|
@@ -448,11 +448,7 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
if (shareCount == 0) {
|
|
|
throw new CostException("未进行项目分摊参数计算,请先进行项目分摊参数计算,当前计算中止");
|
|
|
}
|
|
|
- //医疗服务项目字典
|
|
|
- List<Item> itemList = itemRepository.getList();
|
|
|
- if (CollectionUtils.isEmpty(itemList)) {
|
|
|
- throw new CostException("医疗服务项目未维护,请先添加医疗服务项目再进行计算,当前计算中止");
|
|
|
- }
|
|
|
+
|
|
|
//月度患者收费项目信息
|
|
|
List<PatientItemDepartmentGroupVo> ptChargeItems = importPatientItemRepository.getByDepartGroupComputeDateItem(computeDate, currentUser);
|
|
|
if (CollectionUtils.isEmpty(ptChargeItems)){
|
|
@@ -465,23 +461,21 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
throw new CostException("没有项目分摊配置信息无法分摊,请联系管理员");
|
|
|
}
|
|
|
|
|
|
- //作废上次计算记录
|
|
|
- repository.removeByComputeDate(computeDate, currentUser);
|
|
|
- detailRepository.removeByComputeDate(computeDate, currentUser);
|
|
|
- groupDetailRepository.removeByComputeDate(computeDate, currentUser);
|
|
|
+ //获取科室损益报表数据
|
|
|
+ List<CostDepartmentProfit> costDepartmentProfits = costDepartmentProfitRepository.getDepartmentProfit(computeDate);
|
|
|
+ if (CollectionUtils.isEmpty(costDepartmentProfits)){
|
|
|
+ throw new CostException("未进行科室损益计算,请先进行科室损益计算,当前计算中止");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//项目成本分摊配置主表信息(项目成本列配置)
|
|
|
List<ShareParamCost> ShareParamCosts = shareParamCostRepository.getList(null);
|
|
|
- //科室责任中心对照信息
|
|
|
- List<ResponsibilityDepartIdVO> responsibilityDeptMaps = responsibilityDepartmentService.getResponsibilityDepart();
|
|
|
//分摊参数信息
|
|
|
List<ComputeShareParamDetailVo> computeShareParamDetails = computeShareParamRepository.getComputeShareParamDetail(computeDate);
|
|
|
//分摊参数按责任中心汇总信息
|
|
|
List<ComputeShareParamDetailVo> computeShareParamDetailGroup = computeShareParamRepository.getComputeShareParamDetailGroup(computeDate);
|
|
|
//要计算的科室收费项目
|
|
|
List<ComputeShareParamDetailVo> computeResponsibilityItems = computeShareParamRepository.getComputeResponsibilityItem(computeDate);
|
|
|
- //获取科室损益报表数据
|
|
|
- List<CostDepartmentProfit> costDepartmentProfits = costDepartmentProfitRepository.getDepartmentProfit(computeDate);
|
|
|
|
|
|
//开始项目成本分摊计算
|
|
|
List<ComputeProjectCost> computeProjectCosts=new ArrayList<>();
|
|
@@ -531,6 +525,12 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
if (CollectionUtils.isEmpty(computeProjectCosts)) {
|
|
|
throw new CostException("没有任何可保存的数据");
|
|
|
}
|
|
|
+
|
|
|
+ //作废上次计算记录
|
|
|
+ repository.removeByComputeDate(computeDate, currentUser);
|
|
|
+ detailRepository.removeByComputeDate(computeDate, currentUser);
|
|
|
+ groupDetailRepository.removeByComputeDate(computeDate, currentUser);
|
|
|
+
|
|
|
//保存项目分摊主表对象数据
|
|
|
repository.saveBatch(computeProjectCosts, 500);
|
|
|
if (!CollectionUtils.isEmpty(computeProjectCostDetails)) {
|