|
|
|
@ -2856,6 +2856,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
reservationEntity.setPeriodOfTime(ServiceConstant.RESERVATION_PERIOED_TIME_DAY); |
|
|
|
|
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); |
|
|
|
|
reservationEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
reservationEntity.setReservationCode(reservationMa()); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
reservationEntity.setCreateUser(user.getUserId()); |
|
|
|
|
reservationEntity.setDeliveryWay(reservation.getDeliveryWay()); |
|
|
|
@ -2865,6 +2866,31 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
reservationEntity.setUpdateUser(user.getUserId()); |
|
|
|
|
reservationEntity.setIsDeleted(0); |
|
|
|
|
reservationEntity.setStatus(1); |
|
|
|
|
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); |
|
|
|
|
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); |
|
|
|
|
reservationEntity.setStatus(1); |
|
|
|
|
String waybillNumbers = v.stream().map(DistributionStockArticleEntity::getWaybillNumber).distinct().collect(Collectors.joining(",")); |
|
|
|
|
String storeCodes = v.stream().map(DistributionStockArticleEntity::getStoreCode).distinct().collect(Collectors.joining(",")); |
|
|
|
|
List<Long> waybillIds = v.stream().map(DistributionStockArticleEntity::getWaybillId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<Long> mallIds = v.stream().map(DistributionStockArticleEntity::getMallId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<Long> storeIds = v.stream().map(DistributionStockArticleEntity::getStoreId).distinct().collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(waybillNumbers)){ |
|
|
|
|
reservationEntity.setWaybillNo(waybillNumbers); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(storeCodes)){ |
|
|
|
|
reservationEntity.setStoreName(storeCodes); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(waybillIds)){ |
|
|
|
|
String w = waybillIds.stream().map(String::valueOf).collect(Collectors.joining(",")); |
|
|
|
|
reservationEntity.setWaybillId(w); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(mallIds) && mallIds.size() == 1){ |
|
|
|
|
reservationEntity.setMallId(mallIds.get(0)); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(storeIds) && storeIds.size() == 1){ |
|
|
|
|
reservationEntity.setStoreId(storeIds.get(0)); |
|
|
|
|
} |
|
|
|
|
reservationEntity.setStatus(1); |
|
|
|
|
distributionReservationMapper.insert(reservationEntity); |
|
|
|
|
//新增一个客户
|
|
|
|
|
v.forEach(s -> { |
|
|
|
@ -2917,7 +2943,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//添加订单下的所有在库订单的包件
|
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()).ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()).ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue()).notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()})); |
|
|
|
|
if (Func.isEmpty(distributionParcelListEntities)) { |
|
|
|
|
|
|
|
|
|
throw new RuntimeException(s.getOrderCode() + "无可用数量"); |
|
|
|
|
} |
|
|
|
|
distributionParcelListEntities.forEach(dp -> { |
|
|
|
@ -2940,7 +2965,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
|
|
|
|
|
}); |
|
|
|
|
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
@ -6515,6 +6539,29 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String reservationMa() { |
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
sb.append("YY"); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
|
|
|
|
String format1 = format.format(new Date()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = warehouseClient.getWarehouseByDepartment(user.getDeptId()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) { |
|
|
|
|
sb.append(warehouseByDepartment.getWarehouseCode()); |
|
|
|
|
sb.append(format1); |
|
|
|
|
String s = "YY" + warehouseByDepartment.getWarehouseCode(); |
|
|
|
|
String s1 = jiShuan(s); |
|
|
|
|
sb.append(s1); |
|
|
|
|
} else { |
|
|
|
|
sb.append("00000"); |
|
|
|
|
sb.append(format1); |
|
|
|
|
String s = "YY" + "00000"; |
|
|
|
|
String s1 = jiShuan(s); |
|
|
|
|
sb.append(s1); |
|
|
|
|
} |
|
|
|
|
return sb.toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String bianMa() { |
|
|
|
|