From 37f1ec0399248443f72c1845bd55a1a2acfe4fd8 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 24 Jan 2024 14:36:03 +0800 Subject: [PATCH] =?UTF-8?q?debug=20=E5=8F=B8=E6=9C=BA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=B8=8D=E5=87=BA=E7=8E=B02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionDeliveryListMapper.xml | 2 +- .../DistributionDeliveryListServiceImpl.java | 351 +++++++++--------- 2 files changed, 178 insertions(+), 175 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 6b19840b8..dec1a0e52 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -757,7 +757,7 @@ logpm_distribution_delivery_list lddl left join logpm_distribution_delivery_self ldds on lddl.id =ldds.delivery_id - lddl.is_deleted =0 and lddl.warehouse_id =#{warehouseId} + lddl.is_deleted =0 and lddl.customers_number > 0 and lddl.warehouse_id =#{warehouseId} and lddl.type = #{param.type} and lddl.id in diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 427c362d0..395a3866a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; import com.logpm.basic.entity.BasicPrintTemplateEntity; import com.logpm.basic.feign.IBasicPrintTemplateClient; @@ -577,8 +578,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl map = new HashMap(); + Map map = new HashMap(); String distrilbutionloadingscanDTOJson = JSONObject.toJSONString(distrilbutionloadingscanDTO); - map.put("distrilbutionloadingscanDTO",distrilbutionloadingscanDTOJson); + map.put("distrilbutionloadingscanDTO", distrilbutionloadingscanDTOJson); String parcelListEntityJson = JSONObject.toJSONString(parcelListEntity); - map.put("parcelListEntity",parcelListEntityJson); - map.put("myCurrentWarehouseId",myCurrentWarehouse.getId()); + map.put("parcelListEntity", parcelListEntityJson); + map.put("myCurrentWarehouseId", myCurrentWarehouse.getId()); String reservationEntityJson = JSONObject.toJSONString(reservationEntity); - map.put("reservationEntity",reservationEntityJson); + map.put("reservationEntity", reservationEntityJson); log.info(">>>>>>>>>>>>> 进入延迟队列处理包件相关信息状态"); @@ -871,7 +872,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionAppDeliveryListPage(IPage page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { - - //获取当前登录人 - BladeUser user = AuthUtil.getUser(); - String roleId = user.getRoleId(); - //判断当前登录人是否为司机 List distributionAppDeliveryListVOS = new ArrayList<>(); - boolean delivery = false; - String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); - if (roleId.contains(value1)) delivery = true; - - BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - + try { +//获取当前登录人 + BladeUser user = AuthUtil.getUser(); + String roleId = user.getRoleId(); + //判断当前登录人是否为司机 + boolean delivery = false; + String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); + if (roleId.contains(value1)) delivery = true; + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); // R value = dictBizClient.getValue("role_class", roleId); - if (delivery) { - //查询当前登录人的配送任务 - BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId()); - if (null == driverArtery) { - log.error("没有司机的信息!!"); - return page.setRecords(distributionAppDeliveryListVOS); - } - //查询司机的任务 - List deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId()); - if (!deliveryIds.isEmpty()) { - distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, deliveryIds, myCurrentWarehouse.getId()); + if (delivery) { + //查询当前登录人的配送任务 + BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId()); + if (null == driverArtery) { + log.error("没有司机的信息!!"); + return page.setRecords(distributionAppDeliveryListVOS); + } + //查询司机的任务 + List deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId()); + if (!deliveryIds.isEmpty()) { + distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, deliveryIds, myCurrentWarehouse.getId()); + } else { + return page.setRecords(distributionAppDeliveryListVOS); + } } else { - return page.setRecords(distributionAppDeliveryListVOS); + distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, null, myCurrentWarehouse.getId()); } - } else { - distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, null, myCurrentWarehouse.getId()); - } - log.info(">>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}",distributionAppDeliveryListVOS); - //转换字典字段 - for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) { + log.info(">>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}", distributionAppDeliveryListVOS); + //转换字典字段 + for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) { - distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId())); - // 调用下 查询装车件数的方法 - //查询备货区 - if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) { - List list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId()); - QueryWrapper queryWrapper = new QueryWrapper(); + distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId())); + // 调用下 查询装车件数的方法 + //查询备货区 + if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) { + List list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId()); + QueryWrapper queryWrapper = new QueryWrapper(); - if (list.size() > 1) { - queryWrapper.in("reservation_id", list); - } else { - queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId()); - } - List list1 = distributionStockupInfoService.list(queryWrapper); - if (!list1.isEmpty()) { - DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0); - DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId()); - if (ObjectUtils.isNotNull(distributionStockupEntity)) { - distributionAppDeliveryListVO.setStockupArea(distributionStockupEntity.getStockupArea()); + if (list.size() > 1) { + queryWrapper.in("reservation_id", list); + } else { + queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId()); + } + List list1 = distributionStockupInfoService.list(queryWrapper); + if (!list1.isEmpty()) { + DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0); + DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId()); + if (ObjectUtils.isNotNull(distributionStockupEntity)) { + distributionAppDeliveryListVO.setStockupArea(distributionStockupEntity.getStockupArea()); + } else { + distributionAppDeliveryListVO.setStockupArea("无数据"); + } } else { distributionAppDeliveryListVO.setStockupArea("无数据"); } + } + //查询包件签收件数 + Integer lad = distributionLoadscanMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getSignforState, 2)).intValue(); + //查询库存品签收件数 + Integer nad = distributionLoadscaninvnMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscaninvnEntity::getSignforState, 2)).intValue(); + //维护计划数 + List reservationEntityList = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); + if (Func.isNotEmpty(reservationEntityList)) { + int packageNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationNum).sum(); + int invertoryNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationStockListNum).sum(); + distributionAppDeliveryListVO.setDeliveryNumber(packageNum + invertoryNum); } else { - distributionAppDeliveryListVO.setStockupArea("无数据"); + continue; } - } - //查询包件签收件数 - Integer lad = distributionLoadscanMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getSignforState, 2)).intValue(); - //查询库存品签收件数 - Integer nad = distributionLoadscaninvnMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscaninvnEntity::getSignforState, 2)).intValue(); - //维护计划数 - List reservationEntityList = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); - if (Func.isNotEmpty(reservationEntityList)) { - int packageNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationNum).sum(); - int invertoryNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationStockListNum).sum(); - distributionAppDeliveryListVO.setDeliveryNumber(packageNum + invertoryNum); - } else { - return null; - } - distributionAppDeliveryListVO.setSignNub(lad + nad); - //查询完成客户数 - Integer cusCount = baseMapper.selectCompletecusCount(distributionAppDeliveryListVO.getId()); - //查询完成订单数 - AtomicInteger ordCount = new AtomicInteger(); + distributionAppDeliveryListVO.setSignNub(lad + nad); + //查询完成客户数 + Integer cusCount = baseMapper.selectCompletecusCount(distributionAppDeliveryListVO.getId()); + //查询完成订单数 + AtomicInteger ordCount = new AtomicInteger(); // List distributionAppStockArticleVOS = baseMapper.selectDistributionAppDeliveryOrderO(distributionAppDeliveryListVO); - List deliveryStockArticleInfo = baseMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId()); + List deliveryStockArticleInfo = baseMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId()); // deliveryStockArticleInfo.forEach(); - List distributionReservationEntities = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); - distributionReservationEntities.forEach(r -> { - List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId()); - reservationStockarticleEntityList.forEach(rs -> { - List loadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId()).eq(DistributionLoadscanEntity::getReservationId, rs.getReservationId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); - if (Func.isNotEmpty(loadscanEntityList)) { - int loadSum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); - if (rs.getReservationNum() == loadSum) { - ordCount.getAndIncrement(); + List distributionReservationEntities = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); + distributionReservationEntities.forEach(r -> { + List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId()); + reservationStockarticleEntityList.forEach(rs -> { + List loadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId()).eq(DistributionLoadscanEntity::getReservationId, rs.getReservationId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + if (Func.isNotEmpty(loadscanEntityList)) { + int loadSum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); + if (rs.getReservationNum() == loadSum) { + ordCount.getAndIncrement(); + } } - } + }); }); - }); // distributionReservationMapper.selectPackageByReservationAndStockArticle() // for (DistributionAppStockArticleVO distributionAppStockArticleVO : distributionAppStockArticleVOS) { // if (distributionAppStockArticleVO.getLoadingNub() >= distributionAppStockArticleVO.getReservationNum()) { // ordCount += 1; // } // } - distributionAppDeliveryListVO.setLoadCusNub(cusCount); - distributionAppDeliveryListVO.setLoadOrdNub(ordCount.get()); - //查询下面的预约单 - List distributionSignforEntityList = distributionSignforMapper.selectList(new QueryWrapper().lambda().eq(DistributionSignforEntity::getDeliveryId, distributionAppDeliveryListVO.getId())); - //提取id - List reList = distributionSignforEntityList.stream().map(DistributionSignforEntity::getId).collect(Collectors.toList()); - distributionAppDeliveryListVO.setType_name(dictBizClient.getValue("distribution_type", distributionAppDeliveryListVO.getType()).getData()); - //查询是否配车 - Integer aLong = 0; - Integer aLong2 = 0; - distributionAppDeliveryListVO.setVehicleStatus_name("已配车"); - distributionAppDeliveryListVO.setDeliStatus_name("配送中"); - if (distributionAppDeliveryListVO.getDeliveryStatus().equals("4")) { - distributionAppDeliveryListVO.setDeliStatus_name("完成"); - } - if (distributionAppDeliveryListVO.getKind().equals("1")) { - aLong = distributionDeliverySelfMapper.selectCount(new QueryWrapper().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue(); - } else { - aLong2 = distributionDeliveryTripartiteMapper.selectCount(new QueryWrapper().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue(); - } - if (aLong == 0 && aLong2 == 0) { - distributionAppDeliveryListVO.setVehicleStatus_name("未配车"); - } - //查询是否备货 - distributionAppDeliveryListVO.setIsstock("备货未完成"); - List stockEntityList = distributionStockMapper.selectList(new QueryWrapper().lambda().eq(DistributionStockEntity::getReservationId, distributionAppDeliveryListVO.getReservationId())); - if (Func.isNotEmpty(stockEntityList)) { - Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数 - int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum(); - if (sum == deliveryNumber) { - distributionAppDeliveryListVO.setIsstock("备货完成"); + distributionAppDeliveryListVO.setLoadCusNub(cusCount); + distributionAppDeliveryListVO.setLoadOrdNub(ordCount.get()); + //查询下面的预约单 + List distributionSignforEntityList = distributionSignforMapper.selectList(new QueryWrapper().lambda().eq(DistributionSignforEntity::getDeliveryId, distributionAppDeliveryListVO.getId())); + //提取id + List reList = distributionSignforEntityList.stream().map(DistributionSignforEntity::getId).collect(Collectors.toList()); + distributionAppDeliveryListVO.setType_name(dictBizClient.getValue("distribution_type", distributionAppDeliveryListVO.getType()).getData()); + //查询是否配车 + Integer aLong = 0; + Integer aLong2 = 0; + distributionAppDeliveryListVO.setVehicleStatus_name("已配车"); + distributionAppDeliveryListVO.setDeliStatus_name("配送中"); + if (distributionAppDeliveryListVO.getDeliveryStatus().equals("4")) { + distributionAppDeliveryListVO.setDeliStatus_name("完成"); } - } - //查询司机 - List distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId()); - if (!distributionAppDeliverySelfVOS.isEmpty()) { - StringBuilder stringBuilder = new StringBuilder(); - distributionAppDeliverySelfVOS.forEach(e -> { - if (e.getIsMaster() == 2) { - stringBuilder.append(e.getDriverName()).append("(主)"); - } else { - stringBuilder.append(e.getDriverName()).append("(副)"); + if (distributionAppDeliveryListVO.getKind().equals("1")) { + aLong = distributionDeliverySelfMapper.selectCount(new QueryWrapper().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue(); + } else { + aLong2 = distributionDeliveryTripartiteMapper.selectCount(new QueryWrapper().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue(); + } + if (aLong == 0 && aLong2 == 0) { + distributionAppDeliveryListVO.setVehicleStatus_name("未配车"); + } + //查询是否备货 + distributionAppDeliveryListVO.setIsstock("备货未完成"); + List stockEntityList = distributionStockMapper.selectList(new QueryWrapper().lambda().eq(DistributionStockEntity::getReservationId, distributionAppDeliveryListVO.getReservationId())); + if (Func.isNotEmpty(stockEntityList)) { + Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数 + int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum(); + if (sum == deliveryNumber) { + distributionAppDeliveryListVO.setIsstock("备货完成"); } - }); - distributionAppDeliveryListVO.setDriverName(stringBuilder.toString()); + } + //查询司机 + List distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId()); + if (!distributionAppDeliverySelfVOS.isEmpty()) { + StringBuilder stringBuilder = new StringBuilder(); + distributionAppDeliverySelfVOS.forEach(e -> { + if (e.getIsMaster() == 2) { + stringBuilder.append(e.getDriverName()).append("(主)"); + } else { + stringBuilder.append(e.getDriverName()).append("(副)"); + } + }); + distributionAppDeliveryListVO.setDriverName(stringBuilder.toString()); + } } + } catch (Exception e) { + log.error(">>>>>>>> 司机配送装车查询 报错", e); } return page.setRecords(distributionAppDeliveryListVOS); + } @Override @@ -3021,9 +3024,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()).ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()).ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue()).notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()})); if (Func.isEmpty(distributionParcelListEntities)) { log.error("##############添加空订单"); - throw new RuntimeException(s.getOrderCode()+"无可用包件!!!"); + throw new RuntimeException(s.getOrderCode() + "无可用包件!!!"); } distributionParcelListEntities.forEach(dp -> { if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { @@ -3165,9 +3168,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { if (Func.isEmpty(oldPackageList.get(p.getId()))) { - if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ - log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); - throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); + if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) { + log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId()); + throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单"); } //为该订单新增了包件 DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); @@ -3187,9 +3190,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { - if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ - log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); - throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); + if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) { + log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId()); + throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单"); } DistributionReservationPackageEntity reservationPackageEntity = b.get(0); reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue()); @@ -3286,9 +3289,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { - if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ - log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); - throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); + if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) { + log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId()); + throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单"); } DistributionReservationStockarticleEntity reservationStockarticleEntity = n.get(0); if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) { @@ -4170,16 +4173,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl orderIds = reservationStockarticleEntityList.stream().filter(order -> order.getIsZero().equals(IsOrNoConstant.no.getValue())).map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); if (Func.isNotEmpty(orderIds)) { //查询该客户的非零但订单包间 - IPage parcelListEntityList = distributionReservationMapper.getReservationPackage(page,orderIds, distributionDeliveryInfoDTO); + IPage parcelListEntityList = distributionReservationMapper.getReservationPackage(page, orderIds, distributionDeliveryInfoDTO); parcelListVOIPage.setTotal(parcelListEntityList.getTotal()); // List parcelListEntityList = distributionReservationMapper.getReservationPackageNew(distributionDeliveryInfoDTO); - log.info(">>>>>> parcelListEntityList {}",parcelListEntityList); + log.info(">>>>>> parcelListEntityList {}", parcelListEntityList); List parcelListVOList = DistributionParcelListWrapper.build().listVO(parcelListEntityList.getRecords()); for (DistributionParcelListVO distributionParcelListVO : parcelListVOList) { - log.info(">>>>>> distributionParcelListVO {}",distributionParcelListVO); + log.info(">>>>>> distributionParcelListVO {}", distributionParcelListVO); if (Func.isNotEmpty(loadingDataMap)) { DistributionLoadscanEntity loadscanEntity = loadingDataMap.get(distributionParcelListVO.getId()); - log.info(">>>>>> loadscanEntity {}",loadscanEntity); + log.info(">>>>>> loadscanEntity {}", loadscanEntity); if (Func.isNotEmpty(loadscanEntity)) { if (loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { @@ -4225,7 +4228,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl>>>>> distributionParcelListVO2 {}",distributionParcelListVO); + log.info(">>>>>> distributionParcelListVO2 {}", distributionParcelListVO); distributionParcelListVOS.add(distributionParcelListVO); } @@ -5135,7 +5138,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())); if (Func.isNotEmpty(parcelListEntities) && parcelListEntities.size() == 1) { DistributionParcelListEntity parcelListEntity = parcelListEntities.get(0); - if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())){ + if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())) { //包件已装车 log.error("重复异常装车,:{}", parcelListEntity.getOrderPackageCode()); return Resp.scanFail("操作失败", "包件已装车"); @@ -5290,13 +5293,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListEntityLambdaQueryWrapper = Wrappers.query().lambda() - .notIn(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue(),OrderPackageStatusConstant.yichuku.getValue()) + .notIn(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue(), OrderPackageStatusConstant.yichuku.getValue()) .ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()) .eq(DistributionParcelListEntity::getStockArticleId, orderId); - if (Func.isNotEmpty(reservationPackageList)){ + if (Func.isNotEmpty(reservationPackageList)) { List packageIds = reservationPackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); - if (Func.isNotEmpty(packageIds)){ - parcelListEntityLambdaQueryWrapper.notIn(DistributionParcelListEntity::getId,packageIds); + if (Func.isNotEmpty(packageIds)) { + parcelListEntityLambdaQueryWrapper.notIn(DistributionParcelListEntity::getId, packageIds); } } List parcelListEntities = distributionParcelListService.list(parcelListEntityLambdaQueryWrapper); @@ -6475,7 +6478,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationEntities = distributionSignforService.selectReservationByDeliveryId(deliveryId); - if (Func.isEmpty(reservationEntities)){ - log.info(method + "预约查询失败:{}", deliveryId); + if (Func.isEmpty(reservationEntities)) { + log.info(method + "预约查询失败:{}", deliveryId); return R.fail("服务器正忙!!!"); } String reservationCodes = reservationEntities.stream().filter(f -> !f.getLoadingStatus().equals(ReservationLoadingStatusConstant.daizhuangche.getValue())).map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(",")); - if (Func.isNotEmpty(reservationCodes)){ + if (Func.isNotEmpty(reservationCodes)) { log.info(method + "存在装车数据:{}", reservationCodes); - return R.fail(reservationCodes+"存在装车包件!!!"); + return R.fail(reservationCodes + "存在装车包件!!!"); } //该配送是否存在异常装车或者异常签收数据 List loadscanEntityList = distributionDeliveryListService.selectAbnormalLoadingBydeliveryId(deliveryId); - if (Func.isNotEmpty(loadscanEntityList)){ + if (Func.isNotEmpty(loadscanEntityList)) { log.info(method + "存在异常装车数据:{}", deliveryId); - return R.fail(reservationCodes+"存在异常装车、签收包条!!!"); + return R.fail(reservationCodes + "存在异常装车、签收包条!!!"); } boolean flag = false; for (DistributionReservationEntity reservationEntity : reservationEntities) { DistributionReservationDTO reservationDTO = Func.copy(reservationEntity, DistributionReservationDTO.class); - flag = distributionReservationService.cancelReservation(reservationDTO); - if (!flag){ - log.info(method + "取消预约失败:{}", deliveryId); - throw new RuntimeException("取消配送计划失败,请联系管理员"); - } + flag = distributionReservationService.cancelReservation(reservationDTO); + if (!flag) { + log.info(method + "取消预约失败:{}", deliveryId); + throw new RuntimeException("取消配送计划失败,请联系管理员"); + } } return R.status(flag); } @@ -6802,9 +6805,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectAbnormalLoadingBydeliveryId(Long deliveryId) { return distributionLoadscanService.list(Wrappers.query().lambda() - .eq(DistributionLoadscanEntity::getDeliveryId,deliveryId) - .eq(DistributionLoadscanEntity::getScanStatus,LoadingStatusConstant.quxiao.getValue()) - .eq(DistributionLoadscanEntity::getIsAbnormalLoading,2) + .eq(DistributionLoadscanEntity::getDeliveryId, deliveryId) + .eq(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + .eq(DistributionLoadscanEntity::getIsAbnormalLoading, 2) ); } @@ -6847,10 +6850,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl list = distributionSignforService.list(Wrappers.query().lambda() .eq(DistributionSignforEntity::getDeliveryId, deliveryId) ); - if (!list.isEmpty()){ + if (!list.isEmpty()) { //查看所有的签收信息是否均已完成 boolean anyMatch = list.stream().allMatch(s -> s.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())); - if (anyMatch){ + if (anyMatch) { deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); } }