From eba8a2048ea20b2f140e6617a0b3772d8b2c06e6 Mon Sep 17 00:00:00 2001 From: zhangzq Date: Wed, 27 Nov 2024 11:11:55 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E5=87=BA=E5=BA=93=E6=97=B6=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E7=BC=BA=E5=B0=91=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pda_manage/iostorage/sevice/PdaIOService.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/pda_manage/iostorage/sevice/PdaIOService.java b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/pda_manage/iostorage/sevice/PdaIOService.java index 9594a220..b72efd96 100644 --- a/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/pda_manage/iostorage/sevice/PdaIOService.java +++ b/wms_pro/hd/nladmin-system/src/main/java/org/nl/wms/pda_manage/iostorage/sevice/PdaIOService.java @@ -83,8 +83,7 @@ public class PdaIOService { for (PdaFormOutDtl dtl : dtls) { BigDecimal now_assign_qty = dtl.getNow_assign_qty(); if (now_assign_qty==null || now_assign_qty.intValue()==0){ - continue; -// throw new BadRequestException("出库申请失败:当前"+dtl.getMaterial_name()+"明细申请数量为0"); + throw new BadRequestException("出库申请失败:当前"+dtl.getMaterial_name()+"明细申请数量为0"); } StIvtIostorinvdtl ivtDtl = new StIvtIostorinvdtl(); ivtDtl.setSource_form_id(dtl.getId()); @@ -94,16 +93,23 @@ public class PdaIOService { if (StringUtils.isEmpty(productArea) || !"A1A2A3".contains(productArea)){ throw new BadRequestException("出库申请失败:明细数据车间字段未指定或不正确"); } + String storCode = dtl.getStor_code(); + if (StringUtils.isEmpty(storCode)){ + throw new BadRequestException("出库申请失败:明细数据仓库字段未指定"); + } HashMap map = MapOf.of("end_struct_code", "", "start_struct_code", "", "order", "", "product_area", productArea); ivtDtl.setForm_data(new JSONObject(map)); ivtDtl.setQty(now_assign_qty); ivtDtl.setPcsn(dtl.getPcsn()); - ivtDtl.setStor_code(dtl.getStor_code());//pdaFormOutMst.getStor_code() + ivtDtl.setStor_code(storCode);//pdaFormOutMst.getStor_code() ivtDtl.setId(IdUtil.getStringId()); ivtDtl.setInv_id(mst.getId()); ivtDtl.setStatus(StatusEnum.FORM_STATUS.code("生成")); list.add(ivtDtl); } + if (CollectionUtils.isEmpty(list)){ + throw new BadRequestException("出库申请失败:出库入明细不能为空"); + } iStIvtIostorinvdtlService.saveBatch(list); iStIvtIostorinvService.save(mst); for (StIvtIostorinvdtl stIvtIostorinvdtl : list) {