3
2
yuedefeng 6 rokov pred
rodič
commit
8502ad85e6

+ 26 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertor.go

@@ -0,0 +1,26 @@
+package limsreportalertor
+
+import (
+	"time"
+)
+
+type LimsReportAlertor struct {
+	Id               int       `xorm:"not null pk autoincr INT(10)"`
+	Eid              int       `xorm:"comment('委托单ID') INT(10)"`
+	TaskbalanceId    int       `xorm:"comment('任务分配表ID') INT(10)"`
+	DataentryId      int       `xorm:"comment('数据记录表ID') INT(10)"`
+	MeterRange       string    `xorm:"comment('量程(*10-6mol/mol)') VARCHAR(255)"`
+	MeasurementRange string    `xorm:"comment('测量范围(*10-6mol/mol)') VARCHAR(255)"`
+	DetectBasis      string    `xorm:"comment('检测依据') VARCHAR(500)"`
+	FaceCheck        string    `xorm:"comment('外观及结构') VARCHAR(50)"`
+	FlagCheck        string    `xorm:"comment('标志标识') VARCHAR(50)"`
+	ElectrifyCheck   string    `xorm:"comment('通电检查') VARCHAR(50)"`
+	Insulation       string    `xorm:"comment('绝缘电阻') VARCHAR(50)"`
+	Remark           string    `xorm:"comment('备注') VARCHAR(255)"`
+	CreateUserId     int       `xorm:"INT(11)"`
+	CreateOn         time.Time `xorm:"DATETIME"`
+	CreateBy         string    `xorm:"VARCHAR(50)"`
+	ModifiedOn       time.Time `xorm:"DATETIME"`
+	ModifiedUserId   int       `xorm:"INT(11)"`
+	ModifiedBy       string    `xorm:"VARCHAR(50)"`
+}

+ 16 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertorService.go

@@ -0,0 +1,16 @@
+package limsreportalertor
+
+import (
+	. "dashoo.cn/backend/api/mydb"
+	"github.com/go-xorm/xorm"
+)
+
+type LimsReportAlertorService struct {
+	MyServiceBase
+}
+
+func GetLimsReportAlertorService(xormEngine *xorm.Engine) *LimsReportAlertorService {
+	s := new(LimsReportAlertorService)
+	s.DBE = xormEngine
+	return s
+}

+ 25 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertorcertificate.go

@@ -0,0 +1,25 @@
+package limsreportalertor
+
+import (
+	"time"
+)
+
+type LimsReportAlertorCertificate struct {
+	Id               int       `xorm:"not null pk autoincr INT(10)"`
+	Eid              int       `xorm:"comment('委托单ID') INT(10)"`
+	Taskbalanceid    int       `xorm:"comment('任务分配表ID') INT(10)"`
+	Dataentryid      int       `xorm:"comment('数据记录表ID') INT(10)"`
+	Instrumentno     string    `xorm:"comment('对应的设备编号') VARCHAR(255)"`
+	Meterrange       string    `xorm:"comment('证书编号') VARCHAR(255)"`
+	Standardunit     string    `xorm:"comment('标准值单位 (*10-6mol/mol) / %') VARCHAR(255)"`
+	Measurementrange string    `xorm:"comment('标准值') VARCHAR(255)"`
+	Uncertainty      string    `xorm:"comment('不确定度') VARCHAR(255)"`
+	Effectdate       time.Time `xorm:"comment('有效期') DATETIME"`
+	Remark           string    `xorm:"comment('备注') VARCHAR(255)"`
+	Createuserid     int       `xorm:"INT(11)"`
+	Createon         time.Time `xorm:"DATETIME"`
+	Createby         string    `xorm:"VARCHAR(50)"`
+	Modifiedon       time.Time `xorm:"DATETIME"`
+	Modifieduserid   int       `xorm:"INT(11)"`
+	Modifiedby       string    `xorm:"VARCHAR(50)"`
+}

+ 27 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertordeviation.go

