diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java index b5d26420b..3896ae6d5 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java @@ -763,7 +763,14 @@ public class MesToLmsServiceImpl implements MesToLmsService { JSONObject jo = new JSONObject(); jo.put("point_code", down_point_code); jo.put("cut_rows", down_rows); - if (del_rows.size() > 1) { + if (del_rows.size() > 0) { + if (up_rows.size() > 0){ + if (del_rows.size() == 1){ + jo.put("is_last", "0"); + }else { + jo.put("is_last", "1"); + } + } jo.put("is_last", "0"); } else { jo.put("is_last", "1"); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/OutController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/OutController.java index 690cb55a5..e95e6261c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/OutController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/OutController.java @@ -37,6 +37,13 @@ public class OutController { return new ResponseEntity<>(outService.confirm(whereJson), HttpStatus.OK); } + @PostMapping("/disuseConfirm") + @Log("废箔下卷") + @ApiOperation("废箔下卷") + public ResponseEntity disuseConfirm(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(outService.disuseConfirm(whereJson), HttpStatus.OK); + } + @PostMapping("/conveyPointQuery") @Log("缓存点位查询") @ApiOperation("缓存点位查询") diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/OutService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/OutService.java index 044095e42..6be55f9e2 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/OutService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/OutService.java @@ -19,6 +19,13 @@ public interface OutService { */ JSONObject confirm(JSONObject whereJson); + /** + * 废箔下卷确认 + * @param whereJson / + * @return JSONObject + */ + JSONObject disuseConfirm(JSONObject whereJson); + /** * 缓存点位查询 * @param whereJson / diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/OutServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/OutServiceImpl.java index 36f97f6e0..aacc91545 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/OutServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/OutServiceImpl.java @@ -169,6 +169,43 @@ public class OutServiceImpl implements OutService { return result; } + @Override + @Transactional(rollbackFor = Exception.class) + public JSONObject disuseConfirm(JSONObject whereJson) { + String point_code = whereJson.getString("point_code"); + + //查询该点位对应的机台编号 + JSONObject cut_ivt = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("up_point_code ='" + point_code + "' OR down_point_code ='" + point_code + "'").uniqueResult(0); + + if (ObjectUtil.isEmpty(cut_ivt)) { + throw new BadRequestException("未查询到对应的分切机!"); + } + + //查询该分切机邻近位置的空载具的输送线点位 + JSONObject empty_vehicle = WQL.getWO("PDA_02") + .addParam("sort_seq", cut_ivt.getString("sort_seq")) + .addParam("sql_str", " ORDER BY abs(" + cut_ivt.getString("sort_seq") + "-sort_seq),point_code") + .addParam("product_area", cut_ivt.getString("product_area")) + .addParam("point_location", cut_ivt.getString("point_location")) + .addParam("flag", "3").process().uniqueResult(0); + if (ObjectUtil.isEmpty(empty_vehicle)) { + throw new BadRequestException("未查询到可用的空载具!"); + } + + JSONObject jo = new JSONObject(); + jo.put("point_code1", point_code); + jo.put("point_code2", empty_vehicle.getString("point_code")); + jo.put("vehicle_code", "waste foil"); + jo.put("product_area", cut_ivt.getString("product_area")); + //分切>输送线 子卷出站 + jo.put("task_type", "010404"); + cutTrussTask.createTask(jo); + + JSONObject result = new JSONObject(); + result.put("message", "操作成功!"); + return result; + } + @Override public JSONObject conveyPointQuery(JSONObject whereJson) { String product_area = whereJson.getString("product_area");