Browse Source

Merge branch 'dev' into pre-production

master
zhaoqiaobo 8 months ago
parent
commit
33d426e39d
  1. 2
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java
  2. 3
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java
  3. 52
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  4. 12
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java
  5. 20
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml
  6. 20
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java

2
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<Long> orderInfoIds; private List<Long> orderInfoIds;
private Long balanceOrderId; private Long balanceOrderInfoId;
} }

3
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 com.logpm.statistics.entity.StatisticsBalanceRecordPhotoEntity;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Data @Data
public class StatisticsBalanceRecordDTO extends StatisticsBalanceRecordEntity { public class StatisticsBalanceRecordDTO extends StatisticsBalanceRecordEntity {
private List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList; private List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList = new ArrayList<>();
} }

52
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -365,10 +365,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
baseMapper.insert(aftersalesWorkOrder); baseMapper.insert(aftersalesWorkOrder);
} else { } else {
//修改 //修改
if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnPpackageEntityList())) { // if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnPpackageEntityList())) {
//删除修改包件 //删除修改包件
aftersalesAbnormalPackageService.deleteLogic(aftersalesWorkOrder.getUnPpackageEntityList()); // aftersalesAbnormalPackageService.deleteLogic(aftersalesWorkOrder.getUnPpackageEntityList());
} // }
LambdaUpdateWrapper<AftersalesAbnormalPackageEntity> updateWrapper = Wrappers.<AftersalesAbnormalPackageEntity>lambdaUpdate()
.set(AftersalesAbnormalPackageEntity::getIsDeleted, 1)
.eq(AftersalesAbnormalPackageEntity::getWorkOrderId, aftersalesWorkOrder.getId());
aftersalesAbnormalPackageService.update(updateWrapper);
if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnProcessorEntityList())) { if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnProcessorEntityList())) {
//责任方 处理方 //责任方 处理方
// List<AftersalesProcessorEntity> list = new ArrayList<>(); // List<AftersalesProcessorEntity> list = new ArrayList<>();
@ -397,26 +401,42 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// aftersalesProcessorService.saveOrUpdateBatch(list); // aftersalesProcessorService.saveOrUpdateBatch(list);
// } // }
} }
if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnDecreaseImageEntityList()) && !aftersalesWorkOrder.getUnDecreaseImageEntityList().isEmpty()) { // if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnDecreaseImageEntityList()) && !aftersalesWorkOrder.getUnDecreaseImageEntityList().isEmpty()) {
//图片修改 // //图片修改
aftersalesDecreaseImageService.deleteLogic(aftersalesWorkOrder.getUnDecreaseImageEntityList()); // aftersalesDecreaseImageService.deleteLogic(aftersalesWorkOrder.getUnDecreaseImageEntityList());
} // }
LambdaUpdateWrapper<AftersalesDecreaseImageEntity> imageEntityLambdaUpdateWrapper = Wrappers.<AftersalesDecreaseImageEntity>lambdaUpdate()
.set(AftersalesDecreaseImageEntity::getIsDeleted, 1)
.eq(AftersalesDecreaseImageEntity::getWorkOrderId, aftersalesWorkOrder.getId());
aftersalesDecreaseImageService.update(imageEntityLambdaUpdateWrapper);
//修改调查经过 //修改调查经过
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getSurveyRecordDTO())) { if (ObjectUtils.isNotNull(aftersalesWorkOrder.getSurveyRecordDTO())) {
aftersalesWorkOrder.setInvestigationProcess(aftersalesWorkOrder.getSurveyRecordDTO().getContent()); aftersalesWorkOrder.setInvestigationProcess(aftersalesWorkOrder.getSurveyRecordDTO().getContent());
} }
//修改责任方 //修改责任方
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnPersonResponsibleDTO())) { // if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnPersonResponsibleDTO())) {
aftersalesPersonResponsibleService.deleteLogic(aftersalesWorkOrder.getUnPersonResponsibleDTO()); // aftersalesPersonResponsibleService.deleteLogic(aftersalesWorkOrder.getUnPersonResponsibleDTO());
} // }
LambdaUpdateWrapper<AftersalesPersonResponsibleEntity> personResponsibleEntityLambdaUpdateWrapper = Wrappers.<AftersalesPersonResponsibleEntity>lambdaUpdate()
.set(AftersalesPersonResponsibleEntity::getIsDeleted, 1)
.eq(AftersalesPersonResponsibleEntity::getWordOrderId, aftersalesWorkOrder.getId());
aftersalesPersonResponsibleService.update(personResponsibleEntityLambdaUpdateWrapper);
//修改赔款方 //修改赔款方
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecordEntities())) { // if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecordEntities())) {
completionRecordService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecordEntities()); // completionRecordService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecordEntities());
} // }
LambdaUpdateWrapper<AftersalesCompletionRecordEntity> completionRecordEntityLambdaUpdateWrapper = Wrappers.<AftersalesCompletionRecordEntity>lambdaUpdate()
.set(AftersalesCompletionRecordEntity::getIsDeleted, 1)
.eq(AftersalesCompletionRecordEntity::getWorkOrderId, aftersalesWorkOrder.getId());
completionRecordService.update(completionRecordEntityLambdaUpdateWrapper);
//修改收款方 //修改收款方
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecipientEntities())) { // if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecipientEntities())) {
completionRecipientService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecipientEntities()); // completionRecipientService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecipientEntities());
} // }
LambdaUpdateWrapper<AftersalesCompletionRecipientEntity> completionRecipientEntityLambdaUpdateWrapper = Wrappers.<AftersalesCompletionRecipientEntity>lambdaUpdate()
.set(AftersalesCompletionRecipientEntity::getIsDeleted, 1)
.eq(AftersalesCompletionRecipientEntity::getWorkOrderId, aftersalesWorkOrder.getId());
completionRecipientService.update(completionRecipientEntityLambdaUpdateWrapper);
// //
baseMapper.updateById(aftersalesWorkOrder); baseMapper.updateById(aftersalesWorkOrder);
} }

