Bladeren bron

fix(bug): 调度
1. 删除无用代码
2. 修改异常提示信息

luchm 3 jaren geleden
bovenliggende
commit
9d66cfed0c

+ 0 - 79
src/dashoo.cn/genepoint_srv/business/converseService/converseService.go

@@ -1069,86 +1069,7 @@ func (this *ConverseService) getAllSampleIdsFromResEntity(entity ResponseEntity)
 	return
 }
 
-////样本状态修改
-//func (this *ConverseService)SampleStatusModify(statusCode int , res ResponseEntity){
-//	if statusCode == SUCCESS {
-//		this.SampleApplyDetailStatusBatchModify(statusCode, res.Data.Task_id)
-//	}else if statusCode == REJECT {
-//		this.SampleApplyDetailStatusBatchModify(FAILED, res.Data.Task_id)
-//	}else if statusCode == FAILED {
-//		this.SampleApplyDetailStatusPartsModify(res)
-//	}
-//}
 
-//获取任务原始信息
-//func (this *ConverseService) GetBasicTaskInfo(task_id string) ([]Sample_Storage_Task, error){
-//	sql := `SELECT
-//				d.EquipmentId,
-//				e.RowNum e_row,
-//				e.ColumnNum e_col,
-//				d.ShelfId,
-//				s.XStation s_x,
-//				s.YStation s_y,
-//				s.RowNum s_row,
-//				s.ColumnNum s_col,
-//				d.BoxId,
-//				b.XStation b_x,
-//				b.YStation b_y,
-//				b.RowNum b_row,
-//				b.ColumnNum b_col,
-//				d.Position,
-//				d.BarCode,
-//				a.EntryNo task_id
-//			FROM
-//				` + TABLE_DETAIL + ` d
-//				JOIN ` + TABLE_EQUIPMENT + ` e ON d.EquipmentId = e.Id
-//				JOIN ` + TABLE_SHELF + ` s ON d.ShelfId = s.Id
-//				JOIN ` + TABLE_BOX + ` b ON d.BoxId = b.Id
-//				JOIN ` + TABLE_SAMPLE_APPLY + ` a ON d.ParentId = a.Id
-//			WHERE
-//				a.EntryNo = '` + task_id + `' AND a.ApplyStatus = '2'`
-//	var list []Sample_Storage_Task
-//	err := this.DBE.SQL(sql).Find(&list)
-//	if err != nil {
-//		return nil,err
-//	}
-//	return list,err
-//}
-
-//原始位置信息转换 样本库调用
-//func (this *ConverseService) TransferPosition(one *Sample_Storage_Task) {
-//	one.Unit = (one.S_Y-1)*one.E_Col + one.S_X
-//	one.Pos = (one.B_Y-1)*one.S_Col + one.B_X
-//	if one.Position != "" {
-//		coord := strings.Split(one.Position, ";")
-//		x, _ := strconv.Atoi(coord[0])
-//		y, _ := strconv.Atoi(coord[1])
-//		one.No = (y-1)*one.B_Col + x
-//	}
-//	one.Ltu = LTU
-//	//one.Group = GROUP
-//}
-
-//处理任务原始信息   样本库调用
-//func (this *ConverseService) HandleTaskInfo(list []Sample_Storage_Task, applyType string) *[]Sample_Storage_Task{
-//	var resultList []Sample_Storage_Task
-//	for _, value := range list {
-//		this.AddTaskType(&value, applyType)
-//		this.TransferPosition(&value)
-//		resultList = append(resultList, value)
-//	}
-//	return &resultList
-//}
-
-//添加任务类型
-//func (this *ConverseService) AddTaskType(one *Sample_Storage_Task, applyType string){
-//	if  applyType == "1" {
-//		one.Task_type = 3	//冻存管入库
-//		one.OperaMode = "manua"
-//	}else if applyType == "2" {
-//		one.Task_type = 4	//冻存管出库
-//	}
-//}
 
 //保存异常信息
 func (this *ConverseService) SaveTaskExcepMsg(msg, taskId string) error {

+ 3 - 3
src/dashoo.cn/genepoint_srv/controllers/converse/converse.go

@@ -217,10 +217,10 @@ func (this *ConverseController) HandleMessage(n int, message []byte) {
 			err = this.StatusModify(ACCEPT, taskId, resp,"")
 		} else if taskType == "running" {
 			log.Println(">>>>>>>>>>任务[" + taskId + "]执行中>>>>>>>>>>")
-			err = this.StatusModify(RUNNING, taskId, resp,"")
+			err = this.StatusModify(RUNNING, taskId, resp,  res.Data.Msg)
 		} else if taskType == "rack_retrieving" {
 			log.Println(">>>>>>>>>>任务[" + taskId + "]执行中>>>>>>>>>>")
-			err = this.StatusModify(RACKRETRIEVING, taskId, resp,"")
+			err = this.StatusModify(RACKRETRIEVING, taskId, resp, res.Data.Msg)
 		}
 		// 执行过程返回响应报文的处理
 		if resp == "task_activate" {
@@ -237,7 +237,7 @@ func (this *ConverseController) HandleMessage(n int, message []byte) {
 		log.Println("----------任务[" + taskId + "]任务拒绝----------")
 		//保存异常信息
 		this.SaveExcepMsg(res, taskId, resp)
-		err = this.StatusModify(REJECT, taskId, resp,"")
+		err = this.StatusModify(REJECT, taskId, resp,res.Data.Causes[0].Msg)
 		// 判断如果为盒操作, 需要将 盒解锁, 重新执行时再上锁
 		if resp == "rack_storing" || resp == "rack_retrieving" {
 			err = this.UpdateBoxIsLocked(taskId)