From 1ecb6109954d22e9be03518d64cdcfd89b599091 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 02 六月 2026 18:20:11 +0800
Subject: [PATCH] 1.处理修改service_task时,子任务删除,未将出院数据还原的问题; 2.新增省立同德满意度接口 3.处理患者基本信息并发新增的问题

---
 smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java             |  309 +++++++++++++++++
 smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java |   84 ++++
 smartor/src/main/java/com/smartor/domain/VO/DetailTraceDealVO.java                         |   11 
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailTrace.java                    |   12 
 smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionReqVO.java                      |    6 
 ruoyi-common/src/main/java/com/ruoyi/common/enums/SendStateEnum.java                       |   52 ++
 smartor/src/main/java/com/smartor/domain/IvrLibaScript.java                                |    6 
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml                  |   12 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java       |   51 +-
 smartor/src/main/java/com/smartor/domain/SvyLibScript.java                                 |    5 
 smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java                     |   10 
 smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java                |   25 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml              |   30 +
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java          |   19 
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java              |   68 ++-
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml                  |   34 +
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml                   |   35 +
 smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml                           |    6 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java  |   24 +
 smartor/src/main/java/com/smartor/domain/IvrLibaScriptVO.java                              |    5 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java      |   58 +-
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java                       |   13 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml                   |   18 +
 smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java                        |   20 +
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java        |    4 
 smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java                      |   11 
 smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java                        |   13 
 smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateScriptMapper.java                  |    2 
 smartor/src/main/java/com/smartor/mapper/SvyLibTemplateScriptMapper.java                   |    3 
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskExport.java                         |    9 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java                        |   12 
 smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java                         |   12 
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java                      |   11 
 smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java                       |   18 +
 smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml                          |    6 
 smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java                      |   13 
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java                         |   10 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java   |    5 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskdiagController.java  |   14 
 smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml                  |   12 
 ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java               |    2 
 41 files changed, 953 insertions(+), 117 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java
index 467b46c..acac05a 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java
@@ -167,15 +167,37 @@
         PatSatisfactionResVO statistics = patSatisfactionService.statistics(patSatisfactionReqVO);
         return getDataTable3(CollectionUtils.isNotEmpty(statistics.getPatSatisfactionDetailEntities()) ? statistics.getPatSatisfactionDetailEntities().size() : 0, statistics);
     }
+
+    /**
+    /**
+     * 鎮h�呮弧鎰忓害缁熻锛堢淮搴︼級
+     */
+    @ApiOperation("鎮h�呮弧鎰忓害缁熻锛堢淮搴︼級")
+    @PostMapping("/statisticsByDimension")
+    public Map<String, Object> statisticsByDimension(@RequestBody PatSatisfactionReqVO patSatisfactionReqVO) {
+        //鍚庣涓嶅仛鍒嗛〉浜嗭紝鐢卞墠绔仛
+        PatSatisfactionResVO statistics = patSatisfactionService.statisticsByDimension(patSatisfactionReqVO);
+        return getDataTable3(CollectionUtils.isNotEmpty(statistics.getPatSatisfactionDetailEntities()) ? statistics.getPatSatisfactionDetailEntities().size() : 0, statistics);
+    }
     /**
      * 鎮h�呮弧鎰忓害鏌辩姸鍥句俊鎭�
      */
-    @ApiOperation("鎮h�呮弧鎰忓害鏌辩姸鍥句俊鎭�")
+    @ApiOperation("鎮h�呮弧鎰忓害鏌辩姸鍥句俊鎭紙鍒嗙被)")
     @PostMapping("/satisfactionGraph")
     public Map<String, Object> satisfactionGraph(@RequestBody PatSatisfactionReqVO patSatisfactionReqVO) {
         Map<String, Object> patSatisfactionGraphResVOS = patSatisfactionService.satisfactionGraph(patSatisfactionReqVO);
         return getDataTable3(0, patSatisfactionGraphResVOS);
     }
 
+    /**
+     * 鎮h�呮弧鎰忓害鏌辩姸鍥句俊鎭�
+     */
+    @ApiOperation("鎮h�呮弧鎰忓害鏌辩姸鍥句俊鎭�(缁村害)")
+    @PostMapping("/satisfactionGraphDimension")
+    public Map<String, Object> satisfactionGraphDimension(@RequestBody PatSatisfactionReqVO patSatisfactionReqVO) {
+        Map<String, Object> patSatisfactionGraphResVOS = patSatisfactionService.satisfactionGraphDimension(patSatisfactionReqVO);
+        return getDataTable3(0, patSatisfactionGraphResVOS);
+    }
+
 
 }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
