소스 검색

检查检验说明模板

xiaochan 1 년 전
부모
커밋
53b5c7aaf7

+ 0 - 8
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/JianYanJianChaController.java

@@ -48,14 +48,6 @@ public class JianYanJianChaController {
     public ResultVo<Map<String, Object>> huoQuShengQingXiangQing(@RequestParam("reqNo") Integer reqNo) {
         return server.huoQuShengQingXiangQing(reqNo);
     }
-
-
-    @GetMapping("/getCheckNewApplication")
-    public ResultVo<List<JcZdClass>> getCheckNewApplication() {
-        return server.getCheckNewApplication();
-    }
-
-
     @GetMapping("/getTemplateGrouping")
     public ResultVo<List<JcZdClass>> getTemplateGrouping(@RequestParam("itemType") Integer itemType,
                                                          @RequestParam("templateType") Integer templateType) {

+ 17 - 29
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/JianYanJianChaDao.java

@@ -123,28 +123,6 @@ public interface JianYanJianChaDao {
             "where code = #{code}")
     JcZdClass daYingXiangQing(@Param("code") String code);
 
-
-    @Select("SELECT code   = rtrim(a.code), " +
-            "       name   = isnull(d.name + '(' + rtrim(a.name) + ')', " +
-            "                       rtrim(a.name)), " +
-            "       bw_code= isnull(d.code, " +
-            "                       0) " +
-            "FROM jc_zd_class a with (NOLOCK), " +
-            "     yz_order_item b with (NOLOCK), " +
-            "     jc_zd_item c with (NOLOCK), " +
-            "     ysh_zd_part_code d with (NOLOCK) " +
-            "where a.code = b.order_type " +
-            "          and isnull(b.del_flag, '') <> '1' " +
-            "          and c.bw_code *= d.code " +
-            "          and a.code = c.class " +
-            "group by a.name, " +
-            "         d.code, " +
-            "         d.name, " +
-            "         a.code " +
-            "order by a.code")
-    List<JcZdClass> getCheckNewApplication();
-
-
     @Select("select tc_name as name," +
             "       rtrim(tc_no) as code," +
             "       '1' as isTheParentNode " +
@@ -214,7 +192,14 @@ public interface JianYanJianChaDao {
             "                                                       where yj.zy_order_code = a.order_code) " +
             "                           else (select rtrim(class) " +
             "                                 from jc_zd_item yj " +
-            "                                 where yj.zy_order_code = a.order_code) end as classes " +
+            "                                 where yj.zy_order_code = a.order_code) end as classes,\n" +
+            "                       case\n" +
+            "                           when req_type = '3' then (select note\n" +
+            "                                                     from jc_zd_item\n" +
+            "                                                     where jc_zd_item.zy_order_code = a.order_code)\n" +
+            "                           else (select note\n" +
+            "                                 from jy_zd_item\n" +
+            "                                 where jy_zd_item.zy_order_code = a.order_code) end note " +
             "FROM yz_order_item a with (NOLOCK), " +
             "     zy_tc_detail_yj b with (NOLOCK), " +
             "     zy_tc_yj c with (NOLOCK) " +
@@ -225,7 +210,7 @@ public interface JianYanJianChaDao {
             "  and c.tc_no = #{code} " +
             "  and c.req_type = #{type} " +
             "order by sort_no desc")
-    List<Map<String, String>> getTemplateByCodeAndType(String code, String type);
+    List<Map<String, String>> getTemplateByCodeAndType(@Param("code") String code, @Param("type") String type);
 
     @Select("<script>" +
             "SELECT jc_text,name,code,wh_flag,op_id " +
@@ -489,7 +474,8 @@ public interface JianYanJianChaDao {
             "    exec_unit_name   = (select name from zd_unit_code where zd_unit_code.code = exec_unit),  " +
             "                       '2'                  as type,  " +
             "                       inspect_stuff        as inspectStuff,  " +
-            "    inspectStuffName = (select rtrim(name) from jy_zd_sample with (NOLOCK) where code = inspect_stuff)  " +
+            "    inspectStuffName = (select rtrim(name) from jy_zd_sample with (NOLOCK) where code = inspect_stuff)," +
+            "    note  " +
             "from jy_zd_item a  " +
             "         left join zy_tc_detail_yj b on (a.zy_order_code = b.order_code)  " +
             "where isnull(del_flag, '0') = '0'  " +
@@ -506,18 +492,19 @@ public interface JianYanJianChaDao {
             "       a.name, " +
             "       rtrim(class)  as classes, " +
             "       exec_unit," +
-            "       exec_unit_name = (select name from zd_unit_code where zd_unit_code.code = exec_unit)  " +
+            "       exec_unit_name = (select name from zd_unit_code where zd_unit_code.code = exec_unit)," +
+            "       note  " +
             "from jc_zd_item a " +
             "         left join ysh_zd_part_code b on (a.bw_code = b.code) " +
             "where isnull(a.del_flag, '0') = '0' " +
             "  and isnull(zy_flag, '0') = '0' " +
-            "order by class;")
+            "order by class")
     List<JyJcItem> selectJcDetailItems();
 
     @Select("select               zy_order_code as code, " +
             "                     name, " +
             "                     exec_unit, " +
-            "    exec_unit_name = (select name from zd_unit_code where zd_unit_code.code = exec_unit) " +
+            "    exec_unit_name = (select name from zd_unit_code where zd_unit_code.code = exec_unit),note " +
             "from jc_zd_item " +
             "where isnull(del_flag,'0') = '0' " +
             "  and isnull(zy_flag,'0') = '0' " +
@@ -531,7 +518,8 @@ public interface JianYanJianChaDao {
             "    exec_unit_name   = (select name from zd_unit_code where zd_unit_code.code = exec_unit), " +
             "                       '2'                  as type, " +
             "                       inspect_stuff        as inspectStuff, " +
-            "    inspectStuffName = (select rtrim(name) from jy_zd_sample with (NOLOCK) where code = inspect_stuff) " +
+            "    inspectStuffName = (select rtrim(name) from jy_zd_sample with (NOLOCK) where code = inspect_stuff), " +
+            "    note " +
             "from jy_zd_item a left join  " +
             "     zy_tc_detail_yj b on (a.zy_order_code = b.order_code) " +
             "where isnull(del_flag, '0') = '0' " +

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/jianyanjiancha/JyJcItem.java

@@ -46,6 +46,8 @@ public class JyJcItem {
     private String inspectStuff;
     private String inspectStuffName;
 
+    private String note;
+
     /**
      * 子节点
      */

+ 11 - 15
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/JianYanJianChaShenQingService.java

@@ -160,16 +160,6 @@ public class JianYanJianChaShenQingService {
         return ResultVoUtil.success(map);
     }
 
-
-    /**
-     * 获取检查
-     *
-     * @return
-     */
-    public ResultVo<List<JcZdClass>> getCheckNewApplication() {
-        return ResultVoUtil.success(dao.getCheckNewApplication());
-    }
-
     public ResultVo<List<JcZdClass>> getTemplateGrouping(Integer itemType, Integer templateType) {
         QueryWrapper<?> qw = templateQueryWrapper(itemType, templateType);
         return ResultVoUtil.success(dao.getTemplate(qw));
@@ -616,6 +606,12 @@ public class JianYanJianChaShenQingService {
     @DS("his")
     public ResultVo<Map<String, List<JyJcItem>>> getJyJcZdTree() {
         Map<String, List<JyJcItem>> map = new HashMap<>(Capacity.TWO);
+        map.put("jy", getJyTree());
+        map.put("jc", getJcTree());
+        return ResultVoUtil.success(map);
+    }
+
+    private List<JyJcItem> getJyTree() {
         // 把 检验 项目大类做map的key
         Map<String, JyJcItem> jyMap = dao.queryInspectionClassification().stream().collect(
                 Collectors.toMap(JyJcItem::getCode, a -> a, (k1, k2) -> k1)
@@ -623,11 +619,13 @@ public class JianYanJianChaShenQingService {
         // 获取检验的详细项目
         List<JyJcItem> jyDetailedItems = dao.getJyDetailedItems();
         grouping(jyMap, jyDetailedItems);
-        // 把 检查 项目大类做map的key
+        return new ArrayList<>(jyMap.values());
+    }
+
+    private List<JyJcItem> getJcTree() {
         Map<String, JyJcItem> jcMap = dao.queryCheckClassification().stream().collect(
                 Collectors.toMap(JyJcItem::getCode, a -> a, (k1, k2) -> k1)
         );
-        // 获取检查的详细项目
         List<JyJcItem> jcDetailedItems = dao.selectJcDetailItems();
         grouping(jcMap, jcDetailedItems);
         // 检查项目还需要根据部位细分
@@ -658,9 +656,7 @@ public class JianYanJianChaShenQingService {
             }
         }
 
-        map.put("jy", new ArrayList<>(jyMap.values()));
-        map.put("jc", jcTree);
-        return ResultVoUtil.success(map);
+        return jcTree;
     }
 
     private void grouping(Map<String, JyJcItem> jyMap, List<JyJcItem> jyDetailedItems) {