diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java index d14a0b592..b450bd648 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java @@ -347,4 +347,10 @@ public class DistributionLoadscanEntity extends TenantEntity { */ @ApiModelProperty(value = "是否异常装车 1-否 2-是") private Integer isAbnormalLoading; + + /** + * 是否异常装车 1-否 2-是 + */ + @ApiModelProperty(value = "是否异常装车 1-否 2-是") + private Integer isZero; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index 96c25d516..06a242331 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -500,6 +500,14 @@ public class DistributionDeliveryListController extends BladeController { return r; } + @PostMapping("/deliveryZeroPackage") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "PC签收包件") + public R deliveryZeroPackage(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) { + R r = distributionSignforService.signforZeroPC(distrilbutionloadingscanDTO); + return r; + } + @PostMapping("/cancelDelivery") diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionAppsignforDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionAppsignforDTO.java index 41a282e7b..bbd5d01a5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionAppsignforDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionAppsignforDTO.java @@ -42,6 +42,13 @@ public class DistrilbutionAppsignforDTO { // @NotEmpty(message = "客户Id不能为空") private Long reservationId; + /** + * 预约Id + */ + @ApiModelProperty(value = "预约Id") +// @NotEmpty(message = "客户Id不能为空") + private String zeroPackageIds; + /** * 预约Id */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java index 12726e329..c6c40064e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java @@ -57,4 +57,12 @@ public interface DistributionParcelNumberMapper extends BaseMapper selectZeroPackage(@Param("stockArticleId") Long id); + + /** + * 查询零担订单包件信息 + * @param orderCode + * @param warehouseId + * @return + */ + List selectParcelNumber(String orderCode, Long warehouseId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml index 51c448fe6..f19549a97 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml @@ -55,6 +55,16 @@ WHERE ldpl.stock_article_id = #{stockArticleId} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index cebec8d34..d7d1372cf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -197,4 +197,10 @@ public interface IDistributionParcelListService extends BaseService findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus); + /** + * 维护零担包件信息 + * @param parcelListId + * @param warehouseId + */ + void maintenanceZeroPackageInfo(Long parcelListId, Long warehouseId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java index 76d7d9b03..3b8f67ca6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java @@ -291,4 +291,12 @@ public interface IDistributionSignforService extends BaseServicequery().lambda() + .eq(DistributionParcelNumberEntity::getParcelListId, parcelListEntity.getId()) + ); + if ((distributionParcelNumberEntity.getDeliveryQuantity() + distributionParcelNumberEntity.getOutboundQuantity())== parcelListEntity.getQuantity()){ + parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); + } + if (distributionParcelNumberEntity.getOutboundQuantity() == parcelListEntity.getQuantity()){ + parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); + parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); + } + if (distributionParcelNumberEntity.getSigninQuantity() == parcelListEntity.getQuantity()){ + parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); + }else if (distributionParcelNumberEntity.getSigninQuantity() > 0){ + parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.bufenqianshou.getValue()); + } + this.updateById(parcelListEntity); + } + + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 6c34c7517..ba733cb7b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -2239,9 +2239,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl 0) { list.forEach(l -> { if (l.getHandQuantity() > 0) { + l.setReservationNum(l.getHandQuantity()); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); distributionReservationZeroPackageEntity.setZeroPackageStatus(ReservationOrderStatusConstant.zhengchang.getValue()); - distributionReservationZeroPackageEntity.setQuantity(l.getHandQuantity() - l.getDeliveryQuantity() - l.getOutboundQuantity()); + distributionReservationZeroPackageEntity.setQuantity(l.getHandQuantity()); distributionReservationZeroPackageEntity.setStockArticleId(s.getId()); distributionReservationZeroPackageEntity.setReservationId(reservationEntity.getId()); distributionReservationZeroPackageEntity.setType(DistributionTypeConstant.shangpei.getValue()); @@ -2249,12 +2250,18 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl list = Func.toLongList(zeroPackageIds); + BladeUser user = AuthUtil.getUser(); + //查询零担计划 + List reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.query().lambda() + .eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId) + .in(DistributionReservationZeroPackageEntity::getParcelListId, list) + .ne(DistributionReservationZeroPackageEntity::getParcelListId, ReservationPackageStatusConstant.quxiao.getValue()) + ); + if (Func.isEmpty(reservationZeroPackageEntities)){ + log.error(method+"预约单异常reservationId:{}",reservationId); + return R.fail("请联系管理员"); + } + DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId()); + if (Func.isEmpty(deliveryListEntity)){ + log.error(method+"配送单异常deliveryId:{}",distrilbutionloadingscanDTO.getDeliveryId()); + return R.fail("请联系管理员"); + } + String driverName = ""; + String driverPhone = ""; + String vehicleNub = ""; + Long loadingId = null; + //查询该车次负责司机 + if ("1".equals(deliveryListEntity.getKind())){ + //自主配送 + List deliverySelfInfo = distributionDeliverySelfMapper.getDeliverySelfInfo(deliveryListEntity.getId()); + driverPhone = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverPhone).collect(Collectors.joining(",")); + driverName = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverName).collect(Collectors.joining(",")); + vehicleNub = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getVehicleNub).collect(Collectors.joining(",")); + List collect = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getId).collect(Collectors.toList()); + loadingId = collect.get(0); + }else if ("2".equals(deliveryListEntity.getKind())){ + //外协 + }else { + log.error(method+"配送司机异常:{}",distrilbutionloadingscanDTO.getDeliveryId()); + return R.fail("请联系管理员"); + } + + for (DistributionReservationZeroPackageEntity reservationZeroPackageEntity : reservationZeroPackageEntities) { + //查询订单 + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(reservationZeroPackageEntity.getStockArticleId()); + //查询零担包件详情 + DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.query().lambda() + .eq(DistributionParcelNumberEntity::getParcelListId, reservationZeroPackageEntity.getParcelListId()) + ); + //在库数 + int a =0; + //签收数 + int b =0; + //出库数 + int c =0; + //冻结数 + int d =0; + DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getReservationId, reservationId) + .in(DistributionLoadscanEntity::getPackageId, list) + .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + ); + if (Func.isEmpty(loadscanEntity)){ + a = distributionParcelNumberEntity.getHandQuantity() - reservationZeroPackageEntity.getQuantity(); + b = distributionParcelNumberEntity.getSigninQuantity() + reservationZeroPackageEntity.getQuantity(); + c = distributionParcelNumberEntity.getOutboundQuantity() + reservationZeroPackageEntity.getQuantity(); + d = distributionParcelNumberEntity.getDeliveryQuantity() - reservationZeroPackageEntity.getQuantity(); + //未进行装车操作 + DistributionLoadscanEntity unLoadscanEntity = new DistributionLoadscanEntity(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss"); + unLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue()); + unLoadscanEntity.setIsInsert(2); + unLoadscanEntity.setLoadingId(loadingId.toString()); + unLoadscanEntity.setOrderId(reservationZeroPackageEntity.getStockArticleId()); + unLoadscanEntity.setPackageId(reservationZeroPackageEntity.getParcelListId()); + unLoadscanEntity.setReservationId(reservationId); + unLoadscanEntity.setIsSignfor(1); + unLoadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); + unLoadscanEntity.setScanUser(user.getNickName()); + unLoadscanEntity.setIsAbnormalSigning(1); + unLoadscanEntity.setIsAbnormalLoading(1); + unLoadscanEntity.setIsZero(1); + unLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); + unLoadscanEntity.setVehicleId(deliveryListEntity.getVehicleId()); + unLoadscanEntity.setVehicleName(vehicleNub); + unLoadscanEntity.setDriverId(deliveryListEntity.getDriverId()); + unLoadscanEntity.setDriverName(driverName); + unLoadscanEntity.setDriverPhone(driverPhone); + unLoadscanEntity.setLoadingId(driverPhone); + unLoadscanEntity.setScanType(LoadingStatusConstant.buluzhuangche.getValue()); + unLoadscanEntity.setScanTime(simpleDateFormat.format(new Date())); + unLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date(System.currentTimeMillis() + (6 * 1000)))); + unLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); + unLoadscanEntity.setSigningUserId(user.getUserId()); + unLoadscanEntity.setSigningUser(user.getNickName()); + unLoadscanEntity.setIsSignfor(2); + unLoadscanEntity.setSignforState(2); +// loadscanEntity.setSigningTime(new Date().toString()); + unLoadscanEntity.setReceivedQuantity(reservationZeroPackageEntity.getQuantity()); + unLoadscanEntity.setLoadedNub(reservationZeroPackageEntity.getQuantity()); + unLoadscanEntity.setPackageNub(reservationZeroPackageEntity.getQuantity()); + unLoadscanEntity.setOneClick(1); + unLoadscanEntity.setOneQclick(1); + unLoadscanEntity.setMsg("文员进行零担订单装车和签收补录"); + distributionLoadscanService.save(unLoadscanEntity); + //更新装车和签收数量 + Integer i = distributionSignforMapper.updateSignforByReservationId(unLoadscanEntity.getDeliveryId(), unLoadscanEntity.getReservationId(), unLoadscanEntity.getReceivedQuantity()); + //更新装车时间 + Integer j = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); + //更新零担包件的数量 + distributionParcelNumberEntity.setHandQuantity(a); + distributionParcelNumberEntity.setSigninQuantity(b); + distributionParcelNumberEntity.setOutboundQuantity(c); + distributionParcelNumberEntity.setDeliveryQuantity(d); + }else { + a = distributionParcelNumberEntity.getHandQuantity() + loadscanEntity.getLoadedNub() - reservationZeroPackageEntity.getQuantity(); + b = distributionParcelNumberEntity.getSigninQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntity.getQuantity(); + c = distributionParcelNumberEntity.getOutboundQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntity.getQuantity(); + d = distributionParcelNumberEntity.getDeliveryQuantity() + loadscanEntity.getReceivedQuantity() - reservationZeroPackageEntity.getQuantity(); + //存在装车操作 + loadscanEntity.setSigningUser(user.getNickName()); + loadscanEntity.setIsSignfor(2); + loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); +// loadscanEntity.setSigningTime(new Date().toString()); + loadscanEntity.setReceivedQuantity(reservationZeroPackageEntity.getQuantity()); + loadscanEntity.setLoadedNub(reservationZeroPackageEntity.getQuantity()); + loadscanEntity.setPackageNub(reservationZeroPackageEntity.getQuantity()); + loadscanEntity.setMsg("文员进行签收补录"); + distributionLoadscanService.updateById(loadscanEntity); + distributionParcelNumberEntity.setHandQuantity(a); + distributionParcelNumberEntity.setSigninQuantity(b); + distributionParcelNumberEntity.setOutboundQuantity(c); + distributionParcelNumberEntity.setDeliveryQuantity(d); + + } + distributionParcelListService.maintenanceZeroPackageInfo(distributionParcelNumberEntity.getParcelListId(),stockArticleEntity.getWarehouseId()); + + distributionParcelNumberService.updateById(distributionParcelNumberEntity); + //维护订单 + distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId()); + } + //维护配送单信息 + deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); + distributionDeliveryListService.updateById(deliveryListEntity); + + //查询计划和是否进行装车 + return R.success("操作成功"); + } + private List handleStockUp(DistributionStockupEntity distributionStockupEntity) { List nodeVos = new ArrayList<>(); try { @@ -2617,8 +2778,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl listDetailEntities = distributionDeliveryListMapper.selectInventoryListByDeliveryListId(distrilbutionloadingscanDTO.getReservationId()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index c0b38fea3..86d1a03be 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -110,7 +110,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl idArr = null; - if (null != ids && !ids.toString().equals("")){ + if (null != ids && !ids.toString().equals("")) { idArr = Arrays.asList(paramMap.get("ids").toString().split(",")); } @@ -171,7 +173,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl list = baseMapper.exportDistributionStockArticle(paramMap, idArr); List excelList = new ArrayList<>(); - if (list.size()>61){ + if (list.size() > 61) { list.parallelStream().forEach(li -> { li.setCreateUserName(userClient.userInfoById(li.getCreateUser()).getData().getName()); DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(li); @@ -182,10 +184,10 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl { li.setCreateUserName(userClient.userInfoById(li.getCreateUser()).getData().getName()); DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(li); @@ -196,7 +198,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl 0) { list1.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getMaterialId)) - .forEach((k ,v) ->{ - int sum = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); - v.stream().forEach( i -> { - //查询有没有打托数据 - - - - //查询包件有没有物料 - List list = distributionParcelDetailsService.list(Wrappers.query().lambda() - .eq(DistributionParcelDetailsEntity::getParcelListId, i.getId()) - ); - if (list.size() > 0) { - //有 - list.stream().collect(Collectors.groupingBy(DistributionParcelDetailsEntity::getEncoded)) - .forEach((kk,vv) ->{ - DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); - BeanUtil.copyProperties(vv.get(0),parcelListEntity); - parcelListEntity.setQuantity(sum); - parcelListEntity.setMaterialName(vv.get(0).getName()); - parcelListEntity.setMaterialCode(vv.get(0).getEncoded()); - parcelListEntity.setMaterialUnit(vv.get(0).getUnit()); - //查询在库订单信息 - DistributionStockArticleEntity distributionStockArticleEntity = baseMapper.selectById(parcelListEntity.getStockArticleId()); - if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId()) ) { - throw new ServiceException("订单的客户数据异常,无法转换!!"); - } - // 添加库存品信息 - addStockList(distributionStockArticleEntity,parcelListEntity, 1); - }); - } - DistributionParcelListEntity parcelList = new DistributionParcelListEntity(); - parcelList.setId(i.getId()); - parcelList.setConditions(2); - distributionParcelListService.updateById(parcelList); - - }); - DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); - BeanUtil.copyProperties(v.get(0),parcelListEntity); - parcelListEntity.setQuantity(sum); - //查询在库订单信息 - DistributionStockArticleEntity distributionStockArticleEntity = baseMapper.selectById(parcelListEntity.getStockArticleId()); - if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId()) ) { - throw new ServiceException("订单的客户数据异常,无法转换!!"); - } - // 添加库存品信息 - addStockList(distributionStockArticleEntity,parcelListEntity, 1); - }); + .forEach((k, v) -> { + int sum = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); + v.stream().forEach(i -> { + //查询有没有打托数据 + //查询包件有没有物料 + List list = distributionParcelDetailsService.list(Wrappers.query().lambda() + .eq(DistributionParcelDetailsEntity::getParcelListId, i.getId()) + ); + if (list.size() > 0) { + //有 + list.stream().collect(Collectors.groupingBy(DistributionParcelDetailsEntity::getEncoded)) + .forEach((kk, vv) -> { + DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); + BeanUtil.copyProperties(vv.get(0), parcelListEntity); + parcelListEntity.setQuantity(sum); + parcelListEntity.setMaterialName(vv.get(0).getName()); + parcelListEntity.setMaterialCode(vv.get(0).getEncoded()); + parcelListEntity.setMaterialUnit(vv.get(0).getUnit()); + //查询在库订单信息 + DistributionStockArticleEntity distributionStockArticleEntity = baseMapper.selectById(parcelListEntity.getStockArticleId()); + if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) { + throw new ServiceException("订单的客户数据异常,无法转换!!"); + } + // 添加库存品信息 + addStockList(distributionStockArticleEntity, parcelListEntity, 1); + }); + } + DistributionParcelListEntity parcelList = new DistributionParcelListEntity(); + parcelList.setId(i.getId()); + parcelList.setConditions(2); + distributionParcelListService.updateById(parcelList); + + }); + DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); + BeanUtil.copyProperties(v.get(0), parcelListEntity); + parcelListEntity.setQuantity(sum); + //查询在库订单信息 + DistributionStockArticleEntity distributionStockArticleEntity = baseMapper.selectById(parcelListEntity.getStockArticleId()); + if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) { + throw new ServiceException("订单的客户数据异常,无法转换!!"); + } + // 添加库存品信息 + addStockList(distributionStockArticleEntity, parcelListEntity, 1); + }); // list1.forEach(i -> { @@ -450,10 +450,10 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl { DistributionStockArticleEntity distributionStockArticleEntity = this.baseMapper.selectById(id); - if (Func.isNotEmpty(distributionStockArticleEntity)){ + if (Func.isNotEmpty(distributionStockArticleEntity)) { DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(distributionStockArticleEntity); List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, distributionStockArticleEntity.getId())); distributionStockArticleVO.setParcelListVOS(DistributionParcelListWrapper.build().listVO(parcelListEntityList)); @@ -599,13 +599,13 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl> selectStockArticleAndParcel(Map query) { List distributionStockArticleVOList = distributionStockArticleMapper.getAllReservationStockArticleInfo(query); ArrayList distributionStockArticleVOS = new ArrayList<>(); - distributionStockArticleVOList.forEach(s->{ + distributionStockArticleVOList.forEach(s -> { DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(s); QueryWrapper parcelListVOQueryWrapper = new QueryWrapper<>(); - parcelListVOQueryWrapper.lambda().eq(DistributionParcelListEntity::getStockArticleId,s.getId()); + parcelListVOQueryWrapper.lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()); List distributionParcelListEntityList = distributionParcelListService.getBaseMapper().selectList(parcelListVOQueryWrapper); ArrayList parcelListVOS = new ArrayList<>(); - distributionParcelListEntityList.forEach(d->{ + distributionParcelListEntityList.forEach(d -> { parcelListVOS.add(DistributionParcelListWrapper.build().entityVO(d)); }); distributionStockArticleVO.setParcelListVOS(parcelListVOS); @@ -668,9 +668,6 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl getPrintTemplates(Map params, HttpServletResponse response) { String templateByUrl = null; @@ -718,20 +715,20 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl map = JSONObject.parseObject(JSONObject.toJSONString(orderNoList), Map.class); - map.put("id",id); + map.put("id", id); String filename = QRCodeUtil.createCodeToFile(orderNoList.getQrCode()); map.put("img", QRCodeUtil.getEmpAutograph(filename)); // 订单号 生成二维码 @@ -748,14 +745,14 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl handlePackage(IPage pageVO) { - pageVO.getRecords().forEach(s->{ + pageVO.getRecords().forEach(s -> { // List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda() // .eq(DistributionParcelListEntity::getStockArticleId, s.getId()) // .ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())); - if (s.getIsZero().equals(IsOrNoConstant.no.getValue())){ + if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) { List parcelListEntities = distributionParcelListMapper.getPackageList(s.getId()); s.setParcelListVOS(DistributionParcelListWrapper.build().listVO(parcelListEntities)); - }else { + } else { //查询当前可操作的零担品类数量 List distributionParcelNumberVOS = distributionParcelNumberMapper.selectZeroPackage(s.getId()); s.setParcelNumberVOS(distributionParcelNumberVOS); @@ -769,16 +766,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl fingListByServiceNumber(String serviceNumber,Long warehouseId) { - return baseMapper.fingListByServiceNumber(serviceNumber,warehouseId); + public List fingListByServiceNumber(String serviceNumber, Long warehouseId) { + return baseMapper.fingListByServiceNumber(serviceNumber, warehouseId); } @Override public List findListByWaybillNumber(String waybillNumber) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("waybill_number",waybillNumber) - .eq("is_zero","1") - .eq("is_deleted",0); + queryWrapper.eq("waybill_number", waybillNumber) + .eq("is_zero", "1") + .eq("is_deleted", 0); return baseMapper.selectList(queryWrapper); } @@ -798,44 +795,45 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl queryWrapper = Condition.getQueryWrapper(distributionStockArticle, DistributionStockArticleEntity.class); - if(Func.isNotEmpty(reservation)){ - queryWrapper.in("reservation_status","10"); + if (Func.isNotEmpty(reservation)) { + queryWrapper.in("reservation_status", "10"); } - if(Func.isNotEmpty(orderCodeNum)){ + if (Func.isNotEmpty(orderCodeNum)) { String anumbering = orderCodeNum.toString(); List list = CommonUtil.stringNum(anumbering); - if(list.size() > 1){ - queryWrapper.in("order_code",list); - }else{ - queryWrapper.like("order_code",anumbering); + if (list.size() > 1) { + queryWrapper.in("order_code", list); + } else { + queryWrapper.like("order_code", anumbering); } } - if(Func.isNotEmpty(waybillNum)){ + if (Func.isNotEmpty(waybillNum)) { String waybill = waybillNum.toString(); List list = CommonUtil.stringNum(waybill); - if(list.size() > 1){ - queryWrapper.in("waybill_number",list); - }else{ - queryWrapper.like("waybill_number",waybill); + if (list.size() > 1) { + queryWrapper.in("waybill_number", list); + } else { + queryWrapper.like("waybill_number", waybill); } } - if(ObjectUtil.isNotEmpty(d)){ - String ids = d.toString(); - queryWrapper.in("id",CommonUtil.stringNum(ids)); + if (ObjectUtil.isNotEmpty(d)) { + String ids = d.toString(); + queryWrapper.in("id", CommonUtil.stringNum(ids)); } - if(ObjectUtil.isNotEmpty(o2)){ - queryWrapper.between("warehouse_entry_time",o2,o1); + if (ObjectUtil.isNotEmpty(o2)) { + queryWrapper.between("warehouse_entry_time", o2, o1); } List myWarehouseList = warehouseClient.getMyWatchWarehouse(); List collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); //if(ObjectUtil.isNotEmpty(collect)){ - queryWrapper.in(collect.size()>0,"warehouse_id",collect); - // } + queryWrapper.in(collect.size() > 0, "warehouse_id", collect); + // } return this.page(page, queryWrapper); } /** * 自己 的列表查询 + * * @param page * @param distributionStockArticle * @return @@ -843,30 +841,30 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl pageListOwe(IPage page, Map distributionStockArticle) { DistributionStockArticleOweDTO stockArticleEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionStockArticle), DistributionStockArticleOweDTO.class); - if(Func.isNotEmpty(stockArticleEntity.getOrderCodeNum())){ + if (Func.isNotEmpty(stockArticleEntity.getOrderCodeNum())) { String anumbering = stockArticleEntity.getOrderCodeNum().trim(); List list = CommonUtil.stringNum(anumbering); - if(list.size() > 1){ + if (list.size() > 1) { stockArticleEntity.setOrderCodeNumList(list); - }else{ + } else { stockArticleEntity.setOrderCodeNumLike(anumbering); } } - if(Func.isNotEmpty(stockArticleEntity.getWaybillNum())){ + if (Func.isNotEmpty(stockArticleEntity.getWaybillNum())) { String waybill = stockArticleEntity.getWaybillNum().trim(); List list = CommonUtil.stringNum(waybill); - if(list.size() > 1){ + if (list.size() > 1) { stockArticleEntity.setWaybillNumList(list); - }else{ + } else { stockArticleEntity.setWaybillNumLike(waybill); } } - if(ObjectUtil.isNotEmpty(stockArticleEntity.getIds())){ - String ids = stockArticleEntity.getIds().trim(); + if (ObjectUtil.isNotEmpty(stockArticleEntity.getIds())) { + String ids = stockArticleEntity.getIds().trim(); List list = CommonUtil.stringNum(ids); - if(list.size() > 1){ + if (list.size() > 1) { stockArticleEntity.setIdsList(list); - }else{ + } else { stockArticleEntity.setIdsLike(ids); } } @@ -877,13 +875,13 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl myWarehouseList = warehouseClient.getMyWatchWarehouse(); List collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); - if(collect.size() > 1){ + if (collect.size() > 1) { stockArticleEntity.setWarehouseIdList(collect); - }else if(collect.size() == 1){ + } else if (collect.size() == 1) { stockArticleEntity.setWarehouseId(collect.get(0)); } IPage distributionStockArticleEntityIPage = baseMapper.pageListOwe(page, stockArticleEntity); - distributionStockArticleEntityIPage.getRecords().stream().forEach(i ->{ + distributionStockArticleEntityIPage.getRecords().stream().forEach(i -> { /* DistributionStockArticleEntity distributionStockArticleEntity = baseMapper.getStockArticleQueryQuantity(i.getId()); i.setDeliveryQuantity(distributionStockArticleEntity.getDeliveryQuantity()); List list = distributionParcelListService.list(Wrappers.query().lambda() @@ -891,7 +889,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl trayList = warehouseTrayGoodsClient.getTrayList(warehouseTrayGoods); - if(!trayList.isEmpty()){ + if (!trayList.isEmpty()) { String collect1 = trayList.stream().map(WarehouseTrayGoodsEntity::getTrayCode).collect(Collectors.joining(",")); i.setTrays(collect1); } @@ -910,7 +908,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl information = warehouseUpdownGoodsClient.getLocationStockListInformation(updownGoodsEntity); - if(ObjectUtils.isNotNull(information) && !information.isEmpty()){ + if (ObjectUtils.isNotNull(information) && !information.isEmpty()) { String collect1 = information.stream().map(WarehouseUpdownGoodsEntity::getPositionCode).collect(Collectors.joining(",")); i.setAllocation(collect1); } @@ -925,14 +923,13 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl distributionStockArticle, Query query) { // IPage page = Condition.getPage(query); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ + if (Func.isEmpty(myCurrentWarehouse)) { return R.fail("无仓库信息!!!"); } // List stockArticleEntityList = baseMapper.selectAllDistributionOrder(); // Map> collect = stockArticleEntityList.stream().collect(Collectors.groupingBy(DistributionStockArticleEntity::getId)); - Object orderCodeNum = distributionStockArticle.get("orderCodeNum"); distributionStockArticle.remove("orderCodeNum"); Object waybillNum = distributionStockArticle.get("waybillNum"); @@ -957,84 +954,85 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl queryWrapper = Condition.getQueryWrapper(distributionStockArticle, DistributionStockArticleEntity.class); LambdaQueryWrapper lambda = Wrappers.query().lambda(); - queryWrapper.ne("reservation_status","30"); - queryWrapper.lambda().eq(DistributionStockArticleEntity::getWarehouseId,myCurrentWarehouse.getId()); - if(Func.isNotEmpty(o)){ - queryWrapper.in("order_code",String.valueOf(o).split(",")); + queryWrapper.ne("reservation_status", "30"); + queryWrapper.lambda().eq(DistributionStockArticleEntity::getWarehouseId, myCurrentWarehouse.getId()); + if (Func.isNotEmpty(o)) { + queryWrapper.in("order_code", String.valueOf(o).split(",")); } - if(Func.isNotEmpty(reservationStatus)){ - queryWrapper.eq("reservation_status",reservationStatus); + if (Func.isNotEmpty(reservationStatus)) { + queryWrapper.eq("reservation_status", reservationStatus); } - if(Func.isNotEmpty(warehouseEntryTime)){ - queryWrapper.apply("datediff(warehouse_entry_time,{0} ) = 0",warehouseEntryTime); + if (Func.isNotEmpty(warehouseEntryTime)) { + queryWrapper.apply("datediff(warehouse_entry_time,{0} ) = 0", warehouseEntryTime); } - if(Func.isNotEmpty(freezeStatus)){ - queryWrapper.eq("freeze_status",freezeStatus); + if (Func.isNotEmpty(freezeStatus)) { + queryWrapper.eq("freeze_status", freezeStatus); } - if(Func.isNotEmpty(completeSet)){ - queryWrapper.eq("complete_set",completeSet); + if (Func.isNotEmpty(completeSet)) { + queryWrapper.eq("complete_set", completeSet); } - if(ObjectUtil.isNotEmpty(d)){ - queryWrapper.in("id",String.valueOf(d).split(",")); + if (ObjectUtil.isNotEmpty(d)) { + queryWrapper.in("id", String.valueOf(d).split(",")); } - if(ObjectUtil.isNotEmpty(o2)){ - queryWrapper.between("warehouse_entry_time",o2,o1); + if (ObjectUtil.isNotEmpty(o2)) { + queryWrapper.between("warehouse_entry_time", o2, o1); } - if(Func.isNotEmpty(orderIds)){ - queryWrapper.notIn(Func.isNotEmpty(orderIds),"id",Func.toLongList(orderIds)); + if (Func.isNotEmpty(orderIds)) { + queryWrapper.notIn(Func.isNotEmpty(orderIds), "id", Func.toLongList(orderIds)); } // if(Func.isNotEmpty(orderIds)){ // queryWrapper.notIn("id",Func.toLongList(orderIds)); // } - if(Func.isNotEmpty(customerName)){ - queryWrapper.like("customer_name",customerName); + if (Func.isNotEmpty(customerName)) { + queryWrapper.like("customer_name", customerName); } - if(Func.isNotEmpty(customerTelephone)){ - queryWrapper.like("customer_telephone",customerTelephone); + if (Func.isNotEmpty(customerTelephone)) { + queryWrapper.like("customer_telephone", customerTelephone); } - if(Func.isNotEmpty(orderCodeNum)){ + if (Func.isNotEmpty(orderCodeNum)) { String anumbering = orderCodeNum.toString(); List list = CommonUtil.stringNum(anumbering); - if(list.size() > 1){ - queryWrapper.in("order_code",list); - }else{ - queryWrapper.like("order_code",anumbering); + if (list.size() > 1) { + queryWrapper.in("order_code", list); + } else { + queryWrapper.like("order_code", anumbering); } } - if(Func.isNotEmpty(waybillNum)){ + if (Func.isNotEmpty(waybillNum)) { String waybill = waybillNum.toString(); List list = CommonUtil.stringNum(waybill); - if(list.size() > 1){ - queryWrapper.in("waybill_number",list); - }else{ - queryWrapper.like("waybill_number",waybill); + if (list.size() > 1) { + queryWrapper.in("waybill_number", list); + } else { + queryWrapper.like("waybill_number", waybill); } } IPage pages = this.page(Condition.getPage(query), queryWrapper); - IPage distributionStockArticleVOIPage = this.handlePackage(DistributionStockArticleWrapper.build().pageVO(pages)); + IPage distributionStockArticleVOIPage = this.handlePackage(DistributionStockArticleWrapper.build().pageVO(pages)); return R.data(distributionStockArticleVOIPage); } @Override public queryOrderVO queryOrder(queryOrderDTO queryrderDTO) { - queryOrderVO queryOrderVO =new queryOrderVO(); + queryOrderVO queryOrderVO = new queryOrderVO(); //查询类型 - switch (queryrderDTO.getType()){ + switch (queryrderDTO.getType()) { case 1: //查询包条 - queryOrderVO = this.queryOrderVOCont(queryrderDTO.getCondition(),1); + queryOrderVO = this.queryOrderVOCont(queryrderDTO.getCondition(), 1); break; case 2: //查询订单 - queryOrderVO = this.queryOrderVOCont(queryrderDTO.getCondition(),2); + queryOrderVO = this.queryOrderVOCont(queryrderDTO.getCondition(), 2); break; - }; + } + ; return queryOrderVO; } @Override - public queryOrderVO queryOrderVOCont(String condition,Integer i) { + public queryOrderVO queryOrderVOCont(String condition, Integer i) { //获取当前登录人仓库 List myWarehouseList = warehouseClient.getMyWatchWarehouse(); List collect = myWarehouseList.stream() @@ -1042,22 +1040,22 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl distributionParcelListEntitys = distributionParcelListMapper.selectListByOderId(id,collect); + List distributionParcelListEntitys = distributionParcelListMapper.selectListByOderId(id, collect); //查询订单下的所有库存品 - List distributionStockListVOS = distributionParcelListMapper.selectStockListByOderId(id,collect); + List distributionStockListVOS = distributionParcelListMapper.selectStockListByOderId(id, collect); queryOrderVO.setWrapNum(distributionParcelListEntitys.size()); - queryOrderVO.setInventoryNum(distributionStockListVOS.size()); + queryOrderVO.setInventoryNum(distributionStockListVOS.size()); queryOrderVO.setList(distributionParcelListEntitys); queryOrderVO.setStockList(distributionStockListVOS); return queryOrderVO; @@ -1072,62 +1070,63 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl selectAllDistributionOrder(IPage page, Map distributionStockArticle) { BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ - log.error("##################当前用户仓库信息有误:{}",myCurrentWarehouse); + if (Func.isEmpty(myCurrentWarehouse)) { + log.error("##################当前用户仓库信息有误:{}", myCurrentWarehouse); return null; } DistributionStockArticleOweDTO stockArticleEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionStockArticle), DistributionStockArticleOweDTO.class); - if (Func.isNotEmpty(distributionStockArticle.get("marketName"))){ + if (Func.isNotEmpty(distributionStockArticle.get("marketName"))) { String marketName = (String) distributionStockArticle.get("marketName"); stockArticleEntity.setMallName(marketName); } stockArticleEntity.setWarehouseId(myCurrentWarehouse.getId()); - if(Func.isNotEmpty(stockArticleEntity.getOrderCodeNum())){ + if (Func.isNotEmpty(stockArticleEntity.getOrderCodeNum())) { String anumbering = stockArticleEntity.getOrderCodeNum().trim(); List list = CommonUtil.stringNum(anumbering); - if(list.size() > 1){ + if (list.size() > 1) { stockArticleEntity.setOrderCodeNumList(list); - }else{ + } else { stockArticleEntity.setOrderCodeNumLike(anumbering); } } - if(Func.isNotEmpty(stockArticleEntity.getWaybillNum())){ + if (Func.isNotEmpty(stockArticleEntity.getWaybillNum())) { String waybill = stockArticleEntity.getWaybillNum().trim(); List list = CommonUtil.stringNum(waybill); - if(list.size() > 1){ + if (list.size() > 1) { stockArticleEntity.setWaybillNumList(list); - }else{ + } else { stockArticleEntity.setWaybillNumLike(waybill); } } - if(ObjectUtil.isNotEmpty(stockArticleEntity.getIds())){ - String ids = stockArticleEntity.getIds().trim(); + if (ObjectUtil.isNotEmpty(stockArticleEntity.getIds())) { + String ids = stockArticleEntity.getIds().trim(); List list = CommonUtil.stringNum(ids); - if(list.size() > 1){ + if (list.size() > 1) { stockArticleEntity.setIdsList(list); - }else{ + } else { stockArticleEntity.setIdsLike(ids); } } - IPage stockArticleEntityList = baseMapper.selectAllDistributionOrder(page,stockArticleEntity); + IPage stockArticleEntityList = baseMapper.selectAllDistributionOrder(page, stockArticleEntity); List stockArticleVOS = DistributionStockArticleWrapper.build().listVO(stockArticleEntityList.getRecords()); // List stockArticleVOS = DistributionStockArticleWrapper.build().listVO(stockArticleEntityList); IPage distributionStockArticleEntityIPage = page.setRecords(stockArticleVOS); @@ -1138,90 +1137,91 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl data) { - List list = new ArrayList<>(); - data.forEach( i -> { - DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); - log.info("数据信息 {}",i); - BasicdataWarehouseEntity warehouse = warehouseClient.getWarehouse(i.getWarehouse(), i.getWarehouseCode()); - stockArticleEntity.setWarehouseId(warehouse.getId()); - stockArticleEntity.setWarehouse(i.getWarehouse()); - stockArticleEntity.setServiceNumber(i.getServiceNumber()); - stockArticleEntity.setWarehouseEntryTime(new Date()); - stockArticleEntity.setCompleteSet(Objects.equals(i.getTotalNumber(), i.getHandQuantity()) ? 2 : 1); - stockArticleEntity.setIsZero("1"); - stockArticleEntity.setGenre(1); - stockArticleEntity.setStockupStatus("10"); - stockArticleEntity.setReservationStatus("10"); - stockArticleEntity.setOrderStatus("10"); - stockArticleEntity.setGroundingStatus("10"); - stockArticleEntity.setOrderReceiveStatus("10"); - stockArticleEntity.setFreezeStatus("10"); - stockArticleEntity.setBrand(i.getBrand()); - stockArticleEntity.setDescriptionGoods(i.getDescriptionGoods()); - stockArticleEntity.setOrderCode(i.getOrderCode()); - stockArticleEntity.setMallName(i.getMallName()); - stockArticleEntity.setTotalNumber(i.getTotalNumber()); - stockArticleEntity.setHandQuantity(i.getHandQuantity()); - stockArticleEntity.setWaybillNumber(i.getWaybillNumber()); - stockArticleEntity.setConsigneePerson(i.getConsigneePerson()); - stockArticleEntity.setResource("零担"); - stockArticleEntity.setConsigneeUnit(i.getConsigneeUnit()); - R> distriType = dictBizClient.getList("distribution_type"); - if(ObjectUtils.isNotNull(distriType)){ - List data1 = distriType.getData(); - - DictBiz dictBiz = data1.stream().filter(da -> { - return i.getTypeService().equals(da.getDictValue()); - }).findAny().get(); - stockArticleEntity.setTypeService(dictBiz.getDictKey());//仓库名称 - } - stockArticleEntity.setAcceptWarehouseName(i.getWarehouse()); - this.save(stockArticleEntity); - //添加包件信息 - DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); - parcelListEntity.setStockArticleId(stockArticleEntity.getId()); - parcelListEntity.setWarehouse(i.getWarehouse()); - parcelListEntity.setWarehouseId(warehouse.getId()); - parcelListEntity.setConditions(1); - parcelListEntity.setOrderCode(i.getOrderCode()); - parcelListEntity.setServiceNumber(i.getServiceNumber()); - parcelListEntity.setBrandName(Optional.ofNullable(i.getBrand()).orElse(null)); - if(i.getDescriptionGoods().contains(",")){ - String[] split = i.getDescriptionGoods().split(","); - for (int i1 = 0; i1 < split.length; i1++) { - parcelListEntity.setFirsts(split[i1]); - parcelListEntity.setQuantity(i.getTotalNumber()/split.length); + List list = new ArrayList<>(); + data.forEach(i -> { + DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); + log.info("数据信息 {}", i); + BasicdataWarehouseEntity warehouse = warehouseClient.getWarehouse(i.getWarehouse(), i.getWarehouseCode()); + stockArticleEntity.setWarehouseId(warehouse.getId()); + stockArticleEntity.setWarehouse(i.getWarehouse()); + stockArticleEntity.setServiceNumber(i.getServiceNumber()); + stockArticleEntity.setWarehouseEntryTime(new Date()); + stockArticleEntity.setCompleteSet(Objects.equals(i.getTotalNumber(), i.getHandQuantity()) ? 2 : 1); + stockArticleEntity.setIsZero("1"); + stockArticleEntity.setGenre(1); + stockArticleEntity.setStockupStatus("10"); + stockArticleEntity.setReservationStatus("10"); + stockArticleEntity.setOrderStatus("10"); + stockArticleEntity.setGroundingStatus("10"); + stockArticleEntity.setOrderReceiveStatus("10"); + stockArticleEntity.setFreezeStatus("10"); + stockArticleEntity.setBrand(i.getBrand()); + stockArticleEntity.setDescriptionGoods(i.getDescriptionGoods()); + stockArticleEntity.setOrderCode(i.getOrderCode()); + stockArticleEntity.setMallName(i.getMallName()); + stockArticleEntity.setTotalNumber(i.getTotalNumber()); + stockArticleEntity.setHandQuantity(i.getHandQuantity()); + stockArticleEntity.setWaybillNumber(i.getWaybillNumber()); + stockArticleEntity.setConsigneePerson(i.getConsigneePerson()); + stockArticleEntity.setResource("零担"); + stockArticleEntity.setConsigneeUnit(i.getConsigneeUnit()); + R> distriType = dictBizClient.getList("distribution_type"); + if (ObjectUtils.isNotNull(distriType)) { + List data1 = distriType.getData(); + + DictBiz dictBiz = data1.stream().filter(da -> { + return i.getTypeService().equals(da.getDictValue()); + }).findAny().get(); + stockArticleEntity.setTypeService(dictBiz.getDictKey());//仓库名称 + } + stockArticleEntity.setAcceptWarehouseName(i.getWarehouse()); + this.save(stockArticleEntity); + //添加包件信息 + DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); + parcelListEntity.setStockArticleId(stockArticleEntity.getId()); + parcelListEntity.setWarehouse(i.getWarehouse()); + parcelListEntity.setWarehouseId(warehouse.getId()); + parcelListEntity.setConditions(1); + parcelListEntity.setOrderCode(i.getOrderCode()); + parcelListEntity.setServiceNumber(i.getServiceNumber()); + parcelListEntity.setBrandName(Optional.ofNullable(i.getBrand()).orElse(null)); + if (i.getDescriptionGoods().contains(",")) { + String[] split = i.getDescriptionGoods().split(","); + for (int i1 = 0; i1 < split.length; i1++) { + parcelListEntity.setFirsts(split[i1]); + parcelListEntity.setQuantity(i.getTotalNumber() / split.length); + distributionParcelListService.save(parcelListEntity); + DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity(); + parcelNumberEntity.setStockArticleId(stockArticleEntity.getId()); + parcelNumberEntity.setParcelListId(parcelListEntity.getId()); + parcelNumberEntity.setQuantity(parcelListEntity.getQuantity()); + parcelNumberEntity.setHandQuantity(0); + parcelNumberEntity.setDeliveryQuantity(0); + parcelNumberEntity.setSigninQuantity(0); + list.add(parcelNumberEntity); + parcelListEntity.setId(null); + } + } else { + parcelListEntity.setFirsts(i.getDescriptionGoods()); + parcelListEntity.setQuantity(i.getTotalNumber()); distributionParcelListService.save(parcelListEntity); DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity(); parcelNumberEntity.setStockArticleId(stockArticleEntity.getId()); parcelNumberEntity.setParcelListId(parcelListEntity.getId()); - parcelNumberEntity.setQuantity(parcelListEntity.getQuantity()); + parcelNumberEntity.setQuantity(stockArticleEntity.getTotalNumber()); parcelNumberEntity.setHandQuantity(0); parcelNumberEntity.setDeliveryQuantity(0); parcelNumberEntity.setSigninQuantity(0); list.add(parcelNumberEntity); - parcelListEntity.setId(null); } - }else{ - parcelListEntity.setFirsts(i.getDescriptionGoods()); - parcelListEntity.setQuantity(i.getTotalNumber()); - distributionParcelListService.save(parcelListEntity); - DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity(); - parcelNumberEntity.setStockArticleId(stockArticleEntity.getId()); - parcelNumberEntity.setParcelListId(parcelListEntity.getId()); - parcelNumberEntity.setQuantity(stockArticleEntity.getTotalNumber()); - parcelNumberEntity.setHandQuantity(0); - parcelNumberEntity.setDeliveryQuantity(0); - parcelNumberEntity.setSigninQuantity(0); - list.add(parcelNumberEntity); - } - }); - if(!list.isEmpty()){ + }); + if (!list.isEmpty()) { parcelNumberService.saveBatch(list); } } @@ -1229,44 +1229,44 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl getZeroOrderDetail(Long id) { List parcelNumberVOS = baseMapper.getZeroOrderDetail(id); - if (Func.isEmpty(parcelNumberVOS)){ - log.error("###############零担订单无详情:{}",parcelNumberVOS); + if (Func.isEmpty(parcelNumberVOS)) { + log.error("###############零担订单无详情:{}", parcelNumberVOS); return null; } return parcelNumberVOS; } @Override - public List findStockArticleByCodeAndMarketAndWarehouseId(String code, String marketNames,Long warehouseId) { - if (Func.isEmpty(warehouseId)){ + public List findStockArticleByCodeAndMarketAndWarehouseId(String code, String marketNames, Long warehouseId) { + if (Func.isEmpty(warehouseId)) { return null; } ArrayList str = new ArrayList<>(); str.add(OrderStatusConstant.qianshou.getValue()); str.add(OrderStatusConstant.chuku.getValue()); LambdaQueryWrapper lambda = Wrappers.query().lambda() - .eq(DistributionStockArticleEntity::getWarehouseId,warehouseId).notIn(DistributionStockArticleEntity::getOrderStatus,str); - if (Func.isNotEmpty(code)){ - lambda.eq(DistributionStockArticleEntity::getOrderCode,code); + .eq(DistributionStockArticleEntity::getWarehouseId, warehouseId).notIn(DistributionStockArticleEntity::getOrderStatus, str); + if (Func.isNotEmpty(code)) { + lambda.eq(DistributionStockArticleEntity::getOrderCode, code); } - if (Func.isNotEmpty(marketNames)){ - lambda.in(DistributionStockArticleEntity::getMallName,Func.toStrList(",",marketNames)); + if (Func.isNotEmpty(marketNames)) { + lambda.in(DistributionStockArticleEntity::getMallName, Func.toStrList(",", marketNames)); } return this.list(lambda); } @Override - public IPage getPackageListByStockArticleId(IPage page, Map packageDTO) { + public IPage getPackageListByStockArticleId(IPage page, Map packageDTO) { // List parcelListEntityList = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, orderId) // .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) // .ne(DistributionParcelListEntity::getConditions,2) // .notIn(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue(), OrderPackageStatusConstant.yichuku.getValue())); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ + if (Func.isEmpty(myCurrentWarehouse)) { log.error("无仓库信息~~"); return null; } - List parcelListEntityList = baseMapper.selectOrderPackageListByMap(packageDTO,myCurrentWarehouse.getId()); + List parcelListEntityList = baseMapper.selectOrderPackageListByMap(packageDTO, myCurrentWarehouse.getId()); List parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntityList); @@ -1277,7 +1277,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl selectTemplate(List ids) { ArrayList arrayList = new ArrayList<>(); for (Long id : ids) { - DistributionStockArticleQRCodeVO orderNoList = baseMapper.getOrderNoList(null,String.valueOf(id)); + DistributionStockArticleQRCodeVO orderNoList = baseMapper.getOrderNoList(null, String.valueOf(id)); // 订单号 生成二维码 // String fileTypeName = QRCodeUtil.createCodeToFile(orderNoList.getOrderCode()); // orderNoList.setImgType(QRCodeUtil.getEmpAutograph(fileTypeName)); @@ -1288,41 +1288,41 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_code",orderCode) - .eq("warehouse_id",warehouseId) - .eq("is_deleted",0); + queryWrapper.eq("order_code", orderCode) + .eq("warehouse_id", warehouseId) + .eq("is_deleted", 0); List list = distributionParcelListService.list(queryWrapper); Integer incomingNum = 0; Integer handleNum = 0; @@ -1347,50 +1347,50 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl time){ + } else { + if (firstEntryTime > time) { firstEntryTime = time; } } - if(lastEntryTime == 0L){ + if (lastEntryTime == 0L) { lastEntryTime = time; - }else{ - if(lastEntryTime < time){ + } else { + if (lastEntryTime < time) { lastEntryTime = time; } } Integer conditions = parcelListEntity.getConditions(); - if(conditions.equals(1)){ + if (conditions.equals(1)) { String orderPackageStatus = parcelListEntity.getOrderPackageStatus(); String orderPackageReservationStatus = parcelListEntity.getOrderPackageReservationStatus(); String orderPackageGroundingStatus = parcelListEntity.getOrderPackageGroundingStatus(); String waybillNumber = parcelListEntity.getWaybillNumber(); - if(StringUtils.isNotBlank(waybillNumber)){ + if (StringUtils.isNotBlank(waybillNumber)) { waybillNoSet.add(parcelListEntity.getWaybillNumber()); } - if("20".equals(orderPackageGroundingStatus)){ + if ("20".equals(orderPackageGroundingStatus)) { groundingNum = groundingNum + 1; } - if("20".equals(orderPackageReservationStatus)){ + if ("20".equals(orderPackageReservationStatus)) { reservationNum = reservationNum + 1; } - if(!"60".equals(orderPackageStatus) && !"70".equals(orderPackageStatus)){ + if (!"60".equals(orderPackageStatus) && !"70".equals(orderPackageStatus)) { handleNum = handleNum + 1; - }else if ("60".equals(orderPackageStatus)){ - outNum = outNum +1; - }else if ("70".equals(orderPackageStatus)){ + } else if ("60".equals(orderPackageStatus)) { + outNum = outNum + 1; + } else if ("70".equals(orderPackageStatus)) { signNum = signNum + 1; } } @@ -1398,9 +1398,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl 0 && reservationNum < totalNumber){ + } else if (reservationNum > 0 && reservationNum < totalNumber) { stockArticleEntity.setReservationStatus("20"); - }else{ + } else { stockArticleEntity.setReservationStatus("30"); } - if(groundingNum == 0){ + if (groundingNum == 0) { stockArticleEntity.setGroundingStatus("10"); - }else if(groundingNum > 0 && groundingNum < totalNumber){ + } else if (groundingNum > 0 && groundingNum < totalNumber) { stockArticleEntity.setGroundingStatus("20"); - }else{ + } else { stockArticleEntity.setGroundingStatus("30"); } } @@ -1483,12 +1483,12 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl findZeroListByWarehouseId(Long warehouseId,Integer pageNum,Integer pageSize) { + public IPage findZeroListByWarehouseId(Long warehouseId, Integer pageNum, Integer pageSize) { IPage page = new Page<>(); page.setCurrent(pageNum); page.setSize(pageSize); - return baseMapper.findZeroListByWarehouseId(page,warehouseId); + return baseMapper.findZeroListByWarehouseId(page, warehouseId); } @Override @@ -1507,80 +1507,127 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() - .eq(DistributionParcelListEntity::getOrderCode, s) - .eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId()) - .eq(DistributionParcelListEntity::getWarehouseId, warehouseId) - ); - if (Func.isEmpty(parcelListEntities)) { - log.error(method + "查询包件列表空orderCode:{}", s); - throw new RuntimeException("包件列表为空"); - } - //在库数量 - int inWarehouseQuantity = 0; - //装车数量 - int loadingQuantity = 0; - //配送件数 - int deliveryQuantity = 0; - //签收件数 - int signingQuantity = 0; - //订单总件数 - int totalNumber = stockArticleEntity.getTotalNumber().intValue(); - for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { - //统计订单相关的状态节点数量 - if (parcelListEntity.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue())) { - deliveryQuantity += parcelListEntity.getQuantity(); - } - if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())) { - loadingQuantity += parcelListEntity.getQuantity(); - } - if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { - signingQuantity += parcelListEntity.getQuantity(); + if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())) { + //查询包件列表 + List parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getOrderCode, s) + .eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId()) + .eq(DistributionParcelListEntity::getWarehouseId, warehouseId) + ); + if (Func.isEmpty(parcelListEntities)) { + log.error(method + "查询包件列表空orderCode:{}", s); + throw new RuntimeException("包件列表为空"); } + //在库数量 + int inWarehouseQuantity = 0; + //装车数量 + int loadingQuantity = 0; + //配送件数 + int deliveryQuantity = 0; + //签收件数 + int signingQuantity = 0; + //订单总件数 + int totalNumber = stockArticleEntity.getTotalNumber().intValue(); + for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { + //统计订单相关的状态节点数量 + if (parcelListEntity.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue())) { + deliveryQuantity += parcelListEntity.getQuantity(); + } + if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())) { + loadingQuantity += parcelListEntity.getQuantity(); + } + if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { + signingQuantity += parcelListEntity.getQuantity(); + } - } - inWarehouseQuantity += stockArticleEntity.getTotalNumber() - loadingQuantity; - - stockArticleEntity.setHandQuantity(inWarehouseQuantity); - stockArticleEntity.setDeliveryQuantity(deliveryQuantity); - stockArticleEntity.setSigninQuantity(signingQuantity); - if (totalNumber != 0) { - - if (totalNumber == deliveryQuantity) { - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); - } else { - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); - } - if (deliveryQuantity == 0) { - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); } + inWarehouseQuantity += stockArticleEntity.getTotalNumber() - loadingQuantity; + stockArticleEntity.setHandQuantity(inWarehouseQuantity); + stockArticleEntity.setDeliveryQuantity(deliveryQuantity); + stockArticleEntity.setSigninQuantity(signingQuantity); + if (totalNumber != 0) { - //未签收的情况下分析订单的装车状态,此时该订单未有包件进行其拿手 - if (signingQuantity == 0) { - if (totalNumber == loadingQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); + if (totalNumber == deliveryQuantity) { + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); + } + if (deliveryQuantity == 0) { + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); } - if (loadingQuantity == 0) { - if (totalNumber == inWarehouseQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + + + //未签收的情况下分析订单的装车状态,此时该订单未有包件进行其拿手 + if (signingQuantity == 0) { + if (totalNumber == loadingQuantity) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + } + if (loadingQuantity == 0) { + if (totalNumber == inWarehouseQuantity) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + } else { + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); + } + } + } else { + //订单存在签收数据了,此时就需要进行签收状态的判断 + if (totalNumber == signingQuantity) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); + } else { + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); } } - } else { - //订单存在签收数据了,此时就需要进行签收状态的判断 - if (totalNumber == signingQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); + this.updateById(stockArticleEntity); + } + } else if (IsOrNoConstant.yes.getValue().equals(stockArticleEntity.getIsZero())) { + //零担订单维护 + List parcelNumberEntities = distributionParcelNumberMapper.selectParcelNumber(stockArticleEntity.getOrderCode(), warehouseId); + //在库数量 + int inWarehouseQuantity = 0; + //装车数量 + int loadingQuantity = 0; + //配送件数 + int deliveryQuantity = 0; + //签收件数 + int signingQuantity = 0; + if (Func.isNotEmpty(parcelNumberEntities)) { + //在库数量 + inWarehouseQuantity = parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getHandQuantity).sum(); + + if ((loadingQuantity + deliveryQuantity) == stockArticleEntity.getTotalNumber()) { + //无在库数量则无法进行预约 + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); + } + loadingQuantity = parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getOutboundQuantity).sum(); + if (stockArticleEntity.getTotalNumber() == loadingQuantity) { + //此时的出库和总数一致,该零担此时全部进行出库 + stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); + } else if (stockArticleEntity.getTotalNumber() > loadingQuantity) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); } else { + stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + } + signingQuantity = parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getSigninQuantity).sum(); + if (stockArticleEntity.getTotalNumber() == signingQuantity) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); + } else if (stockArticleEntity.getTotalNumber() > signingQuantity) { stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); } + //维护订单的在库件数 + stockArticleEntity.setHandQuantity(inWarehouseQuantity); + //维护订单的配送件数 + deliveryQuantity = parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getDeliveryQuantity).sum() + parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getSigninQuantity).sum() + parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getOutboundQuantity).sum(); + stockArticleEntity.setDeliveryQuantity(deliveryQuantity); + stockArticleEntity.setSigninQuantity(signingQuantity); + stockArticleEntity.setDeliveryQuantity(deliveryQuantity); + this.updateById(stockArticleEntity); } - this.updateById(stockArticleEntity); + } + } } @@ -1592,7 +1639,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl list = this.list(Wrappers.query().lambda().eq(DistributionStockArticleEntity::getOrderCode, code)); - if (Func.isNotEmpty(list) && list.size()>0){ + if (Func.isNotEmpty(list) && list.size() > 0) { //查询配送数量 for (DistributionStockArticleEntity stockArticleEntity : list) { //查询配送数量 @@ -1614,7 +1661,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl ids = baseMapper.getOrderListByWaybill(code); - if (Func.isEmpty(ids) ){ + if (Func.isEmpty(ids)) { deliveryOrderInfoVO.setDeliveryNum(a); deliveryOrderInfoVO.setSigningNum(b); return R.data(deliveryOrderInfoVO); @@ -1655,28 +1702,28 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl packageEntityList = distributionReservationPackageService.list(Wrappers.query().lambda() .eq(DistributionReservationPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId()) .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) ); - if (Func.isNotEmpty(packageEntityList)){ + if (Func.isNotEmpty(packageEntityList)) { a += packageEntityList.size(); } - }else if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.yes.getValue())){ + } else if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.yes.getValue())) { //查询零担配送数量 List zeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.query().lambda() .eq(DistributionReservationZeroPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId()) .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) ); - if (Func.isNotEmpty(zeroPackageEntityList)){ + if (Func.isNotEmpty(zeroPackageEntityList)) { a += zeroPackageEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum(); } - }else { - log.error(method+"配送订单无类型"); + } else { + log.error(method + "配送订单无类型"); return R.fail("数据错误!!!"); } } @@ -1685,7 +1732,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionStockArticleEntity::getOrderCode, code) ); - if (Func.isNotEmpty(one)){ - if (one.getIsZero().equals(IsOrNoConstant.no.getValue())){ + if (Func.isNotEmpty(one)) { + if (one.getIsZero().equals(IsOrNoConstant.no.getValue())) { //查询包件数量 List packageEntityList = distributionReservationPackageService.list(Wrappers.query().lambda() .eq(DistributionReservationPackageEntity::getStockArticleId, one.getId()) .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) ); - if (Func.isNotEmpty(packageEntityList)){ + if (Func.isNotEmpty(packageEntityList)) { a += packageEntityList.size(); } - }else if (one.getIsZero().equals(IsOrNoConstant.yes.getValue())){ + } else if (one.getIsZero().equals(IsOrNoConstant.yes.getValue())) { //查询零担配送数量 List zeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.query().lambda() .eq(DistributionReservationZeroPackageEntity::getStockArticleId, one.getId()) .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) ); - if (Func.isNotEmpty(zeroPackageEntityList)){ + if (Func.isNotEmpty(zeroPackageEntityList)) { a += zeroPackageEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum(); } - }else { - log.error(method+"配送订单无类型"); + } else { + log.error(method + "配送订单无类型"); return R.fail("数据错误!!!"); } } @@ -1724,7 +1771,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_code",orderCode) - .eq("warehouse_id",warehouseId) - .eq("is_zero",1) - .eq("is_deleted",0); + queryWrapper.eq("order_code", orderCode) + .eq("warehouse_id", warehouseId) + .eq("is_zero", 1) + .eq("is_deleted", 0); return baseMapper.selectOne(queryWrapper); } @Override public DistributionStockArticleEntity findStockArticleByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_code",orderCode) - .eq("warehouse_id",warehouseId) + queryWrapper.eq("order_code", orderCode) + .eq("warehouse_id", warehouseId) // .eq("is_zero",1) - .eq("is_deleted",0); + .eq("is_deleted", 0); return baseMapper.selectOne(queryWrapper); } @Override public List findListByWaybillNumberAndWarehouseId(String waybillNumber, Long warehouseId) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.like("waybill_number",waybillNumber) - .eq("warehouse_id",warehouseId) - .eq("is_zero",1) - .eq("is_deleted",0); + queryWrapper.like("waybill_number", waybillNumber) + .eq("warehouse_id", warehouseId) + .eq("is_zero", 1) + .eq("is_deleted", 0); return baseMapper.selectList(queryWrapper); } @Override - public void updateGroundingStatus(String orderCode, String groundingStatus,Long warehouseId) { - baseMapper.updateGroundingStatus(orderCode,groundingStatus,warehouseId); + public void updateGroundingStatus(String orderCode, String groundingStatus, Long warehouseId) { + baseMapper.updateGroundingStatus(orderCode, groundingStatus, warehouseId); } }