index a0e194c..9382fd6 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -13,6 +13,7 @@
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.enums.PreachFormEnum;
+import com.ruoyi.common.enums.SendStateEnum;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DtoConversionUtils;
@@ -230,6 +231,10 @@
             for (ServiceSubtaskExport serviceSubtaskExport : serviceSubtaskExports) {
                 String pf = PreachFormEnum.getDescByCode(serviceSubtaskExport.getPreachform());
                 serviceSubtaskExport.setPreachform(pf);
+                if(serviceSubtaskExport.getSendstate() != null) {
+                    String stName = SendStateEnum.getDescByCode("" + serviceSubtaskExport.getSendstate());
+                    serviceSubtaskExport.setStName(stName);
+                }
 
                 //璁$畻鍑洪櫌澶╂暟
                 if (!Objects.isNull(serviceSubtaskExport.getEndtime())) {
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
index 801edca..a2fca4a 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
@@ -71,38 +71,38 @@
 //        List<ServiceTask> list = serviceTaskService.selectServiceTaskList(serviceTask);
         List<ServiceTask> list = serviceTaskService.selectServiceTaskAndtaskDeptList(serviceTask);
         List<ServiceTaskVO> serviceTaskVOS = DtoConversionUtils.sourceToTarget(list, ServiceTaskVO.class);
-
-        List<Long> taskIds = list.stream().map(ServiceTask::getTaskid).collect(Collectors.toList());
-
-        ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity();
-        serviceSubtaskEntity.setTaskIds(taskIds);
-        serviceSubtaskEntity.setStartOutHospTime(serviceTask.getStartOutHospTime());
-        serviceSubtaskEntity.setEndOutHospTime(serviceTask.getEndOutHospTime());
-        // 鎵归噺鏌ヨ鎵�鏈夊瓙浠诲姟
-        Map<String, List<ServiceSubtask>> subtaskMap = iServiceSubtaskService
-                .selectServiceSubtaskList(serviceSubtaskEntity)
-                .stream()
-                .filter(subtask -> subtask.getTaskid() != null)  // 娣诲姞杩囨护
-                .collect(Collectors.groupingBy(subtask -> Optional.of(subtask.getTaskid().toString()).orElse("Unknown")));
+//
+//        List<Long> taskIds = list.stream().map(ServiceTask::getTaskid).collect(Collectors.toList());
+//
+//        ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity();
+//        serviceSubtaskEntity.setTaskIds(taskIds);
+//        serviceSubtaskEntity.setStartOutHospTime(serviceTask.getStartOutHospTime());
+//        serviceSubtaskEntity.setEndOutHospTime(serviceTask.getEndOutHospTime());
+//        // 鎵归噺鏌ヨ鎵�鏈夊瓙浠诲姟
+//        Map<String, List<ServiceSubtask>> subtaskMap = iServiceSubtaskService
+//                .selectServiceSubtaskList(serviceSubtaskEntity)
+//                .stream()
+//                .filter(subtask -> subtask.getTaskid() != null)  // 娣诲姞杩囨护
+//                .collect(Collectors.groupingBy(subtask -> Optional.of(subtask.getTaskid().toString()).orElse("Unknown")));
 
 
         if (CollectionUtils.isNotEmpty(serviceTaskVOS)) {
-            for (ServiceTaskVO taskVO : serviceTaskVOS) {
-                List<ServiceSubtask> subtasks = subtaskMap.getOrDefault(taskVO.getTaskid().toString(), Collections.emptyList());
-
-                if (CollectionUtils.isNotEmpty(subtasks)) {
-                    //宸插彂閫侊紙瀛愪换鍔′腑鐨� sendstate=1涓鸿棰嗗彇锛�
-                    long yfs = subtasks.stream().filter(s -> s.getSendstate() != null &&
-                            (s.getSendstate() >= 3L || s.getSendstate() == 1L)).count();
-                    //鏈彂閫�
-                    long wfs = subtasks.stream().filter(s -> s.getSendstate() != null &&
-                            s.getSendstate() == 2L).count();
-                    taskVO.setYfs(yfs);
-                    taskVO.setWfs(wfs);
-
-                }
-
-            }
+//            for (ServiceTaskVO taskVO : serviceTaskVOS) {
+//                List<ServiceSubtask> subtasks = subtaskMap.getOrDefault(taskVO.getTaskid().toString(), Collections.emptyList());
+//
+//                if (CollectionUtils.isNotEmpty(subtasks)) {
+//                    //宸插彂閫侊紙瀛愪换鍔′腑鐨� sendstate=1涓鸿棰嗗彇锛�
+//                    long yfs = subtasks.stream().filter(s -> s.getSendstate() != null &&
+//                            (s.getSendstate() >= 3L || s.getSendstate() == 1L)).count();
+//                    //鏈彂閫�
+//                    long wfs = subtasks.stream().filter(s -> s.getSendstate() != null &&
+//                            s.getSendstate() == 2L).count();
+//                    taskVO.setYfs(yfs);
+//                    taskVO.setWfs(wfs);
+//
+//                }
+//
+//            }
             //鑾峰彇total
             long total = PageUtils.count(new ISelect() {
                 @Override
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskdiagController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskdiagController.java
index 2d65c2b..9a58888 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskdiagController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskdiagController.java
@@ -1,6 +1,7 @@
 package com.ruoyi.web.controller.smartor;
 
 import java.util.List;
+import java.util.Map;
 
 import com.ruoyi.common.annotation.AddOrgId;
 import io.swagger.annotations.Api;
@@ -8,6 +9,7 @@
 
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -54,6 +56,18 @@
     }
 
     /**
+     * 鏌ヨ妯℃澘绉戝鍏宠仈鍒楄〃涓嶅垎椤�
+     */
+    @ApiOperation("鏌ヨ妯℃澘绉戝鍏宠仈鍒楄〃涓嶅垎椤�")
+    //@PreAuthorize("@ss.hasPermi('smartor:taskdiag:list')")
+    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
+    @PostMapping("listnopage")
+    public Map<String, Object> listnopage(@RequestBody ServiceTaskdiag serviceTaskdiag) {
+        List<ServiceTaskdiag> list = serviceTaskdiagService.selectServiceTaskdiagList(serviceTaskdiag);
+        return getDataTable3(CollectionUtils.isEmpty(list) ? 0 : list.size(), list);
+    }
+
+    /**
      * 瀵煎嚭妯℃澘绉戝鍏宠仈鍒楄〃
      */
     @ApiOperation("瀵煎嚭妯℃澘绉戝鍏宠仈鍒楄〃")
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
index 1b42597..6935191 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
@@ -1,7 +1,10 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.annotation.AddOrgId;
@@ -34,8 +37,7 @@
  */
 @RestController
 @RequestMapping("/system/dict/data")
-public class SysDictDataController extends BaseController
-{
+public class SysDictDataController extends BaseController {
     @Autowired
     private ISysDictDataService dictDataService;
 
@@ -44,8 +46,7 @@
 
     //@PreAuthorize("@ss.hasPermi('system:dict:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysDictData dictData)
-    {
+    public TableDataInfo list(SysDictData dictData) {
         startPage();
         List<SysDictData> list = dictDataService.selectDictDataList(dictData);
         return getDataTable(list);
@@ -54,8 +55,7 @@
     @Log(title = "瀛楀吀鏁版嵁", businessType = BusinessType.EXPORT)
     //@PreAuthorize("@ss.hasPermi('system:dict:export')")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, SysDictData dictData)
-    {
+    public void export(HttpServletResponse response, SysDictData dictData) {
         List<SysDictData> list = dictDataService.selectDictDataList(dictData);
         ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
         util.exportExcel(response, list, "瀛楀吀鏁版嵁");
@@ -66,8 +66,7 @@
      */
     //@PreAuthorize("@ss.hasPermi('system:dict:query')")
     @GetMapping(value = "/{dictCode}")
-    public AjaxResult getInfo(@PathVariable Long dictCode)
-    {
+    public AjaxResult getInfo(@PathVariable Long dictCode) {
         return success(dictDataService.selectDictDataById(dictCode));
     }
 
@@ -75,14 +74,33 @@
      * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁淇℃伅
      */
     @GetMapping(value = "/type/{dictType}")
-    public AjaxResult dictType(@PathVariable String dictType)
-    {
+    public AjaxResult dictType(@PathVariable String dictType) {
         List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
-        if (StringUtils.isNull(data))
-        {
+        if (StringUtils.isNull(data)) {
             data = new ArrayList<SysDictData>();
         }
         return success(data);
+    }
+
+    /**
+     * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁淇℃伅(澶栭摼)
+     */
+    @GetMapping(value = "/typeout/{dictType}")
+    public AjaxResult dictTypeOut(@PathVariable String dictType) {
+        if (dictType == null) return error();
+        List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
+        if (StringUtils.isNull(data) || data.isEmpty()) {
+            return error("瀛楀吀鏁版嵁涓嶅瓨鍦�");
+        }
+
+        List<Map<String, Object>> list = data.stream().map(item -> {
+            Map<String, Object> map = new HashMap<>();
+            map.put("dictLabel", item.getDictLabel());
+            map.put("dictValue", item.getDictValue());
+            map.put("listClass", item.getListClass());
+            return map;
+        }).collect(Collectors.toList());
+        return success(list);
     }
 
     /**
@@ -92,8 +110,7 @@
     @Log(title = "瀛楀吀鏁版嵁", businessType = BusinessType.INSERT)
     @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
     @PostMapping("/add")
-    public AjaxResult add(@Validated @RequestBody SysDictData dict)
-    {
+    public AjaxResult add(@Validated @RequestBody SysDictData dict) {
         dict.setCreateBy(getUsername());
         return toAjax(dictDataService.insertDictData(dict));
     }
@@ -105,8 +122,7 @@
     @Log(title = "瀛楀吀鏁版嵁", businessType = BusinessType.UPDATE)
     @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
     @PostMapping("/edit")
-    public AjaxResult edit(@Validated @RequestBody SysDictData dict)
-    {
+    public AjaxResult edit(@Validated @RequestBody SysDictData dict) {
         dict.setUpdateBy(getUsername());
         return toAjax(dictDataService.updateDictData(dict));
     }
@@ -117,8 +133,7 @@
     //@PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.DELETE)
     @GetMapping("/remove/{dictCodes}")
-    public AjaxResult remove(@PathVariable Long[] dictCodes)
-    {
+    public AjaxResult remove(@PathVariable Long[] dictCodes) {
         dictDataService.deleteDictDataByIds(dictCodes);
         return success();
     }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
index 7ced3c4..956cdad 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -19,6 +19,7 @@
 import com.ruoyi.system.mapper.SysUserDeptMapper;
 import com.smartor.service.IServiceSLTDHealthcareRecordService;
 import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
@@ -28,6 +29,7 @@
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -91,8 +93,18 @@
 //    @PostMapping("/test")
 //    public void test(@RequestBody Map<String, Object> map) {
 //        WxMpUtils wxMpUtils = new WxMpUtils(wxAppid, wxAppSecret);
-//        boolean b = wxMpUtils.sendTextMessage("bA_nlW7yM6CCfQMUX5HpBg", "浣犲ソ");
-//        System.out.println("b鐨勫�间负锛�" + b);
+//
+//        Map<String, WxMpTemplateData> dataMap = new HashMap();
+//
+//        dataMap.put("thing2", new WxMpTemplateData("thing2", "搴峰鎶ュ憡閫氱煡", "#FFB6C1"));
+//        dataMap.put("thing4", new WxMpTemplateData("thing4", "xx甯倄x鍘縳x璺痻x鍙�", "#173177"));
+//        dataMap.put("time7", new WxMpTemplateData("time7", "2023-05-15 00:00:00", "#B95EA6"));
+//        dataMap.put("thing8", new WxMpTemplateData("thing8", "寮犱笁", "#87cefa"));
+//
+//
+//        String s = wxMpUtils.sendTemplateMessage("oK3-Z59miSE_ebKdXP4IZuXilEvE", "TDF0WB3hndi1gtQybzcHCXeZWm_Q7HjtjVLNG4MOX8Q", "", dataMap);
+//
+//        System.out.println("s鐨勫�间负锛�" + s);
 //    }
 
     /**
@@ -136,7 +148,8 @@
     private RedirectView buildRedirect(String url) {
         RedirectView redirectView = new RedirectView();
         redirectView.setUrl(url);
-        redirectView.setStatusCode(HttpStatus.MOVED_PERMANENTLY);
+        redirectView.setStatusCode(HttpStatus.FOUND); // 302 涓存椂閲嶅畾鍚�,閬垮厤娴忚鍣ㄧ紦瀛�
+        redirectView.setExposeModelAttributes(false); // 閬垮厤妯″瀷灞炴�ф毚闇�
         return redirectView;
     }
 
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/SendStateEnum.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/SendStateEnum.java
new file mode 100644
index 0000000..455c54c
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/SendStateEnum.java
@@ -0,0 +1,52 @@
+package com.ruoyi.common.enums;
+
+/**
+ * 鍙戦�佺被鍨嬫灇涓�
+ */
+public enum SendStateEnum {
+    dlq("1", "寰呴鍙�"),
+    dfs("2", "寰呭彂閫�"),
+    yfs("3", "宸插彂閫�"),
+    bzx("4", "涓嶆墽琛�"),
+    fssb("5", "鍙戦�佸け璐�"),
+    wc("6", "瀹屾垚"),
+    cs("7", "瓒呮椂");
+
+
+
+    private String code;
+    private String desc;
+
+    SendStateEnum(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public static String getDescByCode(String code) {
+        SendStateEnum[] organEnums = values();
+        for (int i = 0; i < organEnums.length; i++) {
+            SendStateEnum organEnum = organEnums[i];
+            if (organEnum.getCode().equals(code)) {
+                return organEnum.getDesc();
+            }
+        }
+        return null;
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
index 9e4d4f0..a789b78 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -111,7 +111,7 @@
                 .antMatchers("/login","/test/**", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer", "/smartor/import/download", "/smartor/serviceSubtask/recordAccept", "/smartor/outPath/getInfoByParam", "/smartor/serviceExternal/addDeptInfo", "/smartor/serviceExternal/**", "/sso/**","/smartor/sltdHealthcareRecord/**","/smartor/servicetask/getScriptByCondition","/smartor/subtaskAnswer/saveMYDQuestionAnswer").permitAll()
                 // 闈欐�佽祫婧愶紝鍙尶鍚嶈闂�
 //                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/getDept/*","/SSOLogin/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
-                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/getDept/*","/SSOLogin/**").permitAll().antMatchers( "/druid/**").permitAll()
+                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/getDept/*","/SSOLogin/**","/system/dict/data/typeout/*").permitAll().antMatchers( "/druid/**").permitAll()
                 .antMatchers("/smartor/organization/list").permitAll()
                 // 闄や笂闈㈠鐨勬墍鏈夎姹傚叏閮ㄩ渶瑕侀壌鏉冭璇�
                 .anyRequest().authenticated().and().headers().frameOptions().disable();
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaScript.java b/smartor/src/main/java/com/smartor/domain/IvrLibaScript.java
index 4e0c997..b610024 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaScript.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaScript.java
@@ -29,6 +29,12 @@
     private Long id;
 
     /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
+    /**
      * 闂璇濇湳鏍囬
      */
     @ApiModelProperty("闂璇濇湳鏍囬")
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaScriptVO.java b/smartor/src/main/java/com/smartor/domain/IvrLibaScriptVO.java
index 7578319..bc2ae85 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaScriptVO.java
@@ -28,6 +28,11 @@
     @ApiModelProperty("闂璇濇湳id锛堜富閿級")
     private Long id;
 
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
 
     /**
      * 鍊肩被鍨嬶紙1 閫夐」  2 鏂囨湰  3 鏁板�硷級
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java
index f1e6a88..6b4b2e9 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java
@@ -2,6 +2,7 @@
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
@@ -29,6 +30,25 @@
     @ApiModelProperty(value = "涓婚敭")
     private Long id;
 
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害闆嗗悎")
+    private List<String> dimensionList;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
     /**
      * 妯℃澘璇濇湳缂栧彿
      */
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
index 7c0c505..2cc953e 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
@@ -28,6 +28,19 @@
     @ApiModelProperty(value = "涓婚敭")
     private Long id;
 
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
     /**
      * 妯℃澘璇濇湳缂栧彿
      */
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
index d23b725..eaa12ed 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -30,6 +30,18 @@
     private Long id;
 
     /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
+    /**
      * 浠诲姟id
      */
     @Excel(name = "浠诲姟id")
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
index bd70037..130b4d8 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -31,6 +31,17 @@
     private Long id;
 
     /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+    /**
      * 鍒嗘暟
      */
     @Excel(name = "鍒嗘暟")
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java
index d0b2a9b..215eaf4 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java
@@ -184,5 +184,15 @@
     @ApiModelProperty(value = "鎮h�匢D")
     private Long patid;
 
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
 
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailTrace.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailTrace.java
index 2bab8d4..8eb08ed 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailTrace.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailTrace.java
@@ -348,5 +348,17 @@
     @Excel(name = "绫诲埆ID")
     private Long categoryid;
 
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
 }
 
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java
index 4d9d56d..12a5674 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java
@@ -188,6 +188,19 @@
     @ApiModelProperty("闂ID")
     @Excel(name = "闂ID闆嗗悎")
     private List<Long> scriptIds;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
     /**
      * 鍑洪櫌鐥呭尯缂栧彿
      */
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskExport.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskExport.java
index c9bd59f..da568fa 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskExport.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskExport.java
@@ -37,11 +37,18 @@
     /**
      * 鍙戦�佺姸鎬�
      */
-    @Excel(name = " 浠诲姟鐘舵�� ")
+//    @Excel(name = " 浠诲姟鐘舵�� ")
     @ApiModelProperty(value = "鍙戦�佺姸鎬� 1 琚鍙�(鍦ㄤ换鍔′腑鏄柊寤猴紝鍦ㄦ湇鍔′腑鏄棰嗗彇)  2 寰呭彂閫�  3 宸插彂閫�  4 涓嶆墽琛�  5 鍙戦�佸け璐� 6 宸插畬鎴� 7 瓒呮椂(浜哄伐)")
     private Long sendstate;
 
     /**
+     * 鍙戦�佺姸鎬�
+     */
+    @Excel(name = " 浠诲姟鐘舵�� ")
+    @ApiModelProperty(value = "鍙戦�佺姸鎬� 1 琚鍙�(鍦ㄤ换鍔′腑鏄柊寤猴紝鍦ㄦ湇鍔′腑鏄棰嗗彇)  2 寰呭彂閫�  3 宸插彂閫�  4 涓嶆墽琛�  5 鍙戦�佸け璐� 6 宸插畬鎴� 7 瓒呮椂(浜哄伐)")
+    private String stName;
+
+    /**
      * 瀹屾垚鏃堕棿
      */
     @Excel(name = " 瀹屾垚鏃堕棿 ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibScript.java b/smartor/src/main/java/com/smartor/domain/SvyLibScript.java
index f2ed7a0..905649b 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibScript.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibScript.java
@@ -189,6 +189,11 @@
     /**
      * 闂埜棰樼洰鍒嗙被ID闆嗗悎
      */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
     @ApiModelProperty("鍒嗙被ID闆嗗悎")
     private String categoryids;
 
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
index da4eda0..f36a2e1 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
@@ -298,6 +298,18 @@
     @ApiModelProperty(value = "鎶ュ绉戝缂栫爜锛堝鏋滃涓瀹ょ敤閫楀彿鍒嗗壊锛�")
     private String reportDeptCode;
 
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
+    /**
+     * 闂缁村害
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
     @Excel(name = "鍒嗙被ID闆嗗悎")
     @ApiModelProperty(value = "鍒嗙被ID闆嗗悎")
     private List<Long> categoryids;
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java
index 2627598..e1448e7 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java
@@ -29,6 +29,24 @@
     @ApiModelProperty("鑷ID")
     private Long id;
 
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
+    /**
+     * 闂缁村害闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害闆嗗悎")
+    private List<String> dimensionList;
+
     @ApiModelProperty(value = "瀵瑰簲鐨刬vr_liba_target鐨勪富閿�")
     private Long targetid;
 
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
index 33ea456..9ebffa6 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
@@ -262,4 +262,17 @@
     @ApiModelProperty(value = "鎶ュ绉戝缂栫爜锛堝鏋滃涓瀹ょ敤閫楀彿鍒嗗壊锛�")
     private String reportDeptCode;
 
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+
 }
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
index 49154a2..bd10356 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -352,6 +352,17 @@
     private String reportDeptCode;
 
     /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
+    /**
      * 璇濇湳閫夐」
      */
     @ApiModelProperty(value = "璇濇湳閫夐」")
diff --git a/smartor/src/main/java/com/smartor/domain/VO/DetailTraceDealVO.java b/smartor/src/main/java/com/smartor/domain/VO/DetailTraceDealVO.java
index 62135c9..f1dda53 100644
--- a/smartor/src/main/java/com/smartor/domain/VO/DetailTraceDealVO.java
+++ b/smartor/src/main/java/com/smartor/domain/VO/DetailTraceDealVO.java
@@ -72,5 +72,16 @@
     @Excel(name = "闂鍒嗙被:锛堜緥濡�,闂ㄨ瘖婊℃剰搴︼細mzmyd     浣忛櫌婊℃剰搴︼細zymyd  ...锛�")
     private String type;
 
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("婊℃剰搴︽剰瑙佸紓甯革紙鍙拡瀵规枃鏈級")
+    private String isMydException;
+
+    /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害")
+    private String dimension;
 }
 
diff --git a/smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionReqVO.java b/smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionReqVO.java
index ddd6d05..5b8f0ef 100644
--- a/smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionReqVO.java
+++ b/smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionReqVO.java
@@ -73,6 +73,12 @@
 
 
     /**
+     * 闂埜棰樼洰鍒嗙被ID闆嗗悎
+     */
+    @ApiModelProperty("闂缁村害闆嗗悎")
+    private List<String> dimensionList;
+
+    /**
      * 鎮h�呮湇鍔$被鍨嬶細6銆佸嚭闄㈡弧鎰忓害璋冩煡    14浣忛櫌婊℃剰搴�   15闂ㄨ瘖婊℃剰搴�  16甯哥敤婊℃剰搴�
      */
     @ApiModelProperty(value = "鎮h�呮湇鍔$被鍨嬶細6銆佸嚭闄㈡弧鎰忓害璋冩煡    14浣忛櫌婊℃剰搴�   15闂ㄨ瘖婊℃剰搴�  16甯哥敤婊℃剰搴�    (榛樿鏌ュ叏閮�)")
diff --git a/smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateScriptMapper.java b/smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateScriptMapper.java
index b90c2dd..772d4c2 100644
--- a/smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateScriptMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateScriptMapper.java
@@ -33,6 +33,8 @@
      */
     public List<IvrLibaTemplateScript> selectIvrLibaTemplateScriptList(IvrLibaTemplateScript ivrLibaTemplateScript);
 
+    public List<IvrLibaTemplateScript> selectILTSBydimension(IvrLibaTemplateScript ivrLibaTemplateScript);
+
     /**
      * 鏂板妯$増闂璇濇湳搴�
      *
diff --git a/smartor/src/main/java/com/smartor/mapper/SvyLibTemplateScriptMapper.java b/smartor/src/main/java/com/smartor/mapper/SvyLibTemplateScriptMapper.java
index 332f248..301ab01 100644
--- a/smartor/src/main/java/com/smartor/mapper/SvyLibTemplateScriptMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/SvyLibTemplateScriptMapper.java
@@ -2,6 +2,7 @@
 
 import com.smartor.domain.IvrLibaTemplateScript;
 import com.smartor.domain.SvyLibTemplateScript;
+import com.smartor.domain.SvyLibTemplateScriptVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -31,6 +32,8 @@
      */
     public List<SvyLibTemplateScript> selectSvyLibTemplateScriptList(SvyLibTemplateScript svyLibTemplateScript);
 
+    public List<SvyLibTemplateScript> selectSLTScriptListBydimension(SvyLibTemplateScriptVO svyLibTemplateScriptVO);
+
     /**
      * 鏂板妯℃澘闂嵎棰樼洰
      *
diff --git a/smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java b/smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java
index 97a8c1a..413a9c6 100644
--- a/smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java
+++ b/smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java
@@ -71,6 +71,14 @@
      */
     public PatSatisfactionResVO statistics( PatSatisfactionReqVO patSatisfactionReqVO);
 
+    /**
+     * 鎮h�呮弧鎰忓害缁熻锛堢淮搴︼級
+     *
+     * @param patSatisfactionReqVO 鎮h�呮弧鎰忓害缁熻鏉′欢
+     * @return 鎮h�呮弧鎰忓害缁熻缁撴灉
+     */
+    public PatSatisfactionResVO statisticsByDimension( PatSatisfactionReqVO patSatisfactionReqVO);
+
 
     /**
      * 鎮h�呮弧鎰忓害鏌辩姸鍥句俊鎭�
@@ -79,4 +87,6 @@
      * @return 鎮h�呮弧鎰忓害鏌辩姸鍥句俊鎭�
      */
     public Map<String, Object> satisfactionGraph(PatSatisfactionReqVO patSatisfactionReqVO);
+
+    public Map<String, Object> satisfactionGraphDimension(PatSatisfactionReqVO patSatisfactionReqVO);
 }
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
index 0ec57d6..919fb64 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -1542,58 +1542,59 @@
                         int primaryGeneratedCount = deptGenCount + wardGenCount + diagGenCount;
                         log.info("銆愬熀浜庤鍒欍�戦瑕佽鍒欐墽琛岀粨鏋�: deptGen={}, wardGen={}, diagGen={}, total={}", deptGenCount, wardGenCount, diagGenCount, primaryGeneratedCount);
 
+                        String remark = patMedInhosp1.getRemark();
                         // 绗簩姝ワ細鍒ゆ柇棣栬瑙勫垯鏄惁鏈変换鎰忎竴涓敓鎴愭垚鍔�
                         if (primaryGeneratedCount > 0) {
                             // 鑷冲皯鏈変竴涓瑕佽鍒欑敓鎴愭垚鍔�
                             // 鈥斺�� 灏�=2鐨勬瑕佽鍒欏搴攆lag璁句负"2"锛堣烦杩囷級
                             log.info("銆愬熀浜庤鍒欍�戦瑕佽鍒欐湁鎴愬姛(count={})锛屽皢娆¤瑙勫垯瀵瑰簲flag璁句负2", primaryGeneratedCount);
                             if (deptIsSecondary) {
-                                updateCheckFlag(patMedInhosp1, 1, "2", "棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃");
+                                updateCheckFlag(patMedInhosp1, 1, "2", StringUtils.isNotEmpty(remark)?remark+";棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃":"棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃");
                             }
                             if (!active.equals("xh")) {
                                 if (wardIsSecondary) {
-                                    updateCheckFlag(patMedInhosp1, 2, "2", "棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃");
+                                    updateCheckFlag(patMedInhosp1, 2, "2", StringUtils.isNotEmpty(remark)?remark+";棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃":"棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃");
                                 }
                                 if (diagIsSecondary) {
-                                    updateCheckFlag(patMedInhosp1, 3, "2", "棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃");
+                                    updateCheckFlag(patMedInhosp1, 3, "2", StringUtils.isNotEmpty(remark)?remark+";棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃":"棣栬瑙勫垯宸茬敓鎴愶紝娆¤瑙勫垯璺宠繃");
                                 }
                             }
                             // 鈥斺�� 瀵逛簬=1涓旂敓鎴愭垚鍔熺殑锛屽皢鍏跺搴攆lag璁句负"1"
                             if (deptIsPrimary && deptGenCount > 0) {
-                                updateCheckFlag(patMedInhosp1, 1, "1", "绉戝棣栬瑙勫垯鐢熸垚鎴愬姛");
+                                updateCheckFlag(patMedInhosp1, 1, "1", StringUtils.isNotEmpty(remark)?remark+";绉戝棣栬瑙勫垯鐢熸垚鎴愬姛":"绉戝棣栬瑙勫垯鐢熸垚鎴愬姛");
                             }
                             if (!active.equals("xh")) {
                                 if (wardIsPrimary && wardGenCount > 0) {
-                                    updateCheckFlag(patMedInhosp1, 2, "1", "鐥呭尯棣栬瑙勫垯鐢熸垚鎴愬姛");
+                                    updateCheckFlag(patMedInhosp1, 2, "1", StringUtils.isNotEmpty(remark)?remark+";鐥呭尯棣栬瑙勫垯鐢熸垚鎴愬姛":"鐥呭尯棣栬瑙勫垯鐢熸垚鎴愬姛");
                                 }
                                 if (diagIsPrimary && diagGenCount > 0) {
-                                    updateCheckFlag(patMedInhosp1, 3, "1", "鐤剧梾棣栬瑙勫垯鐢熸垚鎴愬姛");
+                                    updateCheckFlag(patMedInhosp1, 3, "1", StringUtils.isNotEmpty(remark)?remark+";鐤剧梾棣栬瑙勫垯鐢熸垚鎴愬姛":"鐤剧梾棣栬瑙勫垯鐢熸垚鎴愬姛");
                                 }
                             }
                             // 鈥斺�� 瀵逛簬=1浣嗙敓鎴愬け璐ョ殑锛屽皢鍏跺搴攆lag璁句负"2"
                             if (deptIsPrimary && deptGenCount == 0) {
-                                updateCheckFlag(patMedInhosp1, 1, "2", "绉戝棣栬瑙勫垯鐢熸垚澶辫触");
+                                updateCheckFlag(patMedInhosp1, 1, "2", StringUtils.isNotEmpty(remark)?remark+";绉戝棣栬瑙勫垯鐢熸垚澶辫触":"绉戝棣栬瑙勫垯鐢熸垚澶辫触");
                             }
                             if (!active.equals("xh")) {
                                 if (wardIsPrimary && wardGenCount == 0) {
-                                    updateCheckFlag(patMedInhosp1, 2, "2", "鐥呭尯棣栬瑙勫垯鐢熸垚澶辫触");
+                                    updateCheckFlag(patMedInhosp1, 2, "2", StringUtils.isNotEmpty(remark)?remark+";鐥呭尯棣栬瑙勫垯鐢熸垚澶辫触":"鐥呭尯棣栬瑙勫垯鐢熸垚澶辫触");
                                 }
                                 if (diagIsPrimary && diagGenCount == 0) {
-                                    updateCheckFlag(patMedInhosp1, 3, "2", "鐤剧梾棣栬瑙勫垯鐢熸垚澶辫触");
+                                    updateCheckFlag(patMedInhosp1, 3, "2", StringUtils.isNotEmpty(remark)?remark+";鐤剧梾棣栬瑙勫垯鐢熸垚澶辫触":"鐤剧梾棣栬瑙勫垯鐢熸垚澶辫触");
                                 }
                             }
                         } else {
                             // 鎵�鏈夐瑕佽鍒欏叏閮ㄥけ璐ワ紝灏�=1鐨刦lag璁句负"2"锛岀劧鍚庢墽琛�=2鐨勬柟娉�
                             log.info("銆愬熀浜庤鍒欍�戦瑕佽鍒欏叏閮ㄥけ璐ワ紝灏�=1鐨刦lag璁句负2锛屽紑濮嬫墽琛屾瑕佽鍒�");
                             if (deptIsPrimary) {
-                                updateCheckFlag(patMedInhosp1, 1, "2", "绉戝棣栬瑙勫垯鍏ㄩ儴澶辫触");
+                                updateCheckFlag(patMedInhosp1, 1, "2", StringUtils.isNotEmpty(remark)?remark+";绉戝棣栬瑙勫垯鍏ㄩ儴澶辫触":"绉戝棣栬瑙勫垯鍏ㄩ儴澶辫触");
                             }
                             if (!active.equals("xh")) {
                                 if (wardIsPrimary) {
-                                    updateCheckFlag(patMedInhosp1, 2, "2", "鐥呭尯棣栬瑙勫垯鍏ㄩ儴澶辫触");
+                                    updateCheckFlag(patMedInhosp1, 2, "2", StringUtils.isNotEmpty(remark)?remark+";鐥呭尯棣栬瑙勫垯鍏ㄩ儴澶辫触":"鐥呭尯棣栬瑙勫垯鍏ㄩ儴澶辫触");
                                 }
                                 if (diagIsPrimary) {
-                                    updateCheckFlag(patMedInhosp1, 3, "2", "鐤剧梾棣栬瑙勫垯鍏ㄩ儴澶辫触");
+                                    updateCheckFlag(patMedInhosp1, 3, "2", StringUtils.isNotEmpty(remark)?remark+";鐤剧梾棣栬瑙勫垯鍏ㄩ儴澶辫触":"鐤剧梾棣栬瑙勫垯鍏ㄩ儴澶辫触");
                                 }
                             }
                             // 鎵ц娆¤瑙勫垯(=2)鐨勬柟娉�
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java
index 46c43db..f1802b9 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java
@@ -315,6 +315,182 @@
         return result;
     }
 
+    /**
+     * 鎮h�呮弧鎰忓害缁熻锛堢淮搴︼級
+     *
+     * @param patSatisfactionReqVO 鎮h�呮弧鎰忓害缁熻鏉′欢
+     * @return 鎮h�呮弧鎰忓害缁熻缁撴灉
+     */
+    @Override
+    public PatSatisfactionResVO statisticsByDimension(PatSatisfactionReqVO patSatisfactionReqVO) {
+        //瀹氫箟杩斿弬
+        PatSatisfactionResVO result = new PatSatisfactionResVO();
+        //绛旈鎬讳汉鏁�(宸茬粡鍥炵瓟闂鐨�)
+        int totalPerson = 0;
+        // 鎬讳汉鏁帮紙鍖呭惈鏈洖绛旂殑锛�
+        int allPerson = 0;
+        //鎮h�呮弧鎰忓害缁熻鎯�
+        List<PatSatisfactionDetailEntity> patSatisfactionDetailEntities = new ArrayList<>();
+        List<ServiceSubtask> serviceSubtasks = serviceSubtaskMapper.selectSatisfactionSubtaskList(patSatisfactionReqVO);
+        // 鎸塼ype鍒嗙粍锛�1-璇煶锛�2-闂嵎
+        Map<String, List<ServiceSubtask>> groupByType = serviceSubtasks.stream().filter(s -> s.getType() != null).collect(Collectors.groupingBy(ServiceSubtask::getType));
+        List<ServiceSubtask> voiceList = groupByType.getOrDefault("1", Collections.emptyList());
+        List<ServiceSubtask> questionnaireList = groupByType.getOrDefault("2", Collections.emptyList());
+
+        if (CollectionUtils.isNotEmpty(voiceList)) {
+            //1. 鍏堣幏鍙栧叆鍙備腑鐨勭淮鎶ら泦鍚�
+            IvrLibaTemplateScript iltscript = new IvrLibaTemplateScript();
+            iltscript.setDimensionList(patSatisfactionReqVO.getDimensionList());
+
+            //2 鍐嶈幏鍙栬闂婊℃剰搴﹀垎绫讳笅鐨処vrLibaTemplateScript鐨勯泦鍚�
+            List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.selectILTSBydimension(iltscript);
+            if (CollectionUtils.isNotEmpty(ivrLibaTemplateScripts)) {
+                //3 鍐嶉�氳繃鍗曚釜ivr_liba_template鑾峰彇鍒版墍鏈夌殑婊℃剰搴﹂棶棰� 鍜� 浣跨敤璇ユā鏉跨殑subTask浜烘暟
+                for (IvrLibaTemplateScript ivrLibaTemplateScript : ivrLibaTemplateScripts) {
+                    //璁板綍鍗曚釜鏄庣粏淇℃伅
+                    PatSatisfactionDetailEntity patSatisfactionDetailEntity = new PatSatisfactionDetailEntity();
+
+                    //閫氳繃闂ID锛岃幏鍙栭棶棰橀�夐」(涓轰簡鑾峰彇閫夐」涓婄殑鏈�楂樺垎鏈�浣庡垎)
+                    IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption();
+                    ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScript.getScriptid());
+                    List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptions = ivrLibaTemplateTargetoptionMapper.selectIvrLibaTemplateTargetoptionList(ivrLibaTemplateTargetoption);
+
+                    //鑾峰彇libTemplateId
+                    List<Long> libTemplateIds = new ArrayList<>();
+                    libTemplateIds.add(ivrLibaTemplateScript.getTemplateid());
+
+                    // 鍐嶉�氳繃妯℃澘id鑾峰彇闂鍙戦�佹�婚噺
+                    ServiceSubtaskSatisfactionEntity serviceSubtaskSatisfactionEntity = DtoConversionUtils.sourceToTarget(patSatisfactionReqVO, ServiceSubtaskSatisfactionEntity.class);
+                    serviceSubtaskSatisfactionEntity.setLibTemplateIds(libTemplateIds);
+                    serviceSubtaskSatisfactionEntity.setType(1);
+                    List<Long> subids = serviceSubtaskMapper.querySendCount(serviceSubtaskSatisfactionEntity);
+
+                    //鑾峰彇濉姤鏁伴噺
+                    List<ServiceSubtaskDetailDTO> fillCount = null;
+                    if (CollectionUtils.isNotEmpty(subids))
+                        fillCount = serviceSubtaskDetailMapper.queryFillCount(subids, ivrLibaTemplateScript.getScriptContent());
+
+                    // 鏍规嵁matchedtext鍒嗙粍锛岀粺璁″悇閫夐」鏁伴噺鍙婂崰姣�
+                    Map<String, Map<String, Object>> matchedtextStats = new HashMap<>();
+                    if (CollectionUtils.isNotEmpty(fillCount)) {
+                        int totalFill = fillCount.size();
+                        fillCount.stream().filter(dto -> dto.getMatchedtext() != null).collect(Collectors.groupingBy(ServiceSubtaskDetailDTO::getMatchedtext, Collectors.counting())).forEach((matchedtext, count) -> {
+                            Map<String, Object> stat = new HashMap<>();
+                            stat.put("count", count);
+                            stat.put("ratio", new BigDecimal((double) count / totalFill * 100).setScale(1, RoundingMode.HALF_UP).doubleValue());
+                            matchedtextStats.put(matchedtext, stat);
+                        });
+                        // 浠巉illCount涓彇targetvalue锛�&鍒嗛殧鐨勫綋鍓嶉棶棰樼殑鎵�鏈夐�夐」锛夛紝琛ュ叏鏈嚭鐜扮殑閫夐」锛宑ount鍜宺atio鍧囦负0
+                        fillCount.stream().filter(dto -> dto.getTargetvalue() != null).findFirst().ifPresent(dto -> {
+                            for (String option : dto.getTargetvalue().split("&")) {
+                                String optionTrim = option.trim();
+                                if (!matchedtextStats.containsKey(optionTrim)) {
+                                    Map<String, Object> emptyStat = new HashMap<>();
+                                    emptyStat.put("count", 0L);
+                                    emptyStat.put("ratio", 0.0);
+                                    matchedtextStats.put(optionTrim, emptyStat);
+                                }
+                            }
+                        });
+                    }
+
+                    patSatisfactionDetailEntity.setScriptContent(ivrLibaTemplateScript.getScriptContent());
+                    patSatisfactionDetailEntity.setAnswerPerson(CollectionUtils.isEmpty(fillCount) ? 0 : fillCount.size());
+                    patSatisfactionDetailEntity.setNoAnswerPerson(CollectionUtils.isNotEmpty(fillCount) && CollectionUtils.isNotEmpty(subids) ? (subids.size() - fillCount.size()) : CollectionUtils.isNotEmpty(subids) ? subids.size() : 0);
+                    patSatisfactionDetailEntity.setAverageScore(averageScore(fillCount));
+                    patSatisfactionDetailEntity.setMaxScore(maxScore(ivrLibaTemplateTargetoptions));
+                    patSatisfactionDetailEntity.setMinScore(minScore(ivrLibaTemplateTargetoptions));
+                    patSatisfactionDetailEntity.setAnswerRate(CollectionUtils.isEmpty(subids) ? 0 : CollectionUtils.isEmpty(fillCount) ? 0 : fillCount.size() * 1.0 / subids.size());
+                    patSatisfactionDetailEntity.setMatchedtextStats(matchedtextStats);
+                    patSatisfactionDetailEntities.add(patSatisfactionDetailEntity);
+
+                    totalPerson += CollectionUtils.isEmpty(fillCount) ? 0 : fillCount.size();
+                    allPerson += subids.size();
+                }
+            }
+        }
+
+        if (CollectionUtils.isNotEmpty(questionnaireList)) {
+            //1. 鍏堣幏鍙栧叆鍙備腑鐨勬弧鎰忓害缁村害
+            SvyLibTemplateScriptVO svyLibTemplateScriptVO = new SvyLibTemplateScriptVO();
+            svyLibTemplateScriptVO.setDimensionList(patSatisfactionReqVO.getDimensionList());
+            //2 鍐嶈幏鍙栬闂婊℃剰搴﹀垎绫讳笅鐨処vrLibaTemplateScript鐨勯泦鍚�
+            List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSLTScriptListBydimension(svyLibTemplateScriptVO);
+            if (CollectionUtils.isNotEmpty(svyLibTemplateScripts)) {
+                for (SvyLibTemplateScript svyLibTemplateScript : svyLibTemplateScripts) {
+                    //璁板綍鍗曚釜鏄庣粏淇℃伅
+                    PatSatisfactionDetailEntity patSatisfactionDetailEntity = new PatSatisfactionDetailEntity();
+
+                    //閫氳繃闂ID锛岃幏鍙栭棶棰橀�夐」(涓轰簡鑾峰彇閫夐」涓婄殑鏈�楂樺垎鏈�浣庡垎)
+                    SvyLibTemplateTargetoption svyLibTemplateTargetoption = new SvyLibTemplateTargetoption();
+                    svyLibTemplateTargetoption.setScriptid(svyLibTemplateScript.getId());
+                    List<SvyLibTemplateTargetoption> svyLibTemplateTargetoptions = svyLibTemplateTargetoptionMapper.selectSvyLibTemplateTargetoptionList(svyLibTemplateTargetoption);
+
+                    //鑾峰彇libTemplateId
+                    List<Long> libTemplateIds = new ArrayList<>();
+                    libTemplateIds.add(svyLibTemplateScript.getSvyid());
+
+                    // 鍐嶉�氳繃妯℃澘id鑾峰彇闂鍙戦�佹�婚噺
+                    ServiceSubtaskSatisfactionEntity serviceSubtaskSatisfactionEntity = DtoConversionUtils.sourceToTarget(patSatisfactionReqVO, ServiceSubtaskSatisfactionEntity.class);
+                    serviceSubtaskSatisfactionEntity.setLibTemplateIds(libTemplateIds);
+                    serviceSubtaskSatisfactionEntity.setType(2);
+                    List<Long> subids = serviceSubtaskMapper.querySendCount(serviceSubtaskSatisfactionEntity);
+
+                    //鑾峰彇濉姤鏁伴噺
+                    List<ServiceSubtaskDetailDTO> fillCount = null;
+                    if (CollectionUtils.isNotEmpty(subids))
+                        fillCount = serviceSubtaskDetailMapper.queryFillCount(subids, svyLibTemplateScript.getScriptContent());
+
+                    // 鏍规嵁matchedtext鍒嗙粍锛岀粺璁″悇閫夐」鏁伴噺鍙婂崰姣�
+                    Map<String, Map<String, Object>> matchedtextStats = new HashMap<>();
+                    if (CollectionUtils.isNotEmpty(fillCount)) {
+                        int totalFill = fillCount.size();
+                        fillCount.stream().filter(dto -> dto.getMatchedtext() != null).collect(Collectors.groupingBy(ServiceSubtaskDetailDTO::getMatchedtext, Collectors.counting())).forEach((matchedtext, count) -> {
+                            Map<String, Object> stat = new HashMap<>();
+                            stat.put("count", count);
+                            stat.put("ratio", new BigDecimal((double) count / totalFill * 100).setScale(1, RoundingMode.HALF_UP).doubleValue());
+                            matchedtextStats.put(matchedtext, stat);
+                        });
+                        // 浠巉illCount涓彇targetvalue锛�&鍒嗛殧鐨勫綋鍓嶉棶棰樼殑鎵�鏈夐�夐」锛夛紝琛ュ叏鏈嚭鐜扮殑閫夐」锛宑ount鍜宺atio鍧囦负0
+                        fillCount.stream().filter(dto -> dto.getTargetvalue() != null).findFirst().ifPresent(dto -> {
+                            for (String option : dto.getTargetvalue().split("&")) {
+                                String optionTrim = option.trim();
+                                if (!matchedtextStats.containsKey(optionTrim)) {
+                                    Map<String, Object> emptyStat = new HashMap<>();
+                                    emptyStat.put("count", 0L);
+                                    emptyStat.put("ratio", 0.0);
+                                    matchedtextStats.put(optionTrim, emptyStat);
+                                }
+                            }
+                        });
+                    }
+                    patSatisfactionDetailEntity.setScriptContent(svyLibTemplateScript.getScriptContent());
+                    patSatisfactionDetailEntity.setAnswerPerson(CollectionUtils.isEmpty(fillCount) ? 0 : fillCount.size());
+                    patSatisfactionDetailEntity.setNoAnswerPerson(CollectionUtils.isNotEmpty(fillCount) && CollectionUtils.isNotEmpty(subids) ? (subids.size() - fillCount.size()) : CollectionUtils.isNotEmpty(subids) ? subids.size() : 0);
+                    patSatisfactionDetailEntity.setAverageScore(averageScore(fillCount));
+
+                    OptionalDouble maxOpt = svyLibTemplateTargetoptions.stream().filter(dto -> dto.getScore() != null).mapToDouble(dto -> dto.getScore().doubleValue()).max();
+                    patSatisfactionDetailEntity.setMaxScore(maxOpt.isPresent() ? new BigDecimal(maxOpt.getAsDouble()).setScale(1, RoundingMode.HALF_UP).doubleValue() : 0.0);
+
+                    OptionalDouble minOpt = svyLibTemplateTargetoptions.stream().filter(dto -> dto.getScore() != null).mapToDouble(dto -> dto.getScore().doubleValue()).min();
+                    patSatisfactionDetailEntity.setMinScore(minOpt.isPresent() ? new BigDecimal(minOpt.getAsDouble()).setScale(1, RoundingMode.HALF_UP).doubleValue() : 0.0);
+
+                    patSatisfactionDetailEntity.setAnswerRate(CollectionUtils.isEmpty(subids) ? 0 : CollectionUtils.isEmpty(fillCount) ? 0 : fillCount.size() * 1.0 / subids.size());
+                    patSatisfactionDetailEntity.setMatchedtextStats(matchedtextStats);
+                    patSatisfactionDetailEntities.add(patSatisfactionDetailEntity);
+
+                    totalPerson += CollectionUtils.isEmpty(fillCount) ? 0 : fillCount.size();
+                    allPerson += subids.size();
+                }
+            }
+        }
+        result.setTotalAnswerRate(Arith.div(totalPerson, allPerson));
+        result.setPatSatisfactionDetailEntities(patSatisfactionDetailEntities);
+        result.setTotalPerson(totalPerson);
+
+        return result;
+    }
+
     @Override
     public Map<String, Object> satisfactionGraph(PatSatisfactionReqVO patSatisfactionReqVO) {
         //鐢ㄦ潵璁板綍鏌辩姸鍥句俊鎭紙key=婊℃剰搴﹀垎绫诲悕绉帮紝value=婊℃剰搴﹀垎绫讳笅鐨勬�讳汉鏁板拰濉姤浜烘暟锛�
@@ -449,6 +625,139 @@
         return zzt;
     }
 
+
+    @Override
+    public Map<String, Object> satisfactionGraphDimension(PatSatisfactionReqVO patSatisfactionReqVO) {
+        //鐢ㄦ潵璁板綍鏌辩姸鍥句俊鎭紙key=婊℃剰搴﹀垎绫诲悕绉帮紝value=婊℃剰搴﹀垎绫讳笅鐨勬�讳汉鏁板拰濉姤浜烘暟锛�
+        Map<String, Object> zzt = new HashMap<>();
+
+        // 璁板綍涓�涓嬫瘡绉嶅垎绫荤殑濉姤鎯呭喌
+        Map<String, List<ServiceSubtaskDetailDTO>> assortNameFillCountMap = new HashMap<>();
+
+        if (patSatisfactionReqVO.getType() == null || patSatisfactionReqVO.getType() == 1) {
+            //1. 浠庡叆鍙備腑鑾峰彇婊℃剰搴︾淮缁村害
+            IvrLibaTemplateScript ivrLibaTemplateScript2 = new IvrLibaTemplateScript();
+            ivrLibaTemplateScript2.setDimensionList(patSatisfactionReqVO.getDimensionList());
+
+            //2 鍐嶈幏鍙栬闂婊℃剰搴﹀垎绫讳笅鐨処vrLibaTemplateScript鐨勯泦鍚�
+            List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.selectILTSBydimension(ivrLibaTemplateScript2);
+            if (ivrLibaTemplateScripts != null && !ivrLibaTemplateScripts.isEmpty()) {
+                //3 鎸塪imension缁村害鍒嗙粍,骞惰幏鍙栨瘡涓泦鍚堣繘琛岄亶鍘嗭紝璁$畻姣忎釜鍒嗙被鐨勬�讳汉鏁板拰濉姤浜烘暟
+                Map<String, List<IvrLibaTemplateScript>> groupByDimension = ivrLibaTemplateScripts.stream().filter(item -> item.getDimension() != null).collect(Collectors.groupingBy(IvrLibaTemplateScript::getDimension));
+
+                if (groupByDimension != null && !groupByDimension.isEmpty()) {
+                    for (String dimension : groupByDimension.keySet()) {
+                        //璁板綍鎬讳汉鏁�
+                        Double subidAll = 0.0;
+                        //璁板綍鎬荤殑濉姤浜烘暟
+                        Double fillCountAll = 0.0;
+                        //鑾峰彇璇ョ淮搴︾殑濉姤鎬绘暟閲�
+                        List<ServiceSubtaskDetailDTO> allFillCountList = new ArrayList<>();
+
+                        List<IvrLibaTemplateScript> ivrLibaTemplateScriptList = groupByDimension.get(dimension);
+                        for (IvrLibaTemplateScript ivrLibaTemplateScript : ivrLibaTemplateScriptList) {
+                            //鑾峰彇libTemplateId
+                            List<Long> libTemplateIds = new ArrayList<>();
+                            libTemplateIds.add(ivrLibaTemplateScript.getTemplateid());
+                            // 鍐嶉�氳繃妯℃澘id鑾峰彇闂鍙戦�佹�婚噺
+                            ServiceSubtaskSatisfactionEntity serviceSubtaskSatisfactionEntity = DtoConversionUtils.sourceToTarget(patSatisfactionReqVO, ServiceSubtaskSatisfactionEntity.class);
+                            serviceSubtaskSatisfactionEntity.setLibTemplateIds(libTemplateIds);
+                            serviceSubtaskSatisfactionEntity.setType(1);
+                            List<Long> subids = serviceSubtaskMapper.querySendCount(serviceSubtaskSatisfactionEntity);
+
+                            //鑾峰彇濉姤鏁伴噺
+                            List<ServiceSubtaskDetailDTO> fillCount = null;
+                            if (CollectionUtils.isNotEmpty(subids)) {
+                                fillCount = serviceSubtaskDetailMapper.queryFillCount(subids, ivrLibaTemplateScript.getScriptContent());
+                                if (CollectionUtils.isNotEmpty(fillCount)) allFillCountList.addAll(fillCount);
+                            }
+                            subidAll += subids.size();
+                            fillCountAll += CollectionUtils.isEmpty(fillCount) ? 0 : fillCount.size();
+                        }
+
+                        // 杩欓噷鍏堣褰曚竴涓嬫瘡涓垎绫荤殑鎬讳汉鏁板拰濉姤浜烘暟
+                        Map<String, Object> personCount = new HashMap<>();
+                        personCount.put("fillCountAll", fillCountAll);
+                        personCount.put("subidAll", subidAll);
+                        personCount.put("receiveRate", Arith.div(fillCountAll, subidAll));
+                        personCount.put("averageScore", averageScore(allFillCountList));
+                        zzt.put(dimension, personCount);
+                        assortNameFillCountMap.put(dimension, allFillCountList);
+                    }
+                }
+            }
+        }
+
+        if (patSatisfactionReqVO.getType() == null || patSatisfactionReqVO.getType() == 2) {
+            //1.  浠庡叆鍙備腑鑾峰彇婊℃剰搴︾淮缁村害
+            SvyLibTemplateScriptVO svyLibTemplateScriptVO = new SvyLibTemplateScriptVO();
+            svyLibTemplateScriptVO.setDimensionList(patSatisfactionReqVO.getDimensionList());
+
+            //2 鍐嶈幏鍙栬闂婊℃剰搴﹀垎绫讳笅鐨処vrLibaTemplateScript鐨勯泦鍚�
+            List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSLTScriptListBydimension(svyLibTemplateScriptVO);
+            if (svyLibTemplateScripts != null && !svyLibTemplateScripts.isEmpty()) {
+                //3 鎸塻criptAssortname鍒嗙粍,骞惰幏鍙栨瘡涓泦鍚堣繘琛岄亶鍘嗭紝璁$畻姣忎釜鍒嗙被鐨勬�讳汉鏁板拰濉姤浜烘暟
+                Map<String, List<SvyLibTemplateScript>> groupByDimension = svyLibTemplateScripts.stream().filter(item -> item.getDimension() != null).collect(Collectors.groupingBy(SvyLibTemplateScript::getDimension));
+                if (groupByDimension != null && !groupByDimension.isEmpty()) {
+                    for (String dimension : groupByDimension.keySet()) {
+                        //璁板綍鎬讳汉鏁�
+                        Double subidAll = 0.0;
+                        //璁板綍鎬荤殑濉姤浜烘暟
+                        Double fillCountAll = 0.0;
+                        //鑾峰彇璇ュ垎绫荤殑濉姤鎬绘暟閲�
+                        List<ServiceSubtaskDetailDTO> allFillCountList = new ArrayList<>();
+
+                        List<SvyLibTemplateScript> svyLibTemplateScriptList = groupByDimension.get(dimension);
+                        for (SvyLibTemplateScript svyLibTemplateScript : svyLibTemplateScriptList) {
+                            //鑾峰彇libTemplateId
+                            List<Long> libTemplateIds = new ArrayList<>();
+                            libTemplateIds.add(svyLibTemplateScript.getSvyid());
+                            // 鍐嶉�氳繃妯℃澘id鑾峰彇闂鍙戦�佹�婚噺
+                            ServiceSubtaskSatisfactionEntity serviceSubtaskSatisfactionEntity = DtoConversionUtils.sourceToTarget(patSatisfactionReqVO, ServiceSubtaskSatisfactionEntity.class);
+                            serviceSubtaskSatisfactionEntity.setLibTemplateIds(libTemplateIds);
+                            serviceSubtaskSatisfactionEntity.setType(2);
+                            List<Long> subids = serviceSubtaskMapper.querySendCount(serviceSubtaskSatisfactionEntity);
+
+                            //鑾峰彇濉姤鏁伴噺
+                            List<ServiceSubtaskDetailDTO> fillCount = null;
+                            if (CollectionUtils.isNotEmpty(subids)) {
+                                fillCount = serviceSubtaskDetailMapper.queryFillCount(subids, svyLibTemplateScript.getScriptContent());
+                                if (CollectionUtils.isNotEmpty(fillCount)) allFillCountList.addAll(fillCount);
+                            }
+                            subidAll += subids.size();
+                            fillCountAll += CollectionUtils.isEmpty(fillCount) ? 0 : fillCount.size();
+                        }
+
+
+                        // 杩欓噷鍏堣褰曚竴涓嬫瘡涓垎绫荤殑鎬讳汉鏁板拰濉姤浜烘暟
+                        Map<String, Object> personCount = (Map<String, Object>) zzt.get(dimension);
+                        if (!Objects.isNull(personCount)) {
+                            Double fillCountAll2 = (Double) personCount.get("fillCountAll");
+                            Double subidAll2 = (Double) personCount.get("subidAll");
+                            personCount.put("fillCountAll", fillCountAll2 + fillCountAll);
+                            personCount.put("subidAll", subidAll2 + subidAll);
+                            personCount.put("receiveRate", Arith.div((Double) personCount.get("fillCountAll"), (Double) personCount.get("subidAll")));
+
+                            //鐪嬩竴涓嬩箣鍓嶆湁娌℃湁璇ュ垎绫荤殑濉姤閲�
+                            List<ServiceSubtaskDetailDTO> serviceSubtaskDetailDTOS = assortNameFillCountMap.get(dimension);
+                            if (CollectionUtils.isNotEmpty(serviceSubtaskDetailDTOS))
+                                allFillCountList.addAll(serviceSubtaskDetailDTOS);
+                            personCount.put("averageScore", averageScore(allFillCountList));
+                        } else {
+                            personCount = new HashMap<>();
+                            personCount.put("fillCountAll", fillCountAll);
+                            personCount.put("subidAll", subidAll);
+                            personCount.put("receiveRate", Arith.div(fillCountAll, subidAll));
+                            personCount.put("averageScore", averageScore(allFillCountList));
+                            zzt.put(dimension, personCount);
+                        }
+                    }
+                }
+            }
+        }
+        return zzt;
+    }
+
     /**
      * 鑾峰彇鏈�楂樺垎
      *
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
index 59212f3..56d4bc6 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
@@ -809,7 +809,42 @@
         patMedInhosp.setHospitaldistrictname(dto.getAreaName());
     }
 
+    /**
+     * 澶勭悊鎮h�呮。妗堬紙鏂板鎴栨洿鏂帮級
+     * 浣跨敤 Redis 鍒嗗竷寮忛攣闃叉骞跺彂閲嶅鎻掑叆
+     */
     private PatArchive processPatientArchive(ServiceSLTDInhospResDTO dto) {
+        // 鏋勫缓閿佺殑 key锛氬熀浜� patientno 鎴� idcardno
+        String lockKey = "pat_archive_lock:" + 
+            (StringUtils.isNotEmpty(dto.getMedicalRecordNo()) ? dto.getMedicalRecordNo() : dto.getIdCardNo());
+        
+        // 灏濊瘯鑾峰彇鍒嗗竷寮忛攣锛屾渶澶氱瓑寰� 3 绉掞紝閿佸畾 10 绉掕嚜鍔ㄩ噴鏀�
+        Boolean lockAcquired = redisTemplate.opsForValue().setIfAbsent(lockKey, "1", 10, TimeUnit.SECONDS);
+        
+        if (lockAcquired == null || !lockAcquired) {
+            log.warn("銆恜rocessPatientArchive銆戣幏鍙栧垎甯冨紡閿佸け璐ワ紝璺宠繃鏈澶勭悊锛堝叾浠栫嚎绋嬫鍦ㄥ鐞嗭級锛宲atientno={}", dto.getMedicalRecordNo());
+            // 绛夊緟涓�娈垫椂闂村悗閲嶈瘯鏌ヨ
+            try {
+                Thread.sleep(500);
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+            }
+        }
+        
+        try {
+            return doProcessPatientArchive(dto);
+        } finally {
+            // 閲婃斁閿�
+            if (lockAcquired != null && lockAcquired) {
+                redisTemplate.delete(lockKey);
+            }
+        }
+    }
+
+    /**
+     * 瀹為檯鎵ц鎮h�呮。妗堝鐞嗛�昏緫
+     */
+    private PatArchive doProcessPatientArchive(ServiceSLTDInhospResDTO dto) {
         List<PatArchive> existingArchives = null;
         log.info("銆恜rocessPatientArchive銆戞柊澧炴偅鑰呮。妗堬紝鏌ヨ鍏ュ弬淇℃伅patientno:{}锛宨dcardno:{}", dto.getMedicalRecordNo(), dto.getIdCardNo());
         // 绗竴姝ワ細鎸� patientno 绮剧‘鏌ラ噸锛堜笌鎻掑叆鏃朵娇鐢ㄧ殑 medicalRecordNo 涓�鑷达級
@@ -818,6 +853,7 @@
             PatArchive queryByPatientNo = new PatArchive();
             queryByPatientNo.setPatientno(patientno);
             existingArchives = patArchiveService.selectPatArchiveList(queryByPatientNo);
+            log.debug("銆恜rocessPatientArchive銆戞寜patientno鏌ヨ锛宲atientno={}, 缁撴灉鏁伴噺={}", patientno, existingArchives.size());
         }
 
         // 绗簩姝ワ細鎸� patientno 鏌ヤ笉鍒版椂锛屾寜 idcardno 鏌ラ噸锛堝垎姝R锛岄伩鍏岮ND鏉′欢婕忔煡锛�
@@ -825,30 +861,55 @@
             PatArchive queryByIdCard = new PatArchive();
             queryByIdCard.setIdcardno(dto.getIdCardNo().trim());
             existingArchives = patArchiveService.selectPatArchiveList(queryByIdCard);
+            log.debug("銆恜rocessPatientArchive銆戞寜idcardno鏌ヨ锛宨dcardno={}, 缁撴灉鏁伴噺={}", dto.getIdCardNo(), existingArchives.size());
         }
 
         PatArchive patArchive = buildPatientArchive(dto);
-
+        log.info("銆恜rocessPatientArchive銆戞偅鑰呮。妗堟煡閲嶅畬鎴愶紝patientno={}, 鏄惁宸插瓨鍦�={}", 
+            patArchive.getPatientno(), CollectionUtils.isEmpty(existingArchives) ? "鍚�" : "鏄�(id=" + existingArchives.get(0).getId() + ")");
+        
         if (CollectionUtils.isEmpty(existingArchives)) {
             try {
-                //鍐嶆煡涓�娆★紝纭繚涓嶄細鏈夐噸澶嶇殑
-                PatArchive queryByIdCard = new PatArchive();
-                if(StringUtils.isNotEmpty(dto.getIdCardNo())) queryByIdCard.setIdcardno(dto.getIdCardNo().trim());
-                if(StringUtils.isNotEmpty(dto.getMedicalRecordNo())) queryByIdCard.setPatientno(dto.getMedicalRecordNo());
-                List<PatArchive> archivesByIdCard = patArchiveService.selectPatArchiveList(queryByIdCard);
-
-                if (CollectionUtils.isEmpty(archivesByIdCard)) patArchiveService.insertPatArchive(patArchive);
-                log.info("銆恜rocessPatientArchive銆戞柊澧炴偅鑰呮。妗堬紝鎮h�呯紪鍙凤細{}", patArchive.getPatientno());
+                // 鏈�缁堢‘璁ゆ煡璇紙闃插尽鎬х紪绋嬶細闃叉Redis閿佸け鏁堢瓑鏋佺鎯呭喌锛�
+                PatArchive finalQuery = new PatArchive();
+                if (StringUtils.isNotEmpty(dto.getIdCardNo())) {
+                    finalQuery.setIdcardno(dto.getIdCardNo().trim());
+                }
+                if (StringUtils.isNotEmpty(dto.getMedicalRecordNo())) {
+                    finalQuery.setPatientno(dto.getMedicalRecordNo());
+                }
+                
+                List<PatArchive> finalCheck = patArchiveService.selectPatArchiveList(finalQuery);
+                log.info("銆恜rocessPatientArchive銆戞渶缁堢‘璁ゆ煡璇紝patientno={}, idcardno={}, 缁撴灉鏁伴噺={}", 
+                    dto.getMedicalRecordNo(), dto.getIdCardNo(), finalCheck.size());
+                
+                if (CollectionUtils.isEmpty(finalCheck)) {
+                    patArchiveService.insertPatArchive(patArchive);
+                    log.info("銆恜rocessPatientArchive銆戔湏 鏂板鎮h�呮。妗堟垚鍔燂紝patientno={}, id={}", 
+                        patArchive.getPatientno(), patArchive.getId());
+                } else {
+                    // 鍏朵粬绾跨▼宸茬粡鎻掑叆锛岀洿鎺ヤ娇鐢ㄥ凡鏈夎褰�
+                    existingArchives = finalCheck;
+                    patArchive.setId(existingArchives.get(0).getId());
+                    patArchive.setNotrequiredFlag(existingArchives.get(0).getNotrequiredFlag());
+                    patArchive.setNotrequiredreason(existingArchives.get(0).getNotrequiredreason());
+                    log.info("銆恜rocessPatientArchive銆戞。妗堝凡琚叾浠栫嚎绋嬪垱寤猴紝浣跨敤宸叉湁璁板綍锛宨d={}", patArchive.getId());
+                }
             } catch (org.springframework.dao.DuplicateKeyException e) {
-                log.error("銆恜rocessPatientArchive銆戞偅鑰呮。妗堝凡瀛樺湪(骞跺彂鎻掑叆)锛岃烦杩囷細patientno={}, idcardno={}", patArchive.getPatientno(), patArchive.getIdcardno());
+                log.warn("銆恜rocessPatientArchive銆戞偅鑰呮。妗堝凡瀛樺湪(骞跺彂鎻掑叆寮傚父)锛岃烦杩囷細patientno={}, idcardno={}", 
+                    patArchive.getPatientno(), patArchive.getIdcardno());
                 // 骞跺彂鎻掑叆鍦烘櫙锛岄噸鏂版煡璇㈣幏鍙栧凡瀛樺湪鐨勮褰�
                 PatArchive queryRetry = new PatArchive();
                 queryRetry.setPatientno(patArchive.getPatientno());
+                if (StringUtils.isNotEmpty(patArchive.getIdcardno())) {
+                    queryRetry.setIdcardno(patArchive.getIdcardno());
+                }
                 existingArchives = patArchiveService.selectPatArchiveList(queryRetry);
                 if (CollectionUtils.isNotEmpty(existingArchives)) {
                     patArchive.setId(existingArchives.get(0).getId());
                     patArchive.setNotrequiredFlag(existingArchives.get(0).getNotrequiredFlag());
                     patArchive.setNotrequiredreason(existingArchives.get(0).getNotrequiredreason());
+                    log.info("銆恜rocessPatientArchive銆戜粠寮傚父鎭㈠锛岃幏鍙栧凡鏈夋。妗堬紝id={}", patArchive.getId());
                 }
             }
         } else {
@@ -856,7 +917,8 @@
             patArchive.setNotrequiredFlag(existingArchives.get(0).getNotrequiredFlag());
             patArchive.setNotrequiredreason(existingArchives.get(0).getNotrequiredreason());
             patArchiveService.updateArchive(patArchive);
-            log.info("銆恜rocessPatientArchive銆戞洿鏂版偅鑰呮。妗堬紝鎮h�呯紪鍙凤細{}", patArchive.getPatientno());
+            log.info("銆恜rocessPatientArchive銆戔湏 鏇存柊鎮h�呮。妗堬紝patientno={}, id={}", 
+                patArchive.getPatientno(), patArchive.getId());
         }
 
         return patArchive;
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
index 5d1f90a..162d9a1 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -862,6 +862,8 @@
         }
         ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(taskid);
         serviceSubtaskDetailVO.setQuestiontext(svyTaskTemplateScriptVO.getScriptContent());
+        serviceSubtaskDetailVO.setIsMydException(svyTaskTemplateScriptVO.getIsMydException());
+        serviceSubtaskDetailVO.setDimension(svyTaskTemplateScriptVO.getDimension());
         serviceSubtaskDetailVO.setCategoryid(svyTaskTemplateScriptVO.getCategoryid());
         serviceSubtaskDetailVO.setTaskid(Long.valueOf(taskid));
         serviceSubtaskDetailVO.setTargetid(svyTaskTemplateScriptVO.getTargetid() != null ? svyTaskTemplateScriptVO.getTargetid().intValue() : null);
@@ -896,7 +898,7 @@
         SvyTaskTemplateTargetoption stt = null;
         Long isabnormalFlag = 0L;
         for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption : svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions()) {
-            if (svyTaskTemplateTargetoption.getOptioncontent().trim().equals(svyTaskTemplateScriptVO.getScriptResult()))
+            if (StringUtils.isNotEmpty(svyTaskTemplateTargetoption.getOptioncontent()) && svyTaskTemplateTargetoption.getOptioncontent().trim().equals(svyTaskTemplateScriptVO.getScriptResult()))
                 stt = svyTaskTemplateTargetoption;
         }
 
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
index c80b12c..c6f675e 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -350,11 +350,16 @@
     public List<ServiceSubtaskRes> patItem(ServiceSubtaskEntity serviceSubtaskEntity) {
         if (serviceSubtaskEntity.getSendstateView() != null) {
             //            1锛氬緟闅忚锛�2 寰呭彂閫侊級锛�2锛氶殢璁夸腑锛�3 宸插彂閫併��1 琚鍙栵級銆�3锛氭湭瀹屾垚锛�5 鍙戦�佸け璐ャ��7銆佽秴鏃讹級銆�4锛氬凡瀹屾垚锛� 6 宸插畬鎴愶級銆�5锛氭棤闇�闅忚锛�4 涓嶆墽琛岋級
-            if (serviceSubtaskEntity.getSendstateView() == 1) serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(2L)));
-            if (serviceSubtaskEntity.getSendstateView() == 2) serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(1L, 3L)));
-            if (serviceSubtaskEntity.getSendstateView() == 3) serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(5L, 7L)));
-            if (serviceSubtaskEntity.getSendstateView() == 4) serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(6L)));
-            if (serviceSubtaskEntity.getSendstateView() == 5) serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(4L)));
+            if (serviceSubtaskEntity.getSendstateView() == 1)
+                serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(2L)));
+            if (serviceSubtaskEntity.getSendstateView() == 2)
+                serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(1L, 3L)));
+            if (serviceSubtaskEntity.getSendstateView() == 3)
+                serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(5L, 7L)));
+            if (serviceSubtaskEntity.getSendstateView() == 4)
+                serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(6L)));
+            if (serviceSubtaskEntity.getSendstateView() == 5)
+                serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(4L)));
         }
 
         List<ServiceSubtask> selectServiceSubtaskList = this.selectServiceSubtaskList(serviceSubtaskEntity);