@@ -0,0 +1,27 @@
+package limsreportalertor
+
+import (
+	"time"
+)
+
+type LimsReportAlertorDeviation struct {
+	Id                int       `xorm:"not null pk autoincr INT(10)"`
+	Eid               int       `xorm:"comment('委托单ID') INT(10)"`
+	Taskbalanceid     int       `xorm:"comment('任务分配表ID') INT(10)"`
+	Dataentryid       int       `xorm:"comment('数据记录表ID') INT(10)"`
+	Gasvalue          string    `xorm:"comment('标准气体浓度值') DECIMAL(10,2)"`
+	Value1            string    `xorm:"comment('实测报警值1') DECIMAL(10,2)"`
+	Value2            string    `xorm:"comment('实测报警值2') DECIMAL(10,2)"`
+	Value3            string    `xorm:"comment('实测报警值3') DECIMAL(10,2)"`
+	Avgvalue          string    `xorm:"comment('平均值') DECIMAL(10,2)"`
+	Deviation         string    `xorm:"comment('示值误差') DECIMAL(10,2)"`
+	Deviationabs      string    `xorm:"comment('相对误差') DECIMAL(10,2)"`
+	Deviationrelative string    `xorm:"comment('绝对误差') DECIMAL(10,2)"`
+	Remark            string    `xorm:"comment('备注') VARCHAR(255)"`
+	Createuserid      int       `xorm:"INT(11)"`
+	Createon          time.Time `xorm:"DATETIME"`
+	Createby          string    `xorm:"VARCHAR(50)"`
+	Modifiedon        time.Time `xorm:"DATETIME"`
+	Modifieduserid    int       `xorm:"INT(11)"`
+	Modifiedby        string    `xorm:"VARCHAR(50)"`
+}

+ 25 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertorother.go

@@ -0,0 +1,25 @@
+package limsreportalertor
+
+import (
+	"time"
+)
+
+type LimsReportAlertorOther struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	Eid            int       `xorm:"comment('委托单ID') INT(10)"`
+	Taskbalanceid  int       `xorm:"comment('任务分配表ID') INT(10)"`
+	Dataentryid    int       `xorm:"comment('数据记录表ID') INT(10)"`
+	Valuetype      string    `xorm:"comment('非被测分组/水蒸气') VARCHAR(50)"`
+	Value0         string    `xorm:"comment('值0') DECIMAL(10,2)"`
+	Value1         string    `xorm:"comment('值1') DECIMAL(10,2)"`
+	Value2         string    `xorm:"comment('值2') DECIMAL(10,2)"`
+	Value3         string    `xorm:"comment('值3') DECIMAL(10,2)"`
+	Othervalue     string    `xorm:"comment('干扰误差(%FS)') DECIMAL(10,2)"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	Createuserid   int       `xorm:"INT(11)"`
+	Createon       time.Time `xorm:"DATETIME"`
+	Createby       string    `xorm:"VARCHAR(50)"`
+	Modifiedon     time.Time `xorm:"DATETIME"`
+	Modifieduserid int       `xorm:"INT(11)"`
+	Modifiedby     string    `xorm:"VARCHAR(50)"`
+}

+ 26 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertorrepeat.go

@@ -0,0 +1,26 @@
+package limsreportalertor
+
+import "time"
+
+type LimsReportAlertorRepeat struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	Eid            int       `xorm:"comment('委托单ID') INT(10)"`
+	Taskbalanceid  int       `xorm:"comment('任务分配表ID') INT(10)"`
+	Dataentryid    int       `xorm:"comment('数据记录表ID') INT(10)"`
+	Gasvalue       string    `xorm:"comment('标准气体浓度值') DECIMAL(10,2)"`
+	Value1         string    `xorm:"comment('仪器示值1') DECIMAL(10,2)"`
+	Value2         string    `xorm:"comment('仪器示值2') DECIMAL(10,2)"`
+	Value3         string    `xorm:"comment('仪器示值3') DECIMAL(10,2)"`
+	Value4         string    `xorm:"comment('仪器示值4') DECIMAL(10,2)"`
+	Value5         string    `xorm:"comment('仪器示值5') DECIMAL(10,2)"`
+	Value6         string    `xorm:"comment('仪器示值6') DECIMAL(10,2)"`
+	Avgvalue       string    `xorm:"comment('平均值') DECIMAL(10,2)"`
+	Repeatvalue    string    `xorm:"comment('重复性') DECIMAL(10,2)"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	Createuserid   int       `xorm:"INT(11)"`
+	Createon       time.Time `xorm:"DATETIME"`
+	Createby       string    `xorm:"VARCHAR(50)"`
+	Modifiedon     time.Time `xorm:"DATETIME"`
+	Modifieduserid int       `xorm:"INT(11)"`
+	Modifiedby     string    `xorm:"VARCHAR(50)"`
+}

