|
|
|
@ -462,8 +462,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//统计数量
|
|
|
|
|
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee()); |
|
|
|
|
reservationEntity.setFee(fee); |
|
|
|
|
String random = Func.random(13, RandomType.ALL); |
|
|
|
|
reservationEntity.setReservationCode(random); |
|
|
|
|
reservationEntity.setReservationCode(reservationMa()); |
|
|
|
|
//设置预约为市配
|
|
|
|
|
reservationEntity.setDeliveryType(DistributionTypeConstant.shipie.getValue()); |
|
|
|
|
reservationEntity.setReservationNum(packageTotal.get()); |
|
|
|
@ -512,11 +511,83 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
return sb.toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
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 = basicdataWarehouseClient.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(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String deliveryListMa() { |
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
sb.append("PS"); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
|
|
|
|
String format1 = format.format(new Date()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) { |
|
|
|
|
sb.append(warehouseByDepartment.getWarehouseCode()); |
|
|
|
|
sb.append(format1); |
|
|
|
|
String s = "PS" + warehouseByDepartment.getWarehouseCode(); |
|
|
|
|
String s1 = jiShuan(s); |
|
|
|
|
sb.append(s1); |
|
|
|
|
} else { |
|
|
|
|
sb.append("00000"); |
|
|
|
|
sb.append(format1); |
|
|
|
|
String s = "PS" + "00000"; |
|
|
|
|
String s1 = jiShuan(s); |
|
|
|
|
sb.append(s1); |
|
|
|
|
} |
|
|
|
|
return sb.toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String trainNumberMa() { |
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
sb.append("PSCC"); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
|
|
|
|
String format1 = format.format(new Date()); |
|
|
|
|
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) { |
|
|
|
|
sb.append(warehouseByDepartment.getWarehouseCode()); |
|
|
|
|
sb.append(format1); |
|
|
|
|
String s = "PSCC" + warehouseByDepartment.getWarehouseCode(); |
|
|
|
|
String s1 = jiShuan(s); |
|
|
|
|
sb.append(s1); |
|
|
|
|
} else { |
|
|
|
|
sb.append("00000"); |
|
|
|
|
sb.append(format1); |
|
|
|
|
String s = "PSCC" + "00000"; |
|
|
|
|
String s1 = jiShuan(s); |
|
|
|
|
sb.append(s1); |
|
|
|
|
} |
|
|
|
|
return sb.toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String jiShuan(String s) { |
|
|
|
|
String n = "00001"; |
|
|
|
|
if (Func.notNull(bladeRedis.get(s))) { |
|
|
|
|
Object o1 = bladeRedis.get(s); |
|
|
|
|
|
|
|
|
|
int anInt = Integer.parseInt(String.valueOf(o1)); |
|
|
|
|
if (anInt < 10) { |
|
|
|
|
if (anInt + 1 == 10) { |
|
|
|
@ -530,7 +601,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
} else { |
|
|
|
|
n = String.format("000%d", anInt + 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else if (anInt < 1000) { |
|
|
|
|
if (anInt + 1 == 1000) { |
|
|
|
|
n = String.format("0%d", anInt + 1); |
|
|
|
@ -629,26 +699,38 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionReservationEntity> getReservationAddr(String ids) { |
|
|
|
|
public List<DistributionReservationVO> getReservationAddr(String ids) { |
|
|
|
|
if (Func.isBlank(ids)) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
String[] split = ids.split(","); |
|
|
|
|
|
|
|
|
|
List<DistributionReservationEntity> distributionReservationVOS = new ArrayList<>(); |
|
|
|
|
if (split.length == 1) { |
|
|
|
|
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(ids); |
|
|
|
|
distributionReservationVOS.add(reservationEntity); |
|
|
|
|
} else { |
|
|
|
|
for (String s : split) { |
|
|
|
|
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(s); |
|
|
|
|
distributionReservationVOS.add(reservationEntity); |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
List<DistributionReservationVO> reservationVOList = null; |
|
|
|
|
if (Func.isNotEmpty(myCurrentWarehouse)){ |
|
|
|
|
List<Long> longs = Func.toLongList(ids); |
|
|
|
|
List<DistributionReservationEntity> reservationEntityList = this.listByIds(longs); |
|
|
|
|
reservationVOList = DistributionReservationWrapper.build().listVO(reservationEntityList); |
|
|
|
|
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(reservationVOList.get(0).getWarehouseId()); |
|
|
|
|
if (Func.isNotEmpty(entityWarehouseId)){ |
|
|
|
|
reservationVOList.stream().forEach(r->{r.setJingdu(entityWarehouseId.getLongitude());r.setWeidu(entityWarehouseId.getLatitude());}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Page<DistributionReservationEntity> distributionReservationVOPage = new Page<>(); |
|
|
|
|
Page<DistributionReservationEntity> resultPage = distributionReservationVOPage.setRecords(distributionReservationVOS); |
|
|
|
|
return resultPage; |
|
|
|
|
|
|
|
|
|
// String[] split = ids.split(",");
|
|
|
|
|
//
|
|
|
|
|
// List<DistributionReservationEntity> distributionReservationVOS = new ArrayList<>();
|
|
|
|
|
// if (split.length == 1) {
|
|
|
|
|
// DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(ids);
|
|
|
|
|
// distributionReservationVOS.add(reservationEntity);
|
|
|
|
|
// } else {
|
|
|
|
|
// for (String s : split) {
|
|
|
|
|
// DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(s);
|
|
|
|
|
// distributionReservationVOS.add(reservationEntity);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return reservationVOList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -695,9 +777,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
|
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity(); |
|
|
|
|
//设置车次号
|
|
|
|
|
String today = DateUtil.today(); |
|
|
|
|
String random = Func.random(7, RandomType.ALL); |
|
|
|
|
distributionDeliveryListEntity.setTrainNumber(random + today); |
|
|
|
|
// String today = DateUtil.today();
|
|
|
|
|
// String random = Func.random(7, RandomType.ALL);
|
|
|
|
|
distributionDeliveryListEntity.setTrainNumber(trainNumberMa()); |
|
|
|
|
distributionDeliveryListEntity.setFee(BigDecimal.ZERO); |
|
|
|
|
distributionDeliveryListEntity.setPrice(BigDecimal.ZERO); |
|
|
|
|
distributionDeliveryListService.save(distributionDeliveryListEntity); |
|
|
|
@ -751,7 +833,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
stockupEntity.setStockupCode(bianMa()); |
|
|
|
|
stockupEntity.setStockupStatus(StockupStatusConstant.weibeihuo.getValue()); |
|
|
|
|
stockupEntity.setStockupDate(new Date()); |
|
|
|
|
stockupEntity.setOutboundDate(new Date()); |
|
|
|
|
// stockupEntity.setOutboundDate(new Date());
|
|
|
|
|
stockupEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
distributionStockupService.save(stockupEntity); |
|
|
|
|
} |
|
|
|
@ -768,7 +850,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); |
|
|
|
|
} |
|
|
|
|
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity(); |
|
|
|
|
distributionSignforEntity.setTrainNumber(random); |
|
|
|
|
distributionSignforEntity.setTrainNumber(trainNumberMa()); |
|
|
|
|
distributionSignforEntity.setReservationId(reservationEntity.getId()); |
|
|
|
|
distributionSignforEntity.setDeliveryId(distributionDeliveryListEntity.getId()); |
|
|
|
|
distributionSignforEntity.setSigningStatus(SignforStatusConstant.daiqianshou.getValue()); |
|
|
|
@ -912,7 +994,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionDeliveryListEntity.setType(DistributionTypeConstant.shipie.getValue()); |
|
|
|
|
distributionDeliveryListEntity.setOrderCode(String.join(",", hashSet)); |
|
|
|
|
// distributionDeliveryListEntity.setTaskTime(allocationDTO.getTaskTime());
|
|
|
|
|
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT)); |
|
|
|
|
distributionDeliveryListEntity.setNoteNumber(deliveryListMa()); |
|
|
|
|
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); |
|
|
|
|
String taskTime = allocationDTO.getTaskTime(); |
|
|
|
|
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
@ -926,7 +1008,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionDeliveryListEntity.setRemarks(allocationDTO.getRemarks()); |
|
|
|
|
} |
|
|
|
|
distributionDeliveryListEntity.setTaskTime(taskTime); |
|
|
|
|
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT)); |
|
|
|
|
// distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
|
|
|
|
|
// if (orderIds.length() > 1) {
|
|
|
|
|
// distributionDeliveryListEntity.setOrderId(orderIds.deleteCharAt(orderIds.length() - 1).toString());
|
|
|
|
|
// }
|
|
|
|
@ -1303,7 +1385,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//4、维护配送表数据
|
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity(); |
|
|
|
|
String str = Func.random(7, RandomType.ALL) + DateUtil.today(); |
|
|
|
|
distributionDeliveryListEntity.setTrainNumber(str); |
|
|
|
|
distributionDeliveryListEntity.setTrainNumber(trainNumberMa()); |
|
|
|
|
distributionDeliveryListEntity.setType(DistributionTypeConstant.shangpei.getValue()); |
|
|
|
|
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue()); |
|
|
|
|
distributionDeliveryListEntity.setPrice(BigDecimal.ZERO); |
|
|
|
@ -1447,7 +1529,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
// reservationEntity.setWaybillId(String.join(",", waybillId));
|
|
|
|
|
reservationEntity.setReservationDate(date); |
|
|
|
|
// -----------------------预约信息完善----------------------------
|
|
|
|
|
reservationEntity.setReservationCode(Func.random(11,RandomType.INT)); |
|
|
|
|
reservationEntity.setReservationCode(reservationMa()); |
|
|
|
|
// reservationEntity.setDeliveryWay();
|
|
|
|
|
reservationEntity.setDeliveryType(DistributionTypeConstant.shangpei.getValue()); |
|
|
|
|
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); |
|
|
|
@ -1465,7 +1547,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
deliveryPackageTotal.getAndAdd(reservationEntity.getReservationNum()); |
|
|
|
|
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity(); |
|
|
|
|
distributionSignforEntity.setReservationId(reservationEntity.getId()); |
|
|
|
|
distributionSignforEntity.setTrainNumber(str); |
|
|
|
|
distributionSignforEntity.setTrainNumber(trainNumberMa()); |
|
|
|
|
distributionSignforEntity.setDeliveryId(distributionDeliveryListEntity.getId()); |
|
|
|
|
distributionSignforService.save(distributionSignforEntity); |
|
|
|
|
deliveryWarehouseName.add(reservationEntity.getWarehouseName()); |
|
|
|
@ -1540,7 +1622,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
// distributionDeliveryListEntity.setOrderCode(String.join(",", orderNumber));
|
|
|
|
|
distributionDeliveryListEntity.setOrderNumber(orderTotal.get()); |
|
|
|
|
distributionDeliveryListEntity.setDeliveryNumber(deliveryPackageTotal.get()); |
|
|
|
|
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT)); |
|
|
|
|
distributionDeliveryListEntity.setNoteNumber(deliveryListMa()); |
|
|
|
|
distributionDeliveryListEntity.setCustomersNumber(clientTotal.get()); |
|
|
|
|
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); |
|
|
|
|
distributionDeliveryListEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
@ -2183,8 +2265,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//统计数量
|
|
|
|
|
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee()); |
|
|
|
|
reservationEntity.setFee(fee); |
|
|
|
|
String random = Func.random(13, RandomType.ALL); |
|
|
|
|
reservationEntity.setReservationCode(random); |
|
|
|
|
reservationEntity.setReservationCode(reservationMa()); |
|
|
|
|
//设置预约为市配
|
|
|
|
|
reservationEntity.setDeliveryType(DistributionTypeConstant.shipie.getValue()); |
|
|
|
|
reservationEntity.setReservationNum(packageTotal.get()); |
|
|
|
|