Parcourir la source

加热炉报告

lining il y a 6 ans
Parent
commit
9b8724820f

+ 34 - 2
src/dashoo.cn/backend/api/business/codecsequence/codecsequenceService.go

@@ -453,14 +453,22 @@ func (s *CodecSequenceService)GetReportMotor(accCode string) string{
 	return seqStr
 }
 
-//电泵井
+//电泵井监测报告
 func (s *CodecSequenceService)GetReportElecPumpWell(accCode string) string{
 	seqName := "ElecPumpWellReport"
 	sequence := s.GetSequenceByName(accCode, seqName)
+	seqStr := "J能QC2.1"+ strconv.Itoa(time.Now().Year()) + "-" + fmt.Sprintf("%03s", strconv.Itoa(sequence))
+	return seqStr
+}
+//电泵井计算报告
+func (s *CodecSequenceService)GetReportElecPumpWellJS(accCode string) string{
+	seqName := "ElecPumpWellReportJS"
+	sequence := s.GetSequenceByName(accCode, seqName)
 	seqStr := "J能QC2.2-"+ strconv.Itoa(time.Now().Year()) + "-" + fmt.Sprintf("%03s", strconv.Itoa(sequence))
 	return seqStr
 }
 
+
 //柱塞泵机组
 func (s *CodecSequenceService)GetReportPistonPumpUnit(accCode string) string{
 	seqName := "PistonPumpUnitReport"
@@ -499,4 +507,28 @@ func (s *CodecSequenceService)GetReportHeatingFurnaceJS(accCode string) string{
 	sequence := s.GetSequenceByName(accCode, seqName)
 	seqStr := "J能QL3.2-"+ strconv.Itoa(time.Now().Year()) + "-" + fmt.Sprintf("%03s", strconv.Itoa(sequence))
 	return seqStr
-}
+}
+
+// 电动机数据录入
+func (s *CodecSequenceService)GetDetailMotor(accCode string) string{
+	seqName := "DetailMotor"
+	sequence := s.GetSequenceByName(accCode, seqName)
+	seqStr := "J能Q D1.3—"+ strconv.Itoa(time.Now().Year()) + "-" + fmt.Sprintf("%03s", strconv.Itoa(sequence))
+	return seqStr
+}
+
+// 电泵井数据录入
+func (s *CodecSequenceService)GetDetailElecPumpWell(accCode string) string{
+	seqName := "DetailElecPumpWell"
+	sequence := s.GetSequenceByName(accCode, seqName)
+	seqStr := "J能Q C2.3—"+ strconv.Itoa(time.Now().Year()) + "-" + fmt.Sprintf("%03s", strconv.Itoa(sequence))
+	return seqStr
+}
+
+// 电泵井数据录入
+func (s *CodecSequenceService)GetDetailPistonPumpUnit(accCode string) string{
+	seqName := "DetailPistonPumpUnit"
+	sequence := s.GetSequenceByName(accCode, seqName)
+	seqStr := "J能Q	P2.3—"+ strconv.Itoa(time.Now().Year()) + "-" + fmt.Sprintf("%03s", strconv.Itoa(sequence))
+	return seqStr
+}

+ 9 - 0
src/dashoo.cn/backend/api/business/limsbalance/limsbalanceService.go

@@ -231,6 +231,15 @@ func (this *LimsBalanceService) CreateDataentry(AccCode string, UserNames string
 	case limsdoctemplate.DAYT_DRILLCOLLAR_DETAIL:
 		//钻铤检测记录
 		seqStr = codecSvc.GetDetailDrillCollarSequence(AccCode)
+	case limsdoctemplate.DAYT_LIMSREPORTMOTOR_DETAIL:
+		//电动机数据录入
+		seqStr = codecSvc.GetDetailMotor(AccCode)
+	case limsdoctemplate.DAYT_LIMSREPORTELECPUMPWELL_DETAIL:
+		//电泵井数据录入
+		seqStr = codecSvc.GetDetailElecPumpWell(AccCode)
+	case limsdoctemplate.DAYT_REPORTPISTONPUMPUNIT_DETAIL:
+		//柱塞泵机组数据录入
+		seqStr = codecSvc.GetDetailPistonPumpUnit(AccCode)
 	}
 	//根据分配人员创建多条数据录入记录
 	ConUserIdList := strings.Split(balancedata.ConUserId, ",")

+ 9 - 9
src/dashoo.cn/backend/api/business/limsreportelecpumpwell/limsreportelecpumpwellService.go

