From c9217acfa43024426c13cf47ae38309e13813283 Mon Sep 17 00:00:00 2001 From: zhaoyf <1783123481@qq.com> Date: Fri, 26 Jun 2026 10:44:43 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E4=BC=98=E5=8C=96=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E7=BB=84=E7=9B=98=E3=80=81=E7=BB=84=E7=9B=98=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E7=BB=84=E7=9B=98=E5=A4=84=E7=90=86=E6=89=B9=E6=AC=A1=E5=8F=B7?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InboundPdaServiceImpl.java | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/nladmin-system/wms-server/src/main/java/org/nl/wms/pda_manage/ios_manage/purchase/service/impl/InboundPdaServiceImpl.java b/nladmin-system/wms-server/src/main/java/org/nl/wms/pda_manage/ios_manage/purchase/service/impl/InboundPdaServiceImpl.java index 96bcb25..cf12643 100644 --- a/nladmin-system/wms-server/src/main/java/org/nl/wms/pda_manage/ios_manage/purchase/service/impl/InboundPdaServiceImpl.java +++ b/nladmin-system/wms-server/src/main/java/org/nl/wms/pda_manage/ios_manage/purchase/service/impl/InboundPdaServiceImpl.java @@ -14,19 +14,19 @@ import org.nl.common.utils.MapOf; import org.nl.common.utils.SecurityUtils; import org.nl.wms.basedata_manage.service.*; import org.nl.wms.basedata_manage.service.dao.*; +import org.nl.wms.pda_manage.ios_manage.purchase.service.InboundPdaService; import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.GroupPlateInboundDto; import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.ManualInboundDto; +import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.PdaGroupPlateDto; import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.UsualInboundDto; +import org.nl.wms.pda_manage.ios_manage.purchase.service.vo.PurchaseMatInfoVo; import org.nl.wms.pm_manage.SourceBillTypeEnum; import org.nl.wms.pm_manage.listener.PmManageEvent; import org.nl.wms.pm_manage.purchase.ListenerHandler.PurchaseListenerParams; import org.nl.wms.pm_manage.purchase.service.PurchaseService; -import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus; -import org.nl.wms.pda_manage.ios_manage.purchase.service.InboundPdaService; -import org.nl.wms.pda_manage.ios_manage.purchase.service.vo.PurchaseMatInfoVo; import org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl; import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst; -import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.PdaGroupPlateDto; +import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus; import org.nl.wms.warehouse_manage.enums.IOSEnum; import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService; import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis; @@ -145,6 +145,24 @@ public class InboundPdaServiceImpl implements InboundPdaService { public JSONObject submitGroupPlate(PdaGroupPlateDto dto) { log.info("PDA提交组盘, vehicleCode: {}", dto.getVehicle_code()); + //判断该载具是否存在组盘信息 + long statusCount = iMdPbGroupplateService.count( + new LambdaQueryWrapper() + .eq(GroupPlate::getStoragevehicle_code, dto.getVehicle_code()) + .lt(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库")) + ); + if (statusCount > 0) { + throw new BadRequestException("组盘失败:载具编码:" + dto.getVehicle_code() + "已存在组盘信息,请对数据进行核实!"); + } + //判断该载具编号是否已经存在库内 + long count = iStructattrService.count( + new LambdaQueryWrapper() + .eq(Structattr::getStoragevehicle_code, dto.getVehicle_code()) + ); + if (count > 0) { + throw new BadRequestException("组盘失败:载具编码:" + dto.getVehicle_code() + "已存在库内,请对数据进行核实!"); + } + List detailList = dto.getDetailList(); detailList.forEach((item)->{ List purchaseMatInfoVos = purchaseService.selectPdaInMat(MapOf.of("orderNo", item.getOrder_no(), @@ -158,28 +176,12 @@ public class InboundPdaServiceImpl implements InboundPdaService { } MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(item.getSku_code()); MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getQty_unit_id()); - //判断该载具是否存在组盘信息 - long statusCount = iMdPbGroupplateService.count( - new LambdaQueryWrapper() - .eq(GroupPlate::getStoragevehicle_code, dto.getVehicle_code()) - .lt(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库")) - ); - if (statusCount > 0) { - throw new BadRequestException("组盘失败:载具编码:" + dto.getVehicle_code() + "已存在组盘信息,请对数据进行核实!"); - } - //判断该载具编号是否已经存在库内 - long count = iStructattrService.count( - new LambdaQueryWrapper() - .eq(Structattr::getStoragevehicle_code, dto.getVehicle_code()) - ); - if (count > 0) { - throw new BadRequestException("组盘失败:载具编码:" + dto.getVehicle_code() + "已存在库内,请对数据进行核实!"); - } + GroupPlate groupDao = GroupPlate.builder() .group_id(IdUtil.getStringId()) .material_code(item.getSku_code()) .storagevehicle_code(dto.getVehicle_code()) - .pcsn(item.getBatch_no()) + .pcsn(Optional.ofNullable(item.getBatch_no()).filter(s -> !s.isEmpty()).orElse("1")) .qty_unit_id(unitDao.getMeasure_unit_id()) .qty_unit_name(unitDao.getUnit_name()) .qty(item.getQty()) @@ -327,7 +329,7 @@ public class InboundPdaServiceImpl implements InboundPdaService { jsonMst.put("biz_date", DateUtil.now()); // 组织明细数据 ArrayList tableData = new ArrayList<>(); - HashMap dtl = new HashMap<>(); + HashMap dtl = new HashMap<>(); // GroupPlate plateDao = plateDaoList.get(0); for (GroupPlate plateDao : plateDaoList) { MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_code()); @@ -338,8 +340,8 @@ public class InboundPdaServiceImpl implements InboundPdaService { dtl.put("pcsn", plateDao.getPcsn()); dtl.put("qty_unit_id", plateDao.getQty_unit_id()); dtl.put("qty_unit_name", plateDao.getQty_unit_name()); - dtl.put("qty", String.valueOf(total_qty)); - dtl.put("plan_qty", String.valueOf(total_qty)); + dtl.put("qty", plateDao.getQty()); + dtl.put("plan_qty", plateDao.getQty()); dtl.put("ext_code", plateDao.getExt_code()); dtl.put("ext_type", plateDao.getExt_type()); dtl.put("callback_strategy", "dealPurchaseRecBillCallback"); @@ -431,7 +433,7 @@ public class InboundPdaServiceImpl implements InboundPdaService { jsonMst.put("biz_date", DateUtil.now()); // 组织明细数据 ArrayList tableData = new ArrayList<>(); - HashMap dtl = new HashMap<>(); + HashMap dtl = new HashMap<>(); // GroupPlate plateDao = plateDaoList.get(0); for (GroupPlate plateDao : plateDaoList) { MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_code()); @@ -442,8 +444,8 @@ public class InboundPdaServiceImpl implements InboundPdaService { dtl.put("pcsn", plateDao.getPcsn()); dtl.put("qty_unit_id", plateDao.getQty_unit_id()); dtl.put("qty_unit_name", plateDao.getQty_unit_name()); - dtl.put("qty", String.valueOf(total_qty)); - dtl.put("plan_qty", String.valueOf(total_qty)); + dtl.put("qty", plateDao.getQty()); + dtl.put("plan_qty", plateDao.getQty()); dtl.put("ext_code", plateDao.getExt_code()); dtl.put("ext_type", plateDao.getExt_type()); dtl.put("callback_strategy", "dealPurchaseRecBillCallback");