From cebb05f8d1ddbf5ac415c5471e17d2d94ea1a6de Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期三, 15 五月 2024 18:14:07 +0800
Subject: [PATCH] zjh 2024/05/15-1

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSurveyTemplateController.java |   65 ++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSurveyTemplateController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSurveyTemplateController.java
index 36f2de7..8e22ec7 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSurveyTemplateController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSurveyTemplateController.java
@@ -8,11 +8,14 @@
 
 import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ltkj.common.core.domain.TreeSelect;
+import com.ltkj.common.core.domain.entity.SysDept;
 import com.ltkj.hosp.domain.TjSurveyOptions;
 import com.ltkj.hosp.domain.TjSurveyQuestion;
 import com.ltkj.hosp.domain.TjSurveyTempQues;
 import com.ltkj.hosp.service.ITjSurveyQuestionService;
 import com.ltkj.system.service.ISysConfigService;
+import com.ltkj.system.service.ISysDeptService;
 import com.ltkj.tduck.domain.UserFormEntity;
 import com.ltkj.tduck.enums.FormSourceTypeEnum;
 import com.ltkj.tduck.enums.FormStatusEnum;
@@ -53,6 +56,8 @@
     @Autowired
     private UserFormService formService;
 
+    @Autowired
+    private ISysDeptService deptService;
 
     /**
      * 鍒ゆ柇鏄惁寮�鍚~楦〃鍗曡璁�
@@ -155,6 +160,21 @@
 
         }
         return AjaxResult.success("鏆傛棤淇℃伅");
+
+
+//        List<TjSurveyQuestion> l11=new ArrayList<>();
+//        TjSurveyTemplate byId1 = tjSurveyTemplateService.selectTjSurveyTemplateByMid(mid);
+//        List<TjSurveyTempQues> tjSurveyTempQuesList = byId1.getTjSurveyTempQuesList();
+//        if (tjSurveyTempQuesList!=null){
+//            for (TjSurveyTempQues tjSurveyTempQues : tjSurveyTempQuesList) {
+//                TjSurveyQuestion byId11 = tjSurveyQuestionService.selectTjSurveyQuestionByQid(tjSurveyTempQues.getQid());
+//                if (byId11!=null){
+//                    l11.add(byId11);
+//                }
+//            }
+//            return AjaxResult.success(l11);
+//        }
+//        return AjaxResult.success("鏆傛棤淇℃伅");
     }
 
 
@@ -194,6 +214,51 @@
         return AjaxResult.success(false);
     }
 
+    @GetMapping("/getQuestionsByMid")
+    public Map<String, Object> getQuestionsByMid(@RequestParam("mid") Long mid,
+                                                 @RequestParam(required = false) String question,
+                                                 @RequestParam("pageNum") int pageNum,
+                                                 @RequestParam("pageSize") int pageSize) {
+        Map<String, Object> res = new HashMap<>();
+//        List<TjSurveyQuestion> list = tjSurveyTemplateService.getQuestionsByMid(mid);
+        LambdaQueryWrapper<TjSurveyQuestion> wq1=new LambdaQueryWrapper<>();
+        wq1.eq(TjSurveyQuestion::getMid,mid);
+        if(null !=question && !question.equals("")){
+            wq1.like(TjSurveyQuestion::getQuestion,question);
+        }
+        final List<TjSurveyQuestion> list = tjSurveyQuestionService.list(wq1);
+
+        int start = 0, end = 0;
+        start = (pageNum - 1) * pageSize;
+        end = start + pageSize;
+        end = Math.min(list.size(), end);
+        List<TjSurveyQuestion> result = new ArrayList<>();
+        for (int i = start; i < end; i++) {
+            result.add(list.get(i));
+        }
+        final TjSurveyTemplate byId = tjSurveyTemplateService.selectTemplateByMid1(mid);
+        for (TjSurveyQuestion tjSurveyQuestion : result) {
+            tjSurveyQuestion.setTemplate(byId);
+            final List<TjSurveyOptions> tjSurveyOptions = tjSurveyQuestionService.selectOptionsByQid(tjSurveyQuestion.getQid());
+            tjSurveyQuestion.setTjSurveyOptionsList(tjSurveyOptions);
+        }
+        res.put("data", result);
+//        res.put("temp", tjSurveyTemplateService.selectTjSurveyTemplateByMid(mid));
+        res.put("total", list.size());
+        return res;
+    }
+
+
+    /**
+     * 鏌ヨ闂嵎妯℃澘鍒楄〃
+     */
+    @GetMapping("/listByDeptId")
+    public AjaxResult listByDeptId(SysDept dept) {
+        List<TreeSelect> treeSelects =deptService.selectDeptList1(dept);
+        return AjaxResult.success(treeSelects);
+    }
+
+
     /**
      * 淇敼闂嵎妯℃澘
      */

--
Gitblit v1.8.0