+ 24 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertorresponsetime.go

@@ -0,0 +1,24 @@
+package limsreportalertor
+
+import (
+	"time"
+)
+
+type LimsReportAlertorResponseTime struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	Eid            int       `xorm:"comment('委托单ID') INT(10)"`
+	Taskbalanceid  int       `xorm:"comment('任务分配表ID') INT(10)"`
+	Dataentryid    int       `xorm:"comment('数据记录表ID') INT(10)"`
+	Gasvalue       string    `xorm:"comment('标准气体浓度值') DECIMAL(10,2)"`
+	Value1         string    `xorm:"comment('时间值1') DECIMAL(10,2)"`
+	Value2         string    `xorm:"comment('时间值2') DECIMAL(10,2)"`
+	Value3         string    `xorm:"comment('时间值3') DECIMAL(10,2)"`
+	Deviation      string    `xorm:"comment('响应时间') DECIMAL(10,2)"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	Createuserid   int       `xorm:"INT(11)"`
+	Createon       time.Time `xorm:"DATETIME"`
+	Createby       string    `xorm:"VARCHAR(50)"`
+	Modifiedon     time.Time `xorm:"DATETIME"`
+	Modifieduserid int       `xorm:"INT(11)"`
+	Modifiedby     string    `xorm:"VARCHAR(50)"`
+}

+ 29 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertorshift.go

@@ -0,0 +1,29 @@
+package limsreportalertor
+
+import (
+	"time"
+)
+
+type LimsReportAlertorShift struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	Eid            int       `xorm:"comment('委托单ID') INT(10)"`
+	Taskbalanceid  int       `xorm:"comment('任务分配表ID') INT(10)"`
+	Dataentryid    int       `xorm:"comment('数据记录表ID') INT(10)"`
+	Valuetype      string    `xorm:"comment('0 零点/ 1 示值') VARCHAR(50)"`
+	Value0         string    `xorm:"comment('值0') DECIMAL(10,2)"`
+	Value1         string    `xorm:"comment('值1') DECIMAL(10,2)"`
+	Value2         string    `xorm:"comment('值2') DECIMAL(10,2)"`
+	Value3         string    `xorm:"comment('值3') DECIMAL(10,2)"`
+	Value4         string    `xorm:"comment('值4') DECIMAL(10,2)"`
+	Value5         string    `xorm:"comment('值5') DECIMAL(10,2)"`
+	Value6         string    `xorm:"comment('值6') DECIMAL(10,2)"`
+	Zerovalue      string    `xorm:"comment('零点漂移(%FS)') DECIMAL(10,2)"`
+	Showvalue      string    `xorm:"comment('示值漂移(%FS)') DECIMAL(10,2)"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	Createuserid   int       `xorm:"INT(11)"`
+	Createon       time.Time `xorm:"DATETIME"`
+	Createby       string    `xorm:"VARCHAR(50)"`
+	Modifiedon     time.Time `xorm:"DATETIME"`
+	Modifieduserid int       `xorm:"INT(11)"`
+	Modifiedby     string    `xorm:"VARCHAR(50)"`
+}

+ 27 - 0
src/dashoo.cn/backend/api/business/Limsreportalertor/limsreportalertorvalue.go

