|
|
@ -254,6 +254,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
reservationEntity.setReservationStatus(ReservationStatusConstant.daiqueren.getValue()); |
|
|
|
reservationEntity.setReservationStatus(ReservationStatusConstant.daiqueren.getValue()); |
|
|
|
//新建预约单订单处于未备货状态
|
|
|
|
//新建预约单订单处于未备货状态
|
|
|
|
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.weibeihuo.getValue()); |
|
|
|
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.weibeihuo.getValue()); |
|
|
|
|
|
|
|
reservationEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
this.save(reservationEntity); |
|
|
|
this.save(reservationEntity); |
|
|
|
//获取新增预约信息的编号
|
|
|
|
//获取新增预约信息的编号
|
|
|
|
Long reservationId = reservationEntity.getId(); |
|
|
|
Long reservationId = reservationEntity.getId(); |
|
|
@ -275,6 +276,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
AtomicReference<BigDecimal> initTotal = new AtomicReference<>(BigDecimal.ZERO); |
|
|
|
AtomicReference<BigDecimal> initTotal = new AtomicReference<>(BigDecimal.ZERO); |
|
|
|
//存在订单构建预约订单关联信息
|
|
|
|
//存在订单构建预约订单关联信息
|
|
|
|
if (!Func.isEmpty(stockArticleList)) { |
|
|
|
if (!Func.isEmpty(stockArticleList)) { |
|
|
|
|
|
|
|
boolean flag = stockArticleList.stream().anyMatch(s -> s.getReservationStatus().equals(OrderReservationStatusConstant.yiyueyue.getValue())); |
|
|
|
|
|
|
|
if (flag){ |
|
|
|
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
|
|
|
|
|
|
|
log.error("预约选择订单被多次预约"); |
|
|
|
|
|
|
|
return R.fail("订单已预约!!!"); |
|
|
|
|
|
|
|
} |
|
|
|
//存在订单的情况下才会对预约和包件的关系进行维护
|
|
|
|
//存在订单的情况下才会对预约和包件的关系进行维护
|
|
|
|
//选择了订单但是未进行包件的选择,默认选择了订单下的所有在库包件
|
|
|
|
//选择了订单但是未进行包件的选择,默认选择了订单下的所有在库包件
|
|
|
|
stockArticleList.forEach(s -> { |
|
|
|
stockArticleList.forEach(s -> { |
|
|
@ -542,6 +549,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
log.error("参数异常:+{" + stockUpInfo + "}"); |
|
|
|
log.error("参数异常:+{" + stockUpInfo + "}"); |
|
|
|
return R.fail("服务器正忙!!!"); |
|
|
|
return R.fail("服务器正忙!!!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)){ |
|
|
|
|
|
|
|
log.error("myCurrentWarehouse参数异常:+{"+myCurrentWarehouse+"}"); |
|
|
|
|
|
|
|
return R.fail("请先选择作业仓库!!!"); |
|
|
|
|
|
|
|
} |
|
|
|
boolean result = false; |
|
|
|
boolean result = false; |
|
|
|
try { |
|
|
|
try { |
|
|
|
//获取前端携带批量转备货的id
|
|
|
|
//获取前端携带批量转备货的id
|
|
|
@ -567,6 +579,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
stockupEntity.setTypeService(DistributionTypeConstant.shipie.getValue()); |
|
|
|
stockupEntity.setTypeService(DistributionTypeConstant.shipie.getValue()); |
|
|
|
//设置备货任务备货时间
|
|
|
|
//设置备货任务备货时间
|
|
|
|
stockupEntity.setStockupDate(date); |
|
|
|
stockupEntity.setStockupDate(date); |
|
|
|
|
|
|
|
//设置仓库
|
|
|
|
|
|
|
|
stockupEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
//保存备货任务数据获取备货数据ID
|
|
|
|
//保存备货任务数据获取备货数据ID
|
|
|
|
result = distributionStockupService.save(stockupEntity); |
|
|
|
result = distributionStockupService.save(stockupEntity); |
|
|
|
Long id = stockupEntity.getId(); |
|
|
|
Long id = stockupEntity.getId(); |
|
|
@ -712,6 +726,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionStockupEntity.setTypeService(DistributionTypeConstant.shipie.getValue()); |
|
|
|
distributionStockupEntity.setTypeService(DistributionTypeConstant.shipie.getValue()); |
|
|
|
//编码生成规则 BH+仓库编码+年月日+序号00001
|
|
|
|
//编码生成规则 BH+仓库编码+年月日+序号00001
|
|
|
|
distributionStockupEntity.setStockupCode(bianMa()); |
|
|
|
distributionStockupEntity.setStockupCode(bianMa()); |
|
|
|
|
|
|
|
distributionStockupEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
distributionStockupService.save(distributionStockupEntity); |
|
|
|
distributionStockupService.save(distributionStockupEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
HashSet<String> warehouseNames = new HashSet<>(); |
|
|
|
HashSet<String> warehouseNames = new HashSet<>(); |
|
|
@ -1220,6 +1235,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
//1、添加配送任务
|
|
|
|
//1、添加配送任务
|
|
|
|
DistributionStockupDTO stockup = allocationDTO.getStockup(); |
|
|
|
DistributionStockupDTO stockup = allocationDTO.getStockup(); |
|
|
|
DistributionStockupEntity stockupEntity = Func.copy(stockup, DistributionStockupEntity.class); |
|
|
|
DistributionStockupEntity stockupEntity = Func.copy(stockup, DistributionStockupEntity.class); |
|
|
|
|
|
|
|
stockupEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
if (!Func.isBlank(stockup.getForkliftName())) { |
|
|
|
if (!Func.isBlank(stockup.getForkliftName())) { |
|
|
|
stockupEntity.setAssignTime(new Date()); |
|
|
|
stockupEntity.setAssignTime(new Date()); |
|
|
|
stockupEntity.setForkliftId(stockupEntity.getForkliftId()); |
|
|
|
stockupEntity.setForkliftId(stockupEntity.getForkliftId()); |
|
|
@ -1233,6 +1249,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
stockupEntity.setStockupUser(user.getUserName()); |
|
|
|
stockupEntity.setStockupUser(user.getUserName()); |
|
|
|
stockupEntity.setStockupUserId(user.getUserId()); |
|
|
|
stockupEntity.setStockupUserId(user.getUserId()); |
|
|
|
|
|
|
|
stockupEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
stockupEntity.setLoaderId(stockup.getLoaderId()); |
|
|
|
stockupEntity.setLoaderId(stockup.getLoaderId()); |
|
|
|
stockupEntity.setStockupArea(stockup.getGoodsAreaName()); |
|
|
|
stockupEntity.setStockupArea(stockup.getGoodsAreaName()); |
|
|
|
stockupEntity.setOutboundDate(stockup.getOutboundDate()); |
|
|
|
stockupEntity.setOutboundDate(stockup.getOutboundDate()); |
|
|
@ -1255,8 +1272,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionDeliveryListService.save(distributionDeliveryListEntity); |
|
|
|
distributionDeliveryListService.save(distributionDeliveryListEntity); |
|
|
|
//获取所有订单
|
|
|
|
//获取所有订单
|
|
|
|
List<DistributionStockArticleDTO> stockArticle = allocationDTO.getStockArticle(); |
|
|
|
List<DistributionStockArticleDTO> stockArticle = allocationDTO.getStockArticle(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据运单号进行分组
|
|
|
|
//根据运单号进行分组
|
|
|
|
//TODO 这里先根据运单号进行运单信息查询,后期根据运单进行
|
|
|
|
//TODO 这里先根据运单号进行运单信息查询,后期根据运单进行
|
|
|
|
Map<String, List<DistributionStockArticleDTO>> mallClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getWaybillNumber)); |
|
|
|
Map<String, List<DistributionStockArticleDTO>> mallClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getWaybillNumber)); |
|
|
@ -1279,6 +1294,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
DistributionReservationDTO reservation = allocationDTO.getReservation(); |
|
|
|
DistributionReservationDTO reservation = allocationDTO.getReservation(); |
|
|
|
DistributionReservationEntity reservationEntity = Func.copy(reservation, DistributionReservationEntity.class); |
|
|
|
DistributionReservationEntity reservationEntity = Func.copy(reservation, DistributionReservationEntity.class); |
|
|
|
reservationEntity.setWaybillNo(k); |
|
|
|
reservationEntity.setWaybillNo(k); |
|
|
|
|
|
|
|
reservationEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
reservationEntity.setReservationStatus(ReservationStatusConstant.daipeisong.getValue()); |
|
|
|
reservationEntity.setReservationStatus(ReservationStatusConstant.daipeisong.getValue()); |
|
|
|
//这里采用订单上的收货信息
|
|
|
|
//这里采用订单上的收货信息
|
|
|
|
this.save(reservationEntity); |
|
|
|
this.save(reservationEntity); |
|
|
@ -1808,6 +1824,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
if (Func.isEmpty(myCurrentWarehouse)){ |
|
|
|
if (Func.isEmpty(myCurrentWarehouse)){ |
|
|
|
return R.fail("无仓库信息!!!"); |
|
|
|
return R.fail("无仓库信息!!!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//构建预约单
|
|
|
|
//构建预约单
|
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
Func.copy(distributionReservationDTO, reservationEntity); |
|
|
|
Func.copy(distributionReservationDTO, reservationEntity); |
|
|
@ -1847,6 +1864,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
if (!Func.isEmpty(stockArticleList)) { |
|
|
|
if (!Func.isEmpty(stockArticleList)) { |
|
|
|
//存在订单的情况下才会对预约和包件的关系进行维护
|
|
|
|
//存在订单的情况下才会对预约和包件的关系进行维护
|
|
|
|
//选择了订单但是未进行包件的选择,默认选择了订单下的所有在库包件
|
|
|
|
//选择了订单但是未进行包件的选择,默认选择了订单下的所有在库包件
|
|
|
|
|
|
|
|
boolean flag = stockArticleList.stream().anyMatch(s -> s.getReservationStatus().equals(OrderReservationStatusConstant.yiyueyue.getValue())); |
|
|
|
|
|
|
|
if (flag){ |
|
|
|
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
|
|
|
|
|
|
|
log.error("预约选择订单被多次预约"); |
|
|
|
|
|
|
|
return R.fail("订单已预约!!!"); |
|
|
|
|
|
|
|
} |
|
|
|
stockArticleList.forEach(s -> { |
|
|
|
stockArticleList.forEach(s -> { |
|
|
|
// storeName.add(s.getStoreName());
|
|
|
|
// storeName.add(s.getStoreName());
|
|
|
|
// mallName.add(s.getMallName());
|
|
|
|
// mallName.add(s.getMallName());
|
|
|
|