代码更新
This commit is contained in:
@@ -121,6 +121,11 @@ public interface CheckOutBillService {
|
|||||||
* @param whereJson /
|
* @param whereJson /
|
||||||
*/
|
*/
|
||||||
void oneSetPoint(JSONObject whereJson);
|
void oneSetPoint(JSONObject whereJson);
|
||||||
|
/**
|
||||||
|
* 设置一个站点
|
||||||
|
* @param whereJson /
|
||||||
|
*/
|
||||||
|
void oneSetPoint2(JSONObject whereJson);
|
||||||
/**
|
/**
|
||||||
* 设置全部站点
|
* 设置全部站点
|
||||||
* @param whereJson /
|
* @param whereJson /
|
||||||
|
|||||||
@@ -138,6 +138,13 @@ public class CheckOutBillController {
|
|||||||
checkOutBillService.oneSetPoint(whereJson);
|
checkOutBillService.oneSetPoint(whereJson);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/oneSetPoint2")
|
||||||
|
@Log("设置一个站点")
|
||||||
|
@ApiOperation("设置检验站点")
|
||||||
|
public ResponseEntity<Object> oneSetPoint2(@RequestBody JSONObject whereJson) {
|
||||||
|
checkOutBillService.oneSetPoint2(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
@PostMapping("/allSetPoint")
|
@PostMapping("/allSetPoint")
|
||||||
@Log("设置全部站点")
|
@Log("设置全部站点")
|
||||||
@ApiOperation("设置全部站点")
|
@ApiOperation("设置全部站点")
|
||||||
|
|||||||
@@ -1488,6 +1488,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
JSONObject dis = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
JSONObject dis = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||||
.addParam("flag", "5")
|
.addParam("flag", "5")
|
||||||
.addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"))
|
.addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"))
|
||||||
|
.addParam("iostorinvdis_id", whereJson.getString("iostorinvdis_id"))
|
||||||
.addParam("struct_id", struct_id)
|
.addParam("struct_id", struct_id)
|
||||||
.addParam("iostorinv_id", iostorinv_id)
|
.addParam("iostorinv_id", iostorinv_id)
|
||||||
.addParam("bill_status", "01")
|
.addParam("bill_status", "01")
|
||||||
@@ -2882,6 +2883,402 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void oneSetPoint2(JSONObject whereJson) {
|
||||||
|
//出库分配表
|
||||||
|
WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
||||||
|
//点位表
|
||||||
|
WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||||
|
//任务表
|
||||||
|
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
|
//出库主表
|
||||||
|
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
||||||
|
//仓位表
|
||||||
|
WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr");
|
||||||
|
|
||||||
|
String struct_id = whereJson.getString("struct_id");
|
||||||
|
String point_code = whereJson.getString("point_code"); // 终点
|
||||||
|
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||||
|
String iostorinvdtl_id = whereJson.getString("iostorinvdtl_id");
|
||||||
|
String iostorinvdis_id = whereJson.getString("iostorinvdis_id");
|
||||||
|
|
||||||
|
//查询主表信息
|
||||||
|
JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jo_mst)) {
|
||||||
|
throw new BadRequestException("未查到相关出库单");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonPoint2 = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0);
|
||||||
|
//如果终点站点被锁定或者有载具号,则不允许设置点位
|
||||||
|
if (ObjectUtil.isEmpty(jsonPoint2)) {
|
||||||
|
throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询未生成和生成未下发的分配记录
|
||||||
|
JSONArray disArrOne = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||||
|
.addParam("flag", "5")
|
||||||
|
.addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"))
|
||||||
|
.addParam("iostorinvdis_id", whereJson.getString("iostorinvdis_id"))
|
||||||
|
.addParam("struct_id", struct_id)
|
||||||
|
.addParam("iostorinv_id", iostorinv_id)
|
||||||
|
.addParam("bill_status", "01")
|
||||||
|
.addParam("is_issued", "0")
|
||||||
|
.process()
|
||||||
|
.getResultJSONArray(0);
|
||||||
|
if (ObjectUtil.isEmpty(disArrOne)) {
|
||||||
|
throw new BadRequestException("分配明细不存在或已执行、完成、!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取第一个
|
||||||
|
JSONObject jsonNoe = disArrOne.getJSONObject(0);
|
||||||
|
|
||||||
|
JSONArray disRowArrNew = new JSONArray();
|
||||||
|
String option = ""; // 1.左 2.右
|
||||||
|
String placement_type = whereJson.getString("placement_type"); // 单通或双通
|
||||||
|
// 双通
|
||||||
|
if (StrUtil.equals(placement_type, "01")) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 判断左边被挡住的个数多还是右边被挡住的个数多
|
||||||
|
*/
|
||||||
|
// 判断右边边被挡住的个数
|
||||||
|
JSONObject isNumMap = new JSONObject();
|
||||||
|
isNumMap.put("flag", "3");
|
||||||
|
isNumMap.put("block_num", jsonNoe.getString("block_num"));
|
||||||
|
isNumMap.put("row_num", jsonNoe.getString("row_num"));
|
||||||
|
isNumMap.put("out_order_seq", jsonNoe.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", jsonNoe.getString("block_num"));
|
||||||
|
isNumMap.put("row_num", jsonNoe.getString("row_num"));
|
||||||
|
isNumMap.put("out_order_seq", jsonNoe.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", jsonNoe.getString("block_num"));
|
||||||
|
isNumMap.put("row_num", jsonNoe.getString("row_num"));
|
||||||
|
isNumMap.put("out_order_seq", jsonNoe.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("iostorinvdis_id", iostorinvdis_id)
|
||||||
|
.process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
option = "1";
|
||||||
|
|
||||||
|
} else if (rightNumArr.size() < leftNumArr.size()) {
|
||||||
|
/*
|
||||||
|
* 右边开始
|
||||||
|
*/
|
||||||
|
// 查询仓位被锁住的货位
|
||||||
|
isNumMap.put("flag", "6");
|
||||||
|
isNumMap.put("block_num", jsonNoe.getString("block_num"));
|
||||||
|
isNumMap.put("row_num", jsonNoe.getString("row_num"));
|
||||||
|
isNumMap.put("out_order_seq", jsonNoe.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("iostorinvdis_id", iostorinvdis_id)
|
||||||
|
.process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
option = "2";
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* 相等默认右边开始
|
||||||
|
*/
|
||||||
|
// 查询仓位被锁住的货位
|
||||||
|
isNumMap.put("flag", "6");
|
||||||
|
isNumMap.put("block_num", jsonNoe.getString("block_num"));
|
||||||
|
isNumMap.put("row_num", jsonNoe.getString("row_num"));
|
||||||
|
isNumMap.put("out_order_seq", jsonNoe.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("iostorinvdis_id", iostorinvdis_id)
|
||||||
|
.process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
option = "2";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (StrUtil.equals(placement_type, "02")) {
|
||||||
|
// 左通
|
||||||
|
|
||||||
|
JSONObject isNumMap = new JSONObject();
|
||||||
|
// 查询仓位被锁住的货位
|
||||||
|
isNumMap.put("flag", "5");
|
||||||
|
isNumMap.put("block_num", jsonNoe.getString("block_num"));
|
||||||
|
isNumMap.put("row_num", jsonNoe.getString("row_num"));
|
||||||
|
isNumMap.put("out_order_seq", jsonNoe.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("iostorinvdis_id", iostorinvdis_id)
|
||||||
|
.process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
option = "1";
|
||||||
|
|
||||||
|
} else if (StrUtil.equals(placement_type, "03")) {
|
||||||
|
// 右通
|
||||||
|
JSONObject isNumMap = new JSONObject();
|
||||||
|
// 查询仓位被锁住的货位
|
||||||
|
isNumMap.put("flag", "6");
|
||||||
|
isNumMap.put("block_num", jsonNoe.getString("block_num"));
|
||||||
|
isNumMap.put("row_num", jsonNoe.getString("row_num"));
|
||||||
|
isNumMap.put("out_order_seq", jsonNoe.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("iostorinvdis_id", iostorinvdis_id)
|
||||||
|
.process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
option = "2";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 循环生成任务
|
||||||
|
*/
|
||||||
|
boolean canOut = false;
|
||||||
|
int j = 0;
|
||||||
|
JSONObject jsonObject = disRowArrNew.getJSONObject(j);
|
||||||
|
|
||||||
|
// 创建任务
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("task_type", "010503");
|
||||||
|
param.put("vehicle_code", jsonObject.getString("box_no"));
|
||||||
|
param.put("task_name", "");
|
||||||
|
param.put("point_code1", jsonObject.getString("struct_code"));
|
||||||
|
param.put("point_code2", point_code);
|
||||||
|
param.put("material_id", jsonObject.getString("material_id"));
|
||||||
|
param.put("task_group_id", ""); // 任务组
|
||||||
|
param.put("sort_seq", ""); // 任务组顺序号
|
||||||
|
|
||||||
|
String create_task_id = outTask.createTask(param);
|
||||||
|
|
||||||
|
// 更新分配状态、任务标识、出库点位
|
||||||
|
JSONObject jsonTask = wo_Task.query("task_id = '" + create_task_id + "'").uniqueResult(0);
|
||||||
|
JSONObject jsonUpdateMap = new JSONObject();
|
||||||
|
jsonUpdateMap.put("work_status", "01");
|
||||||
|
jsonUpdateMap.put("task_id", jsonTask.getLong("task_id"));
|
||||||
|
jsonUpdateMap.put("point_id", jsonPoint2.getLongValue("point_id"));
|
||||||
|
wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + jsonObject.getString("iostorinvdis_id") + "'");
|
||||||
|
|
||||||
|
// 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
|
||||||
|
JSONArray disArr = wo_dis.query("struct_id = '" + jsonObject.getString("struct_id") +
|
||||||
|
"' and iostorinv_id = '" + jsonObject.getString("iostorinv_id") +
|
||||||
|
"' and iostorinvdis_id <> '" + jsonObject.getString("iostorinvdis_id") +
|
||||||
|
"' and work_status = '00'").getResultJSONArray(0);
|
||||||
|
|
||||||
|
// 依次更新相同仓位的分配明细状态、任务标识、出库点位
|
||||||
|
for (int n = 0; n < disArr.size(); n++) {
|
||||||
|
JSONObject jsonObject2 = disArr.getJSONObject(n);
|
||||||
|
jsonObject2.put("work_status", "01");
|
||||||
|
jsonObject2.put("task_id", jsonTask.getLong("task_id"));
|
||||||
|
jsonObject2.put("point_id", jsonPoint2.getLongValue("point_id"));
|
||||||
|
wo_dis.update(jsonObject2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询未被锁住的仓位
|
||||||
|
JSONArray moveArr = new JSONArray();
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("block_num", jsonObject.getString("block_num"));
|
||||||
|
map.put("row_num", jsonObject.getString("row_num"));
|
||||||
|
map.put("out_order_seq", jsonObject.getString("out_order_seq"));
|
||||||
|
|
||||||
|
if (StrUtil.equals(option, "1")) {
|
||||||
|
// 左边
|
||||||
|
map.put("flag", "7");
|
||||||
|
moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
} else {
|
||||||
|
// 右边
|
||||||
|
map.put("flag", "8");
|
||||||
|
moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建任务组
|
||||||
|
long task_group_id = IdUtil.getSnowflake(1, 1).nextId();
|
||||||
|
// 更新出库任务:任务组和顺序号
|
||||||
|
jsonTask.put("task_group_id", task_group_id);
|
||||||
|
jsonTask.put("sort_seq", 0);
|
||||||
|
wo_Task.update(jsonTask);
|
||||||
|
|
||||||
|
// 判断是否需要生成移库
|
||||||
|
if (ObjectUtil.isNotEmpty(moveArr)) {
|
||||||
|
JSONObject moveParam = new JSONObject();
|
||||||
|
moveParam.put("jsonAllBlockPoint", moveArr);
|
||||||
|
moveParam.put("iostorinvdis_id", jsonObject.getString("iostorinvdis_id"));
|
||||||
|
moveParam.put("task_group_id", task_group_id);
|
||||||
|
this.createMove(moveParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 判断下一个出库仓位是否相邻
|
||||||
|
*/
|
||||||
|
int out_order_seq = jsonObject.getIntValue("out_order_seq");
|
||||||
|
boolean canAdd = true;
|
||||||
|
int nextNum = j + 1;
|
||||||
|
while (canAdd) {
|
||||||
|
// 判断数组是否到头
|
||||||
|
if (nextNum <= disRowArrNew.size() - 1) {
|
||||||
|
JSONObject jsonNext = disRowArrNew.getJSONObject(nextNum);
|
||||||
|
int out_order_seq_next = jsonNext.getIntValue("out_order_seq");
|
||||||
|
if (Math.abs(out_order_seq_next - out_order_seq) != nextNum) {
|
||||||
|
// 下发当前任务组
|
||||||
|
outTask.immediateNotifyAcs(null);
|
||||||
|
|
||||||
|
// 更新任务组
|
||||||
|
task_group_id = IdUtil.getSnowflake(1, 1).nextId();
|
||||||
|
canAdd = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 查询此任务组最后一个生成的任务
|
||||||
|
JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq ASC").uniqueResult(0);
|
||||||
|
// 创建任务并添加到任务组
|
||||||
|
JSONObject param2 = new JSONObject();
|
||||||
|
param2.put("task_type", "010503");
|
||||||
|
param2.put("vehicle_code", jsonNext.getString("box_no"));
|
||||||
|
param2.put("task_name", "");
|
||||||
|
param2.put("point_code1", jsonNext.getString("struct_code"));
|
||||||
|
param2.put("point_code2", point_code);
|
||||||
|
param2.put("material_id", jsonNext.getString("material_id"));
|
||||||
|
param2.put("task_group_id", task_group_id); // 任务组
|
||||||
|
param2.put("sort_seq", jsonTaskLast.getIntValue("sort_seq") - 1); // 任务组顺序号
|
||||||
|
|
||||||
|
String create_task_id2 = outTask.createTask(param2);
|
||||||
|
|
||||||
|
// 更新分配状态、任务标识、出库点位
|
||||||
|
JSONObject jsonTask2 = wo_Task.query("task_id = '" + create_task_id2 + "'").uniqueResult(0);
|
||||||
|
JSONObject jsonUpdateMap2 = new JSONObject();
|
||||||
|
jsonUpdateMap2.put("work_status", "01");
|
||||||
|
jsonUpdateMap2.put("task_id", jsonTask2.getLong("task_id"));
|
||||||
|
jsonUpdateMap2.put("point_id", jsonPoint2.getLongValue("point_id"));
|
||||||
|
wo_dis.update(jsonUpdateMap2, "iostorinvdis_id = '" + jsonNext.getString("iostorinvdis_id") + "'");
|
||||||
|
|
||||||
|
// 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
|
||||||
|
JSONArray disArr2 = wo_dis.query("struct_id = '" + jsonNext.getString("struct_id") +
|
||||||
|
"' and iostorinv_id = '" + jsonNext.getString("iostorinv_id") +
|
||||||
|
"' and iostorinvdis_id <> '" + jsonNext.getString("iostorinvdis_id") +
|
||||||
|
"' and work_status = '00'").getResultJSONArray(0);
|
||||||
|
|
||||||
|
// 依次更新相同仓位的分配明细状态、任务标识、出库点位
|
||||||
|
for (int m = 0; m < disArr2.size(); m++) {
|
||||||
|
JSONObject jsonObject3 = disArr2.getJSONObject(m);
|
||||||
|
jsonObject3.put("work_status", "01");
|
||||||
|
jsonObject3.put("task_id", jsonTask2.getLong("task_id"));
|
||||||
|
jsonObject3.put("point_id", jsonPoint2.getLongValue("point_id"));
|
||||||
|
wo_dis.update(jsonObject3);
|
||||||
|
}
|
||||||
|
|
||||||
|
nextNum++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
canAdd = false;
|
||||||
|
canOut = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canOut) {
|
||||||
|
// 下发当前任务组
|
||||||
|
outTask.immediateNotifyAcs(null);
|
||||||
|
disRowArrNew.clear();
|
||||||
|
|
||||||
|
// 更新任务组
|
||||||
|
task_group_id = IdUtil.getSnowflake(1, 1).nextId();
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createMove(JSONObject whereJson) {
|
public void createMove(JSONObject whereJson) {
|
||||||
//任务表
|
//任务表
|
||||||
|
|||||||
@@ -365,7 +365,8 @@
|
|||||||
attr.row_num,
|
attr.row_num,
|
||||||
attr.col_num,
|
attr.col_num,
|
||||||
attr.layer_num,
|
attr.layer_num,
|
||||||
attr.block_num
|
attr.block_num,
|
||||||
|
attr.placement_type
|
||||||
FROM
|
FROM
|
||||||
ST_IVT_IOStorInvDis dis
|
ST_IVT_IOStorInvDis dis
|
||||||
LEFT JOIN ST_IVT_IOStorInv ios ON ios.iostorinv_id = dis.iostorinv_id
|
LEFT JOIN ST_IVT_IOStorInv ios ON ios.iostorinv_id = dis.iostorinv_id
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
输入.block_num TYPEAS s_string
|
输入.block_num TYPEAS s_string
|
||||||
输入.row_num TYPEAS s_string
|
输入.row_num TYPEAS s_string
|
||||||
输入.out_order_seq TYPEAS s_string
|
输入.out_order_seq TYPEAS s_string
|
||||||
|
输入.iostorinvdis_id TYPEAS s_string
|
||||||
|
|
||||||
[临时表]
|
[临时表]
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
@@ -98,6 +99,10 @@
|
|||||||
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.iostorinvdis_id <> ""
|
||||||
|
dis.iostorinvdis_id = 输入.iostorinvdis_id
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.block_num <> ""
|
OPTION 输入.block_num <> ""
|
||||||
attr.block_num = 输入.block_num
|
attr.block_num = 输入.block_num
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
@@ -143,6 +148,10 @@
|
|||||||
WHERE
|
WHERE
|
||||||
dis.work_status = '00'
|
dis.work_status = '00'
|
||||||
|
|
||||||
|
OPTION 输入.iostorinvdis_id <> ""
|
||||||
|
dis.iostorinvdis_id = 输入.iostorinvdis_id
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.iostorinvdtl_id <> ""
|
OPTION 输入.iostorinvdtl_id <> ""
|
||||||
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|||||||
@@ -181,7 +181,7 @@
|
|||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="button4"
|
:disabled="button4"
|
||||||
@click="oneSetPoint"
|
@click="oneSetPoint2"
|
||||||
>
|
>
|
||||||
设置站点
|
设置站点
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -550,6 +550,29 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
oneSetPoint2() {
|
||||||
|
if (this.form2.point_code === '') {
|
||||||
|
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.currentDis.point_code) {
|
||||||
|
this.crud.notify('站点已设置!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.currentDis.work_status !== '00') {
|
||||||
|
this.crud.notify('任务已生成!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.currentDis.iostorinvdis_id !== null) {
|
||||||
|
this.currentDis.point_code = this.form2.point_code
|
||||||
|
checkoutbill.oneSetPoint2(this.currentDis).then(res => {
|
||||||
|
this.queryTableDdis(this.currentDis.iostorinvdtl_id)
|
||||||
|
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
}).catch(() => {
|
||||||
|
this.currentDis.point_code = ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
allSetPoint() {
|
allSetPoint() {
|
||||||
debugger
|
debugger
|
||||||
if (this.form2.point_code === '') {
|
if (this.form2.point_code === '') {
|
||||||
|
|||||||
@@ -218,4 +218,11 @@ export function allSetPoint(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint }
|
export function oneSetPoint2(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/checkoutbill/oneSetPoint2',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2 }
|
||||||
|
|||||||
Reference in New Issue
Block a user