@@ -0,0 +1,27 @@
+package limsreportalertor
+
+import (
+	"time"
+)
+
+type LimsReportAlertorValue struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	Eid            int       `xorm:"comment('委托单ID') INT(10)"`
+	Taskbalanceid  int       `xorm:"comment('任务分配表ID') INT(10)"`
+	Dataentryid    int       `xorm:"comment('数据记录表ID') INT(10)"`
+	Alertfunction  string    `xorm:"comment('报警功能') VARCHAR(255)"`
+	Surevalue      string    `xorm:"default 0.00 comment('仪器设定报警点(*10-6mol/mol)') DECIMAL(10,2)"`
+	Value1         string    `xorm:"default 0.00 comment('实测报警值1') DECIMAL(10,2)"`
+	Value2         string    `xorm:"default 0.00 comment('实测报警值2') DECIMAL(10,2)"`
+	Value3         string    `xorm:"default 0.00 comment('实测报警值3') DECIMAL(10,2)"`
+	Maxvalue       string    `xorm:"default 0.00 comment('报警浓度最大值(*10-6mol/mol)') DECIMAL(10,2)"`
+	Allowvalue     string    `xorm:"default 0.00 comment('报警浓度最大值(*10-6mol/mol)') DECIMAL(10,2)"`
+	Actionvalue    string    `xorm:"default 0.00 comment('报警动作值') DECIMAL(10,2)"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	Createuserid   int       `xorm:"INT(11)"`
+	Createon       time.Time `xorm:"DATETIME"`
+	Createby       string    `xorm:"VARCHAR(50)"`
+	Modifiedon     time.Time `xorm:"DATETIME"`
+	Modifieduserid int       `xorm:"INT(11)"`
+	Modifiedby     string    `xorm:"VARCHAR(50)"`
+}

+ 1 - 0
src/dashoo.cn/backend/api/controllers/base.go

@@ -223,6 +223,7 @@ var (
 	BaseUserName                             string = "Base_User"           //用户表
 	UserQualificationName                    string = "UserQualification"   //用户资质表
 	LimsInstrumentGroup                      string = "LimsInstrumentGroup" // 检测仪器关联
+	LimsReportAlertorName					 string = "LimsReportAlertor" // 计量站报警器
 )
 
 //分页信息及数据

+ 350 - 0
src/dashoo.cn/backend/api/controllers/lims/limsreportalertor.go

@@ -0,0 +1,350 @@
+package lims
+
+import (
+	"dashoo.cn/business/userRole"
+	"dashoo.cn/backend/api/business/baseUser"
+	"dashoo.cn/backend/api/business/limsreportalertor"
+	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/utils"
+	"encoding/json"
+	"strings"
+	"time"
+)
+
+type LimsReportAlertorController struct {
+	BaseController
+}
+
+// @Title 获取列表
+// @Description get user by token
+// @Success 200 {object} []limsreportalertor.LimsReportAlertor
+// @router /list [get]
+func (this *LimsReportAlertorController) 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")
+	MeterRange := this.GetString("MeterRange")
+	MeasurementRange := this.GetString("MeasurementRange")
+	DetectBasis := this.GetString("DetectBasis")
+	FaceCheck := this.GetString("FaceCheck")
+	FlagCheck := this.GetString("FlagCheck")
+	ElectrifyCheck := this.GetString("ElectrifyCheck")
+	Insulation := this.GetString("Insulation")
+	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 MeterRange != "" {
+		where = where + " and MeterRange like '%" + MeterRange + "%'"
+	}
+
+
+	if MeasurementRange != "" {
+		where = where + " and MeasurementRange like '%" + MeasurementRange + "%'"
+	}
+
+
+	if DetectBasis != "" {
+		where = where + " and DetectBasis like '%" + DetectBasis + "%'"
+	}
+
+
+	if FaceCheck != "" {
+		where = where + " and FaceCheck like '%" + FaceCheck + "%'"
+	}
+
+
+	if FlagCheck != "" {
+		where = where + " and FlagCheck like '%" + FlagCheck + "%'"
+	}
+
+
+	if ElectrifyCheck != "" {
+		where = where + " and ElectrifyCheck like '%" + ElectrifyCheck + "%'"
+	}
+
+
+	if Insulation != "" {
+		where = where + " and Insulation like '%" + Insulation + "%'"
+	}
+
+
+	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 := limsreportalertor.GetLimsReportAlertorService(utils.DBE)
+	var list []limsreportalertor.LimsReportAlertor
+	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 *LimsReportAlertorController) 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} limsreportalertor.LimsReportAlertor
+// @router /get/:id [get]
+func (this *LimsReportAlertorController) GetEntity() {
+	Id := this.Ctx.Input.Param(":id")
+
+	var model limsreportalertor.LimsReportAlertor
+	svc := limsreportalertor.GetLimsReportAlertorService(utils.DBE)
+	svc.GetEntityByIdBytbl(this.User.AccCode+LimsReportAlertorName, Id, &model)
+
+	this.Data["json"] = &model
+	this.ServeJSON()
+}
+
+// @Title 添加
+// @Description 新增
+// @Param 	body body limsreportalertor.LimsReportAlertor
+// @Success	200	{object} controllers.Request
+// @router /add [post]
+func (this *LimsReportAlertorController) AddEntity() {
+	var model limsreportalertor.LimsReportAlertor
+	var jsonBlob = this.Ctx.Input.RequestBody
+	svc := limsreportalertor.GetLimsReportAlertorService(utils.DBE)
+
+	json.Unmarshal(jsonBlob, &model)
+	model.CreateOn = time.Now()
+	model.CreateBy = this.User.Realname
+	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+	//model.OrganizeId, _ = utils.StrTo(this.User.DepartmentId).Int()
+
+	_, err := svc.InsertEntityBytbl(this.User.AccCode+LimsReportAlertorName, &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 limsreportalertor.LimsReportAlertor
+// @Success	200	{object} controllers.Request
+// @router /update/:id [post]
+func (this *LimsReportAlertorController) 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 limsreportalertor.LimsReportAlertor
+	svc := limsreportalertor.GetLimsReportAlertorService(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",
+
+		"MeterRange",
+
+		"MeasurementRange",
+
+		"DetectBasis",
+
+		"FaceCheck",
+
+		"FlagCheck",
+
+		"ElectrifyCheck",
+
+		"Insulation",
+
+		"Remark",
+
+		"CreateUserId",
+
+		"CreateOn",
+
+		"CreateBy",
+
+		"ModifiedOn",
+
+		"ModifiedUserId",
+
+		"ModifiedBy",
+
+
+	}
+	err := svc.UpdateEntityBytbl(this.User.AccCode+LimsReportAlertorName, 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 *LimsReportAlertorController) 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 limsreportalertor.LimsReportAlertor
+	var entityempty limsreportalertor.LimsReportAlertor
+	svc := limsreportalertor.GetLimsReportAlertorService(utils.DBE)
+	opdesc := "删除-" + Id
+	err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+LimsReportAlertorName, 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()
+	}
+}

+ 41 - 0
src/dashoo.cn/frontend_web/src/api/lims/reportalertor.js

@@ -0,0 +1,41 @@
+export default {
+  getList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/limsreportalertor/list?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  getDictList (myAxios) {
+    return myAxios({
+      url: '/limsreportalertor/dictlist/',
+      method: 'GET'
+    })
+  },
+  getEntity (entityId, myAxios) {
+    return myAxios({
+      url: '/limsreportalertor/get/' + entityId,
+      method: 'GET'
+    })
+  },
+  addEntity (formData, myAxios) {
+    return myAxios({
+      url: '/limsreportalertor/add',
+      method: 'post',
+      data: formData
+    })
+  },
+  updateEntity (entityId, formData, myAxios) {
+    return myAxios({
+      url: '/limsreportalertor/update/' + entityId,
+      method: 'post',
+      data: formData
+    })
+  },
+  deleteEntity (entityId, myAxios) {
+    return myAxios({
+      url: '/limsreportalertor/delete/' + entityId,
+      method: 'delete'
+    })
+  }
+}

+ 282 - 0
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorben/_opera/operation.vue

@@ -0,0 +1,282 @@
+
+
+<template>
+  <div>
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item :to="{ path: '/lims/reportalertorben' }">苯气检测报警器检定记录</el-breadcrumb-item>
+      <el-breadcrumb-item>编辑</el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-card class="box-card" style="height: calc(100vh - 113px);">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> 编辑
+        </span>
+        <span style="float: right;">
+          <el-button type="primary" size="mini" @click="saveEntity">保存</el-button>
+          <router-link :to="'/lims/dataentry'">
+            <el-button type="primary" size="mini" style="margin-left: 8px">返回</el-button>
+          </router-link>
+        </span>
+      </div>
+      <el-form label-width="110px" ref="EntityForm" :model="formData">
+        <el-row>
+          <!--<el-col :span="8">
+            <el-form-item label="DEMO">
+              <el-select ref="selectWellNo" v-model="formData.WellNoId" filterable placeholder="请选择" style="width: 100%">
+                <el-option
+                  v-for="item in wellNoOptions"
+                  :key="item.Id"
+                  :label="item.Value"
+                  :value="item.Id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>-->
+
+          <el-col :span="8">
+            <el-form-item label="">
+              <el-input v-model="formData.Id" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="委托单ID">
+              <el-input v-model="formData.EId" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="任务分配表ID">
+              <el-input v-model="formData.TaskBalanceId" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="数据记录表ID">
+              <el-input v-model="formData.DataEntryId" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="量程(*10-6mol/mol)">
+              <el-input v-model="formData.MeterRange" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="测量范围(*10-6mol/mol)">
+              <el-input v-model="formData.MeasurementRange" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="检测依据">
+              <el-input v-model="formData.DetectBasis" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="外观及结构">
+              <el-input v-model="formData.FaceCheck" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="标志标识">
+              <el-input v-model="formData.FlagCheck" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="通电检查">
+              <el-input v-model="formData.ElectrifyCheck" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="绝缘电阻">
+              <el-input v-model="formData.Insulation" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="备注">
+              <el-input v-model="formData.Remark" placeholder="请输入"  style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+
+        </el-row>
+      </el-form>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+  import api from '@/api/lims/reportalertor'
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 's5ovelimsreportalertorEdit',
+
+    data () {
+      return {
+        serviceId: '',
+        formData: {
+          Id: '',
+          EId: '',
+          TaskBalanceId: '',
+          DataEntryId: '',
+          MeterRange: '',
+          MeasurementRange: '',
+          DetectBasis: '',
+          FaceCheck: '',
+          FlagCheck: '',
+          ElectrifyCheck: '',
+          Insulation: '',
+          Remark: '',
+          CreateUserId: '',
+          CreateOn: '',
+          CreateBy: '',
+          ModifiedOn: '',
+          ModifiedUserId: '',
+          ModifiedBy: '',
+
+        },
+
+        //下拉选择项
+        //wellNoOptions: [],
+        //supervisersOptions: [],
+
+      }
+    },
+    created() {
+      this.serviceId = this.$route.params.opera;
+      this.getDictOptions();
+      console.log(this.serviceId);
+      if(this.serviceId != 'add' && this.serviceId>0) {
+        this.formData.Id = this.serviceId;
+        this.initDatas();
+      } else {
+        this.formData.Id = 0;
+      }
+    },
+    methods: {
+      initDatas() {
+        if(this.formData.Id) {
+          api.getEntity(this.formData.Id, this.$axios).then(res => {
+            this.formData = res.data;
+          }).catch(err => {
+            console.error(err)
+          });
+        }
+      },
+
+      getDictOptions() {
+        api.getDictList(this.$axios).then(res => {
+          //this.wellNoOptions = res.data.items['WellNo']
+          //this.supervisersOptions = res.data.items['Supervisers']
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      //保存信息
+      saveEntity() {
+        this.$refs['EntityForm'].validate((valid) => {
+          if (valid) {
+            //this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+
+            if (!this.formData.Id) {
+              this.addEntity();
+            } else {
+              this.updateEntity();
+            }
+
+          } else {
+            return false
+          }
+        })
+      },
+
+      addEntity() {
+        api.addEntity(this.formData, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            //保存成功后,初始化数据,变成修改
+            this.formData.Id = res.data.item;
+            this.initDatas();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
+
+      updateEntity() {
+        api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            //保存成功后,初始化数据,变成修改
+            this.initDatas();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
+
+      jstimehandle(val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+
+      formatDateTime(date) {
+        var y = date.getFullYear();
+        var m = date.getMonth() + 1;
+        m = m < 10 ? ('0' + m) : m;
+        var d = date.getDate();
+        d = d < 10 ? ('0' + d) : d;
+        var h = date.getHours();
+        var minute = date.getMinutes();
+        minute = minute < 10 ? ('0' + minute) : minute;
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+      }
+    }
+  }
+
+</script>
+
+<style lang="scss">
+
+</style>