|
|
@@ -5,6 +5,8 @@ import (
|
|
|
"dashoo.cn/backend/api/business/limsreportliquidtransportation"
|
|
|
"dashoo.cn/backend/api/business/limsreportmotor"
|
|
|
"dashoo.cn/backend/api/business/limsreportpistonpumpunit"
|
|
|
+ "dashoo.cn/backend/api/business/limsreportscrewpump"
|
|
|
+ "dashoo.cn/backend/api/business/limsreportspecialfield"
|
|
|
"encoding/base64"
|
|
|
"encoding/json"
|
|
|
"errors"
|
|
|
@@ -1317,13 +1319,15 @@ func (this *LimsDataEntryController) exportdatatoexcel(fileurl string, dataentry
|
|
|
svc := limsreportliquidtransportation.GetLimsReportLiquidTransportationService(utils.DBE)
|
|
|
where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
|
|
|
has := svc.GetEntityByWhere(this.User.AccCode+LimsReportLiquidTransportationName, where1, &model)
|
|
|
+ datamap := StructToMapDemo(model)
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ var template limsdoctemplate.LimsDocTemplate
|
|
|
+ wheretem := "Id=" + strconv.Itoa(entrustlist[0].DocId)
|
|
|
+ has = svc.GetEntityByWhere(this.User.AccCode+LimsDocTemplateName, wheretem, &template)
|
|
|
if (has) {
|
|
|
- datamap := StructToMapDemo(model)
|
|
|
- svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
- //weed1.labsop.cn:9390/5,185d7c489668|离心泵机组液体输送系统.doc
|
|
|
- // weed1.labsop.cn:9390/1,1866fd6844ea|test.docx
|
|
|
- templateUrl := "http://" + entrustlist[0].DocAddress
|
|
|
- fileName := entrustlist[0].DocName
|
|
|
+ urlArr := strings.Split(template.FileURL, "|")
|
|
|
+ templateUrl := "http://" + urlArr[0]
|
|
|
+ fileName := urlArr[1]
|
|
|
DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
|
|
|
err = nil
|
|
|
} else {
|
|
|
@@ -1395,6 +1399,51 @@ func (this *LimsDataEntryController) exportdatatoexcel(fileurl string, dataentry
|
|
|
DocUrl = ""
|
|
|
err = errors.New("")
|
|
|
}
|
|
|
+ case limsdoctemplate.DAYT_LIMSREPORTSCREWPUMP_DETAIL:
|
|
|
+ // 螺杆泵
|
|
|
+ var model limsreportscrewpump.LimsReportScrewPump
|
|
|
+ svc := limsreportscrewpump.GetLimsReportScrewPumpService(utils.DBE)
|
|
|
+ where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
|
|
|
+ has := svc.GetEntityByWhere(this.User.AccCode+LimsReportScrewPumpName, where1, &model)
|
|
|
+ datamap := StructToMapDemo(model)
|
|
|
+ datamap["CheckDate"] = model.CheckDate.Format("2006年01月02日")
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ var template limsdoctemplate.LimsDocTemplate
|
|
|
+ wheretem := "Id=" + strconv.Itoa(entrustlist[0].DocId)
|
|
|
+ has = svc.GetEntityByWhere(this.User.AccCode+LimsDocTemplateName, wheretem, &template)
|
|
|
+ if (has) {
|
|
|
+ urlArr := strings.Split(template.FileURL, "|")
|
|
|
+ templateUrl := "http://" + urlArr[0]
|
|
|
+ fileName := urlArr[1]
|
|
|
+ DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
|
|
|
+ err = nil
|
|
|
+ } else {
|
|
|
+ DocUrl = ""
|
|
|
+ err = errors.New("")
|
|
|
+ }
|
|
|
+ case limsdoctemplate.DAYT_LIMSREPORTSPECIALFIELD_DETAIL:
|
|
|
+ // 油田专用变压器
|
|
|
+ var model limsreportspecialfield.LimsReportSpecialField
|
|
|
+ svc := limsreportspecialfield.GetLimsReportSpecialFieldService(utils.DBE)
|
|
|
+ where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
|
|
|
+ has := svc.GetEntityByWhere(this.User.AccCode+LimsReportSpecialFieldName, where1, &model)
|
|
|
+ datamap := StructToMapDemo(model)
|
|
|
+ datamap["ProductionDate"] = model.ProductionDate.Format("2006年01月02日")
|
|
|
+ datamap["TestTime"] = model.TestTime.Format("2006年01月02日")
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ var template limsdoctemplate.LimsDocTemplate
|
|
|
+ wheretem := "Id=" + strconv.Itoa(entrustlist[0].DocId)
|
|
|
+ has = svc.GetEntityByWhere(this.User.AccCode+LimsDocTemplateName, wheretem, &template)
|
|
|
+ if (has) {
|
|
|
+ urlArr := strings.Split(template.FileURL, "|")
|
|
|
+ templateUrl := "http://" + urlArr[0]
|
|
|
+ fileName := urlArr[1]
|
|
|
+ DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
|
|
|
+ err = nil
|
|
|
+ } else {
|
|
|
+ DocUrl = ""
|
|
|
+ err = errors.New("")
|
|
|
+ }
|
|
|
}
|
|
|
return DocUrl, err
|
|
|
}
|