diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/BakingController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/BakingController.java index e37a9679c..95b68136c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/BakingController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/BakingController.java @@ -28,15 +28,13 @@ public class BakingController { @Log("烘箱出入") @ApiOperation("烘箱出入") public ResponseEntity queryRawFoil(@RequestBody JSONObject whereJson) { - bakingService.ovenInAndOut(whereJson); - return new ResponseEntity<>(HttpStatus.OK); + return new ResponseEntity<>(bakingService.ovenInAndOut(whereJson),HttpStatus.OK); } @PostMapping("/inCoolIvt") @Log("入冷却") @ApiOperation("入冷却") public ResponseEntity inCoolIvt(@RequestBody JSONObject whereJson) { - bakingService.inCoolIvt(whereJson); - return new ResponseEntity<>(HttpStatus.OK); + return new ResponseEntity<>(bakingService.inCoolIvt(whereJson),HttpStatus.OK); } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql index bfcb85e5b..e58c87257 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql @@ -183,6 +183,7 @@ LEFT JOIN st_ivt_sbpointivt ivt ON ivt.ext_code = der.resource_name WHERE der.is_delete = '0' + AND der.status <> '09' OPTION 输入.point_code <> "" der.resource_name = 输入.point_code diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallEmpReelTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallEmpReelTask.java index 46e53e3e9..5f7853b7d 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallEmpReelTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallEmpReelTask.java @@ -113,46 +113,71 @@ public class CallEmpReelTask extends AbstractAcsTask { String point_code1 = jsonTask.getString("point_code1"); String point_code2 = jsonTask.getString("point_code2"); + String point_code3 = jsonTask.getString("point_code3"); String point_code4 = jsonTask.getString("point_code4"); - PointService point = SpringContextHolder.getBean(PointService.class); - // 校验起点是否存在 - JSONObject jsonIvt = ivtTab.query("empty_point_code ='" + point_code1 + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("未找到可用点位:" + point_code1); - // 校验终点是否存在 - JSONObject nextDto = sbTab.query("point_code ='" + point_code2 + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(nextDto)) - throw new BadRequestException("未找到可用点位:" + jsonTask.getString("point_code2")); - - // 更新冷却库存状态 - jsonIvt.put("empty_point_status", "01"); - ivtTab.update(jsonIvt); - - - // 校验终点是否存在 - JSONObject jsonIvt2 = ivtTab.query("full_point_code ='" + point_code4 + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2); - - // 更新工单状态为完成 JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0); - jsonRaw.put("status", "09"); - rawTab.update(jsonRaw); - // 更新冷却库存状态 - jsonIvt2.put("full_point_status", "02"); - jsonIvt2.put("instorage_time", DateUtil.now()); - jsonIvt2.put("container_name", jsonRaw.getString("container_name")); - jsonIvt2.put("workorder_id", jsonRaw.getString("workorder_id")); - jsonIvt2.put("ivt_qty", jsonRaw.getString("productin_qty")); - ivtTab.update(jsonIvt2); + // 判断是两个点位的任务还是四个点位的任务 + if (ObjectUtil.isEmpty(point_code3)) { + // 判断是取满 or 取空 :取满起点是生箔区域、取空起点是冷却区域 + JSONObject jsonSbIvt = sbTab.query("point_code = '" + point_code1 + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(jsonSbIvt)) { + // 取满 + JSONObject jsonCoolIvt = ivtTab.query("full_point_code = '" + point_code2 + "'").uniqueResult(0); + // 更新库存状态 + jsonCoolIvt.put("full_point_status", "02"); + jsonCoolIvt.put("instorage_time", DateUtil.now()); + jsonCoolIvt.put("container_name", jsonRaw.getString("container_name")); + jsonCoolIvt.put("workorder_id", jsonRaw.getString("workorder_id")); + jsonCoolIvt.put("ivt_qty", jsonRaw.getString("productin_qty")); + ivtTab.update(jsonCoolIvt); + } else { + // 取空 + JSONObject jsonCoolIvt = ivtTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0); + jsonCoolIvt.put("empty_point_status", "01"); + ivtTab.update(jsonCoolIvt); + } + } else { + // 取满放空 + // 校验起点是否存在 + JSONObject jsonIvt = ivtTab.query("empty_point_code ='" + point_code1 + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("未找到可用点位:" + point_code1); + // 校验终点是否存在 + JSONObject nextDto = sbTab.query("point_code ='" + point_code2 + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(nextDto)) + throw new BadRequestException("未找到可用点位:" + jsonTask.getString("point_code2")); + + // 更新冷却库存状态 + jsonIvt.put("empty_point_status", "01"); + ivtTab.update(jsonIvt); + + // 校验终点是否存在 + JSONObject jsonIvt2 = ivtTab.query("full_point_code ='" + point_code4 + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2); + + // 更新工单状态为完成 + jsonRaw.put("status", "09"); + rawTab.update(jsonRaw); + + // 更新冷却库存状态 + jsonIvt2.put("full_point_status", "02"); + jsonIvt2.put("instorage_time", DateUtil.now()); + jsonIvt2.put("container_name", jsonRaw.getString("container_name")); + jsonIvt2.put("workorder_id", jsonRaw.getString("workorder_id")); + jsonIvt2.put("ivt_qty", jsonRaw.getString("productin_qty")); + ivtTab.update(jsonIvt2); + } // 更新冷却区出入表 JSONObject jsonCool = coolTab.query("task_id = '" + task_id + "'").uniqueResult(0); - jsonCool.put("bill_status", "50"); - jsonCool.put("confirm_optid", SecurityUtils.getCurrentUserId()); - jsonCool.put("confirm_optname", SecurityUtils.getCurrentUsername()); - jsonCool.put("confirm_time", DateUtil.now()); - coolTab.update(jsonCool); + if (ObjectUtil.isNotEmpty(jsonCool)) { + jsonCool.put("bill_status", "50"); + jsonCool.put("confirm_optid", SecurityUtils.getCurrentUserId()); + jsonCool.put("confirm_optname", SecurityUtils.getCurrentUsername()); + jsonCool.put("confirm_time", DateUtil.now()); + coolTab.update(jsonCool); + } } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InCoolIvtTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InCoolIvtTask.java index e856e4486..16d95cdb0 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InCoolIvtTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InCoolIvtTask.java @@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.system.util.CodeUtil; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.SpringContextHolder; @@ -143,11 +144,13 @@ public class InCoolIvtTask extends AbstractAcsTask { // 将入冷却信息发送给mes JSONObject param = new JSONObject(); + String userName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue(); + String passWord = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue(); param.put("iContainerName", jsonTask.getString("material_code")); param.put("iArrivalTime", DateUtil.now()); param.put("iWarehouse", 2); - param.put("UserName", ""); - param.put("PassWord", ""); + param.put("UserName", userName); + param.put("PassWord", passWord); JSONObject result = new LmsToMesServiceImpl().momRollSemiFGInboundComplete(param); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InHotTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InHotTask.java index f4f6cb1e9..c0ef42337 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InHotTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InHotTask.java @@ -10,8 +10,10 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.system.util.CodeUtil; import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.modules.wql.util.SpringContextHolder; import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl; import org.nl.wms.sch.AcsTaskDto; import org.nl.wms.sch.manage.AbstractAcsTask; @@ -203,13 +205,15 @@ public class InHotTask extends AbstractAcsTask { // 将入烘箱信息发送给mes JSONObject param = new JSONObject(); + String userName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue(); + String passWord = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue(); param.put("iContainerName", jsonHotMst.getString("container_name")); param.put("iResourceName", hot_point_code); param.put("iMoveInDate", DateUtil. now()); param.put("iPlanBakingTemperature", jsonHotDtl.getDoubleValue("temperature")); param.put("iPlanBakingTimer", jsonHotDtl.getDoubleValue("oven_time")); - param.put("UserName", ""); - param.put("PassWord", ""); + param.put("UserName", userName); + param.put("PassWord", passWord); JSONObject result = new LmsToMesServiceImpl().momRollBakeInBound(param); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index a540add9a..b57f60c71 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -1194,7 +1194,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } mapParam.put("tableData", table); // 调用移库单新增方法 - handMoveStorService.insertDtl2(mapParam); + if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) { + handMoveStorService.insertDtl2(mapParam); + } } } else { JSONObject map = new JSONObject(); @@ -1307,7 +1309,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } mapParam.put("tableData", table); // 调用移库单新增方法 - handMoveStorService.insertDtl2(mapParam); + if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) { + handMoveStorService.insertDtl2(mapParam); + } } // 下发 outTask.immediateNotifyAcs();