|
@@ -9,12 +9,10 @@ import com.kcim.common.util.ComputeDateUtils;
|
|
|
import com.kcim.dao.model.ComputeMedicalDepartmentProfit;
|
|
|
import com.kcim.dao.model.ReportForm;
|
|
|
import com.kcim.dao.model.Responsibility;
|
|
|
+import com.kcim.dao.model.UserResponsibilityRight;
|
|
|
import com.kcim.dao.repository.ComputeMedicalDepartmentProfitRepository;
|
|
|
import com.kcim.dao.repository.CostDepartmentProfitRepository;
|
|
|
-import com.kcim.service.ComputeMedicalDepartmentProfitService;
|
|
|
-import com.kcim.service.ReportFormService;
|
|
|
-import com.kcim.service.ResponsibilityService;
|
|
|
-import com.kcim.service.SqlService;
|
|
|
+import com.kcim.service.*;
|
|
|
import com.kcim.vo.MedicalResponsibilityVo;
|
|
|
import com.kcim.vo.ReportFormProfitVo;
|
|
|
import com.kcim.web.reponse.MedicalProfitResponse;
|
|
@@ -48,12 +46,14 @@ public class ComputeMedicalDepartmentProfitServiceImpl implements ComputeMedical
|
|
|
ResponsibilityService responsibilityService ;
|
|
|
ReportFormService reportFormService;
|
|
|
CostDepartmentProfitRepository costDepartmentProfitRepository;
|
|
|
+ UserResponsibilityRightService userResponsibilityRightService;
|
|
|
|
|
|
- public ComputeMedicalDepartmentProfitServiceImpl(SqlService sqlService, ComputeMedicalDepartmentProfitRepository repository, ResponsibilityService responsibilityService, ReportFormService reportFormService, CostDepartmentProfitRepository costDepartmentProfitRepository) {
|
|
|
+ public ComputeMedicalDepartmentProfitServiceImpl(SqlService sqlService, ComputeMedicalDepartmentProfitRepository repository, ResponsibilityService responsibilityService, ReportFormService reportFormService,UserResponsibilityRightService userResponsibilityRightService, CostDepartmentProfitRepository costDepartmentProfitRepository) {
|
|
|
this.sqlService = sqlService;
|
|
|
this.repository = repository;
|
|
|
this.responsibilityService = responsibilityService;
|
|
|
this.reportFormService = reportFormService;
|
|
|
+ this.userResponsibilityRightService=userResponsibilityRightService;
|
|
|
this.costDepartmentProfitRepository = costDepartmentProfitRepository;
|
|
|
}
|
|
|
|
|
@@ -321,6 +321,25 @@ public class ComputeMedicalDepartmentProfitServiceImpl implements ComputeMedical
|
|
|
if(CollectionUtils.isEmpty(medicalProfitList)){
|
|
|
throw new CostException(reportType+"未进行科室门住损益计算");
|
|
|
}
|
|
|
+ //开启数据权限流程时
|
|
|
+ if(userResponsibilityRightService.IsUserReportRightAble()){
|
|
|
+ //获取用户所有有权限的责任中心
|
|
|
+ List<UserResponsibilityRight> currentUserResponsibilityRights = userResponsibilityRightService.getUserResponsibilityRight();
|
|
|
+ if(CollectionUtils.isEmpty(currentUserResponsibilityRights)){
|
|
|
+ throw new CostException("您没有分配责任中心权限,请联系管理员");
|
|
|
+ }
|
|
|
+ //如果不是分配了全部责任中心权限则过滤没有权限的责任中心
|
|
|
+ if(!currentUserResponsibilityRights.stream().anyMatch(userResponsibilityRight->
|
|
|
+ userResponsibilityRight.getResponsibilityCode().equals(NumberConstant.ZERO_S))){
|
|
|
+ //筛选出有权限的责任中心对象
|
|
|
+ medicalProfitList = medicalProfitList.stream().filter(responsibility ->
|
|
|
+ currentUserResponsibilityRights.stream().anyMatch(userRight ->
|
|
|
+ userRight.getResponsibilityCode().equals(responsibility.getResponsibilityCode()))).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isEmpty(medicalProfitList)){
|
|
|
+ throw new CostException("您没有对应的责任中心权限,请联系管理员");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//获取当前院区所有的责任中心
|
|
|
List<Responsibility> responsibilityAllList = responsibilityService.list(new QueryWrapper<Responsibility>().lambda()
|
|
|
.eq(Responsibility::getHospId, hospId));
|