|
|
|
@ -29,6 +29,7 @@ import lombok.AllArgsConstructor;
|
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.core.tool.utils.RandomType; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
@ -68,6 +69,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
|
|
|
|
|
private final IDistributionDeliveryListService distributionDeliveryListService; |
|
|
|
|
|
|
|
|
|
private final IDistributionDeliverySelfService distributionDeliverySelfService; |
|
|
|
|
|
|
|
|
|
private final IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IDistributionReservationStockarticleService distributionReservationStockarticleService; |
|
|
|
@ -323,7 +328,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
String stockupId = distributionStockupInfoEntity.getStockupId(); |
|
|
|
|
DistributionStockupEntity stockupEntity = distributionStockupService.getById(stockupId); |
|
|
|
|
//2、预约单存在备货任务还未指派
|
|
|
|
|
if (Func.equals(stockupEntity.getAssignStatus(),"2")){ |
|
|
|
|
if (Func.equals(stockupEntity.getAssignStatus(),"1")){ |
|
|
|
|
//对原有的备货关系进行修改
|
|
|
|
|
distributionStockupInfoEntity.setStockupId(stockupEntityId.toString()); |
|
|
|
|
distributionStockupInfoService.updateById(distributionStockupInfoEntity); |
|
|
|
@ -376,18 +381,47 @@ 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); |
|
|
|
|
distributionDeliveryListService.save(distributionDeliveryListEntity); |
|
|
|
|
Long id = distributionDeliveryListEntity.getId(); |
|
|
|
|
//操作司机信息
|
|
|
|
|
DistributionDeliveryTripartiteDTO tripartite = allocationDTO.getTripartite(); |
|
|
|
|
if (Func.isEmpty(tripartite)){ |
|
|
|
|
//这里就是自主配送
|
|
|
|
|
}else { |
|
|
|
|
//这里就是三方配送
|
|
|
|
|
DistributionDeliveryTripartiteEntity tripartiteEntity = Func.copy(tripartite, DistributionDeliveryTripartiteEntity.class); |
|
|
|
|
tripartiteEntity.setReservationIds(reservationId.substring(reservationId.length()-1)); |
|
|
|
|
// TODO 配置信息编号
|
|
|
|
|
}else { |
|
|
|
|
//这里就是自主配送
|
|
|
|
|
List<DistributionDeliverySelfDTO> allocationInfo = allocationDTO.getAllocationInfo(); |
|
|
|
|
allocationInfo.forEach(a->{ |
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity(); |
|
|
|
|
//设置车辆编号
|
|
|
|
|
distributionDeliverySelfEntity.setDeliveryId(Long.parseLong(a.getDriverId())); |
|
|
|
|
//设置预约单号拼接
|
|
|
|
|
distributionDeliverySelfEntity.setReservationIds(reservationId.substring(reservationId.length()-1)); |
|
|
|
|
//设置司机信息
|
|
|
|
|
distributionDeliverySelfEntity.setVehicleId(a.getVehicleId()); |
|
|
|
|
//设置是否为主司机
|
|
|
|
|
if (Func.equals(allocationDTO.getMasterDriverName(),a.getDriver())){ |
|
|
|
|
//设置主司机
|
|
|
|
|
distributionDeliverySelfEntity.setIsMaster(1); |
|
|
|
|
} |
|
|
|
|
// TODO 配置信息编号
|
|
|
|
|
//完成对自主配送司机信息保存
|
|
|
|
|
distributionDeliverySelfService.save(distributionDeliverySelfEntity); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|