@@ -747,9 +752,8 @@
                     serviceSubtask.setPatid(patTaskRelevance.getPatid());
                     serviceSubtask.setCreateTime(DateUtils.getNowDate());
                     serviceSubtask.setInhospid(patTaskRelevance.getHospid());
-                    serviceSubtask.setSendstate(1L);
-                    if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1)
-                        serviceSubtask.setSendstate(2L);
+                    //鏂板缓瀹屾垚灏辨槸寰呭彂閫佺姸鎬�
+                    serviceSubtask.setSendstate(2L);
                     serviceSubtask.setDeptcode(patTaskRelevance.getDeptcode());
                     serviceSubtask.setDeptname(patTaskRelevance.getDeptName());
                     serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode());
@@ -826,20 +830,23 @@
                     redisCache.removeElementFromList("cache-3", serviceSubtask.getId().toString());
                     redisCache.removeElementFromList("cache-4", serviceSubtask.getId().toString());
                     //灏嗗嚭鍏ラ櫌琛ㄧ殑鏁版嵁锛岃繕鍘熸垚杩樻湭澶勭悊鐨勭姸鎬�
-                    if(serviceSubtask.getServiceType().equals("2")) {
-                        PatMedInhosp patMedInhosp = new PatMedInhosp();
-                        patMedInhosp.setDeptcheckFlag("0");
-                        patMedInhosp.setWardcheckFlag("0");
-                        patMedInhosp.setDiagcheckFlag("0");
-                        patMedInhosp.setInhospid(serviceSubtask.getInhospid());
-                        patMedInhospMapper.updatePatMedInhosp(patMedInhosp);
-                    }else if(serviceSubtask.getServiceType().equals("3")) {
-
-                        if(serviceSubtask.getInhospid()!=null) {
-                            PatMedOuthospQueryReq req=new PatMedOuthospQueryReq();
+                    if (serviceSubtask.getServiceType().equals("2")) {
+                        ServiceTask st = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
+                        //濡傛灉浠诲姟鏄暱鏈熶换鍔★紝闇�瑕佸皢璇ユ偅鑰呯殑鍑哄叆闄㈡暟鎹繕鍘熸垚杩樻湭澶勭悊鐨勭姸鎬�
+                        if (st != null && st.getLongTask() == 1) {
+                            PatMedInhosp patMedInhosp = new PatMedInhosp();
+                            patMedInhosp.setDeptcheckFlag("0");
+                            patMedInhosp.setWardcheckFlag("0");
+                            patMedInhosp.setDiagcheckFlag("0");
+                            patMedInhosp.setInhospid(serviceSubtask.getInhospid());
+                            patMedInhospMapper.updatePatMedInhosp(patMedInhosp);
+                        }
+                    } else if (serviceSubtask.getServiceType().equals("3")) {
+                        if (serviceSubtask.getInhospid() != null) {
+                            PatMedOuthospQueryReq req = new PatMedOuthospQueryReq();
                             req.setOuthospno(serviceSubtask.getHospno());
                             List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.callSpQueryOuthosp(req);
-                            if(CollectionUtils.isNotEmpty(patMedOuthosps)) {
+                            if (CollectionUtils.isNotEmpty(patMedOuthosps)) {
                                 PatMedOuthosp patMedOuthosp = patMedOuthosps.get(0);
                                 patMedOuthosp.setServerState("0");
                                 patMedOuthospService.updatePatMedOuthosp(patMedOuthosp);
@@ -2214,6 +2221,8 @@
                     IvrTaskTemplateScript ivrTaskTemplateScript = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptByID(serviceSubtaskDetail.getScriptid());
                     if (ivrTaskTemplateScript != null)
                         serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScript.getScriptAssortid());
+                    serviceSubtaskDetail.setIsMydException(ivrTaskTemplateScript.getIsMydException());
+                    serviceSubtaskDetail.setDimension(ivrTaskTemplateScript.getDimension());
                 }
 
                 serviceSubtaskDetail.setSubId(selectServiceSubtaskList.get(0).getId());
@@ -2818,7 +2827,7 @@
                         if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) {
                             serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L);
                         }
-                    } else if(StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("3")) {
+                    } else if (StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("3")) {
                         //棣栨闅忚鎴愬姛
                         if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate().equals(6L))) {
                             serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L);
