|
|
@@ -1,8 +1,12 @@
|
|
|
package limsreportmotor
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/limsentrust"
|
|
|
+ "dashoo.cn/backend/api/business/workflow"
|
|
|
. "dashoo.cn/backend/api/mydb"
|
|
|
+ "dashoo.cn/utils"
|
|
|
"github.com/go-xorm/xorm"
|
|
|
+ "strings"
|
|
|
)
|
|
|
|
|
|
type LimsReportMotorService struct {
|
|
|
@@ -14,3 +18,28 @@ func GetLimsReportMotorService(xormEngine *xorm.Engine) *LimsReportMotorService
|
|
|
s.DBE = xormEngine
|
|
|
return s
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 生成[液压安全阀]报告
|
|
|
+ */
|
|
|
+func (s *LimsReportMotorService) DataToExcelReport(entrustMainEntity limsentrust.LimsEntrustMain, dateentryname string, createreportname string,tablename string, seqStr string, retUrl string, entrustId string, dataentryIds string) (reportUrl string, err error) {
|
|
|
+ var reportList []LimsReportMotor
|
|
|
+ s.GetEntitysByOrderbyWhere(tablename, "DataEntryId in ("+dataentryIds+")", "DataEntryId", &reportList)
|
|
|
+ //模板下载到服务器
|
|
|
+ //_dir := utils.Cfg.MustValue("file", "tmplateDir") + entrustId
|
|
|
+ fileurl := strings.Split(retUrl, "|")
|
|
|
+ templateUrl := "http://" + fileurl[0]
|
|
|
+ fileName := fileurl[1]
|
|
|
+
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ datamap := make(map[string]interface{})
|
|
|
+ datamap["key"] = "val"
|
|
|
+ svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
|
|
|
+
|
|
|
+ //urlArr := strings.Split(template.FileURL, "|")
|
|
|
+ //templateUrl := "http://" + urlArr[0]
|
|
|
+ //fileName := urlArr[1]
|
|
|
+ //DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
|
|
|
+ //err = nil
|
|
|
+ return
|
|
|
+}
|