From af73b41c2b027d8d74ce417e2f10008337577128 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 29 十月 2025 14:07:06 +0800
Subject: [PATCH] 新增服务补偿,用户查询BUG修改
---
 smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java               |    2 
 smartor/src/main/java/com/smartor/domain/ServiceSubtask.java                        |   10 
 smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml     |   14 +
 ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml                     |   63 +++++++
 smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java           |   10 +
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java                |    4 
 smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java               |    8 
 smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java            |   11 +
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java           |   16 +
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java               |    2 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml                  |  180 +++++++++++---------
 smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java                      |    5 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml     |   12 +
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java    |    6 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml      |   12 +
 ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java              |   27 ++
 smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java           |   12 +
 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java               |    3 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java    |   28 ++
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml     |   12 +
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java |   94 +++++++++
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java                      |    4 
 22 files changed, 426 insertions(+), 109 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
index 12e4ad9..a96db79 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -141,9 +141,13 @@
             //灏嗙姸鎬佹敼鎴愬畬鎴�
             ServiceTask serviceTask = new ServiceTask();
             serviceTask.setTaskid(Long.valueOf(commonTaskcallMQ.getTaskid()));
-            serviceTask.setSendState(5L);
-            serviceTask.setFail(1L);
-            svyTaskMapper.updateServiceTask(serviceTask);
+
+            //鍦ㄩ棶鍗蜂腑锛岄�変腑鏌愪釜閫夐」瑕佽繘琛屾湇鍔¤ˉ鍋挎椂锛屽彧鏄�熺敤璇ユ湇鍔$殑澶栧3锛屼笉瀵硅鏈嶅姟鏈変换鍔″奖鍝�
+            if (commonTaskcallMQ.getUpdateSendstate() == null || commonTaskcallMQ.getUpdateSendstate() == 1) {
+                serviceTask.setSendState(5L);
+                serviceTask.setFail(1L);
+                svyTaskMapper.updateServiceTask(serviceTask);
+            }
         } catch (Exception e) {
             Integer integer = redisCache.getCacheObject(commonTaskcallMQ.getTaskid().toString());
             if (integer != null && integer == 3) {
@@ -571,7 +575,7 @@
 
             } else if (descByCode.equals("浜哄伐")) {
                 setFailPreachForm(serviceSubtask, sendPreachform, "浜哄伐寰呮墽琛�", "2");
-            }else if (descByCode.equals("寰俊灏忕▼搴�")) {
+            } else if (descByCode.equals("寰俊灏忕▼搴�")) {
                 setFailPreachForm(serviceSubtask, sendPreachform, "寰俊灏忕▼搴忓緟鎵ц", "2");
             }
         }
@@ -651,7 +655,12 @@
             serviceSubtaskPreachform.setTaskid(serviceSubtask.getTaskid());
             serviceSubtaskPreachform.setOrgid(serviceSubtask.getOrgid());
             serviceSubtaskPreachform.setSendstate(failSendstate);
+            if (serviceSubtask.getType().equals("3") || serviceSubtask.getType().equals("4")) {
+                //濡傛灉鏄鏁欐垨閫氱煡锛屽苟涓斿彂閫佹垚鍔燂紝鐩存帴灏嗗彂閫佺姸鎬佹敼鎴�9
+                if (failSendstate.equals("2")) serviceSubtaskPreachform.setSendstate("9");
+            }
             serviceSubtaskPreachformMapper.updateSSPByCondition(serviceSubtaskPreachform);
+
             return true;
         }
 
@@ -675,6 +684,10 @@
         if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) {
             ServiceSubtaskPreachform serviceSubtaskPreachform1 = serviceSubtaskPreachforms.get(0);
             serviceSubtaskPreachform1.setSendstate(failSendstate);
+            if (serviceSubtask.getType().equals("3") || serviceSubtask.getType().equals("4")) {
+                //濡傛灉鏄鏁欐垨閫氱煡锛屽苟涓斿彂閫佹垚鍔燂紝鐩存帴灏嗗彂閫佺姸鎬佹敼鎴�9
+                if (failSendstate.equals("2")) serviceSubtaskPreachform1.setSendstate("9");
+            }
             serviceSubtaskPreachform1.setRemark(remark);
             serviceSubtaskPreachformMapper.updateServiceSubtaskPreachform(serviceSubtaskPreachform1);
             //濡傛灉褰撳墠鐨刾reachform宸茬粡鏄渶鍚庝竴涓簡,骞朵笖鏈杩樻槸鍙戦�佸け璐ワ紝閭g洿鎺ュ皢serviceSubtask鐨剆endstate鐘舵�佹敼鎴�5灏辫浜�(鍏ㄥけ璐ヤ簡)
@@ -696,6 +709,12 @@
         serviceSubtask.setCurrentPreachform(preachform);
         serviceSubtask.setVisitTime(getNextVisitTime(serviceSubtask.getId(), serviceSubtask.getTaskid(), serviceSubtask.getVisitTime(), serviceSubtask.getCurrentPreachform()));
         serviceSubtask.setSendstate(3L);
+        if (serviceSubtask.getType().equals("3") || serviceSubtask.getType().equals("4")) {
+            //濡傛灉鏄鏁欐垨閫氱煡锛屽苟涓斿彂閫佹垚鍔燂紝鍒欑洿鎺ュ皢serviceSubtask鐘舵�佹敼鎴�6L锛堣繖涓偅鑰呮槸娌℃湁棰樺仛鐨勶紝涓嶄細鍐嶈Е鍙戞帴鍙h繘琛岀姸鎬佷慨鏀癸級
+            if (failSendstate.equals("2")) {
+                serviceSubtask.setSendstate(6L);
+            }
+        }
         serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
         return true;
     }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
index 9979825..4a7f264 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -1,6 +1,8 @@
 package com.ruoyi.web.controller.system;
 
+import com.github.pagehelper.PageInfo;
 import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.HttpStatus;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -9,6 +11,7 @@
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -28,7 +31,9 @@
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -63,13 +68,24 @@
      */
     //@PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysUser user) {
