hurugang 5 سال پیش
والد
کامیت
a57cc3a0b4

+ 5 - 0
src/main/java/cn/hnthyy/thmz/common/Constants.java

@@ -258,4 +258,9 @@ public class Constants {
      * 号表告警的人员配置的key
      */
     public static final String  ALARM_USER_KEY= "alarm_user";
+    /**
+     * 医生的人员类型
+     */
+    public static final Integer  DOCTOR_TIT_GRADE= 1;
+
 }

+ 11 - 0
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -977,16 +977,27 @@ public class MedicalViewApiController {
             }
             List<ZdEmpTitle> zdEmpTitles = zdEmpTitleService.queryZdEmpTitle();
             Map<String, String> titleMap = null;
+            Map<String, Integer> titGradeMap = null;
             Map<String, String> zdUnitCodeMap = list.stream().collect(Collectors.toMap(ZdUnitCode::getCode, ZdUnitCode::getName));
             if (zdEmpTitles != null && zdEmpTitles.size() > 0) {
                 titleMap = zdEmpTitles.stream().collect(Collectors.toMap(ZdEmpTitle::getCode, ZdEmpTitle::getName));
+                titGradeMap = zdEmpTitles.stream().collect(Collectors.toMap(ZdEmpTitle::getCode, ZdEmpTitle::getTitGrade));
             }
+            List<Employee> notDoctors = new ArrayList<>();
             for (Employee employee : employees) {
+                if(titGradeMap!=null){
+                    Integer titGrade = titGradeMap.get(employee.getEmpTitCode());
+                    if(!Constants.DOCTOR_TIT_GRADE.equals(titGrade)){
+                        notDoctors.add(employee);
+                        continue;
+                    }
+                }
                 if (titleMap != null) {
                     employee.setDoctorTitle(titleMap.get(employee.getEmpTitCode()));
                 }
                 employee.setDeptName(zdUnitCodeMap.get(employee.getDeptCode()));
             }
+            employees.removeAll(notDoctors);
             results.put("resultCode", 0);
             results.put("resultMessage", "查询所有门诊医生信息成功");
             results.put("data", employees);

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/ZdEmpTitle.java

@@ -15,4 +15,6 @@ public class ZdEmpTitle {
     private String pyCode;
     //五笔编码
     private String wbCode;
+    //人员类型 1 医生  2 护士
+    private Integer titGrade;
 }

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/ZdEmpTitleMapper.java

@@ -12,7 +12,7 @@ public interface ZdEmpTitleMapper {
      * @param code
      * @return
      */
-    @Select("select rtrim(code) code,rtrim(name) name,rtrim(py_code) py_code,rtrim(d_code) wb_code from zd_emp_title where code = #{code,jdbcType=CHAR}")
+    @Select("select rtrim(code) code,rtrim(name) name,rtrim(py_code) py_code,rtrim(d_code) wb_code,tit_grade from zd_emp_title where code = #{code,jdbcType=CHAR}")
     ZdEmpTitle selectByCode(@Param("code") String code);
 
 
@@ -22,6 +22,6 @@ public interface ZdEmpTitleMapper {
      *
      * @return
      */
-    @Select("select rtrim(code) code,rtrim(name) name,rtrim(py_code) py_code,rtrim(d_code) wb_code from zd_emp_title")
+    @Select("select rtrim(code) code,rtrim(name) name,rtrim(py_code) py_code,rtrim(d_code) wb_code,tit_grade from zd_emp_title")
     List<ZdEmpTitle> selectAllZdEmpTitle();
 }