|
|
|
@ -29,7 +29,9 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; |
|
|
|
|
import com.logpm.basic.entity.BasicMaterialEntity; |
|
|
|
|
import com.logpm.basic.entity.BasicPrintTemplateEntity; |
|
|
|
|
import com.logpm.basic.feign.IBasicMaterialClient; |
|
|
|
|
import com.logpm.basic.feign.IBasicPrintTemplateClient; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
@ -278,6 +280,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
@Autowired |
|
|
|
|
private IBasicdataDriverArteryClient basicdataDriverArteryClient; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IBasicMaterialClient basicMaterialClient; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionDeliveryListEntity> selectDistributionDeliveryListPage(IPage<DistributionDeliveryListEntity> page, DistributionDeliveryListDTO distributionDeliveryList) { |
|
|
|
|
//转换创建时间
|
|
|
|
@ -1111,7 +1116,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING); |
|
|
|
|
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName()); |
|
|
|
|
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId()); |
|
|
|
|
nodeFanoutMsg.setOperator(AuthUtil.getTenantId()); |
|
|
|
|
nodeFanoutMsg.setOperator(AuthUtil.getNickName()); |
|
|
|
|
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getUpdateTime()); |
|
|
|
|
|
|
|
|
|
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
|
|
|
|
@ -1123,7 +1128,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
String vehicleName = distributionDeliveryListEntity.getVehicleName(); |
|
|
|
|
// 如果是自主配送 需要去获取当前司机绑定的车牌
|
|
|
|
|
if ("1".equals(distributionDeliveryListEntity.getKind())) { |
|
|
|
|
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId()); |
|
|
|
|
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId()); |
|
|
|
|
if (driverArteryById != null) { |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < planDriverbindCarVOS.size(); i++) { |
|
|
|
@ -1137,6 +1142,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
distributionLoadVO.setDriverName(driverName); |
|
|
|
|
distributionLoadVO.setVehicleName(vehicleName); |
|
|
|
|
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); |
|
|
|
|
|
|
|
|
|
nodeFanoutMsg.setMain(distributionLoadVO); |
|
|
|
|
|
|
|
|
@ -1200,7 +1206,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING); |
|
|
|
|
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName()); |
|
|
|
|
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId()); |
|
|
|
|
nodeFanoutMsg.setOperator(AuthUtil.getTenantId()); |
|
|
|
|
nodeFanoutMsg.setOperator(AuthUtil.getNickName()); |
|
|
|
|
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getCreateTime()); |
|
|
|
|
|
|
|
|
|
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
|
|
|
|
@ -1213,7 +1219,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
String vehicleName = distributionDeliveryListEntity.getVehicleName(); |
|
|
|
|
// 如果是自主配送 需要去获取当前司机绑定的车牌
|
|
|
|
|
if ("1".equals(distributionDeliveryListEntity.getKind())) { |
|
|
|
|
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId()); |
|
|
|
|
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId()); |
|
|
|
|
if (driverArteryById != null) { |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < planDriverbindCarVOS.size(); i++) { |
|
|
|
@ -1227,6 +1233,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
distributionLoadVO.setDriverName(driverName); |
|
|
|
|
distributionLoadVO.setVehicleName(vehicleName); |
|
|
|
|
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); |
|
|
|
|
List<PackageData> data = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
for (DistributionLoadscaninvnEntity distributionParcelListEntity : ts) { |
|
|
|
@ -1250,7 +1257,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
packageData.setBrand(stockListEntity.getBrandName()); |
|
|
|
|
packageData.setPackageCode(stockEntity.getOrderPackageCode()); |
|
|
|
|
packageData.setMallName(stockListEntity.getMallName()); |
|
|
|
|
packageData.setMaterialCode(stockListEntity.getMarketCode()); |
|
|
|
|
|
|
|
|
|
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(stockListEntity.getMaterialId()); |
|
|
|
|
if(materialOwnId!=null){ |
|
|
|
|
packageData.setMaterialCode(materialOwnId.getProductCode()); |
|
|
|
|
} |
|
|
|
|
packageData.setMaterialName(stockListEntity.getDescriptionGoods()); |
|
|
|
|
packageData.setOrderCode(stockListEntity.getOrderCode()); |
|
|
|
|
packageData.setPackageType(PackageTypeEnums.INV); |
|
|
|
@ -3568,7 +3579,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
nodeFanoutMsg.setNode(WorkNodeEnums.PLAN_DELIVERY); |
|
|
|
|
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName()); |
|
|
|
|
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId()); |
|
|
|
|
nodeFanoutMsg.setOperator(user.getTenantId()); |
|
|
|
|
nodeFanoutMsg.setOperator(user.getNickName()); |
|
|
|
|
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getCreateTime()); |
|
|
|
|
DistributionTaskVO distributionTaskVO = getDistributionTaskVO(distributionDeliveryListEntity); |
|
|
|
|
List<PlanDriverbindCarVO> planDriverbindCarVOS = buildDeliveryCarDriverInfor(distributionDeliveryListEntity); |
|
|
|
@ -4822,7 +4833,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_CAR_START); |
|
|
|
|
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName()); |
|
|
|
|
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId()); |
|
|
|
|
nodeFanoutMsg.setOperator(AuthUtil.getTenantId()); |
|
|
|
|
nodeFanoutMsg.setOperator(AuthUtil.getNickName()); |
|
|
|
|
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getUpdateTime()); |
|
|
|
|
List<PlanDriverbindCarVO> planDriverbindCarVOS = buildDeliveryCarDriverInfor(distributionDeliveryListEntity); |
|
|
|
|
|
|
|
|
@ -4830,7 +4841,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
String vehicleName = distributionDeliveryListEntity.getVehicleName(); |
|
|
|
|
// 如果是自主配送 需要去获取当前司机绑定的车牌
|
|
|
|
|
if ("1".equals(distributionDeliveryListEntity.getKind())) { |
|
|
|
|
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId()); |
|
|
|
|
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId()); |
|
|
|
|
if (driverArteryById != null) { |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < planDriverbindCarVOS.size(); i++) { |
|
|
|
@ -6235,8 +6246,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING); |
|
|
|
|
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName()); |
|
|
|
|
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId()); |
|
|
|
|
nodeFanoutMsg.setOperator(AuthUtil.getTenantId()); |
|
|
|
|
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getCreateTime()); |
|
|
|
|
nodeFanoutMsg.setOperator(AuthUtil.getNickName()); |
|
|
|
|
nodeFanoutMsg.setOperatorTime(new Date()); |
|
|
|
|
|
|
|
|
|
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
|
|
|
|
|
|
|
|
|
@ -6248,7 +6259,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
String vehicleName = distributionDeliveryListEntity.getVehicleName(); |
|
|
|
|
// 如果是自主配送 需要去获取当前司机绑定的车牌
|
|
|
|
|
if ("1".equals(distributionDeliveryListEntity.getKind())) { |
|
|
|
|
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId()); |
|
|
|
|
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId()); |
|
|
|
|
if (driverArteryById != null) { |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < planDriverbindCarVOS.size(); i++) { |
|
|
|
@ -8379,8 +8390,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (!broadcastDataByArticles.isEmpty()) { |
|
|
|
|
|
|
|
|
|
broadcastDataByArticles.forEach(map -> { |
|
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
|
reservationEntity.setId(Long.parseLong(map.get("reservationId").toString())); |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity); |
|
|
|
|
|
|
|
|
|
List<PackageData> packageDataList = reservationVO.getPackageDataList(); |
|
|
|
@ -8404,8 +8416,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (!broadcastDataByStock.isEmpty()) { |
|
|
|
|
|
|
|
|
|
for (Map<String, Object> map : broadcastDataByStock) { |
|
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
|
reservationEntity.setId(Long.parseLong(map.get("reservationId").toString())); |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString()); |
|
|
|
|
|
|
|
|
|
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity); |
|
|
|
|
|
|
|
|
|
List<PackageData> packageDataList = reservationVO.getPackageDataList(); |
|
|
|
@ -8426,8 +8438,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
List<Map<String, Object>> broadcastDataByZeroOrder = baseMapper.getBroadcastDataByZeroOrder(id, warehouseId); |
|
|
|
|
if (!broadcastDataByZeroOrder.isEmpty()) { |
|
|
|
|
broadcastDataByZeroOrder.forEach(map -> { |
|
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
|
reservationEntity.setId(Long.parseLong(map.get("reservationId").toString())); |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString()); |
|
|
|
|
|
|
|
|
|
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity); |
|
|
|
|
|
|
|
|
|
List<PackageData> packageDataList = reservationVO.getPackageDataList(); |
|
|
|
@ -8465,13 +8477,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
ReservationVO temp = null; |
|
|
|
|
|
|
|
|
|
for (ReservationVO reservationVO : data) { |
|
|
|
|
if (reservationVO.getReservationCode().equals(reservationEntity.getReservationCode())) { |
|
|
|
|
if (reservationVO.getId().equals(reservationEntity.getId())) { |
|
|
|
|
temp = reservationVO; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(temp==null){ |
|
|
|
|
temp=distributionReservationService.getReservationVO(reservationEntity); |
|
|
|
|
data.add(temp); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return temp; |
|
|
|
|
|
|
|
|
|