Browse Source

优化住院医生和操作指南。

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
7da6e0bef3

+ 56 - 5
src/main/java/thyyxxk/webserver/controller/PublicController.java

@@ -18,11 +18,10 @@ import thyyxxk.webserver.utils.ResultVoUtil;
 import thyyxxk.webserver.utils.SnowFlakeId;
 
 import javax.naming.Context;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
 import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * <p>
@@ -176,7 +175,59 @@ public class PublicController {
     @GetMapping("/getOperationGuide")
     @PassToken
     public ResultVo<String> getOperationGuide() {
-        return service.getOperationGuide();
+        String path = "D:\\a.snapshot\\download\\操作指南";
+        File folder = new File(path);
+        String[] docFiles = folder.list(new MyExtFilter("docx"));
+        if (docFiles == null) {
+            return ResultVoUtil.success("v1.1.0");
+        }
+        for (String item : docFiles) {
+            int start = item.indexOf("v");
+            int end = item.indexOf(".docx");
+            return ResultVoUtil.success(item.substring(start, end));
+        }
+        return ResultVoUtil.success("v1.1.0");
+    }
+
+    /**
+     * 线上预览 pdf
+     * @param response
+     * @throws IOException
+     */
+    @PostMapping("/getOperationGuidePdf")
+    @PassToken
+    @Deprecated
+    public void getOperationGuidePdf(HttpServletResponse response) throws IOException {
+        String path = "D:\\a.snapshot\\download\\操作指南";
+        File folder = new File(path);
+        String[] docFiles = folder.list(new MyExtFilter("pdf"));
+        if (docFiles != null) {
+            FileInputStream inputStream = new FileInputStream(path + "\\" + docFiles[0]);
+            byte[] data = new byte[inputStream.available()];
+            inputStream.read(data);
+            response.setContentType("application/pdf");
+            response.setContentLength(data.length);
+            OutputStream os = response.getOutputStream();
+            os.write(data);
+            //先声明的流后关掉!
+            os.flush();
+            os.close();
+            inputStream.close();
+        }
+    }
+
+
+    static class MyExtFilter implements FilenameFilter {
+        private final String ext;
+
+        MyExtFilter(String ext) {
+            this.ext = ext;
+        }
+
+        public boolean accept(File dir, String name) {
+            return name.endsWith(ext);
+        }
+
     }
 
 

+ 2 - 2
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -607,8 +607,8 @@ public interface YiZhuLuRuDao {
     @Select("SELECT act_order_no, " +
             "       order_name " +
             "FROM yz_act_order " +
-            "WHERE inpatient_no = '0410707' " +
-            "  AND admiss_times = '1' " +
+            "WHERE inpatient_no = #{patNo} " +
+            "  AND admiss_times = #{times} " +
             "  AND isnull(parent_no, 0) = 0 " +
             "  and status_flag = '1' " +
             "  and serial <> '00' ")

+ 3 - 14
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -741,20 +741,9 @@ public class PublicServer {
         WebSocketServer.sendMessageToAll(SocketMsg.socketVo(Message.SYSTEM_ANNOUNCEMENT, obj));
     }
 
-    public ResultVo<String> getOperationGuide() {
-        String path = "D:\\a.snapshot\\download\\操作指南";
-        File folder = new File(path);
-        File[] files = folder.listFiles();
-        if (files != null) {
-            for (File file : files) {
-                String name = file.getName();
-                int start = name.indexOf("v");
-                int end = name.indexOf(".docx");
-                return ResultVoUtil.success(name.substring(start, end));
-            }
-        }
-        return ResultVoUtil.success("v1.1.0");
-    }
+
+
+
 
 }