From 731bb22226b5fc781ef6b96ec72ca7b891291d49 Mon Sep 17 00:00:00 2001 From: "ZHOUZ\\Noble'lift" <1014987728@qq.com> Date: Mon, 14 Nov 2022 10:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pda/mps/rest/EmptyVehicleController.java | 8 ++-- .../service/impl/EmptyVehicleServiceImpl.java | 41 ++++++++++++++++++- .../impl/RawAssistIStorServiceImpl.java | 12 +++--- .../st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql | 4 ++ 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/EmptyVehicleController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/EmptyVehicleController.java index 36ff366d3..f846ec99e 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/EmptyVehicleController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/EmptyVehicleController.java @@ -25,15 +25,15 @@ public class EmptyVehicleController { private final EmptyVehicleService emptyVehicleService; @PostMapping("/pointStatusQuery") - @Log("分切计划初始化查询") - @ApiOperation("分切计划初始化查询") + @Log("点位载具查询") + @ApiOperation("点位载具查询") public ResponseEntity pointStatusQuery(@RequestBody JSONObject whereJson) { return new ResponseEntity<>(emptyVehicleService.pointStatusQuery(whereJson), HttpStatus.OK); } @PostMapping("/pointOperate") - @Log("子卷出站") - @ApiOperation("子卷出站") + @Log("解绑绑定") + @ApiOperation("解绑绑定") public ResponseEntity pointOperate(@RequestBody JSONObject whereJson) { return new ResponseEntity<>(emptyVehicleService.pointOperate(whereJson), HttpStatus.OK); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/EmptyVehicleServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/EmptyVehicleServiceImpl.java index 08c0ee5d5..cdce6b312 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/EmptyVehicleServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/EmptyVehicleServiceImpl.java @@ -25,11 +25,48 @@ public class EmptyVehicleServiceImpl implements EmptyVehicleService { @Override public JSONObject pointStatusQuery(JSONObject whereJson) { - return null; + String point_code = whereJson.getString("point_code"); + if (StrUtil.isEmpty(point_code)){ + throw new BadRequestException("点位不能为空!"); + } + JSONObject point_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("empty_point_code = '"+point_code+"'").uniqueResult(0); + if (ObjectUtil.isEmpty(point_jo)){ + throw new BadRequestException("未查询到对应的点位设备!"); + } + String empty_vehicle_code = point_jo.getString("empty_vehicle_code"); + JSONObject vehicle_jo = new JSONObject(); + vehicle_jo.put("vehicle_code",empty_vehicle_code); + JSONObject jo = new JSONObject(); + jo.put("data",vehicle_jo); + jo.put("message","操作成功!"); + return jo; } @Override public JSONObject pointOperate(JSONObject whereJson) { - return null; + String point_code = whereJson.getString("point_code"); + String vehicle_code = whereJson.getString("vehicle_code"); + if (StrUtil.isEmpty(point_code)){ + throw new BadRequestException("点位不能为空!"); + } + if (StrUtil.isEmpty(vehicle_code)){ + throw new BadRequestException("载具码不能为空!"); + } + + String option = whereJson.getString("option"); + JSONObject point_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("empty_point_code = '"+point_code+"'").uniqueResult(0); + if (ObjectUtil.isEmpty(point_jo)){ + throw new BadRequestException("未查询到对应的点位设备!"); + } + if (option.equals("0")){ + point_jo.put("empty_vehicle_code",""); + } + if (option.equals("1")){ + point_jo.put("empty_vehicle_code",vehicle_code); + } + WQLObject.getWQLObject("st_ivt_coolpointivt").update(point_jo); + JSONObject jo = new JSONObject(); + jo.put("message","操作成功!"); + return jo; } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java index 1612c3e6b..fc19f2962 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java @@ -814,9 +814,9 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { String placement_type = row_jo.getString("placement_type"); if (placement_type.equals("01") || placement_type.equals("03")) { - struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "'AND placement_type = '"+placement_type+"' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0); + struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '"+placement_type+"' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0); } else { - struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "'AND placement_type = '"+placement_type+"' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0); + struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '"+placement_type+"' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0); } } else { //如果不存在相同订单物料的巷道 @@ -842,9 +842,9 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { String placement_type = empty_row.getString("placement_type"); if (placement_type.equals("01") || placement_type.equals("03")) { - struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '"+placement_type+"' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq desc").uniqueResult(0); + struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '"+placement_type+"' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq desc").uniqueResult(0); } else { - struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '"+placement_type+"'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq").uniqueResult(0); + struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '"+placement_type+"'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq").uniqueResult(0); } } else { //如果查询不到空的一排,则查询有空位双通的一排 @@ -858,10 +858,10 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { JSONObject right_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq").uniqueResult(0); JSONObject left_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq desc").uniqueResult(0); if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !right_str.getString("lock_type").equals("1")){ - struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0); + struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0); } if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !left_str.getString("lock_type").equals("1")){ - struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0); + struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0); } } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql index dc205d95e..907555fb6 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/wql/QST_IVT_RAWASSISTISTOR.wql @@ -62,6 +62,8 @@ ST_IVT_IOStorInv ios WHERE ios.is_delete = '0' + AND + ios.io_type = '0' OPTION 输入.bill_code <> "" ios.bill_code like 输入.bill_code ENDOPTION @@ -411,6 +413,8 @@ IFNULL(sa2.storagevehicle_code,'') = '' AND sa2.lock_type = '1' + AND + sa2.is_delete = '0' AND sa.sect_id = 输入.sect_id OPTION 输入.material_code <> ""