Commit 4b4a3a42 by jianan

来佣接口27

parent 277a3473
...@@ -135,8 +135,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -135,8 +135,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if (CollUtil.isNotEmpty(fortuneBizIdList)) { if (CollUtil.isNotEmpty(fortuneBizIdList)) {
List<Fortune> fortuneList = this.list(new QueryWrapper<Fortune>().in("fortune_biz_id", fortuneBizIdList)); List<Fortune> fortuneList = this.list(new QueryWrapper<Fortune>().in("fortune_biz_id", fortuneBizIdList));
if (CollUtil.isNotEmpty(fortuneList)) { if (CollUtil.isNotEmpty(fortuneList)) {
// 按人分组 // 按人和币种分组
Map<String, List<Fortune>> fortuneMap = fortuneList.stream().collect(Collectors.groupingBy(Fortune::getBroker)); Map<String, List<Fortune>> fortuneMap = fortuneList.stream().collect(Collectors.groupingBy(fortune -> fortune.getBroker() + "_" + fortune.getCurrency()));
// 创建按人分组的导出DTO列表 // 创建按人分组的导出DTO列表
List<FortuneAccountExportDTO> accountExportDTOList = new ArrayList<>(); List<FortuneAccountExportDTO> accountExportDTOList = new ArrayList<>();
...@@ -147,9 +147,10 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -147,9 +147,10 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
.filter(StringUtils::isNotBlank) .filter(StringUtils::isNotBlank)
.collect(Collectors.toSet()); .collect(Collectors.toSet());
// 处理每个的数据 // 处理每个分组的数据
for (Map.Entry<String, List<Fortune>> entry : fortuneMap.entrySet()) { for (Map.Entry<String, List<Fortune>> entry : fortuneMap.entrySet()) {
String broker = entry.getKey(); String broker = entry.getKey().split("_")[0];
String currency = entry.getKey().split("_")[1];
List<Fortune> brokerFortunes = entry.getValue(); List<Fortune> brokerFortunes = entry.getValue();
FortuneAccountExportDTO accountDTO = new FortuneAccountExportDTO(); FortuneAccountExportDTO accountDTO = new FortuneAccountExportDTO();
...@@ -159,7 +160,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -159,7 +160,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
// 设置团队、币种(取第一个记录) // 设置团队、币种(取第一个记录)
if (CollUtil.isNotEmpty(brokerFortunes)) { if (CollUtil.isNotEmpty(brokerFortunes)) {
accountDTO.setTeam(brokerFortunes.get(0).getTeam()); accountDTO.setTeam(brokerFortunes.get(0).getTeam());
accountDTO.setCurrency(brokerFortunes.get(0).getCurrency()); accountDTO.setCurrency(currency);
} }
// 计算出账总额 // 计算出账总额
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment