Browse Source

1.结算功能模块更新

dist.1.3.0
zhenghaoyu 10 months ago
parent
commit
5908c563c7
  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. 12
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java
  4. 20
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml
  5. 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 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 lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class StatisticsBalanceRecordDTO extends StatisticsBalanceRecordEntity {
private List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList;
private List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList = new ArrayList<>();
}

12
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);

20
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,

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;
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<Stati
balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId);
List<StatisticsBalanceAbnormalEntity> list = balanceAbnormalService.list(balanceAbnormalEntityQueryWrapper);
if(list.isEmpty()){
return R.data(CollUtil.newArrayList());
}
//把list中所有元素的id放到一个List集合中
List<Long> idList= list.stream()
.map(StatisticsBalanceAbnormalEntity::getId)
@ -118,13 +125,15 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<Stati
Map<Long, List<StatisticsBalanceAbnormalPhotoEntity>> groupedPhotos = abnormalPhotoEntityList.stream()
.collect(Collectors.groupingBy(StatisticsBalanceAbnormalPhotoEntity::getAbnormalId));
List<StatisticsBalanceAbnormalVO> 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<Stati
balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId);
List<StatisticsBalanceRecordEntity> list = balanceRecordService.list(balanceAbnormalEntityQueryWrapper);
if(list.isEmpty()){
return R.data(CollUtil.newArrayList());
}
//把list中所有元素的id放到一个List集合中
List<Long> idList= list.stream()
.map(StatisticsBalanceRecordEntity::getId)
@ -202,15 +216,17 @@ public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<Stati
Map<Long, List<StatisticsBalanceRecordPhotoEntity>> groupedPhotos = recordPhotoEntityList.stream()
.collect(Collectors.groupingBy(StatisticsBalanceRecordPhotoEntity::getRecordId));
List<StatisticsBalanceRecordVO> 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

Loading…
Cancel
Save