Quellcode durchsuchen

Merge branch 'master' of huangrui/CostAccount into dev

huangrui vor 4 Jahren
Ursprung
Commit
7f353323ce

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

@@ -130,10 +130,10 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
                         throw new CostException("责任中心:" + accountShare.getResponsibilityName() + ";会计中心为:" + accountShare.getAccountingNames() + ";未设置分摊参数比例");
                     }
 
-                    List<CostCostingGroup> groups = responsibilityCodeMap.get(responsibilityCode);
-                    if (CollUtil.isEmpty(groups)) {
-                        continue;
-                    }
+//                    List<CostCostingGroup> groups = responsibilityCodeMap.get(responsibilityCode);
+//                    if (CollUtil.isEmpty(groups)) {
+//                        continue;
+//                    }
                     // 计算本次分摊的钱
                     BigDecimal totalAmount = this.getCostAmount(accountShare, calcType, responsibilityCodeMap, costList);
                     if (totalAmount.equals(BigDecimal.ZERO)) {
@@ -320,7 +320,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
 
                 BigDecimal bigDecimal = all.stream()
                         .map(Allocation::getAmount)
-                        .reduce(BigDecimal.ZERO, BigDecimal::subtract);
+                        .reduce(BigDecimal.ZERO, BigDecimal::add);
 
                 if (Objects.nonNull(bigDecimal)) {
                     costAmount = costAmount.add(bigDecimal);
@@ -339,7 +339,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
                 if (!all.isEmpty()) {
                     BigDecimal bigDecimal = all.stream()
                             .map(Allocation::getAmount)
-                            .reduce(BigDecimal.ZERO, BigDecimal::subtract);
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
                     if (Objects.nonNull(bigDecimal)) {
                         costAmount = costAmount.add(bigDecimal);
                     }