|
@@ -6,6 +6,8 @@ import com.diagbot.dto.BehospitalInfoAgeDTO;
|
|
import com.diagbot.dto.CheckedRecordListDTO;
|
|
import com.diagbot.dto.CheckedRecordListDTO;
|
|
import com.diagbot.dto.SysUserDeptDTO;
|
|
import com.diagbot.dto.SysUserDeptDTO;
|
|
import com.diagbot.entity.BasDeptInfo;
|
|
import com.diagbot.entity.BasDeptInfo;
|
|
|
|
+import com.diagbot.entity.BasDoctorInfo;
|
|
|
|
+import com.diagbot.entity.DeptMedoup;
|
|
import com.diagbot.entity.MedBehospitalType;
|
|
import com.diagbot.entity.MedBehospitalType;
|
|
import com.diagbot.entity.MedCheckInfo;
|
|
import com.diagbot.entity.MedCheckInfo;
|
|
import com.diagbot.entity.SysRole;
|
|
import com.diagbot.entity.SysRole;
|
|
@@ -20,6 +22,7 @@ import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.service.MedQcresultDetailService;
|
|
import com.diagbot.service.MedQcresultDetailService;
|
|
|
|
+import com.diagbot.service.impl.DeptMedoupServiceImpl;
|
|
import com.diagbot.service.impl.MedBehospitalTypeServiceImpl;
|
|
import com.diagbot.service.impl.MedBehospitalTypeServiceImpl;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
@@ -34,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.security.core.userdetails.User;
|
|
import org.springframework.security.core.userdetails.User;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import java.util.Collection;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -65,6 +69,10 @@ public class RecordCheckFacade {
|
|
BasDeptInfoFacade basDeptInfoFacade;
|
|
BasDeptInfoFacade basDeptInfoFacade;
|
|
@Autowired
|
|
@Autowired
|
|
MedBehospitalTypeServiceImpl medBehospitalTypeServiceImpl;
|
|
MedBehospitalTypeServiceImpl medBehospitalTypeServiceImpl;
|
|
|
|
+ @Autowired
|
|
|
|
+ DeptMedoupServiceImpl deptMedoupService;
|
|
|
|
+ @Autowired
|
|
|
|
+ BasDoctorInfoFacade basDoctorInfoFacade;
|
|
|
|
|
|
|
|
|
|
public IPage<CheckedRecordListDTO> checkedRecordList(CheckedRecordListVO checkedRecordListVO) {
|
|
public IPage<CheckedRecordListDTO> checkedRecordList(CheckedRecordListVO checkedRecordListVO) {
|
|
@@ -106,7 +114,8 @@ public class RecordCheckFacade {
|
|
deptIds.remove(deptInfo.getDeptId());
|
|
deptIds.remove(deptInfo.getDeptId());
|
|
}
|
|
}
|
|
JobTypes.add(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "");
|
|
JobTypes.add(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "");
|
|
- userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.DEPT_GENERAL.getKey()));
|
|
|
|
|
|
+// userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.DEPT_GENERAL.getKey()));
|
|
|
|
+ userIds.addAll(getUserIdsOfRoleId(checkedRecordListVO,deptIds, CheckerRoleEnum.DEPT_GENERAL.getKey()));
|
|
} else if ((roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey() && ListUtil.isNotEmpty(deptIds))
|
|
} else if ((roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey() && ListUtil.isNotEmpty(deptIds))
|
|
|| roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey() || roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()) {
|
|
|| roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey() || roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()) {
|
|
userIds.add(userId);
|
|
userIds.add(userId);
|
|
@@ -133,6 +142,11 @@ public class RecordCheckFacade {
|
|
checkedRecordListVO.setCurrentDeptIds(String.join(",", deptIds));
|
|
checkedRecordListVO.setCurrentDeptIds(String.join(",", deptIds));
|
|
checkedRecordListVO.setCurrentGeneralUserIds(userIds);
|
|
checkedRecordListVO.setCurrentGeneralUserIds(userIds);
|
|
checkedRecordListVO.setHospitalId(hospitalId);
|
|
checkedRecordListVO.setHospitalId(hospitalId);
|
|
|
|
+
|
|
|
|
+ //通过主治医生去查,病区、科室、医疗组不作为筛选条件
|
|
|
|
+ checkedRecordListVO.setDepts(null);
|
|
|
|
+ checkedRecordListVO.setWards(null);
|
|
|
|
+ checkedRecordListVO.setMedoups(null);
|
|
IPage<CheckedRecordListDTO> iPage = medCheckInfoFacade.getBaseMapper().checkedRecordList(checkedRecordListVO);
|
|
IPage<CheckedRecordListDTO> iPage = medCheckInfoFacade.getBaseMapper().checkedRecordList(checkedRecordListVO);
|
|
|
|
|
|
if (ListUtil.isNotEmpty(iPage.getRecords())) {
|
|
if (ListUtil.isNotEmpty(iPage.getRecords())) {
|
|
@@ -148,6 +162,44 @@ public class RecordCheckFacade {
|
|
return iPage;
|
|
return iPage;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private List<Long> getUserIdsOfRoleId(CheckedRecordListVO checkedRecordListVO,List<String> depts, long roleId) {
|
|
|
|
+ //如果没有添加医疗组筛选条件默认筛选全部医疗组
|
|
|
|
+ List<String> codes = null;
|
|
|
|
+ if (ListUtil.isEmpty(checkedRecordListVO.getMedoups())) {
|
|
|
|
+ //通过科室获取医疗组
|
|
|
|
+ List<DeptMedoup> deptMedoups = deptMedoupService.list(new QueryWrapper<DeptMedoup>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .in("dept_id", depts));
|
|
|
|
+ if (ListUtil.isNotEmpty(deptMedoups)) {
|
|
|
|
+ codes = deptMedoups.stream().map(DeptMedoup::getMedoupCode).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ codes = checkedRecordListVO.getMedoups();
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(codes)) {
|
|
|
|
+ List<BasDoctorInfo> basDoctorInfos = basDoctorInfoFacade.list(new QueryWrapper<BasDoctorInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .in("group_id", codes));
|
|
|
|
+ List<String> usernames = basDoctorInfos.stream().map(BasDoctorInfo::getDoctorId).collect(Collectors.toList());
|
|
|
|
+ if (ListUtil.isEmpty(usernames)) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ //获取用户id
|
|
|
|
+ List<Long> userIds = sysUserFacade.list(new QueryWrapper<SysUser>()
|
|
|
|
+ .in("username",usernames)
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ ).stream().map(SysUser::getId).collect(Collectors.toList());
|
|
|
|
+ if (ListUtil.isEmpty(userIds)) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ QueryWrapper<SysUserRole> sysUserRoleQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ sysUserRoleQueryWrapper.in("user_id", userIds);
|
|
|
|
+ sysUserRoleQueryWrapper.eq("role_id", roleId);
|
|
|
|
+ return sysUserRoleFacade.list(sysUserRoleQueryWrapper).stream().map(i -> i.getUserId()).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
private List<Long> getUserIdsOfRoleId(Long hospitalId, List<String> deptIds, long roleId) {
|
|
private List<Long> getUserIdsOfRoleId(Long hospitalId, List<String> deptIds, long roleId) {
|
|
QueryWrapper<SysUserDept> sysUserDeptQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<SysUserDept> sysUserDeptQueryWrapper = new QueryWrapper<>();
|
|
sysUserDeptQueryWrapper.eq("hospital_id", hospitalId);
|
|
sysUserDeptQueryWrapper.eq("hospital_id", hospitalId);
|