From 936d63735323dd972a1a5a6075d57a37b884466b Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Mon, 3 Jun 2024 14:16:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=BA=BF=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/AftersalesWorkOrderMapper.xml | 14 +- .../DistrilbutionBillLadingServiceImpl.java | 433 +++++++++--------- .../service/impl/ServiceNumServiceImpl.java | 11 +- 3 files changed, 230 insertions(+), 228 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index 8bcf5ba0d..f3f9726ff 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -320,8 +320,8 @@ law.waybill_number, law.order_code, law.train_number, - law.FIRST, - law.secondary, + laap.FIRST, + laap.secondary, law.vehicle_route, law.deliver_goods_time, law.discovery_time, @@ -343,10 +343,12 @@ law.audit_time, law.entry_time, law.operator, - law.brand_name + laap.brand_name FROM logpm_aftersales_processor lap LEFT JOIN logpm_aftersales_work_order law ON lap.work_order_id = law.id + left join logpm_aftersales_abnormal_package laap on laap.work_order_id=law.id + lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2' and law.work_order_status in ('10','20','30') and law.work_order_status = #{param.workOrderStatusNameS } @@ -357,8 +359,8 @@ and law.work_order_number like concat('%',#{param.workOrderNumber},'%') and law.waybill_number like concat('%',#{param.waybillNumber},'%') and law.order_code like concat('%',#{param.orderCode},'%') - and law.first like concat('%',#{param.first},'%') - and law.secondary like concat('%',#{param.secondary},'%') + and laap.first like concat('%',#{param.first},'%') + and laap.secondary like concat('%',#{param.secondary},'%') and law.waybill_mall like concat('%',#{param.waybillMall},'%') and law.brand_name like concat('%',#{param.brandName},'%') and law.customer_service_name like concat('%',#{param.customerServiceName},'%') @@ -375,7 +377,7 @@ and date_format(from_unixtime(law.audit_time),'%Y-%m-%d') = date_format(#{param.auditTime},'%Y-%m-%d') and date_format(from_unixtime(law.entry_time),'%Y-%m-%d') = date_format(#{param.entryTime},'%Y-%m-%d') and date_format(from_unixtime(law.over_time),'%Y-%m-%d') = date_format(#{param.overTime}),'%Y-%m-%d') - and law.brand_name like concat('%',#{param.brandName},'%') + and laap.brand_name like concat('%',#{param.brandName},'%') diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index 88d09150d..a34c3593d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -2970,276 +2970,269 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distrilbutionBillLading) { - Object billLadingId = distrilbutionBillLading.get("id"); //提货ID - Object coding = distrilbutionBillLading.get("coding"); //包条码 - Object type = distrilbutionBillLading.get("type"); //类型 2 订单 1 库存品 - if (Func.isNull(billLadingId) || ObjectUtil.isEmpty(coding) || Func.isNull(type)) { - return Resp.scanFail("3000", "参数不完整!!"); - } else { - DistrilbutionBillLadingEntity billLadingEntity1 = baseMapper.selectById((Serializable) billLadingId); - DistrilbutionAppBillLadingOrderMainVO billLadingOrderMainVO = baseMapper.getBillLadingOrderMainVO(Long.parseLong((String) billLadingId)); - Integer planNum = billLadingOrderMainVO.getPlanNum(); - Integer signedNum = billLadingOrderMainVO.getSignedNum(); - if ((planNum + billLadingOrderMainVO.getInventoryNub()) == signedNum) { - return Resp.scanFail("提货任务扫描已完成!", "提货任务扫描已完成!"); - } - if (ObjectUtils.isNotNull(billLadingEntity1) && "30".equals(billLadingEntity1.getConditions())) { - return Resp.scanFail("提货任务已完成!", "提货任务已完成!"); - } - BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); - if (ObjectUtils.isNull(myCurrentWarehouse)) { - return Resp.scanFail("请选择仓库!", "请选择仓库!"); - } - //查询是否签收 - List list3 = distributionBillLadingScanService.list(Wrappers.query().lambda() - .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) - .eq(DistributionBillLadingScanEntity::getMaterialType, type) - .eq(DistributionBillLadingScanEntity::getPacketBarCode, coding) - ); - if (!list3.isEmpty()) { - return Resp.scanFail("该包件已签收!", "该包件已签收!"); - } - - //添加扫描记录 - DistributionBillLadingScanEntity distributionBillLadingScan = new DistributionBillLadingScanEntity(); - distributionBillLadingScan.setMaterialType((String) type); - distributionBillLadingScan.setBillLadingId(Long.parseLong(billLadingId.toString())); - distributionBillLadingScan.setScanType(1); - distributionBillLadingScan.setScanUser(AuthUtil.getUser().getNickName()); - //扫描 - if ("1".equals(type)) { - //查询该自提单存在几种品类的库存品 - List inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId)); - if (ObjectUtils.isNotNull(inventoryAppVO)) { - List stocklistIds = inventoryAppVO.stream().map(DistrilbutionBillLadingInventoryAppVO::getStockListId).collect(Collectors.toList()); - //查询该自提单所有的库存品包件信息 - List inventoryPackage = disStockListDetailService.list(Wrappers.query().lambda() - .eq(DisStockListDetailEntity::getReservationId, billLadingId) - .in(DisStockListDetailEntity::getStockListId, stocklistIds) - .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) - ); - Long stockListId = 0L; - if (Func.isNotEmpty(inventoryPackage)) { - //检测库存品包件是否都已经完成备货 - boolean flag = inventoryPackage.stream().anyMatch(f -> Func.isEmpty(f.getStockPackageCode())); - if (flag) { - return Resp.scanFail("库存品备货未完成,请联系库管人员!", "库存品备货未完成,请联系库管人员"); - } - //校验包件李彪是否存在满足码值的包件 - List collect = inventoryPackage.stream().filter(f -> coding.equals(f.getStockPackageCode())).collect(Collectors.toList()); - if (collect.size() == 1) { - //满足签收 - distributionBillLadingScan.setPacketBarCode((String) coding); - distributionBillLadingScan.setStockListId(collect.get(0).getStockListId()); - distributionBillLadingScan.setQuantity(1); - distributionBillLadingScanService.save(distributionBillLadingScan); - stockListId = collect.get(0).getStockListId(); - //扣减库存 - distributionStockListMapper.deductionQuantityStock(collect.get(0).getStockListId(), collect.get(0).getNum()); + try{ + Object billLadingId = distrilbutionBillLading.get("id"); //提货ID + Object coding = distrilbutionBillLading.get("coding"); //包条码 + Object type = distrilbutionBillLading.get("type"); //类型 2 订单 1 库存品 + if (Func.isNull(billLadingId) || ObjectUtil.isEmpty(coding) || Func.isNull(type)) { + return Resp.scanFail("3000", "参数不完整!!"); + } else { + DistrilbutionBillLadingEntity billLadingEntity1 = baseMapper.selectById((Serializable) billLadingId); + DistrilbutionAppBillLadingOrderMainVO billLadingOrderMainVO = baseMapper.getBillLadingOrderMainVO(Long.parseLong((String) billLadingId)); + Integer planNum = billLadingOrderMainVO.getPlanNum(); + Integer signedNum = billLadingOrderMainVO.getSignedNum(); + if ((planNum + billLadingOrderMainVO.getInventoryNub()) == signedNum) { + return Resp.scanFail("提货任务扫描已完成!", "提货任务扫描已完成!"); + } + if (ObjectUtils.isNotNull(billLadingEntity1) && "30".equals(billLadingEntity1.getConditions())) { + return Resp.scanFail("提货任务已完成!", "提货任务已完成!"); + } + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + if (ObjectUtils.isNull(myCurrentWarehouse)) { + return Resp.scanFail("请选择仓库!", "请选择仓库!"); + } + //查询是否签收 + List list3 = distributionBillLadingScanService.list(Wrappers.query().lambda() + .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) + .eq(DistributionBillLadingScanEntity::getMaterialType, type) + .eq(DistributionBillLadingScanEntity::getPacketBarCode, coding) + ); + if (!list3.isEmpty()) { + return Resp.scanFail("该包件已签收!", "该包件已签收!"); + } + //添加扫描记录 + DistributionBillLadingScanEntity distributionBillLadingScan = new DistributionBillLadingScanEntity(); + distributionBillLadingScan.setMaterialType((String) type); + distributionBillLadingScan.setBillLadingId(Long.parseLong(billLadingId.toString())); + distributionBillLadingScan.setScanType(1); + distributionBillLadingScan.setScanUser(AuthUtil.getUser().getNickName()); + //扫描 + if ("1".equals(type)) { + //查询该自提单存在几种品类的库存品 + List inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId)); + if (ObjectUtils.isNotNull(inventoryAppVO)) { + List stocklistIds = inventoryAppVO.stream().map(DistrilbutionBillLadingInventoryAppVO::getStockListId).collect(Collectors.toList()); + //查询该自提单所有的库存品包件信息 + List inventoryPackage = disStockListDetailService.list(Wrappers.query().lambda() + .eq(DisStockListDetailEntity::getReservationId, billLadingId) + .in(DisStockListDetailEntity::getStockListId, stocklistIds) + .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) + ); + Long stockListId = 0L; + if (Func.isNotEmpty(inventoryPackage)) { + //检测库存品包件是否都已经完成备货 + boolean flag = inventoryPackage.stream().anyMatch(f -> Func.isEmpty(f.getStockPackageCode())); + if (flag) { + return Resp.scanFail("库存品备货未完成,请联系库管人员!", "库存品备货未完成,请联系库管人员"); + } + //校验包件李彪是否存在满足码值的包件 + List collect = inventoryPackage.stream().filter(f -> coding.equals(f.getStockPackageCode())).collect(Collectors.toList()); + if (collect.size() == 1) { + //满足签收 + distributionBillLadingScan.setPacketBarCode((String) coding); + distributionBillLadingScan.setStockListId(collect.get(0).getStockListId()); + distributionBillLadingScan.setQuantity(1); + distributionBillLadingScanService.save(distributionBillLadingScan); + stockListId = collect.get(0).getStockListId(); + //扣减库存 + distributionStockListMapper.deductionQuantityStock(collect.get(0).getStockListId(), collect.get(0).getNum()); - } else { - //不满足签收,记录为什么不满足 - if (collect.size() > 1) { - //已备货库存品包件存在多条一样的 - log.info("########################PDA签收库存品包件存在多条一样的备货码值:{}", coding); - return Resp.scanFail("系统无此编码!", "系统无此编码"); } else { - //备货库存品不存在 - return Resp.scanFail("系统无此编码!", "系统无此编码"); + //不满足签收,记录为什么不满足 + if (collect.size() > 1) { + //已备货库存品包件存在多条一样的 + log.info("########################PDA签收库存品包件存在多条一样的备货码值:{}", coding); + return Resp.scanFail("系统无此编码!", "系统无此编码"); + } else { + //备货库存品不存在 + return Resp.scanFail("系统无此编码!", "系统无此编码"); + + } } - } - Map> stockListMap = inventoryAppVO.stream().collect(Collectors.groupingBy(DistrilbutionBillLadingInventoryAppVO::getStockListId)); - //查询签收数量 - List list = distributionBillLadingScanService.list(Wrappers.query().lambda() - .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) - .eq(DistributionBillLadingScanEntity::getMaterialType, "1") - .eq(DistributionBillLadingScanEntity::getStockListId, stockListId) - ); - List billLadingInventoryAppVOS = stockListMap.get(stockListId); - if (Func.isNotEmpty(billLadingInventoryAppVOS)) { - DistrilbutionBillLadingInventoryAppVO distrilbutionBillLadingInventoryAppVO = billLadingInventoryAppVOS.get(0); - if (list.size() == distrilbutionBillLadingInventoryAppVO.getQuantity()) { - //修改完成状态 - distributionAsyncService.getInventoryOrderSelfPickup(distrilbutionBillLadingInventoryAppVO.getLdddId()); - } - if (list.size() > distrilbutionBillLadingInventoryAppVO.getQuantity()) { - return Resp.scanFail("已完成!", "已完成!!"); + Map> stockListMap = inventoryAppVO.stream().collect(Collectors.groupingBy(DistrilbutionBillLadingInventoryAppVO::getStockListId)); + //查询签收数量 + List list = distributionBillLadingScanService.list(Wrappers.query().lambda() + .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) + .eq(DistributionBillLadingScanEntity::getMaterialType, "1") + .eq(DistributionBillLadingScanEntity::getStockListId, stockListId) + ); + List billLadingInventoryAppVOS = stockListMap.get(stockListId); + if (Func.isNotEmpty(billLadingInventoryAppVOS)) { + DistrilbutionBillLadingInventoryAppVO distrilbutionBillLadingInventoryAppVO = billLadingInventoryAppVOS.get(0); + if (list.size() == distrilbutionBillLadingInventoryAppVO.getQuantity()) { + //修改完成状态 + distributionAsyncService.getInventoryOrderSelfPickup(distrilbutionBillLadingInventoryAppVO.getLdddId()); + } + if (list.size() > distrilbutionBillLadingInventoryAppVO.getQuantity()) { + return Resp.scanFail("已完成!", "已完成!!"); + } + //修改库存品签收 + distributionAsyncService.getInventorySelfPickup(distrilbutionBillLadingInventoryAppVO.getStockArticleId()); } - //修改库存品签收 - distributionAsyncService.getInventorySelfPickup(distrilbutionBillLadingInventoryAppVO.getStockArticleId()); + + } else { + return Resp.scanFail("库存品暂未备货请联系库管人员!", "库存品暂未备货请联系库管人员"); + } } else { - return Resp.scanFail("库存品暂未备货请联系库管人员!", "库存品暂未备货请联系库管人员"); - + return Resp.scanFail("包件信息不存在", "包件信息不存在"); } - } else { - return Resp.scanFail("包件信息不存在", "包件信息不存在"); - } - } else { - //查询订单是否已签收 - List list4 = distributionParcelListService.list(Wrappers.query().lambda() - .eq(DistributionParcelListEntity::getOrderPackageCode, coding) - .eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) - ); - if (list4.isEmpty()) { - return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(), PdaAudioLingoStatus.baojianbucunzai.getName()); - } - if (list4.size() > 1) { - return Resp.scanFail("包件信息错误", "包件信息错误"); - } + //查询订单是否已签收 + List list4 = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getOrderPackageCode, coding) + .eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) + ); + if (list4.isEmpty()) { + return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(), PdaAudioLingoStatus.baojianbucunzai.getName()); + } + if (list4.size() > 1) { + return Resp.scanFail("包件信息错误", "包件信息错误"); + } - DistrilbutionBillStockEntity one2 = distrilbutionBillStockService.getOne(Wrappers.query().lambda() - .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) - .apply("order_status in ('1' , '3')") - .eq(DistrilbutionBillStockEntity::getStockArticleId, list4.get(0).getStockArticleId()) - ); + DistrilbutionBillStockEntity one2 = distrilbutionBillStockService.getOne(Wrappers.query().lambda() + .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) + .apply("order_status in ('1' , '3')") + .eq(DistrilbutionBillStockEntity::getStockArticleId, list4.get(0).getStockArticleId()) + ); - DistrilbutionBillPackageEntity one3 = distrilbutionBillPackageService.getOne(Wrappers.query().lambda() - .eq(DistrilbutionBillPackageEntity::getBillLadingId, billLadingId) - .ne(DistrilbutionBillPackageEntity::getPacketBarStatus, 2) - .eq(DistrilbutionBillPackageEntity::getParceListId, list4.get(0).getId()) - ); - if (ObjectUtils.isNull(one3)) { - return Resp.scanFail("不是本客户的货!", "不是本客户的货!"); - } + DistrilbutionBillPackageEntity one3 = distrilbutionBillPackageService.getOne(Wrappers.query().lambda() + .eq(DistrilbutionBillPackageEntity::getBillLadingId, billLadingId) + .ne(DistrilbutionBillPackageEntity::getPacketBarStatus, 2) + .eq(DistrilbutionBillPackageEntity::getParceListId, list4.get(0).getId()) + ); + if (ObjectUtils.isNull(one3)) { + return Resp.scanFail("不是本客户的货!", "不是本客户的货!"); + } - if ("20".equals(one2.getConditions())) { - return Resp.scanFail("当前提货任务," + list4.get(0).getOrderCode() + "已齐套!", "当前提货任务," + list4.get(0).getOrderCode() + "已齐套!"); - } + if ("20".equals(one2.getConditions())) { + return Resp.scanFail("当前提货任务," + list4.get(0).getOrderCode() + "已齐套!", "当前提货任务," + list4.get(0).getOrderCode() + "已齐套!"); + } - //查询订单存在吗 - List list = distrilbutionBillStockService.list(Wrappers.query().lambda() - .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) - ); - if (list.isEmpty()) { - return Resp.scanFail("当前提货任务,订单不存在!", "当前提货任务,订单不存在!"); - } else { - AtomicBoolean n = new AtomicBoolean(false); + //查询订单存在吗 + List list = distrilbutionBillStockService.list(Wrappers.query().lambda() + .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) + ); + if (list.isEmpty()) { + return Resp.scanFail("当前提货任务,订单不存在!", "当前提货任务,订单不存在!"); + } else { + AtomicBoolean n = new AtomicBoolean(false); - // 获取订单的ID - List ls = list.stream() // 转换为Stream - .map(DistrilbutionBillStockEntity::getStockArticleId) // 提取每个元素的orderId - .collect(Collectors.toList()); // 收集到新的List + // 获取订单的ID + List ls = list.stream() // 转换为Stream + .map(DistrilbutionBillStockEntity::getStockArticleId) // 提取每个元素的orderId + .collect(Collectors.toList()); // 收集到新的List - List distributionStockArticleEntityList = distributionStockArticleService.list(Wrappers.query().lambda() - .in(DistributionStockArticleEntity::getId, ls)); + List distributionStockArticleEntityList = distributionStockArticleService.list(Wrappers.query().lambda() + .in(DistributionStockArticleEntity::getId, ls)); - List list1 = distributionParcelListService.list(Wrappers.query().lambda() - .in(DistributionParcelListEntity::getStockArticleId, ls) - ); + List list1 = distributionParcelListService.list(Wrappers.query().lambda() + .in(DistributionParcelListEntity::getStockArticleId, ls) + ); - List distributionBillLadingScanEntities = distributionBillLadingScanService.list(Wrappers.query().lambda() - .in(DistributionBillLadingScanEntity::getStockArticleId, ls) - .eq(DistributionBillLadingScanEntity::getMaterialType, "2") - .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) - ); + List distributionBillLadingScanEntities = distributionBillLadingScanService.list(Wrappers.query().lambda() + .in(DistributionBillLadingScanEntity::getStockArticleId, ls) + .eq(DistributionBillLadingScanEntity::getMaterialType, "2") + .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) + ); - list.forEach(so -> { - //查询包件信息 + list.forEach(so -> { + //查询包件信息 - DistributionParcelListEntity distributionParcelListEntity = null; + DistributionParcelListEntity distributionParcelListEntity = null; - for (DistributionParcelListEntity parcelListEntity : list1) { - if (parcelListEntity.getStockArticleId().equals(so.getStockArticleId()) && parcelListEntity.getOrderPackageCode().equals(coding)) { - distributionParcelListEntity = parcelListEntity; + for (DistributionParcelListEntity parcelListEntity : list1) { + if (parcelListEntity.getStockArticleId().equals(so.getStockArticleId()) && parcelListEntity.getOrderPackageCode().equals(coding)) { + distributionParcelListEntity = parcelListEntity; + } } - } - if (distributionParcelListEntity != null) { - n.set(true); - //查询订单包件数量签收的信息 - DistributionStockArticleEntity one = distributionStockArticleEntityList.stream().filter(s -> s.getId().equals(so.getStockArticleId())).findFirst().orElse(null); + if (distributionParcelListEntity != null) { + n.set(true); + //查询订单包件数量签收的信息 + DistributionStockArticleEntity one = distributionStockArticleEntityList.stream().filter(s -> s.getId().equals(so.getStockArticleId())).findFirst().orElse(null); - List list2 = new ArrayList<>(); - for (DistributionBillLadingScanEntity distributionBillLadingScanEntity : distributionBillLadingScanEntities) { - if (distributionBillLadingScanEntity.getStockArticleId().equals(so.getStockArticleId())) { - list2.add(distributionBillLadingScanEntity); + List list2 = new ArrayList<>(); + for (DistributionBillLadingScanEntity distributionBillLadingScanEntity : distributionBillLadingScanEntities) { + if (distributionBillLadingScanEntity.getStockArticleId().equals(so.getStockArticleId())) { + list2.add(distributionBillLadingScanEntity); + } } - } - one.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); + one.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); - //判断当前签收数 修改订单和备货订单状态 - if (one.getTotalNumber().equals(list2.size() + 1)) { + //判断当前签收数 修改订单和备货订单状态 + if (one.getTotalNumber().equals(list2.size() + 1)) { // - DistrilbutionBillStockEntity one1 = null; + DistrilbutionBillStockEntity one1 = null; + + for (DistrilbutionBillStockEntity distrilbutionBillStockEntity : list) { + if (distrilbutionBillStockEntity.getStockArticleId().equals(so.getStockArticleId()) && distrilbutionBillStockEntity.getConditions().equals(BillLadingStatusConstant.daitihuo.getValue())) { + one1 = distrilbutionBillStockEntity; + } + } - for (DistrilbutionBillStockEntity distrilbutionBillStockEntity : list) { - if (distrilbutionBillStockEntity.getStockArticleId().equals(so.getStockArticleId()) && distrilbutionBillStockEntity.getConditions().equals(BillLadingStatusConstant.daitihuo.getValue())) { - one1 = distrilbutionBillStockEntity; + if (one1 != null) { + distributionAsyncService.updateBillStock(one1.getId()); } + one.setOrderStatus(OrderStatusConstant.qianshou.getValue()); + } + //修改在库数量 + if (ObjectUtils.isNotNull(one.getHandQuantity()) && one.getHandQuantity() > 0) { + int i = one.getHandQuantity() - 1; + int i2 = ObjectUtils.isNull(one.getSigninQuantity()) ? 1 : one.getSigninQuantity() + 1; + one.setHandQuantity(i); + one.setSigninQuantity(i2); - if (one1 != null) { - distributionAsyncService.updateBillStock(one1.getId()); } - one.setOrderStatus(OrderStatusConstant.qianshou.getValue()); - //修改订单状态 -// distributionAsyncService.updateOrderSelfPickup(one.getId()); - //修改备货订单状态 - } - //修改在库数量 - if (ObjectUtils.isNotNull(one.getHandQuantity()) && one.getHandQuantity() > 0) { - int i = one.getHandQuantity() - 1; - int i2 = ObjectUtils.isNull(one.getSigninQuantity()) ? 1 : one.getSigninQuantity() + 1; -// distributionStockArticleService.update(Wrappers.update() -// .eq("id", one.getId()) -// .set("hand_quantity", i) -// .set("signin_quantity", i2) -// ); - one.setHandQuantity(i); - one.setSigninQuantity(i2); - } + // 修改订单状态 + distributionStockArticleService.updateById(one); - // 修改订单状态 - distributionStockArticleService.updateById(one); - - //修改包件状态 - distributionAsyncService.getSelfPickup(distributionParcelListEntity.getId()); - distributionBillLadingScan.setParcelListId(distributionParcelListEntity.getId()); - distributionBillLadingScan.setPacketBarCode(String.valueOf(coding)); - //订单 - distributionBillLadingScan.setStockArticleId(one.getId()); - distributionBillLadingScan.setQuantity(1); - distributionBillLadingScan.setBillLadingId(Long.parseLong((String) billLadingId)); - //包件解脱 -// try { -// warehouseUpdownTypeClient.downPackageOrDelTray((String) coding, myCurrentWarehouse.getId(),"签收下架解托"); -// } catch (Exception e) { -// log.info("自提签收包件解托报错:" + e.getMessage()); -// } + //修改包件状态 + distributionAsyncService.getSelfPickup(distributionParcelListEntity.getId()); + distributionBillLadingScan.setParcelListId(distributionParcelListEntity.getId()); + distributionBillLadingScan.setPacketBarCode(String.valueOf(coding)); + //订单 + distributionBillLadingScan.setStockArticleId(one.getId()); + distributionBillLadingScan.setQuantity(1); + distributionBillLadingScan.setBillLadingId(Long.parseLong((String) billLadingId)); - } - }); + } + }); - if (n.get()) { - distributionBillLadingScanService.save(distributionBillLadingScan); - } else { - return Resp.scanFail("当前订单,包件不存在!!", "当前订单,包件不存在!!"); + if (n.get()) { + distributionBillLadingScanService.save(distributionBillLadingScan); + } else { + return Resp.scanFail("当前订单,包件不存在!!", "当前订单,包件不存在!!"); + } } - } - } - //判断当前自提任务完成没有 - String a = String.valueOf(billLadingId); - distributionAsyncService.getStockUPstate(Long.parseLong(a)); + } + //判断当前自提任务完成没有 + String a = String.valueOf(billLadingId); + distributionAsyncService.getStockUPstate(Long.parseLong(a)); - log.info(coding + " > > 签收成功!!"); - return Resp.scanSuccess("签收成功", "签收成功"); + log.info(coding + " > > 签收成功!!"); + return Resp.scanSuccess("签收成功", "签收成功"); + } + }catch (Exception e){ + log.error("自提扫描异常",e); + return Resp.scanFail("系统异常!", "系统异常,请联系管理员"); } + } /** diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java index 3db7f7679..3cf2abfba 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java @@ -21,6 +21,7 @@ import com.logpm.oldproject.entity.ServiceNumEntity; import com.logpm.oldproject.mapper.ServiceNumMapper; import com.logpm.oldproject.service.IServiceNumService; import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.util.List; @@ -32,6 +33,7 @@ import java.util.Objects; * @author BladeX * @since 2023-05-10 */ +@Slf4j @Service @AllArgsConstructor public class ServiceNumServiceImpl implements IServiceNumService { @@ -40,9 +42,14 @@ public class ServiceNumServiceImpl implements IServiceNumService { @Override public Boolean addServiceNum(List serviceNum) { - if(!Objects.isNull(serviceNum)&&serviceNum.size()>0){ - return serviceNumMapper.addAll(serviceNum); + try{ + if(!Objects.isNull(serviceNum)&& !serviceNum.isEmpty()){ + return serviceNumMapper.addAll(serviceNum); + } + }catch (Exception e){ + log.error(">>>> addServiceNum",e); } + return true; }