|
@@ -71,7 +71,7 @@ func (this *ConverseService) GetSessionSetupRequest(utc string) *RequestEntity {
|
|
|
return entity
|
|
return entity
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//生成请求报文
|
|
|
|
|
|
|
+// 生成请求报文
|
|
|
func (this *ConverseService) GetRequestEntity(request string, utc string, data RequestData) *RequestEntity {
|
|
func (this *ConverseService) GetRequestEntity(request string, utc string, data RequestData) *RequestEntity {
|
|
|
var entity RequestEntity
|
|
var entity RequestEntity
|
|
|
entity.Request = request
|
|
entity.Request = request
|
|
@@ -93,7 +93,7 @@ func (this *ConverseService) GetKeyBaseOnTime(utc string) string {
|
|
|
return resultKey
|
|
return resultKey
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//查询库存冻存盒信息
|
|
|
|
|
|
|
+// 查询库存冻存盒信息
|
|
|
func (this *ConverseService) CheckStockRackInfo(cu int, rack_id string, utc string) *RequestEntity {
|
|
func (this *ConverseService) CheckStockRackInfo(cu int, rack_id string, utc string) *RequestEntity {
|
|
|
var request = "stock_rack"
|
|
var request = "stock_rack"
|
|
|
var data RequestData
|
|
var data RequestData
|
|
@@ -103,7 +103,7 @@ func (this *ConverseService) CheckStockRackInfo(cu int, rack_id string, utc stri
|
|
|
return entity
|
|
return entity
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//查询库存冻存管信息
|
|
|
|
|
|
|
+// 查询库存冻存管信息
|
|
|
func (this *ConverseService) CheckStockTubeInfo(cu int, rack_id, tube_id, utc string) *RequestEntity {
|
|
func (this *ConverseService) CheckStockTubeInfo(cu int, rack_id, tube_id, utc string) *RequestEntity {
|
|
|
var request = "stock_rack_tube"
|
|
var request = "stock_rack_tube"
|
|
|
var data RequestData
|
|
var data RequestData
|
|
@@ -114,7 +114,7 @@ func (this *ConverseService) CheckStockTubeInfo(cu int, rack_id, tube_id, utc st
|
|
|
return entity
|
|
return entity
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//任务撤销
|
|
|
|
|
|
|
+// 任务撤销
|
|
|
func (this *ConverseService) CancelTast(utc string, task_id string) *RequestEntity {
|
|
func (this *ConverseService) CancelTast(utc string, task_id string) *RequestEntity {
|
|
|
var request = "task_change"
|
|
var request = "task_change"
|
|
|
var data RequestData
|
|
var data RequestData
|
|
@@ -124,7 +124,7 @@ func (this *ConverseService) CancelTast(utc string, task_id string) *RequestEnti
|
|
|
return entity
|
|
return entity
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//扫描新任务
|
|
|
|
|
|
|
+// 扫描新任务
|
|
|
func (this *ConverseService) ScanNewTaskDetail() []Sample_Storage_Task {
|
|
func (this *ConverseService) ScanNewTaskDetail() []Sample_Storage_Task {
|
|
|
var tasks []Sample_Storage_Task
|
|
var tasks []Sample_Storage_Task
|
|
|
where := "statuscode = 0"
|
|
where := "statuscode = 0"
|
|
@@ -141,7 +141,7 @@ func (this *ConverseService) GetOperUser(EntryNo string) (user string) {
|
|
|
return user
|
|
return user
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//新任务数量
|
|
|
|
|
|
|
+// 新任务数量
|
|
|
func (this *ConverseService) GetNewTaskBasic() []Sample_Storage_Task {
|
|
func (this *ConverseService) GetNewTaskBasic() []Sample_Storage_Task {
|
|
|
//var count64 int64
|
|
//var count64 int64
|
|
|
var tasks []Sample_Storage_Task
|
|
var tasks []Sample_Storage_Task
|
|
@@ -247,7 +247,7 @@ func (this *ConverseService) HandleTaskDetail(taskType int, entity *RequestEntit
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//处理冻存盒入库任务信息
|
|
|
|
|
|
|
+// 处理冻存盒入库任务信息
|
|
|
func handleRackStore(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
func handleRackStore(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
var ones = make([]Single, 0)
|
|
var ones = make([]Single, 0)
|
|
|
var exist bool
|
|
var exist bool
|
|
@@ -292,7 +292,7 @@ func handleRackStore(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
entity.Data.Task_data = ones
|
|
entity.Data.Task_data = ones
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//处理冻存盒出库任务信息
|
|
|
|
|
|
|
+// 处理冻存盒出库任务信息
|
|
|
func handleRackRetrieve(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
func handleRackRetrieve(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
var ones []Single
|
|
var ones []Single
|
|
|
var one Single
|
|
var one Single
|
|
@@ -311,7 +311,7 @@ func handleRackRetrieve(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
entity.Data.Task_data = ones
|
|
entity.Data.Task_data = ones
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//处理冻存管入库任务信息
|
|
|
|
|
|
|
+// 处理冻存管入库任务信息
|
|
|
func handleTubeStore(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
func handleTubeStore(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
var ones []Single
|
|
var ones []Single
|
|
|
var exist bool
|
|
var exist bool
|
|
@@ -372,7 +372,7 @@ label:
|
|
|
entity.Data.Task_data = ones
|
|
entity.Data.Task_data = ones
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//处理冻存管出库任务信息
|
|
|
|
|
|
|
+// 处理冻存管出库任务信息
|
|
|
func handleTubeRetrieve(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
func handleTubeRetrieve(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
var one OutSingle
|
|
var one OutSingle
|
|
|
//var exist bool
|
|
//var exist bool
|
|
@@ -393,18 +393,25 @@ func handleTubeRetrieve(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
entity.Data.Task_data = one
|
|
entity.Data.Task_data = one
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//任务撤销
|
|
|
|
|
|
|
+// 任务变更
|
|
|
func handleTaskChange(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
func handleTaskChange(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
- entity.Data.Status = detail.Status
|
|
|
|
|
|
|
+ if detail.Status == 703 {
|
|
|
|
|
+ entity.Data.Status = 3 //任务重启
|
|
|
|
|
+ }
|
|
|
|
|
+ if detail.Status == 705 {
|
|
|
|
|
+ entity.Data.Status = 5 // 暂停任务
|
|
|
|
|
+ }
|
|
|
|
|
+ entity.Data.Task_id = detail.Task_id
|
|
|
|
|
+ entity.Data.OrderTime = time.Now().UTC().Format(time.RFC3339)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//查询冻存盒库存信息
|
|
|
|
|
|
|
+// 查询冻存盒库存信息
|
|
|
func handleQueryRack(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
func handleQueryRack(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
entity.Data.Cu = detail.Cu
|
|
entity.Data.Cu = detail.Cu
|
|
|
entity.Data.Rack_id = detail.BoxBarcode
|
|
entity.Data.Rack_id = detail.BoxBarcode
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//查询冻存管库存信息
|
|
|
|
|
|
|
+// 查询冻存管库存信息
|
|
|
func handleQueryTube(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
func handleQueryTube(entity *RequestEntity, detail *Sample_Storage_Task) {
|
|
|
entity.Data.Rack_id = detail.BoxBarcode
|
|
entity.Data.Rack_id = detail.BoxBarcode
|
|
|
entity.Data.Tube_id = detail.BarCode
|
|
entity.Data.Tube_id = detail.BarCode
|
|
@@ -497,7 +504,7 @@ func (this *ConverseService) StatusModifyWithDetail(task_id string, res Response
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//修改任务表状态码
|
|
|
|
|
|
|
+// 修改任务表状态码
|
|
|
func (this *ConverseService) TaskStatusModify(statusCode int, task_id string) error {
|
|
func (this *ConverseService) TaskStatusModify(statusCode int, task_id string) error {
|
|
|
sql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(statusCode) + "' WHERE task_id = '" + task_id + "'"
|
|
sql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(statusCode) + "' WHERE task_id = '" + task_id + "'"
|
|
|
_, err := this.DBE.Exec(sql)
|
|
_, err := this.DBE.Exec(sql)
|
|
@@ -527,7 +534,7 @@ func (this *ConverseService) SampleApplyStatusModify(statusCode int, entryNo, ms
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//2020/12/18新增 根据当前任务报文返回状态批量更新当前任务下所有的样本状态
|
|
|
|
|
|
|
+// 2020/12/18新增 根据当前任务报文返回状态批量更新当前任务下所有的样本状态
|
|
|
func (this *ConverseService) SampleApplyDetailStatusModify(statusCode int, entryNo string) error {
|
|
func (this *ConverseService) SampleApplyDetailStatusModify(statusCode int, entryNo string) error {
|
|
|
|
|
|
|
|
//获取出入库单Id
|
|
//获取出入库单Id
|
|
@@ -543,7 +550,7 @@ func (this *ConverseService) SampleApplyDetailStatusModify(statusCode int, entry
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//任务执行驳回, 修改全部样本失败状态
|
|
|
|
|
|
|
+// 任务执行驳回, 修改全部样本失败状态
|
|
|
func (this *ConverseService) ModifySampleAllRejectStatus(res ResponseEntity) error {
|
|
func (this *ConverseService) ModifySampleAllRejectStatus(res ResponseEntity) error {
|
|
|
//获取出入库单Id
|
|
//获取出入库单Id
|
|
|
getId := "SELECT id FROM " + TABLE_SAMPLE_APPLY + " WHERE entryno = '" + res.Data.Task_id + "'"
|
|
getId := "SELECT id FROM " + TABLE_SAMPLE_APPLY + " WHERE entryno = '" + res.Data.Task_id + "'"
|
|
@@ -573,7 +580,7 @@ func (this *ConverseService) handleSampleFailed(idsStr string, response string,
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//处理样本执行成功状态
|
|
|
|
|
|
|
+// 处理样本执行成功状态
|
|
|
func (this *ConverseService) handleSampleSuccess(idsStr string, response string, applyMainId int) {
|
|
func (this *ConverseService) handleSampleSuccess(idsStr string, response string, applyMainId int) {
|
|
|
if strings.Contains(response, "tube_storing") {
|
|
if strings.Contains(response, "tube_storing") {
|
|
|
this.sampleRKSuccessDBModify(idsStr, applyMainId)
|
|
this.sampleRKSuccessDBModify(idsStr, applyMainId)
|
|
@@ -583,7 +590,7 @@ func (this *ConverseService) handleSampleSuccess(idsStr string, response string,
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//入库成功, 修改样本数据库状态信息
|
|
|
|
|
|
|
+// 入库成功, 修改样本数据库状态信息
|
|
|
func (this *ConverseService) sampleRKSuccessDBModify(idsStr string, parentId int) error {
|
|
func (this *ConverseService) sampleRKSuccessDBModify(idsStr string, parentId int) error {
|
|
|
fmt.Println("开始更新样本入库信息, 包括更新容量,状态, 锁定状态")
|
|
fmt.Println("开始更新样本入库信息, 包括更新容量,状态, 锁定状态")
|
|
|
// add by 徐春林 基点入库成功, 根据样本入库详情表中 更新 样本的 剩余容量
|
|
// add by 徐春林 基点入库成功, 根据样本入库详情表中 更新 样本的 剩余容量
|
|
@@ -605,7 +612,7 @@ func (this *ConverseService) sampleRKSuccessDBModify(idsStr string, parentId int
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//出库成功, 修改样本数据库状态信息
|
|
|
|
|
|
|
+// 出库成功, 修改样本数据库状态信息
|
|
|
func (this *ConverseService) sampleCKSuccessDBModify(idsStr string, parentId int) error {
|
|
func (this *ConverseService) sampleCKSuccessDBModify(idsStr string, parentId int) error {
|
|
|
var list []Bank_Apply_Detail
|
|
var list []Bank_Apply_Detail
|
|
|
var onHold []string
|
|
var onHold []string
|
|
@@ -636,7 +643,7 @@ func (this *ConverseService) sampleCKSuccessDBModify(idsStr string, parentId int
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//获取出入库单信息
|
|
|
|
|
|
|
+// 获取出入库单信息
|
|
|
func (this *ConverseService) GetApplyMain(entryNo string) Bank_Apply_Main {
|
|
func (this *ConverseService) GetApplyMain(entryNo string) Bank_Apply_Main {
|
|
|
where := "entryNo = '" + entryNo + "'"
|
|
where := "entryNo = '" + entryNo + "'"
|
|
|
var entity Bank_Apply_Main
|
|
var entity Bank_Apply_Main
|
|
@@ -644,7 +651,7 @@ func (this *ConverseService) GetApplyMain(entryNo string) Bank_Apply_Main {
|
|
|
return entity
|
|
return entity
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//根据出入库单信息判断任务信息, 并修改样本状态
|
|
|
|
|
|
|
+// 根据出入库单信息判断任务信息, 并修改样本状态
|
|
|
func (this *ConverseService) ModifySampleStatusByApplyMainInfo(entryNo string, resp string, entity ResponseEntity) {
|
|
func (this *ConverseService) ModifySampleStatusByApplyMainInfo(entryNo string, resp string, entity ResponseEntity) {
|
|
|
|
|
|
|
|
applyMain := this.GetApplyMain(entryNo)
|
|
applyMain := this.GetApplyMain(entryNo)
|
|
@@ -709,7 +716,7 @@ func (this *ConverseService) ModifySampleStatusByApplyMainInfo(entryNo string, r
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//2021/01/09 by 卢传敏
|
|
|
|
|
|
|
+// 2021/01/09 by 卢传敏
|
|
|
// 根据入库返回报文,更新 冻存盒的信息盒
|
|
// 根据入库返回报文,更新 冻存盒的信息盒
|
|
|
func (this *ConverseService) UpdateBoxInfo(entity ResponseEntity, parentId int) (err error) {
|
|
func (this *ConverseService) UpdateBoxInfo(entity ResponseEntity, parentId int) (err error) {
|
|
|
//1. 获取当前返回的 冻存架信息,
|
|
//1. 获取当前返回的 冻存架信息,
|
|
@@ -813,7 +820,7 @@ func (this *ConverseService) UpdateBoxAbnormalInfo(entity ResponseEntity, parent
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//2021/01/09 by 卢传敏
|
|
|
|
|
|
|
+// 2021/01/09 by 卢传敏
|
|
|
// 根据出库返回报文,更新 冻存盒的信息盒
|
|
// 根据出库返回报文,更新 冻存盒的信息盒
|
|
|
func (this *ConverseService) UpdateBoxInfoCK(entity ResponseEntity, parentId int) (err error) {
|
|
func (this *ConverseService) UpdateBoxInfoCK(entity ResponseEntity, parentId int) (err error) {
|
|
|
//1. 获取当前返回的 冻存架信息,
|
|
//1. 获取当前返回的 冻存架信息,
|
|
@@ -873,7 +880,8 @@ func (this *ConverseService) UpdateBoxIsLocked(taskId string) (err error) {
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
|
|
+/*
|
|
|
|
|
+*
|
|
|
修改detail 信息
|
|
修改detail 信息
|
|
|
*/
|
|
*/
|
|
|
func (this *ConverseService) UpdateDetail(BarCode string, entity ResponseEntity, parentId int, rack_id string) {
|
|
func (this *ConverseService) UpdateDetail(BarCode string, entity ResponseEntity, parentId int, rack_id string) {
|
|
@@ -976,7 +984,7 @@ func (this *ConverseService) UpdatePosition(rack_id string, tubes []Tube, entity
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//获取当前操作样本的id, 正常和异常的
|
|
|
|
|
|
|
+// 获取当前操作样本的id, 正常和异常的
|
|
|
func (this *ConverseService) getOperaSampleIdsStr(applyType, parentId int, resp string, entity ResponseEntity) (actualIds string, abnormalIds string) {
|
|
func (this *ConverseService) getOperaSampleIdsStr(applyType, parentId int, resp string, entity ResponseEntity) (actualIds string, abnormalIds string) {
|
|
|
|
|
|
|
|
//获取出入库单中所有样本信息
|
|
//获取出入库单中所有样本信息
|
|
@@ -1050,7 +1058,7 @@ func (this *ConverseService) getOperaSampleIdsStr(applyType, parentId int, resp
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//当任务为rack_retrieving 且 end 时, 获取所有样本Ids
|
|
|
|
|
|
|
+// 当任务为rack_retrieving 且 end 时, 获取所有样本Ids
|
|
|
func (this *ConverseService) getAllSampleIdsFromResEntity(entity ResponseEntity) (actualIds string, abnormalIds string) {
|
|
func (this *ConverseService) getAllSampleIdsFromResEntity(entity ResponseEntity) (actualIds string, abnormalIds string) {
|
|
|
//获取反馈报文中的所有成功样本Id列表
|
|
//获取反馈报文中的所有成功样本Id列表
|
|
|
var actualTubeIds []string
|
|
var actualTubeIds []string
|
|
@@ -1064,21 +1072,21 @@ func (this *ConverseService) getAllSampleIdsFromResEntity(entity ResponseEntity)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//保存异常信息
|
|
|
|
|
|
|
+// 保存异常信息
|
|
|
func (this *ConverseService) SaveTaskExcepMsg(msg, taskId string) error {
|
|
func (this *ConverseService) SaveTaskExcepMsg(msg, taskId string) error {
|
|
|
sql := "UPDATE " + TABLE_TAST + " SET exception = '" + msg + "' WHERE task_id = '" + taskId + "'"
|
|
sql := "UPDATE " + TABLE_TAST + " SET exception = '" + msg + "' WHERE task_id = '" + taskId + "'"
|
|
|
_, err := this.DBE.Exec(sql)
|
|
_, err := this.DBE.Exec(sql)
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//保存异常信息
|
|
|
|
|
|
|
+// 保存异常信息
|
|
|
func (this *ConverseService) SaveSampleExcepMsg(msg, entryNo string) error {
|
|
func (this *ConverseService) SaveSampleExcepMsg(msg, entryNo string) error {
|
|
|
sql := "UPDATE " + TABLE_SAMPLE_APPLY + " SET exception = '" + msg + "' WHERE entryno = '" + entryNo + "'"
|
|
sql := "UPDATE " + TABLE_SAMPLE_APPLY + " SET exception = '" + msg + "' WHERE entryno = '" + entryNo + "'"
|
|
|
_, err := this.DBE.Exec(sql)
|
|
_, err := this.DBE.Exec(sql)
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//根据条件删除数据,不记录日志
|
|
|
|
|
|
|
+// 根据条件删除数据,不记录日志
|
|
|
func (this *ConverseService) DeleteEntityBytbl(tablename string, where string) (err error) {
|
|
func (this *ConverseService) DeleteEntityBytbl(tablename string, where string) (err error) {
|
|
|
if where == "" {
|
|
if where == "" {
|
|
|
where = "1=2"
|
|
where = "1=2"
|
|
@@ -1088,14 +1096,14 @@ func (this *ConverseService) DeleteEntityBytbl(tablename string, where string) (
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//样本库分表
|
|
|
|
|
|
|
+// 样本库分表
|
|
|
func (s *ConverseSessionService) InsertEntityBytbl(tablename string, entity interface{}) (affected int64, err error) {
|
|
func (s *ConverseSessionService) InsertEntityBytbl(tablename string, entity interface{}) (affected int64, err error) {
|
|
|
affected, err = s.Session.Table(tablename).Insert(entity)
|
|
affected, err = s.Session.Table(tablename).Insert(entity)
|
|
|
LogError(err)
|
|
LogError(err)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//获取设备名称
|
|
|
|
|
|
|
+// 获取设备名称
|
|
|
func (s *ConverseService) GetEquipmentName(cu int) string {
|
|
func (s *ConverseService) GetEquipmentName(cu int) string {
|
|
|
sql := "SELECT name from " + TABLE_EQUIPMENT + " where cu = '" + strconv.Itoa(cu) + "'"
|
|
sql := "SELECT name from " + TABLE_EQUIPMENT + " where cu = '" + strconv.Itoa(cu) + "'"
|
|
|
var entity Equipment
|
|
var entity Equipment
|
|
@@ -1103,7 +1111,7 @@ func (s *ConverseService) GetEquipmentName(cu int) string {
|
|
|
return entity.Name
|
|
return entity.Name
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//异常信息转换
|
|
|
|
|
|
|
+// 异常信息转换
|
|
|
func (s *ConverseService) HandleCauses(causes []Cause) string {
|
|
func (s *ConverseService) HandleCauses(causes []Cause) string {
|
|
|
var exceptInfo string
|
|
var exceptInfo string
|
|
|
for _, cause := range causes {
|
|
for _, cause := range causes {
|
|
@@ -1113,7 +1121,7 @@ func (s *ConverseService) HandleCauses(causes []Cause) string {
|
|
|
return exceptInfo
|
|
return exceptInfo
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//根据异常码获取异常原因
|
|
|
|
|
|
|
+// 根据异常码获取异常原因
|
|
|
func (s *ConverseService) GetReason(cause Cause, equipmentName string) string {
|
|
func (s *ConverseService) GetReason(cause Cause, equipmentName string) string {
|
|
|
var reasonStr string
|
|
var reasonStr string
|
|
|
switch cause.Reason {
|
|
switch cause.Reason {
|
|
@@ -1151,7 +1159,7 @@ func (s *ConverseService) GetReason(cause Cause, equipmentName string) string {
|
|
|
return reasonStr
|
|
return reasonStr
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//处理Exceptions异常信息
|
|
|
|
|
|
|
+// 处理Exceptions异常信息
|
|
|
func (s *ConverseService) HandleExceptions(excepts []Exception) string {
|
|
func (s *ConverseService) HandleExceptions(excepts []Exception) string {
|
|
|
var exceptStr string
|
|
var exceptStr string
|
|
|
for _, except := range excepts {
|
|
for _, except := range excepts {
|
|
@@ -1184,7 +1192,7 @@ func (s *ConverseService) HandleExceptions(excepts []Exception) string {
|
|
|
return exceptStr
|
|
return exceptStr
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//处理返回设备状态数据, 并存储到数据表里
|
|
|
|
|
|
|
+// 处理返回设备状态数据, 并存储到数据表里
|
|
|
func RecordDeviceData(list []List_Data) {
|
|
func RecordDeviceData(list []List_Data) {
|
|
|
t := time.Now()
|
|
t := time.Now()
|
|
|
var data []GenePoint_Device_Report_Data
|
|
var data []GenePoint_Device_Report_Data
|
|
@@ -1237,7 +1245,7 @@ func (this *ConverseService) ApplyStatusModify(statusCode int, entryNo, msg stri
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//修改任务表状态码
|
|
|
|
|
|
|
+// 修改任务表状态码
|
|
|
func (this *ConverseService) ApplyTaskStatusModify(statusCode int, task_id, rack_id string) error {
|
|
func (this *ConverseService) ApplyTaskStatusModify(statusCode int, task_id, rack_id string) error {
|
|
|
sql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(statusCode) + "' WHERE " +
|
|
sql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(statusCode) + "' WHERE " +
|
|
|
" task_id = '" + task_id + "' and BoxBarcode = '" + rack_id + "' "
|
|
" task_id = '" + task_id + "' and BoxBarcode = '" + rack_id + "' "
|