|
|
|
@ -523,9 +523,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
log.error("参数错误+{" + distributionReservationDTO + "}"); |
|
|
|
|
return R.status(false); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Func.isEmpty(distributionReservationDTO.getWarehouseId())) { |
|
|
|
|
// 获取商场的仓库
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
distributionReservationDTO.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
distributionReservationDTO.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
|
if (Func.isEmpty(distributionReservationDTO.getWarehouseId())) { |
|
|
|
@ -534,19 +534,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
// if (Func.isEmpty(distributionReservationDTO.getWarehouseName())){
|
|
|
|
|
// log.error("WarehouseName参数错误+{" + distributionReservationDTO.getWarehouseName() + "}");
|
|
|
|
|
// return R.status(false);
|
|
|
|
|
// }
|
|
|
|
|
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
|
|
|
|
|
// if (Func.isEmpty(myCurrentWarehouse)) {
|
|
|
|
|
// return R.fail("无仓库信息!!!");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//构建预约单
|
|
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
|
Func.copy(distributionReservationDTO, reservationEntity); |
|
|
|
@ -958,7 +945,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
|
|
|
|
String format1 = format.format(new Date()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) { |
|
|
|
|
sb.append(warehouseByDepartment.getWarehouseCode()); |
|
|
|
|
sb.append(format1); |
|
|
|
@ -982,7 +969,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
|
|
|
|
String format1 = format.format(new Date()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) { |
|
|
|
|
sb.append(warehouseByDepartment.getWarehouseCode()); |
|
|
|
|
sb.append(format1); |
|
|
|
@ -1007,7 +994,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
|
|
|
|
String format1 = format.format(new Date()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) { |
|
|
|
|
sb.append(warehouseByDepartment.getWarehouseCode()); |
|
|
|
|
sb.append(format1); |
|
|
|
@ -1031,7 +1018,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
|
|
|
|
String format1 = format.format(new Date()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) { |
|
|
|
|
sb.append(warehouseByDepartment.getWarehouseCode()); |
|
|
|
|
sb.append(format1); |
|
|
|
@ -1251,7 +1238,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//这里站配送任务主要有两个方面
|
|
|
|
|
//1、针对市配订单需要将预约信息填充至配送计划中
|
|
|
|
|
//2、商配跳过预约阶段直接将订单信息和配送计划进行关联
|
|
|
|
|
if (Func.isEmpty(allocationDTO)) { |
|
|
|
|
if (Objects.isNull(allocationDTO)) { |
|
|
|
|
log.error("参数异常allocationDTO:+{" + allocationDTO + "}"); |
|
|
|
|
return R.fail("服务器正忙!!!"); |
|
|
|
|
} |
|
|
|
@ -1289,7 +1276,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//司机名称拼接
|
|
|
|
|
StringBuilder driverNames = new StringBuilder(); |
|
|
|
|
//查询根据预约ID查询这些预约的备货状态
|
|
|
|
|
List<DistributionReservationEntity> reservationEntityList = baseMapper.selectList(Wrappers.<DistributionReservationEntity>query().lambda().eq(DistributionReservationEntity::getId, ids)); |
|
|
|
|
List<DistributionReservationEntity> reservationEntityList = baseMapper.selectList(Wrappers.<DistributionReservationEntity>query().lambda() |
|
|
|
|
.in(DistributionReservationEntity::getId, ids) |
|
|
|
|
); |
|
|
|
|
//判断是否存在预约进行了配送任务的提交
|
|
|
|
|
boolean match = reservationEntityList.stream().anyMatch(r -> ReservationStatusConstant.daipeisong.getValue().equals(r.getReservationStatus())); |
|
|
|
|
if (match) { |
|
|
|
@ -1322,11 +1311,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (Func.equals(reservationEntity.getStockupStatus(), ReservationStockupStatusConstant.weibeihuo.getValue())) { |
|
|
|
|
//如果预约已经备货
|
|
|
|
|
//如果预约未进行备货
|
|
|
|
|
DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity(); |
|
|
|
|
stockupInfoEntity.setStockUpType(StockupTypeConstant.shipei.getValue()); |
|
|
|
|
stockupInfoEntity.setReservationId(ids.get(i)); |
|
|
|
|
stockupInfoEntity.setStockupId(stockupEntity.getId()); |
|
|
|
|
if(stockupEntity!=null){ |
|
|
|
|
stockupInfoEntity.setStockupId(stockupEntity.getId()); |
|
|
|
|
} |
|
|
|
|
distributionStockupInfoService.save(stockupInfoEntity); |
|
|
|
|
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); |
|
|
|
|
} |
|
|
|
|