This commit is contained in:
2023-01-27 10:53:39 +08:00
9 changed files with 139 additions and 146 deletions

View File

@@ -192,45 +192,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task); logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task);
} }
// if (task > 0) {
// Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
// if (ObjectUtil.isNotEmpty(instruction)) {
//
// if (StrUtil.equals(this.getDeviceCode(), instruction.getStart_device_code())) {
//
// if (StrUtil.equals(instruction.getInstruction_status(), "0")) {
// instruction.setInstruction_status("1");
// instructionService.update(instruction);
// }
//
// String next_device_code = instruction.getNext_device_code();
// Device device = deviceAppservice.findDeviceByCode(next_device_code);
// if (ObjectUtil.isEmpty(device)) {
// logServer.deviceExecuteLog(this.device_code, "", "", "任务号:" + task + "输送线任务未完成,目标站设备为空!");
// return;
// }
// SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
// if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
// if(mode ==2 ){
// siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
// int nextTask = siemensConveyorDeviceDriver.getTask();
// if (nextTask == task) {
// inst_message = "指令号:" + instruction.getInstruction_code() + " " + instruction.getStart_point_code() + "->" + instruction.getNext_point_code() + " 载具号:" + instruction.getVehicle_code();
// if (StrUtil.equals(instruction.getInstruction_status(), "1")) {
// inst = instruction;
// finish_instruction();
// this.clearWrite();
// }
// }
// }
//
// }
// }
//
// }
//
// }
if (mode == 2 && move != 0 && task > 0) { if (mode == 2 && move != 0 && task > 0) {
//inst_message //inst_message
inst = instructionService.findByCodeFromCache(String.valueOf(task)); inst = instructionService.findByCodeFromCache(String.valueOf(task));
@@ -238,12 +199,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
vehicle_code = inst.getVehicle_code(); vehicle_code = inst.getVehicle_code();
// Device device = deviceAppservice.findDeviceByCode("BCR1");
// StandardScannerDeviceDriver standardScannerDeviceDriver;
// if (device.getDeviceDriver() instanceof ScannerDeviceDriver) {
// standardScannerDeviceDriver = (StandardScannerDeviceDriver) device.getDeviceDriver();
// standardScannerDeviceDriver.writeBarcode(vehicle_code);
// }
finish_instruction(); finish_instruction();
} }
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) { if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
@@ -873,16 +828,16 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
public synchronized void applyAgvTask() { public synchronized void applyAgvTask() {
Date date = new Date(); Date date = new Date();
if (date.getTime() - this.require_empty_out_time.getTime() < (long) this.instruction_require_time_out) { if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return; return;
} else { } else {
this.require_empty_out_time = date; this.instruction_require_time = date;
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
message = "申请AGV搬运任务中..."; message = "申请AGV搬运任务中...";
JSONObject apply = new JSONObject(); JSONObject apply = new JSONObject();
apply.put("device_code", device_code); apply.put("device_code", device_code);
apply.put("type","4"); apply.put("type","1");
String str = acsToWmsService.applyTaskToWms(apply); String str = acsToWmsService.applyTaskToWms(apply);
JSONObject jo = JSON.parseObject(str); JSONObject jo = JSON.parseObject(str);
if (ObjectUtil.isEmpty(jo)) { if (ObjectUtil.isEmpty(jo)) {

View File

@@ -684,6 +684,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
jo.put("hasGoods", true); jo.put("hasGoods", true);
} }
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("driver_type", "standard_conveyor_control_with_scanner");
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);
jo.put("action", action); jo.put("action", action);

View File

@@ -199,7 +199,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
boolean auto_div = false; boolean auto_div = false;
if (ObjectUtil.isEmpty(vehicle_code)) throw new BadRequestException("ACS申请任务失败载具不能为空"); if (ObjectUtil.isEmpty(vehicle_code)) throw new BadRequestException("ACS申请任务失败载具不能为空");
//通过该木箱码查询对应的分配明细 //通过该木箱码查询对应的分配明细
JSONArray dis_rows = WQLObject.getWQLObject("st_ivt_iostorinvdis").query("work_status = '00' AND box_no = '" + vehicle_code + "'").getResultJSONArray(0); JSONArray dis_rows = WQLObject.getWQLObject("st_ivt_iostorinvdis").query("work_status = '00' AND box_no = '" + vehicle_code + "' AND IFNULL(task_id,'') = ''").getResultJSONArray(0);
if (ObjectUtil.isEmpty(dis_rows)) { if (ObjectUtil.isEmpty(dis_rows)) {
throw new BadRequestException("未查询到木箱:" + vehicle_code + "相关入库分配明细记录!"); throw new BadRequestException("未查询到木箱:" + vehicle_code + "相关入库分配明细记录!");
} }

View File

@@ -171,6 +171,18 @@ public class ShippingServiceImpl implements ShippingService {
throw new BadRequestException("未查询到可用的空点位!"); throw new BadRequestException("未查询到可用的空点位!");
} }
/*//如果为左边点位判断右边是否存在未完成的任务,如果有则提示不能下发
//判断输送出来的任务起点是否靠近分切机,如果靠近分切机且远离分切机的点位上存在载具且不存在任务进行载具横移
char dtl_type = empty_point.getString("point_code").charAt(empty_point.getString("point_code").length() - 1);
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
JSONObject right_point = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_location = '"+empty_point.getString("point_location")+"' AND product_area = '"+empty_point.getString("product_area")+"' AND sort_seq = '"+empty_point.getString("sort_seq")+"' order by point_code desc").uniqueResult(0);
//判断是否存在任务
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("point_code1 = '"+right_point.getString("point_code")+"' OR point_code2 = '"+right_point.getString("point_code")+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task_jo)){
throw new BadRequestException("当前一截输送线存在未完成的任务,请稍等几分钟后进行下发!");
}
}*/
//下发输送线任务 //下发输送线任务
JSONObject form = new JSONObject(); JSONObject form = new JSONObject();
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + plan_jo.getString("product_area") + "' AND point_type = '6'").uniqueResult(0); JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + plan_jo.getString("product_area") + "' AND point_type = '6'").uniqueResult(0);
@@ -220,7 +232,8 @@ public class ShippingServiceImpl implements ShippingService {
} }
//根据起点判断区域查询对应的输送线空点位 //根据起点判断区域查询对应的输送线空点位
JSONObject point_jo = WQL.getWO("PDA_02").addParam("flag", "4").addParam("product_area", vehicle_area.getString("product_area")).addParam("point_location", vehicle_area.getString("point_location")).process().uniqueResult(0); JSONObject point_jo = WQL.getWO("PDA_02").addParam("flag", "4").addParam("product_area", vehicle_area.getString("product_area"))
.addParam("point_location", vehicle_area.getString("point_location")).process().uniqueResult(0);
if (ObjectUtil.isEmpty(point_jo)) { if (ObjectUtil.isEmpty(point_jo)) {
throw new BadRequestException("对应输送线不存在可用的空位!"); throw new BadRequestException("对应输送线不存在可用的空位!");
} }