@@ -2839,7 +2848,7 @@
                         if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate().equals(6L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) {
                             serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L);
                         }
-                    }else {
+                    } else {
                         //棣栨闅忚鎴愬姛 - 缁熻鏃跺�欏姞涓婁笉鎵ц鐨勶紝宸插彂閫佺殑
                         if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate().equals(6L) || serviceSubtask.getSendstate().equals(3L) || serviceSubtask.getSendstate().equals(4L))) {
                             serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L);
@@ -2909,7 +2918,7 @@
                         if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) {
                             serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L);
                         }
-                    } else if(StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("3")) {
+                    } else if (StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("3")) {
                         //鍐嶆闅忚鎴愬姛
                         if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate().equals(6L))) {
                             serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L);
@@ -3059,7 +3068,7 @@
                     if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) {
                         serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L);
                     }
-                }  else if(StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("3")) {
+                } else if (StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("3")) {
                     //棣栨闅忚鎴愬姛
                     if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate().equals(6L))) {
                         serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L);
@@ -3206,7 +3215,7 @@
                     if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) {
                         serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L);
                     }
-                }  else if(StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("3")) {
+                } else if (StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("3")) {
                     //鍐嶆闅忚鎴愬姛
                     if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate().equals(6L)) {
                         serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L);