@@ -24,7 +24,7 @@ func GetLimsReportElecPumpWellService(xormEngine *xorm.Engine) *LimsReportElecPu
 /**
  * 生成报告
  */
-func (s *LimsReportElecPumpWellService) DataToExcelReport(entrustMainEntity limsentrust.LimsEntrustMain, dateentryname string, createreportname string,tablename string, seqStr string, retUrl string, entrustId string, dataentryIds string) (reportUrl string, err error) {
+func (s *LimsReportElecPumpWellService) DataToExcelReport(entrustMainEntity limsentrust.LimsEntrustMain, dateentryname string, createreportname string,tablename string, seqStr string, seqStrJS string, retUrl string, entrustId string, dataentryIds string) (reportUrl string, err error) {
 	var reportList []LimsReportElecPumpWell
 	s.GetEntitysByOrderbyWhere(tablename, "DataEntryId in ("+dataentryIds+")", "DataEntryId", &reportList)
 	//模板下载到服务器
@@ -78,18 +78,18 @@ func (s *LimsReportElecPumpWellService) DataToExcelReport(entrustMainEntity lims
 	datamap["cosphi"] = cosphi
 	datamap["lb"] = lb
 	datamap["qe"] = qe
-	datamap["h"] = cosphi
+	datamap["h"] = h
 	datamap["etaxt"] = etaxt
 
 	if (etaxt >= limitval1) {
-		datamap["result1"] = "合格"
+		datamap["res1"] = "合格"
 	} else {
-		datamap["result1"] = "不合格"
+		datamap["res1"] = "不合格"
 	}
 	if (cosphi >= limitval2) {
-		datamap["result2"] = "合格"
+		datamap["res2"] = "合格"
 	} else {
-		datamap["result2"] = "不合格"
+		datamap["res2"] = "不合格"
 	}
 
 
@@ -101,9 +101,9 @@ func (s *LimsReportElecPumpWellService) DataToExcelReport(entrustMainEntity lims
 	//datamap["number"] = reportList[0].DeviceName
 	datamap["place"] = reportList[0].PositionCheck
 	datamap["instr"] = reportList[0].MonitoringInstrument
-	datamap["evalva1"] = 35
-	datamap["limitval1"] = limitval1
-	datamap["limitval2"] = limitval2
+	datamap["rd"] = reportList[0].RatedPower // 额定功率
+	datamap["codeJS"] = seqStrJS
+
 	reportUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
 
 	return  reportUrl, err

+ 11 - 11
src/dashoo.cn/backend/api/business/limsreportmotor/limsreportmotorService.go

@@ -46,16 +46,16 @@ func (s *LimsReportMotorService) DataToExcelReport(entrustMainEntity limsentrust
 	cosN := float64(reportList[0].RatedPowerFactor) //额定功率因数
 	cosphi := float64(reportList[0].PowerFactor) //电机功率因数
 
-	deltaPn,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", (1/etaN-1)*pn),64) // 额定负载有功损耗
-	qn,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", pn/etaN*(math.Sqrt(1-cosN*cosN)/cosN)), 64) //额定负载时无功功率
-	qo,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", math.Sqrt(3*math.Pow(u*i,2)* math.Pow(10,-6)-math.Pow(po,2))), 64) // 空载无功功率
-	deltaPcn,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", deltaPn+kQ*qn),64) // 额定综合功率损耗
-	beta,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", (-pn/2+math.Sqrt(math.Pow(pn,2)/4+(deltaPn-po)*(p1-po)))/(deltaPn-po)),64) // 运行负载系数
-	deltaPc,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", po+math.Pow(beta,2)*(deltaPn-po)+kQ*qo+kQ*math.Pow(beta,2)*(qn-qo)),64) //综合功率损耗
-	etac,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", beta*pn/(beta*pn+deltaPc)), 64) // 综合效率
-	etacN,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", pn/(pn+deltaPcn)), 64) // 额定综合效率
-	eta1c,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", etacN*0.6), 64) // 运行综合效率
-	eta,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", beta*pn/p1), 64) // 电机效率
+	deltaPn,err := strconv.ParseFloat(fmt.Sprintf("%.3f", (1/etaN-1)*pn),64) // 额定负载有功损耗
+	qn,err := strconv.ParseFloat(fmt.Sprintf("%.3f", pn/etaN*(math.Sqrt(1-cosN*cosN)/cosN)), 64) //额定负载时无功功率
+	qo,err := strconv.ParseFloat(fmt.Sprintf("%.3f", math.Sqrt(3*math.Pow(u*i,2)* math.Pow(10,-6)-math.Pow(po,2))), 64) // 空载无功功率
+	deltaPcn,err := strconv.ParseFloat(fmt.Sprintf("%.3f", deltaPn+kQ*qn),64) // 额定综合功率损耗
+	beta,err := strconv.ParseFloat(fmt.Sprintf("%.3f", (-pn/2+math.Sqrt(math.Pow(pn,2)/4+(deltaPn-po)*(p1-po)))/(deltaPn-po)),64) // 运行负载系数
+	deltaPc,err := strconv.ParseFloat(fmt.Sprintf("%.3f", po+math.Pow(beta,2)*(deltaPn-po)+kQ*qo+kQ*math.Pow(beta,2)*(qn-qo)),64) //综合功率损耗
+	etac,err := strconv.ParseFloat(fmt.Sprintf("%.3f", beta*pn/(beta*pn+deltaPc)), 64) // 综合效率
+	etacN,err := strconv.ParseFloat(fmt.Sprintf("%.3f", pn/(pn+deltaPcn)), 64) // 额定综合效率
+	eta1c,err := strconv.ParseFloat(fmt.Sprintf("%.3f", etacN*0.6), 64) // 运行综合效率
+	eta,err := strconv.ParseFloat(fmt.Sprintf("%.3f", beta*pn/p1), 64) // 电机效率
 	// 电机功率因数
 	//fmt.Println(math.Pow(u*i,2), math.Pow(po,2))
 	//fmt.Println(etac, eta1c, eta)
@@ -103,6 +103,6 @@ func (s *LimsReportMotorService) DataToExcelReport(entrustMainEntity limsentrust
 	//templateUrl := "http://" + urlArr[0]
 	//fileName := urlArr[1]
 	//DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
-	err = nil
+
 	return  reportUrl, err
 }

+ 2 - 3
src/dashoo.cn/backend/api/controllers/lims/limscreatereport.go

@@ -988,16 +988,15 @@ func (this *CreateReportController) generateExcelReportN(entrustMain limsentrust
 	case limsdoctemplate.DAYT_LIMSREPORTMOTOR_REPORT:
 		codecSvc := codecsequence.GetCodecSequenceService(utils.DBE)
 		seqStr := codecSvc.GetReportMotor(this.User.AccCode)
-		fmt.Println(time.Now().Month())
 		svc := limsreportmotor.GetLimsReportMotorService(utils.DBE)
 		reportUrl, err = svc.DataToExcelReport(entrustMain, this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsCreateReportName, this.User.AccCode+LimsReportMotorName, seqStr, docTemplate.FileURL, entrustId, dataentryIds)
 		// 电泵
 	case limsdoctemplate.DAYT_LIMSREPORTELECPUMPWELL_REPORT:
 		codecSvc := codecsequence.GetCodecSequenceService(utils.DBE)
 		seqStr := codecSvc.GetReportElecPumpWell(this.User.AccCode)
-		fmt.Println(time.Now().Month())
+		seqStrJS := codecSvc.GetReportElecPumpWellJS(this.User.AccCode)
 		svc := limsreportelecpumpwell.GetLimsReportElecPumpWellService(utils.DBE)
-		reportUrl, err = svc.DataToExcelReport(entrustMain, this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsCreateReportName, this.User.AccCode+LimsReportElecPumpWellName, seqStr, docTemplate.FileURL, entrustId, dataentryIds)
+		reportUrl, err = svc.DataToExcelReport(entrustMain, this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsCreateReportName, this.User.AccCode+LimsReportElecPumpWellName, seqStr, seqStrJS,docTemplate.FileURL, entrustId, dataentryIds)
 	case limsdoctemplate.DAYT_REPORTPISTONPUMPUNIT_REPORT:
 		codecSvc := codecsequence.GetCodecSequenceService(utils.DBE)
 		seqStr := codecSvc.GetReportPistonPumpUnit(this.User.AccCode)

+ 13 - 60
src/dashoo.cn/backend/api/controllers/lims/limsreportelecpumpwell.go

@@ -1,14 +1,15 @@
 package lims
 
 import (
-"dashoo.cn/business2/userRole"
-"dashoo.cn/backend/api/business/baseUser"
-"dashoo.cn/backend/api/business/limsreportelecpumpwell"
-. "dashoo.cn/backend/api/controllers"
-"dashoo.cn/utils"
-"encoding/json"
-"strings"
-"time"
+	"dashoo.cn/backend/api/business/baseUser"
+	svccustomer "dashoo.cn/backend/api/business/customer"
+	"dashoo.cn/backend/api/business/limsreportelecpumpwell"
+	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/business2/userRole"
+	"dashoo.cn/utils"
+	"encoding/json"
+	"strings"
+	"time"
 )
 
 type LimsReportElecPumpWellController struct {
@@ -85,232 +86,186 @@ func (this *LimsReportElecPumpWellController) GetEntityList() {
 		where = where + " and Id like '%" + Id + "%'"
 	}
 
-
 	if EId != "" {
 		where = where + " and EId like '%" + EId + "%'"
 	}
 
-
 	if TaskBalanceId != "" {
 		where = where + " and TaskBalanceId like '%" + TaskBalanceId + "%'"
 	}
 
-
 	if DataEntryId != "" {
 		where = where + " and DataEntryId like '%" + DataEntryId + "%'"
 	}
 
-
 	if TestDepartId != "" {
 		where = where + " and TestDepartId like '%" + TestDepartId + "%'"
 	}
 
-
 	if PositionCheckId != "" {
 		where = where + " and PositionCheckId like '%" + PositionCheckId + "%'"
 	}
 
-
 	if TestDepart != "" {
 		where = where + " and TestDepart like '%" + TestDepart + "%'"
 	}
 
-
 	if PositionCheck != "" {
 		where = where + " and PositionCheck like '%" + PositionCheck + "%'"
 	}
 
-
 	if WellNumber != "" {
 		where = where + " and WellNumber like '%" + WellNumber + "%'"
 	}
 
-
 	if CheckDate != "" {
 		where = where + " and CheckDate like '%" + CheckDate + "%'"
 	}
 
-
 	if PumpModel != "" {
 		where = where + " and PumpModel like '%" + PumpModel + "%'"
 	}
 
-
 	if RatedPower != "" {
 		where = where + " and RatedPower like '%" + RatedPower + "%'"
 	}
 
-
 	if RatedDischarge != "" {
 		where = where + " and RatedDischarge like '%" + RatedDischarge + "%'"
 	}
 
-
 	if RatedLift != "" {
 		where = where + " and RatedLift like '%" + RatedLift + "%'"
 	}
 
-
 	if RatedVoltage != "" {
 		where = where + " and RatedVoltage like '%" + RatedVoltage + "%'"
 	}
 
-
 	if RatedCurrent != "" {
 		where = where + " and RatedCurrent like '%" + RatedCurrent + "%'"
 	}
 
-
 	if PumpDepth != "" {
 		where = where + " and PumpDepth like '%" + PumpDepth + "%'"
 	}
 
-
 	if Manufacturer != "" {
 		where = where + " and Manufacturer like '%" + Manufacturer + "%'"
 	}
 
-
 	if AvgVoltage != "" {
 		where = where + " and AvgVoltage like '%" + AvgVoltage + "%'"
 	}
 
-
 	if AvgCurrent != "" {
 		where = where + " and AvgCurrent like '%" + AvgCurrent + "%'"
 	}
 
-
 	if AvgActivePower != "" {
 		where = where + " and AvgActivePower like '%" + AvgActivePower + "%'"
 	}
 
-
 	if AvgReactivePower != "" {
 		where = where + " and AvgReactivePower like '%" + AvgReactivePower + "%'"
 	}
 
-
 	if AvgPowerFactor != "" {
 		where = where + " and AvgPowerFactor like '%" + AvgPowerFactor + "%'"
 	}
 
-
 	if BackPressure != "" {
 		where = where + " and BackPressure like '%" + BackPressure + "%'"
 	}
 
-
 	if OilPressure != "" {
 		where = where + " and OilPressure like '%" + OilPressure + "%'"
 	}
 
-
 	if CasingPressure != "" {
 		where = where + " and CasingPressure like '%" + CasingPressure + "%'"
 	}
 
-
 	if ProducedFluidVolume != "" {
 		where = where + " and ProducedFluidVolume like '%" + ProducedFluidVolume + "%'"
 	}
 
-
 	if WaterContent != "" {
 		where = where + " and WaterContent like '%" + WaterContent + "%'"
 	}
 
-
 	if CrudeOilDensity != "" {
 		where = where + " and CrudeOilDensity like '%" + CrudeOilDensity + "%'"
 	}
 
-
 	if WorkingFluidLevel != "" {
 		where = where + " and WorkingFluidLevel like '%" + WorkingFluidLevel + "%'"
 	}
 
-
 	if SuctionDepth != "" {
 		where = where + " and SuctionDepth like '%" + SuctionDepth + "%'"
 	}
 
-
 	if StraightOrslope != "" {
 		where = where + " and StraightOrslope like '%" + StraightOrslope + "%'"
 	}
 
-
 	if OilFieldType != "" {
 		where = where + " and OilFieldType like '%" + OilFieldType + "%'"
 	}
 
-
 	if Standard != "" {
 		where = where + " and Standard like '%" + Standard + "%'"
 	}
 
-
 	if MonitoringInstrument != "" {
 		where = where + " and MonitoringInstrument like '%" + MonitoringInstrument + "%'"
 	}
 
-
 	if Temperature != "" {
 		where = where + " and Temperature like '%" + Temperature + "%'"
 	}
 
-
 	if Humidity != "" {
 		where = where + " and Humidity like '%" + Humidity + "%'"
 	}
 
-
 	if BeforeCheck != "" {
 		where = where + " and BeforeCheck like '%" + BeforeCheck + "%'"
 	}
 
-
 	if AfterCheck != "" {
 		where = where + " and AfterCheck like '%" + AfterCheck + "%'"
 	}
 
-
 	if Remark != "" {
 		where = where + " and Remark like '%" + Remark + "%'"
 	}
 
-
 	if CreateUserId != "" {
 		where = where + " and CreateUserId like '%" + CreateUserId + "%'"
 	}
 
-
 	if CreateOn != "" {
 		where = where + " and CreateOn like '%" + CreateOn + "%'"
 	}
 
-
 	if CreateBy != "" {
 		where = where + " and CreateBy like '%" + CreateBy + "%'"
 	}
 
-
 	if ModifiedOn != "" {
 		where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
 	}
 
-
 	if ModifiedUserId != "" {
 		where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
 	}
 
-
 	if ModifiedBy != "" {
 		where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
 	}
 
-
 	if CreateOn != "" {
 		dates := strings.Split(CreateOn, ",")
 		if len(dates) == 2 {
@@ -340,15 +295,15 @@ func (this *LimsReportElecPumpWellController) GetDictList() {
 	dictList := make(map[string]interface{})
 	//dictSvc := items.GetItemsService(utils.DBE)
 	userSvc := baseUser.GetBaseUserService(utils.DBE)
-	//customerSvc := svccustomer.GetCustomerService(utils.DBE)
+	customerSvc := svccustomer.GetCustomerService(utils.DBE)
 	//dictList["WellNo"] = dictSvc.GetKeyValueItems("WellNo", this.User.AccCode)
 	var userEntity userRole.Base_User
 	userSvc.GetEntityById(this.User.Id, &userEntity)
 	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
 
-	//var dictCustomer []svccustomer.Customer
-	//customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
-	//dictList["EntrustCorp"] = &dictCustomer
+	var dictCustomer []svccustomer.Customer
+	customerSvc.GetEntitysByWhere(this.User.AccCode+CustomerName, "", &dictCustomer)
+	dictList["EntrustCorp"] = &dictCustomer
 
 	var datainfo DataInfo
 	datainfo.Items = dictList
@@ -530,8 +485,6 @@ func (this *LimsReportElecPumpWellController) UpdateEntity() {
 		"ModifiedUserId",
 
 		"ModifiedBy",
-
-
 	}
 	err := svc.UpdateEntityBytbl(this.User.AccCode+LimsReportElecPumpWellName, id, &model, cols)
 	if err == nil {

+ 13 - 44
src/dashoo.cn/backend/api/controllers/lims/limsreportmotor.go

@@ -1,14 +1,15 @@
 package lims
 
 import (
-"dashoo.cn/business2/userRole"
-"dashoo.cn/backend/api/business/baseUser"
-"dashoo.cn/backend/api/business/limsreportmotor"
-. "dashoo.cn/backend/api/controllers"
-"dashoo.cn/utils"
-"encoding/json"
-"strings"
-"time"
+	"dashoo.cn/backend/api/business/baseUser"
+	svccustomer "dashoo.cn/backend/api/business/customer"
+	"dashoo.cn/backend/api/business/limsreportmotor"
+	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/business2/userRole"
+	"dashoo.cn/utils"
+	"encoding/json"
+	"strings"
+	"time"
 )
 
 type LimsReportMotorController struct {
@@ -71,162 +72,130 @@ func (this *LimsReportMotorController) GetEntityList() {
 		where = where + " and Id like '%" + Id + "%'"
 	}
 
-
 	if SectionMonitor != "" {
 		where = where + " and SectionMonitor like '%" + SectionMonitor + "%'"
 	}
 
-
 	if MotorType != "" {
 		where = where + " and MotorType like '%" + MotorType + "%'"
 	}
 
-
 	if RatedPower != "" {
 		where = where + " and RatedPower like '%" + RatedPower + "%'"
 	}
 
-
 	if RatedVoltage != "" {
 		where = where + " and RatedVoltage like '%" + RatedVoltage + "%'"
 	}
 
-
 	if RatedCurrent != "" {
 		where = where + " and RatedCurrent like '%" + RatedCurrent + "%'"
 	}
 
-
 	if RatedSpeed != "" {
 		where = where + " and RatedSpeed like '%" + RatedSpeed + "%'"
 	}
 
-
 	if RatedEfficiency != "" {
 		where = where + " and RatedEfficiency like '%" + RatedEfficiency + "%'"
 	}
 
-
 	if RatedNoloadPower != "" {
 		where = where + " and RatedNoloadPower like '%" + RatedNoloadPower + "%'"
 	}
 
-
 	if RatedPowerFactor != "" {
 		where = where + " and RatedPowerFactor like '%" + RatedPowerFactor + "%'"
 	}
 
-
 	if NoloadCurrent != "" {
 		where = where + " and NoloadCurrent like '%" + NoloadCurrent + "%'"
 	}
 
-
 	if Insulation != "" {
 		where = where + " and Insulation like '%" + Insulation + "%'"
 	}
 
-
 	if Standard != "" {
 		where = where + " and Standard like '%" + Standard + "%'"
 	}
 
-
 	if UseInstrument != "" {
 		where = where + " and UseInstrument like '%" + UseInstrument + "%'"
 	}
 
-
 	if BeforeTesting != "" {
 		where = where + " and BeforeTesting like '%" + BeforeTesting + "%'"
 	}
 
-
 	if AfterTesting != "" {
 		where = where + " and AfterTesting like '%" + AfterTesting + "%'"
 	}
 
-
 	if Temperature != "" {
 		where = where + " and Temperature like '%" + Temperature + "%'"
 	}
 
-
 	if RelativeHumidity != "" {
 		where = where + " and RelativeHumidity like '%" + RelativeHumidity + "%'"
 	}
 
-
 	if Voltage != "" {
 		where = where + " and Voltage like '%" + Voltage + "%'"
 	}
 
-
 	if Electric != "" {
 		where = where + " and Electric like '%" + Electric + "%'"
 	}
 
-
 	if ActivePower != "" {
 		where = where + " and ActivePower like '%" + ActivePower + "%'"
 	}
 
-
 	if ReactivePower != "" {
 		where = where + " and ReactivePower like '%" + ReactivePower + "%'"
 	}
 
-
 	if ApparentPower != "" {
 		where = where + " and ApparentPower like '%" + ApparentPower + "%'"
 	}
 
-
 	if PowerFactor != "" {
 		where = where + " and PowerFactor like '%" + PowerFactor + "%'"
 	}
 
-
 	if OperatingEfficiency != "" {
 		where = where + " and OperatingEfficiency like '%" + OperatingEfficiency + "%'"
 	}
 
-
 	if Remark != "" {
 		where = where + " and Remark like '%" + Remark + "%'"
 	}
 
-
 	if CreateUserId != "" {
 		where = where + " and CreateUserId like '%" + CreateUserId + "%'"
 	}
 
-
 	if CreateOn != "" {
 		where = where + " and CreateOn like '%" + CreateOn + "%'"
 	}
 
-
 	if CreateBy != "" {
 		where = where + " and CreateBy like '%" + CreateBy + "%'"
 	}
 
-
 	if ModifiedOn != "" {
 		where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
 	}
 
-
 	if ModifiedUserId != "" {
 		where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
 	}
 
-
 	if ModifiedBy != "" {
 		where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
 	}
 
-
 	if CreateOn != "" {
 		dates := strings.Split(CreateOn, ",")
 		if len(dates) == 2 {
@@ -256,15 +225,15 @@ func (this *LimsReportMotorController) GetDictList() {
 	dictList := make(map[string]interface{})
 	//dictSvc := items.GetItemsService(utils.DBE)
 	userSvc := baseUser.GetBaseUserService(utils.DBE)
-	//customerSvc := svccustomer.GetCustomerService(utils.DBE)
+	customerSvc := svccustomer.GetCustomerService(utils.DBE)
 	//dictList["WellNo"] = dictSvc.GetKeyValueItems("WellNo", this.User.AccCode)
 	var userEntity userRole.Base_User
 	userSvc.GetEntityById(this.User.Id, &userEntity)
 	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
 
-	//var dictCustomer []svccustomer.Customer
-	//customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
-	//dictList["EntrustCorp"] = &dictCustomer
+	var dictCustomer []svccustomer.Customer
+	customerSvc.GetEntitysByWhere(this.User.AccCode+CustomerName, "", &dictCustomer)
+	dictList["EntrustCorp"] = &dictCustomer
 
 	var datainfo DataInfo
 	datainfo.Items = dictList

+ 5 - 4
src/dashoo.cn/backend/api/controllers/lims/limsreportpistonpumpunit.go

@@ -10,6 +10,7 @@ import (
 	"strconv"
 	"strings"
 	"time"
+	svccustomer "dashoo.cn/backend/api/business/customer"
 )
 
 type LimsReportPistonPumpUnitController struct {
@@ -519,15 +520,15 @@ func (this *LimsReportPistonPumpUnitController) GetDictList() {
 	dictList := make(map[string]interface{})
 	//dictSvc := items.GetItemsService(utils.DBE)
 	userSvc := baseUser.GetBaseUserService(utils.DBE)
-	//customerSvc := svccustomer.GetCustomerService(utils.DBE)
+	customerSvc := svccustomer.GetCustomerService(utils.DBE)
 	//dictList["WellNo"] = dictSvc.GetKeyValueItems("WellNo", this.User.AccCode)
 	var userEntity userRole.Base_User
 	userSvc.GetEntityById(this.User.Id, &userEntity)
 	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
 
-	//var dictCustomer []svccustomer.Customer
-	//customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
-	//dictList["EntrustCorp"] = &dictCustomer
+	var dictCustomer []svccustomer.Customer
+	customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
+	dictList["EntrustCorp"] = &dictCustomer
 
 	var datainfo DataInfo
 	datainfo.Items = dictList

+ 24 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportelecpumpwell/_opera/operation.vue

@@ -32,7 +32,11 @@
         <el-row>
           <el-col :span="6">
             <el-form-item label="被测单位">
-              <el-input v-model.trim="formData.TestDepart" placeholder="请输入" style="width: 100%" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3" ></el-input>
+              <el-select disabled ref="selectEntrustCorp" v-model="formData.TestDepartId" filterable placeholder="请选择"
+                         style="width: 100%">
+                <el-option v-for="item in EntrustCorpOptions" :key="item.Id" :label="item.CustomerName" :value="item.Id">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="6">
@@ -332,6 +336,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/lims/limsreportelecpumpwell'
+  import entrustApi from '@/api/lims/limsentrust'
 
   export default {
     computed: {
@@ -352,6 +357,7 @@
         ischeck: 0,
         DataStatus: '0',
         acceptUsers: [],
+        EntrustCorpOptions: [],
         formData: {
           Id: '',
           EId: '',
@@ -424,6 +430,7 @@
       this.formData.DataEntryId = parseInt(this.DataEntryId)
       this.initData()
       this.getUsersByRole()
+      this.getDictOptions()
     },
     methods: {
       saveEntity () {
@@ -482,6 +489,22 @@
             this.formData = res.data.item
           } else {
           }
+          this.getEntrustInfo(this.EId)
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      getEntrustInfo (EId) {
+        entrustApi.getEntrustInfo(EId, this.$axios).then(res => {
+          this.formData.TestDepartId = res.data.CustomerId
+        }).catch(err => {
+          // handle error
+          console.error(err)
+        })
+      },
+      getDictOptions () {
+        api.getDictList(this.$axios).then(res => {
+          this.EntrustCorpOptions = res.data.items['EntrustCorp']
         }).catch(err => {
           console.error(err)
         })

+ 30 - 3
src/dashoo.cn/frontend_web/src/pages/lims/reportmotor/_opera/operation.vue

@@ -31,7 +31,11 @@
         <el-row>
           <el-col :span="6">
             <el-form-item label="被测单位名称">
-              <el-input v-model.trim="formData.TestDepart" placeholder="请输入" style="width: 100%" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3" ></el-input>
+              <el-select disabled ref="selectEntrustCorp" v-model="formData.TestDepartId" filterable placeholder="请选择"
+                         style="width: 100%">
+                <el-option v-for="item in EntrustCorpOptions" :key="item.Id" :label="item.CustomerName" :value="item.Id">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="6">
@@ -108,6 +112,8 @@
               <el-input type="number" step="0.001" v-model.number="formData.RatedPowerFactor" placeholder="请输入" style="width: 100%" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3" ></el-input>
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row>
           <el-col :span="6">
             <el-form-item label="空载电流"
                           prop="NoloadCurrent">
@@ -126,18 +132,20 @@
               <el-input v-model.trim="formData.Standard" placeholder="请输入" style="width: 100%" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3" ></el-input>
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row>
           <el-col :span="12">
             <el-form-item label="使用仪器">
               <el-input v-model.trim="formData.UseInstrument" placeholder="请输入" style="width: 100%" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3" ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="测试前仪器状态">
+            <el-form-item label="测试前仪器状态" label-width="120px">
               <el-input v-model.trim="formData.BeforeTesting" placeholder="请输入" style="width: 100%" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3" ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="测试后仪器状态">
+            <el-form-item label="测试后仪器状态" label-width="120px">
               <el-input v-model.trim="formData.AfterTesting" placeholder="请输入" style="width: 100%" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3" ></el-input>
             </el-form-item>
           </el-col>
@@ -280,6 +288,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/lims/limsreportmotor'
+  import entrustApi from '@/api/lims/limsentrust'
 
   export default {
     computed: {
@@ -299,6 +308,7 @@
         sign: '2',
         ischeck: 0,
         DataStatus: '0',
+        EntrustCorpOptions: [],
         formData: {
           Id: '',
           EId: '',
@@ -366,6 +376,7 @@
       this.formData.DataEntryId = parseInt(this.DataEntryId)
       this.initData()
       this.getUsersByRole()
+      this.getDictOptions()
     },
     methods: {
       saveEntity () {
@@ -425,6 +436,22 @@
             this.formData = res.data.item
           } else {
           }
+          this.getEntrustInfo(this.EId)
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      getEntrustInfo (EId) {
+        entrustApi.getEntrustInfo(EId, this.$axios).then(res => {
+          this.formData.TestDepartId = res.data.CustomerId
+        }).catch(err => {
+          // handle error
+          console.error(err)
+        })
+      },
+      getDictOptions () {
+        api.getDictList(this.$axios).then(res => {
+          this.EntrustCorpOptions = res.data.items['EntrustCorp']
         }).catch(err => {
           console.error(err)
         })

+ 24 - 2
src/dashoo.cn/frontend_web/src/pages/lims/reportpistonpumpunit/_opera/operation.vue

@@ -31,8 +31,11 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="被测单位" label-width="120px">
-              <el-input v-model.trim="formData.TestDepart" placeholder="请输入" style="width: 100%"
-                        :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3"></el-input>
+              <el-select disabled ref="selectEntrustCorp" v-model="formData.TestDepartId" filterable placeholder="请选择"
+                         style="width: 100%">
+                <el-option v-for="item in EntrustCorpOptions" :key="item.Id" :label="item.CustomerName" :value="item.Id">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -507,6 +510,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/lims/reportpistonpumpunit'
+  import entrustApi from '@/api/lims/limsentrust'
 
   export default {
     computed: {
@@ -523,6 +527,7 @@
         ischeck: 0,
         DataStatus: '0',
         acceptUsers: [],
+        EntrustCorpOptions: [],
         Id: '',
         EId: '',
         TaskBalanceId: '',
@@ -638,6 +643,7 @@
       this.formData.DataEntryId = parseInt(this.$route.query.deid)
       this.initData()
       this.getUsersByRole()
+      this.getDictOptions()
     },
     methods: {
       saveEntity () {
@@ -698,6 +704,22 @@
             this.formData = res.data.item
           } else {
           }
+          this.getEntrustInfo(this.EId)
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      getEntrustInfo (EId) {
+        entrustApi.getEntrustInfo(EId, this.$axios).then(res => {
+          this.formData.TestDepartId = res.data.CustomerId
+        }).catch(err => {
+          // handle error
+          console.error(err)
+        })
+      },
+      getDictOptions () {
+        api.getDictList(this.$axios).then(res => {
+          this.EntrustCorpOptions = res.data.items['EntrustCorp']
         }).catch(err => {
           console.error(err)
         })