diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java index 6aa69073b..c4d510a3d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java @@ -34,12 +34,11 @@ import com.logpm.distribution.mapper.DistrilbutionBillStockMapper; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.DisStockListDetailVO; import com.logpm.distribution.vo.DisStockListVO; -import com.logpm.distribution.vo.DistributionStockArticleQRCodeVO; import com.logpm.distribution.vo.OrderPackgeCodeDataVO; import lombok.AllArgsConstructor; +import org.jetbrains.annotations.NotNull; import org.springblade.common.constant.DistributionTypeConstant; import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant; -import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.utils.QRCodeUtil; import org.springblade.common.utils.TemplateUtil; import org.springblade.core.log.exception.ServiceException; @@ -160,7 +159,7 @@ public class DisStockListDetailServiceImpl extends BaseServiceImpl list = distrilbutionBillStockService.selectList(Wrappers.query().lambda() .eq(DistrilbutionBillStockEntity::getBillLadingId, reservationId) ); - if(list.size() > 0){ + if(!list.isEmpty()){ DistributionStockArticleEntity byId = distributionStockArticleService.getById(list.get(0).getStockArticleId()); disStockListDetail.put("userName",byId.getConsigneePerson()); disStockListDetail.put("userNameDetail",byId.getCustomerAddress()); @@ -257,16 +256,7 @@ public class DisStockListDetailServiceImpl extends BaseServiceImpl fuzhi(String id){ DisStockListDetailEntity dis = baseMapper.selectById(id); DistributionStockListEntity byId = distributionStockListService.getById(dis.getStockListId()); - DisStockListVO disStockListVO = new DisStockListVO(); - disStockListVO.setId(dis.getId()); - disStockListVO.setStockPackageCode(dis.getStockPackageCode()); - disStockListVO.setSku(byId.getSku()); - disStockListVO.setCargoUnit(byId.getCargoUnit()); - disStockListVO.setOrderCode(byId.getOrderCode()); - disStockListVO.setDescriptionGoods(byId.getDescriptionGoods()); - disStockListVO.setBrandName(byId.getBrandName()); - disStockListVO.setStockListId(disStockListVO.getStockListId()); - disStockListVO.setReservationId(disStockListVO.getReservationId()); + DisStockListVO disStockListVO = getDisStockListVO(dis, byId); Map map = JSONObject.parseObject(JSONObject.toJSONString(disStockListVO), Map.class); String fileTypeName = QRCodeUtil.createCodeToFile(dis.getStockPackageCode()); @@ -279,7 +269,7 @@ public class DisStockListDetailServiceImpl extends BaseServiceImpl list = distrilbutionBillStockService.selectList(Wrappers.query().lambda() .eq(DistrilbutionBillStockEntity::getBillLadingId, dis.getReservationId()) ); - if(list.size() > 0){ + if(!list.isEmpty()){ DistributionStockArticleEntity byIds = distributionStockArticleService.getById(list.get(0).getStockArticleId()); map.put("userName",byIds.getConsigneePerson()); map.put("userNameDetail",byIds.getCustomerAddress()); @@ -293,4 +283,19 @@ public class DisStockListDetailServiceImpl extends BaseServiceImpl distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) ); - if (distributionLoadscanEntities.size() < 0) { - log.info("[makeSureByPackage]包条无数据"); - return; - } // 使用流式操作和映射,提取包条Id并创建新的列表 // List packageIdList = distributionLoadscanEntities.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList()); // for (Long aLong : packageIdList) { @@ -264,7 +252,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { @Override public void updateParcelListReservation(List ids) { log.debug("####修改包件预约状态"); - ids.stream().forEach(i -> { + ids.forEach(i -> { DistributionParcelListEntity distributionParcelListEntity = new DistributionParcelListEntity(); distributionParcelListEntity.setId(i); distributionParcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); @@ -436,7 +424,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); //修改包件状态 distributionParcelListService.updateById(parcelListEntity); - DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId)); +// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId)); List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId())); boolean packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); boolean packageSigningFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); @@ -524,7 +512,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { ); if (Func.isNotEmpty(loadscanEntityList)) { loadingNum += loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); - signNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(SignforStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); + signNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); } List loadscaninvnEntityList = distributionLoadscaninvnMapper.selectList(Wrappers.query().lambda() @@ -533,7 +521,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { ); if (Func.isNotEmpty(loadscanEntityList)) { loadingNum += loadscaninvnEntityList.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum(); - signNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(SignforStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); + signNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); } if (loadingNum == reservationTotal) { @@ -595,7 +583,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) ); if (Func.isNotEmpty(loadscanEntityList)) { - deliverySigningNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(SignforStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); + deliverySigningNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); } List loadscaninvnEntityList = distributionLoadscaninvnMapper.selectList(Wrappers.query().lambda() @@ -603,10 +591,10 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) ); if (Func.isNotEmpty(loadscanEntityList)) { - deliverySigningNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(SignforStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); + deliverySigningNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); } - if (deliverySigningNum == delivertTotal) { + if (deliverySigningNum.equals(delivertTotal)) { deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); } else { deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); @@ -889,7 +877,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { distributionDeliveryListMapper.updateById(deliveryListEntity); } List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); - if (Func.isNotEmpty(reservationEntityList) && reservationEntityList.size() > 0) { + if (Func.isNotEmpty(reservationEntityList) && !reservationEntityList.isEmpty()) { for (DistributionReservationEntity reservationEntity : reservationEntityList) { List parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId()); Map> order = parcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getStockArticleId)); @@ -937,7 +925,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId); Integer orderLoadingNum = distributionLoadscanMapper.selectOrderLoadingNum(stockArticleEntity.getId()); if (Func.isNotEmpty(orderLoadingNum) && orderLoadingNum > 0) { - if (stockArticleEntity.getTotalNumber() == orderLoadingNum) { + if (stockArticleEntity.getTotalNumber().equals(orderLoadingNum)) { stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); } else { stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); @@ -986,7 +974,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if (Func.isNotEmpty(parcelNumberEntityList)) { parcelNumberEntityList.forEach(p -> { DistributionParcelListEntity zeroParcelListEntity = distributionParcelListService.getById(p.getParcelListId()); - if (p.getOutboundQuantity() == p.getQuantity() && p.getOutboundQuantity() > 0) { + if (p.getOutboundQuantity() .equals(p.getQuantity()) && p.getOutboundQuantity() > 0) { //出库数量和总数量一致,此时包件处于装车状态 zeroParcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); } @@ -1036,19 +1024,19 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } catch (InterruptedException e) { throw new RuntimeException(e); } - log.debug("修改备货数据》》》", stockupDTO); + log.info("修改备货数据》》》 {}", stockupDTO); QueryWrapper queryWrapper = new QueryWrapper(); if (ObjectUtils.isNotNull(stockupDTO.getStockArticleId())) { queryWrapper.eq("stock_article_id", stockupDTO.getStockArticleId()); } - if (stockupDTO.getStockArticleIdList() != null && !stockupDTO.getStockArticleIdList().equals(null)) { + if (stockupDTO.getStockArticleIdList() != null && ObjectUtils.isNotNull(stockupDTO.getStockArticleIdList())) { queryWrapper.in("stock_article_id", stockupDTO.getStockArticleIdList()); } queryWrapper.eq("reservation_id", stockupDTO.getReservationId()); List list = reservationZeroPackageService.list(queryWrapper); AtomicBoolean pian = new AtomicBoolean(true); DistributionStockupEntity stockupEntity = new DistributionStockupEntity(); - list.stream().forEach(i -> { + list.forEach(i -> { if (!i.getQuantity().equals(i.getRealityQuantity())) { //不同 不能修改为完成 pian.set(false); @@ -1234,7 +1222,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } parcelNumberEntities.forEach(p -> { DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p.getParcelListId()); - if (p.getOutboundQuantity() == p.getQuantity()) { + if (Objects.equals(p.getOutboundQuantity(), p.getQuantity())) { parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); } else { parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()); @@ -1448,7 +1436,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { @Override @Async - public void sendFactory(DistributionParcelListEntity distributionParcelListEntity, String signingTime, Long reservationId, String reservationCode, String warehouseName,String userName) { + public void sendFactory(DistributionParcelListEntity distributionParcelListEntity, String signingTime, Long reservationId, String reservationCode, String warehouseName, String userName) { DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distributionParcelListEntity.getStockArticleId()); log.info(">>>>>>>>>>> 签收推送 对象 {}", distributionParcelListEntity); if (Func.isNotEmpty(stockArticleEntity)) { @@ -1465,8 +1453,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { case "欧派": //推送到欧派 try { - // ouPaiFactoryClinet.newSystemHandleStatusDataSignforOne("7",distributionParcelListEntity.getOrderPackageCode(), signingTime, userName );//*签收人*// - // log.info(">>>>>>>>>>>>>>>>>>>>>>>> 签收推送 欧派:{} {} {} {}", "7",distributionParcelListEntity.getOrderPackageCode(), signingTime, userName ); + // ouPaiFactoryClinet.newSystemHandleStatusDataSignforOne("7",distributionParcelListEntity.getOrderPackageCode(), signingTime, userName );//*签收人*// + // log.info(">>>>>>>>>>>>>>>>>>>>>>>> 签收推送 欧派:{} {} {} {}", "7",distributionParcelListEntity.getOrderPackageCode(), signingTime, userName ); } catch (Exception e) { throw new RuntimeException(e); } @@ -1482,7 +1470,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { @Async public void sendReviewFactory(Long signingId, String warehouseName, Long warehouseId) { String brands = "梦天,欧派";//可追加 - log.info(">>>>>>>>>>> 签收推送 对象 {}", "signingId:="+signingId+"warehouseName:="+warehouseName+"warehouseId:="+warehouseId); + log.info(">>>>>>>>>>> 签收推送 对象 {}", "signingId:=" + signingId + "warehouseName:=" + warehouseName + "warehouseId:=" + warehouseId); //查询签收信息 DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signingId); if (Func.isNotEmpty(distributionSignforEntity)) { @@ -1498,29 +1486,28 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { Map> brand = null; - log.info(">>>brand {} ",brand); List distributionReservationStockarticleEntities = distributionReservationMapper.selectStockArticleByReservationId(distributionReservationEntity.getId()); - log.info(">>>brand distributionReservationStockarticleEntities 长度 {} ",distributionReservationStockarticleEntities.size()); + log.info(">>>brand distributionReservationStockarticleEntities 长度 {} ", distributionReservationStockarticleEntities.size()); if (Func.isNotEmpty(distributionReservationStockarticleEntities)) { - log.info(">>>brand 进入 长度 {} ",distributionReservationStockarticleEntities); + log.info(">>>brand 进入 长度 {} ", distributionReservationStockarticleEntities); //存在订单 List orderIds = distributionReservationStockarticleEntities.stream().filter(f -> f.getIsZero().equals(IsOrNoConstant.no.getValue())).map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); - log.info(">>>brand 进入 orderIds {} ",orderIds); + log.info(">>>brand 进入 orderIds {} ", orderIds); List distributionStockArticleEntities = distributionStockArticleService.listByIds(orderIds); - log.info(">>>brand 进入 distributionStockArticleEntities {} ",distributionStockArticleEntities); + log.info(">>>brand 进入 distributionStockArticleEntities {} ", distributionStockArticleEntities); if (Func.isNotEmpty(distributionStockArticleEntities)) { String[] split = Func.split(brands, ","); - log.info(">>>brand 进入 split {} ",split); + log.info(">>>brand 进入 split {} ", (Object) split); //包件信息列表 brand = handkeBrandsPackageList(split, distributionStockArticleEntities, warehouseName, distributionReservationEntity.getId(), distributionDeliveryListEntity.getOrderCode(), warehouseId); } - log.info(">>>brand 进入 {} ",brand); + log.info(">>>brand 进入 {} ", brand); } @@ -1541,7 +1528,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { log.info(">>>>>>>>>>>>>>> 文员复核推送 品牌 {} ", brand); - if (Func.isNotEmpty(brand.get("梦天"))) { + assert brand != null; + if (Func.isNotEmpty(brand.get("梦天"))) { mtReceiveDTO.setReceiveContentList(brand.get("梦天")); orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO); } @@ -1557,26 +1545,23 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { - log.info(">>>>>>>>>>>>>>>>>>>>>>>>>distributionParcelListEntities: {}",distributionParcelListEntities); - log.info(">>>>>>>>>>>>>>>>>>>>>>>>>distributionParcelListEntity: {}",distributionParcelListEntity); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>>distributionParcelListEntities: {}", distributionParcelListEntities); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>>distributionParcelListEntity: {}", distributionParcelListEntity); // todo 查询签收信息 DistributionSignforEntity distributionSignfor = distributionSignforService.getByReservationId(distributionReservationStockarticleEntity.getReservationId()); - OrderStatusDTO orderStatusDTO = new OrderStatusDTO(); + OrderStatusDTO orderStatusDTO = new OrderStatusDTO(); orderStatusDTO.setUnitNo(distributionParcelListEntity.getOrderPackageCode()); //单号 orderStatusDTO.setUsername(distributionSignfor.getSigneeName()); //操作人名称 orderStatusDTO.setStatus("7"); orderStatusDTO.setOperationTime(distributionSignfor.getSigningTime()); //时间 ouPaiFactoryClinet.newSystemHandleStatusData(orderStatusDTO); - log.info(">>>>>>>>>>>>>>>>>进入newSystemHandleStatusData orderStatusDTO值 :{}",orderStatusDTO); + log.info(">>>>>>>>>>>>>>>>>进入newSystemHandleStatusData orderStatusDTO值 :{}", orderStatusDTO); } - } - - // orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO); } @@ -1589,11 +1574,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } //TODO 需要测试 + /** * 根据预约单查询预约单下面的订单下面的包件 * 并且状态为已签收的包件 + * * @param distributionReservationStockarticleEntity - * @return List + * @return List */ private List buildOpByReservationId(DistributionReservationStockarticleEntity distributionReservationStockarticleEntity) { Long stockArticleId = distributionReservationStockarticleEntity.getStockArticleId();//订单id @@ -1635,14 +1622,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { .distinct().collect(Collectors.joining(",")); distributionStockArticleService.maintenanceOrderInfo(orderCodes, warehouseId); - log.info(">>>>>> updatePackageDeliveryStatus,{}, {}",reservationId,packageIds); + log.info(">>>>>> updatePackageDeliveryStatus,{}, {}", reservationId, packageIds); //完成对该客户下此包件任务的取消 int row = distributionReservationMapper.updatePackageDeliveryStatus(reservationId, packageIds); //TODO 欠缺零担的资源释放 //维护预约订单状态 - distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId,warehouseId); + distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouseId); } //存在库存品信息 @@ -1677,37 +1664,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - private Map> handkeBrandsPackageList(String[] split, List distributionStockArticleEntities, Long warehouseId,Long reservationId,String deliveryCode) { - Map> packageList = new HashMap<>(); - Map> orderMap = distributionStockArticleEntities.stream().collect(Collectors.groupingBy(DistributionStockArticleEntity::getBrand)); - for (String s : split) { - orderMap.forEach((k,v)->{ - if (k.equals(s)){ - List mtReceiveContentDTOS = new ArrayList<>(); - for (DistributionStockArticleEntity distributionStockArticleEntity : v) { - List distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, distributionStockArticleEntity.getId(),warehouseId); - for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { - if (distributionParcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){ - String signingTime = distributionLoadscanMapper.selectPackageSigningTime(distributionParcelListEntity.getId()); - MtReceiveContentDTO mtReceiveContentDTO = new MtReceiveContentDTO(); - //查询签收时间 - mtReceiveContentDTO.setWarehouse(warehouseId.toString());//仓库Id - mtReceiveContentDTO.setOrderCode(distributionStockArticleEntity.getOrderCode());//仓库Id - mtReceiveContentDTO.setUnitNo(distributionParcelListEntity.getOrderPackageCode());//仓库Id - mtReceiveContentDTO.setOperateDate(signingTime);//操作时间 - mtReceiveContentDTO.setInvoiceOrderCode(deliveryCode);//发货编号 - mtReceiveContentDTOS.add(mtReceiveContentDTO); - } - } - } - packageList.put(s,mtReceiveContentDTOS); - } - }); - - } - return packageList; - } /** * 定制品 修改备货时间 @@ -1723,7 +1680,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { Long stockupId = stockupDTO.getStockupId(); //修改包件备货状态 DistributionParcelListEntity one = distributionParcelListService.getOne(Wrappers.query().lambda() - .eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()) + .eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()) ); //修改包件备货状态 DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); @@ -2096,7 +2053,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } boolean apj = false; - if (list.size() > 0) { + if (!list.isEmpty()) { //查询包件数量 // list.forEach(i -> { // List list1 = distributionParcelListService.list(Wrappers.query().lambda() @@ -2312,16 +2269,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, id)); boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue())); if (flag && stockArticleEntity.getTotalNumber() == parcelListEntityList.size()) { - assert stockArticleEntity != null; - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); } else { flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.daiyuyue.getValue())); if (flag) { - assert stockArticleEntity != null; - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); } else { - assert stockArticleEntity != null; - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); } } } else { @@ -2618,14 +2572,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { //修改 } } else { - if (i == 0) { + distributionStockup.setId(stockupDTO.getStockupId()); + if (i == 0) { //修改备货状态 - distributionStockup.setId(stockupDTO.getStockupId()); - distributionStockup.setStockupStatus(StockupStatusConstant.yibeihuo.getValue()); + distributionStockup.setStockupStatus(StockupStatusConstant.yibeihuo.getValue()); } else { //修改备货状态 - distributionStockup.setId(stockupDTO.getStockupId()); - distributionStockup.setStockupStatus(StockupStatusConstant.beihuozhong.getValue()); + distributionStockup.setStockupStatus(StockupStatusConstant.beihuozhong.getValue()); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java index a99bc0600..7f7b29ae6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java @@ -32,22 +32,17 @@ import com.logpm.distribution.vo.app.DistributionAppParcelListVO; import com.logpm.distribution.vo.app.DistributionAppStockArticleVO; import com.logpm.distribution.wrapper.DistributionDisStockListWrapper; import com.logpm.distribution.wrapper.DistributionParcelListWrapper; -import com.logpm.distribution.wrapper.DistributionStockArticleWrapper; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.loading.LoadingStatusConstant; import org.springblade.common.constant.order.OrderStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; -import org.springblade.common.constant.reservation.ReservationOrderStatusConstant; import org.springblade.common.exception.CustomerException; -import org.springblade.common.serviceConstant.ServiceConstant; import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.stereotype.Service; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -117,7 +112,6 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl parcelListEntityList = baseMapper.selectDistributionDeliverywrapInfoPage(page, reservationPackageDTO); List parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntityList); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); parcelListVOS.forEach(p -> { //查询扫描表, DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getPackageId, p.getId()).eq(DistributionLoadscanEntity::getOrderPackageCode, p.getOrderPackageCode())); @@ -334,7 +328,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl distributionStockListEntities = distributionStockListService.listByIds(stockListIds); Map stockListMap = distributionStockListEntities.stream().collect(Collectors.toMap(DistributionStockListEntity::getId, Function.identity(), (k1, k2) -> k2)); List disStockListDetailVOS = DistributionDisStockListWrapper.build().listVO(inventoryList); - disStockListDetailVOS.stream().forEach(sd -> { + disStockListDetailVOS.forEach(sd -> { //查询一次装车 如果装车了那么 DistributionLoadscaninvnEntity serviceOne = distributionLoadscaninvnService.getOne(Wrappers.query().lambda() .eq(DistributionLoadscaninvnEntity::getReservationId, distributionAppDeliveryListDTO.getReservationId()) 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 105c8793c..5c72e0c6c 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 @@ -758,7 +758,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl loadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()).ne(DistributionLoadscanEntity::getScanStatus, 1).eq(DistributionLoadscanEntity::getTrayNo, distrilbutionloadingscanDTO.getBarcode())); boolean trayLoadingStatus = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); log.info("#########!!!!!!!!!!!!!!!!!--------- 333333333 trayLoadingStatus={} loadscanEntityList={}", trayLoadingStatus, loadscanEntityList); - if (Func.isNotEmpty(loadscanEntityList) && loadscanEntityList.size() > 0 && trayLoadingStatus) { + if (Func.isNotEmpty(loadscanEntityList) && !loadscanEntityList.isEmpty() && trayLoadingStatus) { return Resp.scanFail("重复扫描", "重复扫描"); } log.info("#########!!!!!!!!!!!!!!!!!--------- 444444444 parcelListEntities={}", parcelListEntities); @@ -869,9 +869,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl k2)); } - SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); ArrayList distributionParcelListVOS = new ArrayList<>(); if (Func.isNotEmpty(reservationStockarticleEntityList)) { List orderIds = reservationStockarticleEntityList.stream().filter(order -> order.getIsZero().equals(IsOrNoConstant.no.getValue())).map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); @@ -4359,7 +4356,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDiscussStockArticleInfoList(Map params, Query query, Long deliveryListId) { - IPage page = Condition.getPage(query); //这里还需要查询出该配送任务下的订单信息,在进行编辑的时候进行回显 // String deliveryId = (String) params.get("deliveryId"); //查询出配送任务下的订单 @@ -5862,14 +5858,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl 0) { - zeroLoadscanEntity.setLoadedNub(0); - zeroLoadscanEntity.setPackageNub(0); - } else { - zeroLoadscanEntity.setLoadedNub(0); - zeroLoadscanEntity.setPackageNub(0); - zeroLoadscanEntity.setScanStatus(LoadingStatusConstant.quxiao.getValue()); - } + zeroLoadscanEntity.setLoadedNub(0); + zeroLoadscanEntity.setPackageNub(0); + if (num <= 0) { + zeroLoadscanEntity.setScanStatus(LoadingStatusConstant.quxiao.getValue()); + } distributionLoadscanService.updateById(zeroLoadscanEntity); //扣减装车数量 int a = distributionSignforMapper.deductionLoadingPacjageNum(zeroLoadscanEntity.getReservationId(), zeroLoadscanEntity.getDeliveryId(), retentionQuantity); @@ -6304,7 +6297,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl> spaclStockList = buildSpaclOrders(distributionReservationEntity, 2); - if (spaclStockList.size() > 0 && !spaclStockList.isEmpty()) { + if (!spaclStockList.isEmpty() ) { map.put("库存品集合", spaclStockList); Integer spaclStockNum = 0; for (Map m : spaclStockList) { @@ -6640,13 +6633,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl inventoryNumberDetail = deliverySigningInventoryNumberDetail(disStockListDetailEntities); if (Func.isNotEmpty(inventoryNumberDetail)) { - detailDTOS.addAll(inventoryNumberDetail); + assert inventoryNumberDetail != null; + detailDTOS.addAll(inventoryNumberDetail); } } //签收数量 @@ -1861,12 +1854,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl listDetailEntities = distributionDeliveryListMapper.selectInventoryListByDeliveryListId(distrilbutionloadingscanDTO.getReservationId()); List deliveryInventory = listDetailEntities.stream().filter(inv -> inv.getStockPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList()); @@ -2887,7 +2879,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionLoadscanEntity::getReservationId, distributionLoadscanAbnormalEntity.getReservationId()) .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanAbnormalEntity.getDeliveryListId()) @@ -3553,7 +3523,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl loadscanAbnormalEntities = distributionLoadscanAbnormalEntities.stream().filter(a -> a.getAuditingStatus().equals(1)).collect(Collectors.toList()); - if (loadscanAbnormalEntities.size() > 0) { + if (!loadscanAbnormalEntities.isEmpty()) { //存在有未审批的异常包件 loadscanAbnormalEntities.forEach(a -> { DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(a.getReservationId()); @@ -3592,23 +3562,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl> prices(DistributionSignforDTO distributionSignfor) { log.info("==========回显图片的值:{}", distributionSignfor); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 6c2290eb7..fb9a54b45 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -65,7 +65,6 @@ import org.springblade.common.constant.stocklist.StockStatusConstant; import org.springblade.common.constant.stockup.StockAssignStatusConstant; import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.constant.stockup.StockupTypeConstant; -import org.springblade.common.constant.stockup.StockupTypeStatusConstant; import org.springblade.common.exception.CustomerException; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; @@ -144,8 +143,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl ii.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.daiyuyue.getValue())).collect(Collectors.toList()).stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); if(sum == 0){ - log.debug("####{}当前订单备货包件为空,无法创建任务!"+byId.getOrderCode()); + log.debug("####{}当前订单备货包件为空,无法创建任务!",byId.getOrderCode()); throw new ServiceException(byId.getOrderCode()+"当前订单备货包件为空,无法创建任务!"); } } @@ -413,7 +413,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl{ + list1.forEach(ss ->{ Optional first1 = list.stream().filter(q -> q.getParceListId().equals(ss.getId())).findFirst(); if(!first1.isPresent()){ DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity(); @@ -654,7 +654,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl getInventoryOwn(IPage page, long id) { IPage l = new Page<>(); IPage inventoryOwn = baseMapper.getInventoryOwn(page, id); - if (inventoryOwn.getRecords().size() > 0) { + if (!inventoryOwn.getRecords().isEmpty()) { //查询库存品 inventoryOwn.getRecords().forEach(i -> { //是否备货 @@ -1311,15 +1311,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0 && i.getQuantity() > list.size()) { + if (!list.isEmpty() && i.getQuantity() > list.size()) { s = "备货中"; - } else if (list.size() > 0 && i.getQuantity() == list.size()) { + } else if (!list.isEmpty() && i.getQuantity() == list.size()) { s = "备货完成"; } else { s = "未备货"; } i.setStockUp(s); - i.setNumber(list.size() > 0 ? list.size() : 0); + i.setNumber(Math.max(list.size(), 0)); }); return inventoryOwn; } else { @@ -1357,7 +1357,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list4 = distributionDeliveryChargeService.list(Wrappers.query().lambda() .eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLadingEntity.getId()) ); - detailOne.setChargeList(list4.size() > 0 ? list4 : null); + detailOne.setChargeList(!list4.isEmpty() ? list4 : null); //查询提货信息 List list = distrilbutionBillStockService.list(Wrappers.query().lambda() .eq(DistrilbutionBillStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) @@ -1366,7 +1366,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl { List list2 = distributionStockArticleService.list(Wrappers.query().lambda().eq(DistributionStockArticleEntity::getId, i.getStockArticleId())); - if (list2.size() > 0) { + if (!list2.isEmpty()) { list1.addAll(DistributionStockArticleWrapper.build().listVO(list2)); } @@ -1871,7 +1871,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelNumberEntityList = new ArrayList<>(); AtomicInteger nu = new AtomicInteger(); //是 添加物料信息 - list.stream().forEach(i -> { + list.forEach(i -> { if(i.getQuantity() != 0){ DistributionReservationZeroPackageEntity zeroPackageEntity = new DistributionReservationZeroPackageEntity(); zeroPackageEntity.setQuantity(i.getQuantity()); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java index c6f6105ec..45d4673e9 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java @@ -87,7 +87,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient { dto.setOrderPackageCode(orderPackageCode); upShelfPackageList.add(dto); } - if(upShelfPackageList.size() > 0){ + if(!upShelfPackageList.isEmpty()){ return warehouseUpdownTypeService.downPackageOrDelTray(upShelfPackageList,warehouseId); }else{ return R.fail(403,"处理失败");