diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java index b4d2e6835..5cb1f2b4d 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.feign; +import com.alibaba.fastjson.JSONObject; import com.logpm.distribution.dto.FindParamterDTO; import com.logpm.distribution.dto.OrderPackageDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; @@ -211,6 +212,10 @@ public interface IDistributionParcelListClient { @PostMapping(API_PREFIX + "/clearPallet") void clearPallet(@RequestBody List orderPackageIdList); + @GetMapping(API_PREFIX + "/findPackageGoodsListByWaybillNo") + List findPackageGoodsListByWaybillNo(@RequestParam String waybillNo); + @GetMapping(API_PREFIX + "/findListByStockArticleId") + List findListByStockArticleId(@RequestParam Long articleId); } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java index 8409a7f32..ba1b057c7 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java @@ -61,6 +61,7 @@ public class LoadCarsDTO implements Serializable { private String orderPackageCode; private List productInfoList = new ArrayList<>(); + private List zeroPackageList = new ArrayList<>(); private String goodsName; diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/ZeroPackageDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/ZeroPackageDTO.java new file mode 100644 index 000000000..4acac8b3e --- /dev/null +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/ZeroPackageDTO.java @@ -0,0 +1,15 @@ +package com.logpm.trunkline.dto; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ZeroPackageDTO implements Serializable { + + private Long packageId; + private Long goodsId; + private String goodsName;//品类名称 + private Integer enterNum;//装车数量 + +} diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineScanZeroDetailEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineScanZeroDetailEntity.java new file mode 100644 index 000000000..e1b837ef8 --- /dev/null +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineScanZeroDetailEntity.java @@ -0,0 +1,51 @@ +package com.logpm.trunkline.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +@Data +@TableName("logpm_trunkline_scan_zero_detail") +@ApiModel(value = "TrunklineScanZeroDetail对象", description = "装车扫描零担明细表") +@EqualsAndHashCode(callSuper = true) +public class TrunklineScanZeroDetailEntity extends TenantEntity { + + /** 预留1 */ + @ApiModelProperty(name = "预留1",notes = "") + private String reserve1 ; + /** 预留2 */ + @ApiModelProperty(name = "预留2",notes = "") + private String reserve2 ; + /** 预留3 */ + @ApiModelProperty(name = "预留3",notes = "") + private String reserve3 ; + /** 预留4 */ + @ApiModelProperty(name = "预留4",notes = "") + private String reserve4 ; + /** 预留5 */ + @ApiModelProperty(name = "预留5",notes = "") + private String reserve5 ; + /** scanId */ + @ApiModelProperty(name = "装车扫描id",notes = "") + private Long scanId ; + /** packageId */ + @ApiModelProperty(name = "包件id",notes = "") + private Long packageId ; + /** goodsId */ + @ApiModelProperty(name = "品类id",notes = "") + private Long goodsId ; + /** goodsName */ + @ApiModelProperty(name = "品类名称",notes = "") + private String goodsName ; + /** loadingNum */ + @ApiModelProperty(name = "装车数量",notes = "") + private Integer loadingNum ; + /** unloadNum */ + @ApiModelProperty(name = "卸车数量",notes = "") + private Integer unloadNum ; + + +} diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/LoadZeroListVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/LoadZeroListVO.java index c07d2669a..d521f7abf 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/LoadZeroListVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/LoadZeroListVO.java @@ -3,6 +3,8 @@ package com.logpm.trunkline.vo; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; @Data public class LoadZeroListVO implements Serializable { @@ -12,4 +14,7 @@ public class LoadZeroListVO implements Serializable { private Integer planNum;//计划装车件数 private Integer loadingNum;//已装车件数 private Integer unloadingNum;//已卸车件数 + + private List zeroPackageList = new ArrayList<>(); + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ZeroPackageVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ZeroPackageVO.java new file mode 100644 index 000000000..51e9df223 --- /dev/null +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ZeroPackageVO.java @@ -0,0 +1,15 @@ +package com.logpm.trunkline.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ZeroPackageVO implements Serializable { + + private Long packageId; + private Long goodsId; + private String goodsName;//品类名称 + private Integer stockNum;//品类在库件数 + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java index 816f5d8bc..abb6d2ecf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java @@ -18,6 +18,7 @@ package com.logpm.distribution.feign; import cn.hutool.core.collection.CollUtil; import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -502,4 +503,17 @@ public class DistributionParcelListClient implements IDistributionParcelListClie public void clearPallet(List orderPackageIdList) { distributionParcelListService.clearPalletByIds(orderPackageIdList); } + + @Override + public List findPackageGoodsListByWaybillNo(String waybillNo) { + return distributionParcelListService.findPackageGoodsListByWaybillNo(waybillNo); + } + + @Override + public List findListByStockArticleId(Long articleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("stock_article_id",articleId); + + return distributionParcelListService.list(queryWrapper); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java index a0bff054b..98d024307 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.mapper; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.dto.DistributionParcelListDTO; @@ -296,4 +297,6 @@ public interface DistributionParcelListMapper extends BaseMapper parcelListIdList, @Param("orderCode") String orderCode); void clearAllocationByIds(@Param("clearTrayList") List clearTrayList); + + List findPackageGoodsListByWaybillNo(@Param("waybillNo") String waybillNo); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 78c93bb8e..dabe84761 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -1874,4 +1874,15 @@ + + + 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 3f363a7e2..a9d902ce7 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 @@ -16,6 +16,7 @@ */ package com.logpm.distribution.service; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; @@ -255,4 +256,6 @@ public interface IDistributionParcelListService extends BaseService clearTrayList); + List findPackageGoodsListByWaybillNo(String waybillNo); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java index dd02ac449..a45ee4d5a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java @@ -32,23 +32,12 @@ import com.logpm.basicdata.feign.IBasicdataClientClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.dto.DistributionParcelListDTO; import com.logpm.distribution.dto.app.StockupDTO; -import com.logpm.distribution.entity.DistributionParcelDetailsEntity; -import com.logpm.distribution.entity.DistributionParcelListEntity; -import com.logpm.distribution.entity.DistributionParcelNumberEntity; -import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity; -import com.logpm.distribution.entity.DistributionStockArticleEntity; -import com.logpm.distribution.entity.DistributionStockListEntity; -import com.logpm.distribution.entity.DistributionStockListInfoEntity; -import com.logpm.distribution.entity.DistrilbutionBillPackageEntity; +import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionParcelListExcel; import com.logpm.distribution.mapper.DistributionParcelListMapper; import com.logpm.distribution.mapper.DistributionStockArticleMapper; import com.logpm.distribution.service.*; -import com.logpm.distribution.vo.DistributionParcelListBaseVO; -import com.logpm.distribution.vo.DistributionParcelListNodeVO; -import com.logpm.distribution.vo.DistributionParcelListVO; -import com.logpm.distribution.vo.DistributionParcelListZeroVO; -import com.logpm.distribution.vo.PackageStockupVO; +import com.logpm.distribution.vo.*; import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient; import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; import com.logpm.warehouse.entity.WarehouseWaybillEntity; @@ -1360,6 +1349,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl findPackageGoodsListByWaybillNo(String waybillNo) { + return baseMapper.findPackageGoodsListByWaybillNo(waybillNo); + } + private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) { JSONObject trunklinePackageTrackLog = new JSONObject(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java index 6dc0915ea..b85435e87 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java @@ -6,6 +6,7 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.trunkline.dto.LoadCarsDTO; import com.logpm.trunkline.dto.LoadingPackageDTO; import com.logpm.trunkline.dto.LoadingZeroDTO; +import com.logpm.trunkline.dto.ZeroPackageDTO; import com.logpm.trunkline.service.ITrunklineCarsLoadService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -420,8 +421,7 @@ public class CarsLoadApiController { String trayCode = loadCarsDTO.getTrayCode(); Integer enterNum = loadCarsDTO.getEnterNum(); String orderCode = loadCarsDTO.getOrderCode(); - -// List productInfoList = loadCarsDTO.getProductInfoList(); + List zeroPackageList = loadCarsDTO.getZeroPackageList(); try{ //当前登录人选择的仓库 @@ -457,7 +457,7 @@ public class CarsLoadApiController { // return R.fail(405,"零担品类信息为空"); // } - return carsLoadService.loadingZero(loadId,myCurrentWarehouse.getId(),waybillNo,orderCode,trayCode,enterNum,"正常装车"); + return carsLoadService.loadingZero(loadId,myCurrentWarehouse.getId(),waybillNo,orderCode,trayCode,enterNum,"正常装车",zeroPackageList); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineScanZeroDetailMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineScanZeroDetailMapper.java new file mode 100644 index 000000000..b9881f419 --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineScanZeroDetailMapper.java @@ -0,0 +1,12 @@ +package com.logpm.trunkline.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity; +import org.mapstruct.Mapper; + +@Mapper +public interface TrunklineScanZeroDetailMapper extends BaseMapper { + + + +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java index 0c29aa26a..6d5697895 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.trunkline.dto.BatchUnloadDTO; import com.logpm.trunkline.dto.LoadCarsDTO; import com.logpm.trunkline.dto.TrunklineCarsLoadDTO; +import com.logpm.trunkline.dto.ZeroPackageDTO; import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; import com.logpm.trunkline.vo.LoadingDetailExportVO; import com.logpm.trunkline.vo.TripartiteTransferVO; @@ -76,7 +77,7 @@ public interface ITrunklineCarsLoadService extends BaseService zeroPackageList); R findZeroAllocation(String orderCode, Long warehouseId); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineScanZeroDetailService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineScanZeroDetailService.java new file mode 100644 index 000000000..320846b09 --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineScanZeroDetailService.java @@ -0,0 +1,7 @@ +package com.logpm.trunkline.service; + +import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity; +import org.springblade.core.mp.base.BaseService; + +public interface ITrunklineScanZeroDetailService extends BaseService { +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 72a2039c5..5dd3b6cc9 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -4678,10 +4678,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService { List parcelNumberList = new ArrayList<>(); for (WarehouseWayBillDetail warehouseWayBillDetail : wayBillDetailList) { DistributionParcelListEntity entity = new DistributionParcelListEntity(); + entity.setBrandId(warehouseWaybill.getBrandId()); + entity.setBrandName(warehouseWaybill.getBrand()); + entity.setDealerName(warehouseWaybill.getConsignee()); entity.setFirsts(warehouseWayBillDetail.getProductName()); entity.setWarehouseId(distributionStockArticleEntity.getWarehouseId()); entity.setWarehouse(distributionStockArticleEntity.getWarehouse()); entity.setQuantity(warehouseWayBillDetail.getNum()); + entity.setTrainNumber(warehouseWaybill.getCustomerTrain()); entity.setConditions(1); entity.setStockArticleId(orderId); entity.setOrderCode(distributionStockArticleEntity.getOrderCode()); @@ -4694,6 +4698,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { entity.setWaybillId(warehouseWaybill.getId()); entity.setWaybillNumber(warehouseWaybill.getWaybillNo()); entity.setIsZero("1"); + entity.setAdvanceId(warehouseWayBillDetail.getId()); entity.setWarehouseEntryTimeEnd(date); entity.setSendWarehouseId(departureWarehouseId); entity.setSendWarehouseName(departureWarehouseName); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index a33e10310..63c44abd7 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -122,6 +122,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl loadCarsPageList(LoadCarsDTO loadCarsDTO) { @@ -3015,8 +3016,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl zeroPackageList) { TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); if (Objects.isNull(carsLoadEntity)) { @@ -3071,6 +3073,28 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListClient.findListByStockArticleId(articleId); + //把parcelListEntities转化为id作为key的Map + Map parcelListMapById = parcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity())); + + + //把parcelListEntities转化成以firsts作为key的map + Map parcelListMap = parcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getFirsts, Function.identity())); + if(CollUtil.isNotEmpty(zeroPackageList)){ + for (ZeroPackageDTO zeroPackageDTO : zeroPackageList) { + Integer en = zeroPackageDTO.getEnterNum(); + String gn = zeroPackageDTO.getGoodsName(); + DistributionParcelListEntity parcelList = parcelListMap.get(gn); + if(Objects.isNull(parcelList)){ + log.warn("##################loadingZero: 品类信息不存在 gn={}", gn); + return R.fail(405, "品类信息有误"); + } + } + + } + Long loadScanId = null; Integer isAbnormal = 0; Integer isData = 1; @@ -3152,6 +3176,51 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl zeroDetailList = new ArrayList<>(); + List updateParceList = new ArrayList<>(); + if(CollUtil.isNotEmpty(zeroPackageList)){ + Long finalLoadScanId = loadScanId; + zeroPackageList.forEach(zeroPackageDTO -> { + TrunklineScanZeroDetailEntity scanZeroDetailEntity = new TrunklineScanZeroDetailEntity(); + scanZeroDetailEntity.setGoodsId(zeroPackageDTO.getGoodsId()); + scanZeroDetailEntity.setScanId(finalLoadScanId); + scanZeroDetailEntity.setGoodsName(zeroPackageDTO.getGoodsName()); + scanZeroDetailEntity.setPackageId(zeroPackageDTO.getPackageId()); + scanZeroDetailEntity.setLoadingNum(zeroPackageDTO.getEnterNum()); + scanZeroDetailEntity.setUnloadNum(0); + zeroDetailList.add(scanZeroDetailEntity); + DistributionParcelListEntity parcelList = parcelListMap.get(zeroPackageDTO.getGoodsName()); + Integer quantity = parcelList.getQuantity(); + DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); + updateEntity.setId(parcelList.getId()); + updateEntity.setQuantity(quantity-zeroPackageDTO.getEnterNum()); + updateParceList.add(updateEntity); + }); + }else{ + if(enterNum == handQuantity){ + Long finalLoadScanId = loadScanId; + parcelListEntities.forEach(entity -> { + Long waybillDetailId = entity.getAdvanceId(); + WarehouseWayBillDetail entityByWaybillDetailId = warehouseWaybillDetailClient.findEntityByWaybillDetailId(waybillDetailId); + TrunklineScanZeroDetailEntity scanZeroDetailEntity = new TrunklineScanZeroDetailEntity(); + scanZeroDetailEntity.setGoodsId(entityByWaybillDetailId.getProductId()); + scanZeroDetailEntity.setScanId(finalLoadScanId); + scanZeroDetailEntity.setGoodsName(entityByWaybillDetailId.getProductName()); + scanZeroDetailEntity.setPackageId(entity.getId()); + scanZeroDetailEntity.setLoadingNum(entityByWaybillDetailId.getNum()); + scanZeroDetailEntity.setUnloadNum(0); + zeroDetailList.add(scanZeroDetailEntity); + Integer quantity = entity.getQuantity(); + DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); + updateEntity.setId(entity.getId()); + updateEntity.setQuantity(quantity-entityByWaybillDetailId.getNum()); + updateParceList.add(updateEntity); + }); + } + } + scanZeroDetailService.saveBatch(zeroDetailList); + distributionParcelListClient.updateList(updateParceList); + difficult = enterNum; distributionStockArticleClient.submitHandleNumByOrderId(enterNum, articleId); } else { @@ -3178,6 +3247,41 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl zeroDetailList = new ArrayList<>(); + List updateParceList = new ArrayList<>(); + + QueryWrapper queryWrapper1 = new QueryWrapper<>(); + queryWrapper1.eq("scanId",loadScanId); + List scanZeroDetailEntities = scanZeroDetailService.list(queryWrapper1); + //把scanZeroDetailEntities中所有元素的scanId作为key转为Map + Map map = scanZeroDetailEntities.stream().collect(Collectors.toMap(TrunklineScanZeroDetailEntity::getPackageId, Function.identity())); + + for (ZeroPackageDTO zeroPackageDTO : zeroPackageList) { + Long packageId = zeroPackageDTO.getPackageId(); + Integer enterNum1 = zeroPackageDTO.getEnterNum(); + TrunklineScanZeroDetailEntity scanZeroDetailEntity = map.get(packageId); + if(Objects.isNull(scanZeroDetailEntity)){ + log.warn("##################loadingZero: 品类信息不存在 packageId={}", packageId); + return R.fail(405, "品类信息有误"); + } + DistributionParcelListEntity parcelList = parcelListMapById.get(packageId); + if(Objects.isNull(parcelList)){ + log.warn("##################loadingZero: 包件信息不存在 packageId={}", packageId); + return R.fail(405, "包件信息不存在"); + } + Integer quantity = parcelList.getQuantity(); + + Integer loadingNum = scanZeroDetailEntity.getLoadingNum(); + int i2 = enterNum1 - loadingNum; + parcelList.setQuantity(quantity-i2); + updateParceList.add(parcelList); + scanZeroDetailEntity.setLoadingNum(enterNum1); + zeroDetailList.add(scanZeroDetailEntity); + } + + distributionParcelListClient.updateList(updateParceList); + scanZeroDetailService.updateBatchById(zeroDetailList); } audio = (enterNum)+"件"; @@ -5929,7 +6033,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl zeroList = trunklineCarsOrderService.findZeroList(loadId, warehouseId); + zeroList.forEach(loadZeroListVO -> { + String waybillNo = loadZeroListVO.getWaybillNo(); + List zeroPackageList = distributionParcelListClient.findPackageGoodsListByWaybillNo(waybillNo); + List ls = new ArrayList<>(); + zeroPackageList.forEach(jsonObject -> { + ls.add(jsonObject.toJavaObject(ZeroPackageVO.class)); + }); + loadZeroListVO.setZeroPackageList(ls); + }); + //查询异常列表 QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineScanZeroDetailServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineScanZeroDetailServiceImpl.java new file mode 100644 index 000000000..575146d32 --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineScanZeroDetailServiceImpl.java @@ -0,0 +1,15 @@ +package com.logpm.trunkline.service.impl; + +import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity; +import com.logpm.trunkline.mapper.TrunklineScanZeroDetailMapper; +import com.logpm.trunkline.service.ITrunklineScanZeroDetailService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +@Slf4j +public class TrunklineScanZeroDetailServiceImpl extends BaseServiceImpl implements ITrunklineScanZeroDetailService { +}