From 370e6da3b4e1818f4cc82dfea3056362883e30f8 Mon Sep 17 00:00:00 2001 From: zhangzhiqiang Date: Fri, 13 Jan 2023 12:47:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=A4=96=E5=8D=8F=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E6=94=B9=E6=89=B9=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/StatisticalReportServiceImpl.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java index cac7a47c..1372025d 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java @@ -586,27 +586,29 @@ public class StatisticalReportServiceImpl implements StatisticalReportService { if (StrUtil.isEmpty(storagevehicle_code)) { throw new BadRequestException("载具不能为空!"); } - if (StrUtil.isEmpty(jsonObject.getString("diskrecord_id"))) { - throw new BadRequestException("组盘记录不能为空"); - } // 仓位属性表【ST_IVT_StructAttr】 WQLObject PDM_BI_ProcedureOffline = WQLObject.getWQLObject("PDM_BI_ProcedureOffline"); - JSONObject jo = PDM_BI_ProcedureOffline.query("storagevehicle_code='"+storagevehicle_code+"' and diskrecord_id='"+jsonObject.getString("diskrecord_id")+"'").uniqueResult(0); - if(jo==null){ + JSONArray array = PDM_BI_ProcedureOffline.query("storagevehicle_code='" + storagevehicle_code + "'").getResultJSONArray(0); + if(array==null || array.size() == 0){ throw new BadRequestException("该载具"+storagevehicle_code+"无组盘记录!"); } - String is_send = jo.getString("is_send"); - if(!"1".equals(is_send)){ - throw new BadRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!"); + List diskrecordIds = new ArrayList<>(); + for (Object o : array) { + JSONObject jo = (JSONObject) o; + String is_send = jo.getString("is_send"); + if(!"1".equals(is_send)){ + throw new BadRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!"); + } + diskrecordIds.add(jo.getString("diskrecord_id")); } - String diskrecord_id = jsonObject.getString("diskrecord_id"); HashMap map = new HashMap(); map.put("is_send","2"); map.put("send_id",currentUserId+""); map.put("send_name",userDto.getNickName()); map.put("send_time",DateUtil.now()); - PDM_BI_ProcedureOffline.update(map,"diskrecord_id='"+diskrecord_id+"'"); + String collect = diskrecordIds.stream().collect(Collectors.joining("','")); + PDM_BI_ProcedureOffline.update(map,"diskrecord_id in ('"+collect+"')"); } JSONObject returnjo = new JSONObject();