lighter 1 éve
szülő
commit
9a05d00ac5

+ 13 - 2
src/main/java/thyyxxk/webserver/controller/outpatient/triage/TriageController.java

@@ -28,6 +28,12 @@ public class TriageController {
         return ResultVoUtil.success("ok");
     }
 
+    @PassToken
+    @GetMapping("/getBigScreenFooter")
+    public ResultVo<String> getBigScreenFooter() {
+        return ResultVoUtil.success(service.getBigScreenFooter());
+    }
+
     @GetMapping("/getUnTriagedPatients")
     public ResultVo<Map<String, Object>> getUnTriagedPatients(@RequestParam("currentPage") Integer currentPage,
                                                               @RequestParam("pageSize") Integer pageSize) {
@@ -85,9 +91,14 @@ public class TriageController {
         return service.cancelTriage(serialNo);
     }
 
+    @GetMapping("/refreshBigScreenData")
+    public ResultVo<String> refreshBigScreenData() {
+        return ResultVoUtil.success(service.refreshBigScreenData());
+    }
+
     @GetMapping("/getBigScreenData")
-    public ResultVo<List<FloorScreen>> getNotifiedPatients(@RequestParam("fullName") Boolean fullName) {
-        return service.getBigScreenData(fullName);
+    public ResultVo<List<FloorScreen>> getNotifiedPatients() {
+        return service.getBigScreenData();
     }
 
     @GetMapping("/getAllPatients")

+ 9 - 3
src/main/java/thyyxxk/webserver/dao/his/outpatient/triage/TriageDao.java

@@ -19,6 +19,9 @@ import java.util.Map;
 
 @Mapper
 public interface TriageDao {
+    @Select("select describe from t_triage_user_depts where code='system'")
+    String getBigScreenFooter();
+
     @Select("select chosen_dept from t_triage_user_depts where code=#{code}")
     String selectChosenDepts(@Param("code") String code);
 
@@ -67,7 +70,7 @@ public interface TriageDao {
             "serial_no, gh_no, req_type,reqName=(select rtrim(name) from mzy_zd_charge_type where code=a.req_type), " +
             "fz_no, slow_flag, status_flag, status_time,call_time, req_order, ampm, " +
             "socialNo=(select rtrim(d.social_no) from mz_patient_mi d where d.patient_id=a.patient_id) " +
-            "from mzfz_patient_order a where datediff(day, visit_date, getdate())=0 and status_flag='1' " +
+            "from mzfz_patient_order a where datediff(day, visit_date, getdate())=0 and status_flag in ('1','3') " +
             "and dept_code in " +
             "<foreach collection='deptCodes' item='deptCode' open='(' separator=',' close=')'>" +
             "#{deptCode}" +
@@ -98,10 +101,10 @@ public interface TriageDao {
             "select visit_date,patient_id, times, name, " +
             "dept_code, dept_name=(select name from zd_unit_code where code=(select dept_code " +
             "from mzfz_zd_dept_room where room_code=a.room_code)), " +
-            "room_code,room_name=(select room_name from mzfz_zd_dept_room where room_code=a.room_code), " +
+            "rtrim(room_code) as roomCode,room_name=(select room_name from mzfz_zd_dept_room where room_code=a.room_code), " +
             "room_no=(select room_no from mzfz_zd_dept_room where room_code=a.room_code), " +
             "room_status=(select status_flag from mzfz_zd_dept_room where room_code=a.room_code), " +
-            "doctor_code,doctor_name=(select name from a_employee_mi where code=doctor_code), " +
+            "doctor_code,doctor_name=(select rtrim(name) from a_employee_mi where code=doctor_code), " +
             "doctor_title=(select rtrim(name) from zd_emp_title where code=(select emp_tit_code from a_employee_mi where " +
             "code=doctor_code))," +
             "phone_no=(select rtrim(isnull(phone_no,'-')) from mz_patient_mi where patient_id=a.patient_id)," +
@@ -195,6 +198,9 @@ public interface TriageDao {
 
     @Select("select dept_code,rtrim(room_code) as room_code,serial_no,rtrim(name) as name,fz_no, " +
             "deptName=(select rtrim(name) from zd_unit_code where code=dept_code), " +
+            "doctorName=(select name from a_employee_mi where code=doctor_code), " +
+            "doctorTitle=(select rtrim(name) from zd_emp_title where code=(select emp_tit_code from a_employee_mi where " +
+            "code=doctor_code))," +
             "roomNo=(select room_no from mzfz_zd_dept_room where " +
             "mzfz_patient_order.room_code=mzfz_zd_dept_room.room_code) " +
             "from mzfz_patient_order where serial_no=#{serialNo}")

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/outpatient/triage/FloorScreen.java

@@ -7,6 +7,7 @@ import java.util.List;
 @Data
 public class FloorScreen {
     private Integer roomNo;
+    private String roomCode;
     private String deptName;
     private String doctorTitle;
     private String doctorName;

+ 6 - 1
src/main/java/thyyxxk/webserver/entity/outpatient/triage/MessageForPush.java

@@ -29,6 +29,8 @@ public class MessageForPush {
      * */
     private String name;
 
+    private String blurName;
+
     /**
      * 分诊序号
      * */
@@ -40,7 +42,7 @@ public class MessageForPush {
     private Integer roomNo;
 
     /**
-     * 消息类型:1: 通知患者就诊,2:正在就诊,3:刷新门口屏显,99:有VIP门诊的挂号
+     * 消息类型:1: 通知患者就诊,2:正在就诊,3:刷新门口屏显,4:有新分诊,5:取消分诊,99:有VIP门诊的挂号
      * */
     private Integer action;
 
@@ -48,4 +50,7 @@ public class MessageForPush {
      * 预约就诊时间
      * */
     private Date visitDate;
+
+    private String doctorName;
+    private String doctorTitle;
 }

+ 35 - 2
src/main/java/thyyxxk/webserver/service/outpatient/triage/TriageService.java

@@ -54,6 +54,10 @@ public class TriageService {
         this.sendWxInfoService = sendWxInfoService;
     }
 
+    public String getBigScreenFooter() {
+        return dao.getBigScreenFooter();
+    }
+
     public ResultVo<Map<String, Object>> getUnTriagedPatients(Integer currentPage, Integer pageSize) {
         String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getInstance().getTokenUserId()));
         if (depts.length == 0) {
@@ -116,7 +120,7 @@ public class TriageService {
         return ResultVoUtil.success(list);
     }
 
-    public ResultVo<List<FloorScreen>> getBigScreenData(Boolean fullName) {
+    public ResultVo<List<FloorScreen>> getBigScreenData() {
         String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getInstance().getTokenUserId()));
         if (depts.length == 0) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先前往【科室设置】分配分诊科室!");
@@ -132,6 +136,7 @@ public class TriageService {
                 fl.setDoctorTitle(item.getDoctorTitle());
                 fl.setDoctorName(item.getDoctorName());
                 fl.setRoomNo(item.getRoomNo());
+                fl.setRoomCode(item.getRoomCode());
                 List<MzfzPatientOrder> temp = new ArrayList<>();
                 temp.add(item);
                 fl.setPatients(temp);
@@ -191,7 +196,17 @@ public class TriageService {
                 room.getDeptCode(), room.getRoomCode(), room.getDoctorCode(),
                 room.getPatientNum(), room.getFuzhenFlag(), room.getSerialNo());
         dao.deleteNotifyRelation(room.getSerialNo());
-        dao.insertNotifyRelation(room.getSerialNo(), TokenUtil.getInstance().getTokenUserId(), room.getRoomCode());
+        dao.insertNotifyRelation(room.getSerialNo(), room.getTriageStaff(), room.getRoomCode());
+
+        MessageForPush messageForPush = dao.selectMessageForPush(room.getSerialNo());
+        messageForPush.setAction(4);
+        messageForPush.setBlurName(StringUtil.desensitizeName(messageForPush.getName()));
+        final String msg = JSON.toJSONString(messageForPush);
+        ApiMessageBody messageBody = new ApiMessageBody(msg);
+        messageBody.setSid(room.getTriageStaff());
+        messageBody.setRoomCode(room.getRoomCode());
+        socketService.sendFloorTriageMessage(messageBody);
+
         return ResultVoUtil.success("分诊成功。");
     }
 
@@ -207,9 +222,26 @@ public class TriageService {
     public ResultVo<Integer> cancelTriage(Integer serialNo) {
         Integer ret = dao.cancelTriage(serialNo);
         dao.deleteNotifyRelation(serialNo);
+        MessageForPush messageForPush = new MessageForPush();
+        messageForPush.setAction(5);
+        messageForPush.setSerialNo(serialNo);
+        final String msg = JSON.toJSONString(messageForPush);
+        ApiMessageBody messageBody = new ApiMessageBody(msg);
+        messageBody.setSid(TokenUtil.getInstance().getTokenUserId());
+        socketService.sendFloorTriageMessage(messageBody);
         return ResultVoUtil.success(ret);
     }
 
+    public String refreshBigScreenData() {
+        MessageForPush messageForPush = new MessageForPush();
+        messageForPush.setAction(3);
+        final String msg = JSON.toJSONString(messageForPush);
+        ApiMessageBody messageBody = new ApiMessageBody(msg);
+        messageBody.setSid(TokenUtil.getInstance().getTokenUserId());
+        socketService.sendFloorTriageMessage(messageBody);
+        return "OK";
+    }
+
     public ResultVo<Map<String, Object>> getAllPatients(String searchContent, Integer currentPage, Integer pageSize) {
         String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getInstance().getTokenUserId()));
         if (depts.length == 0) {
@@ -254,6 +286,7 @@ public class TriageService {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有找到此患者的分诊信息!");
         }
         messageForPush.setAction(param.getAction());
+        messageForPush.setBlurName(StringUtil.desensitizeName(messageForPush.getName()));
         String text = String.format("请%s号%s,到%s%s号诊室就诊。", messageForPush.getFzNo(), messageForPush.getName(),
                 messageForPush.getDeptName(), messageForPush.getRoomNo());
         log.info("消息推送>>> {}\n{}", messageForPush, text);