-        startPage();
+    public Map<String, Object> list(SysUser user) {
         LoginUser loginUser = getLoginUser();
         String orgid = loginUser.getUser().getOrgid();
         user.setOrgid(orgid);
-        List<SysUser> list = userService.selectUserList(user);
-        return getDataTable(list);
+        user.setPageNum(PageUtils.getOffset(user.getPageNum(), user.getPageSize()));
+        List<SysUser> list = userService.getUserList(user);
+
+        Map<String, Object> rspData = new HashMap();
+        rspData.put("code", HttpStatus.SUCCESS);
+        rspData.put("msg", "鏌ヨ鎴愬姛");
+        rspData.put("rows", list);
+
+        user.setPageNum(null);
+        user.setPageSize(null);
+        List<SysUser> total = userService.getUserList(user);
+        rspData.put("total", total.size());
+
+        return rspData;
     }
 
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.EXPORT)
@@ -104,7 +120,7 @@
     //@PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping("/getInfo/{userId}")
     public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
-        log.info("--------userId鐨勫�间负锛歿}",userId);
+        log.info("--------userId鐨勫�间负锛歿}", userId);
         userService.checkUserDataScope(userId);
         AjaxResult ajax = AjaxResult.success();
         List<SysRole> roles = roleService.selectRoleAll();
@@ -123,7 +139,7 @@
         sysUserDept.setDeptType("1");
         LoginUser loginUser = getLoginUser();
         SysUser user = loginUser.getUser();
-        log.info("--------user鐨勫�间负锛歿}",user);
+        log.info("--------user鐨勫�间负锛歿}", user);
         sysUserDept.setOrgid(user.getOrgid());
         sysUserDeptKSs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
         ajax.put("belongDepts", sysUserDeptKSs);
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
index 472c03e..f89a766 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
@@ -21,6 +21,8 @@
      */
     public List<SysUser> selectUserList(SysUser sysUser);
 
+    public List<SysUser> getUserList(SysUser sysUser);
+
     /**
      * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ宸查厤鐢ㄦ埛瑙掕壊鍒楄〃
      *
@@ -44,6 +46,7 @@
      * @return 鐢ㄦ埛瀵硅薄淇℃伅
      */
     public SysUser selectUserByUserName(String userName);
+
     /**
      * 閫氳繃鐢ㄦ埛鍚嶆煡璇㈢敤鎴�
      *
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
index ca34c52..74ba552 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -78,6 +78,12 @@
     @DataScope(deptAlias = "d", userAlias = "u")
     public List<SysUser> selectUserList(SysUser user) {
         return userMapper.selectUserList(user);
+
+    }
+
+    @Override
+    public List<SysUser> getUserList(SysUser user) {
+        return userMapper.getUserList(user);
     }
 
     /**
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index 5be683e..20ff6a8 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -175,6 +175,69 @@
         <!-- 鏁版嵁鑼冨洿杩囨护 -->
         ${params.dataScope}
     </select>
+    <select id="getUserList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
+        select u.user_id,u.title,u.his_user_id,u.hosp_info,u.dept_info, u.searchscope, u.dept_id, u.user_type,
+        u.nick_name, u.user_name,
+        u.email,u.id_card,
+        u.avatar,
+        u.dept_name,
+        u.dept_code,
+        u.birthday,
+        u.job_phone,
+        u.phonenumber, u.sex, u.status,
+        u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u
+        where u.del_flag = '0'
+        <if test="userId != null">
+            AND u.user_id = #{userId}
+        </if>
+        <if test="orgid != null and orgid != ''">
+            AND u.orgid = #{orgid}
+        </if>
+        <if test="userName != null and userName != ''">
+            AND u.user_name like concat('%', #{userName}, '%')
+        </if>
+        <if test="nickName != null and nickName != ''">
+            AND u.nick_name like concat('%', #{nickName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND u.status = #{status}
+        </if>
+        <if test="idCard != null and idCard != ''">
+            AND u.id_card = #{idCard}
+        </if>
+        <if test="title != null and title != ''">
+            AND u.title = #{title}
+        </if>
+        <if test="jobPhone != null and jobPhone != ''">
+            AND u.job_phone = #{jobPhone}
+        </if>
+        <if test="birthday != null and birthday != ''">
+            AND u.birthday = #{birthday}
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND u.dept_name = #{deptName}
+        </if>
+        <if test="deptCode != null and deptCode != ''">
+            AND u.dept_code = #{deptCode}
+        </if>
+        <if test="hisUserId != null and hisUserId != ''">
+            AND u.his_user_id = #{hisUserId}
+        </if>
+        <if test="phonenumber != null and phonenumber != ''">
+            AND u.phonenumber like concat('%', #{phonenumber}, '%')
+        </if>
+        <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+            AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
+        </if>
+        <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+            AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
+        </if>
+        <if test="deptId != null and deptId != 0">
+            AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
+            ancestors) ))
+        </if>
+        <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
+    </select>
 
     <select id="selectAllocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser"
             resultMap="SysUserResult">
diff --git a/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java b/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
index 79faeb9..8e4c328 100644
--- a/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
+++ b/smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
@@ -64,5 +64,10 @@
      */
     @ApiModelProperty(value = "鍙戦�佹椂闂存 ")
     private TaskSendTimeVO sendTimeslot;
+    /**
+     * 鏈嶅姟鐘舵�佷慨鏀癸細1淇敼  2涓嶄慨鏀�
+     */
+    @ApiModelProperty(value = "鏈嶅姟鐘舵�佷慨鏀癸細1淇敼  2涓嶄慨鏀� ")
+    private Integer updateSendstate;
 
 }
diff --git a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java
index adbd77f..4a39193 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java
@@ -245,5 +245,15 @@
     @ApiModelProperty(value = "鏄惁缁撴潫 0锛氫笉缁撴潫   1锛氱粨鏉�")
     private Integer isEnd;
 
+    /**
+     * 閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d
+     */
+    @ApiModelProperty(value = "閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d")
+    private Integer sendTaskid;
 
