diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/stockup/StockupTypeConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/stockup/StockupTypeConstant.java new file mode 100644 index 000000000..7f2a1d0f5 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/stockup/StockupTypeConstant.java @@ -0,0 +1,48 @@ +package org.springblade.common.constant.stockup; + +/** + * 备货任务类型 + * 对应码表 + * stockup_status + * @author pref + */ +public enum StockupTypeConstant { + + shipei("市配","1"), + shangpei("商配","2"), + ziti("自提","3"); + + + + /** + * 状态 + */ + private String name; + + /** + * 值 + */ + private String value; + + + private StockupTypeConstant(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java index 0770b5f85..9cc9839a3 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java @@ -128,7 +128,7 @@ public class DistributionStockupEntity extends TenantEntity { /** * 叉车司机 */ - @ApiModelProperty(value = "叉车司机") + @ApiModelProperty(value = "叉车司机名称") private String forkliftName; /** * 装卸班组 @@ -193,6 +193,9 @@ public class DistributionStockupEntity extends TenantEntity { @ApiModelProperty(value = "备货编号") private String stockupCode; + @ApiModelProperty(value = "仓库Id") + private Long warehouseId; + diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java index 01c2495d0..c18bb50dd 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java @@ -120,107 +120,13 @@ public class DistrilbutionBillLadingEntity extends TenantEntity { @TableField(exist = false) private Map fei; - /** - * 叉车司机 - */ - @ApiModelProperty(value = "叉车司机") - private Long forkliftId; - /** - * 装卸班组 - */ - @ApiModelProperty(value = "装卸班组") - private Long loaderId; - /** - * 叉车司机 - */ - @ApiModelProperty(value = "叉车司机") - private String forkliftName; - /** - * 装卸班组 - */ - @ApiModelProperty(value = "装卸班组") - private String loaderName; - - /** - * 备货人id - */ - @ApiModelProperty(value = "备货人id") - private Long stockupUserId; - /** - * 确认完成备货时间 - */ - @ApiModelProperty(value = "确认完成备货时间") - private Date fixTime; - /** - * 指派时间 - */ - @ApiModelProperty(value = "指派时间") - @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") - private Date assignTime; - - /** - * 出库时间 - */ - @ApiModelProperty(value = "出库时间") - @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") - private Date outboundDate; - /** - * 备货状态 1待指派 2 待备货 3备货中 4已备货 - */ - @ApiModelProperty(value = "备货状态") - private String stockupStatus; - /** - * 备货区 - */ - @ApiModelProperty(value = "备货区") - private String stockupArea; - /** - * 指派状态;1-未指派、2-已指派 - */ - @ApiModelProperty(value = "指派状态;1-未指派、2-已指派") - private String assignStatus; - /** - * 备货库位 - */ - @ApiModelProperty(value = "备货库位") - private String stockipAllocation; - /** - * 备货时间 - */ - @ApiModelProperty(value = "备货时间") - private Date stockupDate; - /** - * 备货人 - */ - @ApiModelProperty(value = "备货人") - private String stockupUser; - /** - * 备货人 - */ - @ApiModelProperty(value = "备货人") - @TableField(exist = false) - private String startDate; - /** - * 备货人 - */ - @ApiModelProperty(value = "备货人") - @TableField(exist = false) - private String entDate; - /** - * 备货编码 - */ - @ApiModelProperty(value = "备货编码") - private String stockupCode; - /** - * 备货人 - */ - @ApiModelProperty(value = "备货人") - private String goodsAreaId; @ApiModelProperty(value = "提货状态") private String conditions; //提货状态 + + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java index 80ef26a48..7dcece32a 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java @@ -36,8 +36,6 @@ public class DistributionStockupVO extends DistributionStockupEntity { private String headline; private String groupName; - //备货编码 - private String stockupCode; //备货人 private String stockupUser; private String stockupStatusName; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java index 79fdd8a67..07fa26abc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java @@ -81,6 +81,19 @@ public class DistributionStockupController extends BladeController { return R.data(detail); } + /** + * 备货信息表 提货 详情 + */ + @GetMapping("/detailOwnSelf") + @ApiOperation(value = "详情", notes = "传入distributionStockup") + public R detailOwnSelf(DistributionStockupEntity distributionStockup) { + DistributionStockupVO detail = distributionStockupService.detailOwnSelf(distributionStockup.getId()); + return R.data(detail); + } + + + + /** * 备货信息表 预约信息 详情 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java index 99092111b..a5b0e5251 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java @@ -169,7 +169,9 @@ public class DistrilbutionBillLadingController extends BladeController { /** * 备货信息表 详情 + * 废弃 */ + @GetMapping("/detailOwn") @ApiOperation(value = "详情", notes = "传入distributionStockup") public R detailOwn(DistrilbutionBillLadingEntity distrilbutionBillLading) { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index 6c6545cf1..5fd5e50f4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -77,6 +77,8 @@ public interface IDistributionReservationService extends BaseService createPackageCode(Long reservationId, Long stockListId, Integer packageNum); String selectStockupAreaByReservationId(Long id); + + DistributionStockupVO detailOwnSelf(Long id); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java index 23f55a81a..afa1c4fbc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java @@ -136,4 +136,5 @@ public interface IDistrilbutionBillLadingService extends BaseService getViewDetailOwn(String id); + } 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 cc40b9e4b..ced7338c5 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 @@ -36,6 +36,7 @@ import com.logpm.distribution.vo.DistributionStockListVO; import com.logpm.distribution.vo.app.*; import com.logpm.distribution.wrapper.DistributionParcelListAppWrapper; import com.logpm.distribution.wrapper.DistributionParcelListWrapper; +import com.logpm.distribution.wrapper.DistributionStockArticleWrapper; import lombok.AllArgsConstructor; import org.checkerframework.checker.units.qual.A; import org.springblade.core.tool.utils.BeanUtil; @@ -101,6 +102,9 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl selectDistributionDeliveryorder(IPage page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) { List distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionDeliveryInfoDTO); + for (DistributionStockArticleVO distributionDeliveryInfoVO : distributionDeliveryInfoVOS) { + DistributionStockArticleWrapper.build().buildVoInfor(distributionDeliveryInfoVO); + } return page.setRecords(distributionDeliveryInfoVOS); } 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 b2d09dbb3..ec31fa954 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 @@ -146,9 +146,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl 1) { // distributionDeliveryListEntity.setOrderId(orderIds.deleteCharAt(orderIds.length() - 1).toString()); // } @@ -990,13 +990,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl pageList(IPage page, Map distributionStockup) { DistributionStockupEntity distributionStockupEntity = JSON.parseObject(JSON.toJSONString(distributionStockup), DistributionStockupEntity.class); distributionStockupEntity.setTenantId(AuthUtil.getTenantId()); - return baseMapper.pageList(page,distributionStockupEntity); + return baseMapper.pageList(page, distributionStockupEntity); } @Override @@ -140,7 +141,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl distributionStockupEntityIPage = baseMapper.selectStockupPage(page, stockupDTO); List records = distributionStockupEntityIPage.getRecords(); - for (DistributionStockupListVO vo:records) { + for (DistributionStockupListVO vo : records) { intToStrDistributionStockupListVO(vo); //查询库位信息 //1.通过预约单号查询所有包件的库位信息 @@ -148,13 +149,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl packageAllocation = distributionParcelListService.selectWarehouseAreaByReservationId(reservationId); //2.通过预约单查询所有库存品的库位信息 List stockListAllocation = distributionStockListService.selectWarehouseAreaByReservationId(reservationId); - String allocation = dealwithAllocation(packageAllocation,stockListAllocation); + String allocation = dealwithAllocation(packageAllocation, stockListAllocation); //查询托盘信息 //1.查询包件托盘信息` List packagePallet = distributionParcelListService.selectPalletByReservationId(reservationId); //2.查询库存品托盘信息 List stockListPallet = distributionStockListService.selectPalletByReservationId(reservationId); - String pallet = deakwithPallet(packagePallet,stockListPallet); + String pallet = deakwithPallet(packagePallet, stockListPallet); //查询对应预约单的订单总数 Integer orderNum = distributionReservationService.selectOrderNumByReservationId(reservationId); @@ -167,9 +168,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl packagePallet, List stockListPallet) { Set set = new HashSet<>(); set.addAll(packagePallet); - for (String pallet:stockListPallet){ - if(StringUtil.isBlank(pallet)){ + for (String pallet : stockListPallet) { + if (StringUtil.isBlank(pallet)) { continue; } //因为库存品的数据可能会有拼接 @@ -216,10 +216,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl set = new HashSet<>(); set.addAll(packageAllocation); - for (String allocation:stockListAllocation){ - if(StringUtil.isBlank(allocation)){ + for (String allocation : stockListAllocation) { + if (StringUtil.isBlank(allocation)) { continue; } //因为库存品的数据可能会有拼接 @@ -242,10 +242,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl getNums(List reservationEntities){ - Map map = new HashMap<>(); + private Map getNums(List reservationEntities) { + Map map = new HashMap<>(); Set set = new TreeSet(); Integer packageNum = 0; Integer stockNum = 0; - for (DistributionReservationEntity reservationEntity:reservationEntities){ + for (DistributionReservationEntity reservationEntity : reservationEntities) { String stockArticleId = reservationEntity.getStockArticleId(); Long reservationId = reservationEntity.getId(); String[] split = stockArticleId.split(","); List list = new ArrayList<>(); boolean b = Collections.addAll(list, split); - if(b){ + if (b) { set.addAll(list); } //查询所有包件数量 packageNum = packageNum + baseMapper.getAllPackageNum(reservationId); stockNum = stockNum + baseMapper.getAllStockNum(reservationId); } - map.put("orderNum",set.size()); - map.put("planNum",packageNum+stockNum); + map.put("orderNum", set.size()); + map.put("planNum", packageNum + stockNum); return map; } - private String getTrays(List reservationEntities){ + private String getTrays(List reservationEntities) { Set set = new TreeSet<>(); StringBuilder sb = new StringBuilder(); - for (DistributionReservationEntity reservationEntity:reservationEntities){ + for (DistributionReservationEntity reservationEntity : reservationEntities) { List list = distributionReservationService.getAllPackagePallet(reservationEntity.getId()); set.addAll(list); } - for (String pallet:set){ - if(StringUtil.hasLength(sb.toString())){ + for (String pallet : set) { + if (StringUtil.hasLength(sb.toString())) { sb.append(pallet); - }else{ + } else { sb.append(",").append(pallet); } } @@ -296,13 +296,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl reservationEntities){ + private String getCustomer(List reservationEntities) { StringBuilder customerSb = new StringBuilder(); - for (DistributionReservationEntity reservationEntity:reservationEntities){ + for (DistributionReservationEntity reservationEntity : reservationEntities) { //循环拼接所有客户的名称 - if(!StringUtil.hasLength(customerSb.toString())){ + if (!StringUtil.hasLength(customerSb.toString())) { customerSb.append(reservationEntity.getConsignee()); - }else{ + } else { customerSb.append(",").append(reservationEntity.getConsignee()); } } @@ -310,7 +310,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionParcelListService.selectOrderInfoList(reservationId,stockArticleId,allocation,pallet); + List list = distributionParcelListService.selectOrderInfoList(reservationId, stockArticleId, allocation, pallet); int size = list.size(); Integer scanNum = 0; - for (PackageStockupVO vo:list){ - if(!Objects.isNull(vo.getScanId())){ + for (PackageStockupVO vo : list) { + if (!Objects.isNull(vo.getScanId())) { scanNum++; } String orderPackageCode = vo.getPackageBarCode(); QueryWrapper qw = new QueryWrapper<>(); - qw.eq("package_code",orderPackageCode); + qw.eq("package_code", orderPackageCode); List parcelDetailsEntityList = distributionParcelDetailsService.list(qw); vo.setDetailsEntities(parcelDetailsEntityList); } - DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO(); + DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO(); vo.setReservationId(reservationId); vo.setCustomer(reservationEntity.getConsignee()); vo.setAddress(reservationEntity.getDeliveryAddress()); @@ -367,11 +367,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl l = new Page<>(); List inventoryChe = baseMapper.getInventoryChe(id); boolean b = inventoryChe.stream().anyMatch(i -> i.getReservationStockListNum() > 0); - if(b){ + if (b) { //查询库存品 - return baseMapper.getInventoryOwn(page,id); - }else{ + return baseMapper.getInventoryOwn(page, id); + } else { return l; } } - /** * 查询预约信息 * @@ -416,8 +420,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl detailReservationOwn(IPage page, Long id) { IPage iPage = baseMapper.detailReservationOwn(page, id); - iPage.getRecords().forEach(i ->{ - i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.STOCKUP_STATUS,i.getStockupStatus())); + iPage.getRecords().forEach(i -> { + i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.STOCKUP_STATUS, i.getStockupStatus())); }); return iPage; } @@ -428,9 +432,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionStockListService.selectStockListInfoList(reservationId,stockListId); + List list = distributionStockListService.selectStockListInfoList(reservationId, stockListId); entity.setStockList(list); @@ -442,19 +446,19 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl createPackageCode(Long reservationId, Long stockListId, Integer packageNum) { //通过预约单id和订单 - Integer num = distributionReservationService.getReservationNumByReservationIdAndStockListId(reservationId,stockListId); - if(packageNum.compareTo(num) > 0){ + Integer num = distributionReservationService.getReservationNumByReservationIdAndStockListId(reservationId, stockListId); + if (packageNum.compareTo(num) > 0) { log.warn("###################createPackageCode: 包条数量与预约数量不正确"); - throw new CustomerException(405,"包条数量与预约数量不正确"); + throw new CustomerException(405, "包条数量与预约数量不正确"); } String deptId = AuthUtil.getDeptId(); BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByDepartment(deptId); List ls = new ArrayList<>(); - for (int i = 0 ; i < packageNum ; i++){ + for (int i = 0; i < packageNum; i++) { - String packageCode = basicDataCodeClient.getCodeByType(CodeDesEnum.PACKAGE.getCodeNum(), basicdataWarehouseEntity.getWarehouseCode(),null);//TODO 这个滴地方需要传入订单编号来区别是哪个订单的包件 + String packageCode = basicDataCodeClient.getCodeByType(CodeDesEnum.PACKAGE.getCodeNum(), basicdataWarehouseEntity.getWarehouseCode(), null);//TODO 这个滴地方需要传入订单编号来区别是哪个订单的包件 ls.add(packageCode); } @@ -466,4 +470,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl printEntityList = distributionPrintService.list(Wrappers.query().lambda().eq(DistributionPrintEntity::getBillLadingId, distrilbutionBillLading.getId())); - if(printEntityList.size() > 0){ - if(distrilbutionBillLading.getMark()){ + if (printEntityList.size() > 0) { + if (distrilbutionBillLading.getMark()) { //要删除 List collect = printEntityList.stream().map(DistributionPrintEntity::getId).collect(Collectors.toList()); distributionPrintService.deleteLogic(collect); //操作图片 - if(distrilbutionBillLading.getPrintList().size() > 0){ + if (distrilbutionBillLading.getPrintList().size() > 0) { addPrint(distrilbutionBillLading); } } @@ -135,7 +142,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = distributionDeliveryChargeService.list(Wrappers.query().lambda() .eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLading.getId()) ); - if(list.size() > 0){ + if (list.size() > 0) { list.forEach(i -> { String s = distrilbutionBillLading.getFei().get(i.getCost()); if (StringUtils.isNotBlank(s)) { @@ -152,9 +159,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0){ + if (distrilbutionBillLading.getStockArticleList().size() > 0) { boolean order = getOrder(distrilbutionBillLading.getStockArticleList(), distrilbutionBillLading.getId()); - if(!order){ + if (!order) { throw new ServiceException("修改失败!!"); } } @@ -180,7 +187,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl iterator = distrilbutionBillLading.getStockDTOList().iterator(); - while (iterator.hasNext()){ + while (iterator.hasNext()) { DistributionStockListDTO next = iterator.next(); if (i.getStockListId().equals(next.getId())) { DistributionDeliveryDetailsEntity deliveryDetails = new DistributionDeliveryDetailsEntity(); @@ -191,10 +198,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl quantity){ + if (inventoryQuantity > quantity) { num = inventoryQuantity - quantity; //多 添加了数量 //修改库存占用数量 - distributionAsyncService.getInventoryNumUpdate(i.getStockListId(),num,1); + distributionAsyncService.getInventoryNumUpdate(i.getStockListId(), num, 1); //kk备货 if (i.getConditions().equals("2")) { //xiugai @@ -203,7 +210,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl num){ + if (i1 > num) { //可以减少 //修改库存占用数量 - distributionAsyncService.getInventoryNumUpdate(i.getStockListId(),num,2); - }else{ + distributionAsyncService.getInventoryNumUpdate(i.getStockListId(), num, 2); + } else { //todo 未扫小于减少 } @@ -236,9 +243,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0){ - ids.forEach( a ->{ + if (ids.size() > 0) { + ids.forEach(a -> { DistributionDeliveryDetailsEntity deliveryDetails = new DistributionDeliveryDetailsEntity(); deliveryDetails.setId(a); deliveryDetails.setInventoryStatus("3"); @@ -258,14 +265,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0){ + if (distrilbutionBillLading.getPrintList().size() > 0) { addPrint(distrilbutionBillLading); } + } //添加库存品信息 - if(distrilbutionBillLading.getStockDTOList().size() > 0){ + if (distrilbutionBillLading.getStockDTOList().size() > 0) { //没有 List detailsEntities = new ArrayList<>(); Boolean finalLas = las; @@ -301,20 +307,20 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0){ + if (distrilbutionBillLading.getFei().size() > 0) { List listEntity = new ArrayList<>(); distrilbutionBillLading.getFei().forEach((k, v) -> { DistributionDeliveryChargeEntity distributionDeliveryCharge = new DistributionDeliveryChargeEntity(); @@ -331,11 +337,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl orderList,Long id){ + public boolean getOrder(List orderList, Long id) { //查询已有的数据 List list = distrilbutionBillStockService.list(Wrappers.query().lambda() .eq(DistrilbutionBillStockEntity::getBillLadingId, id) @@ -343,18 +350,18 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl wp.eq(DistrilbutionBillStockEntity::getBillLadingId, id).eq(DistrilbutionBillStockEntity::getOrderStatus, "2")) ); List deList = new ArrayList<>(); - list.forEach( i ->{ + list.forEach(i -> { boolean b = orderList.stream().anyMatch(o -> o.getId().equals(i.getStockArticleId())); - if(b){ + if (b) { //存在 Iterator iterator = orderList.iterator(); - while (iterator.hasNext()){ + while (iterator.hasNext()) { DistributionStockArticleEntity next = iterator.next(); - if(next.getId().equals( i.getStockArticleId())){ + if (next.getId().equals(i.getStockArticleId())) { iterator.remove(); } } - }else{ + } else { //不存在 DistrilbutionBillStockEntity stockEntity = new DistrilbutionBillStockVO(); stockEntity.setId(i.getId()); @@ -366,12 +373,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl{ + deList.forEach(i -> { //查询数据是否已备货 - if(!i.getConditions().equals("2")){ + if (!i.getConditions().equals("2")) { //未 List list1 = distributionStockService.list(Wrappers.query().lambda().eq(DistributionStockEntity::getStockArticle, i.getStockArticleId())); - if(list1.size() == 0){ + if (list1.size() == 0) { //取消 DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); stockArticleEntity.setId(i.getStockArticleId()); @@ -384,7 +391,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list1 = new ArrayList<>(); //添加订单关联 - orderList.forEach( i ->{ + orderList.forEach(i -> { DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); stockArticleEntity.setStockupStatus(StockupStatusConstant.daibeihuo.getValue()); @@ -402,26 +409,28 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl pageList(IPage page, Map distrilbutionBillLading) { DistrilbutionBillLadingDTO distrilbutionBillLadingDTO = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingDTO.class); IPage distrilbutionBillLadingVOIPage = baseMapper.pageList(page, distrilbutionBillLadingDTO); - List records =distrilbutionBillLadingVOIPage.getRecords(); + List records = distrilbutionBillLadingVOIPage.getRecords(); - records.forEach( i -> { + records.forEach(i -> { List list = distributionDeliveryChargeService.list(Wrappers.query().lambda() .eq(DistributionDeliveryChargeEntity::getBillLading, i.getId()) ); - list.forEach( ii ->{ - ii.setCostName(DictBizCache.getValue(DictBizConstant.DELIVERY_COST,ii.getCost())); + list.forEach(ii -> { + ii.setCostName(DictBizCache.getValue(DictBizConstant.DELIVERY_COST, ii.getCost())); }); i.setList(list); }); @@ -433,7 +442,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = distributionPrintService.list(Wrappers.query().lambda() // .eq(DistributionPrintEntity::getBillLadingId, distrilbutionBillLadingDTO.getId()) // ); @@ -463,7 +472,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl pageListApp(IPage page, BillLadingAppDTO billLadingAppDTO) { IPage pageList = baseMapper.pageListApp(page, billLadingAppDTO); List records = pageList.getRecords(); - for (DistrilbutionBillLadingAppVO vo : records){ + for (DistrilbutionBillLadingAppVO vo : records) { //有可能存在多个订单所以需要拆分 String stockArticleId = vo.getStockArticleId(); @@ -471,33 +480,33 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("stock_article_id",Long.parseLong(s)) - .eq("is_deleted",0); + queryWrapper.eq("stock_article_id", Long.parseLong(s)) + .eq("is_deleted", 0); List list = distributionParcelListService.list(queryWrapper); int pn = list.size(); planNum = planNum + pn; //通过订单id查询扫描表中有多少数据 QueryWrapper qw = new QueryWrapper<>(); - qw.eq("stock_article_id",Long.parseLong(s)) - .eq("is_deleted",0); + qw.eq("stock_article_id", Long.parseLong(s)) + .eq("is_deleted", 0); List ls = distributionBillLadingScanService.list(qw); int sn = ls.size(); - signedNum = signedNum +sn; + signedNum = signedNum + sn; } //查询库存品的件数量 DistributionDeliveryDetailsVO list = distributionDeliveryDetailsService.oneListNum(vo.getBillLadingId()); - if(ObjectUtils.isNotNull(list)){ + if (ObjectUtils.isNotNull(list)) { planNum += list.getWholeNum(); signedNum += list.getEsauNum(); vo.setInventoryNum(list.getWholeNum()); - }else{ + } else { vo.setInventoryNum(0); } vo.setOrderNum(orderNum); @@ -510,9 +519,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl l = new ArrayList<>(); - for (String s:split){ - if(StringUtil.isBlank(s)){ + for (String s : split) { + if (StringUtil.isBlank(s)) { continue; } DistrilbutionAppBillLadingOrderVO vo = new DistrilbutionAppBillLadingOrderVO(); @@ -536,10 +545,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("stock_article_id",Long.parseLong(s)) - .eq("is_deleted",0); - if(!StringUtil.isBlank(orderSelfNumbering)){ - queryWrapper.ne("order_self_numbering",orderSelfNumbering); + queryWrapper.eq("stock_article_id", Long.parseLong(s)) + .eq("is_deleted", 0); + if (!StringUtil.isBlank(orderSelfNumbering)) { + queryWrapper.ne("order_self_numbering", orderSelfNumbering); } List list = distributionParcelListService.list(queryWrapper); vo.setOrderSelfNumbering(list.get(0).getOrderCode()); @@ -548,38 +557,38 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl qw = new QueryWrapper<>(); - qw.eq("stock_article_id",Long.parseLong(s)) - .eq("is_deleted",0); + qw.eq("stock_article_id", Long.parseLong(s)) + .eq("is_deleted", 0); List ls = distributionBillLadingScanService.list(qw); int sn = ls.size(); vo.setSignedNum(sn); - signedNum = signedNum +sn; + signedNum = signedNum + sn; - if(pn == sn){ + if (pn == sn) { conpleteNum++; } - if(pn == sn){ + if (pn == sn) { vo.setOrderStatusStr("齐套"); - }else if(sn 0){ + } else if (sn < pn && sn > 0) { vo.setOrderStatusStr("部分扫"); - }else if(sn == 0){ + } else if (sn == 0) { vo.setOrderStatusStr("未扫"); } //0 全部 1 齐套 2部分扫 3未扫 - if(orderStatus == 0){ + if (orderStatus == 0) { l.add(vo); - }else if(orderStatus == 1){ - if(pn == sn){ + } else if (orderStatus == 1) { + if (pn == sn) { l.add(vo); } - }else if(orderStatus == 2){ - if(sn 0){ + } else if (orderStatus == 2) { + if (sn < pn && sn > 0) { l.add(vo); } - }else if(orderStatus == 3){ - if(sn == 0){ + } else if (orderStatus == 3) { + if (sn == 0) { l.add(vo); } } @@ -592,7 +601,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list1 = distributionDeliveryDetailsService.list(Wrappers.query().lambda() .eq(DistributionDeliveryDetailsEntity::getBillLadingId, billLadingId) ); - if(list1.size() > 0){ + if (list1.size() > 0) { long count = list1.stream().filter(i -> i.getConditions().equals("2")).count(); signedNum += (int) count; } @@ -601,11 +610,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0){ + if (list2.size() > 0) { signedNum += list2.size(); } - planNum += list.stream().mapToInt( DistributionDeliveryDetailsEntity::getQuantity ).sum(); + planNum += list.stream().mapToInt(DistributionDeliveryDetailsEntity::getQuantity).sum(); DistrilbutionAppBillLadingOrderMainVO mainVO = new DistrilbutionAppBillLadingOrderMainVO(); mainVO.setOrderNum(orderNum); mainVO.setPlanNum(planNum); @@ -617,9 +626,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl details = baseMapper.selectDetailList(Long.parseLong(s),scanStatus,orderSelfNumbering); - for (DistrilbutionAppBillLadingDetailVO detailVO : details){ + List details = baseMapper.selectDetailList(Long.parseLong(s), scanStatus, orderSelfNumbering); + for (DistrilbutionAppBillLadingDetailVO detailVO : details) { Integer ss = detailVO.getScanStatus(); Integer errorStatus = detailVO.getErrorStatus(); - if(ss == 1){ + if (ss == 1) { detailVO.setScanStatusStr("未扫描"); - }else{ + } else { detailVO.setScanStatusStr("已扫描"); } - if(errorStatus == 0){ + if (errorStatus == 0) { detailVO.setErrorStatusStr("无异常"); - }else{ + } else { detailVO.setErrorStatusStr("有异常"); } } @@ -657,20 +666,20 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("stock_article_id",Long.parseLong(s)) - .eq("is_deleted",0); + queryWrapper.eq("stock_article_id", Long.parseLong(s)) + .eq("is_deleted", 0); List list = distributionParcelListService.list(queryWrapper); int pn = list.size(); planNum = planNum + pn; //通过订单id查询扫描表中有多少数据 QueryWrapper qw = new QueryWrapper<>(); - qw.eq("stock_article_id",Long.parseLong(s)) - .eq("is_deleted",0); + qw.eq("stock_article_id", Long.parseLong(s)) + .eq("is_deleted", 0); List ls = distributionBillLadingScanService.list(qw); int sn = ls.size(); - signedNum = signedNum +sn; + signedNum = signedNum + sn; - if(pn == sn){ + if (pn == sn) { conpleteNum++; } } @@ -686,23 +695,24 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl detailReservationOwn(IPage page, long id) { IPage distrilbutionBillLadingOwnVOIPage = baseMapper.detailReservationOwn(page, id); - distrilbutionBillLadingOwnVOIPage.getRecords().forEach( i ->{ + distrilbutionBillLadingOwnVOIPage.getRecords().forEach(i -> { List list = distributionStockupScanService.list(Wrappers.query().lambda() .eq(DistributionStockupScanEntity::getPackageType, '1') .eq(DistributionStockupScanEntity::getParcelListId, i.getId()) ); - i.setStockUp(list.size() > 0 ? "已备货": "未备货"); + i.setStockUp(list.size() > 0 ? "已备货" : "未备货"); }); return distrilbutionBillLadingOwnVOIPage; } /** * 提货库存品 + * * @param page * @param id * @return @@ -749,28 +762,28 @@ 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().size() > 0) { //查询库存品 - inventoryOwn.getRecords().forEach( i ->{ + inventoryOwn.getRecords().forEach(i -> { //是否备货 List list = distributionStockupScanService.list(Wrappers.query().lambda() .eq(DistributionStockupScanEntity::getPackageType, "2") .eq(DistributionStockupScanEntity::getStockListId, i.getId()) ); String s = ""; - if(list.size() > 0 && i.getQuantity() > list.size()){ + if (list.size() > 0 && i.getQuantity() > list.size()) { s = "备货中"; - }else if(list.size() > 0 && i.getQuantity() == list.size()){ + } else if (list.size() > 0 && i.getQuantity() == list.size()) { s = "备货完成"; - }else{ + } else { s = "未备货"; } i.setStockUp(s); i.setNumber(list.size() > 0 ? list.size() : 0); }); return inventoryOwn; - }else{ - return l; + } else { + return l; } @@ -778,6 +791,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = distrilbutionBillStockService.list(Wrappers.query().lambda() .eq(DistrilbutionBillStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) - .eq(DistrilbutionBillStockEntity::getOrderStatus,"1") - .or( eq ->eq.eq(DistrilbutionBillStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()).eq(DistrilbutionBillStockEntity::getOrderStatus,"2")) + .eq(DistrilbutionBillStockEntity::getOrderStatus, "1") + .or(eq -> eq.eq(DistrilbutionBillStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()).eq(DistrilbutionBillStockEntity::getOrderStatus, "2")) ); - list.forEach( i ->{ + list.forEach(i -> { List list2 = distributionStockArticleService.list(Wrappers.query().lambda().eq(DistributionStockArticleEntity::getId, i.getStockArticleId())); - if(list2.size() > 0){ + if (list2.size() > 0) { list1.addAll(DistributionStockArticleWrapper.build().listVO(list2)); } @@ -826,14 +841,14 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list3 = distributionDeliveryDetailsService.list(Wrappers.query().lambda() .eq(DistributionDeliveryDetailsEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) ); - if(list3.size() > 0){ - list3.forEach( i ->{ + if (list3.size() > 0) { + list3.forEach(i -> { DistributionStockListEntity one = distributionStockListService.getOne(Wrappers.query().lambda() .eq(DistributionStockListEntity::getId, i.getStockListId()) ); - if(ObjectUtils.isNotNull(one)){ + if (ObjectUtils.isNotNull(one)) { DistributionStockListVO distributionStockListVO = new DistributionStockListVO(); - BeanUtils.copyProperties(one,distributionStockListVO); + BeanUtils.copyProperties(one, distributionStockListVO); distributionStockListVO.setInventoryQuantity(i.getQuantity()); stockListEntities.add(distributionStockListVO); } @@ -846,6 +861,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl getInventory(IPage page, Map distrilbutionBillLading) { DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingEntity.class); IPage inventory = baseMapper.getInventory(page, distrilbutionBillLadingEntity); - inventory.getRecords().forEach( i ->{ + inventory.getRecords().forEach(i -> { - if(i.getQuantity().equals(i.getDeliveryNum())){ + if (i.getQuantity().equals(i.getDeliveryNum())) { //已备货 List list = distributionBillLadingScanService.list(Wrappers.query().lambda() .eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) .eq(DistributionBillLadingScanEntity::getMaterialType, '1') ); i.setEsauInventoryNum(list.size()); - }else{ + } else { //没有备货完成 i.setEsauInventoryNum(-1); } @@ -874,6 +890,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list3 = distributionBillLadingScanService.list(Wrappers.query().lambda() .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) .eq(DistributionBillLadingScanEntity::getMaterialType, type) .eq(DistributionBillLadingScanEntity::getPacketBarCode, coding) ); - if(list3.size() > 0){ - return R.fail(3001,"已签收!"); + if (list3.size() > 0) { + return R.fail(3001, "已签收!"); } //添加扫描记录 DistributionBillLadingScanEntity distributionBillLadingScan = new DistributionBillLadingScanEntity(); distributionBillLadingScan.setMaterialType((String) type); distributionBillLadingScan.setBillLadingId(Long.parseLong(billLadingId.toString())); - if(type.equals("1")){ + if (type.equals("1")) { //库存品 DistrilbutionBillLadingInventoryAppVO inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId), String.valueOf(coding)); - if(ObjectUtils.isNotNull(inventoryAppVO)){ + if (ObjectUtils.isNotNull(inventoryAppVO)) { //查询签收数量 List list = distributionBillLadingScanService.list(Wrappers.query().lambda() .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) .eq(DistributionBillLadingScanEntity::getMaterialType, "1") .eq(DistributionBillLadingScanEntity::getStockListId, inventoryAppVO.getStockListId()) ); - if(list.size() == inventoryAppVO.getQuantity()+1){ + if (list.size() == inventoryAppVO.getQuantity() + 1) { //修改完成状态 distributionAsyncService.getInventoryOrderSelfPickup(inventoryAppVO.getLdddId()); } @@ -919,25 +936,25 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list= distrilbutionBillStockService.list(Wrappers.query().lambda() + List list = distrilbutionBillStockService.list(Wrappers.query().lambda() .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) ); - if(list.size() < 1){ - return R.fail(3000,"当前提货任务,订单不存在!"); - }else{ + if (list.size() < 1) { + return R.fail(3000, "当前提货任务,订单不存在!"); + } else { AtomicBoolean n = new AtomicBoolean(false); - list.forEach(so ->{ + list.forEach(so -> { //查询包件信息 List list1 = distributionParcelListService.list(Wrappers.query().lambda() .eq(DistributionParcelListEntity::getStockArticleId, so.getStockArticleId()) .eq(DistributionParcelListEntity::getOrderPackageCode, coding) ); - if(list1.size() > 0){ + if (list1.size() > 0) { n.set(true); //查询订单包件数量签收的信息 DistributionStockArticleEntity one = distributionStockArticleService.getOne(Wrappers.query().lambda() @@ -949,7 +966,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImplquery().lambda() .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) @@ -962,17 +979,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl e.getConditions().equals("2")).count(); long count2 = list1.stream().filter(e -> e.getConditions().equals("2")).count(); - if(Integer.parseInt(String.valueOf(count)) == list.size() && Integer.parseInt(String.valueOf(count2)) == list1.size()){ + if (Integer.parseInt(String.valueOf(count)) == list.size() && Integer.parseInt(String.valueOf(count2)) == list1.size()) { //修改提货任务状态 DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity(); billLadingEntity.setId((Long) billLadingId); billLadingEntity.setConsignee("2"); baseMapper.updateById(billLadingEntity); } - return R.fail(200,"签收成功"); + return R.fail(200, "签收成功"); } } /** * 查询包件 + * * @param page * @param distrilbutionBillLading * @return @@ -1007,8 +1025,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl getInventoryNum(IPage page, Map distrilbutionBillLading) { DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingEntity.class); IPage inventory = baseMapper.getInventory(page, distrilbutionBillLadingEntity); - inventory.getRecords().forEach( i ->{ - if(i.getQuantity().equals(i.getDeliveryNum())){ + inventory.getRecords().forEach(i -> { + if (i.getQuantity().equals(i.getDeliveryNum())) { //已备货 List list = distributionBillLadingScanService.list(Wrappers.query().lambda() .eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) @@ -1020,11 +1038,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl{ + list1.forEach(di -> { DistrilbutionAppBillLadingDetailVO billLadingDetailVO = new DistrilbutionAppBillLadingDetailVO(); billLadingDetailVO.setOrderPackageCode(di.getCoding()); billLadingDetailVO.setScanStatus(Integer.parseInt(di.getConditions())); - switch (di.getConditions()){ + switch (di.getConditions()) { case "2": billLadingDetailVO.setScanStatusStr("待签收"); break; @@ -1035,7 +1053,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl ew.eq(DistrilbutionBillStockEntity::getBillLadingId, s).eq(DistrilbutionBillStockEntity::getOrderStatus, "2")) ); - if(list.size() > 0){ - list.forEach( li ->{ + if (list.size() > 0) { + list.forEach(li -> { DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); stockArticleEntity.setId(li.getStockArticleId()); @@ -1082,13 +1101,14 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distrilbutionBillLading) { DistrilbutionBillLadingDTO billLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingDTO.class); - DistrilbutionBillLadingVO billLadingVO = baseMapper.getBillLadingNum(billLadingEntity); //查询 + DistrilbutionBillLadingVO billLadingVO = baseMapper.getBillLadingNum(billLadingEntity); //查询 return billLadingVO; } /** * 查询详细信息 + * * @param id * @return */ @@ -1098,4 +1118,52 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl { + private IUserClient userCliient = SpringUtil.getBean(IUserClient.class); public static DistributionStockArticleWrapper build() { + return new DistributionStockArticleWrapper(); } @@ -27,16 +29,11 @@ public class DistributionStockArticleWrapper extends BaseEntityWrapper