Explorar el Código

分诊/所有挂号,不再使用后端分页,并按时间倒序排序

lighter hace 5 meses
padre
commit
9076352d00

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

@@ -104,10 +104,8 @@ public class TriageController {
     }
 
     @GetMapping("/getAllPatients")
-    public ResultVo<Map<String, Object>> getAllPatients(@RequestParam("searchContent") String searchContent,
-                                                        @RequestParam("currentPage") Integer currentPage,
-                                                        @RequestParam("pageSize") Integer pageSize) {
-        return service.getAllPatients(searchContent, currentPage, pageSize);
+    public ResultVo<List<MzfzPatientOrder>> getAllPatients(@RequestParam("searchContent") String searchContent) {
+        return service.getAllPatients(searchContent);
     }
 
     @GetMapping("/getMzVitalSigns")

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

@@ -178,10 +178,10 @@ public interface TriageDao {
             "and dept_code in " +
             "<foreach collection='deptCodes' item='deptCode' open='(' separator=',' close=')'>" +
             "#{deptCode}" +
-            "</foreach>" +
+            "</foreach> " +
+            "order by a.visit_date desc" +
             "</script>")
-    IPage<MzfzPatientOrder> getAllPatients(IPage<MzfzPatientOrder> iPage, @Param("deptCodes") String[] deptCodes,
-                                           @Param("content") String content);
+    List<MzfzPatientOrder> getAllPatients(@Param("deptCodes") String[] deptCodes, @Param("content") String content);
 
     @Select("select * from mz_ysh_tzxx where patient_id=#{patientId} and datediff(day, visit_date, getdate())=0")
     MzYshTzxx getMzVitalSigns(@Param("patientId") String patientId);

+ 3 - 7
src/main/java/thyyxxk/webserver/service/outpatient/triage/TriageService.java

@@ -246,18 +246,14 @@ public class TriageService {
         return "OK";
     }
 
-    public ResultVo<Map<String, Object>> getAllPatients(String searchContent, Integer currentPage, Integer pageSize) {
+    public ResultVo<List<MzfzPatientOrder>> getAllPatients(String searchContent) {
         String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getInstance().getTokenUserId()));
         if (depts.length == 0) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先前往【科室设置】分配分诊科室!");
         }
-        Map<String, Object> map = new HashMap<>(Capacity.TWO);
         searchContent = StringUtil.isBlank(searchContent) ? "%%" : searchContent + "%";
-        IPage<MzfzPatientOrder> iPage = new Page<>(currentPage, pageSize);
-        iPage = dao.getAllPatients(iPage, depts, searchContent);
-        map.put("totalSize", iPage.getTotal());
-        map.put("list", iPage.getRecords());
-        return ResultVoUtil.success(map);
+        List<MzfzPatientOrder> list = dao.getAllPatients(depts, searchContent);
+        return ResultVoUtil.success(list);
     }
 
     public ResultVo<MzYshTzxx> getMzVitalSigns(String patientId) {