+    /**
+     * 鏈嶅姟鐨勫悕绉�
+     */
+    @ApiModelProperty(value = "鏈嶅姟鐨勫悕绉�")
+    private String sendTaskname;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
index 93693ca..f1d08d0 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -340,6 +340,8 @@
     @ApiModelProperty(value = "寮傚父棰勮锛�0缁胯壊锛�1绾㈣壊锛�2榛勮壊")
     private Long isabnormal;
 
+    private List<Integer> sendTaskids;
+
     /**
      * 璇濇湳閫夐」
      */
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java
index bf5de6d..3c865b3 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java
@@ -22,7 +22,7 @@
  * @date 2024-05-13
  */
 @Data
-@ApiModel(value = "IvrTaskTemplateTargetoption" , description = "闅忚浠诲姟妯℃澘鎸囨爣閫夐」搴撳璞�")
+@ApiModel(value = "IvrTaskTemplateTargetoption", description = "闅忚浠诲姟妯℃澘鎸囨爣閫夐」搴撳璞�")
 public class IvrTaskTemplateTargetoption extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
@@ -182,7 +182,7 @@
      * 涓婁紶鏃堕棿
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = " 涓婁紶鏃堕棿 " , width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = " 涓婁紶鏃堕棿 ", width = 30, dateFormat = "yyyy-MM-dd")
     @ApiModelProperty(value = "涓婁紶鏃堕棿")
     private Date uploadTime;
 
@@ -266,4 +266,16 @@
 
     @ApiModelProperty(value = "鏄惁缁撴潫 0锛氫笉缁撴潫   1锛氱粨鏉�")
     private Integer isEnd;
+
+    /**
+     * 閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d
+     */
+    @ApiModelProperty(value = "閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d")
+    private Integer sendTaskid;
+
+    /**
+     * 鏈嶅姟鐨勫悕绉�
+     */
+    @ApiModelProperty(value = "鏈嶅姟鐨勫悕绉�")
+    private String sendTaskname;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java b/smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java
index c9b1631..9ca7178 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java
@@ -24,12 +24,20 @@
 
     @ApiModelProperty(value = "寮傚父鏍囪瘑")
     private String excep;
+
     private String guid;
+
     private String orgid;
 
     @ApiModelProperty(value = "璇曞嵎绫诲瀷:1 闅忚   2 闂嵎")
     private Integer type;
 
+    /**
+     * 寮傚父棰勮锛�0缁胯壊锛�1绾㈣壊锛�2榛勮壊
+     */
+    @ApiModelProperty(value = "寮傚父棰勮锛�0缁胯壊锛�1绾㈣壊锛�2榛勮壊")
+    private Integer isabnormal;
+
     @ApiModelProperty(value = "闂缁撴灉璇︽儏")
     private List<ServiceSubtaskDetail> serviceSubtaskDetailList;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
index 5d7a07b..5730755 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -633,19 +633,15 @@
     @ApiModelProperty(value = "ps")
     private Integer ps;
 
-
-    /**
-     * 鎮h�呮潵婧�
-     */
     @ApiModelProperty(value = "缁忕鍖荤敓缂栫爜")
     private String managementDoctorCode;
 
-    /**
-     * 鎮h�呮潵婧�
-     */
     @ApiModelProperty(value = "缁忕鍖荤敓")
     private String managementDoctor;
 
     @ApiModelProperty(value = "闅忚鎯呭喌:1姝e父璇煶,2鎮h�呮嫆鎺ユ垨鎷掕,3闈㈣鎴栬�呮帴璇�,4寰俊闅忚,5闅忚鐢佃瘽涓嶆纭�,6鍏朵粬")
     private Integer taskSituation;
+
+    @ApiModelProperty(value = "寮傚父棰勮锛�0缁胯壊锛�1绾㈣壊锛�2榛勮壊")
+    private Integer isabnormal;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java
index 74f92f7..3ad9f22 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java
@@ -23,8 +23,12 @@
     private Long userId;
 
     private Integer visitCount;
+
     private Integer isVisitAgain;
 
+    @ApiModelProperty(value = "寮傚父棰勮锛�0缁胯壊锛�1绾㈣壊锛�2榛勮壊")
+    private Integer isabnormal;
+
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "寮�濮嬫椂闂�")
     private Date startTime;
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
index 518cdf7..a2c3c76 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
@@ -681,7 +681,6 @@
      * 缁撴潫鍑洪櫌鏃ユ湡
      */
     @ApiModelProperty(value = "缁撴潫鍑洪櫌鏃ユ湡")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date endOutHospTime;
 
     /**
@@ -730,6 +729,9 @@
     @ApiModelProperty(value = "闅忚閮ㄩ棬鍚嶇О")
     private String visitDeptName;
 
+    @ApiModelProperty(value = "寮傚父棰勮锛�0缁胯壊锛�1绾㈣壊锛�2榛勮壊")
+    private Integer isabnormal;
+
     @ApiModelProperty(value = "闅忚閮ㄩ棬缂栫爜闆嗗悎")
     private List<String> visitDeptCodes;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java
index 21f5c52..601bfed 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java
@@ -266,4 +266,15 @@
     @ApiModelProperty(value = "閫変腑鎻愮ず")
     private String prompt;
 
+    /**
+     * 閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d
+     */
+    @ApiModelProperty(value = "閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d")
+    private Integer sendTaskid;
+
+    /**
+     * 鏈嶅姟鐨勫悕绉�
+     */
+    @ApiModelProperty(value = "鏈嶅姟鐨勫悕绉�")
+    private String sendTaskname;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
index c624c18..73578d3 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -332,6 +332,8 @@
     @ApiModelProperty(value = "缁勫埆")
     private String groupName;
 
+    @ApiModelProperty(value = "閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d闆嗗悎")
+    private List<Integer> sendTaskids;
 
     /**
      * 璇濇湳閫夐」
diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java
index 5439ba9..2cf154d 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java
@@ -230,6 +230,18 @@
     private Integer isoperation;
 
     /**
+     * 閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d
+     */
+    @ApiModelProperty(value = "閫変腑璇ラ�夐」鍚庯紝闇�瑕佺粰褰撳墠鎮h�呯珛鍗冲彂閫佺殑鏈嶅姟鐨刬d")
+    private Integer sendTaskid;
+
+    /**
+     * 鏈嶅姟鐨勫悕绉�
+     */
+    @ApiModelProperty(value = "鏈嶅姟鐨勫悕绉�")
+    private String sendTaskname;
+
+    /**
      * 閫夐」缁彿
      */
     @ApiModelProperty(value = "閫夐」缁彿")
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 0c5b3cb..fe021e6 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -1,5 +1,8 @@
 package com.smartor.service.impl;
 
