代码更新
This commit is contained in:
@@ -75,7 +75,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
*
|
||||
* @param moveinv_id
|
||||
*/
|
||||
void deleteById(String moveinv_id) {
|
||||
public void deleteById(String moveinv_id) {
|
||||
//明细表
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_MoveInvDtl");
|
||||
//主表
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.nl.wms.st.instor.service.HandMoveStorService;
|
||||
import org.nl.wms.st.instor.service.impl.HandMoveStorServiceImpl;
|
||||
import org.nl.wms.st.instor.task.HandMoveStorAcsTask;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -1235,6 +1236,10 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
//移库单明细表
|
||||
WQLObject move_dtl = WQLObject.getWQLObject("ST_IVT_MoveInvDtl");
|
||||
//移库单主表
|
||||
WQLObject move_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
//查询主表信息
|
||||
@@ -1313,9 +1318,32 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
if (flag.size() == 0) {//仓位载具冻结数为0
|
||||
//任务号不为空
|
||||
if (ObjectUtil.isNotEmpty(dis.getString("task_id"))) {
|
||||
// 判断是否有移库的任务:有就取消掉
|
||||
JSONObject jsonTask = wo_Task.query("task_id = '" + dis.getString("task_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonTask)) {
|
||||
JSONArray moveArrTask = wo_Task.query("task_group_id = '" + jsonTask.getString("task_group_id") + "' and task_type = '010505'").getResultJSONArray(0);
|
||||
|
||||
for (int j = 0; j < moveArrTask.size(); j++) {
|
||||
JSONObject jsonMoveTask = moveArrTask.getJSONObject(j);
|
||||
// 调用删除移库单
|
||||
JSONObject jsonMoveDtl = move_dtl.query("task_id = '" + jsonMoveTask.getString("task_id") + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonMoveDtl)) {
|
||||
JSONObject jsonMoveMst = move_mst.query("moveinv_id = '" + jsonMoveDtl.getString("moveinv_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonMoveMst)) {
|
||||
HandMoveStorServiceImpl bean = SpringContextHolder.getBean(HandMoveStorServiceImpl.class);
|
||||
bean.deleteById(jsonMoveMst.getString("moveinv_id"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//更新对应任务为删除
|
||||
map.put("is_delete", "1");
|
||||
wo_Task.update(map, "task_id='" + dis.getString("task_id") + "'");
|
||||
|
||||
}
|
||||
//解锁起点仓位点位
|
||||
JSONObject from_start = new JSONObject();
|
||||
@@ -2524,43 +2552,149 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
JSONArray disRowArrNew = new JSONArray();
|
||||
String option = ""; // 1.左 2.右
|
||||
String placement_type = jsonRow.getString("placement_type"); // 单通或双通
|
||||
// 双通
|
||||
if (StrUtil.equals(placement_type, "01")) {
|
||||
// String placement_type = jsonRow.getString("placement_type"); // 单通或双通
|
||||
|
||||
// 取右边第一个
|
||||
JSONObject jsonDisRight = disRowArr.getJSONObject(0);
|
||||
// 取左边第一个
|
||||
JSONObject jsonDisLeft = disRowArr.getJSONObject(disRowArr.size() - 1);
|
||||
for (int p = 0; p < disRowArr.size(); p++) {
|
||||
JSONObject jsonObject4 = disRowArr.getJSONObject(p);
|
||||
String placement_type = jsonObject4.getString("placement_type");
|
||||
// 双通
|
||||
if (StrUtil.equals(placement_type, "01")) {
|
||||
|
||||
/*
|
||||
* 判断左边被挡住的个数多还是右边被挡住的个数多
|
||||
*/
|
||||
// 判断右边边被挡住的个数
|
||||
JSONObject isNumMap = new JSONObject();
|
||||
isNumMap.put("flag", "3");
|
||||
isNumMap.put("block_num", jsonDisRight.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisRight.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq"));
|
||||
JSONArray numArrFirst = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
// 取右边第一个
|
||||
JSONObject jsonDisRight = disRowArr.getJSONObject(0);
|
||||
// 取左边第一个
|
||||
JSONObject jsonDisLeft = disRowArr.getJSONObject(disRowArr.size() - 1);
|
||||
|
||||
// 调用共用方法计算被挡个数
|
||||
JSONArray rightNumArr = this.isNum(numArrFirst);
|
||||
|
||||
// 判断左边被挡住的个数
|
||||
isNumMap.put("flag", "4");
|
||||
isNumMap.put("block_num", jsonDisLeft.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisLeft.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisLeft.getString("out_order_seq"));
|
||||
JSONArray numArrLast = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
// 调用共用方法计算被挡个数
|
||||
JSONArray leftNumArr = this.isNum(numArrLast);
|
||||
// 判断哪边少
|
||||
if (rightNumArr.size() > leftNumArr.size()) {
|
||||
/*
|
||||
* 左边开始
|
||||
* 判断左边被挡住的个数多还是右边被挡住的个数多
|
||||
*/
|
||||
// 判断右边边被挡住的个数
|
||||
JSONObject isNumMap = new JSONObject();
|
||||
isNumMap.put("flag", "3");
|
||||
isNumMap.put("block_num", jsonDisRight.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisRight.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq"));
|
||||
JSONArray numArrFirst = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
// 调用共用方法计算被挡个数
|
||||
JSONArray rightNumArr = this.isNum(numArrFirst);
|
||||
|
||||
// 判断左边被挡住的个数
|
||||
isNumMap.put("flag", "4");
|
||||
isNumMap.put("block_num", jsonDisLeft.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisLeft.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisLeft.getString("out_order_seq"));
|
||||
JSONArray numArrLast = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
// 调用共用方法计算被挡个数
|
||||
JSONArray leftNumArr = this.isNum(numArrLast);
|
||||
// 判断哪边少
|
||||
if (rightNumArr.size() > leftNumArr.size()) {
|
||||
/*
|
||||
* 左边开始
|
||||
*/
|
||||
// 查询仓位被锁住的货位
|
||||
isNumMap.put("flag", "5");
|
||||
isNumMap.put("block_num", jsonDisLeft.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisLeft.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisLeft.getString("out_order_seq"));
|
||||
JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
JSONArray numArr = this.isNum(isLockArr);
|
||||
// 不为空则返回报错
|
||||
if (ObjectUtil.isNotEmpty(numArr)) {
|
||||
String error = "";
|
||||
|
||||
for (int k = 0; k < numArr.size(); k++) {
|
||||
JSONObject json = numArr.getJSONObject(k);
|
||||
error += json.getString("struct_code") + ",";
|
||||
}
|
||||
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!");
|
||||
}
|
||||
// 重新按照排序查询
|
||||
disRowArrNew = WQL.getWO("ST_OUTIVT04")
|
||||
.addParam("flag", "22")
|
||||
.addParam("iostorinvdtl_id", iostorinvdtl_id)
|
||||
.addParam("block_num", jsonRow.getString("block_num"))
|
||||
.addParam("row_num", jsonRow.getString("row_num"))
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
option = "1";
|
||||
|
||||
} else if (rightNumArr.size() < leftNumArr.size()) {
|
||||
/*
|
||||
* 右边开始
|
||||
*/
|
||||
// 查询仓位被锁住的货位
|
||||
isNumMap.put("flag", "6");
|
||||
isNumMap.put("block_num", jsonDisRight.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisRight.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq"));
|
||||
JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
JSONArray numArr = this.isNum(isLockArr);
|
||||
// 不为空则返回报错
|
||||
if (ObjectUtil.isNotEmpty(numArr)) {
|
||||
String error = "";
|
||||
|
||||
for (int k = 0; k < numArr.size(); k++) {
|
||||
JSONObject json = numArr.getJSONObject(k);
|
||||
error += json.getString("struct_code") + ",";
|
||||
}
|
||||
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!");
|
||||
}
|
||||
|
||||
// 重新按照排序查询
|
||||
disRowArrNew = WQL.getWO("ST_OUTIVT04")
|
||||
.addParam("flag", "2")
|
||||
.addParam("iostorinvdtl_id", iostorinvdtl_id)
|
||||
.addParam("block_num", jsonRow.getString("block_num"))
|
||||
.addParam("row_num", jsonRow.getString("row_num"))
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
option = "2";
|
||||
} else {
|
||||
/*
|
||||
* 相等默认右边开始
|
||||
*/
|
||||
// 查询仓位被锁住的货位
|
||||
isNumMap.put("flag", "6");
|
||||
isNumMap.put("block_num", jsonDisRight.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisRight.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq"));
|
||||
JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
JSONArray numArr = this.isNum(isLockArr);
|
||||
// 不为空则返回报错
|
||||
if (ObjectUtil.isNotEmpty(numArr)) {
|
||||
String error = "";
|
||||
|
||||
for (int k = 0; k < numArr.size(); k++) {
|
||||
JSONObject json = numArr.getJSONObject(k);
|
||||
error += json.getString("struct_code") + ",";
|
||||
}
|
||||
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!");
|
||||
}
|
||||
|
||||
// 重新按照排序查询
|
||||
disRowArrNew = WQL.getWO("ST_OUTIVT04")
|
||||
.addParam("flag", "2")
|
||||
.addParam("iostorinvdtl_id", iostorinvdtl_id)
|
||||
.addParam("block_num", jsonRow.getString("block_num"))
|
||||
.addParam("row_num", jsonRow.getString("row_num"))
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
option = "2";
|
||||
}
|
||||
|
||||
} else if (StrUtil.equals(placement_type, "02")) {
|
||||
// 左通
|
||||
JSONObject jsonDisLeft = disRowArr.getJSONObject(disRowArr.size() - 1);
|
||||
|
||||
JSONObject isNumMap = new JSONObject();
|
||||
// 查询仓位被锁住的货位
|
||||
isNumMap.put("flag", "5");
|
||||
isNumMap.put("block_num", jsonDisLeft.getString("block_num"));
|
||||
@@ -2578,7 +2712,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
error += json.getString("struct_code") + ",";
|
||||
}
|
||||
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!");
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务");
|
||||
}
|
||||
// 重新按照排序查询
|
||||
disRowArrNew = WQL.getWO("ST_OUTIVT04")
|
||||
@@ -2590,10 +2724,10 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
option = "1";
|
||||
|
||||
} else if (rightNumArr.size() < leftNumArr.size()) {
|
||||
/*
|
||||
* 右边开始
|
||||
*/
|
||||
} else if (StrUtil.equals(placement_type, "03")) {
|
||||
// 右通
|
||||
JSONObject jsonDisRight = disRowArr.getJSONObject(0);
|
||||
JSONObject isNumMap = new JSONObject();
|
||||
// 查询仓位被锁住的货位
|
||||
isNumMap.put("flag", "6");
|
||||
isNumMap.put("block_num", jsonDisRight.getString("block_num"));
|
||||
@@ -2611,40 +2745,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
error += json.getString("struct_code") + ",";
|
||||
}
|
||||
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!");
|
||||
}
|
||||
|
||||
// 重新按照排序查询
|
||||
disRowArrNew = WQL.getWO("ST_OUTIVT04")
|
||||
.addParam("flag", "2")
|
||||
.addParam("iostorinvdtl_id", iostorinvdtl_id)
|
||||
.addParam("block_num", jsonRow.getString("block_num"))
|
||||
.addParam("row_num", jsonRow.getString("row_num"))
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
option = "2";
|
||||
} else {
|
||||
/*
|
||||
* 相等默认右边开始
|
||||
*/
|
||||
// 查询仓位被锁住的货位
|
||||
isNumMap.put("flag", "6");
|
||||
isNumMap.put("block_num", jsonDisRight.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisRight.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq"));
|
||||
JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
JSONArray numArr = this.isNum(isLockArr);
|
||||
// 不为空则返回报错
|
||||
if (ObjectUtil.isNotEmpty(numArr)) {
|
||||
String error = "";
|
||||
|
||||
for (int k = 0; k < numArr.size(); k++) {
|
||||
JSONObject json = numArr.getJSONObject(k);
|
||||
error += json.getString("struct_code") + ",";
|
||||
}
|
||||
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!");
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务");
|
||||
}
|
||||
|
||||
// 重新按照排序查询
|
||||
@@ -2657,78 +2758,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
option = "2";
|
||||
}
|
||||
|
||||
} else if (StrUtil.equals(placement_type, "02")) {
|
||||
// 左通
|
||||
JSONObject jsonDisLeft = disRowArr.getJSONObject(disRowArr.size() - 1);
|
||||
|
||||
JSONObject isNumMap = new JSONObject();
|
||||
// 查询仓位被锁住的货位
|
||||
isNumMap.put("flag", "5");
|
||||
isNumMap.put("block_num", jsonDisLeft.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisLeft.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisLeft.getString("out_order_seq"));
|
||||
JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
JSONArray numArr = this.isNum(isLockArr);
|
||||
// 不为空则返回报错
|
||||
if (ObjectUtil.isNotEmpty(numArr)) {
|
||||
String error = "";
|
||||
|
||||
for (int k = 0; k < numArr.size(); k++) {
|
||||
JSONObject json = numArr.getJSONObject(k);
|
||||
error += json.getString("struct_code") + ",";
|
||||
}
|
||||
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务");
|
||||
}
|
||||
// 重新按照排序查询
|
||||
disRowArrNew = WQL.getWO("ST_OUTIVT04")
|
||||
.addParam("flag", "22")
|
||||
.addParam("iostorinvdtl_id", iostorinvdtl_id)
|
||||
.addParam("block_num", jsonRow.getString("block_num"))
|
||||
.addParam("row_num", jsonRow.getString("row_num"))
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
option = "1";
|
||||
|
||||
} else if (StrUtil.equals(placement_type, "03")) {
|
||||
// 右通
|
||||
JSONObject jsonDisRight = disRowArr.getJSONObject(0);
|
||||
JSONObject isNumMap = new JSONObject();
|
||||
// 查询仓位被锁住的货位
|
||||
isNumMap.put("flag", "6");
|
||||
isNumMap.put("block_num", jsonDisRight.getString("block_num"));
|
||||
isNumMap.put("row_num", jsonDisRight.getString("row_num"));
|
||||
isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq"));
|
||||
JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0);
|
||||
|
||||
JSONArray numArr = this.isNum(isLockArr);
|
||||
// 不为空则返回报错
|
||||
if (ObjectUtil.isNotEmpty(numArr)) {
|
||||
String error = "";
|
||||
|
||||
for (int k = 0; k < numArr.size(); k++) {
|
||||
JSONObject json = numArr.getJSONObject(k);
|
||||
error += json.getString("struct_code") + ",";
|
||||
}
|
||||
|
||||
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务");
|
||||
}
|
||||
|
||||
// 重新按照排序查询
|
||||
disRowArrNew = WQL.getWO("ST_OUTIVT04")
|
||||
.addParam("flag", "2")
|
||||
.addParam("iostorinvdtl_id", iostorinvdtl_id)
|
||||
.addParam("block_num", jsonRow.getString("block_num"))
|
||||
.addParam("row_num", jsonRow.getString("row_num"))
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
option = "2";
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* 循环生成任务
|
||||
* 生成任务
|
||||
*/
|
||||
boolean canOut = false;
|
||||
int j = 0;
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
max(dis.point_id) AS point_id,
|
||||
max(attr.out_order_seq) AS out_order_seq,
|
||||
max(attr.block_num) AS block_num,
|
||||
max(attr.row_num) AS row_num
|
||||
max(attr.row_num) AS row_num,
|
||||
max(attr.placement_type) AS placement_type
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
LEFT JOIN st_ivt_structattr attr ON dis.struct_id = attr.struct_id
|
||||
|
||||
Reference in New Issue
Block a user