فهرست منبع

优化检验检查的模板数据

DESKTOP-0GD05B0\Administrator 2 سال پیش
والد
کامیت
1d0ad3b04b

+ 3 - 10
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/JianYanJianChaController.java

@@ -69,13 +69,6 @@ public class JianYanJianChaController {
         return server.jianChaJianYanFenLei(total, currentPage, leiXing, jianCha);
     }
 
-    @GetMapping("/chaKanFenLeiXiangQing")
-    public ResultVo<List<Map<String, String>>> chaKanFenLeiXiangQing(@RequestParam("code") String code,
-                                                                     @RequestParam("bwCode") String bwCode,
-                                                                     @RequestParam("jianCha") Boolean jianCha) {
-        return server.chaKanFenLeiXiangQing(code, bwCode, jianCha);
-    }
-
     @GetMapping("/shanShuJianChaMuBan")
     public ResultVo<String> shanShuJianChaMuBan(@RequestParam("code") String code,
                                                 @RequestParam("deptCode") String deptCode) {
@@ -148,7 +141,7 @@ public class JianYanJianChaController {
     @GetMapping("/queryCheckTextResults")
     public ResultVo<Map<String, Object>> queryCheckTextResults(@RequestParam("patNo") String patNo,
                                                                @RequestParam("reqNo") String reqNo) {
-        return server.queryCheckTextResults(patNo,  reqNo);
+        return server.queryCheckTextResults(patNo, reqNo);
     }
 
     @GetMapping("/getJyJcZdTree")
@@ -160,13 +153,13 @@ public class JianYanJianChaController {
 
     @GetMapping("/getJcItem")
     @PassToken
-    public ResultVo<List<JyJcItem>> getJcItem(@RequestParam("code")String code) {
+    public ResultVo<List<JyJcItem>> getJcItem(@RequestParam("code") String code) {
         return server.getJcItem(code);
     }
 
     @GetMapping("/getJyItem")
     @PassToken
-    public ResultVo<List<JyJcItem>> getJyItem(@RequestParam("code")String code) {
+    public ResultVo<List<JyJcItem>> getJyItem(@RequestParam("code") String code) {
         return server.getJyItem(code);
     }
 

+ 6 - 5
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/YizhuLuRuController.java

@@ -95,11 +95,12 @@ public class YizhuLuRuController {
     }
 
     @GetMapping("/huoQuFeiYongXinXi")
-    public ResultVo<Map<String, Object>> huoQuFeiYongXinXi(@RequestParam("code") String code,
-                                                           @RequestParam("serial") String serial,
-                                                           @RequestParam("deptCode") String deptCode,
-                                                           @RequestParam("groupNo") String groupNo) {
-        return server.huoQuFeiYongXinXi(code, serial, deptCode,groupNo);
+    public ResultVo<Map<String, Object>> huoQuFeiYongXinXi(@RequestParam("queryCode") String queryCode) {
+        if (queryCode == null) {
+            return ResultVoUtil.success();
+        }
+        String[] str = queryCode.split("_");
+        return server.huoQuFeiYongXinXi(str[0], str[1], str[2], str[3]);
     }
 
     @PostMapping("/deleteMultipleOrders")

+ 28 - 38
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/JianYanJianChaDao.java

@@ -152,8 +152,9 @@ public interface JianYanJianChaDao {
     long jianChaMingTiaoShu();
 
     @Select("select tc_name as name," +
-            "       tc_no as code " +
-            "from zy_tc_yj with (NOLOCK)" +
+            "       rtrim(tc_no) as code," +
+            "       '1' as isTheParentNode " +
+            "from zy_tc_yj c with (NOLOCK)" +
             "where isnull(del_flag, '0') = '0' and " +
             "${ew.sqlSegment}")
     List<JcZdClass> getTemplate(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
@@ -177,42 +178,6 @@ public interface JianYanJianChaDao {
                                         @Param("userCode") String userCode,
                                         @Param("reqType") String reqType);
 
-    @Select("SELECT rtrim(a.order_code) orderCode, " +
-            "       rtrim(a.order_name) orderName, " +
-            "       rtrim(a.yb_comment) ybComment, " +
-            "       checkFlag='0', " +
-            "       a.order_type AS orderType," +
-            "       a.exec_dept as execDept," +
-            "       (select rtrim(name) from zd_unit_code where code = a.exec_dept) execDeptName," +
-            "       getdate() as startTime " +
-            "FROM yz_order_item a with (NOLOCK), " +
-            "     jc_zd_item b with (NOLOCK), " +
-            "     ysh_zd_part_code c with (NOLOCK) " +
-            "where a.order_type = #{orderType} " +
-            "          and isnull(b.bw_code, 0) = #{bwCode} and " +
-            "      isnull(a.del_flag, '') <> '1' and " +
-            "      a.order_code = b.zy_order_code and b.bw_code *= c.code " +
-            "order by a.order_name")
-    List<Map<String, String>> chaKanFenLeiXiangQing(@Param("orderType") String orderType,
-                                                    @Param("bwCode") String bwCode);
-
-
-    @Select("SELECT         rtrim(a.order_code)                                             orderCode, " +
-            "               rtrim(a.order_name)                                             orderName, " +
-            "               rtrim(a.yb_comment)                                             ybComment, " +
-            "    checkFlag='0', " +
-            "               a.exec_dept   as                                                execDept, " +
-            "               (select rtrim(name) from zd_unit_code with (NOLOCK) where code = a.exec_dept) execDeptName, " +
-            "               getdate()     as                                                startTime, " +
-            "               b.sample_code as                                                inspectStuff," +
-            "    (select name from jy_zd_sample with (NOLOCK) where jy_zd_sample.code = b.sample_code) as inspectStuffName " +
-            "FROM yz_order_item a with (NOLOCK), " +
-            "     jy_zd_item b with (NOLOCK) " +
-            "where jy_type = #{code} " +
-            "  and isnull(a.del_flag, '') <> '1' " +
-            "  and a.order_code = b.zy_order_code " +
-            "order by order_name")
-    List<Map<String, String>> chaKanJianYanXiangQing(@Param("code") String code);
 
     @Select("select op_id,tc_exec " +
             "from zy_tc_yj with (NOLOCK) " +
@@ -248,6 +213,31 @@ public interface JianYanJianChaDao {
                                                  @Param("reqType") String reqType);
 
 
+    @Select("SELECT rtrim(a.order_code) as                                          orderCode, " +
+            "       rtrim(a.order_name) as                                          orderName, " +
+            "       rtrim(a.order_code) as                                          code, " +
+            "       rtrim(a.order_name) as                                          name, " +
+            "       rtrim(a.yb_comment)                                             ybComment, " +
+            "       '0'                 as                                          checkFlag, " +
+            "       a.exec_dept         as                                          execDept, " +
+            "       a.order_type        as                                          orderType, " +
+            "       (select rtrim(name) from zd_unit_code with (NOLOCK) where code = a.exec_dept) execDeptName, " +
+            "       CONVERT(varchar(100), GETDATE(), 20)           as               startTime," +
+            "       inspect_stuff as inspectStuff , " +
+            "       inspectStuffName = (select rtrim(name) from jy_zd_sample with (NOLOCK) where code = inspect_stuff)," +
+            "       rtrim(c.tc_no) as tc_no," +
+            "       '2' as isTheParentNode " +
+            "FROM yz_order_item a with (NOLOCK), " +
+            "     zy_tc_detail_yj b with (NOLOCK), " +
+            "     zy_tc_yj c with (NOLOCK) " +
+            "where b.tc_no = c.tc_no " +
+            "  and a.order_code = b.order_code " +
+            "  and isnull(a.del_flag, '') <> '1'" +
+            "  and isnull(c.del_flag, '') <> '1' " +
+            "  and ${ew.sqlSegment} ")
+    List<Map<String, String>> selectTemplateContent(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
+
+
     @Select("<script>" +
             "SELECT jc_text,name,code,wh_flag,op_id " +
             "FROM ysh_zd_yj_template with (NOLOCK) " +

+ 10 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/jianyanjiancha/JcZdClass.java

@@ -3,6 +3,9 @@ package thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha;
 
 import lombok.Data;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 描述: 检验检查侧边栏
@@ -23,6 +26,8 @@ public class JcZdClass {
      */
     private String name;
 
+    private String isTheParentNode;
+
     /**
      * 部位编码
      */
@@ -65,4 +70,9 @@ public class JcZdClass {
      * 打印下面的提示
      */
     private String comment8;
+
+    /**
+     * 子级
+     */
+    private List<Map<String, String>> list;
 }

+ 18 - 25
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/JianYanJianChaShenQingServer.java

@@ -147,14 +147,28 @@ public class JianYanJianChaShenQingServer {
      */
     public ResultVo<List<JcZdClass>> getTemplate(Integer itemType, Integer templateType) {
         QueryWrapper<?> qw = new QueryWrapper<>();
-        qw.eq("req_type", itemType);
+        qw.eq("c.req_type", itemType);
         if (templateType == 2) {
-            qw.eq("op_id", TokenUtil.getTokenUserId());
+            qw.eq("c.op_id", TokenUtil.getTokenUserId());
         } else {
             UserInfo info = realtimeService.getUserInfoByToken();
-            qw.eq("tc_exec", info.getDeptCode());
+            qw.eq("c.tc_exec", info.getDeptCode());
         }
-        return ResultVoUtil.success(dao.getTemplate(qw));
+        List<JcZdClass> parentNode = dao.getTemplate(qw);
+        Map<String, JcZdClass> map = parentNode
+                .stream()
+                .collect(Collectors.toMap(JcZdClass::getCode, a -> a, (k1, k2) -> k1));
+        List<Map<String, String>> tempContent = dao.selectTemplateContent(qw);
+        tempContent.forEach(item -> {
+            JcZdClass jcZdClass = map.get(item.get("tc_no"));
+            if (jcZdClass != null) {
+                if (jcZdClass.getList() == null) {
+                    jcZdClass.setList(new ArrayList<>());
+                }
+                jcZdClass.getList().add(item);
+            }
+        });
+        return ResultVoUtil.success(parentNode);
     }
 
 
@@ -188,27 +202,6 @@ public class JianYanJianChaShenQingServer {
         return ResultVoUtil.success(page);
     }
 
-    /**
-     * 检验检查的分类详细信息
-     *
-     * @param code    编码
-     * @param bwCode  不是个人编码的话就需要这个
-     * @param jianCha true 检查 false 检验
-     * @return 返回详细的内容
-     */
-    public ResultVo<List<Map<String, String>>> chaKanFenLeiXiangQing(String code, String bwCode, Boolean jianCha) {
-        if (jianCha) {
-            if (StringUtil.notBlank(bwCode) && bwCode.equals("mb")) {
-                return ResultVoUtil.success(dao.chaKanMuBanNeiRong(code, "3"));
-            }
-            return ResultVoUtil.success(dao.chaKanFenLeiXiangQing(code, bwCode));
-        }
-        if (StringUtil.notBlank(bwCode) && bwCode.equals("mb")) {
-            return ResultVoUtil.success(dao.chaKanMuBanNeiRong(code, "2"));
-        }
-        return ResultVoUtil.success(dao.chaKanJianYanXiangQing(code));
-    }
-
     /**
      * 删除检查或检验模板
      *