代码更新
This commit is contained in:
@@ -78,7 +78,7 @@ public class OutTask extends AbstractAcsTask {
|
||||
wo_Task.update(paramMap,"task_id ='"+json.getString("task_id")+"'");
|
||||
} else {
|
||||
// 2.有任务组:按照执行顺序下发 大到小
|
||||
JSONArray taskArr = wo_Task.query("task_group_id = '" + json.getString("task_group_id") + "' order by sort_seq DESC").getResultJSONArray(0);
|
||||
JSONArray taskArr = wo_Task.query("task_group_id = '" + json.getString("task_group_id") + "' order by sort_seq ASC").getResultJSONArray(0);
|
||||
|
||||
for (int j = 0; j < taskArr.size(); j++) {
|
||||
JSONObject json2 = taskArr.getJSONObject(j);
|
||||
@@ -153,7 +153,7 @@ public class OutTask extends AbstractAcsTask {
|
||||
String task_group_id = jsonTask.getString("task_group_id");
|
||||
if (ObjectUtil.isNotEmpty(task_group_id)) {
|
||||
// 上一个任务组顺序号
|
||||
String sort_seq_last = NumberUtil.add(jsonTask.getString("sort_seq"), "1").toString();
|
||||
String sort_seq_last = NumberUtil.sub(jsonTask.getString("sort_seq"), "1").toString();
|
||||
|
||||
JSONObject jsonTaskLast = taskTab.query("task_group_id = '" + task_group_id + "' and sort_seq = '" + sort_seq_last + "' and task_status <> '07'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonTaskLast)) throw new BadRequestException("请先完成"+jsonTaskLast.getString("task_code")+"的任务!");
|
||||
|
||||
@@ -2768,6 +2768,35 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
int j = 0;
|
||||
JSONObject jsonObject = disRowArrNew.getJSONObject(j);
|
||||
|
||||
// 查询未被锁住的仓位
|
||||
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();
|
||||
|
||||
// 判断是否需要生成移库
|
||||
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);
|
||||
}
|
||||
|
||||
// 创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("task_type", "010503");
|
||||
@@ -2804,38 +2833,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
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();
|
||||
// 更新出库任务:任务组和顺序号
|
||||
JSONObject jsonTaskLast1 = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq DESC").uniqueResult(0);
|
||||
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);
|
||||
if (ObjectUtil.isEmpty(jsonTaskLast1)) {
|
||||
jsonTask.put("sort_seq", 1);
|
||||
} else {
|
||||
jsonTask.put("sort_seq", jsonTaskLast1.getIntValue("sort_seq")+1);
|
||||
}
|
||||
wo_Task.update(jsonTask);
|
||||
|
||||
/*
|
||||
* 判断下一个出库仓位是否相邻
|
||||
@@ -2858,7 +2864,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
} else {
|
||||
// 查询此任务组最后一个生成的任务
|
||||
JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq ASC").uniqueResult(0);
|
||||
JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq DESC").uniqueResult(0);
|
||||
// 创建任务并添加到任务组
|
||||
JSONObject param2 = new JSONObject();
|
||||
param2.put("task_type", "010503");
|
||||
@@ -2868,7 +2874,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
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); // 任务组顺序号
|
||||
param2.put("sort_seq", jsonTaskLast.getIntValue("sort_seq") + 1); // 任务组顺序号
|
||||
|
||||
String create_task_id2 = outTask.createTask(param2);
|
||||
|
||||
@@ -3166,6 +3172,35 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
int j = 0;
|
||||
JSONObject jsonObject = disRowArrNew.getJSONObject(j);
|
||||
|
||||
// 查询未被锁住的仓位
|
||||
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();
|
||||
|
||||
// 判断是否需要生成移库
|
||||
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);
|
||||
}
|
||||
|
||||
// 创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("task_type", "010503");
|
||||
@@ -3202,38 +3237,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
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();
|
||||
// 更新出库任务:任务组和顺序号
|
||||
JSONObject jsonTaskLast1 = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq DESC").uniqueResult(0);
|
||||
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);
|
||||
if (ObjectUtil.isEmpty(jsonTaskLast1)) {
|
||||
jsonTask.put("sort_seq", 1);
|
||||
} else {
|
||||
jsonTask.put("sort_seq", jsonTaskLast1.getIntValue("sort_seq")+1);
|
||||
}
|
||||
wo_Task.update(jsonTask);
|
||||
|
||||
/*
|
||||
* 判断下一个出库仓位是否相邻
|
||||
@@ -3256,7 +3268,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
} else {
|
||||
// 查询此任务组最后一个生成的任务
|
||||
JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq ASC").uniqueResult(0);
|
||||
JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq DESC").uniqueResult(0);
|
||||
// 创建任务并添加到任务组
|
||||
JSONObject param2 = new JSONObject();
|
||||
param2.put("task_type", "010503");
|
||||
@@ -3266,7 +3278,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
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); // 任务组顺序号
|
||||
param2.put("sort_seq", jsonTaskLast.getIntValue("sort_seq") + 1); // 任务组顺序号
|
||||
|
||||
String create_task_id2 = outTask.createTask(param2);
|
||||
|
||||
@@ -3375,7 +3387,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
param2.put("point_code1", json.getString("struct_code"));
|
||||
param2.put("point_code2", jsonMove.getString("struct_code"));
|
||||
param2.put("task_group_id", whereJson.getLongValue("task_group_id")); // 任务组
|
||||
param2.put("sort_seq", jsonAllBlockPoint.size() - i); // 任务组顺序号
|
||||
param2.put("sort_seq", i+1); // 任务组顺序号
|
||||
String move_task_id = outTask.createTask(param2);
|
||||
|
||||
// 回显移库明细任务id
|
||||
@@ -4299,7 +4311,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
String task_group_id = task.getString("task_group_id");
|
||||
if (ObjectUtil.isNotEmpty(task_group_id)) {
|
||||
// 上一个任务组顺序号
|
||||
String sort_seq_last = NumberUtil.add(task.getString("sort_seq"), "1").toString();
|
||||
String sort_seq_last = NumberUtil.sub(task.getString("sort_seq"), "1").toString();
|
||||
|
||||
JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' and sort_seq = '" + sort_seq_last + "' and task_status <> '07'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonTaskLast))
|
||||
|
||||
Reference in New Issue
Block a user