Browse Source

feature:基点任务变更 添加完整任务ID

liran 1 year ago
parent
commit
d55c083189

+ 34 - 33
src/dashoo.cn/genepoint_srv/business/converseService/converse.go

@@ -199,39 +199,40 @@ type GenePoint_Device_Report_Data struct {
 }
 
 type Sample_Storage_Task struct {
-	Id          int
-	Task_id     string
-	Task_type   int
-	EquipmentId int
-	Cu          int
-	E_Row       int
-	E_Col       int
-	Ltu         int
-	Group       int
-	ShelfId     int
-	S_Row       int
-	S_Col       int
-	S_X         int
-	S_Y         int
-	BoxId       string
-	BoxBarcode  string
-	B_Row       int
-	B_Col       int
-	B_X         int
-	B_Y         int
-	BoxType     int
-	BarCode     string
-	TubeType    int
-	Status      int
-	Position    string
-	No          int
-	Unit        int
-	Pos         int
-	StatusCode  int
-	OperaMode   string
-	Exception   string `xorm:"VARCHAR(512)"`
-	Remark      string
-	SourceBox   string // 源盒编码
+	Id           int
+	Task_id      string
+	Full_task_id string
+	Task_type    int
+	EquipmentId  int
+	Cu           int
+	E_Row        int
+	E_Col        int
+	Ltu          int
+	Group        int
+	ShelfId      int
+	S_Row        int
+	S_Col        int
+	S_X          int
+	S_Y          int
+	BoxId        string
+	BoxBarcode   string
+	B_Row        int
+	B_Col        int
+	B_X          int
+	B_Y          int
+	BoxType      int
+	BarCode      string
+	TubeType     int
+	Status       int
+	Position     string
+	No           int
+	Unit         int
+	Pos          int
+	StatusCode   int
+	OperaMode    string
+	Exception    string `xorm:"VARCHAR(512)"`
+	Remark       string
+	SourceBox    string // 源盒编码
 }
 
 type Id struct {

+ 8 - 1
src/dashoo.cn/genepoint_srv/business/converseService/converseService.go

@@ -132,6 +132,13 @@ func (this *ConverseService) ScanNewTaskDetail() []Sample_Storage_Task {
 	return tasks
 }
 
+// 更新任务表的完整TaskId
+func (this *ConverseService) UpdateFullTaskId(id int, fullTaskId string) (err error) {
+	updApplySql := fmt.Sprintf("UPDATE %s SET Full_task_id = %s WHERE id = %d", TABLE_TAST, fullTaskId, id)
+	_, err = this.DBE.Exec(updApplySql)
+	return
+}
+
 // 获取申请单创建人
 func (this *ConverseService) GetOperUser(EntryNo string) (user string) {
 
@@ -401,7 +408,7 @@ func handleTaskChange(entity *RequestEntity, detail *Sample_Storage_Task) {
 	if detail.Status == 705 {
 		entity.Data.Status = 5 // 暂停任务
 	}
-	entity.Data.Task_id = detail.Task_id
+	entity.Data.Task_id = detail.Full_task_id
 	entity.Data.OrderTime = time.Now().UTC().Format(time.RFC3339)
 }
 

+ 5 - 0
src/dashoo.cn/genepoint_srv/controllers/converse/converse.go

@@ -65,6 +65,11 @@ func (ctrl *ConverseController) SearchDatabase() map[string]*RequestEntity {
 		//处理任务详细
 		svc.HandleTaskDetail(value.Task_type, reqMap[value.Task_id], &value)
 
+		// 记录完整的taskId
+		err := svc.UpdateFullTaskId(value.Id, taskid)
+		if err != nil {
+			log.Println("更新完整taskId失败", err)
+		}
 	}
 	for _, v := range reqMap {
 		//log.Println("****************************")