|
|
@@ -711,23 +711,25 @@ func (this *ConverseService) UpdateBoxInfoCK(entity ResponseEntity) (err error)
|
|
|
|
|
|
for i := range entity.Data.Actual_data {
|
|
|
boxBarcode := entity.Data.Actual_data[i].Rack_id // 冻存盒编号
|
|
|
- //Cu := entity.Data.Actual_data[i].Target.Cu // 设备编号
|
|
|
- //Ltu := entity.Data.Actual_data[i].Target.Ltu //
|
|
|
- //Unit := entity.Data.Actual_data[i].Target.Unit
|
|
|
+ //Cu := entity.Data.Actual_data[i].source.Cu // 设备编号
|
|
|
+ //Ltu := entity.Data.Actual_data[i].source.Ltu //
|
|
|
+ //Unit := entity.Data.Actual_data[i].source.Unit
|
|
|
Pos := entity.Data.Actual_data[i].Target.Pos
|
|
|
- //Group := entity.Data.Actual_data[i].Target.Group
|
|
|
+ //Group := entity.Data.Actual_data[i].source.Group?
|
|
|
|
|
|
//fmt.Println("保存返回的冻存盒位置信息:cu:",Cu,",Ltu",Ltu,",Unit",Unit,",Group",Group,",Pos",Pos)
|
|
|
//
|
|
|
//sql := "select 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.Unit ='"+utils.ToStr(Unit) +"' and a.Group ='"+utils.ToStr(Group)+"'"
|
|
|
|
|
|
- //this.DBE.SQL(sql).Get(&shelf)
|
|
|
+ sql :=" select shelfId , EquipmentId from bank_box where code = '"+boxBarcode+"'"
|
|
|
+
|
|
|
+ this.DBE.SQL(sql).Get(&shelf)
|
|
|
fmt.Println("冻存架信息:", shelf.Id, shelf.XStation, shelf.YStation)
|
|
|
|
|
|
// 更新盒所在的冻存架的信息 计算位置信息,并更新
|
|
|
// 临时处理逻辑,默认 pos 为 盒子的 XStation
|
|
|
- _, err = this.DBE.Exec("update bank_box set shelfId=null,XStation =null,YStation =null where Barcode ='" + boxBarcode + "' ")
|
|
|
+ _, err = this.DBE.Exec("update bank_box set EquipmentId=null,shelfId=null,XStation =null,YStation =null where Barcode ='" + boxBarcode + "' ")
|
|
|
// 更新 当前冰箱冻存盒容量 信息
|
|
|
_, err = this.DBE.Exec(" update bank_currboxcapacity set `A" + utils.ToStr(Pos) + "`= -2 where shelfId =" + utils.ToStr(shelf.Id) + "")
|
|
|
|