|
|
@@ -0,0 +1,629 @@
|
|
|
+package lims
|
|
|
+
|
|
|
+import (
|
|
|
+"dashoo.cn/business/userRole"
|
|
|
+"dashoo.cn/backend/api/business/baseUser"
|
|
|
+"dashoo.cn/backend/api/business/limsreportscrewpump"
|
|
|
+. "dashoo.cn/backend/api/controllers"
|
|
|
+"dashoo.cn/utils"
|
|
|
+"encoding/json"
|
|
|
+"strings"
|
|
|
+"time"
|
|
|
+)
|
|
|
+
|
|
|
+type LimsReportScrewPumpController struct {
|
|
|
+ BaseController
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取列表
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} []limsreportscrewpump.LimsReportScrewPump
|
|
|
+// @router /list [get]
|
|
|
+func (this *LimsReportScrewPumpController) GetEntityList() {
|
|
|
+
|
|
|
+ //获取分页信息
|
|
|
+ page := this.GetPageInfoForm()
|
|
|
+ where := " 1=1 "
|
|
|
+ orderby := "Id"
|
|
|
+ asc := false
|
|
|
+ Order := this.GetString("Order")
|
|
|
+ Prop := this.GetString("Prop")
|
|
|
+ if Order != "" && Prop != "" {
|
|
|
+ orderby = Prop
|
|
|
+ if Order == "asc" {
|
|
|
+ asc = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Id := this.GetString("Id")
|
|
|
+ EId := this.GetString("EId")
|
|
|
+ TaskBalanceId := this.GetString("TaskBalanceId")
|
|
|
+ DataEntryId := this.GetString("DataEntryId")
|
|
|
+ TestDepartId := this.GetString("TestDepartId")
|
|
|
+ PositionCheckId := this.GetString("PositionCheckId")
|
|
|
+ TestDepart := this.GetString("TestDepart")
|
|
|
+ PositionCheck := this.GetString("PositionCheck")
|
|
|
+ CheckDate := this.GetString("CheckDate")
|
|
|
+ WellNumber := this.GetString("WellNumber")
|
|
|
+ MotorModel := this.GetString("MotorModel")
|
|
|
+ MotorRatedPower := this.GetString("MotorRatedPower")
|
|
|
+ MotorRatedVoltage := this.GetString("MotorRatedVoltage")
|
|
|
+ MotorRatedCurrent := this.GetString("MotorRatedCurrent")
|
|
|
+ MotorRatedSpeed := this.GetString("MotorRatedSpeed")
|
|
|
+ MotorManufacturer := this.GetString("MotorManufacturer")
|
|
|
+ PumpModel := this.GetString("PumpModel")
|
|
|
+ PumpDepth := this.GetString("PumpDepth")
|
|
|
+ PumpRatedVoltage := this.GetString("PumpRatedVoltage")
|
|
|
+ PumpRatedCurrent := this.GetString("PumpRatedCurrent")
|
|
|
+ PumpRatedSpeed := this.GetString("PumpRatedSpeed")
|
|
|
+ PumpManufacturer := this.GetString("PumpManufacturer")
|
|
|
+ AvgVoltage := this.GetString("AvgVoltage")
|
|
|
+ AvgCurrent := this.GetString("AvgCurrent")
|
|
|
+ AvgActivePower := this.GetString("AvgActivePower")
|
|
|
+ AvgReactivePower := this.GetString("AvgReactivePower")
|
|
|
+ AvgPowerFactor := this.GetString("AvgPowerFactor")
|
|
|
+ BackPressure := this.GetString("BackPressure")
|
|
|
+ OilPressure := this.GetString("OilPressure")
|
|
|
+ CasingPressure := this.GetString("CasingPressure")
|
|
|
+ ProducedFluidVolume := this.GetString("ProducedFluidVolume")
|
|
|
+ WaterContent := this.GetString("WaterContent")
|
|
|
+ CrudeOilDensity := this.GetString("CrudeOilDensity")
|
|
|
+ WorkingFluidLevel := this.GetString("WorkingFluidLevel")
|
|
|
+ SuctionDepth := this.GetString("SuctionDepth")
|
|
|
+ StraightOrslope := this.GetString("StraightOrslope")
|
|
|
+ OilFieldType := this.GetString("OilFieldType")
|
|
|
+ Standard := this.GetString("Standard")
|
|
|
+ MonitoringInstrument := this.GetString("MonitoringInstrument")
|
|
|
+ Temperature := this.GetString("Temperature")
|
|
|
+ Humidity := this.GetString("Humidity")
|
|
|
+ BeforeCheck := this.GetString("BeforeCheck")
|
|
|
+ AfterCheck := this.GetString("AfterCheck")
|
|
|
+ Remark := this.GetString("Remark")
|
|
|
+ CreateUserId := this.GetString("CreateUserId")
|
|
|
+ CreateOn := this.GetString("CreateOn")
|
|
|
+ CreateBy := this.GetString("CreateBy")
|
|
|
+ ModifiedOn := this.GetString("ModifiedOn")
|
|
|
+ ModifiedUserId := this.GetString("ModifiedUserId")
|
|
|
+ ModifiedBy := this.GetString("ModifiedBy")
|
|
|
+
|
|
|
+ if Id != "" {
|
|
|
+ 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 CheckDate != "" {
|
|
|
+ where = where + " and CheckDate like '%" + CheckDate + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if WellNumber != "" {
|
|
|
+ where = where + " and WellNumber like '%" + WellNumber + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if MotorModel != "" {
|
|
|
+ where = where + " and MotorModel like '%" + MotorModel + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if MotorRatedPower != "" {
|
|
|
+ where = where + " and MotorRatedPower like '%" + MotorRatedPower + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if MotorRatedVoltage != "" {
|
|
|
+ where = where + " and MotorRatedVoltage like '%" + MotorRatedVoltage + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if MotorRatedCurrent != "" {
|
|
|
+ where = where + " and MotorRatedCurrent like '%" + MotorRatedCurrent + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if MotorRatedSpeed != "" {
|
|
|
+ where = where + " and MotorRatedSpeed like '%" + MotorRatedSpeed + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if MotorManufacturer != "" {
|
|
|
+ where = where + " and MotorManufacturer like '%" + MotorManufacturer + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if PumpModel != "" {
|
|
|
+ where = where + " and PumpModel like '%" + PumpModel + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if PumpDepth != "" {
|
|
|
+ where = where + " and PumpDepth like '%" + PumpDepth + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if PumpRatedVoltage != "" {
|
|
|
+ where = where + " and PumpRatedVoltage like '%" + PumpRatedVoltage + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if PumpRatedCurrent != "" {
|
|
|
+ where = where + " and PumpRatedCurrent like '%" + PumpRatedCurrent + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if PumpRatedSpeed != "" {
|
|
|
+ where = where + " and PumpRatedSpeed like '%" + PumpRatedSpeed + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if PumpManufacturer != "" {
|
|
|
+ where = where + " and PumpManufacturer like '%" + PumpManufacturer + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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 {
|
|
|
+ minDate := dates[0]
|
|
|
+ maxDate := dates[1]
|
|
|
+ where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ svc := limsreportscrewpump.GetLimsReportScrewPumpService(utils.DBE)
|
|
|
+ var list []limsreportscrewpump.LimsReportScrewPump
|
|
|
+ total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
+ var datainfo DataInfo
|
|
|
+ datainfo.Items = list
|
|
|
+ datainfo.CurrentItemCount = total
|
|
|
+ datainfo.PageIndex = page.CurrentPage
|
|
|
+ datainfo.ItemsPerPage = page.Size
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取字典列表
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} map[string]interface{}
|
|
|
+// @router /dictlist [get]
|
|
|
+func (this *LimsReportScrewPumpController) GetDictList() {
|
|
|
+ dictList := make(map[string]interface{})
|
|
|
+ //dictSvc := items.GetItemsService(utils.DBE)
|
|
|
+ userSvc := baseUser.GetBaseUserService(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 datainfo DataInfo
|
|
|
+ datainfo.Items = dictList
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取实体
|
|
|
+// @Description 获取实体
|
|
|
+// @Success 200 {object} limsreportscrewpump.LimsReportScrewPump
|
|
|
+// @router /get/:id [get]
|
|
|
+func (this *LimsReportScrewPumpController) GetEntity() {
|
|
|
+ Id := this.Ctx.Input.Param(":id")
|
|
|
+
|
|
|
+ var model limsreportscrewpump.LimsReportScrewPump
|
|
|
+ svc := limsreportscrewpump.GetLimsReportScrewPumpService(utils.DBE)
|
|
|
+ svc.GetEntityByIdBytbl(this.User.AccCode+LimsReportScrewPumpName, Id, &model)
|
|
|
+
|
|
|
+ this.Data["json"] = &model
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取实体byDataEntryId
|
|
|
+// @Description 获取实体
|
|
|
+// @Success 200 {object} limsreportscrewpump.LimsReportScrewPump
|
|
|
+// @router /getEntityByDataEntryId/:id [get]
|
|
|
+func (this *LimsReportScrewPumpController) GetEntityByDataEntryId() {
|
|
|
+ Id := this.Ctx.Input.Param(":id")
|
|
|
+ where := "DataEntryId=" + Id
|
|
|
+ var model limsreportscrewpump.LimsReportScrewPump
|
|
|
+ svc := limsreportscrewpump.GetLimsReportScrewPumpService(utils.DBE)
|
|
|
+ //svc.GetEntityByIdBytbl(this.User.AccCode+LimsReportScrewPumpName, Id, &model)
|
|
|
+ has := svc.GetEntityByWhere(this.User.AccCode+LimsReportScrewPumpName, where, &model)
|
|
|
+ var data ErrorDataInfo
|
|
|
+ if (has) {
|
|
|
+ data.Code = 0
|
|
|
+ } else {
|
|
|
+ data.Code = -1
|
|
|
+ }
|
|
|
+ data.Item = model
|
|
|
+ this.Data["json"] = &data
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 添加
|
|
|
+// @Description 新增
|
|
|
+// @Param body body limsreportscrewpump.LimsReportScrewPump
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /add [post]
|
|
|
+func (this *LimsReportScrewPumpController) AddEntity() {
|
|
|
+ var model limsreportscrewpump.LimsReportScrewPump
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ svc := limsreportscrewpump.GetLimsReportScrewPumpService(utils.DBE)
|
|
|
+
|
|
|
+ json.Unmarshal(jsonBlob, &model)
|
|
|
+ model.CreateOn = time.Now()
|
|
|
+ model.CreateBy = this.User.Realname
|
|
|
+ model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+
|
|
|
+ _, err := svc.InsertEntityBytbl(this.User.AccCode+LimsReportScrewPumpName, &model)
|
|
|
+
|
|
|
+ var errinfo ErrorDataInfo
|
|
|
+ if err == nil {
|
|
|
+ //新增
|
|
|
+ errinfo.Message = "添加成功!"
|
|
|
+ errinfo.Code = 0
|
|
|
+ errinfo.Item = model.Id
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ } else {
|
|
|
+ errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 修改实体
|
|
|
+// @Description 修改实体
|
|
|
+// @Param body body limsreportscrewpump.LimsReportScrewPump
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /update/:id [post]
|
|
|
+func (this *LimsReportScrewPumpController) UpdateEntity() {
|
|
|
+ id := this.Ctx.Input.Param(":id")
|
|
|
+ var errinfo ErrorInfo
|
|
|
+ if id == "" {
|
|
|
+ errinfo.Message = "操作失败!请求信息不完整"
|
|
|
+ errinfo.Code = -2
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var model limsreportscrewpump.LimsReportScrewPump
|
|
|
+ svc := limsreportscrewpump.GetLimsReportScrewPumpService(utils.DBE)
|
|
|
+
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ json.Unmarshal(jsonBlob, &model)
|
|
|
+ model.ModifiedOn = time.Now()
|
|
|
+ model.ModifiedBy = this.User.Realname
|
|
|
+ model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+
|
|
|
+ cols := []string{
|
|
|
+
|
|
|
+ "Id",
|
|
|
+
|
|
|
+ "EId",
|
|
|
+
|
|
|
+ "TaskBalanceId",
|
|
|
+
|
|
|
+ "DataEntryId",
|
|
|
+
|
|
|
+ "TestDepartId",
|
|
|
+
|
|
|
+ "PositionCheckId",
|
|
|
+
|
|
|
+ "TestDepart",
|
|
|
+
|
|
|
+ "PositionCheck",
|
|
|
+
|
|
|
+ "CheckDate",
|
|
|
+
|
|
|
+ "WellNumber",
|
|
|
+
|
|
|
+ "MotorModel",
|
|
|
+
|
|
|
+ "MotorRatedPower",
|
|
|
+
|
|
|
+ "MotorRatedVoltage",
|
|
|
+
|
|
|
+ "MotorRatedCurrent",
|
|
|
+
|
|
|
+ "MotorRatedSpeed",
|
|
|
+
|
|
|
+ "MotorManufacturer",
|
|
|
+
|
|
|
+ "PumpModel",
|
|
|
+
|
|
|
+ "PumpDepth",
|
|
|
+
|
|
|
+ "PumpRatedVoltage",
|
|
|
+
|
|
|
+ "PumpRatedCurrent",
|
|
|
+
|
|
|
+ "PumpRatedSpeed",
|
|
|
+
|
|
|
+ "PumpManufacturer",
|
|
|
+
|
|
|
+ "AvgVoltage",
|
|
|
+
|
|
|
+ "AvgCurrent",
|
|
|
+
|
|
|
+ "AvgActivePower",
|
|
|
+
|
|
|
+ "AvgReactivePower",
|
|
|
+
|
|
|
+ "AvgPowerFactor",
|
|
|
+
|
|
|
+ "BackPressure",
|
|
|
+
|
|
|
+ "OilPressure",
|
|
|
+
|
|
|
+ "CasingPressure",
|
|
|
+
|
|
|
+ "ProducedFluidVolume",
|
|
|
+
|
|
|
+ "WaterContent",
|
|
|
+
|
|
|
+ "CrudeOilDensity",
|
|
|
+
|
|
|
+ "WorkingFluidLevel",
|
|
|
+
|
|
|
+ "SuctionDepth",
|
|
|
+
|
|
|
+ "StraightOrslope",
|
|
|
+
|
|
|
+ "OilFieldType",
|
|
|
+
|
|
|
+ "Standard",
|
|
|
+
|
|
|
+ "MonitoringInstrument",
|
|
|
+
|
|
|
+ "Temperature",
|
|
|
+
|
|
|
+ "Humidity",
|
|
|
+
|
|
|
+ "BeforeCheck",
|
|
|
+
|
|
|
+ "AfterCheck",
|
|
|
+
|
|
|
+ "Remark",
|
|
|
+
|
|
|
+ "CreateUserId",
|
|
|
+
|
|
|
+ "CreateOn",
|
|
|
+
|
|
|
+ "CreateBy",
|
|
|
+
|
|
|
+ "ModifiedOn",
|
|
|
+
|
|
|
+ "ModifiedUserId",
|
|
|
+
|
|
|
+ "ModifiedBy",
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ err := svc.UpdateEntityBytbl(this.User.AccCode+LimsReportScrewPumpName, id, &model, cols)
|
|
|
+ if err == nil {
|
|
|
+ errinfo.Message = "修改成功!"
|
|
|
+ errinfo.Code = 0
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ } else {
|
|
|
+ errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 删除单条信息
|
|
|
+// @Description
|
|
|
+// @Success 200 {object} ErrorInfo
|
|
|
+// @Failure 403 :id 为空
|
|
|
+// @router /delete/:Id [delete]
|
|
|
+func (this *LimsReportScrewPumpController) DeleteEntity() {
|
|
|
+ Id := this.Ctx.Input.Param(":Id")
|
|
|
+ var errinfo ErrorInfo
|
|
|
+ if Id == "" {
|
|
|
+ errinfo.Message = "操作失败!请求信息不完整"
|
|
|
+ errinfo.Code = -2
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var model limsreportscrewpump.LimsReportScrewPump
|
|
|
+ var entityempty limsreportscrewpump.LimsReportScrewPump
|
|
|
+ svc := limsreportscrewpump.GetLimsReportScrewPumpService(utils.DBE)
|
|
|
+ opdesc := "删除-" + Id
|
|
|
+ err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+LimsReportScrewPumpName, BaseOperationLogName, Id, &model, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "钻井日报")
|
|
|
+ if err == nil {
|
|
|
+ errinfo.Message = "删除成功"
|
|
|
+ errinfo.Code = 0
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ } else {
|
|
|
+ errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|