|
|
@@ -2,6 +2,7 @@ package lims
|
|
|
|
|
|
import (
|
|
|
"dashoo.cn/backend/api/business/limsdrillcollar"
|
|
|
+ "dashoo.cn/backend/api/business/limsentrustequipment"
|
|
|
"dashoo.cn/backend/api/business/limspetroleumpipe"
|
|
|
"dashoo.cn/backend/api/business/limspipedrillpipe"
|
|
|
"dashoo.cn/backend/api/business/limsreportoilpipeultrasonic"
|
|
|
@@ -63,9 +64,9 @@ import (
|
|
|
"dashoo.cn/backend/api/business/limsreportlp"
|
|
|
"dashoo.cn/backend/api/business/limsreportnobeampumpingunits"
|
|
|
|
|
|
+ myorganize "dashoo.cn/backend/api/business/organize"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
"dashoo.cn/utils"
|
|
|
- myorganize "dashoo.cn/backend/api/business/organize"
|
|
|
)
|
|
|
|
|
|
type LimsDataEntryController struct {
|
|
|
@@ -160,8 +161,6 @@ func (this *LimsDataEntryController) GetTaskBalanceFinishList() {
|
|
|
page := this.GetPageInfoForm()
|
|
|
svc := limsdataentry.GetLimsDataEntryService(utils.DBE)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
EntrustNo := this.GetString("EntrustNo")
|
|
|
testDetailId := this.GetString("TestDetailId")
|
|
|
department := this.GetString("department")
|
|
|
@@ -4851,3 +4850,374 @@ func (this *LimsDataEntryController) AddDataEntryFile() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// @Title 获取检测计划的设备列表
|
|
|
+// @Description
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /getentrustequipment [get]
|
|
|
+func (this *LimsDataEntryController) GetEntrustEquipment() {
|
|
|
+
|
|
|
+ eId,_ := strconv.Atoi(this.GetString("EId"))
|
|
|
+ dataEntryId,_ := strconv.Atoi(this.GetString("DataEntryId"))
|
|
|
+ taskBalanceId,_ := strconv.Atoi(this.GetString("TaskBalanceId"))
|
|
|
+ dataDocId := this.GetString("DataDocId")
|
|
|
+ positionCheckId := this.GetString("PositionCheckId")
|
|
|
+
|
|
|
+ svc := limsdataentry.GetLimsDataEntryService(utils.DBE)
|
|
|
+ var entrustmaindata limsdataentry.LimsEntrustMain
|
|
|
+ svce := limsdataentry.GetLimsDataEntryService(utils.DBE)
|
|
|
+ svce.GetEntityByIdBytbl(this.User.AccCode + LimsEntrustMainName, eId, &entrustmaindata)
|
|
|
+
|
|
|
+ var templatedata []limsdataentry.LimsDocTemplateModel
|
|
|
+
|
|
|
+ orderby := "b.Id desc"
|
|
|
+ where2 := " b.Id= " + dataDocId
|
|
|
+ templatedata = svc.GetPagingTemplateSerch(this.User.AccCode+LimsDocTemplateName, this.User.AccCode+LimsDocTemplateDetailName, orderby, where2)
|
|
|
+ templatecode := templatedata[0].TemplateCode
|
|
|
+
|
|
|
+ this.adddataentrydetail(eId, dataEntryId, taskBalanceId, positionCheckId, entrustmaindata.EntrustNo, templatecode, this.User.AccCode)
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (this *LimsDataEntryController) adddataentrydetail(entrustmainId, dataentryid, balanceid int, positionCheckId, entrustNo,templatecode, AccCode string) error {
|
|
|
+ var err error
|
|
|
+ svc := limsdataentry.GetLimsDataEntryService(utils.DBE)
|
|
|
+ var entrustenquipment []limsentrustequipment.LimsEntrustEquipment
|
|
|
+ where := "EntrustNo = '" + entrustNo + "' and PositionCheckId=" + positionCheckId
|
|
|
+ svc.GetEntitysByWhere(AccCode+"LimsEntrustEquipment", where, &entrustenquipment)
|
|
|
+ switch templatecode {
|
|
|
+ case limsdoctemplate.DAYT_ATMOSVALVE_DETAIL:
|
|
|
+ //呼吸阀
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportHuxf", where)
|
|
|
+ for idx, item := range entrustenquipment {
|
|
|
+ var hzf limsreporthuxf.LimsReportHuxf
|
|
|
+ hzf.EId = entrustmainId
|
|
|
+ hzf.TaskBalanceId = balanceid
|
|
|
+ hzf.DataEntryId = dataentryid
|
|
|
+ hzf.OrderNo = idx + 1
|
|
|
+ hzf.CustNo = item.CustNo
|
|
|
+ hzf.Spec = item.Spec
|
|
|
+ hzf.DeviceName = item.DeviceName
|
|
|
+ hzf.DeviceId = item.DeviceId
|
|
|
+ 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:
|
|
|
+ //液压安全阀
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportYeyaqf", where)
|
|
|
+ for idx, item := range entrustenquipment {
|
|
|
+ var yeyaqf limsreportyyaqf.LimsReportYeyaqf
|
|
|
+ yeyaqf.EId = entrustmainId
|
|
|
+ yeyaqf.TaskBalanceId = balanceid
|
|
|
+ yeyaqf.DataEntryId = dataentryid
|
|
|
+ yeyaqf.OrderNo = idx + 1
|
|
|
+ yeyaqf.CustNo = item.CustNo
|
|
|
+ yeyaqf.Spec = item.Spec
|
|
|
+ yeyaqf.DeviceName = item.DeviceName
|
|
|
+ yeyaqf.DeviceId = item.DeviceId
|
|
|
+ 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:
|
|
|
+ //空气泡沫产生器
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportAirFoamGenerator", where)
|
|
|
+ for idx, item := range entrustenquipment {
|
|
|
+ var kqpm limsreportkqpm.LimsReportAirFoamGenerator
|
|
|
+ kqpm.EId = entrustmainId
|
|
|
+ kqpm.TaskBalanceId = balanceid
|
|
|
+ kqpm.DataEntryId = dataentryid
|
|
|
+ kqpm.OrderNo = idx + 1
|
|
|
+ kqpm.CustNo = item.CustNo
|
|
|
+ kqpm.Spec = item.Spec
|
|
|
+ kqpm.DeviceName = item.DeviceName
|
|
|
+ kqpm.DeviceId = item.DeviceId
|
|
|
+ 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:
|
|
|
+ //游梁式抽油机
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportBeamPumpingUnits", where)
|
|
|
+ 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.DeviceName = item.DeviceName
|
|
|
+ yl.DeviceId = item.DeviceId
|
|
|
+ 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:
|
|
|
+ //阻火器
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportZuhq", where)
|
|
|
+ for idx, item := range entrustenquipment {
|
|
|
+ var zuhq Limsreportzuhq.LimsReportZuhq
|
|
|
+ zuhq.EId = entrustmainId
|
|
|
+ zuhq.TaskBalanceId = balanceid
|
|
|
+ zuhq.DataEntryId = dataentryid
|
|
|
+ zuhq.OrderNo = idx + 1
|
|
|
+ zuhq.CustNo = item.CustNo
|
|
|
+ zuhq.Spec = item.Spec
|
|
|
+ zuhq.DeviceName = item.DeviceName
|
|
|
+ zuhq.DeviceId = item.DeviceId
|
|
|
+ zuhq.PositionCheckId = item.PositionCheckId
|
|
|
+ zuhq.VentVolume1 = "0"
|
|
|
+ zuhq.VentVolume2 = "0"
|
|
|
+ zuhq.VentVolume3 = "0"
|
|
|
+ zuhq.VentVolume4 = "0"
|
|
|
+ zuhq.PyPa1 = "0"
|
|
|
+ zuhq.PyPa2 = "0"
|
|
|
+ zuhq.PyPa3 = "0"
|
|
|
+ zuhq.PyPaAvg = "0"
|
|
|
+ zuhq.PwPa1 = "0"
|
|
|
+ zuhq.PwPa2 = "0"
|
|
|
+ zuhq.PwPa3 = "0"
|
|
|
+ zuhq.PwPaAvg = "0"
|
|
|
+ zuhq.PaDiff = "0"
|
|
|
+ zuhq.Position = item.Position
|
|
|
+ zuhq.PositionId = item.PositionID
|
|
|
+ zuhq.CreateOn = time.Now()
|
|
|
+ svc.InsertEntityBytbl(AccCode+"LimsReportZuhq", &zuhq)
|
|
|
+ }
|
|
|
+ case limsdoctemplate.DAYT_NOBEAMPUMPINGUNIT_DETAIL:
|
|
|
+ //无游梁式抽油机
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportNoBeamPumpingUnit", where)
|
|
|
+ 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.DeviceName = item.DeviceName
|
|
|
+ wyl.DeviceId = item.DeviceId
|
|
|
+ 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:
|
|
|
+ //电气接地装置
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportElecGround", where)
|
|
|
+ for i:= 0; i< len(entrustenquipment); i++ {
|
|
|
+ var elegroudmodel limsreportelecground.LimsReportElecGround
|
|
|
+ elegroudmodel.EId = entrustmainId
|
|
|
+ elegroudmodel.TaskBalanceId = balanceid
|
|
|
+ elegroudmodel.DataEntryId = dataentryid
|
|
|
+ elegroudmodel.DeviceId = entrustenquipment[i].DeviceId
|
|
|
+ elegroudmodel.DeviceName = entrustenquipment[i].DeviceName
|
|
|
+ elegroudmodel.OrderNo = i + 1
|
|
|
+ elegroudmodel.PositionCheckId = entrustenquipment[i].PositionCheckId
|
|
|
+ elegroudmodel.PositionCheck = entrustenquipment[i].PositionCheck
|
|
|
+ elegroudmodel.District = entrustenquipment[i].Position
|
|
|
+ elegroudmodel.DistrictId = entrustenquipment[i].PositionID
|
|
|
+ elegroudmodel.Position = entrustenquipment[i].DeviceName
|
|
|
+ elegroudmodel.ResistanceVal = "0"
|
|
|
+ elegroudmodel.CreateOn = time.Now()
|
|
|
+ _, err = svc.InsertEntityBytbl(AccCode+"LimsReportElecGround", &elegroudmodel)
|
|
|
+ }
|
|
|
+ case limsdoctemplate.DAYT_EQUIPOTENT_DETAIL:
|
|
|
+ //防雷装置(等电位)
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportEquipotent", where)
|
|
|
+ for i:= 0; i< len(entrustenquipment); i++ {
|
|
|
+ var equipotentmodel limsreportequipotent.LimsReportEquipotent
|
|
|
+ equipotentmodel.EId = entrustmainId
|
|
|
+ equipotentmodel.TaskBalanceId = balanceid
|
|
|
+ equipotentmodel.DataEntryId = dataentryid
|
|
|
+ equipotentmodel.OrderNo = i + 1
|
|
|
+ equipotentmodel.DeviceId = entrustenquipment[i].DeviceId
|
|
|
+ equipotentmodel.PositionCheckId = entrustenquipment[i].PositionCheckId
|
|
|
+ equipotentmodel.PositionCheck = entrustenquipment[i].PositionCheck
|
|
|
+ equipotentmodel.District = entrustenquipment[i].Position
|
|
|
+ equipotentmodel.DistrictId = entrustenquipment[i].PositionID
|
|
|
+ equipotentmodel.Position = entrustenquipment[i].DeviceName
|
|
|
+ equipotentmodel.ResistanceVal = "0"
|
|
|
+ equipotentmodel.CreateOn = time.Now()
|
|
|
+ _, err = svc.InsertEntityBytbl(AccCode+"LimsReportEquipotent", &equipotentmodel)
|
|
|
+ }
|
|
|
+ case limsdoctemplate.DAYT_LIGHTPROTECT_DETAIL:
|
|
|
+ //防雷装置
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportLightProtect", where)
|
|
|
+ for i:= 0; i< len(entrustenquipment); i++ {
|
|
|
+ var lightprotect limsreportlp.LimsReportLightProtect
|
|
|
+ lightprotect.EId = entrustmainId
|
|
|
+ lightprotect.TaskBalanceId = balanceid
|
|
|
+ lightprotect.DataEntryId = dataentryid
|
|
|
+ lightprotect.OrderNo = i + 1
|
|
|
+ lightprotect.DeviceId = entrustenquipment[i].DeviceId
|
|
|
+ lightprotect.DeviceName = entrustenquipment[i].DeviceName
|
|
|
+ lightprotect.PositionCheckId = entrustenquipment[i].PositionCheckId
|
|
|
+ lightprotect.PositionCheck = entrustenquipment[i].PositionCheck
|
|
|
+ lightprotect.District = entrustenquipment[i].Position
|
|
|
+ lightprotect.DistrictId = entrustenquipment[i].PositionID
|
|
|
+ lightprotect.Position = entrustenquipment[i].DeviceName
|
|
|
+ lightprotect.ResistanceVal = "0"
|
|
|
+ lightprotect.CreateOn = time.Now()
|
|
|
+ _, err = svc.InsertEntityBytbl(AccCode+"LimsReportLightProtect", &lightprotect)
|
|
|
+ }
|
|
|
+ case limsdoctemplate.DAYT_LEAKPROTECT_DETAIL:
|
|
|
+ //漏电保护器
|
|
|
+ where := "DataEntryId=" + strconv.Itoa(dataentryid)
|
|
|
+ svc.DeleteEntityBytbl(AccCode+"LimsReportLeakProtect", where)
|
|
|
+ for i:= 0; i< len(entrustenquipment); i++ {
|
|
|
+ var leakprotect limsreportldbh.LimsReportLeakProtect
|
|
|
+ leakprotect.EId = entrustmainId
|
|
|
+ leakprotect.TaskBalanceId = balanceid
|
|
|
+ leakprotect.DataEntryId = dataentryid
|
|
|
+ leakprotect.OrderNo = i + 1
|
|
|
+ leakprotect.DeviceId = entrustenquipment[i].DeviceId
|
|
|
+ leakprotect.DeviceName = entrustenquipment[i].DeviceName
|
|
|
+ leakprotect.PositionCheckId = entrustenquipment[i].PositionCheckId
|
|
|
+ leakprotect.PositionCheck = entrustenquipment[i].PositionCheck
|
|
|
+ leakprotect.Position = entrustenquipment[i].Position
|
|
|
+ leakprotect.PositionId = entrustenquipment[i].PositionID
|
|
|
+ leakprotect.RemainElectricA = "0"
|
|
|
+ leakprotect.RemainElectricB = "0"
|
|
|
+ leakprotect.RemainElectricC = "0"
|
|
|
+ leakprotect.CreateOn = time.Now()
|
|
|
+ _, err = svc.InsertEntityBytbl(AccCode+"LimsReportLeakProtect", &leakprotect)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return err
|
|
|
+}
|