|
|
@@ -58,14 +58,14 @@ func (this *ArrangeService) GetOperUser(EntryNo string) (user string) {
|
|
|
* @return
|
|
|
**/
|
|
|
// 修改出入库单状态
|
|
|
-func (this *ArrangeService) ArrangeMainStatusModify(statusCode int, entryNo,msg string) error {
|
|
|
+func (this *ArrangeService) ArrangeMainStatusModify(statusCode int, entryNo, msg string) error {
|
|
|
set := ""
|
|
|
- if statusCode == 1 || statusCode == 2 || statusCode == 3 || statusCode == 5 {
|
|
|
+ if statusCode == 1 || statusCode == 2 || statusCode == 3 || statusCode == 5 {
|
|
|
set = " ,exception='' "
|
|
|
- }else{
|
|
|
- if msg!=""{
|
|
|
- set = " ,exception='"+msg+"' "
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
+ if msg != "" {
|
|
|
+ set = " ,exception='" + msg + "' "
|
|
|
+ } else {
|
|
|
set = " ,exception='' "
|
|
|
}
|
|
|
}
|
|
|
@@ -75,6 +75,24 @@ func (this *ArrangeService) ArrangeMainStatusModify(statusCode int, entryNo,msg
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 判断单据类型。如果是整理单,但会moving
|
|
|
+ */
|
|
|
+func (this *ArrangeService) CheckType(entryNo string) (types string) {
|
|
|
+ // 判断是否整理单据信息
|
|
|
+ glog.Info(" 判断是否整理单据信息 ")
|
|
|
+ var Main Bank_Arrange_Main
|
|
|
+ sql := " select * from Bank_Arrange_Main where entryno = '" + entryNo + "'"
|
|
|
+
|
|
|
+ this.DBE.SQL(sql).Get(&Main)
|
|
|
+ glog.Info(" 整理单据信息: ", Main)
|
|
|
+ if Main.EntryNo == entryNo {
|
|
|
+ return "moving"
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* @Author EDZ
|
|
|
* @Description // 修改整理单详情表信息
|
|
|
@@ -84,12 +102,16 @@ func (this *ArrangeService) ArrangeMainStatusModify(statusCode int, entryNo,msg
|
|
|
**/
|
|
|
func (this *ArrangeService) ArrangeDetailStatusModify(statusCode int, entryNo string) error {
|
|
|
//获取出入库单Id
|
|
|
- getId := "SELECT id FROM " + TABLE_ARRANGE_MAIN+ " WHERE entryno = '" + entryNo + "'"
|
|
|
+ getId := "SELECT id FROM " + TABLE_ARRANGE_MAIN + " WHERE entryno = '" + entryNo + "'"
|
|
|
var idList []Id
|
|
|
err := this.DBE.SQL(getId).Find(&idList)
|
|
|
- //批量更新全部成功或失败的任务样本状态
|
|
|
- sql := "UPDATE " + TABLE_ARRANGE_DETAIL + " SET taskstatus = '" + strconv.Itoa(statusCode) + "' WHERE parentid = '" + strconv.Itoa(idList[0].Id) + "' and taskstatus !=5"
|
|
|
- _, err = this.DBE.Exec(sql)
|
|
|
+
|
|
|
+ if len(idList) > 0 {
|
|
|
+ //批量更新全部成功或失败的任务样本状态
|
|
|
+ sql := "UPDATE " + TABLE_ARRANGE_DETAIL + " SET taskstatus = '" + strconv.Itoa(statusCode) + "' WHERE parentid = '" + strconv.Itoa(idList[0].Id) + "' and taskstatus !=5"
|
|
|
+ _, err = this.DBE.Exec(sql)
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
return err
|
|
|
}
|
|
|
@@ -115,7 +137,7 @@ func (this *ArrangeService) SaveArrangeExcepMsg(msg, entryNo string) error {
|
|
|
* @Param
|
|
|
* @return
|
|
|
**/
|
|
|
-func (this *ArrangeService) UpdateArrangeRes (entryNo string, resp string, message []byte) error {
|
|
|
+func (this *ArrangeService) UpdateArrangeRes(entryNo string, resp string, message []byte) error {
|
|
|
var res ResponseEntity
|
|
|
err := json.Unmarshal(message, &res)
|
|
|
if err != nil {
|
|
|
@@ -125,7 +147,7 @@ func (this *ArrangeService) UpdateArrangeRes (entryNo string, resp string, messa
|
|
|
isEnd := res.Data.Is_end
|
|
|
|
|
|
// 判断是否全部成功, 更新失败的任务状态
|
|
|
- this.GetAbnormalDataAndUpdate(taskId,res)
|
|
|
+ this.GetAbnormalDataAndUpdate(taskId, res)
|
|
|
// 先更新盒子的原位置
|
|
|
err = this.UpdateBoxInfoCK(res)
|
|
|
if err != nil {
|
|
|
@@ -147,7 +169,7 @@ func (this *ArrangeService) UpdateArrangeRes (entryNo string, resp string, messa
|
|
|
var tubes = value.Tubes
|
|
|
fmt.Println("样本位置信息:", tubes)
|
|
|
//新增方法 更新位置信息
|
|
|
- this.UpdatePosition(taskId,Rack_id, tubes, res)
|
|
|
+ this.UpdatePosition(taskId, Rack_id, tubes, res)
|
|
|
}
|
|
|
if isEnd {
|
|
|
// 根据盒子中样本数量更新样本信息
|
|
|
@@ -157,7 +179,6 @@ func (this *ArrangeService) UpdateArrangeRes (entryNo string, resp string, messa
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* @Author 徐春林
|
|
|
* @Description // 获取整理成功的 盒子信息并保存
|
|
|
@@ -178,8 +199,8 @@ func (this *ArrangeService) UpdateBoxInfo(entity ResponseEntity) (err error) {
|
|
|
glog.Info("操作地 ", i, " 条数据")
|
|
|
|
|
|
boxBarcode := entity.Data.Actual_data[i].RackId // 冻存盒编号
|
|
|
- Cu := entity.Data.Actual_data[i].Target.Cu // 设备编号
|
|
|
- Ltu := entity.Data.Actual_data[i].Target.Ltu //
|
|
|
+ Cu := entity.Data.Actual_data[i].Target.Cu // 设备编号
|
|
|
+ Ltu := entity.Data.Actual_data[i].Target.Ltu //
|
|
|
Unit := entity.Data.Actual_data[i].Target.Unit
|
|
|
Pos := entity.Data.Actual_data[i].Target.Pos
|
|
|
Group := entity.Data.Actual_data[i].Target.Group
|
|
|
@@ -190,25 +211,24 @@ func (this *ArrangeService) UpdateBoxInfo(entity ResponseEntity) (err error) {
|
|
|
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,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) + "'"
|
|
|
|
|
|
// 拼接冻存盒位置信息
|
|
|
position := equipment.Code + "-" + common.Boxlinename(shelf.XStation) + utils.ToStr(shelf.YStation) + "-" +
|
|
|
- "" + common.Boxlinename( Pos )
|
|
|
+ "" + common.Boxlinename(Pos)
|
|
|
|
|
|
// 冷库设备
|
|
|
- YStation:=" "
|
|
|
- if equipment.Ltu == 0 {
|
|
|
+ YStation := " "
|
|
|
+ if equipment.Ltu == 0 {
|
|
|
sql += " and a.Unit ='" + utils.ToStr(Unit) + "' "
|
|
|
- YStation = " , YStation =1 "
|
|
|
+ YStation = " , YStation =1 "
|
|
|
position += utils.ToStr(1)
|
|
|
- fmt.Println("保存返回的冻存盒位置信息:YStation1:1 ", YStation)
|
|
|
- }else{
|
|
|
- YStation = " , YStation = "+ utils.ToStr(Unit)
|
|
|
+ fmt.Println("保存返回的冻存盒位置信息:YStation1:1 ", YStation)
|
|
|
+ } else {
|
|
|
+ YStation = " , YStation = " + utils.ToStr(Unit)
|
|
|
position += utils.ToStr(utils.ToStr(Unit))
|
|
|
- fmt.Println("保存返回的冻存盒位置信息:cYStation1:2 ", YStation)
|
|
|
+ fmt.Println("保存返回的冻存盒位置信息:cYStation1:2 ", YStation)
|
|
|
}
|
|
|
|
|
|
this.DBE.SQL(sql).Get(&shelf)
|
|
|
@@ -217,8 +237,8 @@ func (this *ArrangeService) UpdateBoxInfo(entity ResponseEntity) (err error) {
|
|
|
|
|
|
// 更新盒所在的冻存架的信息 计算位置信息,并更新
|
|
|
// 临时处理逻辑,默认 pos 为 盒子的 XStation
|
|
|
- _, err = this.DBE.Exec("update bank_box set XStation ='" + utils.ToStr(Pos) + "' "+YStation+" ,EquipmentId ='" + utils.ToStr(shelf.EquipmentId) + "'," +
|
|
|
- " shelfId =" + utils.ToStr(shelf.Id) + ",IsLocked = 0 , position = '"+position+"' where Barcode ='" + boxBarcode + "' ")
|
|
|
+ _, err = this.DBE.Exec("update bank_box set XStation ='" + utils.ToStr(Pos) + "' " + YStation + " ,EquipmentId ='" + utils.ToStr(shelf.EquipmentId) + "'," +
|
|
|
+ " shelfId =" + utils.ToStr(shelf.Id) + ",IsLocked = 0 , position = '" + position + "' where Barcode ='" + boxBarcode + "' ")
|
|
|
// 更新 当前冰箱冻存盒容量 信息
|
|
|
_, err = this.DBE.Exec(" update bank_currboxcapacity set `A" + utils.ToStr(Pos) + "`= -1 where shelfId =" + utils.ToStr(shelf.Id) + "")
|
|
|
|
|
|
@@ -265,7 +285,7 @@ func (this *ArrangeService) UpdateBoxInfoCK(entity ResponseEntity) (err error) {
|
|
|
* @Param
|
|
|
* @return
|
|
|
**/
|
|
|
-func (this *ArrangeService) UpdatePosition(taskId,rack_id string, tubes []Tube, entity ResponseEntity) {
|
|
|
+func (this *ArrangeService) UpdatePosition(taskId, rack_id string, tubes []Tube, entity ResponseEntity) {
|
|
|
// 根据返回的报文中的盒子标识,获取盒子类型
|
|
|
sql := "select Id,RowNum,ColumnNum,EquipmentId,ShelfId,XStation,YStation from bank_box where Barcode ='" + rack_id + "'"
|
|
|
var box Box
|
|
|
@@ -275,17 +295,17 @@ func (this *ArrangeService) UpdatePosition(taskId,rack_id string, tubes []Tube,
|
|
|
ColumnNum := box.ColumnNum
|
|
|
|
|
|
// 获取容器信息
|
|
|
- equipmentsql := " select Id,Code,Name from bank_equipment where id = '"+ box.EquipmentId+"' "
|
|
|
+ equipmentsql := " select Id,Code,Name from bank_equipment where id = '" + box.EquipmentId + "' "
|
|
|
var equipmentInfo EquipmentInfo
|
|
|
this.DBE.SQL(equipmentsql).Get(&equipmentInfo)
|
|
|
// 获取架子信息
|
|
|
- shelfsql := " select Id,XStation,YStation from bank_shelf where id = '"+ box.ShelfId+"' "
|
|
|
+ shelfsql := " select Id,XStation,YStation from bank_shelf where id = '" + box.ShelfId + "' "
|
|
|
var shelf Shelf
|
|
|
this.DBE.SQL(shelfsql).Get(&shelf)
|
|
|
|
|
|
glog.Info("冻存盒的行数:", RowNum, ";冻存盒的列数:", ColumnNum) //
|
|
|
- glog.Info("冻存盒内管数量len(tubes) : " ,len(tubes) ) //
|
|
|
- if len(tubes) >0{
|
|
|
+ glog.Info("冻存盒内管数量len(tubes) : ", len(tubes)) //
|
|
|
+ if len(tubes) > 0 {
|
|
|
for i := 0; i < len(tubes); i++ {
|
|
|
no := tubes[i].No
|
|
|
id := tubes[i].Id
|
|
|
@@ -304,16 +324,16 @@ func (this *ArrangeService) UpdatePosition(taskId,rack_id string, tubes []Tube,
|
|
|
glog.Info("管子在盒子中的位置坐标为:", box_y, ";", box_x)
|
|
|
|
|
|
position := equipmentInfo.Code + "-" + common.Boxlinename(shelf.YStation) + utils.ToStr(shelf.XStation) + "-" +
|
|
|
- "" + common.Boxlinename(box.YStation) + utils.ToStr(box.XStation)+"-"+common.Boxlinename(box_x) + utils.ToStr(box_y)
|
|
|
+ "" + common.Boxlinename(box.YStation) + utils.ToStr(box.XStation) + "-" + common.Boxlinename(box_x) + utils.ToStr(box_y)
|
|
|
|
|
|
sql = "update bank_sample set BoxId = '" + utils.ToStr(box.Id) + "',Position = '" + utils.ToStr(box_y) + ";" + utils.ToStr(box_x) + "' , " +
|
|
|
"PositionInfo = '" + position + "' where barcode ='" + id + "' "
|
|
|
//执行sql 更新位置和坐标信息
|
|
|
this.DBE.Exec(sql)
|
|
|
- this.UpdateDetail(id, entity, rack_id,taskId)
|
|
|
+ this.UpdateDetail(id, entity, rack_id, taskId)
|
|
|
}
|
|
|
- }else{
|
|
|
- this.UpdateDetail("", entity, rack_id,taskId)
|
|
|
+ } else {
|
|
|
+ this.UpdateDetail("", entity, rack_id, taskId)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -325,7 +345,7 @@ func (this *ArrangeService) UpdatePosition(taskId,rack_id string, tubes []Tube,
|
|
|
* @Param
|
|
|
* @return
|
|
|
**/
|
|
|
-func (this *ArrangeService) UpdateDetail(BarCode string, entity ResponseEntity, rack_id,taskId string) {
|
|
|
+func (this *ArrangeService) UpdateDetail(BarCode string, entity ResponseEntity, rack_id, taskId string) {
|
|
|
|
|
|
glog.Info("修改detail:", entity)
|
|
|
arrangeMain := this.GetArrangeMain(taskId)
|
|
|
@@ -339,17 +359,16 @@ func (this *ArrangeService) UpdateDetail(BarCode string, entity ResponseEntity,
|
|
|
Unit := entity.Data.Actual_data[i].Target.Unit
|
|
|
Group := entity.Data.Actual_data[i].Target.Group
|
|
|
|
|
|
-
|
|
|
// 判断是否是冷库,如果是冷库的话,查询容器架子信息时不需要组装 unit
|
|
|
lengSql := " select * from bank_equipment where cu = '" + utils.ToStr(Cu) + "' and Ltu = '" + utils.ToStr(Ltu) + "' "
|
|
|
this.DBE.SQL(lengSql).Get(&equipment)
|
|
|
|
|
|
- if entity.Response == "moving"{
|
|
|
+ if entity.Response == "moving" {
|
|
|
// 更内库内整理 冻存盒信息 整理结果
|
|
|
updatesql := "UPDATE bank_arrange_detail SET IsLocked = '0', taskstatus = '" + strconv.Itoa(SUCCESS) + "' WHERE barcode = '" + entity.Data.Actual_data[i].Target.Rack_id + "'" + " AND parentid = '" + strconv.Itoa(arrangeMain.Id) + "'"
|
|
|
this.DBE.Exec(updatesql)
|
|
|
// 更内库内整理 冻存盒信息 整理结果
|
|
|
- updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(SUCCESS) + "' WHERE boxbarcode = '" + entity.Data.Actual_data[i].Target.Rack_id + "' and task_id = '"+taskId+"'"
|
|
|
+ updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(SUCCESS) + "' WHERE boxbarcode = '" + entity.Data.Actual_data[i].Target.Rack_id + "' and task_id = '" + taskId + "'"
|
|
|
this.DBE.Exec(updTaskSql)
|
|
|
}
|
|
|
|
|
|
@@ -358,7 +377,7 @@ func (this *ArrangeService) UpdateDetail(BarCode string, entity ResponseEntity,
|
|
|
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) + "' " +
|
|
|
"and a.Ltu = '" + utils.ToStr(Ltu) + "' and a.Group ='" + utils.ToStr(Group) + "'"
|
|
|
|
|
|
- if equipment.Ltu == 0 {
|
|
|
+ if equipment.Ltu == 0 {
|
|
|
sql += " and a.Unit ='" + utils.ToStr(Unit) + "' "
|
|
|
}
|
|
|
|
|
|
@@ -373,24 +392,23 @@ func (this *ArrangeService) UpdateDetail(BarCode string, entity ResponseEntity,
|
|
|
sql = "update bank_sample set EquipmentId=" + equipmentid + ",ShelfId=" + ShelfId + " where barcode ='" + BarCode + "' "
|
|
|
this.DBE.Exec(sql)
|
|
|
|
|
|
- if entity.Response == "moving"{
|
|
|
+ if entity.Response == "moving" {
|
|
|
// 更内库内整理 冻存盒信息 整理结果
|
|
|
updatesql := "UPDATE bank_arrange_detail SET IsLocked = '0', taskstatus = '" + strconv.Itoa(SUCCESS) + "' WHERE barcode = '" + entity.Data.Actual_data[i].Target.Rack_id + "'" + " AND parentid = '" + strconv.Itoa(arrangeMain.Id) + "'"
|
|
|
this.DBE.Exec(updatesql)
|
|
|
// 更内库内整理 冻存盒信息 整理结果
|
|
|
- updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(SUCCESS) + "' WHERE boxbarcode = '" + entity.Data.Actual_data[i].Target.Rack_id + "' and task_id = '"+taskId+"'"
|
|
|
+ updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(SUCCESS) + "' WHERE boxbarcode = '" + entity.Data.Actual_data[i].Target.Rack_id + "' and task_id = '" + taskId + "'"
|
|
|
this.DBE.Exec(updTaskSql)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
// 更新库内整理 样本整理结果
|
|
|
updatesql := "UPDATE bank_arrange_detail SET IsLocked = '0', taskstatus = '" + strconv.Itoa(SUCCESS) + "' WHERE barcode = '" + BarCode + "'" + " AND parentid = '" + strconv.Itoa(arrangeMain.Id) + "'"
|
|
|
this.DBE.Exec(updatesql)
|
|
|
|
|
|
- updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(SUCCESS) + "' WHERE barcode = '" + BarCode + "' and task_id = '"+taskId+"'"
|
|
|
+ updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(SUCCESS) + "' WHERE barcode = '" + BarCode + "' and task_id = '" + taskId + "'"
|
|
|
this.DBE.Exec(updTaskSql)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -436,7 +454,7 @@ func (this *ArrangeService) GetAbnormalDataAndUpdate(taskId string, entity Respo
|
|
|
racks := entity.Data.Abnormal_data.Racks
|
|
|
arrangeMain := this.GetArrangeMain(taskId)
|
|
|
var shelf Shelf
|
|
|
- if len(racks) > 0 {
|
|
|
+ if len(racks) > 0 {
|
|
|
for _, v := range racks {
|
|
|
// 根据盒编码,任务编码查询 任务信息,任务存在更新状态
|
|
|
sql := "SELECT count(*) FROM `" + TABLE_TAST + " WHERE task_id = '" + taskId + "' and BoxBarCode = '" + v.RackId + "'"
|
|
|
@@ -447,9 +465,9 @@ func (this *ArrangeService) GetAbnormalDataAndUpdate(taskId string, entity Respo
|
|
|
// 存在未执行成功的子任务
|
|
|
if total > 0 {
|
|
|
// 更新任务明细信息
|
|
|
- updatesql := "UPDATE " + TABLE_ARRANGE_DETAIL + " SET taskstatus = '" + strconv.Itoa(FAILED) + "' WHERE BoxBarCode = '" + v.RackId + "' AND parentid = '" + strconv.Itoa(arrangeMain.Id) + "'"
|
|
|
+ updatesql := "UPDATE " + TABLE_ARRANGE_DETAIL + " SET taskstatus = '" + strconv.Itoa(FAILED) + "' WHERE BoxBarCode = '" + v.RackId + "' AND parentid = '" + strconv.Itoa(arrangeMain.Id) + "'"
|
|
|
this.DBE.Exec(updatesql)
|
|
|
- updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(FAILED) + "' WHERE BoxBarCode = '" + v.RackId + "' and task_id = '" + taskId + "'"
|
|
|
+ updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(FAILED) + "' WHERE BoxBarCode = '" + v.RackId + "' and task_id = '" + taskId + "'"
|
|
|
this.DBE.Exec(updTaskSql)
|
|
|
continue
|
|
|
}
|
|
|
@@ -461,11 +479,11 @@ func (this *ArrangeService) GetAbnormalDataAndUpdate(taskId string, entity Respo
|
|
|
|
|
|
// 根据架编码,任务Id 查询 任务信息, 任务存在更新状态
|
|
|
// 更新任务明细信息
|
|
|
- updatesql := "UPDATE " + TABLE_ARRANGE_DETAIL + " SET taskstatus = '" + strconv.Itoa(FAILED) + "' WHERE ShelfId = " +strconv.Itoa( shelf.Id)+ " AND parentid = '" + strconv.Itoa(arrangeMain.Id) + "'"
|
|
|
+ updatesql := "UPDATE " + TABLE_ARRANGE_DETAIL + " SET taskstatus = '" + strconv.Itoa(FAILED) + "' WHERE ShelfId = " + strconv.Itoa(shelf.Id) + " AND parentid = '" + strconv.Itoa(arrangeMain.Id) + "'"
|
|
|
this.DBE.Exec(updatesql)
|
|
|
|
|
|
// 更新任务状态
|
|
|
- updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(FAILED) + "' WHERE ShelfId = " +strconv.Itoa( shelf.Id)+ "and task_id = '" + taskId + "'"
|
|
|
+ updTaskSql := "UPDATE " + TABLE_TAST + " SET statuscode = '" + strconv.Itoa(FAILED) + "' WHERE ShelfId = " + strconv.Itoa(shelf.Id) + "and task_id = '" + taskId + "'"
|
|
|
this.DBE.Exec(updTaskSql)
|
|
|
}
|
|
|
}
|
|
|
@@ -484,7 +502,7 @@ func (this *ArrangeService) GetArrangeMain(entryNo string) Bank_Arrange_Main {
|
|
|
sql := "SELECT * FROM bank_arrange_main WHERE " + where
|
|
|
//results, err := this.DBE.Query(sql)
|
|
|
//fmt.Println(results)
|
|
|
- _,err := this.DBE.SQL(sql).Get(&entity)
|
|
|
+ _, err := this.DBE.SQL(sql).Get(&entity)
|
|
|
fmt.Println("执行错误:", err)
|
|
|
return entity
|
|
|
}
|
|
|
@@ -496,8 +514,8 @@ func (this *ArrangeService) GetArrangeMain(entryNo string) Bank_Arrange_Main {
|
|
|
* @Param
|
|
|
* @return
|
|
|
**/
|
|
|
-func (this *ArrangeService) GetAllBox(taskId string) {
|
|
|
+func (this *ArrangeService) GetAllBox(taskId string) {
|
|
|
arrangeMain := this.GetArrangeMain(taskId)
|
|
|
- sql := "update bank_box a set a.IsEmpty = (case when (select count(b.Id) from bank_sample b where a.Id = b.BoxId) > 0 then 0 else 1 end) where a.EquipmentId = '"+utils.ToStr(arrangeMain.EquipmentId)+"'"
|
|
|
+ sql := "update bank_box a set a.IsEmpty = (case when (select count(b.Id) from bank_sample b where a.Id = b.BoxId) > 0 then 0 else 1 end) where a.EquipmentId = '" + utils.ToStr(arrangeMain.EquipmentId) + "'"
|
|
|
this.DBE.Exec(sql)
|
|
|
}
|