diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliverySelfEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliverySelfEntity.java index 9d2d966bd..c96d2eaee 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliverySelfEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliverySelfEntity.java @@ -45,7 +45,7 @@ public class DistributionDeliverySelfEntity extends TenantEntity { * 配送司机 */ @ApiModelProperty(value = "配送司机") - private String slaveDriverId; + private String driverId; /** * 车辆编号 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java index cd1857765..8b8d789fd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java @@ -50,6 +50,18 @@ public class DistributionDeliveryAllocationDTO { @ApiModelProperty(value = "三方配送司机车辆信息") private DistributionDeliveryTripartiteDTO tripartite; + /** + * 主司机名称 + */ + @ApiModelProperty(value = "主司机名称") + private String masterDriverName; + /** + * 主车辆车牌号 + */ + @ApiModelProperty(value = "主车辆车牌号") + private String masterVehicleNub; + + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml index 6131c6bad..8421bfc28 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml @@ -14,7 +14,7 @@ - + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 640d2083c..1febb676b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -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 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); }