Explorar o código

Merge remote-tracking branch 'origin/dev1.0' into dev1.0

lmx hai 9 meses
pai
achega
9d3f125797

+ 2 - 15
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/VisitServiceImpl.java

@@ -35,22 +35,9 @@ public class VisitServiceImpl extends ServiceImpl<VisitMapper, Visit> implements
     }
 
     @Override
-    @DataScope(deptAlias = "v")
+    @DataScope(deptAlias = "v",userAlias = "u")
     public List<PatientCardDto> getPatientCardByNameOrDepartmentOrPhysician(PatientCardDto patientCardDto) {
-        //根据userId判断医生是普通医生还是科室主任,或者管理员
-        Long userId= SecurityUtils.getUserId();
-        Long roleId=visitMapper.isRole(userId);
-        if (roleId==4){
-            //非科室主任
-            return visitMapper.getPatientCardByUserId(SecurityUtils.getUsername());
-        } else if (roleId==7){
-            //科室主任
-            return visitMapper.getPatientCardByNameOrDepartmentOrPhysician(patientCardDto);
-        } else {
-            //管理员
-            return visitMapper.getPatientCardByNameOrDepartmentOrPhysician(patientCardDto);
-        }
-
+        return visitMapper.getPatientCardByNameOrDepartmentOrPhysician(patientCardDto);
 
     }
 

+ 2 - 10
ruoyi-admin/src/main/resources/mapper/work/VisitMapper.xml

@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         JOIN tb_orc_report ON tb_orc_report.visit_id=v.id
         LEFT JOIN tb_patient ON v.pat_id = tb_patient.id
         LEFT JOIN sys_dept d ON d.dept_id = v.dept_id
-
+        LEFT JOIN sys_user u ON u.user_name=v.doctor_code
         <where>
             v.hospital_status = '3'
             <if test="name!='' and name!=null">
@@ -67,15 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND v.physician like concat('%', #{physician}, '%')
             </if>
             <if test="deptId !=null and deptId != 0">
-                <choose>
-                    <when test="deptId ==100">
-                        AND (v.dept_id = #{deptId} OR v.dept_id IN (SELECT s.dept_id FROM sys_dept s WHERE s.parent_id in (SELECT s.dept_id FROM sys_dept s WHERE find_in_set( #{deptId}, parent_id ))))
-                    </when>
-                    <otherwise>
-                        AND (v.dept_id = #{deptId} AND v.dept_id IN(SELECT s.dept_id FROM sys_dept s WHERE find_in_set( #{deptId}, dept_id )))
-                    </otherwise>
-                </choose>
-
+                AND (v.dept_id = #{deptId} AND v.dept_id IN (SELECT s.dept_id FROM sys_dept s WHERE find_in_set( #{deptId}, dept_id )))
             </if>
             <if test="startTime!=null and endTime!=null ">
                 AND v.discharge_time BETWEEN #{startTime} AND DATE_ADD(#{endTime},INTERVAL 1 day)