|
@@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
@@ -207,7 +208,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
|
}
|
|
|
|
|
|
// 入cost_allocation_query 表 便于后续操作
|
|
|
- this.saveAllocationQuery(list, costingGroups, hospId);
|
|
|
+ this.saveAllocationQuery(list, costingGroups, hospId, startDTO.getYear(), startDTO.getMonth());
|
|
|
}
|
|
|
|
|
|
private void removeData(StartDTO startDTO, Long hospId) {
|
|
@@ -226,7 +227,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
|
}
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
|
- public void saveAllocationQuery(List<Allocation> list, List<CostCostingGroup> costingGroups, Long hospId) {
|
|
|
+ public void saveAllocationQuery(List<Allocation> list, List<CostCostingGroup> costingGroups, Long hospId, Integer year, Integer month) {
|
|
|
List<AllocationQuery> saveList = new ArrayList<>();
|
|
|
List<Long> maxId = shareLevelService.getMaxId(hospId);
|
|
|
list = list.stream().filter(i -> maxId.contains(i.getTargetShareLevelId())).collect(Collectors.toList());
|
|
@@ -257,6 +258,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
|
saveList.add(allocationQuery);
|
|
|
});
|
|
|
|
|
|
+ costingGroups = costCostingGroupService.getRealData(maxId, hospId, year, month);
|
|
|
costingGroups.forEach(i -> {
|
|
|
AllocationQuery allocationQuery = new AllocationQuery();
|
|
|
String responsibilityCode = i.getResponsibilityCode();
|