|
@@ -116,9 +116,6 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
for (Responsibility responsibility : responsibilities) {
|
|
for (Responsibility responsibility : responsibilities) {
|
|
String responsibilityCode = responsibility.getResponsibilityCode();
|
|
String responsibilityCode = responsibility.getResponsibilityCode();
|
|
// 得到分摊参数对应记录,不存在,下一个
|
|
// 得到分摊参数对应记录,不存在,下一个
|
|
- if (responsibilityCode.equals("123")) {
|
|
|
|
- System.out.println(1);
|
|
|
|
- }
|
|
|
|
List<CostAccountShare> accountShares = accountShareService.getByResponsibility(responsibilityCode, hospId);
|
|
List<CostAccountShare> accountShares = accountShareService.getByResponsibility(responsibilityCode, hospId);
|
|
if (accountShares.isEmpty()) {
|
|
if (accountShares.isEmpty()) {
|
|
continue;
|
|
continue;
|
|
@@ -311,19 +308,19 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
if (CollUtil.isEmpty(costingGroups)) {
|
|
if (CollUtil.isEmpty(costingGroups)) {
|
|
return BigDecimal.ZERO;
|
|
return BigDecimal.ZERO;
|
|
}
|
|
}
|
|
- // 计算方式 0是合并计算 1是分开计算
|
|
|
|
BigDecimal costAmount = BigDecimal.ZERO;
|
|
BigDecimal costAmount = BigDecimal.ZERO;
|
|
List<Allocation> all = new ArrayList<>();
|
|
List<Allocation> all = new ArrayList<>();
|
|
if (!costList.isEmpty()) {
|
|
if (!costList.isEmpty()) {
|
|
all = costList.stream().filter(i -> i.getTargetResponsibilityCode().equals(responsibilityCode)).collect(Collectors.toList());
|
|
all = costList.stream().filter(i -> i.getTargetResponsibilityCode().equals(responsibilityCode)).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
+ // 计算方式 0是合并计算 1是分开计算
|
|
if (calcType == 0) {
|
|
if (calcType == 0) {
|
|
costAmount = costingGroups.stream().map(CostCostingGroup::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
costAmount = costingGroups.stream().map(CostCostingGroup::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
if (!all.isEmpty()) {
|
|
if (!all.isEmpty()) {
|
|
|
|
|
|
BigDecimal bigDecimal = all.stream()
|
|
BigDecimal bigDecimal = all.stream()
|
|
.map(Allocation::getAmount)
|
|
.map(Allocation::getAmount)
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::subtract);
|
|
|
|
|
|
if (Objects.nonNull(bigDecimal)) {
|
|
if (Objects.nonNull(bigDecimal)) {
|
|
costAmount = costAmount.add(bigDecimal);
|
|
costAmount = costAmount.add(bigDecimal);
|
|
@@ -342,7 +339,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
if (!all.isEmpty()) {
|
|
if (!all.isEmpty()) {
|
|
BigDecimal bigDecimal = all.stream()
|
|
BigDecimal bigDecimal = all.stream()
|
|
.map(Allocation::getAmount)
|
|
.map(Allocation::getAmount)
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::subtract);
|
|
if (Objects.nonNull(bigDecimal)) {
|
|
if (Objects.nonNull(bigDecimal)) {
|
|
costAmount = costAmount.add(bigDecimal);
|
|
costAmount = costAmount.add(bigDecimal);
|
|
}
|
|
}
|