View File

@@ -135,15 +135,10 @@ public class ProductInstorServiceImpl implements ProductInstorService {
String iostorinv_id = ""; String iostorinv_id = "";
//查询该木箱是否存在未完成的入库单 //查询该木箱是否存在未完成的入库单
JSONObject box_mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("box_no = '" + box_no + "' AND bill_status <'99'").uniqueResult(0); JSONObject box_mst_jo = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "26").addParam("box_no", box_no).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(box_mst_jo)){ if (ObjectUtil.isNotEmpty(box_mst_jo)) {
JSONObject box_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '"+box_mst_jo.getString("iostorinv_id")+"' AND is_delete = '0' AND bill_status < '99'").uniqueResult(0); iostorinv_id = box_mst_jo.getString("iostorinv_id");
if (ObjectUtil.isNotEmpty(box_mst)){ } else {
iostorinv_id = box_mst_jo.getString("iostorinv_id");
}else {
iostorinv_id = rawAssistIStorService.insertDtl(mst_jo);
}
}else {
iostorinv_id = rawAssistIStorService.insertDtl(mst_jo); iostorinv_id = rawAssistIStorService.insertDtl(mst_jo);
} }
@@ -154,20 +149,20 @@ public class ProductInstorServiceImpl implements ProductInstorService {
String box_length = sub_jo.getString("box_length"); String box_length = sub_jo.getString("box_length");
String box_width = sub_jo.getString("box_width"); String box_width = sub_jo.getString("box_width");
String box_high = sub_jo.getString("box_high"); String box_high = sub_jo.getString("box_high");
if (StrUtil.isEmpty(box_length) || StrUtil.isEmpty(box_width) || StrUtil.isEmpty(box_high)){ if (StrUtil.isEmpty(box_length) || StrUtil.isEmpty(box_width) || StrUtil.isEmpty(box_high)) {
throw new BadRequestException("该木箱没有长宽高信息,无法入库,请到子卷包装关系中维护!"); throw new BadRequestException("该木箱没有长宽高信息,无法入库,请到子卷包装关系中维护!");
} }
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '"+point_code+"'").uniqueResult(0); JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(point_jo)){ if (ObjectUtil.isEmpty(point_jo)) {
throw new BadRequestException("未查询到对应的点位!"); throw new BadRequestException("未查询到对应的点位!");
}else { } else {
if (point_jo.getString("is_used").equals("0")){ if (point_jo.getString("is_used").equals("0")) {
throw new BadRequestException("该点位已经被禁用!"); throw new BadRequestException("该点位已经被禁用!");
} }
if (point_jo.getString("is_delete").equals("1")){ if (point_jo.getString("is_delete").equals("1")) {
throw new BadRequestException("该点位已经被删除!"); throw new BadRequestException("该点位已经被删除!");
} }
if (!point_jo.getString("region_code").equals("NBJ01")){ if (!point_jo.getString("region_code").equals("NBJ01")) {
throw new BadRequestException("请扫描内包间入库点位!"); throw new BadRequestException("请扫描内包间入库点位!");
} }
} }
@@ -186,7 +181,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
String task_id = IdUtil.getSnowflake(1, 1).nextId() + ""; String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
//直接分配虚拟区货位,并确认 //直接分配虚拟区货位,并确认
JSONObject struct = WQL.getWO("PDA_ST_01").addParam("flag", "3").addParam("stor_id",stor.getString("stor_id")).process().uniqueResult(0); JSONObject struct = WQL.getWO("PDA_ST_01").addParam("flag", "3").addParam("stor_id", stor.getString("stor_id")).process().uniqueResult(0);
HashMap<String, String> dis_map = new HashMap(); HashMap<String, String> dis_map = new HashMap();
dis_map.put("sect_id", struct.getString("sect_id")); dis_map.put("sect_id", struct.getString("sect_id"));
@@ -199,7 +194,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
dis_map.put("task_id", task_id); dis_map.put("task_id", task_id);
//更新该木箱明细对应的分配 //更新该木箱明细对应的分配
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "iostorinv_id = '" + iostorinv_id + "' AND box_no = '"+box_no+"'"); WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "iostorinv_id = '" + iostorinv_id + "' AND box_no = '" + box_no + "'");
//修改库存 //修改库存
//直接取出入库分配表的库存 //直接取出入库分配表的库存

