|
|
@@ -0,0 +1,572 @@
|
|
|
+package lims
|
|
|
+
|
|
|
+import (
|
|
|
+"dashoo.cn/business/userRole"
|
|
|
+"dashoo.cn/backend/api/business/baseUser"
|
|
|
+"dashoo.cn/backend/api/business/limsreportspecialfield"
|
|
|
+. "dashoo.cn/backend/api/controllers"
|
|
|
+"dashoo.cn/utils"
|
|
|
+"encoding/json"
|
|
|
+"strings"
|
|
|
+"time"
|
|
|
+)
|
|
|
+
|
|
|
+type LimsReportSpecialFieldController struct {
|
|
|
+ BaseController
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取列表
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} []limsreportspecialfield.LimsReportSpecialField
|
|
|
+// @router /list [get]
|
|
|
+func (this *LimsReportSpecialFieldController) 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")
|
|
|
+ InstalPositionId := this.GetString("InstalPositionId")
|
|
|
+ TestDepart := this.GetString("TestDepart")
|
|
|
+ InstalPosition := this.GetString("InstalPosition")
|
|
|
+ Number := this.GetString("Number")
|
|
|
+ Type := this.GetString("Type")
|
|
|
+ Manufacturer := this.GetString("Manufacturer")
|
|
|
+ ProductionDate := this.GetString("ProductionDate")
|
|
|
+ Capacity := this.GetString("Capacity")
|
|
|
+ RatedVoltage := this.GetString("RatedVoltage")
|
|
|
+ RatedCurrent := this.GetString("RatedCurrent")
|
|
|
+ NoloadLoss := this.GetString("NoloadLoss")
|
|
|
+ LoadLoss := this.GetString("LoadLoss")
|
|
|
+ LoadCurrent := this.GetString("LoadCurrent")
|
|
|
+ ImpedanceVoltage := this.GetString("ImpedanceVoltage")
|
|
|
+ JoinGroupMode := this.GetString("JoinGroupMode")
|
|
|
+ Standard := this.GetString("Standard")
|
|
|
+ AvgVoltage := this.GetString("AvgVoltage")
|
|
|
+ Active := this.GetString("Active")
|
|
|
+ AvgCurrent := this.GetString("AvgCurrent")
|
|
|
+ NegativeActive := this.GetString("NegativeActive")
|
|
|
+ AvgActive := this.GetString("AvgActive")
|
|
|
+ Reactive := this.GetString("Reactive")
|
|
|
+ AvgReactive := this.GetString("AvgReactive")
|
|
|
+ NegativeReactive := this.GetString("NegativeReactive")
|
|
|
+ Apparent := this.GetString("Apparent")
|
|
|
+ TestTime := this.GetString("TestTime")
|
|
|
+ PowerFactor := this.GetString("PowerFactor")
|
|
|
+ EquipName := this.GetString("EquipName")
|
|
|
+ EquipStatus := this.GetString("EquipStatus")
|
|
|
+ Temperature := this.GetString("Temperature")
|
|
|
+ Humidity := this.GetString("Humidity")
|
|
|
+ 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 InstalPositionId != "" {
|
|
|
+ where = where + " and InstalPositionId like '%" + InstalPositionId + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if TestDepart != "" {
|
|
|
+ where = where + " and TestDepart like '%" + TestDepart + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if InstalPosition != "" {
|
|
|
+ where = where + " and InstalPosition like '%" + InstalPosition + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Number != "" {
|
|
|
+ where = where + " and Number like '%" + Number + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Type != "" {
|
|
|
+ where = where + " and Type like '%" + Type + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Manufacturer != "" {
|
|
|
+ where = where + " and Manufacturer like '%" + Manufacturer + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ProductionDate != "" {
|
|
|
+ where = where + " and ProductionDate like '%" + ProductionDate + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Capacity != "" {
|
|
|
+ where = where + " and Capacity like '%" + Capacity + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if RatedVoltage != "" {
|
|
|
+ where = where + " and RatedVoltage like '%" + RatedVoltage + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if RatedCurrent != "" {
|
|
|
+ where = where + " and RatedCurrent like '%" + RatedCurrent + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if NoloadLoss != "" {
|
|
|
+ where = where + " and NoloadLoss like '%" + NoloadLoss + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if LoadLoss != "" {
|
|
|
+ where = where + " and LoadLoss like '%" + LoadLoss + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if LoadCurrent != "" {
|
|
|
+ where = where + " and LoadCurrent like '%" + LoadCurrent + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ImpedanceVoltage != "" {
|
|
|
+ where = where + " and ImpedanceVoltage like '%" + ImpedanceVoltage + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if JoinGroupMode != "" {
|
|
|
+ where = where + " and JoinGroupMode like '%" + JoinGroupMode + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Standard != "" {
|
|
|
+ where = where + " and Standard like '%" + Standard + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if AvgVoltage != "" {
|
|
|
+ where = where + " and AvgVoltage like '%" + AvgVoltage + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Active != "" {
|
|
|
+ where = where + " and Active like '%" + Active + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if AvgCurrent != "" {
|
|
|
+ where = where + " and AvgCurrent like '%" + AvgCurrent + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if NegativeActive != "" {
|
|
|
+ where = where + " and NegativeActive like '%" + NegativeActive + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if AvgActive != "" {
|
|
|
+ where = where + " and AvgActive like '%" + AvgActive + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Reactive != "" {
|
|
|
+ where = where + " and Reactive like '%" + Reactive + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if AvgReactive != "" {
|
|
|
+ where = where + " and AvgReactive like '%" + AvgReactive + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if NegativeReactive != "" {
|
|
|
+ where = where + " and NegativeReactive like '%" + NegativeReactive + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Apparent != "" {
|
|
|
+ where = where + " and Apparent like '%" + Apparent + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if TestTime != "" {
|
|
|
+ where = where + " and TestTime like '%" + TestTime + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if PowerFactor != "" {
|
|
|
+ where = where + " and PowerFactor like '%" + PowerFactor + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if EquipName != "" {
|
|
|
+ where = where + " and EquipName like '%" + EquipName + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if EquipStatus != "" {
|
|
|
+ where = where + " and EquipStatus like '%" + EquipStatus + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Temperature != "" {
|
|
|
+ where = where + " and Temperature like '%" + Temperature + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if Humidity != "" {
|
|
|
+ where = where + " and Humidity like '%" + Humidity + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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 := limsreportspecialfield.GetLimsReportSpecialFieldService(utils.DBE)
|
|
|
+ var list []limsreportspecialfield.LimsReportSpecialField
|
|
|
+ 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 *LimsReportSpecialFieldController) 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} limsreportspecialfield.LimsReportSpecialField
|
|
|
+// @router /getEntityByDataEntryId/:id [get]
|
|
|
+func (this *LimsReportSpecialFieldController) GetEntityByDataEntryId() {
|
|
|
+ Id := this.Ctx.Input.Param(":id")
|
|
|
+ where := "DataEntryId=" + Id
|
|
|
+ var model limsreportspecialfield.LimsReportSpecialField
|
|
|
+ svc := limsreportspecialfield.GetLimsReportSpecialFieldService(utils.DBE)
|
|
|
+ //svc.GetEntityByIdBytbl(this.User.AccCode+LimsReportSpecialFieldName, Id, &model)
|
|
|
+ has := svc.GetEntityByWhere(this.User.AccCode+LimsReportSpecialFieldName, 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 获取实体
|
|
|
+// @Success 200 {object} limsreportspecialfield.LimsReportSpecialField
|
|
|
+// @router /get/:id [get]
|
|
|
+func (this *LimsReportSpecialFieldController) GetEntity() {
|
|
|
+ Id := this.Ctx.Input.Param(":id")
|
|
|
+
|
|
|
+ var model limsreportspecialfield.LimsReportSpecialField
|
|
|
+ svc := limsreportspecialfield.GetLimsReportSpecialFieldService(utils.DBE)
|
|
|
+ svc.GetEntityByIdBytbl(this.User.AccCode+LimsReportSpecialFieldName, Id, &model)
|
|
|
+
|
|
|
+ this.Data["json"] = &model
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 添加
|
|
|
+// @Description 新增
|
|
|
+// @Param body body limsreportspecialfield.LimsReportSpecialField
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /add [post]
|
|
|
+func (this *LimsReportSpecialFieldController) AddEntity() {
|
|
|
+ var model limsreportspecialfield.LimsReportSpecialField
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ svc := limsreportspecialfield.GetLimsReportSpecialFieldService(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+LimsReportSpecialFieldName, &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 limsreportspecialfield.LimsReportSpecialField
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /update/:id [post]
|
|
|
+func (this *LimsReportSpecialFieldController) 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 limsreportspecialfield.LimsReportSpecialField
|
|
|
+ svc := limsreportspecialfield.GetLimsReportSpecialFieldService(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",
|
|
|
+
|
|
|
+ "InstalPositionId",
|
|
|
+
|
|
|
+ "TestDepart",
|
|
|
+
|
|
|
+ "InstalPosition",
|
|
|
+
|
|
|
+ "Number",
|
|
|
+
|
|
|
+ "Type",
|
|
|
+
|
|
|
+ "Manufacturer",
|
|
|
+
|
|
|
+ "ProductionDate",
|
|
|
+
|
|
|
+ "Capacity",
|
|
|
+
|
|
|
+ "RatedVoltage",
|
|
|
+
|
|
|
+ "RatedCurrent",
|
|
|
+
|
|
|
+ "NoloadLoss",
|
|
|
+
|
|
|
+ "LoadLoss",
|
|
|
+
|
|
|
+ "LoadCurrent",
|
|
|
+
|
|
|
+ "ImpedanceVoltage",
|
|
|
+
|
|
|
+ "JoinGroupMode",
|
|
|
+
|
|
|
+ "Standard",
|
|
|
+
|
|
|
+ "AvgVoltage",
|
|
|
+
|
|
|
+ "Active",
|
|
|
+
|
|
|
+ "AvgCurrent",
|
|
|
+
|
|
|
+ "NegativeActive",
|
|
|
+
|
|
|
+ "AvgActive",
|
|
|
+
|
|
|
+ "Reactive",
|
|
|
+
|
|
|
+ "AvgReactive",
|
|
|
+
|
|
|
+ "NegativeReactive",
|
|
|
+
|
|
|
+ "Apparent",
|
|
|
+
|
|
|
+ "TestTime",
|
|
|
+
|
|
|
+ "PowerFactor",
|
|
|
+
|
|
|
+ "EquipName",
|
|
|
+
|
|
|
+ "EquipStatus",
|
|
|
+
|
|
|
+ "Temperature",
|
|
|
+
|
|
|
+ "Humidity",
|
|
|
+
|
|
|
+ "Remark",
|
|
|
+
|
|
|
+ "CreateUserId",
|
|
|
+
|
|
|
+ "CreateOn",
|
|
|
+
|
|
|
+ "CreateBy",
|
|
|
+
|
|
|
+ "ModifiedOn",
|
|
|
+
|
|
|
+ "ModifiedUserId",
|
|
|
+
|
|
|
+ "ModifiedBy",
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ err := svc.UpdateEntityBytbl(this.User.AccCode+LimsReportSpecialFieldName, 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 *LimsReportSpecialFieldController) 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 limsreportspecialfield.LimsReportSpecialField
|
|
|
+ var entityempty limsreportspecialfield.LimsReportSpecialField
|
|
|
+ svc := limsreportspecialfield.GetLimsReportSpecialFieldService(utils.DBE)
|
|
|
+ opdesc := "删除-" + Id
|
|
|
+ err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+LimsReportSpecialFieldName, 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()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|