代码合并
This commit is contained in:
@@ -116,6 +116,11 @@ public interface CheckOutBillService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
void setPoint(JSONObject whereJson);
|
||||
/**
|
||||
* 设置一个站点
|
||||
* @param whereJson /
|
||||
*/
|
||||
void oneSetPoint(JSONObject whereJson);
|
||||
/**
|
||||
* 查询可分配库存
|
||||
* @param whereJson /
|
||||
|
||||
@@ -124,6 +124,13 @@ public class CheckOutBillController {
|
||||
checkOutBillService.setPoint(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@PostMapping("/oneSetPoint")
|
||||
@Log("设置一个站点")
|
||||
@ApiOperation("设置检验站点")
|
||||
public ResponseEntity<Object> oneSetPoint(@RequestBody JSONObject whereJson) {
|
||||
checkOutBillService.oneSetPoint(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@GetMapping("/getOutBillTask")
|
||||
@Log("查询出库单分配任务")
|
||||
@ApiOperation("查询出库单分配任务")
|
||||
|
||||
@@ -87,6 +87,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
if (StrUtil.isNotEmpty(map.get("vbeln"))) {
|
||||
map.put("vbeln", "%" + map.get("vbeln") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("width"))) {
|
||||
map.put("width", "%" + map.get("width") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
}
|
||||
@@ -464,6 +467,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
jsonDtl.put("unassign_qty", row.get("plan_qty"));
|
||||
jsonDtl.put("vbeln", row.getString("vbeln"));
|
||||
jsonDtl.put("posnr", row.getString("posnr"));
|
||||
jsonDtl.put("width", row.getString("width"));
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(jsonDtl);
|
||||
qty += jsonDtl.getDoubleValue("plan_qty");
|
||||
|
||||
@@ -1655,6 +1659,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
table.add(jsonMoveDtl);
|
||||
// 更新任务处理类
|
||||
JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0);
|
||||
jsonTaskMove.put("task_type", "010505");
|
||||
jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName());
|
||||
wo_Task.update(jsonTaskMove);
|
||||
|
||||
@@ -1774,6 +1779,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
table.add(jsonMoveDtl);
|
||||
// 更新任务处理类
|
||||
JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0);
|
||||
jsonTaskMove.put("task_type", "010505");
|
||||
jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName());
|
||||
wo_Task.update(jsonTaskMove);
|
||||
|
||||
@@ -1787,7 +1793,770 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
// 下发
|
||||
outTask.immediateNotifyAcs(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void oneSetPoint(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");
|
||||
// 库存表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
|
||||
String struct_id = whereJson.getString("struct_id");
|
||||
String point_code = whereJson.getString("point_code"); // 终点
|
||||
String iostorinv_id = whereJson.getString("iostorinv_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("该站点被锁定或者有载具号,不允许设置!");
|
||||
}
|
||||
|
||||
// 查询未生成和生成未下发的分配记录
|
||||
JSONObject dis = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||
.addParam("flag", "5")
|
||||
.addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"))
|
||||
.addParam("struct_id", struct_id)
|
||||
.addParam("iostorinv_id", iostorinv_id)
|
||||
.addParam("bill_status", "01")
|
||||
.addParam("is_issued", "0")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(dis)) {
|
||||
throw new BadRequestException("分配明细不存在或已执行、完成、!");
|
||||
}
|
||||
|
||||
String task_status = dis.getString("task_status");
|
||||
String task_id = dis.getString("task_id");
|
||||
|
||||
if (StrUtil.isNotEmpty(task_status) && "05,06,07".contains(task_status)) {
|
||||
throw new BadRequestException("该任务已执行,不可重新设置站点!");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(task_id)) {
|
||||
//若任务不为空,则为变更出库目的站点
|
||||
JSONObject task = wo_Task.query("task_id='" + task_id + "'").uniqueResult(0);
|
||||
//更新任务
|
||||
task.put("point_code2", jsonPoint2.getString("point_code"));
|
||||
wo_Task.update(task);
|
||||
} else {
|
||||
/*
|
||||
* 生成任务:
|
||||
* 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
|
||||
* a.如果有:有则合并只生成一条任务
|
||||
* b.没有:则正常生成
|
||||
* 2.判断此货位是否被挡住
|
||||
* a.挡住:判断哪边的货位比较少 , 生成移库单
|
||||
* b.没挡住:正常生成
|
||||
*/
|
||||
JSONObject jsonPoint1 = wo_Point.query("source_id = '" + dis.getString("struct_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint1)) throw new BadRequestException("起点点位不存在");
|
||||
|
||||
// 创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("task_type", "010503");
|
||||
param.put("vehicle_code", dis.getString("box_no"));
|
||||
param.put("task_name", "task_name");
|
||||
param.put("point_code1", jsonPoint1.getString("point_code"));
|
||||
param.put("point_code2", jsonPoint2.getString("point_code"));
|
||||
param.put("material_id", dis.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.getLong("point_id"));
|
||||
wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + dis.getString("iostorinvdis_id") + "'");
|
||||
|
||||
// 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
|
||||
JSONArray disArr = wo_dis.query("struct_id = '" + dis.getString("struct_id") +
|
||||
"' and iostorinv_id = '" + dis.getString("iostorinv_id") +
|
||||
"' and iostorinvdis_id <> '" + dis.getString("iostorinvdis_id") +
|
||||
"' and work_status = '00'").getResultJSONArray(0);
|
||||
|
||||
// 依次更新相同仓位的分配明细状态、任务标识、出库点位
|
||||
for (int i = 0; i < disArr.size(); i++) {
|
||||
JSONObject jsonObject = disArr.getJSONObject(i);
|
||||
jsonObject.put("work_status", "01");
|
||||
jsonObject.put("task_id", jsonTask.getLong("task_id"));
|
||||
jsonObject.put("point_id", jsonPoint2.getLong("point_id"));
|
||||
wo_dis.update(jsonObject);
|
||||
}
|
||||
|
||||
// 2.判断此货位是否被挡住
|
||||
JSONObject jsonAttr = attrTab.query("struct_id = '" + dis.getString("struct_id") + "'").uniqueResult(0);
|
||||
|
||||
// 判断此仓位是‘双通’还是’单通‘
|
||||
if (StrUtil.equals(jsonAttr.getString("placement_type"), "01")) {
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("struct_code", jsonAttr.getString("struct_code"));
|
||||
map.put("sect_id", jsonAttr.getString("sect_id"));
|
||||
|
||||
// 判断左边是否被挡住
|
||||
JSONObject jsonIsBlockL = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
|
||||
boolean left_verify = true;
|
||||
if (ObjectUtil.isEmpty(jsonIsBlockL)) {
|
||||
left_verify = false;
|
||||
String out_order_seq = NumberUtil.add(jsonAttr.getString("out_order_seq"), "1").toString();
|
||||
JSONObject json = attrTab.query("sect_id = '" + map.getString("sect_id")
|
||||
+ "' and out_order_seq = '" + out_order_seq
|
||||
+ "' and block_num = '" + jsonAttr.getString("block_num")
|
||||
+ "' and row_num = '" + jsonAttr.getString("row_num") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
jsonAttr.put("placement_type","02");
|
||||
}
|
||||
} else {
|
||||
// 调用验证方法进行校验
|
||||
String out_order_seq = NumberUtil.add(jsonIsBlockL.getString("out_order_seq"), "1").toString();
|
||||
JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id")
|
||||
+ "' and out_order_seq = '" + out_order_seq
|
||||
+ "' and block_num = '" + jsonIsBlockL.getString("block_num")
|
||||
+ "' and row_num = '" + jsonIsBlockL.getString("row_num") + "'").uniqueResult(0);
|
||||
|
||||
jsonParam.put("iostorinv_id", dis.getString("iostorinv_id"));
|
||||
jsonParam.put("option", "2");
|
||||
left_verify = this.is_trueOrFalse(jsonParam);
|
||||
|
||||
if (!left_verify) {
|
||||
jsonParam.put("option", "3");
|
||||
boolean left_verify2 = this.is_trueOrFalse(jsonParam);
|
||||
|
||||
if (left_verify2) {
|
||||
jsonAttr.put("placement_type","02");
|
||||
}
|
||||
} else {
|
||||
jsonParam.put("option", "4");
|
||||
boolean left_verify2 = this.is_trueOrFalse(jsonParam);
|
||||
|
||||
if (left_verify2) {
|
||||
jsonAttr.put("placement_type","02");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 判断右边是否被挡住
|
||||
map.put("flag", "1");
|
||||
JSONObject jsonIsBlockR = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
|
||||
boolean right_verify = true;
|
||||
if (ObjectUtil.isEmpty(jsonIsBlockR)) {
|
||||
right_verify = false;
|
||||
String out_order_seq = NumberUtil.sub(jsonAttr.getString("out_order_seq"), "1").toString();
|
||||
JSONObject json = attrTab.query("sect_id = '" + map.getString("sect_id")
|
||||
+ "' and out_order_seq = '" + out_order_seq
|
||||
+ "' and block_num = '" + jsonAttr.getString("block_num")
|
||||
+ "' and row_num = '" + jsonAttr.getString("row_num") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
jsonAttr.put("placement_type","03");
|
||||
}
|
||||
} else {
|
||||
// 调用验证方法进行校验
|
||||
String out_order_seq = NumberUtil.sub(jsonIsBlockR.getString("out_order_seq"), "1").toString();
|
||||
JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id")
|
||||
+ "' and out_order_seq = '" + out_order_seq
|
||||
+ "' and block_num = '" + jsonIsBlockR.getString("block_num")
|
||||
+ "' and row_num = '" + jsonIsBlockR.getString("row_num") + "'").uniqueResult(0);
|
||||
|
||||
jsonParam.put("iostorinv_id", dis.getString("iostorinv_id"));
|
||||
jsonParam.put("option", "2");
|
||||
right_verify = this.is_trueOrFalse(jsonParam);
|
||||
|
||||
if (!right_verify) {
|
||||
jsonParam.put("option", "3");
|
||||
boolean right_verify2 = this.is_trueOrFalse(jsonParam);
|
||||
|
||||
if (right_verify2) {
|
||||
jsonAttr.put("placement_type","03");
|
||||
}
|
||||
} else {
|
||||
jsonParam.put("option", "4");
|
||||
boolean right_verify2 = this.is_trueOrFalse(jsonParam);
|
||||
|
||||
if (right_verify2) {
|
||||
jsonAttr.put("placement_type","03");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (left_verify && right_verify) {
|
||||
// 都被挡住判断哪边被挡住的货位少
|
||||
map.put("flag", "3");
|
||||
map.put("out_order_seq", jsonAttr.getString("out_order_seq"));
|
||||
JSONArray jsonIsBlockAll = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
int blockLeft = 0; // 左边个数
|
||||
int blockRigth = 0; // 右边个数
|
||||
for (int i = 0; i < jsonIsBlockAll.size(); i++) {
|
||||
JSONObject json = jsonIsBlockAll.getJSONObject(i);
|
||||
|
||||
if (i == 0) blockRigth = json.getIntValue("num");
|
||||
if (i == 1) blockRigth = json.getIntValue("num");
|
||||
}
|
||||
|
||||
// 更新第一个任务 任务组、任务顺序号
|
||||
jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonTask.put("sort_seq", 1);
|
||||
wo_Task.update(jsonTask);
|
||||
|
||||
JSONArray jsonAllBlockPoint = new JSONArray();
|
||||
if (blockLeft > blockRigth) {
|
||||
// 从右边生成移库单
|
||||
map.put("flag", "4");
|
||||
map.put("block_num", jsonAttr.getString("block_num"));
|
||||
map.put("row_num", jsonAttr.getString("row_num"));
|
||||
|
||||
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
} else {
|
||||
// 从左边生成移库单
|
||||
map.put("flag", "5");
|
||||
map.put("block_num", jsonAttr.getString("block_num"));
|
||||
map.put("row_num", jsonAttr.getString("row_num"));
|
||||
|
||||
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < jsonAllBlockPoint.size(); i++) {
|
||||
JSONObject json = jsonAllBlockPoint.getJSONObject(i);
|
||||
|
||||
JSONObject mapParam = new JSONObject();// 生成移库单传入参数
|
||||
JSONArray table = new JSONArray(); // 明细参数
|
||||
mapParam.put("bill_status", "10");
|
||||
mapParam.put("bill_type", "21");
|
||||
mapParam.put("buss_type", "21");
|
||||
mapParam.put("biz_date", DateUtil.today());
|
||||
mapParam.put("stor_code", "CP01");
|
||||
mapParam.put("stor_id", "1582991156504039424");
|
||||
mapParam.put("stor_name", "成品仓库");
|
||||
mapParam.put("is_task", "1");
|
||||
|
||||
// 查询移入货位
|
||||
JSONObject moveParam = new JSONObject();
|
||||
moveParam.put("box_no", json.getString("storagevehicle_code"));
|
||||
moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId());
|
||||
JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam);
|
||||
// 查询移出货位的库存物料
|
||||
JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03")
|
||||
.addParam("flag", "6")
|
||||
.addParam("struct_id", json.getString("struct_id"))
|
||||
.process().uniqueResult(0);
|
||||
|
||||
// 移库单明细
|
||||
JSONObject jsonMoveDtl = new JSONObject();
|
||||
jsonMoveDtl.put("is_task", "2");
|
||||
jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id"));
|
||||
jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code"));
|
||||
jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name"));
|
||||
jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id"));
|
||||
jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code"));
|
||||
jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name"));
|
||||
jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id"));
|
||||
jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn"));
|
||||
jsonMoveDtl.put("quality_scode", "01");
|
||||
jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id"));
|
||||
jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name"));
|
||||
jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty"));
|
||||
jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
|
||||
jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id"));
|
||||
jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code"));
|
||||
jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name"));
|
||||
jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id"));
|
||||
jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code"));
|
||||
jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name"));
|
||||
jsonMoveDtl.put("source_billdtl_id", dis.getLongValue("iostorinvdis_id"));
|
||||
|
||||
// 生成任务
|
||||
JSONObject param2 = new JSONObject();
|
||||
param2.put("task_type", "010503");
|
||||
param2.put("vehicle_code", json.getString("storagevehicle_code"));
|
||||
param2.put("task_name", "task_name");
|
||||
param2.put("point_code1", json.getString("point_code"));
|
||||
param2.put("point_code2", jsonMove.getString("struct_code"));
|
||||
param2.put("task_group_id", jsonTask.getLongValue("task_group_id")); // 任务组
|
||||
param2.put("sort_seq", jsonTask.getIntValue("sort_seq") + i + 1); // 任务组顺序号
|
||||
String move_task_id = outTask.createTask(param2);
|
||||
|
||||
// 回显移库明细任务id
|
||||
jsonMoveDtl.put("task_id", move_task_id);
|
||||
table.add(jsonMoveDtl);
|
||||
// 更新任务处理类
|
||||
JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0);
|
||||
jsonTaskMove.put("task_type", "010505");
|
||||
jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName());
|
||||
wo_Task.update(jsonTaskMove);
|
||||
|
||||
mapParam.put("tableData", table);
|
||||
// 调用移库单新增方法
|
||||
if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) {
|
||||
handMoveStorService.insertDtl2(mapParam);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (StrUtil.equals(jsonAttr.getString("placement_type"),"01")) {
|
||||
throw new BadRequestException("任务生成失败,请重新选择");
|
||||
}
|
||||
map.put("struct_code", jsonAttr.getString("struct_code"));
|
||||
map.put("sect_id", jsonAttr.getString("sect_id"));
|
||||
map.put("out_order_seq", jsonAttr.getString("out_order_seq"));
|
||||
map.put("block_num", jsonAttr.getString("block_num"));
|
||||
map.put("row_num", jsonAttr.getString("row_num"));
|
||||
|
||||
JSONArray jsonAllBlockPoint = new JSONArray();
|
||||
if (StrUtil.equals(jsonAttr.getString("placement_type"), "02")) {
|
||||
// 02-左通
|
||||
map.put("flag", "2");
|
||||
// 判断左边是否被挡住
|
||||
JSONObject jsonIsBlockL2 = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
// 如果被挡住则进行校验
|
||||
boolean verify = true;
|
||||
if (ObjectUtil.isEmpty(jsonIsBlockL2)) {
|
||||
verify = false;
|
||||
} else {
|
||||
// 调用验证方法进行校验
|
||||
String out_order_seq = NumberUtil.add(jsonIsBlockL2.getString("out_order_seq"), "1").toString();
|
||||
JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id")
|
||||
+ "' and out_order_seq = '" + out_order_seq
|
||||
+ "' and block_num = '" + map.getString("block_num")
|
||||
+ "' and row_num = '" + map.getString("row_num") + "'").uniqueResult(0);
|
||||
|
||||
jsonParam.put("iostorinv_id", dis.getString("iostorinv_id"));
|
||||
jsonParam.put("option", "1");
|
||||
verify = this.is_trueOrFalse(jsonParam);
|
||||
}
|
||||
|
||||
if (verify) {
|
||||
// 更新第一个任务 任务组、任务顺序号
|
||||
jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonTask.put("sort_seq", 1);
|
||||
wo_Task.update(jsonTask);
|
||||
// 从左边生成移库单
|
||||
map.put("flag", "5");
|
||||
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.equals(jsonAttr.getString("placement_type"), "03")) {
|
||||
// 03-右通
|
||||
map.put("flag", "1");
|
||||
// 判断右边是否被挡住
|
||||
JSONObject jsonIsBlockR2 = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
// 如果被挡住则进行校验
|
||||
boolean verify = true;
|
||||
if (ObjectUtil.isEmpty(jsonIsBlockR2)) {
|
||||
verify = false;
|
||||
} else {
|
||||
// 调用验证方法进行校验
|
||||
String out_order_seq = NumberUtil.sub(jsonIsBlockR2.getString("out_order_seq"), "1").toString();
|
||||
JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id")
|
||||
+ "' and out_order_seq = '" + out_order_seq
|
||||
+ "' and block_num = '" + map.getString("block_num")
|
||||
+ "' and row_num = '" + map.getString("row_num") + "'").uniqueResult(0);
|
||||
|
||||
jsonParam.put("iostorinv_id", dis.getString("iostorinv_id"));
|
||||
jsonParam.put("option", "1");
|
||||
verify = this.is_trueOrFalse(jsonParam);
|
||||
}
|
||||
|
||||
if (verify) {
|
||||
// 更新第一个任务 任务组、任务顺序号
|
||||
jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonTask.put("sort_seq", 1);
|
||||
wo_Task.update(jsonTask);
|
||||
// 从右边生成移库单
|
||||
map.put("flag", "4");
|
||||
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < jsonAllBlockPoint.size(); i++) {
|
||||
JSONObject json = jsonAllBlockPoint.getJSONObject(i);
|
||||
|
||||
JSONObject mapParam = new JSONObject();// 生成移库单传入参数
|
||||
JSONArray table = new JSONArray(); // 明细参数
|
||||
mapParam.put("bill_status", "10");
|
||||
mapParam.put("bill_type", "21");
|
||||
mapParam.put("buss_type", "21");
|
||||
mapParam.put("biz_date", DateUtil.today());
|
||||
mapParam.put("stor_code", "CP01");
|
||||
mapParam.put("stor_id", "1582991156504039424");
|
||||
mapParam.put("stor_name", "成品仓库");
|
||||
mapParam.put("is_task", "1");
|
||||
|
||||
// 查询移入货位
|
||||
JSONObject moveParam = new JSONObject();
|
||||
moveParam.put("box_no", json.getString("storagevehicle_code"));
|
||||
moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId());
|
||||
JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam);
|
||||
// 查询移出货位的库存物料
|
||||
JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03")
|
||||
.addParam("flag", "6")
|
||||
.addParam("struct_id", json.getString("struct_id"))
|
||||
.process().uniqueResult(0);
|
||||
|
||||
// 移库单明细
|
||||
JSONObject jsonMoveDtl = new JSONObject();
|
||||
jsonMoveDtl.put("is_task", "2");
|
||||
jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id"));
|
||||
jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code"));
|
||||
jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name"));
|
||||
jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id"));
|
||||
jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code"));
|
||||
jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name"));
|
||||
jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id"));
|
||||
jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn"));
|
||||
jsonMoveDtl.put("quality_scode", "01");
|
||||
jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id"));
|
||||
jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name"));
|
||||
jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty"));
|
||||
jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
|
||||
jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id"));
|
||||
jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code"));
|
||||
jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name"));
|
||||
jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id"));
|
||||
jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code"));
|
||||
jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name"));
|
||||
jsonMoveDtl.put("source_billdtl_id", dis.getLongValue("iostorinvdis_id"));
|
||||
|
||||
// 生成任务
|
||||
JSONObject param2 = new JSONObject();
|
||||
param2.put("task_type", "010503");
|
||||
param2.put("vehicle_code", json.getString("storagevehicle_code"));
|
||||
param2.put("task_name", "task_name");
|
||||
param2.put("point_code1", json.getString("point_code"));
|
||||
param2.put("point_code2", jsonMove.getString("struct_code"));
|
||||
param2.put("task_group_id", jsonTask.getLongValue("task_group_id")); // 任务组
|
||||
param2.put("sort_seq", jsonTask.getIntValue("sort_seq") + i + 1); // 任务组顺序号
|
||||
String move_task_id = outTask.createTask(param2);
|
||||
|
||||
// 回显移库明细任务id
|
||||
jsonMoveDtl.put("task_id", move_task_id);
|
||||
table.add(jsonMoveDtl);
|
||||
// 更新任务处理类
|
||||
JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0);
|
||||
jsonTaskMove.put("task_type", "010505");
|
||||
jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName());
|
||||
wo_Task.update(jsonTaskMove);
|
||||
|
||||
mapParam.put("tableData", table);
|
||||
// 调用移库单新增方法
|
||||
if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) {
|
||||
handMoveStorService.insertDtl2(mapParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("struct_code", jsonAttr.getString("struct_code"));
|
||||
map.put("sect_id", jsonAttr.getString("sect_id"));
|
||||
map.put("out_order_seq", jsonAttr.getString("out_order_seq"));
|
||||
map.put("block_num", jsonAttr.getString("block_num"));
|
||||
map.put("row_num", jsonAttr.getString("row_num"));
|
||||
|
||||
JSONArray jsonAllBlockPoint = new JSONArray();
|
||||
if (StrUtil.equals(jsonAttr.getString("placement_type"), "02")) {
|
||||
// 02-左通
|
||||
map.put("flag", "2");
|
||||
// 判断左边是否被挡住
|
||||
JSONObject jsonIsBlockL = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
// 如果被挡住则进行校验
|
||||
boolean verify = true;
|
||||
if (ObjectUtil.isEmpty(jsonIsBlockL)) {
|
||||
verify = false;
|
||||
} else {
|
||||
// 调用验证方法进行校验
|
||||
String out_order_seq = NumberUtil.add(jsonIsBlockL.getString("out_order_seq"), "1").toString();
|
||||
JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id")
|
||||
+ "' and out_order_seq = '" + out_order_seq
|
||||
+ "' and block_num = '" + map.getString("block_num")
|
||||
+ "' and row_num = '" + map.getString("row_num") + "'").uniqueResult(0);
|
||||
|
||||
jsonParam.put("iostorinv_id", dis.getString("iostorinv_id"));
|
||||
jsonParam.put("option", "1");
|
||||
verify = this.is_trueOrFalse(jsonParam);
|
||||
}
|
||||
|
||||
if (verify) {
|
||||
// 更新第一个任务 任务组、任务顺序号
|
||||
jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonTask.put("sort_seq", 1);
|
||||
wo_Task.update(jsonTask);
|
||||
// 从左边生成移库单
|
||||
map.put("flag", "5");
|
||||
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.equals(jsonAttr.getString("placement_type"), "03")) {
|
||||
// 03-右通
|
||||
map.put("flag", "1");
|
||||
// 判断左边是否被挡住
|
||||
JSONObject jsonIsBlockR = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
// 如果被挡住则进行校验
|
||||
boolean verify = true;
|
||||
if (ObjectUtil.isEmpty(jsonIsBlockR)) {
|
||||
verify = false;
|
||||
} else {
|
||||
// 调用验证方法进行校验
|
||||
String out_order_seq = NumberUtil.sub(jsonIsBlockR.getString("out_order_seq"), "1").toString();
|
||||
JSONObject jsonParam = attrTab.query("sect_id = '" + map.getString("sect_id")
|
||||
+ "' and out_order_seq = '" + out_order_seq
|
||||
+ "' and block_num = '" + map.getString("block_num")
|
||||
+ "' and row_num = '" + map.getString("row_num") + "'").uniqueResult(0);
|
||||
|
||||
jsonParam.put("iostorinv_id", dis.getString("iostorinv_id"));
|
||||
jsonParam.put("option", "1");
|
||||
verify = this.is_trueOrFalse(jsonParam);
|
||||
}
|
||||
|
||||
if (verify) {
|
||||
// 更新第一个任务 任务组、任务顺序号
|
||||
jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonTask.put("sort_seq", 1);
|
||||
wo_Task.update(jsonTask);
|
||||
// 从右边生成移库单
|
||||
map.put("flag", "4");
|
||||
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < jsonAllBlockPoint.size(); i++) {
|
||||
JSONObject json = jsonAllBlockPoint.getJSONObject(i);
|
||||
|
||||
JSONObject mapParam = new JSONObject();// 生成移库单传入参数
|
||||
JSONArray table = new JSONArray(); // 明细参数
|
||||
mapParam.put("bill_status", "10");
|
||||
mapParam.put("bill_type", "21");
|
||||
mapParam.put("buss_type", "21");
|
||||
mapParam.put("biz_date", DateUtil.today());
|
||||
mapParam.put("stor_code", "CP01");
|
||||
mapParam.put("stor_id", "1582991156504039424");
|
||||
mapParam.put("stor_name", "成品仓库");
|
||||
mapParam.put("is_task", "1");
|
||||
|
||||
// 查询移入货位
|
||||
JSONObject moveParam = new JSONObject();
|
||||
moveParam.put("box_no", json.getString("storagevehicle_code"));
|
||||
moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId());
|
||||
JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam);
|
||||
// 查询移出货位的库存物料
|
||||
JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03")
|
||||
.addParam("flag", "6")
|
||||
.addParam("struct_id", json.getString("struct_id"))
|
||||
.process().uniqueResult(0);
|
||||
|
||||
// 移库单明细
|
||||
JSONObject jsonMoveDtl = new JSONObject();
|
||||
jsonMoveDtl.put("is_task", "2");
|
||||
jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id"));
|
||||
jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code"));
|
||||
jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name"));
|
||||
jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id"));
|
||||
jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code"));
|
||||
jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name"));
|
||||
jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id"));
|
||||
jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn"));
|
||||
jsonMoveDtl.put("quality_scode", "01");
|
||||
jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id"));
|
||||
jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name"));
|
||||
jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty"));
|
||||
jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
|
||||
jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id"));
|
||||
jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code"));
|
||||
jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name"));
|
||||
jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id"));
|
||||
jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code"));
|
||||
jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name"));
|
||||
jsonMoveDtl.put("source_billdtl_id", dis.getLongValue("iostorinvdis_id"));
|
||||
|
||||
// 生成任务
|
||||
JSONObject param2 = new JSONObject();
|
||||
param2.put("task_type", "010503");
|
||||
param2.put("vehicle_code", json.getString("storagevehicle_code"));
|
||||
param2.put("task_name", "task_name");
|
||||
param2.put("point_code1", json.getString("point_code"));
|
||||
param2.put("point_code2", jsonMove.getString("struct_code"));
|
||||
param2.put("task_group_id", jsonTask.getLongValue("task_group_id")); // 任务组
|
||||
param2.put("sort_seq", jsonTask.getIntValue("sort_seq") + i + 1); // 任务组顺序号
|
||||
String move_task_id = outTask.createTask(param2);
|
||||
|
||||
// 回显移库明细任务id
|
||||
jsonMoveDtl.put("task_id", move_task_id);
|
||||
table.add(jsonMoveDtl);
|
||||
// 更新任务处理类
|
||||
JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0);
|
||||
jsonTaskMove.put("task_type", "010505");
|
||||
jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName());
|
||||
wo_Task.update(jsonTaskMove);
|
||||
|
||||
mapParam.put("tableData", table);
|
||||
// 调用移库单新增方法
|
||||
if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) {
|
||||
handMoveStorService.insertDtl2(mapParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 下发
|
||||
outTask.immediateNotifyAcs(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean is_trueOrFalse(JSONObject json) {
|
||||
/*
|
||||
* 判断此货位在此出库单分配明细中是否存在:
|
||||
* 1.如果存在:
|
||||
* 1)判断此货位是否生成任务:生成:则没有任务组 = false,未生成:报错
|
||||
* 2.如果不存在:则判断此货位是否被锁住
|
||||
* 1)未锁住:生成移库单 = true
|
||||
* 2)锁住:判断是否生成任务,生成:则不用生成移库单 = false;未生成则报错
|
||||
*/
|
||||
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配明细表
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task"); // 任务表
|
||||
|
||||
if (ObjectUtil.isEmpty(json)) {
|
||||
// 如果为空说明未堵住
|
||||
return false;
|
||||
}
|
||||
|
||||
String struct_code = json.getString("struct_code");
|
||||
String iostorinv_id = json.getString("iostorinv_id");
|
||||
|
||||
if (ObjectUtil.isEmpty(struct_code)) throw new BadRequestException("校验仓位不能为空");
|
||||
|
||||
boolean param = false;
|
||||
|
||||
if (StrUtil.equals(json.getString("option"), "1")) {
|
||||
// 单通
|
||||
// 判断此货位在此出库单中是否存在
|
||||
JSONObject jsondis = disTab.query("iostorinv_id = '" + iostorinv_id + "' and struct_code = '" + struct_code + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsondis)) {
|
||||
// 存在:判断是否生成任务
|
||||
if (!StrUtil.equals(jsondis.getString("work_status"),"00")) {
|
||||
param = false;
|
||||
} else {
|
||||
throw new BadRequestException("此仓位不可生成任务,请按照顺序选择!");
|
||||
}
|
||||
} else {
|
||||
// 不存在: 判断此货位是否被锁住
|
||||
if (StrUtil.equals(json.getString("lock_type"), "1")) {
|
||||
// 未锁住:返回true
|
||||
param = true;
|
||||
} else {
|
||||
// 锁住:判断是否生成任务,生成:则不用生成移库单 = false;未生成则报错
|
||||
JSONObject jsonTask1 = taskTab.query("point_code1 = '" + struct_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
JSONObject jsonTask2 = taskTab.query("point_code2 = '" + struct_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonTask1) && ObjectUtil.isEmpty(jsonTask2)) {
|
||||
// 未生成任务
|
||||
throw new BadRequestException("挡住仓位"+struct_code+"已锁定但未生成任务,请按照顺序选择");
|
||||
} else {
|
||||
// 已生成
|
||||
param = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (StrUtil.equals(json.getString("option"), "2")){
|
||||
// 双通
|
||||
// 判断此货位在此出库单中是否存在
|
||||
JSONObject jsondis = disTab.query("iostorinv_id = '" + iostorinv_id + "' and struct_code = '" + struct_code + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsondis)) {
|
||||
param = false;
|
||||
} else {
|
||||
// 不存在: 判断此货位是否被锁住
|
||||
if (StrUtil.equals(json.getString("lock_type"), "1")) {
|
||||
// 未锁住:返回true
|
||||
param = true;
|
||||
} else {
|
||||
// 锁住:判断是否生成任务,生成:则不用生成移库单 = false;未生成则报错
|
||||
JSONObject jsonTask1 = taskTab.query("point_code1 = '" + struct_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
JSONObject jsonTask2 = taskTab.query("point_code2 = '" + struct_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonTask1) && ObjectUtil.isEmpty(jsonTask2)) {
|
||||
// 未生成任务
|
||||
param = true;
|
||||
} else {
|
||||
// 已生成
|
||||
param = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (StrUtil.equals(json.getString("option"), "3")) {
|
||||
// 判断此货位在此出库单中是否存在
|
||||
JSONObject jsondis = disTab.query("iostorinv_id = '" + iostorinv_id + "' and struct_code = '" + struct_code + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsondis)) {
|
||||
// 存在:判断是否生成任务
|
||||
if (!StrUtil.equals(jsondis.getString("work_status"),"00")) {
|
||||
param = true;
|
||||
} else {
|
||||
param = false;
|
||||
}
|
||||
} else {
|
||||
// 不存在: 判断此货位是否被锁住
|
||||
if (StrUtil.equals(json.getString("lock_type"), "1")) {
|
||||
// 未锁住:返回true
|
||||
param = false;
|
||||
} else {
|
||||
// 锁住:判断是否生成任务,生成:则不用生成移库单 = false;未生成则报错
|
||||
JSONObject jsonTask1 = taskTab.query("point_code1 = '" + struct_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
JSONObject jsonTask2 = taskTab.query("point_code2 = '" + struct_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonTask1) && ObjectUtil.isEmpty(jsonTask2)) {
|
||||
// 未生成任务
|
||||
param = false;
|
||||
} else {
|
||||
// 已生成
|
||||
param = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (StrUtil.equals(json.getString("option"), "4")) {
|
||||
if (StrUtil.equals(json.getString("lock_type"), "1")) {
|
||||
// 未锁住:返回true
|
||||
param = true;
|
||||
} else {
|
||||
// 锁住:判断是否生成任务,生成:则不用生成移库单 = false;未生成则报错
|
||||
JSONObject jsonTask1 = taskTab.query("point_code1 = '" + struct_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
JSONObject jsonTask2 = taskTab.query("point_code2 = '" + struct_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonTask1) && ObjectUtil.isEmpty(jsonTask2)) {
|
||||
// 未生成任务
|
||||
param = true;
|
||||
} else {
|
||||
// 已生成
|
||||
param = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
输入.cust_code TYPEAS s_string
|
||||
输入.package_box_sn TYPEAS s_string
|
||||
输入.is_upload TYPEAS s_string
|
||||
输入.width TYPEAS s_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
@@ -121,6 +122,10 @@
|
||||
dtl.vbeln like 输入.vbeln
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.width <> ""
|
||||
dtl.width like 输入.width
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_type <> ""
|
||||
ios.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
@@ -165,7 +170,7 @@
|
||||
LEFT JOIN ST_IVT_IOStorInv ios ON ios.iostorinv_id = iosdtl.iostorinv_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = iosdtl.pcsn
|
||||
WHERE
|
||||
sub.status = '2'
|
||||
1=1
|
||||
OPTION 输入.iostorinv_id <> ""
|
||||
iosdtl.iostorinv_id = 输入.iostorinv_id
|
||||
ENDOPTION
|
||||
@@ -393,7 +398,7 @@
|
||||
dis.work_status <= 输入.bill_status
|
||||
ENDOPTION
|
||||
|
||||
order by attr.row_num,attr.out_order_seq ASC
|
||||
order by attr.layer_num ASC,attr.row_num ASC,attr.col_num ASC
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -84,7 +84,6 @@
|
||||
st_ivt_structattr sa3
|
||||
WHERE
|
||||
IFNULL( sa3.storagevehicle_code, '' ) <> ''
|
||||
AND sa3.lock_type = '1'
|
||||
) c
|
||||
WHERE
|
||||
c.block_num = a.block_num
|
||||
@@ -137,7 +136,6 @@
|
||||
st_ivt_structattr sa2
|
||||
WHERE
|
||||
IFNULL( sa2.storagevehicle_code, '' ) <> ''
|
||||
AND sa2.lock_type = '1'
|
||||
) b
|
||||
WHERE
|
||||
b.block_num = a.block_num
|
||||
@@ -169,8 +167,8 @@
|
||||
AND b.row_num = sa.row_num
|
||||
WHERE
|
||||
sa.out_order_seq < 输入.out_order_seq
|
||||
and sa.lock_type = '1'
|
||||
AND IFNULL( sa.storagevehicle_code, '' ) <> ''
|
||||
AND sa.lock_type = '1'
|
||||
|
||||
UNION
|
||||
|
||||
@@ -191,8 +189,8 @@
|
||||
AND b.row_num = sa.row_num
|
||||
WHERE
|
||||
sa.out_order_seq > 输入.out_order_seq
|
||||
and sa.lock_type = '1'
|
||||
AND IFNULL( sa.storagevehicle_code, '' ) <> ''
|
||||
AND sa.lock_type = '1'
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<!-- <el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />-->
|
||||
<el-table-column show-overflow-tooltip prop="vbeln" label="交货单" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="width" label="幅宽" align="center" width="100" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
@@ -163,7 +163,7 @@
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
@@ -173,6 +173,17 @@
|
||||
@click="setPoint()"
|
||||
>
|
||||
设置站点
|
||||
</el-button>-->
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="button4"
|
||||
@click="oneSetPoint"
|
||||
>
|
||||
设置站点
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
@@ -493,21 +504,6 @@ export default {
|
||||
this.crud.notify('任务已生成!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 根据此仓位的 ‘相同块、相同排、相同层’ 判断上一个任务是否生成
|
||||
const tab = this.tabledis
|
||||
for (let i = 0; i < tab.length; i++) {
|
||||
const item = tab[i]
|
||||
if (this.currentDis.block_num === item.block_num && this.currentDis.row_num === item.row_num && this.currentDis.layer_num === item.layer_num) {
|
||||
const out_order_seq = parseInt(this.currentDis.out_order_seq) - 1
|
||||
if (parseInt(item.out_order_seq) === out_order_seq) {
|
||||
if (item.work_status === '00') {
|
||||
this.crud.notify('请先生成上一个任务:' + item.struct_code, CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.currentDis.iostorinvdis_id !== null) {
|
||||
this.currentDis.point_code = this.form2.point_code
|
||||
checkoutbill.setPoint(this.currentDis).then(res => {
|
||||
@@ -515,6 +511,26 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
oneSetPoint() {
|
||||
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.oneSetPoint(this.currentDis).then(res => {
|
||||
this.queryTableDdis(this.currentDis.iostorinvdtl_id)
|
||||
})
|
||||
}
|
||||
},
|
||||
queryTableDtl() {
|
||||
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
|
||||
this.tableDtl = res
|
||||
|
||||
@@ -113,11 +113,14 @@
|
||||
<el-table-column prop="pcsn" label="子卷号" width="150px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="sap_pcsn" label="sap批次" width="120px" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="assign_qty" :formatter="crud.formatNum3" label="已分配重量" align="center" width="100px" />
|
||||
<el-table-column prop="unassign_qty" :formatter="crud.formatNum3" label="未分配重量" align="center" width="100px" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
|
||||
<!-- <el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />-->
|
||||
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
|
||||
<el-table-column prop="vbeln" label="交货单号" align="center" width="120px" />
|
||||
<el-table-column prop="posnr" label="行号" align="center" width="70px" />
|
||||
<el-table-column prop="width" label="幅宽" align="center" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
@@ -100,6 +100,13 @@ export function setPoint(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function oneSetPoint(data) {
|
||||
return request({
|
||||
url: '/api/checkoutbill/oneSetPoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getStructIvt(params) {
|
||||
return request({
|
||||
url: '/api/checkoutbill/getStructIvt',
|
||||
@@ -197,4 +204,4 @@ export function getOutBillTask2(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel }
|
||||
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 }
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="生成方式">
|
||||
<!-- <el-form-item label="生成方式">
|
||||
<el-select
|
||||
v-model="query.create_mode"
|
||||
clearable
|
||||
@@ -54,7 +54,7 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
@@ -128,6 +128,15 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发货幅宽">
|
||||
<el-input
|
||||
v-model="query.width"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="幅宽"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否回传">
|
||||
<el-select
|
||||
v-model="query.is_upload"
|
||||
|
||||
Reference in New Issue
Block a user