+import com.alibaba.fastjson2.JSON;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DtoConversionUtils;
@@ -18,6 +21,7 @@
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
 
 /**
  * 浠诲姟闂嵎闂閫夐」Service涓氬姟灞傚鐞�
@@ -198,7 +202,7 @@
                         }
 
                     } else {
-                        SvyTaskTemplateScriptVO svyTaskTemplateScriptVO =cacheList.get(i);
+                        SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = cacheList.get(i);
 //                        SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(cacheList.get(i), SvyTaskTemplateScriptVO.class);
                         List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(i).getSvyTaskTemplateTargetoptions();
 //                        List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(cacheList.get(i).getSvyTaskTemplateTargetoptions(), SvyTaskTemplateTargetoption.class);
@@ -278,6 +282,7 @@
             serviceSubtask.setTaskid(tid);
             serviceSubtask.setPatid(pid);
             serviceSubtask.setSubmit(1L);
+            serviceSubtask.setIsabnormal(serviceSubTaskAnswerReq.getIsabnormal());
             serviceSubtask.setSendstate(6L);
             serviceSubtask.setExcep(serviceSubTaskAnswerReq.getExcep());
             serviceSubtask.setFinishtime(new Date());
@@ -367,7 +372,7 @@
                 } else {
                     SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = svyTaskTemplateScriptVOS.get(i);
 //                    SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(svyLibTemplateScriptVOS.get(i), SvyTaskTemplateScriptVO.class);
-                    List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions =svyTaskTemplateScriptVOS.get(i).getSvyTaskTemplateTargetoptions();
+                    List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateScriptVOS.get(i).getSvyTaskTemplateTargetoptions();
 //                    List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(svyLibTemplateScriptVOS.get(i).getSvyLibTemplateTargetoptions(), SvyTaskTemplateTargetoption.class);
                     svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions);
 
@@ -665,10 +670,6 @@
             }
             serviceSubtaskDetailVO.setAsrtext(StringUtils.isEmpty(svyTaskTemplateScriptVO.getScriptResult()) ? "" : svyTaskTemplateScriptVO.getScriptResult().replaceAll("^\"|\"$", ""));
             serviceSubtaskDetailVO.setMatchedtext(StringUtils.isEmpty(svyTaskTemplateScriptVO.getScriptResult()) ? "" : svyTaskTemplateScriptVO.getScriptResult().replaceAll("^\"|\"$", ""));
-            //            if (StringUtils.isEmpty(serviceSubtaskDetailVO.getAsrtext())) {
-//                nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno().toString();
-//            }
-//            serviceSubtaskDetailVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions());
         } else {
             //闈炲崟澶氶��
             if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getScriptResult())) {
@@ -699,11 +700,86 @@
         ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class);
         serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
 
+        //濡備綍杩欓渶瑕佹湇鍔¤ˉ鍋跨殑鏈嶅姟ID涓嶄负绌虹殑璇濓紝鍒欒繘琛岀珛鍗冲彂閫�
+        if (CollectionUtils.isNotEmpty(svyTaskTemplateScriptVO.getSendTaskids()) && CollectionUtils.isNotEmpty(selectServiceSubtaskList)) {
+            sendTaskIds(svyTaskTemplateScriptVO.getSendTaskids(), selectServiceSubtaskList.get(0));
+        }
+
         Map<String, String> map = new HashMap<>();
         map.put("nextScriptNo", nextScriptNo);
         map.put("score", score);
         map.put("id", "" + serviceSubtaskDetail.getId());
         return map;
+    }
+
+    private Boolean sendTaskIds(List<Integer> sendTaskids, ServiceSubtask serviceSubtask) {
+        for (Integer taskId : sendTaskids) {
+            ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(Long.valueOf(taskId));
+            String content = sendMQContent(serviceTask, null);
+            //鍏堜慨鏀圭姸鎬�
+            insertServiceSubtask(serviceTask, new Date(), serviceSubtask);
+            //绔嬪嵆鍙戦��
+            redisCache.setCacheObject(content, content, 1, TimeUnit.SECONDS);
+            serviceTask.setStopState(null);
+            log.info("娑堟伅鍙戦�佹垚鍔�");
+        }
+        return null;
+    }
+
+
+    private void insertServiceSubtask(ServiceTask serviceTask, Date date, ServiceSubtask serviceSubtask) {
+        //鍙杩涘叆闃熷垪灏辩畻寰呭彂閫�
+        serviceSubtask.setTaskid(serviceTask.getTaskid());
+        serviceSubtask.setTaskName(serviceTask.getTaskName());
+        serviceSubtask.setLibtemplateid(StringUtils.isNotEmpty(serviceTask.getLibtemplateid()) ? Long.valueOf(serviceTask.getLibtemplateid()) : null);
+        serviceSubtask.setTemplatename(serviceTask.getTemplatename());
+        serviceSubtask.setTemplateid(serviceTask.getTemplateid());
+        serviceSubtask.setSendstate(2L);
+        serviceSubtask.setVisitTime(date);
+        serviceSubtask.setId(null);
+        serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
+
+        //璁剧疆鍙戦�佽ˉ鍋挎柟寮忥紙杩欎釜瀹屽叏鎸夌収鏈嶅姟鐨勫彂閫佹柟寮忔潵璧帮級
+        if (StringUtils.isNotEmpty(serviceTask.getPreachformDesc())) {
+            ObjectMapper objectMapper = new ObjectMapper();
+            try {
+                List<Map<String, Object>> pfList = objectMapper.readValue(serviceTask.getPreachformDesc(), List.class);
+                for (Map<String, Object> map : pfList) {
+                    ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform();
+                    serviceSubtaskPreachform.setSort(ObjectUtils.isEmpty(map.get("sort")) ? 0 : Long.valueOf(map.get("sort").toString()));
+                    serviceSubtaskPreachform.setPreachform(ObjectUtils.isEmpty(map.get("preachform")) ? "" : map.get("preachform").toString());
+                    serviceSubtaskPreachform.setCompensateTime(ObjectUtils.isEmpty(map.get("compensateTime")) ? "" : map.get("compensateTime").toString());
+                    serviceSubtaskPreachform.setTaskid(serviceTask.getTaskid());
+                    serviceSubtaskPreachform.setSubid(serviceSubtask.getId());
+                    //杩欎釜sendstate闇�瑕佸湪鏁版嵁搴撹缃竴涓粯璁ゅ�间负鈥�1鈥�
+                    serviceSubtaskPreachform.setSendstate("1");
+                    serviceSubtaskPreachform.setOrgid(serviceTask.getOrgid());
+                    serviceSubtaskPreachform.setCreateTime(new Date());
+                    serviceSubtaskPreachformMapper.insertServiceSubtaskPreachform(serviceSubtaskPreachform);
+                }
+            } catch (JsonProcessingException e) {
+                e.printStackTrace();
+            }
+
+        }
+
+
+    }
+
+    private String sendMQContent(ServiceTask serviceTask, TaskSendTimeVO sendTimeslot) {
+        CommonTaskcallMQ commonTaskcallMQ = new CommonTaskcallMQ();
+        commonTaskcallMQ.setTaskid(serviceTask.getTaskid());
+        commonTaskcallMQ.setSendType("2");
+        commonTaskcallMQ.setTemplateid(ObjectUtils.isNotEmpty(serviceTask.getTemplateid()) ? serviceTask.getTemplateid().toString() : null);
+        commonTaskcallMQ.setPreachform(serviceTask.getPreachform());
+        commonTaskcallMQ.setStopState(serviceTask.getStopState());
+        commonTaskcallMQ.setTaskType(StringUtils.isNotEmpty(serviceTask.getType()) ? Integer.valueOf(serviceTask.getType()) : null);
+        commonTaskcallMQ.setSendTimeslot(sendTimeslot);
+        commonTaskcallMQ.setUpdateSendstate(2);
+
+        String commonTaskcallMQJson = JSON.toJSONString(commonTaskcallMQ);
+        commonTaskcallMQJson = commonTaskcallMQJson.substring(1, commonTaskcallMQJson.length() - 1);
+        return commonTaskcallMQJson;
     }
 
     private Map<String, String> setSFInfo(IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, Long taskid, Long patid) {
@@ -764,6 +840,12 @@
         ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class);
         serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
 
+        //濡備綍杩欓渶瑕佹湇鍔¤ˉ鍋跨殑鏈嶅姟ID涓嶄负绌虹殑璇濓紝鍒欒繘琛岀珛鍗冲彂閫�
+        if (CollectionUtils.isNotEmpty(ivrTaskTemplateScriptVO.getSendTaskids()) && CollectionUtils.isNotEmpty(selectServiceSubtaskList)) {
+            sendTaskIds(ivrTaskTemplateScriptVO.getSendTaskids(), selectServiceSubtaskList.get(0));
+        }
+
+
         Map<String, String> map = new HashMap<>();
         map.put("nextScriptNo", nextScriptNo);
         map.put("score", score);
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
index a94d19a..48c6dee 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
@@ -39,11 +39,15 @@
         <result property="score" column="score"/>
         <result property="prompt" column="prompt"/>
         <result property="isEnd" column="is_end"/>
+        <result property="sendTaskid" column="send_taskid"/>
+        <result property="sendTaskname" column="send_taskname"/>
     </resultMap>
 
     <sql id="selectIvrLibaTemplateTargetoptionVo">
         select id,
                targetid,
+               send_taskid,
+               send_taskname,
                is_end,
                score,
                appendflag,
@@ -98,6 +102,8 @@
             <if test="appendflag != null">and appendflag = #{appendflag}</if>
             <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
             <if test="optionNo != null">and option_no = #{optionNo}</if>
+            <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if>
+            <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if>
         </where>
     </select>
 
@@ -143,6 +149,8 @@
             <if test="optionNo != null">option_no,</if>
             <if test="score != null">score,</if>
             <if test="isEnd != null ">is_end,</if>
+            <if test="sendTaskid != null">send_taskid,</if>
+            <if test="sendTaskname != null">send_taskname,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="targetid != null">#{targetid},</if>
@@ -177,6 +185,8 @@
             <if test="optionNo != null">#{optionNo},</if>
             <if test="score != null">#{score},</if>
             <if test="isEnd != null ">#{isEnd},</if>
+            <if test="sendTaskid != null">#{sendTaskid},</if>
+            <if test="sendTaskname != null">#{sendTaskname},</if>
         </trim>
     </insert>
 
@@ -215,6 +225,8 @@
             <if test="optionNo != null">option_no = #{optionNo},</if>
             <if test="score != null">score = #{score},</if>
             <if test="isEnd != null ">is_end = #{isEnd},</if>
+            <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if>
+            <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
index ce15a1c..2dca21e 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
@@ -42,11 +42,15 @@
         <result property="score" column="score"/>
         <result property="prompt" column="prompt"/>
         <result property="isEnd" column="is_end"/>
+        <result property="sendTaskid" column="send_taskid"/>
+        <result property="sendTaskname" column="send_taskname"/>
     </resultMap>
 
     <sql id="selectIvrTaskTemplateTargetoptionVo">
         select id,
                taskid,
+               send_taskid,
+               send_taskname,
                is_end,
                templateID,
                score,
@@ -102,6 +106,8 @@
             <if test="optionCode != null ">and option_code = #{optionCode}</if>
             <if test="isUserOperation != null ">and is_user_operation = #{isUserOperation}</if>
             <if test="score != null ">and score = #{score}</if>
+            <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if>
+            <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if>
         </where>
     </select>
 
@@ -150,6 +156,8 @@
             <if test="isUserOperation != null ">is_user_operation,</if>
             <if test="score != null ">score,</if>
             <if test="isEnd != null ">is_end,</if>
+            <if test="sendTaskid != null">send_taskid,</if>
+            <if test="sendTaskname != null">send_taskname,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="taskid != null">#{taskid},</if>
@@ -187,6 +195,8 @@
             <if test="isUserOperation != null ">#{isUserOperation},</if>
             <if test="score != null ">#{score},</if>
             <if test="isEnd != null ">#{isEnd},</if>
+            <if test="sendTaskid != null">#{sendTaskid},</if>
+            <if test="sendTaskname != null">#{sendTaskname},</if>
         </trim>
     </insert>
 
@@ -228,6 +238,8 @@
             <if test="isUserOperation != null ">is_user_operation = #{isUserOperation},</if>
             <if test="score != null ">score = #{score},</if>
             <if test="isEnd != null ">is_end = #{isEnd},</if>
+            <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if>
+            <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 6e2c64e..f7a491e 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -86,6 +86,7 @@
         <result property="managementDoctorCode" column="management_doctor_code"/>
         <result property="currentPreachform" column="current_preachform"/>
         <result property="taskSituation" column="task_situation"/>
+        <result property="isabnormal" column="isabnormal"/>
     </resultMap>
 
     <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2">
@@ -108,6 +109,7 @@
                management_doctor_code,
                current_preachform,
                upid,
+               isabnormal,
                visit_dept_name,
                visit_dept_code,
                visit_time,
@@ -361,6 +363,7 @@
             <if test="suggest != null">and suggest = #{suggest}</if>
             <if test="createBy != null">and create_by = #{createBy}</if>
             <if test="taskGuid != null">and task_guid = #{taskGuid}</if>
+            <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
             <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if>
             <!-- <if test="visitTime != null">and visit_time = #{visitTime}</if> -->
             <!--<if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
@@ -406,6 +409,7 @@
             <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if>
             <if test="managementDoctor != null">and management_doctor = #{managementDoctor}</if>
             <if test="currentPreachform != null">and current_preachform = #{currentPreachform}</if>
+            <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
         </where>
 
     </select>
@@ -462,6 +466,7 @@
             <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>
             <if test="currentPreachform != null">and current_preachform = #{currentPreachform}</if>
             <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if>
+            <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
             <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if>
         </where>
 
@@ -492,6 +497,7 @@
         <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
         <if test="deptcode != null  and deptcode != ''">and deptcode = #{deptcode}</if>
         <if test="deptname != null  and deptname != ''">and deptname = #{deptname}</if>
+        <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
         <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">and
             leavehospitaldistrictcode = #{leavehospitaldistrictcode}
         </if>
@@ -521,6 +527,7 @@
                 AND date_format(visit_time,'%y%m%d') <= date_format(#{endtime},'%y%m%d')
             </if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
+            <if test="isabnormal != null ">and isabnormal = #{isabnormal}</if>
             <if test="deptcode != null  and deptcode != ''">and deptcode = #{deptcode}</if>
             <if test="deptname != null  and deptname != ''">and deptname = #{deptname}</if>
             <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">and
@@ -627,6 +634,7 @@
             <if test="managementDoctor != null">management_doctor,</if>
             <if test="currentPreachform != null">current_preachform,</if>
             <if test="taskSituation != null">task_situation,</if>
+            <if test="isabnormal != null">isabnormal,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="sendname != null">#{sendname},</if>
@@ -712,6 +720,7 @@
             <if test="managementDoctor != null">#{managementDoctor},</if>
             <if test="currentPreachform != null">#{currentPreachform},</if>
             <if test="taskSituation != null">#{taskSituation},</if>
+            <if test="isabnormal != null">#{isabnormal},</if>
         </trim>
     </insert>
 
@@ -802,6 +811,7 @@
             <if test="managementDoctor != null">management_doctor=#{managementDoctor},</if>
             <if test="currentPreachform != null">current_preachform=#{currentPreachform},</if>
             <if test="taskSituation != null">task_situation=#{taskSituation},</if>
+            <if test="isabnormal != null">isabnormal=#{isabnormal},</if>
         </trim>
         where id = #{id}
     </update>
@@ -893,6 +903,7 @@
             <if test="managementDoctor != null">management_doctor=#{managementDoctor},</if>
             <if test="currentPreachform != null">current_preachform=#{currentPreachform},</if>
             <if test="taskSituation != null">task_situation=#{taskSituation},</if>
+            <if test="isabnormal != null">isabnormal=#{isabnormal},</if>
         </trim>
         <where>
             <if test="patid != null ">and patid = #{patid}</if>
@@ -986,6 +997,7 @@
             <if test="managementDoctor != null">management_doctor=#{managementDoctor},</if>
             <if test="currentPreachform != null">current_preachform=#{currentPreachform},</if>
             <if test="taskSituation != null">task_situation=#{taskSituation},</if>
+            <if test="isabnormal != null">isabnormal=#{isabnormal},</if>
         </trim>
         where patid = #{patid} and taskid = #{taskid}
     </update>
@@ -1076,6 +1088,7 @@
             <if test="managementDoctor != null">management_doctor=#{managementDoctor},</if>
             <if test="currentPreachform != null">current_preachform=#{currentPreachform},</if>
             <if test="taskSituation != null">task_situation=#{taskSituation},</if>
+            <if test="isabnormal != null">isabnormal=#{isabnormal},</if>
         </trim>
         where task_guid = #{taskGuid} and task_name = #{taskName}
     </update>
@@ -1129,13 +1142,15 @@
             </if>
             <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
             <if test="visitDeptName != null">abd visit_dept_name = #{visitDeptName}</if>
+            <if test="isabnormal != null">abd isabnormal = #{isabnormal}</if>
         </where>
     </select>
 
     <select id="getSfStatisticsJoy" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
             resultMap="ServiceSubtaskResult2">
         SELECT sub_id as subTaskId,COUNT(sub_id) joyCount,
-             (SELECT COUNT(1) FROM ivr_liba_target WHERE assortid IN (SELECT config_value FROM sys_config WHERE config_key='joyCount')) joyAllCount
+        (SELECT COUNT(1) FROM ivr_liba_target WHERE assortid IN (SELECT config_value FROM sys_config WHERE
+        config_key='joyCount')) joyAllCount
         FROM service_subtask_detail a
         WHERE sub_id IN(SELECT id FROM service_subtask t
         <where>
@@ -1167,17 +1182,19 @@
             </if>
             <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
             <if test="visitDeptName != null">abd visit_dept_name = #{visitDeptName}</if>
+            <if test="isabnormal != null">abd isabnormal = #{isabnormal}</if>
         </where>
         )
-        AND targetid IN ( SELECT id FROM ivr_liba_target WHERE assortid IN (SELECT config_value FROM sys_config WHERE config_key='joyCount'))
+        AND targetid IN ( SELECT id FROM ivr_liba_target WHERE assortid IN (SELECT config_value FROM sys_config WHERE
+        config_key='joyCount'))
         GROUP BY sub_id
     </select>
 
     <select id="getSfStatisticsJoydetails" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
             resultMap="ServiceSubtaskResult2">
-        SELECT joyName,joyCount,joyAllCount,ROUND(joyCount/joyAllCount,2) joyTotal  FROM  (
+        SELECT joyName,joyCount,joyAllCount,ROUND(joyCount/joyAllCount,2) joyTotal FROM (
         SELECT targetname joyName,
-               (select COUNT(sub_id) FROM service_subtask_detail WHERE sub_id IN(SELECT id FROM service_subtask t
+        (select COUNT(sub_id) FROM service_subtask_detail WHERE sub_id IN(SELECT id FROM service_subtask t
         <where>
             del_flag=0
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
@@ -1210,33 +1227,33 @@
         WHERE sub_id IN(SELECT id FROM service_subtask t
         <where>
             del_flag=0
-        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">AND
-            leavehospitaldistrictcode IN
-            <foreach
-                    collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
-                     close=")">
-                #{leavehospitaldistrictcode}
-            </foreach>
-        </if>
-        <if test="deptcodes != null and deptcodes.size() > 0">
-            AND deptcode IN
-            <foreach collection="deptcodes" item="deptcode" open="(" separator=","
-                     close=")">
-                #{deptcode}
-            </foreach>
-        </if>
-        <if test="serviceType != null and serviceType.size() > 0">
-            AND service_type IN
-            <foreach collection="serviceType" item="serviceType" open="(" separator=","
-                     close=")">
-                #{serviceType}
-            </foreach>
-        </if>
+            <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">AND
+                leavehospitaldistrictcode IN
+                <foreach
+                        collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
+                        close=")">
+                    #{leavehospitaldistrictcode}
+                </foreach>
+            </if>
+            <if test="deptcodes != null and deptcodes.size() > 0">
+                AND deptcode IN
+                <foreach collection="deptcodes" item="deptcode" open="(" separator=","
+                         close=")">
+                    #{deptcode}
+                </foreach>
+            </if>
+            <if test="serviceType != null and serviceType.size() > 0">
+                AND service_type IN
+                <foreach collection="serviceType" item="serviceType" open="(" separator=","
+                         close=")">
+                    #{serviceType}
+                </foreach>
+            </if>
             <if test="startTime != null and endTime!=null">
                 AND date_format(visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')
                 AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
             </if>
-    </where>
+        </where>
         GROUP BY sub_id ) ) ta ) joyAllCount
         FROM ivr_liba_target a
         WHERE assortid IN (SELECT config_value FROM sys_config WHERE config_key=
@@ -1321,6 +1338,7 @@
                visitDeptName,
                management_doctor_code,
                management_doctor,
+               isabnormal,
                leaveicd10code
         FROM service_subtask,
              JSON_TABLE(send_time_slot, '$[*]' COLUMNS (
@@ -1432,24 +1450,24 @@
             </foreach>
         </if>
 
-<!--        GROUP BY-->
-<!--        <choose>-->
-<!--            <when test="timeType == 'day'">-->
-<!--                DATE_FORMAT(visit_time, '%Y-%m-%d')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'month'">-->
-<!--                DATE_FORMAT(visit_time, '%Y-%m')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'year'">-->
-<!--                DATE_FORMAT(visit_time, '%Y')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'week'">-->
-<!--                CONCAT(YEAR(visit_time), '-W', LPAD(WEEK(visit_time, 1), 2, '0'))-->
-<!--            </when>-->
-<!--            <otherwise>-->
-<!--                DATE_FORMAT(visit_time, '%Y-%m-%d')-->
-<!--            </otherwise>-->
-<!--        </choose>-->
+        <!--        GROUP BY-->
+        <!--        <choose>-->
+        <!--            <when test="timeType == 'day'">-->
+        <!--                DATE_FORMAT(visit_time, '%Y-%m-%d')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'month'">-->
+        <!--                DATE_FORMAT(visit_time, '%Y-%m')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'year'">-->
+        <!--                DATE_FORMAT(visit_time, '%Y')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'week'">-->
+        <!--                CONCAT(YEAR(visit_time), '-W', LPAD(WEEK(visit_time, 1), 2, '0'))-->
+        <!--            </when>-->
+        <!--            <otherwise>-->
+        <!--                DATE_FORMAT(visit_time, '%Y-%m-%d')-->
+        <!--            </otherwise>-->
+        <!--        </choose>-->
 
         UNION ALL
 
@@ -1502,24 +1520,24 @@
             </foreach>
         </if>
 
-<!--        GROUP BY-->
-<!--        <choose>-->
-<!--            <when test="timeType == 'day'">-->
-<!--                DATE_FORMAT(endtime, '%Y-%m-%d')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'month'">-->
-<!--                DATE_FORMAT(endtime, '%Y-%m')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'year'">-->
-<!--                DATE_FORMAT(endtime, '%Y')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'week'">-->
-<!--                CONCAT(YEAR(endtime), '-W', LPAD(WEEK(endtime, 1), 2, '0'))-->
-<!--            </when>-->
-<!--            <otherwise>-->
-<!--                DATE_FORMAT(endtime, '%Y-%m-%d')-->
-<!--            </otherwise>-->
-<!--        </choose>-->
+        <!--        GROUP BY-->
+        <!--        <choose>-->
+        <!--            <when test="timeType == 'day'">-->
+        <!--                DATE_FORMAT(endtime, '%Y-%m-%d')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'month'">-->
+        <!--                DATE_FORMAT(endtime, '%Y-%m')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'year'">-->
+        <!--                DATE_FORMAT(endtime, '%Y')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'week'">-->
+        <!--                CONCAT(YEAR(endtime), '-W', LPAD(WEEK(endtime, 1), 2, '0'))-->
+        <!--            </when>-->
+        <!--            <otherwise>-->
+        <!--                DATE_FORMAT(endtime, '%Y-%m-%d')-->
+        <!--            </otherwise>-->
+        <!--        </choose>-->
 
         UNION ALL
 
@@ -1563,24 +1581,24 @@
             </foreach>
         </if>
 
-<!--        GROUP BY-->
-<!--        <choose>-->
-<!--            <when test="timeType == 'day'">-->
-<!--                DATE_FORMAT(admitdate, '%Y-%m-%d')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'month'">-->
-<!--                DATE_FORMAT(admitdate, '%Y-%m')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'year'">-->
-<!--                DATE_FORMAT(admitdate, '%Y')-->
-<!--            </when>-->
-<!--            <when test="timeType == 'week'">-->
-<!--                CONCAT(YEAR(admitdate), '-W', LPAD(WEEK(admitdate, 1), 2, '0'))-->
-<!--            </when>-->
-<!--            <otherwise>-->
-<!--                DATE_FORMAT(admitdate, '%Y-%m-%d')-->
-<!--            </otherwise>-->
-<!--        </choose>-->
+        <!--        GROUP BY-->
+        <!--        <choose>-->
+        <!--            <when test="timeType == 'day'">-->
+        <!--                DATE_FORMAT(admitdate, '%Y-%m-%d')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'month'">-->
+        <!--                DATE_FORMAT(admitdate, '%Y-%m')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'year'">-->
+        <!--                DATE_FORMAT(admitdate, '%Y')-->
+        <!--            </when>-->
+        <!--            <when test="timeType == 'week'">-->
+        <!--                CONCAT(YEAR(admitdate), '-W', LPAD(WEEK(admitdate, 1), 2, '0'))-->
+        <!--            </when>-->
+        <!--            <otherwise>-->
+        <!--                DATE_FORMAT(admitdate, '%Y-%m-%d')-->
+        <!--            </otherwise>-->
+        <!--        </choose>-->
         ) AS combined_data
         GROUP BY timePeriod
         ORDER BY timePeriod DESC
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
index a2e5521..43e4337 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
@@ -41,11 +41,15 @@
         <result property="appenddesc" column="appenddesc"/>
         <result property="optionNo" column="option_no"/>
         <result property="prompt" column="prompt"/>
+        <result property="sendTaskid" column="send_taskid"/>
+        <result property="sendTaskname" column="send_taskname"/>
     </resultMap>
 
     <sql id="selectSvyLibTemplateTargetoptionVo">
         select id,
                groupid,
+               send_taskid,
+               send_taskname,
                score,
                prompt,
                option_no,
@@ -109,6 +113,8 @@
             <if test="appendflag != null">and appendflag = #{appendflag}</if>
             <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
             <if test="optionNo != null">and option_no = #{optionNo}</if>
+            <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if>
+            <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if>
         </where>
     </select>
 
@@ -156,6 +162,8 @@
             <if test="appenddesc != null">appenddesc,</if>
             <if test="optionNo != null">option_no,</if>
             <if test="prompt != null">prompt,</if>
+            <if test="sendTaskid != null">send_taskid,</if>
+            <if test="sendTaskname != null">send_taskname,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="groupid != null">#{groupid},</if>
@@ -193,6 +201,8 @@
             <if test="appenddesc != null">#{appenddesc},</if>
             <if test="optionNo != null">#{optionNo},</if>
             <if test="prompt != null">#{prompt},</if>
+            <if test="sendTaskid != null">#{sendTaskid},</if>
+            <if test="sendTaskname != null">#{sendTaskname},</if>
         </trim>
     </insert>
 
@@ -234,6 +244,8 @@
             <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
             <if test="optionNo != null">option_no = #{optionNo},</if>
             <if test="prompt != null">prompt = #{prompt},</if>
+            <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if>
+            <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml
index 758dec4..ce96a3d 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml
@@ -43,11 +43,15 @@
         <result property="score" column="score"/>
         <result property="score" column="score"/>
         <result property="prompt" column="prompt"/>
+        <result property="sendTaskid" column="send_taskid"/>
+        <result property="sendTaskname" column="send_taskname"/>
     </resultMap>
 
     <sql id="selectSvyTaskTemplateTargetoptionVo">
         select id,
                option_code,
+               send_taskid,
+               send_taskname,
                score,
                prompt,
                appendflag,
@@ -102,6 +106,8 @@
             <if test="optionCode != null">and option_code = #{optionCode}</if>
             <if test="appendflag != null">and appendflag = #{appendflag}</if>
             <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
+            <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if>
+            <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if>
         </where>
     </select>
 
@@ -151,7 +157,8 @@
             <if test="appenddesc != null">appenddesc,</if>
             <if test="score != null">score,</if>
             <if test="prompt != null">prompt,</if>
-
+            <if test="sendTaskid != null">send_taskid,</if>
+            <if test="sendTaskname != null">send_taskname,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="taskid != null">#{taskid},</if>
@@ -190,7 +197,8 @@
             <if test="appenddesc != null">#{appenddesc},</if>
             <if test="score != null">#{score},</if>
             <if test="prompt != null">#{prompt},</if>
-
+            <if test="sendTaskid != null">#{sendTaskid}</if>
+            <if test="sendTaskname != null">#{sendTaskname}</if>
         </trim>
     </insert>
 
@@ -233,6 +241,8 @@
             <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
             <if test="score != null">score = #{score},</if>
             <if test="prompt != null">score = #{prompt},</if>
+            <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if>
+            <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if>
         </trim>
         where id = #{id}
     </update>
--
Gitblit v1.9.3