From e3a9f8757a14972700534fb6586d6573a3ae374a Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Wed, 29 May 2024 16:02:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(all):=20=E8=A7=A3=E5=86=B3=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E5=BC=82=E5=B8=B8=E5=B7=A5=E5=8D=95=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AftersalesWorkOrderServiceImpl.java | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) 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 2c826ea5c..b9868e1d7 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 @@ -365,10 +365,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl updateWrapper = Wrappers.lambdaUpdate() + .set(AftersalesAbnormalPackageEntity::getIsDeleted, 1) + .eq(AftersalesAbnormalPackageEntity::getWorkOrderId, aftersalesWorkOrder.getId()); + aftersalesAbnormalPackageService.update(updateWrapper); if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnProcessorEntityList())) { //责任方 处理方 // List list = new ArrayList<>(); @@ -397,26 +401,42 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl imageEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() + .set(AftersalesDecreaseImageEntity::getIsDeleted, 1) + .eq(AftersalesDecreaseImageEntity::getWorkOrderId, aftersalesWorkOrder.getId()); + aftersalesDecreaseImageService.update(imageEntityLambdaUpdateWrapper); //修改调查经过 if (ObjectUtils.isNotNull(aftersalesWorkOrder.getSurveyRecordDTO())) { aftersalesWorkOrder.setInvestigationProcess(aftersalesWorkOrder.getSurveyRecordDTO().getContent()); } //修改责任方 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnPersonResponsibleDTO())) { - aftersalesPersonResponsibleService.deleteLogic(aftersalesWorkOrder.getUnPersonResponsibleDTO()); - } +// if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnPersonResponsibleDTO())) { +// aftersalesPersonResponsibleService.deleteLogic(aftersalesWorkOrder.getUnPersonResponsibleDTO()); +// } + LambdaUpdateWrapper personResponsibleEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() + .set(AftersalesPersonResponsibleEntity::getIsDeleted, 1) + .eq(AftersalesPersonResponsibleEntity::getWordOrderId, aftersalesWorkOrder.getId()); + aftersalesPersonResponsibleService.update(personResponsibleEntityLambdaUpdateWrapper); //修改赔款方 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecordEntities())) { - completionRecordService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecordEntities()); - } +// if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecordEntities())) { +// completionRecordService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecordEntities()); +// } + LambdaUpdateWrapper completionRecordEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() + .set(AftersalesCompletionRecordEntity::getIsDeleted, 1) + .eq(AftersalesCompletionRecordEntity::getWorkOrderId, aftersalesWorkOrder.getId()); + completionRecordService.update(completionRecordEntityLambdaUpdateWrapper); //修改收款方 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecipientEntities())) { - completionRecipientService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecipientEntities()); - } +// if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecipientEntities())) { +// completionRecipientService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecipientEntities()); +// } + LambdaUpdateWrapper completionRecipientEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() + .set(AftersalesCompletionRecipientEntity::getIsDeleted, 1) + .eq(AftersalesCompletionRecipientEntity::getWorkOrderId, aftersalesWorkOrder.getId()); + completionRecipientService.update(completionRecipientEntityLambdaUpdateWrapper); // baseMapper.updateById(aftersalesWorkOrder); } From 5908c563c7ba044401b35bbb88ac1b060d85a7bc Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 29 May 2024 16:02:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E7=BB=93=E7=AE=97=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statistics/dto/MerchantStatisticsDTO.java | 2 +- .../dto/StatisticsBalanceRecordDTO.java | 3 ++- .../controller/MerchantBalanceController.java | 12 +++++------ .../mapper/StatisticsOrderInfoMapper.xml | 20 +++++++++---------- ...StatisticsBalanceOrderInfoServiceImpl.java | 20 +++++++++++++++++-- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java index 2b84490e0..b9f8ac49b 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java @@ -23,6 +23,6 @@ public class MerchantStatisticsDTO implements Serializable { private List orderInfoIds; - private Long balanceOrderId; + private Long balanceOrderInfoId; } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java index b693279b2..332887812 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java @@ -4,11 +4,12 @@ import com.logpm.statistics.entity.StatisticsBalanceRecordEntity; import com.logpm.statistics.entity.StatisticsBalanceRecordPhotoEntity; import lombok.Data; +import java.util.ArrayList; import java.util.List; @Data public class StatisticsBalanceRecordDTO extends StatisticsBalanceRecordEntity { - private List recordPhotoEntityList; + private List recordPhotoEntityList = new ArrayList<>(); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java index 5d67944a7..1126c8020 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java @@ -133,7 +133,7 @@ public class MerchantBalanceController { @ResponseBody @PostMapping("/findRecordList") @ApiOperationSupport(order = 1) - @ApiOperation(value = "查询异常列表", notes = "传入balanceRecordDTO") + @ApiOperation(value = "查询结算记录列表", notes = "传入balanceRecordDTO") public R findRecordList(@RequestBody StatisticsBalanceRecordDTO balanceRecordDTO) { String method = "############findRecordList: "; log.info(method+"请求参数{}",balanceRecordDTO); @@ -158,19 +158,19 @@ public class MerchantBalanceController { @ResponseBody @PostMapping("/findBalanceDetail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "查询异常列表", notes = "传入merchantStatisticsDTO") + @ApiOperation(value = "查询结算单详情", notes = "传入merchantStatisticsDTO") public R findBalanceDetail(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) { String method = "############findBalanceDetail: "; log.info(method+"请求参数{}",merchantStatisticsDTO); try{ - Long balanceOrderId = merchantStatisticsDTO.getBalanceOrderId(); - if(Objects.isNull(balanceOrderId)){ - log.warn(method+"请选择正确的结算单 balanceOrderId={}",balanceOrderId); + Long balanceOrderInfoId = merchantStatisticsDTO.getBalanceOrderInfoId(); + if(Objects.isNull(balanceOrderInfoId)){ + log.warn(method+"请选择正确的结算单 balanceOrderInfoId={}",balanceOrderInfoId); return R.fail(405,"请选择正确的结算单"); } - return balanceOrderInfoService.findBalanceDetail(balanceOrderId); + return balanceOrderInfoService.findBalanceDetail(balanceOrderInfoId); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml index 8a11e5bd8..e0663c77c 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml @@ -39,11 +39,11 @@ GROUP_CONCAT(lscr.remark) changesRemark, MAX(lscr.create_time) changesTime, GROUP_CONCAT(DISTINCT lstp.product_name) goodsName, - sum(lstp.total_num) totalcount, - sum(lstp.total_weight) totalWeight, - sum(lstp.total_volume) totalVolume, - sum(lstp.open_price+lswp.open_price+lsdp.open_price) openFee, - sum(lstp.total_price+lswp.total_price+lsdp.total_price) totalFee, + IFNULL(sum(lstp.total_num),0) totalcount, + IFNULL(sum(lstp.total_weight),0) totalWeight, + IFNULL(sum(lstp.total_volume),0) totalVolume, + IFNULL(sum(lstp.open_price+lswp.open_price+lsdp.open_price),0) openFee, + IFNULL(sum(lstp.total_price+lswp.total_price+lsdp.total_price),0) totalFee, sum(lstp.pickup_fee) pickupFee, sum(lstp.real_pickup_fee) realPickupFee, sum(lstp.freight_fee) freightFee, @@ -159,11 +159,11 @@ GROUP_CONCAT(lscr.remark) changesRemark, MAX(lscr.create_time) changesTime, GROUP_CONCAT(DISTINCT lstp.product_name) goodsName, - sum(lstp.total_num) totalcount, - sum(lstp.total_weight) totalWeight, - sum(lstp.total_volume) totalVolume, - sum(lstp.open_price+lswp.open_price+lsdp.open_price) openFee, - sum(lstp.total_price+lswp.total_price+lsdp.total_price) totalFee, + IFNULL(sum(lstp.total_num),0) totalcount, + IFNULL(sum(lstp.total_weight),0) totalWeight, + IFNULL(sum(lstp.total_volume),0) totalVolume, + IFNULL(sum(lstp.open_price+lswp.open_price+lsdp.open_price),0) openFee, + IFNULL(sum(lstp.total_price+lswp.total_price+lsdp.total_price),0) totalFee, sum(lstp.pickup_fee) pickupFee, sum(lstp.real_pickup_fee) realPickupFee, sum(lstp.freight_fee) freightFee, diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java index 2181a44ab..d742108ac 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.statistics.service.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -22,6 +23,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -105,6 +107,11 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl list = balanceAbnormalService.list(balanceAbnormalEntityQueryWrapper); + + if(list.isEmpty()){ + return R.data(CollUtil.newArrayList()); + } + //把list中所有元素的id放到一个List集合中 List idList= list.stream() .map(StatisticsBalanceAbnormalEntity::getId) @@ -118,13 +125,15 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl> groupedPhotos = abnormalPhotoEntityList.stream() .collect(Collectors.groupingBy(StatisticsBalanceAbnormalPhotoEntity::getAbnormalId)); + List abnormalVOList = new ArrayList<>(); list.forEach(balanceAbnormalEntity -> { StatisticsBalanceAbnormalVO balanceAbnormalVO = new StatisticsBalanceAbnormalVO(); BeanUtil.copy(balanceAbnormalEntity,balanceAbnormalVO); balanceAbnormalVO.setAbnormalPhotoEntityList(groupedPhotos.get(balanceAbnormalEntity.getId())); + abnormalVOList.add(balanceAbnormalVO); }); - return R.data(list); + return R.data(abnormalVOList); } @Transactional(rollbackFor = Exception.class) @@ -189,6 +198,11 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl list = balanceRecordService.list(balanceAbnormalEntityQueryWrapper); + + if(list.isEmpty()){ + return R.data(CollUtil.newArrayList()); + } + //把list中所有元素的id放到一个List集合中 List idList= list.stream() .map(StatisticsBalanceRecordEntity::getId) @@ -202,15 +216,17 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl> groupedPhotos = recordPhotoEntityList.stream() .collect(Collectors.groupingBy(StatisticsBalanceRecordPhotoEntity::getRecordId)); + List balanceRecordVOS = new ArrayList<>(); list.forEach(balanceRecordEntity -> { StatisticsBalanceRecordVO balanceRecordVO = new StatisticsBalanceRecordVO(); BeanUtil.copy(balanceRecordEntity,balanceRecordVO); balanceRecordVO.setRecordPhotoEntityList(groupedPhotos.get(balanceRecordEntity.getId())); balanceRecordVO.setBalanceUserName(balanceRecordEntity.getBalanceUserName()); balanceRecordVO.setBalanceRemark(balanceRecordEntity.getBalanceRemark()); + balanceRecordVOS.add(balanceRecordVO); }); - return R.data(list); + return R.data(balanceRecordVOS); } @Override