|
|
@@ -1,7 +1,9 @@
|
|
|
package lims
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/limsreportelecpumpwell"
|
|
|
"dashoo.cn/backend/api/business/limsreportliquidtransportation"
|
|
|
+ "dashoo.cn/backend/api/business/limsreportmotor"
|
|
|
"dashoo.cn/backend/api/business/limsreportpistonpumpunit"
|
|
|
"encoding/base64"
|
|
|
"encoding/json"
|
|
|
@@ -1350,6 +1352,49 @@ func (this *LimsDataEntryController) exportdatatoexcel(fileurl string, dataentry
|
|
|
DocUrl = ""
|
|
|
err = errors.New("")
|
|
|
}
|
|
|
+ case limsdoctemplate.DAYT_LIMSREPORTMOTOR_DETAIL:
|
|
|
+ // 电动机
|
|
|
+ var model limsreportmotor.LimsReportMotor
|
|
|
+ svc := limsreportmotor.GetLimsReportMotorService(utils.DBE)
|
|
|
+ where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
|
|
|
+ has := svc.GetEntityByWhere(this.User.AccCode+LimsReportMotorName, 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) {
|
|
|
+ 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_LIMSREPORTELECPUMPWELL_DETAIL:
|
|
|
+ // 电动机
|
|
|
+ var model limsreportelecpumpwell.LimsReportElecPumpWell
|
|
|
+ svc := limsreportelecpumpwell.GetLimsReportElecPumpWellService(utils.DBE)
|
|
|
+ where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
|
|
|
+ has := svc.GetEntityByWhere(this.User.AccCode+LimsReportElecPumpWellName, 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("")
|
|
|
+ }
|
|
|
}
|
|
|
return DocUrl, err
|
|
|
}
|