Selaa lähdekoodia

Merge branch 'master' of huangrui/CostAccount into dev

lijiaxi 4 vuotta sitten
vanhempi
commit
179a7fd4c8

+ 8 - 3
src/main/java/com/imed/costaccount/service/impl/AllocationServiceImpl.java

@@ -401,8 +401,11 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
         // 设置导出
         Map<String, List<AllocationReportVO>> responsibilityMap = allocationReportVOList.stream().collect(Collectors.groupingBy(AllocationReportVO::getResponsibilityCode));
         Map<String, List<AllocationReportVO>> targetResponsibilityMap = allocationReportVOList.stream().collect(Collectors.groupingBy(AllocationReportVO::getTargetResponsibilityCode));
+        // 以会计科目查
         Map<String, AllocationReportVO> allAccMap = allocationReportVOList.stream().collect(Collectors.toMap(k -> k.getResponsibilityName() + k.getAccountName() + k.getTargetResponsibilityName() + k.getShareParamName(), synOne -> synOne));
-        Map<String, AllocationReportVO> allAliMap = allocationReportVOList.stream().collect(Collectors.toMap(k -> k.getResponsibilityName() + k.getAlias() + k.getTargetResponsibilityName() + k.getShareParamName(), synOne -> synOne));
+        // 用别名查 过滤别名不为空的
+        Map<String, AllocationReportVO> allAliMap=allocationReportVOList.stream().filter(i->StrUtil.isNotBlank(i.getAlias())).collect(Collectors.toMap(k -> k.getResponsibilityName() + k.getAlias() + k.getTargetResponsibilityName() + k.getShareParamName(), synOne -> synOne));
+//        Map<String, AllocationReportVO> allAliMap = allocationReportVOList.stream().collect(Collectors.toMap(k -> k.getResponsibilityName() + k.getAlias() + k.getTargetResponsibilityName() + k.getShareParamName(), synOne -> synOne));
         // 当前责任中心下面有几个会计科目  后面进行合并使用
         int numResponsibility;
 //        // 从第几列开始编写数据
@@ -561,10 +564,11 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
         if (Objects.isNull(levelSort) || Objects.isNull(year) || Objects.isNull(month)) {
             throw new CostException(500, "参数异常");
         }
+        // 处理第几次分摊计算值
         List<Allocation> allocationList = baseMapper.selectList(new QueryWrapper<Allocation>().lambda()
                 .eq(Allocation::getHospId, hospId).eq(Allocation::getLevelSort, levelSort).eq(Allocation::getDateYear, year)
                 .eq(Allocation::getDateMonth, month));
-        // 处理第几次分摊计算值
+
         List<Allocation> allocations = baseMapper.selectList(new QueryWrapper<Allocation>().lambda()
                 .eq(Allocation::getHospId, hospId).eq(Allocation::getDateYear, year)
                 .eq(Allocation::getDateMonth, month));
@@ -575,6 +579,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
                 .eq(CostAccountShare::getHospId, hospId));
         Map<Long, CostAccountShare> accountShareMap = costAccountShareList.stream().collect(Collectors.toMap(CostAccountShare::getId, synOne -> synOne));
         List<AllocationReportVO> allocationReportVOList = BeanUtil.convertList(allocationList, AllocationReportVO.class);
+        // 设置会计科目的
         allocationReportVOList.forEach(i -> {
             Long accountShareId = i.getAccountShareId();
             CostAccountShare costAccountShare = accountShareMap.get(accountShareId);
@@ -595,7 +600,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
                         });
                     } else {
                         // TODO 封装测试数据
-                        shareMoney.add("1000");
+                        shareMoney.add("0");
                     }
                 }
             }