diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryWordVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryWordVO.java new file mode 100644 index 000000000..4cb6abe32 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryWordVO.java @@ -0,0 +1,22 @@ +package com.logpm.distribution.vo; + +import lombok.Data; + +import java.util.Date; + +/** + * @author 12702 + */ +@Data +public class DistributionDeliveryWordVO { + //配送ID + private Long id; + //配送时间 + private Date taskTime; + //车次号 + private String trainNumber; + //司机名称 + private String driverName; + //配送种类;1-自主配送,2-三方配送 + private String kind; +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index a098c3ea9..295acb2ab 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -231,7 +231,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl list = new ArrayList<>(); aftersalesWorkOrder.getPackageEntityList().forEach(i ->{ - AftersalesAbnormalPackageEntity packageEntity = new AftersalesAbnormalPackageEntity(); - BeanUtil.copyProperties(i,packageEntity); - packageEntity.setWorkOrderId(aftersalesWorkOrder.getId()); - packageEntity.setWarehouseId(myCurrentWarehouse.getId()); - list.add(packageEntity); + if(ObjectUtils.isNotNull( i.getId()) ){ + //修改包件信息 +// AftersalesAbnormalPackageEntity abnormalPackage = new AftersalesAbnormalPackageEntity(); + aftersalesAbnormalPackageService.updateById(i); + }else{ + //添加 + AftersalesAbnormalPackageEntity packageEntity = new AftersalesAbnormalPackageEntity(); + BeanUtil.copyProperties(i,packageEntity); + packageEntity.setWorkOrderId(aftersalesWorkOrder.getId()); + packageEntity.setWarehouseId(myCurrentWarehouse.getId()); + list.add(packageEntity); + } }); if(!list.isEmpty()){ aftersalesAbnormalPackageService.saveBatch(list); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index ff0463b4c..38cd9b8f5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -116,6 +116,20 @@ public class DistributionDeliveryListController extends BladeController { } + /** + * 异常工单查询配送信息 + */ + @GetMapping("/shippingInformation") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "异常工单查询配送信息", notes = "传入distributionDeliveryList") + public R> getShippingInformation (DistributionDeliveryListDTO distributionDeliveryInfoDTO, Query query) { + IPage pages = distributionDeliveryListService.getShippingInformation(Condition.getPage(query), distributionDeliveryInfoDTO); + return R.data(pages); + } + + + + /** * 查看订单 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java index 220e6a43f..8a0e83308 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java @@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.DistributionDeliveryInfoDTO; import com.logpm.distribution.dto.DistributionDeliveryListDTO; import com.logpm.distribution.dto.DistributionLoadingNumDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; @@ -460,4 +461,12 @@ public interface DistributionDeliveryListMapper extends BaseMapper getShippingInformation(IPage page,@Param("param") DistributionDeliveryListDTO distributionDeliveryInfoDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 9fc377110..b1124baea 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -49,7 +49,16 @@ UPDATE logpm_distribution_delivery_list lddl SET lddl.loading_time = now(),lddl.delivery_status = 1 WHERE lddl.id = #{id} and lddl.loading_time is null + + DELETE FROM logpm_distribution_delivery_list diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index d02bb6079..59f695880 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -16,7 +16,6 @@ */ package com.logpm.distribution.service; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; @@ -369,6 +368,14 @@ public interface IDistributionDeliveryListService extends BaseService aftersalesPackageScan(Long deliveryId, String scanBarCode); + /** + * 工单查询配送信息 + * @param page + * @param distributionDeliveryInfoDTO + * @return + */ + IPage getShippingInformation(IPage page, DistributionDeliveryListDTO distributionDeliveryInfoDTO); + /** * 查询签收预约客户包件信息 * @param reservationId diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 3b8756aab..b226e4e69 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -5966,6 +5966,44 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl getShippingInformation(IPage page, DistributionDeliveryListDTO distributionDeliveryInfoDTO) { + IPage iPage= baseMapper.getShippingInformation(page,distributionDeliveryInfoDTO); + if(!iPage.getRecords().isEmpty()){ + iPage.getRecords().forEach( i ->{ + if("1".equals(i.getKind())){ + //自主 + //查询司机信息 + List distributionDeliverySelfEntities = distributionDeliverySelfMapper.selectList(Wrappers.query().lambda() + .eq(DistributionDeliverySelfEntity::getDeliveryId, i.getId()) + ); + if(!distributionDeliverySelfEntities.isEmpty()){ + String collect = distributionDeliverySelfEntities.stream().map(DistributionDeliverySelfEntity::getDriverName).collect(Collectors.joining(",")); + i.setDriverName(collect); + } + }else{ + //三方 + List list = distributionDeliveryTripartiteService.list(Wrappers.query().lambda() + .eq(DistributionDeliveryTripartiteEntity::getDeliveryId, i.getId()) + ); + if(!list.isEmpty()){ + String collect = list.stream().map(DistributionDeliveryTripartiteEntity::getDriverName).collect(Collectors.joining(",")); + i.setDriverName(collect); + } + } + }); + } + + return iPage; + } + public Map getDriverCar(String kind, Long deliveryListEntityId) { Map map = new HashMap<>();