|
@@ -11,6 +11,7 @@ import com.diagbot.dto.MedoupDTO;
|
|
import com.diagbot.dto.RegionDTO;
|
|
import com.diagbot.dto.RegionDTO;
|
|
import com.diagbot.dto.RegionMedoupDTO;
|
|
import com.diagbot.dto.RegionMedoupDTO;
|
|
import com.diagbot.entity.BasDoctorInfo;
|
|
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.Medoup;
|
|
import com.diagbot.entity.Medoup;
|
|
@@ -378,34 +379,42 @@ public class MedCheckWorkFacade {
|
|
}
|
|
}
|
|
regionMedoup.setMedoups(medoups);
|
|
regionMedoup.setMedoups(medoups);
|
|
//获取当前用户的医疗组信息
|
|
//获取当前用户的医疗组信息
|
|
-// MedoupUser medoupUser = medoupUserService.getOne(new QueryWrapper<MedoupUser>()
|
|
|
|
-// .eq("user_id", SysUserUtils.getCurrentPrincipleID())
|
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
|
-// if (medoupUser == null || medoupUser.getMedoupCode() == null) {
|
|
|
|
-// throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户无医疗组关联信息");
|
|
|
|
-// }
|
|
|
|
-// regionMedoup.setLocalMedoupCode(medoupUser.getMedoupCode());
|
|
|
|
|
|
+ List<String> userNames = sysUserFacade.list(new QueryWrapper<SysUser>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("id", SysUserUtils.getCurrentPrincipleID())
|
|
|
|
+ ).stream().map(SysUser::getUsername).collect(Collectors.toList());
|
|
|
|
+ if (ListUtil.isNotEmpty(userNames)) {
|
|
|
|
+ List<String> medoupTemps = medoupUserService.list(new QueryWrapper<BasDoctorInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .in("doctor_id", userNames)
|
|
|
|
+ ).stream().map(BasDoctorInfo::getGroupId).collect(Collectors.toList());
|
|
|
|
+ if (ListUtil.isNotEmpty(medoups)) {
|
|
|
|
+ regionMedoup.setLocalMedoupCode(medoupTemps.get(0));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return regionMedoup;
|
|
return regionMedoup;
|
|
}
|
|
}
|
|
|
|
|
|
private List<MedoupDTO> getLocalMdeoup(List<BasDeptInfoDTO> selDepts) {
|
|
private List<MedoupDTO> getLocalMdeoup(List<BasDeptInfoDTO> selDepts) {
|
|
List<MedoupDTO> medoups = new ArrayList<>();
|
|
List<MedoupDTO> medoups = new ArrayList<>();
|
|
if (ListUtil.isNotEmpty(selDepts)) {
|
|
if (ListUtil.isNotEmpty(selDepts)) {
|
|
-// List<String> deptIds = selDepts.stream().map(BasDeptInfoDTO::getDeptId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> deptIds = selDepts.stream().map(BasDeptInfoDTO::getDeptId).collect(Collectors.toList());
|
|
//获取本人科室关联的医疗组code
|
|
//获取本人科室关联的医疗组code
|
|
-// List<DeptMedoup> deptMedoups = deptMedoupService.list(new QueryWrapper<DeptMedoup>()
|
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
-// .in("dept_id", deptIds));
|
|
|
|
- List<String> medoupCodes = null;
|
|
|
|
- List<String> doctorIds = sysUserFacade.list(new QueryWrapper<SysUser>()
|
|
|
|
|
|
+ List<DeptMedoup> deptMedoups = deptMedoupService.list(new QueryWrapper<DeptMedoup>()
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("id", SysUserUtils.getCurrentPrincipleID())
|
|
|
|
- ).stream().map(SysUser::getUsername).collect(Collectors.toList());
|
|
|
|
- if (ListUtil.isNotEmpty(doctorIds)) {
|
|
|
|
- medoupCodes = medoupUserService.list(new QueryWrapper<BasDoctorInfo>()
|
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
- .in("doctor_id", doctorIds)
|
|
|
|
- ).stream().map(BasDoctorInfo::getGroupId).collect(Collectors.toList());
|
|
|
|
|
|
+ .in("dept_id", deptIds));
|
|
|
|
+ List<String> medoupCodes = null;
|
|
|
|
+// List<String> doctorIds = sysUserFacade.list(new QueryWrapper<SysUser>()
|
|
|
|
+// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+// .eq("id", SysUserUtils.getCurrentPrincipleID())
|
|
|
|
+// ).stream().map(SysUser::getUsername).collect(Collectors.toList());
|
|
|
|
+ if (ListUtil.isNotEmpty(deptMedoups)) {
|
|
|
|
+ medoupCodes = deptMedoups.stream().map(DeptMedoup::getMedoupCode).collect(Collectors.toList());
|
|
|
|
+// medoupCodes = medoupUserService.list(new QueryWrapper<BasDoctorInfo>()
|
|
|
|
+// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+// .in("doctor_id", doctorIds)
|
|
|
|
+// ).stream().map(BasDoctorInfo::getGroupId).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|
|
if (ListUtil.isNotEmpty(medoupCodes)) {
|
|
if (ListUtil.isNotEmpty(medoupCodes)) {
|