|
|
@@ -1,15 +1,21 @@
|
|
|
package limsbalance
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/Limsreportyyaqf"
|
|
|
+ "dashoo.cn/backend/api/business/Limsreportzuhq"
|
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
|
"dashoo.cn/backend/api/business/codecsequence"
|
|
|
"dashoo.cn/backend/api/business/limsdataentry"
|
|
|
"dashoo.cn/backend/api/business/limsdoctemplate"
|
|
|
"dashoo.cn/backend/api/business/limsentrustequipment"
|
|
|
+ "dashoo.cn/backend/api/business/limsreportbeampumpingunits"
|
|
|
+ "dashoo.cn/backend/api/business/limsreporthuxf"
|
|
|
"dashoo.cn/backend/api/business/limsreportelecground"
|
|
|
"dashoo.cn/backend/api/business/limsreportequipotent"
|
|
|
+ "dashoo.cn/backend/api/business/limsreportkqpm"
|
|
|
"dashoo.cn/backend/api/business/limsreportldbh"
|
|
|
"dashoo.cn/backend/api/business/limsreportlp"
|
|
|
+ "dashoo.cn/backend/api/business/limsreportnobeampumpingunits"
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
"time"
|
|
|
|
|
|
@@ -296,27 +302,219 @@ func (this *LimsBalanceService) adddataentrydetail(entrustmainId, dataentryid, b
|
|
|
var err error
|
|
|
svc := limsdataentry.GetLimsDataEntryService(utils.DBE)
|
|
|
var entrustenquipment []limsentrustequipment.LimsEntrustEquipment
|
|
|
- where := "EntrustMainId = " +utils.ToStr(entrustmainId)
|
|
|
- svc.GetEntitysByWhere(AccCode+"LimsEntrustEquipment",where, &entrustenquipment)
|
|
|
+ where := "EntrustMainId = " + utils.ToStr(entrustmainId)
|
|
|
+ svc.GetEntitysByWhere(AccCode+"LimsEntrustEquipment", where, &entrustenquipment)
|
|
|
switch templatecode {
|
|
|
case limsdoctemplate.DAYT_ATMOSVALVE_DETAIL:
|
|
|
//呼吸阀
|
|
|
+ for _, item := range entrustenquipment {
|
|
|
+ var hzf limsreporthuxf.LimsReportHuxf
|
|
|
+ hzf.EId = entrustmainId
|
|
|
+ hzf.TaskBalanceId = balanceid
|
|
|
+ hzf.DataEntryId = dataentryid
|
|
|
+ hzf.OrderNo = item.OrderNo
|
|
|
+ hzf.CustNo = item.CustNo
|
|
|
+ hzf.Spec = item.Spec
|
|
|
+ hzf.Position = item.Position
|
|
|
+ hzf.PositionId = item.PositionID
|
|
|
+ hzf.PosPress1 = "0"
|
|
|
+ hzf.PosPress2 = "0"
|
|
|
+ hzf.PosPress3 = "0"
|
|
|
+ hzf.PosPress4 = "0"
|
|
|
+ hzf.PosPress5 = "0"
|
|
|
+ hzf.PosPress6 = "0"
|
|
|
+ hzf.PosPress7 = "0"
|
|
|
+ hzf.PosPress8 = "0"
|
|
|
+ hzf.PosPress9 = "0"
|
|
|
+ hzf.NgPress1 = "0"
|
|
|
+ hzf.NgPress2 = "0"
|
|
|
+ hzf.NgPress3 = "0"
|
|
|
+ hzf.NgPress4 = "0"
|
|
|
+ hzf.NgPress5 = "0"
|
|
|
+ hzf.NgPress6 = "0"
|
|
|
+ hzf.NgPress7 = "0"
|
|
|
+ hzf.NgPress8 = "0"
|
|
|
+ hzf.NgPress9 = "0"
|
|
|
+ hzf.NgPressAvg = "0"
|
|
|
+ hzf.NgBaseNum1 = 0
|
|
|
+ hzf.NgBaseNum2 = 0
|
|
|
+ hzf.NgBaseNum3 = 0
|
|
|
+ hzf.NgBaseNum4 = 0
|
|
|
+ hzf.NgBaseNum5 = 0
|
|
|
+ hzf.NgBaseNum6 = 0
|
|
|
+ hzf.NgBaseNum7 = 0
|
|
|
+ hzf.NgBaseNum8 = 0
|
|
|
+ hzf.NgBaseNum9 = 0
|
|
|
+ hzf.NgCloud1 = "0"
|
|
|
+ hzf.NgCloud2 = "0"
|
|
|
+ hzf.NgCloud3 = "0"
|
|
|
+ hzf.NgCloudAvg = "0"
|
|
|
+ hzf.PosPa1 = "0"
|
|
|
+ hzf.PosPa2 = "0"
|
|
|
+ hzf.PosPa3 = "0"
|
|
|
+ hzf.PosPaAvg = "0"
|
|
|
+ hzf.NgPa1 = "0"
|
|
|
+ hzf.NgPa2 = "0"
|
|
|
+ hzf.NgPa3 = "0"
|
|
|
+ hzf.NgPaAvg = "0"
|
|
|
+ hzf.PosPressAvg = "0"
|
|
|
+ hzf.PosCloud1 = "0"
|
|
|
+ hzf.PosCloud2 = "0"
|
|
|
+ hzf.PosCloud3 = "0"
|
|
|
+ hzf.PosCloudAvg = "0"
|
|
|
+ hzf.OperPress1 = "0"
|
|
|
+ hzf.OperPress2 = "0"
|
|
|
+ hzf.OperPress3 = "0"
|
|
|
+ hzf.OperPressAvg = "0"
|
|
|
+ hzf.OperPressNg1 = "0"
|
|
|
+ hzf.OperPressNg2 = "0"
|
|
|
+ hzf.OperPressNg3 = "0"
|
|
|
+ hzf.OperPressNgAvg = "0"
|
|
|
+ hzf.PosBaseNum1 = 0
|
|
|
+ hzf.PosBaseNum2 = 0
|
|
|
+ hzf.PosBaseNum3 = 0
|
|
|
+ hzf.PosBaseNum4 = 0
|
|
|
+ hzf.PosBaseNum5 = 0
|
|
|
+ hzf.PosBaseNum6 = 0
|
|
|
+ hzf.PosBaseNum7 = 0
|
|
|
+ hzf.PosBaseNum8 = 0
|
|
|
+ hzf.PosBaseNum9 = 0
|
|
|
+ hzf.PosPressStart = "0"
|
|
|
+ hzf.PosPressEnd = "0"
|
|
|
+ hzf.NgPressStart = "0"
|
|
|
+ hzf.NgPressEnd = "0"
|
|
|
+ hzf.CreateOn = time.Now()
|
|
|
+ svc.InsertEntityBytbl(AccCode+"LimsReportHuxf", &hzf)
|
|
|
+ }
|
|
|
|
|
|
case limsdoctemplate.DAYT_HYDRAULICSAFE_DETAIL:
|
|
|
//液压安全阀
|
|
|
-
|
|
|
+ for _, item := range entrustenquipment {
|
|
|
+ var yeyaqf limsreportyyaqf.LimsReportYeyaqf
|
|
|
+ yeyaqf.EId = entrustmainId
|
|
|
+ yeyaqf.TaskBalanceId = balanceid
|
|
|
+ yeyaqf.DataEntryId = dataentryid
|
|
|
+ yeyaqf.OrderNo = item.OrderNo
|
|
|
+ yeyaqf.CustNo = item.CustNo
|
|
|
+ yeyaqf.Spec = item.Spec
|
|
|
+ yeyaqf.Position = item.Position
|
|
|
+ yeyaqf.PositionId = item.PositionID
|
|
|
+ yeyaqf.PosPress1 = "0"
|
|
|
+ yeyaqf.PosPress2 = "0"
|
|
|
+ yeyaqf.PosPress3 = "0"
|
|
|
+ yeyaqf.NgPress1 = "0"
|
|
|
+ yeyaqf.NgPress2 = "0"
|
|
|
+ yeyaqf.NgPress3 = "0"
|
|
|
+ yeyaqf.NgPressAvg = "0"
|
|
|
+ yeyaqf.NgBaseNum1 = 0
|
|
|
+ yeyaqf.NgBaseNum2 = 0
|
|
|
+ yeyaqf.NgBaseNum3 = 0
|
|
|
+ yeyaqf.NgCloud1 = "0"
|
|
|
+ yeyaqf.NgCloud2 = "0"
|
|
|
+ yeyaqf.NgCloud3 = "0"
|
|
|
+ yeyaqf.NgCloudAvg = "0"
|
|
|
+ yeyaqf.PosPressAvg = "0"
|
|
|
+ yeyaqf.PosCloud1 = "0"
|
|
|
+ yeyaqf.PosCloud2 = "0"
|
|
|
+ yeyaqf.PosCloud3 = "0"
|
|
|
+ yeyaqf.PosCloudAvg = "0"
|
|
|
+ yeyaqf.PosBaseNum1 = 0
|
|
|
+ yeyaqf.PosBaseNum2 = 0
|
|
|
+ yeyaqf.PosBaseNum3 = 0
|
|
|
+ yeyaqf.CreateOn = time.Now()
|
|
|
+ svc.InsertEntityBytbl(AccCode+"LimsReportYeyaqf", &yeyaqf)
|
|
|
+ }
|
|
|
case limsdoctemplate.DAYT_AIRFOAMGENERATOR_DETAIL:
|
|
|
//空气泡沫产生器
|
|
|
-
|
|
|
+ for _, item := range entrustenquipment {
|
|
|
+ var kqpm limsreportkqpm.LimsReportAirFoamGenerator
|
|
|
+ kqpm.EId = entrustmainId
|
|
|
+ kqpm.TaskBalanceId = balanceid
|
|
|
+ kqpm.DataEntryId = dataentryid
|
|
|
+ kqpm.OrderNo = item.OrderNo
|
|
|
+ kqpm.CustNo = item.CustNo
|
|
|
+ kqpm.Spec = item.Spec
|
|
|
+ kqpm.Position = item.Position
|
|
|
+ kqpm.PositionId = item.PositionID
|
|
|
+ kqpm.CreateOn = time.Now()
|
|
|
+ kqpm.PosPress = "0"
|
|
|
+ kqpm.PosGlass = "0"
|
|
|
+ svc.InsertEntityBytbl(AccCode+"LimsReportAirFoamGenerator", &kqpm)
|
|
|
+ }
|
|
|
case limsdoctemplate.DAYT_BEAMPUMPINGUNIT_DETAIL:
|
|
|
//游梁式抽油机
|
|
|
-
|
|
|
+ for _, item := range entrustenquipment {
|
|
|
+ var yl limsreportbeampumpingunits.LimsReportBeamPumpingUnits
|
|
|
+ yl.EId = entrustmainId
|
|
|
+ yl.TaskBalanceId = balanceid
|
|
|
+ yl.DataEntryId = dataentryid
|
|
|
+ yl.CustNo = item.CustNo
|
|
|
+ yl.Spec = item.Spec
|
|
|
+ yl.Position = item.Position
|
|
|
+ yl.PositionId = item.PositionID
|
|
|
+ yl.CreateOn = time.Now()
|
|
|
+ yl.Temperature = "0"
|
|
|
+ yl.RetarderTemp = "0"
|
|
|
+ yl.MachineNoise1 = "0"
|
|
|
+ yl.MachineNoise2 = "0"
|
|
|
+ yl.MachineNoise3 = "0"
|
|
|
+ yl.DownX = "0"
|
|
|
+ yl.MidDownX = "0"
|
|
|
+ yl.MiddleX = "0"
|
|
|
+ yl.MidUpX = "0"
|
|
|
+ yl.UpX = "0"
|
|
|
+ yl.DownY = "0"
|
|
|
+ yl.MidDownY = "0"
|
|
|
+ yl.MiddleY = "0"
|
|
|
+ yl.MidUpY = "0"
|
|
|
+ yl.UpY = "0"
|
|
|
+ svc.InsertEntityBytbl(AccCode+"LimsReportBeamPumpingUnits", &yl)
|
|
|
+ }
|
|
|
case limsdoctemplate.DAYT_ZUHQ_DETAIL:
|
|
|
//阻火器
|
|
|
-
|
|
|
+ for _, item := range entrustenquipment {
|
|
|
+ var zuhq Limsreportzuhq.LimsReportZuhq
|
|
|
+ zuhq.EId = entrustmainId
|
|
|
+ zuhq.TaskBalanceId = balanceid
|
|
|
+ zuhq.DataEntryId = dataentryid
|
|
|
+ zuhq.OrderNo = item.OrderNo
|
|
|
+ zuhq.CustNo = item.CustNo
|
|
|
+ zuhq.Spec = item.Spec
|
|
|
+ zuhq.Position = item.Position
|
|
|
+ zuhq.PositionId = item.PositionID
|
|
|
+ zuhq.CreateOn = time.Now()
|
|
|
+ svc.InsertEntityBytbl(AccCode+"LimsReportZuhq", &zuhq)
|
|
|
+ }
|
|
|
case limsdoctemplate.DAYT_NOBEAMPUMPINGUNIT_DETAIL:
|
|
|
//无游梁式抽油机
|
|
|
-
|
|
|
+ for _, item := range entrustenquipment {
|
|
|
+ var wyl limsreportnobeampumpingunits.LimsReportNoBeamPumpingUnit
|
|
|
+ wyl.EId = entrustmainId
|
|
|
+ wyl.TaskBalanceId = balanceid
|
|
|
+ wyl.DataEntryId = dataentryid
|
|
|
+ wyl.OrderNo = strconv.Itoa(item.OrderNo)
|
|
|
+ wyl.CustNo = item.CustNo
|
|
|
+ wyl.Spec = item.Spec
|
|
|
+ wyl.Position = item.Position
|
|
|
+ wyl.PositionId = item.PositionID
|
|
|
+ wyl.CreateOn = time.Now()
|
|
|
+ wyl.Temperature = "0"
|
|
|
+ wyl.RetarderTemp = "0"
|
|
|
+ wyl.MachineNoise1 = "0"
|
|
|
+ wyl.MachineNoise2 = "0"
|
|
|
+ wyl.MachineNoise3 = "0"
|
|
|
+ wyl.DownX = "0"
|
|
|
+ wyl.MidDownX = "0"
|
|
|
+ wyl.MiddleX = "0"
|
|
|
+ wyl.MidUpX = "0"
|
|
|
+ wyl.UpX = "0"
|
|
|
+ wyl.DownY = "0"
|
|
|
+ wyl.MidDownY = "0"
|
|
|
+ wyl.MiddleY = "0"
|
|
|
+ wyl.MidUpY = "0"
|
|
|
+ wyl.UpY = "0"
|
|
|
+ svc.InsertEntityBytbl(AccCode+"LimsReportNoBeamPumpingUnit", &wyl)
|
|
|
+ }
|
|
|
case limsdoctemplate.DAYT_ELECGROUND_DETAIL:
|
|
|
//电气接地装置
|
|
|
for i:= 0; i< len(entrustenquipment); i++ {
|
|
|
@@ -388,4 +586,4 @@ func (this *LimsBalanceService) adddataentrydetail(entrustmainId, dataentryid, b
|
|
|
}
|
|
|
}
|
|
|
return err
|
|
|
-}
|
|
|
+}
|