@@ -3707,8 +3716,8 @@
          */
         if (StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("2")) {
             List<Long> sendstates = serviceSubtaskCountReq.getSendstates();
-            if(CollectionUtils.isNotEmpty(sendstates) && sendstates.get(0).equals(6L)){
-                List<Long> sendstates1 =new ArrayList<>();
+            if (CollectionUtils.isNotEmpty(sendstates) && sendstates.get(0).equals(6L)) {
+                List<Long> sendstates1 = new ArrayList<>();
                 sendstates1.add(3L);
                 sendstates1.add(4L);
                 sendstates1.add(6L);
@@ -3884,10 +3893,7 @@
         //鑾峰彇鍙婃椂鐜囩粺璁″悎闆�
         Map<String, Map<String, Object>> jsRates = getSsRateForSfStatistics(serviceSubtaskCountReq, collect);
         //涓�娆℃�ф煡璇㈡墍鏈夊垎缁勭殑棰樼洰缁熻锛岄伩鍏嶆瘡涓垎缁勪竴娆QL锛圢+1锛�
-        List<Long> allSubTaskIds = rawData.stream().map(ServiceSubtask::getId)
-                .filter(Objects::nonNull)
-                .distinct()
-                .collect(Collectors.toList());
+        List<Long> allSubTaskIds = rawData.stream().map(ServiceSubtask::getId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
         List<ServiceSubtaskCount> subCounts = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(allSubTaskIds)) {
             serviceSubtaskCountReq.setSubTaskIds(allSubTaskIds);
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml
index ac239ca..be111cc 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml
@@ -7,6 +7,7 @@
     <resultMap type="com.smartor.domain.IvrLibaScript" id="IvrLibaScriptResult">
         <result property="id" column="id"/>
         <result property="assortid" column="assortid"/>
+        <result property="dimension" column="dimension"/>
         <result property="scriptTopic" column="script_topic"/>
         <result property="scriptContent" column="script_content"/>
         <result property="ivrVoice" column="ivr_voice"/>
@@ -58,6 +59,7 @@
     <sql id="selectIvrLibaScriptVo">
         select id,
                suitway,
+               dimension,
                assortid,
                targetdesc,
                campus,
@@ -94,6 +96,7 @@
             and del_flag = 0
             <if test="id != null ">and id = #{id}</if>
             <if test="deptIds != null  and deptIds != ''">and deptIds = #{deptIds}</if>
+            <if test="dimension != null  and dimension != ''">and dimension = #{dimension}</if>
             <if test="deptNames != null  and deptNames != ''">and deptNames like concat('%', #{deptNames}, '%')</if>
             <if test="scriptTopic != null  and scriptTopic != ''">and script_topic like concat('%', #{scriptTopic},
                 '%')
@@ -191,6 +194,7 @@
             <if test="valueType != null">value_type,</if>
             <if test="reply != null">reply,</if>
             <if test="targetdesc != null">targetdesc,</if>
+            <if test="dimension != null">dimension,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="scriptTopic != null">#{scriptTopic},</if>
@@ -240,6 +244,7 @@
             <if test="valueType != null">#{valueType},</if>
             <if test="reply != null">#{reply},</if>
             <if test="targetdesc != null">#{targetdesc},</if>
+            <if test="dimension != null">#{dimension},</if>
         </trim>
     </insert>
 
@@ -294,6 +299,7 @@
             <if test="valueType != null">value_type = #{valueType},</if>
             <if test="reply != null">reply = #{reply},</if>
             <if test="targetdesc != null">targetdesc = #{targetdesc},</if>
+            <if test="dimension != null">dimension = #{dimension},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
index 0231b76..ff1d04a 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -53,11 +53,16 @@
         <result property="dutyDeptCode" column="duty_dept_code"/>
         <result property="reportDeptCode" column="report_dept_name"/>
         <result property="reportDeptName" column="report_dept_code"/>
+        <result property="isMydException" column="is_myd_exception"/>
+        <result property="dimension" column="dimension"/>
+
     </resultMap>
 
     <sql id="selectIvrLibaTemplateScriptVo">
         select id,
                scriptno,
+               is_myd_exception,
+               dimension,
                sort,
                script_assortname,
                duty_dept_name,
@@ -111,6 +116,8 @@
         <include refid="selectIvrLibaTemplateScriptVo"/>
         where del_flag = 0
         <if test="scriptno != null ">and scriptno = #{scriptno}</if>
+        <if test="isMydException != null ">and is_myd_exception = #{isMydException}</if>
+        <if test="dimension != null ">and dimension = #{dimension}</if>
         <if test="scriptAssortid != null ">and script_assortid = #{scriptAssortid}</if>
         <if test="groupName != null ">and group_name = #{groupName}</if>
         <if test="scriptDesc != null ">and script_desc = #{scriptDesc}</if>
@@ -169,6 +176,19 @@
         <if test="score != null">and score = #{score}</if>
     </select>
 
+
+    <select id="selectILTSBydimension" parameterType="com.smartor.domain.IvrLibaTemplateScript"
+            resultMap="IvrLibaTemplateScriptResult">
+        <include refid="selectIvrLibaTemplateScriptVo"/>
+        <where>del_flag=0
+            <if test="dimensionList != null ">and dimension in
+                <foreach item="dimension" collection="dimensionList" open="(" separator="," close=")">
+                    #{dimension}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
     <select id="selectIvrLibaTemplateScriptByID" parameterType="Long" resultMap="IvrLibaTemplateScriptResult">
         <include refid="selectIvrLibaTemplateScriptVo"/>
         where id = #{id}
@@ -225,6 +245,8 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">duty_dept_code,</if>
             <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name,</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code,</if>
+            <if test="isMydException != null  and isMydException != ''">is_myd_exception,</if>
+            <if test="dimension != null  and dimension != ''">dimension,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="scriptno != null">#{scriptno},</if>
@@ -273,6 +295,8 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">#{dutyDeptCode},</if>
             <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
+            <if test="isMydException != null  and isMydException != ''">#{isMydException},</if>
+            <if test="dimension != null  and dimension != ''">#{dimension},</if>
         </trim>
     </insert>
 
@@ -313,6 +337,8 @@
             <if test="isMust != null  and isMust != ''">is_must = #{isMust},</if>
             <if test="scriptDesc != null ">script_desc = #{scriptDesc},</if>
             <if test="scriptType != null ">script_type = #{scriptType},</if>
+            <if test="isMydException != null  and isMydException != ''">is_myd_exception = #{isMydException},</if>
+            <if test="dimension != null  and dimension != ''">dimension = #{dimension},</if>
             <if test="sort != null ">sort = #{sort},</if>
             <if test="ivrtext != null ">ivrtext = #{ivrtext},</if>
             <if test="branchFlag != null  and branchFlag != ''">branch_flag = #{branchFlag},</if>
@@ -350,10 +376,10 @@
         <include refid="selectIvrLibaTemplateScriptVo"/>
         where del_flag=0
         <if test="scriptAssortids != null and scriptAssortids.size > 0">
-        and script_assortid in
-        <foreach item="scriptAssortid" collection="scriptAssortids" open="(" separator="," close=")">
-            #{scriptAssortid}
-        </foreach>
+            and script_assortid in
+            <foreach item="scriptAssortid" collection="scriptAssortids" open="(" separator="," close=")">
+                #{scriptAssortid}
+            </foreach>
         </if>
     </select>
 </mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
index f84aca6..2be2ecf 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -53,11 +53,15 @@
         <result property="dutyDeptCode" column="duty_dept_code"/>
         <result property="reportDeptCode" column="report_dept_name"/>
         <result property="reportDeptName" column="report_dept_code"/>
+        <result property="dimension" column="dimension"/>
+        <result property="isMydException" column="is_myd_exception"/>
     </resultMap>
 
     <sql id="selectIvrTaskTemplateScriptVo">
         select id,
                taskid,
+               dimension,
+               is_myd_exception,
                duty_dept_name,
                duty_dept_code,
                report_dept_name,
@@ -93,6 +97,8 @@
         where 1=1
         and del_flag = 0
         <if test="taskid != null ">and taskid = #{taskid}</if>
+        <if test="dimension != null  and dimension != ''">and dimension = #{dimension}</if>
+        <if test="isMydException != null  and isMydException != ''">and is_myd_exception = #{isMydException}</if>
         <if test="scriptAssortid != null ">and script_assortid = #{scriptAssortid}</if>
         <if test="score != null ">and score = #{score}</if>
         <if test="scriptTopic != null ">and script_topic = #{scriptTopic}</if>
@@ -205,6 +211,8 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">duty_dept_code,</if>
             <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name,</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code,</if>
+            <if test="dimension != null  and dimension != ''">dimension,</if>
+            <if test="isMydException != null  and isMydException != ''">is_myd_exception,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="taskid != null">#{taskid},</if>
@@ -253,6 +261,8 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">#{dutyDeptCode},</if>
             <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
+            <if test="dimension != null  and dimension != ''">#{dimension},</if>
+            <if test="isMydException != null  and isMydException != ''">#{isMydException},</if>
         </trim>
     </insert>
 
@@ -303,6 +313,8 @@
             <if test="ivrtext != null">ivrtext = #{ivrtext},</if>
             <if test="scriptTopic != null ">script_topic = #{scriptTopic},</if>
             <if test="scriptAssortid != null ">script_assortid = #{scriptAssortid},</if>
+            <if test="dimension != null  and dimension != ''">dimension = #{dimension},</if>
+            <if test="isMydException != null  and isMydException != ''">is_myd_exception = #{isMydException},</if>
             <if test="dutyDeptName != null  and dutyDeptName != ''">duty_dept_name = #{dutyDeptName},</if>
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">duty_dept_code = #{dutyDeptCode},</if>
             <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name = #{reportDeptName},</if>
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
index 0591b17..f661975 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -18,6 +18,8 @@
         <result property="assigntime" column="assigntime"/>
         <result property="starttime" column="starttime"/>
         <result property="answertime" column="answertime"/>
+        <result property="dimension" column="lib_templateid"/>
+        <result property="isMydException" column="is_myd_exception"/>
 
         <result property="silent" column="silent"/>
         <result property="dtmfKey" column="dtmf_key"/>
@@ -70,6 +72,8 @@
     <sql id="selectServiceSubtaskDetailVo">
         select id,
                sub_id,
+               is_myd_exception,
+               dimension,
                lib_templateid,
                targetid,
                answerps,
@@ -129,6 +133,8 @@
         <include refid="selectServiceSubtaskDetailVo"/>
         where 1=1
         <if test="subId != null">and sub_id = #{subId}</if>
+        <if test="isMydException != null">and is_myd_exception = #{isMydException}</if>
+        <if test="dimension != null">and dimension = #{dimension}</if>
         <if test="templateType != null">and template_type = #{templateType}</if>
         <if test="libTemplateid != null">and lib_templateid = #{libTemplateid}</if>
         <if test="targetid != null">and targetid = #{targetid}</if>
@@ -183,6 +189,8 @@
             resultType="java.util.HashMap">
         select
             ssd.sub_id,
+            ssd.is_myd_exception,
+            ssd.dimension,
             ssd.taskid,
             ssd.patid,
             sd.sendname,
@@ -205,6 +213,8 @@
         <if test="subId != null">and ssd.sub_id = #{subId}</if>
         <if test="taskid != null">and ssd.taskid = #{taskid}</if>
         <if test="questiontext != null and questiontext != ''">and ssd.questiontext = #{questiontext}</if>
+        <if test="isMydException != null">and ssd.is_myd_exception = #{isMydException}</if>
+        <if test="dimension != null">and ssd.dimension = #{dimension}</if>
         <if test="matchedtext != null and matchedtext != ''">and ssd.matchedtext = #{matchedtext}</if>
         <if test="asrtext != null and asrtext != ''">and ssd.asrtext = #{asrtext}</if>
         <if test="scriptid != null">and ssd.scriptid = #{scriptid}</if>
@@ -314,6 +324,8 @@
             <if test="templateType != null">template_type,</if>
             <if test="libTemplateid != null">lib_templateid,</if>
             <if test="score != null">score,</if>
+            <if test="isMydException != null">is_myd_exception,</if>
+            <if test="dimension != null">dimension,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -369,12 +381,16 @@
             <if test="templateType != null">#{templateType},</if>
             <if test="libTemplateid != null">#{libTemplateid},</if>
             <if test="score != null">#{score},</if>
+            <if test="isMydException != null">#{isMydException},</if>
+            <if test="dimension != null">#{dimension},</if>
         </trim>
     </insert>
 
     <update id="updateServiceSubtaskDetail" parameterType="com.smartor.domain.ServiceSubtaskDetail">
         update service_subtask_detail
         <trim prefix="SET" suffixOverrides=",">
+            <if test="isMydException != null">is_myd_exception = #{isMydException},</if>
+            <if test="dimension != null">dimension = #{dimension},</if>
             <if test="subId != null">sub_id = #{subId},</if>
             <if test="taskid != null">taskid = #{taskid},</if>
             <if test="targetid != null">targetid = #{targetid},</if>
@@ -487,6 +503,8 @@
             <if test="templateType != null">template_type = #{templateType},</if>
             <if test="libTemplateid != null">lib_templateid = #{libTemplateid},</if>
             <if test="score != null">score = #{score},</if>
+            <if test="isMydException != null">is_myd_exception = #{isMydException},</if>
+            <if test="dimension != null">dimension = #{dimension},</if>
         </trim>
         where patid = #{patid} and scriptid = #{scriptid} and sub_id = #{subId}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml
index a7c9511..c3220e6 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml
@@ -53,11 +53,15 @@
         <result property="pid" column="pid"/>
         <result property="categoryid" column="categoryid"/>
         <result property="templateType" column="template_type"/>
+        <result property="isMydException" column="is_myd_exception"/>
+        <result property="dimension" column="dimension"/>
     </resultMap>
 
     <sql id="selectServiceSubtaskDetailTtraceVo">
         select id,
                detail_id,
+               is_myd_exception,
+               dimension,
                template_type,
                sub_id,
                taskid,
@@ -247,6 +251,12 @@
         <if test="type != null  and type != ''">
             and type = #{type}
         </if>
+        <if test="dimension != null  and dimension != ''">
+            and dimension = #{dimension}
+        </if>
+        <if test="isMydException != null ">
+            and is_myd_exception = #{isMydException}
+        </if>
     </select>
 
     <select id="tracedeallist" parameterType="com.smartor.domain.VO.DetailTraceDealVO"
@@ -276,6 +286,12 @@
         </if>
         <if test="templateType != null">
             and template_type = #{templateType}
+        </if>
+        <if test="isMydException != null ">
+            and is_myd_exception = #{isMydException}
+        </if>
+        <if test="dimension != null  and dimension != ''">
+            and dimension = #{dimension}
         </if>
     </select>
 
@@ -386,6 +402,10 @@
             </if>
             <if test="templateType != null">template_type,
             </if>
+            <if test="dimension != null">dimension,
+            </if>
+            <if test="isMydException != null">is_myd_exception,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="detailId != null">#{detailId},
@@ -483,6 +503,10 @@
             <if test="type != null">#{type},
             </if>
             <if test="templateType != null">#{templateType},
+            </if>
+            <if test="dimension != null">#{dimension},
+            </if>
+            <if test="isMydException != null">#{isMydException},
             </if>
         </trim>
     </insert>
@@ -634,6 +658,12 @@
             <if test="templateType != null">template_type =
                 #{templateType},
             </if>
+            <if test="dimension != null">dimension =
+                #{dimension},
+            </if>
+            <if test="isMydException != null">is_myd_exception =
+                #{isMydException},
+            </if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
index e78b54e..e892bf1 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
@@ -38,11 +38,13 @@
         <result property="targetname" column="targetname"/>
         <result property="targettype" column="targettype"/>
         <result property="targetoptions" column="targetoptions"/>
+        <result property="dimension" column="dimension"/>
     </resultMap>
 
     <sql id="selectSvyLibScriptVo">
         select id,
                scoretype,
+               dimension,
                targetid,
                targetname,
                targettype,
@@ -83,6 +85,7 @@
             and del_flag = 0
             <if test="id != null ">and id = #{id}</if>
             <if test="scriptType != null and scriptType != ''">and script_type = #{scriptType}</if>
+            <if test="dimension != null and dimension != ''">and dimension = #{dimension}</if>
             <if test="categoryid != null ">and categoryid = #{categoryid}</if>
             <if test="scriptContent != null  and scriptContent != ''">and script_content like concat('%',
                 #{scriptContent}, '%')
@@ -146,6 +149,7 @@
             <if test="targettype != null  and targettype != ''">targettype,</if>
             <if test="targetoptions != null  and targetoptions != ''">targetoptions,</if>
             <if test="guid != null  and guid != ''">guid,</if>
+            <if test="dimension != null  and dimension != ''">dimension,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="scriptType != null">#{scriptType},</if>
@@ -180,6 +184,7 @@
             <if test="targettype != null  and targettype != ''">#{targettype},</if>
             <if test="targetoptions != null  and targetoptions != ''">#{targetoptions},</if>
             <if test="guid != null  and guid != ''">#{guid},</if>
+            <if test="dimension != null  and dimension != ''">#{dimension},</if>
         </trim>
     </insert>
 
@@ -217,6 +222,7 @@
             <if test="targetname != null  and targetname != ''">targetname = #{targetname},</if>
             <if test="targettype != null  and targettype != ''">targettype = #{targettype},</if>
             <if test="targetoptions != null  and targetoptions != ''">targetoptions = #{targetoptions},</if>
+            <if test="dimension != null  and dimension != ''">dimension = #{dimension},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
index f22a134..2b5d520 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -50,11 +50,16 @@
         <result property="dutyDeptCode" column="duty_dept_code"/>
         <result property="reportDeptCode" column="report_dept_name"/>
         <result property="reportDeptName" column="report_dept_code"/>
+        <result property="isMydException" column="is_myd_exception"/>
+        <result property="dimension" column="dimension"/>
+
     </resultMap>
 
     <sql id="selectSvyLibTemplateScriptVo">
         select id,
                script_type,
+               is_myd_exception,
+               dimension,
                duty_dept_name,
                duty_dept_code,
                report_dept_name,
@@ -105,6 +110,8 @@
         and del_flag = 0
         <if test="nextScriptno != null ">and next_scriptno = #{nextScriptno}</if>
         <if test="scriptType != null  and scriptType != ''">and script_type = #{scriptType}</if>
+        <if test="isMydException != null  and isMydException != ''">and is_myd_exception = #{isMydException}</if>
+        <if test="dimension != null  and dimension != ''">and dimension = #{dimension}</if>
         <if test="scriptno != null  and scriptno != ''">and scriptno = #{scriptno}</if>
         <if test="scriptid != null">and scriptid = #{scriptid}</if>
         <if test="scriptDesc != null  and scriptDesc != ''">and script_desc = #{scriptDesc}</if>
@@ -164,6 +171,18 @@
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>
 
+    <select id="selectSLTScriptListBydimension" parameterType="com.smartor.domain.SvyLibTemplateScriptVO"
+            resultMap="SvyLibTemplateScriptResult">
+        <include refid="selectSvyLibTemplateScriptVo"/>
+        <where>del_flag=0
+            <if test="dimensionList != null ">and dimension in
+                <foreach item="dimension" collection="dimensionList" open="(" separator="," close=")">
+                    #{dimension}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
     <select id="selectSvyLibTemplateScriptByTopicid" parameterType="Long" resultMap="SvyLibTemplateScriptResult">
         <include refid="selectSvyLibTemplateScriptVo"/>
         where id = #{id}
@@ -218,6 +237,8 @@
             <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name,</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code,</if>
             <if test="categoryName != null  and categoryName != ''">categoryName,</if>
+            <if test="isMydException != null  and isMydException != ''">is_myd_exception,</if>
+            <if test="dimension != null  and dimension != ''">dimension,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="nextScriptno != null">#{nextScriptno},</if>
@@ -265,6 +286,8 @@
             <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
             <if test="categoryName != null  and categoryName != ''">#{categoryName},</if>
+            <if test="isMydException != null  and isMydException != ''">#{isMydException},</if>
+            <if test="dimension != null  and dimension != ''">#{dimension},</if>
         </trim>
     </insert>
 
@@ -318,6 +341,8 @@
             <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name = #{reportDeptName},</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code = #{reportDeptCode},</if>
             <if test="categoryName != null  and categoryName != ''">categoryName = #{categoryName},</if>
+            <if test="isMydException != null  and isMydException != ''">is_myd_exception = #{isMydException},</if>
+            <if test="dimension != null  and dimension != ''">dimension = #{dimension},</if>
         </trim>
         where id = #{id}
     </update>
@@ -335,14 +360,14 @@
         </foreach>
     </delete>
 
-    <select id="querySvyLibTemplateIds"  resultMap="SvyLibTemplateScriptResult">
+    <select id="querySvyLibTemplateIds" resultMap="SvyLibTemplateScriptResult">
         <include refid="selectSvyLibTemplateScriptVo"/>
         where del_flag=0
         <if test="scriptCategoryids != null and scriptCategoryids.size > 0">
-        and categoryid in
-        <foreach item="scriptCategoryid" collection="scriptCategoryids" open="(" separator="," close=")">
-            #{scriptCategoryid}
-        </foreach>
+            and categoryid in
+            <foreach item="scriptCategoryid" collection="scriptCategoryids" open="(" separator="," close=")">
+                #{scriptCategoryid}
+            </foreach>
         </if>
     </select>
 </mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
index 81f1d55..b69adad 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
@@ -49,11 +49,15 @@
         <result property="dutyDeptCode" column="duty_dept_code"/>
         <result property="reportDeptCode" column="report_dept_name"/>
         <result property="reportDeptName" column="report_dept_code"/>
+        <result property="isMydException" column="is_myd_exception"/>
+        <result property="dimension" column="dimension"/>
     </resultMap>
 
     <sql id="selectSvyTaskTemplateScriptVo">
         select id,
                sort,
+               is_myd_exception,
+               dimension,
                duty_dept_name,
                duty_dept_code,
                report_dept_name,
@@ -81,6 +85,8 @@
         <include refid="selectSvyTaskTemplateScriptVo"/>
         where 1=1
             <if test="taskid != null ">and taskid = #{taskid}</if>
+            <if test="isMydException != null ">and is_myd_exception = #{isMydException}</if>
+            <if test="dimension != null ">and dimension = #{dimension}</if>
             <if test="categoryid != null ">and categoryid = #{categoryid}</if>
             <if test="ishide != null ">and ishide = #{ishide}</if>
             <if test="scriptno != null ">and scriptno = #{scriptno}</if>
@@ -183,6 +189,8 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">duty_dept_code,</if>
             <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name,</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''"> report_dept_code,</if>
+            <if test="isMydException != null ">is_myd_exception,</if>
+            <if test="dimension != null ">dimension,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="taskid != null">#{taskid},</if>
@@ -228,6 +236,8 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''">#{dutyDeptCode},</if>
             <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
+            <if test="isMydException != null ">#{isMydException},</if>
+            <if test="dimension != null ">#{dimension},</if>
         </trim>
     </insert>
 
@@ -279,6 +289,8 @@
             <if test="dutyDeptCode != null  and dutyDeptCode != ''"> duty_dept_code = #{dutyDeptCode},</if>
             <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name = #{reportDeptName},</if>
             <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code = #{reportDeptCode},</if>
+            <if test="isMydException != null ">is_myd_exception = #{isMydException},</if>
+            <if test="dimension != null ">dimension = #{dimension},</if>
         </trim>
         where id = #{d}
     </update>

--
Gitblit v1.9.3