lighter преди 1 година
родител
ревизия
bc172d936e

+ 5 - 0
src/main/java/thyyxxk/webserver/controller/LoginController.java

@@ -43,6 +43,11 @@ public class LoginController {
         return service.getWards();
     }
 
+    @PassToken
+    @GetMapping("/getAllWards")
+    public ResultVo<List<CodeName>> getAllWards() {
+        return service.getAllWards();
+    }
 
     @GetMapping("/sendAVerificationCode")
     @PassToken

+ 2 - 0
src/main/java/thyyxxk/webserver/controller/dashboard/DashboardController.java

@@ -5,6 +5,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.dashboard.InpatientBrief;
 import thyyxxk.webserver.service.dashboard.DashboardService;
@@ -21,6 +22,7 @@ public class DashboardController {
         this.service = service;
     }
 
+    @PassToken
     @GetMapping("/selectInpatientBriefs")
     public ResultVo<List<InpatientBrief>> selectInpatientBriefs(@RequestParam("deptCode") String deptCode) {
         return service.selectInpatientBriefs(deptCode);

+ 4 - 0
src/main/java/thyyxxk/webserver/service/LoginService.java

@@ -155,6 +155,10 @@ public class LoginService {
         }
     }
 
+    public ResultVo<List<CodeName>> getAllWards() {
+        return ResultVoUtil.success(dao.getAllWards());
+    }
+
     private String makeSid(String code, String sid, String ip) {
         String uuid = UUID.randomUUID().toString().replaceAll("-", "");
         if (StringUtil.notBlank(sid) && "fromTriageScreen".equals(sid)) {

+ 12 - 17
src/main/java/thyyxxk/webserver/service/dashboard/DashboardService.java

@@ -25,24 +25,19 @@ public class DashboardService {
 
     public ResultVo<List<InpatientBrief>> selectInpatientBriefs(String deptCode) {
         List<InpatientBrief> list = dao.selectInpatientBrief(deptCode);
-        if (null == list) {
-            list = new ArrayList<>();
-        }
-        if (!list.isEmpty()) {
-            list.forEach(itm -> {
-                itm.setIndays(DateUtil.daysBetween(new Date(), itm.getAdmissDate()));
-                itm.setMedTypeName(MedType.getName(itm.getMedType()));
-                if (StringUtil.isBlank(itm.getSickLevelOrderName())) {
-                    itm.setSickLevel(0);
-                } else {
-                    if (itm.getSickLevelOrderName().equals("病重")) {
-                        itm.setSickLevel(1);
-                    } else if (itm.getSickLevelOrderName().equals("病危")) {
-                        itm.setSickLevel(2);
-                    }
+        list.forEach(itm -> {
+            itm.setIndays(DateUtil.daysBetween(new Date(), itm.getAdmissDate()));
+            itm.setMedTypeName(MedType.getName(itm.getMedType()));
+            if (StringUtil.isBlank(itm.getSickLevelOrderName())) {
+                itm.setSickLevel(0);
+            } else {
+                if (itm.getSickLevelOrderName().equals("病重")) {
+                    itm.setSickLevel(1);
+                } else if (itm.getSickLevelOrderName().equals("病危")) {
+                    itm.setSickLevel(2);
                 }
-            });
-        }
+            }
+        });
         return ResultVoUtil.success(list);
     }
 }