|
|
@@ -0,0 +1,526 @@
|
|
|
+package lims
|
|
|
+
|
|
|
+import (
|
|
|
+ "dashoo.cn/backend/api/business/baseUser"
|
|
|
+ "dashoo.cn/backend/api/business/limsreportheatingfurnace"
|
|
|
+ . "dashoo.cn/backend/api/controllers"
|
|
|
+ "dashoo.cn/business/userRole"
|
|
|
+ "dashoo.cn/utils"
|
|
|
+ "encoding/json"
|
|
|
+ "strconv"
|
|
|
+ "strings"
|
|
|
+ "time"
|
|
|
+)
|
|
|
+
|
|
|
+type LimsReportHeatingFurnaceSessionController struct {
|
|
|
+ BaseController
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取列表
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} []limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+// @router /list [get]
|
|
|
+func (this *LimsReportHeatingFurnaceSessionController) 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")
|
|
|
+ TestDepart := this.GetString("TestDepart")
|
|
|
+ PositionCheckId := this.GetString("PositionCheckId")
|
|
|
+ PositionCheck := this.GetString("PositionCheck")
|
|
|
+ CheckDate := this.GetString("CheckDate")
|
|
|
+ Number := this.GetString("Number")
|
|
|
+ HFModel := this.GetString("HFModel")
|
|
|
+ RHCapacity := this.GetString("RHCapacity")
|
|
|
+ RatedPower := this.GetString("RatedPower")
|
|
|
+ HFProDate := this.GetString("HFProDate")
|
|
|
+ Manufacturer := this.GetString("Manufacturer")
|
|
|
+ Fuel := this.GetString("Fuel")
|
|
|
+ BurnerManuf := this.GetString("BurnerManuf")
|
|
|
+ BurnerModel := this.GetString("BurnerModel")
|
|
|
+ BurnerProDate := this.GetString("BurnerProDate")
|
|
|
+ BurnerIntel := this.GetString("BurnerIntel")
|
|
|
+ Temperature := this.GetString("Temperature")
|
|
|
+ WindSpeed := this.GetString("WindSpeed")
|
|
|
+ RelativeHumidity := this.GetString("RelativeHumidity")
|
|
|
+ InstrStatus := this.GetString("InstrStatus")
|
|
|
+ InTemp := this.GetString("InTemp")
|
|
|
+ InPressure := this.GetString("InPressure")
|
|
|
+ OutTemp := this.GetString("OutTemp")
|
|
|
+ OutPressure := this.GetString("OutPressure")
|
|
|
+ MediumFlow := this.GetString("MediumFlow")
|
|
|
+ MedMoiContent := this.GetString("MedMoiContent")
|
|
|
+ MedDensity := this.GetString("MedDensity")
|
|
|
+ CombustionQty := this.GetString("CombustionQty")
|
|
|
+ Indoor := this.GetString("Indoor")
|
|
|
+ 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 TestDepart != "" {
|
|
|
+ where = where + " and TestDepart like '%" + TestDepart + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if PositionCheckId != "" {
|
|
|
+ where = where + " and PositionCheckId like '%" + PositionCheckId + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if PositionCheck != "" {
|
|
|
+ where = where + " and PositionCheck like '%" + PositionCheck + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if CheckDate != "" {
|
|
|
+ where = where + " and CheckDate like '%" + CheckDate + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Number != "" {
|
|
|
+ where = where + " and Number like '%" + Number + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if HFModel != "" {
|
|
|
+ where = where + " and HFModel like '%" + HFModel + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if RHCapacity != "" {
|
|
|
+ where = where + " and RHCapacity like '%" + RHCapacity + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if RatedPower != "" {
|
|
|
+ where = where + " and RatedPower like '%" + RatedPower + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if HFProDate != "" {
|
|
|
+ where = where + " and HFProDate like '%" + HFProDate + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Manufacturer != "" {
|
|
|
+ where = where + " and Manufacturer like '%" + Manufacturer + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Fuel != "" {
|
|
|
+ where = where + " and Fuel like '%" + Fuel + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if BurnerManuf != "" {
|
|
|
+ where = where + " and BurnerManuf like '%" + BurnerManuf + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if BurnerModel != "" {
|
|
|
+ where = where + " and BurnerModel like '%" + BurnerModel + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if BurnerProDate != "" {
|
|
|
+ where = where + " and BurnerProDate like '%" + BurnerProDate + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if BurnerIntel != "" {
|
|
|
+ where = where + " and BurnerIntel like '%" + BurnerIntel + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Temperature != "" {
|
|
|
+ where = where + " and Temperature like '%" + Temperature + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if WindSpeed != "" {
|
|
|
+ where = where + " and WindSpeed like '%" + WindSpeed + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if RelativeHumidity != "" {
|
|
|
+ where = where + " and RelativeHumidity like '%" + RelativeHumidity + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if InstrStatus != "" {
|
|
|
+ where = where + " and InstrStatus like '%" + InstrStatus + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if InTemp != "" {
|
|
|
+ where = where + " and InTemp like '%" + InTemp + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if InPressure != "" {
|
|
|
+ where = where + " and InPressure like '%" + InPressure + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if OutTemp != "" {
|
|
|
+ where = where + " and OutTemp like '%" + OutTemp + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if OutPressure != "" {
|
|
|
+ where = where + " and OutPressure like '%" + OutPressure + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if MediumFlow != "" {
|
|
|
+ where = where + " and MediumFlow like '%" + MediumFlow + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if MedMoiContent != "" {
|
|
|
+ where = where + " and MedMoiContent like '%" + MedMoiContent + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if MedDensity != "" {
|
|
|
+ where = where + " and MedDensity like '%" + MedDensity + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if CombustionQty != "" {
|
|
|
+ where = where + " and CombustionQty like '%" + CombustionQty + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ if Indoor != "" {
|
|
|
+ where = where + " and Indoor like '%" + Indoor + "%'"
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 + "'"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ session := utils.DBE.NewSession()
|
|
|
+ svc := limsreportheatingfurnace.GetLimsReportHeatingFurnaceSessionService(session)
|
|
|
+ var list []limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+ 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 *LimsReportHeatingFurnaceSessionController) 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} limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+// @router /get/:id [get]
|
|
|
+func (this *LimsReportHeatingFurnaceSessionController) GetEntity() {
|
|
|
+ session := utils.DBE.NewSession()
|
|
|
+ Id := this.Ctx.Input.Param(":id")
|
|
|
+
|
|
|
+ var model limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+ svc := limsreportheatingfurnace.GetLimsReportHeatingFurnaceSessionService(session)
|
|
|
+ svc.GetEntityByIdBytbl(this.User.AccCode+LimsReportHeatingFurnaceName, Id, &model)
|
|
|
+
|
|
|
+ this.Data["json"] = &model
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取实体ByDateEntryId
|
|
|
+// @Description 获取实体
|
|
|
+// @Success 200 {object} limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+// @router /getEntityByDataEntryId/:id [get]
|
|
|
+func (this *LimsReportHeatingFurnaceSessionController) GetEntityByDataEntryId() {
|
|
|
+ session := utils.DBE.NewSession()
|
|
|
+ dictList := make(map[string]interface{})
|
|
|
+ Id := this.Ctx.Input.Param(":id")
|
|
|
+ where := "DataEntryId=" + Id
|
|
|
+ var model limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+ var tabledata []limsreportheatingfurnace.LimsHeatingFurnaceItems
|
|
|
+ svc := limsreportheatingfurnace.GetLimsReportHeatingFurnaceSessionService(session)
|
|
|
+ //svc.GetEntityByIdBytbl(this.User.AccCode+LimsReportHeatingFurnaceName, Id, &model)
|
|
|
+ has := svc.GetEntityByWhere(this.User.AccCode+LimsReportHeatingFurnaceName, where, &model)
|
|
|
+ wheretable := "MId=" + strconv.Itoa(model.Id)
|
|
|
+ svc.GetEntitysByWhere(this.User.AccCode+LimsHeatingFurnaceItemsName, wheretable, &tabledata)
|
|
|
+ var data ErrorDataInfo
|
|
|
+ if (has) {
|
|
|
+ dictList["formData"] = model
|
|
|
+ dictList["tableData"] = tabledata
|
|
|
+ data.Code = 0
|
|
|
+ } else {
|
|
|
+ data.Code = -1
|
|
|
+ }
|
|
|
+ data.Item = dictList
|
|
|
+ this.Data["json"] = &data
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 添加
|
|
|
+// @Description 新增
|
|
|
+// @Param body body limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /add [post]
|
|
|
+func (this *LimsReportHeatingFurnaceSessionController) AddEntity() {
|
|
|
+ session := utils.DBE.NewSession()
|
|
|
+ var requestData limsreportheatingfurnace.HeatingFurnaceData
|
|
|
+ var model limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+ var modelitems limsreportheatingfurnace.LimsHeatingFurnaceItems
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ svc := limsreportheatingfurnace.GetLimsReportHeatingFurnaceSessionService(session)
|
|
|
+
|
|
|
+ json.Unmarshal(jsonBlob, &requestData)
|
|
|
+ model = requestData.FormData
|
|
|
+ var tabledata = requestData.TableData
|
|
|
+ model.CreateOn = time.Now()
|
|
|
+ model.CreateBy = this.User.Realname
|
|
|
+ model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+
|
|
|
+ _, err := svc.InsertEntityBytbl(this.User.AccCode+LimsReportHeatingFurnaceName, &model)
|
|
|
+
|
|
|
+ if err == nil {
|
|
|
+ for i := 0; i < len(tabledata); i++ {
|
|
|
+ modelitems = tabledata[i]
|
|
|
+ modelitems.MId = model.Id
|
|
|
+ _, err = svc.InsertEntityBytbl(this.User.AccCode+LimsHeatingFurnaceItemsName, &modelitems)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /update/:id [post]
|
|
|
+func (this *LimsReportHeatingFurnaceSessionController) UpdateEntity() {
|
|
|
+ session := utils.DBE.NewSession()
|
|
|
+ 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 limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+ var modelitems []limsreportheatingfurnace.LimsHeatingFurnaceItems
|
|
|
+ var HeatingFurnace limsreportheatingfurnace.HeatingFurnaceData
|
|
|
+ svc := limsreportheatingfurnace.GetLimsReportHeatingFurnaceSessionService(session)
|
|
|
+
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ json.Unmarshal(jsonBlob, &HeatingFurnace)
|
|
|
+ model = HeatingFurnace.FormData
|
|
|
+ modelitems = HeatingFurnace.TableData
|
|
|
+
|
|
|
+ model.ModifiedOn = time.Now()
|
|
|
+ model.ModifiedBy = this.User.Realname
|
|
|
+ model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+
|
|
|
+ cols := []string{
|
|
|
+
|
|
|
+ "Id",
|
|
|
+ "EId",
|
|
|
+ "TaskBalanceId",
|
|
|
+ "DataEntryId",
|
|
|
+ "TestDepartId",
|
|
|
+ "TestDepart",
|
|
|
+ "PositionCheckId",
|
|
|
+ "PositionCheck",
|
|
|
+ "CheckDate",
|
|
|
+ "Number",
|
|
|
+ "HFModel",
|
|
|
+ "RHCapacity",
|
|
|
+ "RatedPower",
|
|
|
+ "HFProDate",
|
|
|
+ "Manufacturer",
|
|
|
+ "Fuel",
|
|
|
+ "BurnerManuf",
|
|
|
+ "BurnerModel",
|
|
|
+ "BurnerProDate",
|
|
|
+ "BurnerIntel",
|
|
|
+ "Temperature",
|
|
|
+ "WindSpeed",
|
|
|
+ "RelativeHumidity",
|
|
|
+ "InstrStatus",
|
|
|
+ "InTemp",
|
|
|
+ "InPressure",
|
|
|
+ "OutTemp",
|
|
|
+ "OutPressure",
|
|
|
+ "MediumFlow",
|
|
|
+ "MedMoiContent",
|
|
|
+ "MedDensity",
|
|
|
+ "CombustionQty",
|
|
|
+ "Indoor",
|
|
|
+ "INCTMeter",
|
|
|
+ "CEMeter",
|
|
|
+ "StandardTM",
|
|
|
+ "OnlineMeter",
|
|
|
+ "Remark",
|
|
|
+ "CreateUserId",
|
|
|
+ "CreateOn",
|
|
|
+ "CreateBy",
|
|
|
+ "ModifiedOn",
|
|
|
+ "ModifiedUserId",
|
|
|
+ "ModifiedBy",
|
|
|
+ }
|
|
|
+ err := svc.UpdateEntityBytbl(this.User.AccCode+LimsReportHeatingFurnaceName, id, &model, cols)
|
|
|
+
|
|
|
+ colsitems := []string{
|
|
|
+ "OrderNo",
|
|
|
+ "TestTime",
|
|
|
+ "LeftTemperature1",
|
|
|
+ "LeftTemperature2",
|
|
|
+ "LeftTemperature3",
|
|
|
+ "LeftTemperature4",
|
|
|
+ "RichtTemperature1",
|
|
|
+ "RichtTemperature2",
|
|
|
+ "RichtTemperature3",
|
|
|
+ "RichtTemperature4",
|
|
|
+ "ExhaustTemperature",
|
|
|
+ "Oxygen",
|
|
|
+ "SulfurDioxide",
|
|
|
+ "CarbonMonoxide",
|
|
|
+ "CarbonDioxide",
|
|
|
+ }
|
|
|
+
|
|
|
+ if err == nil {
|
|
|
+ for i := 0; i < len(modelitems); i++ {
|
|
|
+ where := "Id=" + strconv.Itoa(modelitems[i].Id)
|
|
|
+ err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsHeatingFurnaceItemsName, &modelitems[i], colsitems, where)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 *LimsReportHeatingFurnaceSessionController) DeleteEntity() {
|
|
|
+ session := utils.DBE.NewSession()
|
|
|
+ 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 limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+ var entityempty limsreportheatingfurnace.LimsReportHeatingFurnace
|
|
|
+ svc := limsreportheatingfurnace.GetLimsReportHeatingFurnaceSessionService(session)
|
|
|
+ opdesc := "删除-" + Id
|
|
|
+ err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+LimsReportHeatingFurnaceName, 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()
|
|
|
+ }
|
|
|
+}
|