12
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java

@ -133,7 +133,7 @@ public class MerchantBalanceController {
@ResponseBody @ResponseBody
@PostMapping("/findRecordList") @PostMapping("/findRecordList")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "查询异常列表", notes = "传入balanceRecordDTO") @ApiOperation(value = "查询结算记录列表", notes = "传入balanceRecordDTO")
public R findRecordList(@RequestBody StatisticsBalanceRecordDTO balanceRecordDTO) { public R findRecordList(@RequestBody StatisticsBalanceRecordDTO balanceRecordDTO) {
String method = "############findRecordList: "; String method = "############findRecordList: ";
log.info(method+"请求参数{}",balanceRecordDTO); log.info(method+"请求参数{}",balanceRecordDTO);
@ -158,19 +158,19 @@ public class MerchantBalanceController {
@ResponseBody @ResponseBody
@PostMapping("/findBalanceDetail") @PostMapping("/findBalanceDetail")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "查询异常列表", notes = "传入merchantStatisticsDTO") @ApiOperation(value = "查询结算单详情", notes = "传入merchantStatisticsDTO")
public R findBalanceDetail(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) { public R findBalanceDetail(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) {
String method = "############findBalanceDetail: "; String method = "############findBalanceDetail: ";
log.info(method+"请求参数{}",merchantStatisticsDTO); log.info(method+"请求参数{}",merchantStatisticsDTO);
try{ try{
Long balanceOrderId = merchantStatisticsDTO.getBalanceOrderId(); Long balanceOrderInfoId = merchantStatisticsDTO.getBalanceOrderInfoId();
if(Objects.isNull(balanceOrderId)){ if(Objects.isNull(balanceOrderInfoId)){
log.warn(method+"请选择正确的结算单 balanceOrderId={}",balanceOrderId); log.warn(method+"请选择正确的结算单 balanceOrderInfoId={}",balanceOrderInfoId);
return R.fail(405,"请选择正确的结算单"); return R.fail(405,"请选择正确的结算单");
} }
return balanceOrderInfoService.findBalanceDetail(balanceOrderId); return balanceOrderInfoService.findBalanceDetail(balanceOrderInfoId);
}catch (CustomerException e){ }catch (CustomerException e){
log.error(e.message,e); log.error(e.message,e);
return R.fail(e.code,e.message); return R.fail(e.code,e.message);

20
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml

@ -39,11 +39,11 @@
GROUP_CONCAT(lscr.remark) changesRemark, GROUP_CONCAT(lscr.remark) changesRemark,
MAX(lscr.create_time) changesTime, MAX(lscr.create_time) changesTime,
GROUP_CONCAT(DISTINCT lstp.product_name) goodsName, GROUP_CONCAT(DISTINCT lstp.product_name) goodsName,
sum(lstp.total_num) totalcount, IFNULL(sum(lstp.total_num),0) totalcount,
sum(lstp.total_weight) totalWeight, IFNULL(sum(lstp.total_weight),0) totalWeight,
sum(lstp.total_volume) totalVolume, IFNULL(sum(lstp.total_volume),0) totalVolume,
sum(lstp.open_price+lswp.open_price+lsdp.open_price) openFee, IFNULL(sum(lstp.open_price+lswp.open_price+lsdp.open_price),0) openFee,
sum(lstp.total_price+lswp.total_price+lsdp.total_price) totalFee, IFNULL(sum(lstp.total_price+lswp.total_price+lsdp.total_price),0) totalFee,
sum(lstp.pickup_fee) pickupFee, sum(lstp.pickup_fee) pickupFee,
sum(lstp.real_pickup_fee) realPickupFee, sum(lstp.real_pickup_fee) realPickupFee,
sum(lstp.freight_fee) freightFee, sum(lstp.freight_fee) freightFee,
@ -159,11 +159,11 @@
GROUP_CONCAT(lscr.remark) changesRemark, GROUP_CONCAT(lscr.remark) changesRemark,
MAX(lscr.create_time) changesTime, MAX(lscr.create_time) changesTime,
GROUP_CONCAT(DISTINCT lstp.product_name) goodsName, GROUP_CONCAT(DISTINCT lstp.product_name) goodsName,
sum(lstp.total_num) totalcount, IFNULL(sum(lstp.total_num),0) totalcount,
sum(lstp.total_weight) totalWeight, IFNULL(sum(lstp.total_weight),0) totalWeight,
sum(lstp.total_volume) totalVolume, IFNULL(sum(lstp.total_volume),0) totalVolume,
sum(lstp.open_price+lswp.open_price+lsdp.open_price) openFee, IFNULL(sum(lstp.open_price+lswp.open_price+lsdp.open_price),0) openFee,
sum(lstp.total_price+lswp.total_price+lsdp.total_price) totalFee, IFNULL(sum(lstp.total_price+lswp.total_price+lsdp.total_price),0) totalFee,
sum(lstp.pickup_fee) pickupFee, sum(lstp.pickup_fee) pickupFee,
sum(lstp.real_pickup_fee) realPickupFee, sum(lstp.real_pickup_fee) realPickupFee,
sum(lstp.freight_fee) freightFee, sum(lstp.freight_fee) freightFee,

20
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.statistics.service.impl; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -22,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
@ -105,6 +107,11 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<Stati
balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId); balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId);
List<StatisticsBalanceAbnormalEntity> list = balanceAbnormalService.list(balanceAbnormalEntityQueryWrapper); List<StatisticsBalanceAbnormalEntity> list = balanceAbnormalService.list(balanceAbnormalEntityQueryWrapper);
if(list.isEmpty()){
return R.data(CollUtil.newArrayList());
}
//把list中所有元素的id放到一个List集合中 //把list中所有元素的id放到一个List集合中
List<Long> idList= list.stream() List<Long> idList= list.stream()
.map(StatisticsBalanceAbnormalEntity::getId) .map(StatisticsBalanceAbnormalEntity::getId)
@ -118,13 +125,15 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<Stati
Map<Long, List<StatisticsBalanceAbnormalPhotoEntity>> groupedPhotos = abnormalPhotoEntityList.stream() Map<Long, List<StatisticsBalanceAbnormalPhotoEntity>> groupedPhotos = abnormalPhotoEntityList.stream()
.collect(Collectors.groupingBy(StatisticsBalanceAbnormalPhotoEntity::getAbnormalId)); .collect(Collectors.groupingBy(StatisticsBalanceAbnormalPhotoEntity::getAbnormalId));
List<StatisticsBalanceAbnormalVO> abnormalVOList = new ArrayList<>();
list.forEach(balanceAbnormalEntity -> { list.forEach(balanceAbnormalEntity -> {
StatisticsBalanceAbnormalVO balanceAbnormalVO = new StatisticsBalanceAbnormalVO(); StatisticsBalanceAbnormalVO balanceAbnormalVO = new StatisticsBalanceAbnormalVO();
BeanUtil.copy(balanceAbnormalEntity,balanceAbnormalVO); BeanUtil.copy(balanceAbnormalEntity,balanceAbnormalVO);
balanceAbnormalVO.setAbnormalPhotoEntityList(groupedPhotos.get(balanceAbnormalEntity.getId())); balanceAbnormalVO.setAbnormalPhotoEntityList(groupedPhotos.get(balanceAbnormalEntity.getId()));
abnormalVOList.add(balanceAbnormalVO);
}); });
return R.data(list); return R.data(abnormalVOList);
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -189,6 +198,11 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<Stati
balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId); balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId);
List<StatisticsBalanceRecordEntity> list = balanceRecordService.list(balanceAbnormalEntityQueryWrapper); List<StatisticsBalanceRecordEntity> list = balanceRecordService.list(balanceAbnormalEntityQueryWrapper);
if(list.isEmpty()){
return R.data(CollUtil.newArrayList());
}
//把list中所有元素的id放到一个List集合中 //把list中所有元素的id放到一个List集合中
List<Long> idList= list.stream() List<Long> idList= list.stream()
.map(StatisticsBalanceRecordEntity::getId) .map(StatisticsBalanceRecordEntity::getId)
@ -202,15 +216,17 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<Stati
Map<Long, List<StatisticsBalanceRecordPhotoEntity>> groupedPhotos = recordPhotoEntityList.stream() Map<Long, List<StatisticsBalanceRecordPhotoEntity>> groupedPhotos = recordPhotoEntityList.stream()
.collect(Collectors.groupingBy(StatisticsBalanceRecordPhotoEntity::getRecordId)); .collect(Collectors.groupingBy(StatisticsBalanceRecordPhotoEntity::getRecordId));
List<StatisticsBalanceRecordVO> balanceRecordVOS = new ArrayList<>();
list.forEach(balanceRecordEntity -> { list.forEach(balanceRecordEntity -> {
StatisticsBalanceRecordVO balanceRecordVO = new StatisticsBalanceRecordVO(); StatisticsBalanceRecordVO balanceRecordVO = new StatisticsBalanceRecordVO();
BeanUtil.copy(balanceRecordEntity,balanceRecordVO); BeanUtil.copy(balanceRecordEntity,balanceRecordVO);
balanceRecordVO.setRecordPhotoEntityList(groupedPhotos.get(balanceRecordEntity.getId())); balanceRecordVO.setRecordPhotoEntityList(groupedPhotos.get(balanceRecordEntity.getId()));
balanceRecordVO.setBalanceUserName(balanceRecordEntity.getBalanceUserName()); balanceRecordVO.setBalanceUserName(balanceRecordEntity.getBalanceUserName());
balanceRecordVO.setBalanceRemark(balanceRecordEntity.getBalanceRemark()); balanceRecordVO.setBalanceRemark(balanceRecordEntity.getBalanceRemark());
balanceRecordVOS.add(balanceRecordVO);
}); });
return R.data(list); return R.data(balanceRecordVOS);
} }
@Override @Override

Loading…
Cancel
Save