View File

@@ -697,6 +697,7 @@
AND work_status < '99' AND work_status < '99'
AND mst.is_delete = '0' AND mst.is_delete = '0'
AND mst.bill_status < '99' AND mst.bill_status < '99'
AND IFNULL(struct_code,'') <> ''
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
@@ -911,10 +912,24 @@
) )
ORDER BY po.out_order_seq ORDER BY po.out_order_seq
ENDSELECT ENDSELECT
ENDIF ENDIF
IF 输入.flag = "26"
QUERY
SELECT
*
FROM
st_ivt_iostorinvdtl dtl
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dtl.iostorinv_id
WHERE
box_no = 输入.box_no
AND dtl.bill_status < '99'
AND mst.is_delete = '0'
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -86,7 +86,7 @@ public class HandMoveStorAcsTask extends AbstractAcsTask {
if(task==null){ if(task==null){
throw new BadRequestException("查询不到操作的任务记录!"); throw new BadRequestException("查询不到操作的任务记录!");
} }
if(TaskStatusEnum.EXECUTING.equals(status)){ if(TaskStatusEnum.EXECUTING.getCode().equals(status)){
map.put("work_status","02"); map.put("work_status","02");
wo_dtl.update(map,"task_id='"+task_id+"'"); wo_dtl.update(map,"task_id='"+task_id+"'");
map.put("task_status","03"); map.put("task_status","03");
@@ -94,7 +94,7 @@ public class HandMoveStorAcsTask extends AbstractAcsTask {
map.put("update_optname",nickName); map.put("update_optname",nickName);
map.put("update_time",now); map.put("update_time",now);
wo_Task.update(map,"task_id='"+task_id+"'"); wo_Task.update(map,"task_id='"+task_id+"'");
}else if(TaskStatusEnum.FINISHED.equals(status)){ }else if(TaskStatusEnum.FINISHED.getCode().equals(status)){
HandMoveStorServiceImpl handMoveStorServiceImpl = SpringContextHolder.getBean(HandMoveStorServiceImpl.class); HandMoveStorServiceImpl handMoveStorServiceImpl = SpringContextHolder.getBean(HandMoveStorServiceImpl.class);
handMoveStorServiceImpl.finishTask(task); handMoveStorServiceImpl.finishTask(task);
}else if("0".equals(status)){ }else if("0".equals(status)){

View File

@@ -258,11 +258,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
// rows.clear(); // rows.clear();
// 遍历 // 遍历
for (String box_no : boxSet) { for (String box_no : boxSet) {
JSONArray jsonArr = WQL.getWO("QST_IVT_CHECKOUTBILL").addParam("flag", "7").addParam("box_no", box_no).process().getResultJSONArray(0); JSONObject jsonObject = WQL.getWO("QST_IVT_CHECKOUTBILL").addParam("flag", "7").addParam("box_no", box_no).process().uniqueResult(0);
for (int i = 0; i < jsonArr.size(); i++) { rows.add(jsonObject);
JSONObject jsonObject = jsonArr.getJSONObject(i);
rows.add(jsonObject);
}
} }
} }
@@ -345,10 +342,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
String pcsn = row.getString("pcsn"); String pcsn = row.getString("pcsn");
String box_no = row.getString("box_no"); String box_no = row.getString("box_no");
//查询该箱子所在货位 //查询该箱子所在货位
JSONObject struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '"+box_no+"'").uniqueResult(0); JSONObject struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + box_no + "'").uniqueResult(0);
String struct_code = struct_jo.getString("struct_code");
if (ObjectUtil.isNotEmpty(pcsn)) { if (ObjectUtil.isNotEmpty(pcsn)) {
JSONObject json = ivtTab.query("pcsn = '" + pcsn + "' AND struct_code = '"+struct_code+"'").uniqueResult(0); if (ObjectUtil.isEmpty(struct_jo)) {
throw new BadRequestException("未查询到该批次所在货位!");
}
String struct_code = struct_jo.getString("struct_code");
JSONObject json = ivtTab.query("pcsn = '" + pcsn + "' AND struct_code = '" + struct_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(json)) continue; if (ObjectUtil.isEmpty(json)) continue;
JSONObject jsonMap = new JSONObject(); JSONObject jsonMap = new JSONObject();
@@ -481,8 +481,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
// 判断此明细子卷是否存在,存在则将此木箱下的子卷全部生成明细 // 判断此明细子卷是否存在,存在则将此木箱下的子卷全部生成明细
String pcsn = row.getString("pcsn"); String pcsn = row.getString("pcsn");
String box_no = row.getString("box_no");
//查询该箱子所在货位
JSONObject struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + box_no + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(pcsn)) { if (ObjectUtil.isNotEmpty(pcsn)) {
JSONObject json = ivtTab.query("pcsn = '" + pcsn + "'").uniqueResult(0); if (ObjectUtil.isEmpty(struct_jo)) {
throw new BadRequestException("未查询到该批次所在货位!");
}
String struct_code = struct_jo.getString("struct_code");
JSONObject json = ivtTab.query("pcsn = '" + pcsn + "' AND struct_code = '" + struct_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(json)) continue; if (ObjectUtil.isEmpty(json)) continue;
JSONObject jsonMap = new JSONObject(); JSONObject jsonMap = new JSONObject();
@@ -699,8 +706,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
// 判断此明细子卷是否存在,存在则将此木箱下的子卷全部生成明细 // 判断此明细子卷是否存在,存在则将此木箱下的子卷全部生成明细
String pcsn = row.getString("pcsn"); String pcsn = row.getString("pcsn");
String box_no = row.getString("box_no");
//查询该箱子所在货位
JSONObject struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + box_no + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(pcsn)) { if (ObjectUtil.isNotEmpty(pcsn)) {
JSONObject json = ivtTab.query("pcsn = '" + pcsn + "'").uniqueResult(0); if (ObjectUtil.isEmpty(struct_jo)) {
throw new BadRequestException("未查询到该批次所在货位!");
}
String struct_code = struct_jo.getString("struct_code");
JSONObject json = ivtTab.query("pcsn = '" + pcsn + "' AND struct_code = '" + struct_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(json)) continue; if (ObjectUtil.isEmpty(json)) continue;
JSONObject jsonMap = new JSONObject(); JSONObject jsonMap = new JSONObject();
@@ -2847,7 +2861,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
if (ObjectUtil.isEmpty(jsonTaskLast1)) { if (ObjectUtil.isEmpty(jsonTaskLast1)) {
jsonTask.put("sort_seq", 1); jsonTask.put("sort_seq", 1);
} else { } else {
jsonTask.put("sort_seq", jsonTaskLast1.getIntValue("sort_seq")+1); jsonTask.put("sort_seq", jsonTaskLast1.getIntValue("sort_seq") + 1);
} }
wo_Task.update(jsonTask); wo_Task.update(jsonTask);
@@ -3251,7 +3265,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
if (ObjectUtil.isEmpty(jsonTaskLast1)) { if (ObjectUtil.isEmpty(jsonTaskLast1)) {
jsonTask.put("sort_seq", 1); jsonTask.put("sort_seq", 1);
} else { } else {
jsonTask.put("sort_seq", jsonTaskLast1.getIntValue("sort_seq")+1); jsonTask.put("sort_seq", jsonTaskLast1.getIntValue("sort_seq") + 1);
} }
wo_Task.update(jsonTask); wo_Task.update(jsonTask);
@@ -3395,7 +3409,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
param2.put("point_code1", json.getString("struct_code")); param2.put("point_code1", json.getString("struct_code"));
param2.put("point_code2", jsonMove.getString("struct_code")); param2.put("point_code2", jsonMove.getString("struct_code"));
param2.put("task_group_id", whereJson.getLongValue("task_group_id")); // 任务组 param2.put("task_group_id", whereJson.getLongValue("task_group_id")); // 任务组
param2.put("sort_seq", i+1); // 任务组顺序号 param2.put("sort_seq", i + 1); // 任务组顺序号
String move_task_id = outTask.createTask(param2); String move_task_id = outTask.createTask(param2);
// 回显移库明细任务id // 回显移库明细任务id
@@ -3911,7 +3925,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
//查询对应明细 //查询对应明细
JSONObject dtl_jo = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinvdtl_id = '" + dis.getString("iostorinvdtl_id") + "'").uniqueResult(0); JSONObject dtl_jo = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinvdtl_id = '" + dis.getString("iostorinvdtl_id") + "'").uniqueResult(0);
// 更新子卷包装关系表 状态 - 3 // 更新子卷包装关系表 状态 - 3
JSONObject jsonSub = subTab.query("container_name = '" + dis.getString("pcsn") + "' and package_box_sn = '"+dis.getString("box_no")+"' and status = '2'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + dis.getString("pcsn") + "' and package_box_sn = '" + dis.getString("box_no") + "' and status = '2'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonSub)) throw new BadRequestException("此子卷不存在或不为入库状态:" + dis.getString("pcsn")); if (ObjectUtil.isEmpty(jsonSub)) throw new BadRequestException("此子卷不存在或不为入库状态:" + dis.getString("pcsn"));
// 如果是拆分入库则将包装关系改为生成状态 // 如果是拆分入库则将包装关系改为生成状态
if (jo_mst.getString("bill_type").equals("1005") || (jo_mst.getString("bill_type").equals("1009") && StrUtil.isEmpty(dtl_jo.getString("source_bill_code")))) { if (jo_mst.getString("bill_type").equals("1005") || (jo_mst.getString("bill_type").equals("1009") && StrUtil.isEmpty(dtl_jo.getString("source_bill_code")))) {

View File

@@ -127,23 +127,23 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 拆分入库回传mes // 拆分入库回传mes
if (StrUtil.equals(bill_type, "0005")) { if (StrUtil.equals(bill_type, "0005")) {
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0); JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag","2").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
for (int j = 0; j < disArr.size(); j++) { for (int j = 0; j < disArr.size(); j++) {
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
JSONObject json = disArr.getJSONObject(j); JSONObject json = disArr.getJSONObject(j);
param.put("PackageBoxSN", json.getString("box_no")); param.put("PackageBoxSN", json.getString("box_no"));
JSONObject jsonParamDtl = new JSONObject(); JSONArray container_jo = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "' AND box_no = '"+json.getString("box_no")+"'").getResultJSONArray(0);
jsonParamDtl.put("ContainerName", json.getString("pcsn")); for (int k = 0; k < container_jo.size(); k++) {
JSONObject dis_jo = container_jo.getJSONObject(k);
details.add(jsonParamDtl); JSONObject jsonParamDtl = new JSONObject();
jsonParamDtl.put("ContainerName", dis_jo.getString("pcsn"));
details.add(jsonParamDtl);
}
param.put("Details", details);
new LmsToMesServiceImpl().lmsPackage(param);
} }
param.put("Details", details);
new LmsToMesServiceImpl().lmsPackage(param);
jo_mst.put("upload_mes", "1"); jo_mst.put("upload_mes", "1");
jo_mst.put("is_upload", "1"); jo_mst.put("is_upload", "1");
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId()); jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
@@ -153,23 +153,23 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 拆分出库回传mes // 拆分出库回传mes
if (StrUtil.equals(bill_type, "1005")) { if (StrUtil.equals(bill_type, "1005")) {
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0); JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag","2").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
for (int j = 0; j < disArr.size(); j++) { for (int j = 0; j < disArr.size(); j++) {
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
JSONObject json = disArr.getJSONObject(j); JSONObject json = disArr.getJSONObject(j);
param.put("PackageBoxSN", json.getString("box_no")); param.put("PackageBoxSN", json.getString("box_no"));
JSONObject jsonParamDtl = new JSONObject(); JSONArray container_jo = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "' AND box_no = '"+json.getString("box_no")+"'").getResultJSONArray(0);
jsonParamDtl.put("ContainerName", json.getString("pcsn")); for (int k = 0; k < container_jo.size(); k++) {
JSONObject dis_jo = container_jo.getJSONObject(k);
details.add(jsonParamDtl); JSONObject jsonParamDtl = new JSONObject();
jsonParamDtl.put("ContainerName", dis_jo.getString("pcsn"));
details.add(jsonParamDtl);
}
param.put("Details", details);
new LmsToMesServiceImpl().lmsUnPackage(param);
} }
param.put("Details", details);
new LmsToMesServiceImpl().lmsUnPackage(param);
jo_mst.put("upload_mes", "1"); jo_mst.put("upload_mes", "1");
jo_mst.put("is_upload", "1"); jo_mst.put("is_upload", "1");
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId()); jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
@@ -340,7 +340,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", lgort); // 明細储存地点 jsonDtl.put("LGORT", lgort); // 明細储存地点
} }
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '"+json2.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) { if (ObjectUtil.isNotEmpty(jsonSect)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
} }
@@ -413,7 +413,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点 jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
} }
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '"+json2.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) { if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
} }
@@ -439,7 +439,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 调用接口回传 // 调用接口回传
new LmsToSapServiceImpl().returnDelivery(param); new LmsToSapServiceImpl().returnDelivery(param);
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException("回传sap失败"+e.getMessage()); throw new BadRequestException("回传sap失败" + e.getMessage());
} }
} }
@@ -482,7 +482,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", lgort); // 明細储存地点 jsonDtl.put("LGORT", lgort); // 明細储存地点
} }
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '"+json2.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) { if (ObjectUtil.isNotEmpty(jsonSect)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
} }
@@ -549,7 +549,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", lgort); // 库存地点:库区外部标识 jsonDtl.put("LGORT", lgort); // 库存地点:库区外部标识
} }
JSONObject jsonSub = subTab.query("container_name = '" + json.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json.getString("pcsn") + "' AND package_box_sn = '"+json.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) { if (ObjectUtil.isNotEmpty(jsonSub)) {
String sale_order_name = jsonSub.getString("sale_order_name"); String sale_order_name = jsonSub.getString("sale_order_name");
@@ -619,7 +619,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点 jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
} }
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '"+json2.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) { if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
} }
@@ -645,7 +645,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 调用接口回传 // 调用接口回传
new LmsToSapServiceImpl().returnDelivery(param); new LmsToSapServiceImpl().returnDelivery(param);
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException("回传sap失败"+e.getMessage()); throw new BadRequestException("回传sap失败" + e.getMessage());
} }
} }
@@ -753,7 +753,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jo_mst.getString("remark")); // 明細储存地点 jsonDtl.put("LGORT", jo_mst.getString("remark")); // 明細储存地点
} }
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '"+json2.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) { if (ObjectUtil.isNotEmpty(jsonSect)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
} }
@@ -787,23 +787,23 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 拆分入库回传mes // 拆分入库回传mes
if (StrUtil.equals(bill_type, "0005")) { if (StrUtil.equals(bill_type, "0005")) {
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0); JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag","2").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
for (int j = 0; j < disArr.size(); j++) { for (int j = 0; j < disArr.size(); j++) {
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
JSONObject json = disArr.getJSONObject(j); JSONObject json = disArr.getJSONObject(j);
param.put("PackageBoxSN", json.getString("box_no")); param.put("PackageBoxSN", json.getString("box_no"));
JSONObject jsonParamDtl = new JSONObject(); JSONArray container_jo = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "' AND box_no = '"+json.getString("box_no")+"'").getResultJSONArray(0);
jsonParamDtl.put("ContainerName", json.getString("pcsn")); for (int k = 0; k < container_jo.size(); k++) {
JSONObject dis_jo = container_jo.getJSONObject(k);
details.add(jsonParamDtl); JSONObject jsonParamDtl = new JSONObject();
jsonParamDtl.put("ContainerName", dis_jo.getString("pcsn"));
details.add(jsonParamDtl);
}
param.put("Details", details);
new LmsToMesServiceImpl().lmsPackage(param);
} }
param.put("Details", details);
new LmsToMesServiceImpl().lmsPackage(param);
jo_mst.put("upload_mes", "1"); jo_mst.put("upload_mes", "1");
jo_mst.put("is_upload", "1"); jo_mst.put("is_upload", "1");
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId()); jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
@@ -851,7 +851,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点 jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
} }
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '"+json2.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) { if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
} }
@@ -877,7 +877,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 调用接口回传 // 调用接口回传
new LmsToSapServiceImpl().returnDelivery(param); new LmsToSapServiceImpl().returnDelivery(param);
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException("回传sap失败"+e.getMessage()); throw new BadRequestException("回传sap失败" + e.getMessage());
} }
} }
@@ -885,23 +885,23 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 拆分出库回传mes // 拆分出库回传mes
if (StrUtil.equals(bill_type, "1005")) { if (StrUtil.equals(bill_type, "1005")) {
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0); JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag","2").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
for (int j = 0; j < disArr.size(); j++) { for (int j = 0; j < disArr.size(); j++) {
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
JSONObject json = disArr.getJSONObject(j); JSONObject json = disArr.getJSONObject(j);
param.put("PackageBoxSN", json.getString("box_no")); param.put("PackageBoxSN", json.getString("box_no"));
JSONObject jsonParamDtl = new JSONObject(); JSONArray container_jo = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "' AND box_no = '"+json.getString("box_no")+"'").getResultJSONArray(0);
jsonParamDtl.put("ContainerName", json.getString("pcsn")); for (int k = 0; k < container_jo.size(); k++) {
JSONObject dis_jo = container_jo.getJSONObject(k);
details.add(jsonParamDtl); JSONObject jsonParamDtl = new JSONObject();
jsonParamDtl.put("ContainerName", dis_jo.getString("pcsn"));
details.add(jsonParamDtl);
}
param.put("Details", details);
new LmsToMesServiceImpl().lmsUnPackage(param);
} }
param.put("Details", details);
new LmsToMesServiceImpl().lmsUnPackage(param);
jo_mst.put("upload_mes", "1"); jo_mst.put("upload_mes", "1");
jo_mst.put("is_upload", "1"); jo_mst.put("is_upload", "1");
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId()); jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
@@ -946,7 +946,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", lgort); // 明細储存地点 jsonDtl.put("LGORT", lgort); // 明細储存地点
} }
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '"+json2.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) { if (ObjectUtil.isNotEmpty(jsonSect)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
} }
@@ -1143,7 +1143,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点 jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
} }
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0); JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '"+json2.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) { if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
} }
@@ -1169,7 +1169,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 调用接口回传 // 调用接口回传
new LmsToSapServiceImpl().returnDelivery(param); new LmsToSapServiceImpl().returnDelivery(param);
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException("回传sap失败"+e.getMessage()); throw new BadRequestException("回传sap失败" + e.getMessage());
} }
} }