Просмотр исходного кода

Merge remote-tracking branch 'origin/20211018_yw_check' into 20211018_yw_check

chengyao 3 лет назад
Родитель
Сommit
8e7733b3dc

+ 8 - 6
src/main/java/com/diagbot/facade/MedCheckInfoFacade.java

@@ -3,6 +3,7 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.BasDeptInfoDTO;
 import com.diagbot.dto.CheckDeptDTO;
 import com.diagbot.dto.CheckJobDTO;
 import com.diagbot.dto.CheckMedoupDTO;
@@ -10,6 +11,7 @@ import com.diagbot.dto.CheckWardDTO;
 import com.diagbot.dto.DeptCheckUserDTO;
 import com.diagbot.entity.BasDeptInfo;
 import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.entity.DeptMedoup;
 import com.diagbot.entity.MedCheckInfo;
 import com.diagbot.entity.RegionDept;
 import com.diagbot.entity.SysRole;
@@ -609,18 +611,18 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .in("dept_id", deptIds)).stream().map(RegionDept::getRegionCode).collect(Collectors.toList());
         checkUserVOS.setRegion(regionCodes);
-        //1.3.1获取当前登录用户所在的医疗组
+        //1.3.1获取当前科室的医疗组
         List<String> userNames = sysUserFacade.list(new QueryWrapper<SysUser>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("id", principleId)
         ).stream().map(SysUser::getUsername).collect(Collectors.toList());
         if (ListUtil.isNotEmpty(userNames)) {
-            List<String> medoups = medoupUserService.list(new QueryWrapper<BasDoctorInfo>()
+            //获取本人科室关联的医疗组code
+            List<DeptMedoup> deptMedoups = deptMedoupService.list(new QueryWrapper<DeptMedoup>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("doctor_id", userNames)
-            ).stream().map(BasDoctorInfo::getGroupId).collect(Collectors.toList());
-            if (ListUtil.isNotEmpty(medoups)) {
-                checkUserVOS.setMedoup(medoups);
+                    .in("dept_id", deptIds));
+            if (ListUtil.isNotEmpty(deptMedoups)) {
+                checkUserVOS.setMedoup(deptMedoups.stream().map(DeptMedoup::getMedoupCode).collect(Collectors.toList()));
             }
         }
         //获取所有的科室核查人员

+ 4 - 4
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -302,15 +302,15 @@
             <if test="checkId !=null and checkId != ''">
                 and b.check_id = #{checkId}
             </if>
-            <if test="deptList !=null and deptList.size()!=0 and jobType==0">
+            <if test="depts !=null and depts.size()!=0 and jobType==0">
                 and a.beh_dept_id in
-                <foreach collection="deptList" item="item" open="(" close=")" separator=",">
+                <foreach collection="depts" item="item" open="(" close=")" separator=",">
                     #{item}
                 </foreach>
             </if>
-            <if test="deptList !=null and deptList.size()!=0 and jobType==2">
+            <if test="depts !=null and depts.size()!=0 and jobType==2">
                 and a.beh_dept_id not in
-                <foreach collection="deptList" item="item" open="(" close=")" separator=",">
+                <foreach collection="depts" item="item" open="(" close=")" separator=",">
                     #{item}
                 </foreach>
             </if>