Browse Source

fix(bug): 自动化调度优化
1. 基点自动化调度优化

luchm 3 năm trước cách đây
mục cha
commit
1f3d17abe1

+ 2 - 0
src/dashoo.cn/genepoint_srv/business/arrangeService/arrange.go

@@ -167,6 +167,8 @@ type Box struct {
 // 冻存架信息
 type Shelf struct {
 	EquipmentId  int // 设备id
+	Code  string   // 容器编码
+	Name  string   // 容器名称
 	Id int // 冻存架id
 	XStation   int   // 位置 X代表第几列
 	YStation   int    // 位置 Y代表第几行

+ 2 - 2
src/dashoo.cn/genepoint_srv/business/arrangeService/arrangeService.go

@@ -190,7 +190,7 @@ func (this *ArrangeService) UpdateBoxInfo(entity ResponseEntity) (err error) {
 		this.DBE.SQL(lengSql).Get(&equipment)
 
 
-		sql := "select b.id EquipmentId,a.id,a.XStation,a.YStation from bank_shelf a left join bank_equipment b  on a.EquipmentId = b.id  where  b.cu = '" + utils.ToStr(Cu) + "' " +
+		sql := "select b.id EquipmentId,a.id,b.code,b.name,a.XStation,a.YStation from bank_shelf a left join bank_equipment b  on a.EquipmentId = b.id  where  b.cu = '" + utils.ToStr(Cu) + "' " +
 			"and  a.Ltu = '" + utils.ToStr(Ltu) + "'   and a.Group ='" + utils.ToStr(Group) + "'"
 
 		// 拼接冻存盒位置信息
@@ -212,7 +212,7 @@ func (this *ArrangeService) UpdateBoxInfo(entity ResponseEntity) (err error) {
 
 		this.DBE.SQL(sql).Get(&shelf)
 		fmt.Println("冻存架信息:", shelf.Id, shelf.XStation, shelf.YStation)
-
+		position = shelf.Code + position
 
 		//  更新盒所在的冻存架的信息  计算位置信息,并更新
 		// 临时处理逻辑,默认 pos 为 盒子的  XStation

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

@@ -355,6 +355,8 @@ type Bank_Equipment struct {
 // 冻存架信息
 type Shelf struct {
 	EquipmentId  int // 设备id
+	Code  string   // 容器编码
+	Name  string   // 容器名称
 	Id int // 冻存架id
 	XStation   int   // 位置 X代表第几列
 	YStation   int    // 位置 Y代表第几行

+ 7 - 3
src/dashoo.cn/genepoint_srv/business/converseService/converseService.go

@@ -205,7 +205,11 @@ func (this *ConverseService) GenerateRequestEntity(taskType int, task_id, user s
 	if requestName != "stock_rack" && requestName != "stock_rack_tube" {
 		data.Task_id = task_id
 		data.Type = "begin"
+
+		// 自动化设备 必须要穿  Operation_user  用户信息
 		data.Operation_user = user
+		// 半自动化设备,不需要传  Operation_user  用户信息
+		//data.Operation_user = ""
 
 	}
 	entity := this.GetRequestEntity(requestName, utc, data)
@@ -740,7 +744,7 @@ func (this *ConverseService) UpdateBoxInfo(entity ResponseEntity,parentId int) (
 			lengSql := " select  * from bank_equipment    where  cu = '" + utils.ToStr(Cu) + "'  and    Ltu = '" + utils.ToStr(Ltu) + "'  "
 			this.DBE.SQL(lengSql).Get(&equipment)
 
-			sql  := "select b.id EquipmentId,a.id,a.XStation,a.YStation from bank_shelf a left join bank_equipment b  on a.EquipmentId = b.id  where  b.cu = '" + utils.ToStr(Cu) + "' " +
+			sql  := "select b.id EquipmentId,b.code,b.name,a.id,a.XStation,a.YStation from bank_shelf a left join bank_equipment b  on a.EquipmentId = b.id  where  b.cu = '" + utils.ToStr(Cu) + "' " +
 				"and  a.Ltu = '" + utils.ToStr(Ltu) + "'  and a.Group ='" + utils.ToStr(Group) + "'"
 			// 冷库设备
 			YStation:="  "
@@ -754,11 +758,11 @@ func (this *ConverseService) UpdateBoxInfo(entity ResponseEntity,parentId int) (
 			}
 
 			this.DBE.SQL(sql).Get(&shelf)
-			fmt.Println("冻存架信息:", shelf.Id, shelf.XStation, shelf.YStation)
+			fmt.Println("冻存架信息:",shelf.Code,shelf.Name, shelf.Id, shelf.XStation, shelf.YStation)
 
 			//  更新盒所在的冻存架的信息  计算位置信息,并更新
 			// 临时处理逻辑,默认 pos 为 盒子的  XStation
-			pos := equipment.Code + "-" + common.Boxlinename(shelf.YStation) + utils.ToStr(shelf.XStation) + "-" +
+			pos := shelf.Code + "-" + common.Boxlinename(shelf.YStation) + utils.ToStr(shelf.XStation) + "-" +
 				"" + common.Boxlinename(    Unit  ) + utils.ToStr(utils.ToStr(Pos))
 
 			possql := "update bank_box set XStation ='" + utils.ToStr(Pos) + "'  "+YStation+"," +

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

@@ -52,6 +52,7 @@ func (this *ConverseController) SearchDatabase() map[string]*RequestEntity {
 		} else {
 			user = svc.GetOperUser(value.Task_id)
 		}
+
 		taskid := value.Task_id + "@" + strconv.FormatInt(time, 10)
 		//	log.Println("taskid:", taskid)