liusheng
10 小时以前 e180e3a496d6f29d3a3b34016400de9d997c6bd9
省立同德满意度功能提交
已修改65个文件
已添加15个文件
4588 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailTraceController.java 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateScriptController.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/banner.txt 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/common/PinYinUtil.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/DTO/DetailTraceDealDTO.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/DTO/ServiceSubtaskDetailDTO.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaScriptAssort.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaScriptTargetoption.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskCacheReq.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtask.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailTrace.java 345 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskPreachform.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibScriptCategory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibScriptCategoryVO.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibScriptOption.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SysUserOrg.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/VO/DetailTraceDealVO.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionReqVO.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionResVO.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/VO/SatisfactionExceptConfigQuestionReqVO.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/VisitPlan.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/entity/PatSatisfactionDetailEntity.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/entity/ServiceSubtaskSatisfactionEntity.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateScriptMapper.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskDetailMapper.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskDetailTraceMapper.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/SvyLibTemplateScriptMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskDetailTraceService.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrLibaScriptAssortServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java 391 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java 311 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailTraceServiceImpl.java 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyLibScriptCategoryServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaScriptAssortMapper.xml 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml 653 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 171 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibScriptOptionMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml 132 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -118,9 +118,6 @@
    @Autowired
    private ISysConfigService configService;
    // åˆ›å»ºå›ºå®šå¤§å°çš„线程池
    private static final ExecutorService executorService = Executors.newFixedThreadPool(10);
    public RedisMqReceiver(RedisMessageListenerContainer listenerContainer) {
        super(listenerContainer);
    }
@@ -152,12 +149,12 @@
            ServiceTask serviceTask = new ServiceTask();
            serviceTask.setTaskid(Long.valueOf(commonTaskcallMQ.getTaskid()));
            //在问卷中,选中某个选项要进行服务补偿时,只是借用该服务的外壳,不对该服务有任务影响
            if (commonTaskcallMQ.getUpdateSendstate() == null || commonTaskcallMQ.getUpdateSendstate() == 1) {
                serviceTask.setSendState(5L);
                serviceTask.setFail(1L);
                serviceTaskMapper.updateServiceTask(serviceTask);
            }
//            //在问卷中,选中某个选项要进行服务补偿时,只是借用该服务的外壳,不对该服务有任务影响
//            if (commonTaskcallMQ.getUpdateSendstate() == null || commonTaskcallMQ.getUpdateSendstate() == 1) {
//                serviceTask.setSendState(5L);
//                serviceTask.setFail(1L);
//                serviceTaskMapper.updateServiceTask(serviceTask);
//            }
        } catch (Exception e) {
            Integer integer = redisCache.getCacheObject(commonTaskcallMQ.getTaskid().toString());
            if (integer != null && integer == 3) {
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java
@@ -1,23 +1,24 @@
package com.ruoyi.web.controller.smartor;
import java.util.List;
import java.util.Map;
import com.github.pagehelper.ISelect;
import com.ruoyi.common.annotation.AddOrgId;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.PageUtils;
import com.smartor.domain.VO.PatSatisfactionReqVO;
import com.smartor.domain.VO.PatSatisfactionResVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -155,4 +156,26 @@
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(patSatisfactionService.deletePatSatisfactionByIds(ids));
    }
    /**
     * æ‚£è€…满意度统计
     */
    @ApiOperation("患者满意度统计")
    @PostMapping("/statistics")
    public Map<String, Object> statistics(@RequestBody PatSatisfactionReqVO patSatisfactionReqVO) {
        //后端不做分页了,由前端做
        PatSatisfactionResVO statistics = patSatisfactionService.statistics(patSatisfactionReqVO);
        return getDataTable3(CollectionUtils.isNotEmpty(statistics.getPatSatisfactionDetailEntities()) ? statistics.getPatSatisfactionDetailEntities().size() : 0, statistics);
    }
    /**
     * æ‚£è€…满意度柱状图信息
     */
    @ApiOperation("患者满意度柱状图信息")
    @PostMapping("/satisfactionGraph")
    public Map<String, Object> satisfactionGraph(@RequestBody PatSatisfactionReqVO patSatisfactionReqVO) {
        Map<String, Object> patSatisfactionGraphResVOS = patSatisfactionService.satisfactionGraph(patSatisfactionReqVO);
        return getDataTable3(0, patSatisfactionGraphResVOS);
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java
@@ -129,6 +129,13 @@
        return toAjax(serviceSubtaskAnswerService.saveQuestionCache(serviceSubTaskCacheReq, 1L));
    }
    @ApiOperation("患者问题结果保存")
    @PostMapping("/savequestiondetail")
    public AjaxResult saveQuestionDetail(@RequestBody ServiceSubTaskCacheReq serviceSubTaskCacheReq) {
        log.info("【saveQuestionDetail-----saveQuestionCache】的prarm1:{},prarm2:{},type:{},prarm6:{}", serviceSubTaskCacheReq.getParam1(), serviceSubTaskCacheReq.getParam2(), serviceSubTaskCacheReq.getType(), serviceSubTaskCacheReq.getParam6());
        return toAjax(serviceSubtaskAnswerService.saveQuestionDetail(serviceSubTaskCacheReq, 0L));
    }
    @ApiOperation("患者问题结果记录(小程充外链)")
    @PostMapping("/saveQuestionAnswerXCH")
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailController.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.ServiceSubTaskCacheReq;
import com.smartor.domain.ServiceSubTaskDetailReq;
import com.smartor.domain.ServiceSubtask;
import com.smartor.domain.ServiceSubtaskDetail;
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailTraceController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,145 @@
package com.ruoyi.web.controller.smartor;
import com.ruoyi.common.annotation.AddOrgId;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.DTO.DetailTraceDealDTO;
import com.smartor.domain.ServiceSubtaskDetailTrace;
import com.smartor.domain.VO.DetailTraceDealVO;
import com.smartor.domain.VO.SatisfactionExceptConfigQuestionReqVO;
import com.smartor.service.IServiceSubtaskDetailTraceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
 * éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªController
 *
 * @author lihu
 * @date 2026-03-24
 */
@Slf4j
@Api("随访任务异常记录跟踪")
@RestController
@RequestMapping("/smartor/trace")
public class ServiceSubtaskDetailTraceController extends BaseController {
    @Autowired
    private IServiceSubtaskDetailTraceService serviceSubtaskDetailTraceService;
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªåˆ—è¡¨
     */
    @ApiOperation("查询随访任务异常记录跟踪列表")
    //@PreAuthorize("@ss.hasPermi('smartor:ltrace:list')")
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/list")
    public Map<String, Object> list(@RequestBody ServiceSubtaskDetailTrace serviceSubtaskDetailTrace) {
        Integer offset = PageUtils.getOffset(serviceSubtaskDetailTrace.getPageNum(), serviceSubtaskDetailTrace.getPageSize());
        serviceSubtaskDetailTrace.setPageNum(offset);
        List<ServiceSubtaskDetailTrace> list = serviceSubtaskDetailTraceService.selectServiceSubtaskDetailTtraceList(serviceSubtaskDetailTrace);
        serviceSubtaskDetailTrace.setPageNum(null);
        serviceSubtaskDetailTrace.setPageSize(null);
        List<ServiceSubtaskDetailTrace> total = serviceSubtaskDetailTraceService.selectServiceSubtaskDetailTtraceList(serviceSubtaskDetailTrace);
        return getDataTable3(CollectionUtils.isNotEmpty(total) ? total.size() : 0, list);
    }
    @ApiOperation("异常问题处理情况查询")
    //@PreAuthorize("@ss.hasPermi('smartor:ltrace:list')")
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/tracedeallist")
    public Map<String, Object> tracedeallist(@RequestBody DetailTraceDealVO detailTraceDealVO) {
        Integer offset = PageUtils.getOffset(detailTraceDealVO.getPageNum(), detailTraceDealVO.getPageSize());
        detailTraceDealVO.setPageNum(offset);
        List<DetailTraceDealDTO> list = serviceSubtaskDetailTraceService.tracedeallist(detailTraceDealVO);
        detailTraceDealVO.setPageNum(null);
        detailTraceDealVO.setPageSize(null);
        List<DetailTraceDealDTO> total = serviceSubtaskDetailTraceService.tracedeallist(detailTraceDealVO);
        return getDataTable3(CollectionUtils.isNotEmpty(total) ? total.size() : 0, list);
    }
    /**
     * èŽ·å–æ»¡æ„åº¦å¼‚å¸¸é…ç½®é¢˜ç›®
     */
    @ApiOperation("获取满意度异常配置题目")
    @PostMapping("/getSatisfactionExceptConfigQuestion")
    public Map<String, Object> getSatisfactionExceptConfigQuestion(@RequestBody SatisfactionExceptConfigQuestionReqVO questionReqVO) {
        log.info("获取满意度异常配置题目的入参: {}", questionReqVO);
        Map<String, Object> satisfactionExceptConfigQuestion = serviceSubtaskDetailTraceService.getSatisfactionExceptConfigQuestion(questionReqVO);
        return satisfactionExceptConfigQuestion;
    }
    /**
     * å¯¼å‡ºéšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªåˆ—è¡¨
     */
    @ApiOperation("导出随访任务异常记录跟踪列表")
    //@PreAuthorize("@ss.hasPermi('smartor:ltrace:export')")
    @Log(title = "随访任务异常记录跟踪", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ServiceSubtaskDetailTrace serviceSubtaskDetailTrace) {
        List<ServiceSubtaskDetailTrace> list = serviceSubtaskDetailTraceService.selectServiceSubtaskDetailTtraceList(serviceSubtaskDetailTrace);
        ExcelUtil<ServiceSubtaskDetailTrace> util = new ExcelUtil<ServiceSubtaskDetailTrace>(ServiceSubtaskDetailTrace.class);
        util.exportExcel(response, list, "随访任务异常记录跟踪数据");
    }
    /**
     * èŽ·å–éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªè¯¦ç»†ä¿¡æ¯
     */
    @ApiOperation("获取随访任务异常记录跟踪详细信息")
    //@PreAuthorize("@ss.hasPermi('smartor:ltrace:query')")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(serviceSubtaskDetailTraceService.selectServiceSubtaskDetailTtraceById(id));
    }
    /**
     * æ–°å¢žéšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     */
    @ApiOperation("新增随访任务异常记录跟踪")
    //@PreAuthorize("@ss.hasPermi('smartor:ltrace:add')")
    @Log(title = "随访任务异常记录跟踪", businessType = BusinessType.INSERT)
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/add")
    public AjaxResult add(@RequestBody ServiceSubtaskDetailTrace serviceSubtaskDetailTrace) {
        return toAjax(serviceSubtaskDetailTraceService.insertServiceSubtaskDetailTtrace(serviceSubtaskDetailTrace));
    }
    /**
     * ä¿®æ”¹éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     */
    @ApiOperation("修改随访任务异常记录跟踪")
    //@PreAuthorize("@ss.hasPermi('smartor:ltrace:edit')")
    @Log(title = "随访任务异常记录跟踪", businessType = BusinessType.UPDATE)
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody ServiceSubtaskDetailTrace serviceSubtaskDetailTrace) {
        return toAjax(serviceSubtaskDetailTraceService.updateServiceSubtaskDetailTtrace(serviceSubtaskDetailTrace));
    }
    /**
     * åˆ é™¤éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     */
    @ApiOperation("删除随访任务异常记录跟踪")
    //@PreAuthorize("@ss.hasPermi('smartor:ltrace:remove')")
    @Log(title = "随访任务异常记录跟踪", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceSubtaskDetailTraceService.deleteServiceSubtaskDetailTtraceByIds(ids));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateController.java
@@ -27,6 +27,7 @@
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * é—®å·æ¨¡æ¿Controller
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTemplateScriptController.java
@@ -7,17 +7,20 @@
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.ServiceSubtaskCountReq;
import com.smartor.domain.SvyLibTemplateScript;
import com.smartor.service.ISvyLibTemplateScriptService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
 * æ¨¡æ¿é—®å·é¢˜ç›®Controller
@@ -27,8 +30,7 @@
 */
@RestController
@RequestMapping("/smartor/svytemplatescript")
public class SvyLibTemplateScriptController extends BaseController
{
public class SvyLibTemplateScriptController extends BaseController {
    @Autowired
    private ISvyLibTemplateScriptService svyLibTemplateScriptService;
@@ -36,12 +38,16 @@
     * æŸ¥è¯¢æ¨¡æ¿é—®å·é¢˜ç›®åˆ—表
     */
    //@PreAuthorize("@ss.hasPermi('system:script:list')")
    @GetMapping("/list")
    public TableDataInfo list(SvyLibTemplateScript svyLibTemplateScript)
    {
        startPage();
    @PostMapping("/list")
    public Map<String, Object> list(SvyLibTemplateScript svyLibTemplateScript) {
        Integer offset = PageUtils.getOffset(svyLibTemplateScript.getPageNum(), svyLibTemplateScript.getPageSize());
        svyLibTemplateScript.setPageNum(offset);
        List<SvyLibTemplateScript> list = svyLibTemplateScriptService.selectSvyLibTemplateScriptList(svyLibTemplateScript);
        return getDataTable(list);
        svyLibTemplateScript.setPageNum(null);
        svyLibTemplateScript.setPageSize(null);
        List<SvyLibTemplateScript> count = svyLibTemplateScriptService.selectSvyLibTemplateScriptList(svyLibTemplateScript);
        return getDataTable3(CollectionUtils.isNotEmpty(count) ? Long.valueOf(count.size()) : 0L, list);
    }
    /**
@@ -50,8 +56,7 @@
    //@PreAuthorize("@ss.hasPermi('system:script:export')")
    @Log(title = "模板问卷题目", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SvyLibTemplateScript svyLibTemplateScript)
    {
    public void export(HttpServletResponse response, SvyLibTemplateScript svyLibTemplateScript) {
        List<SvyLibTemplateScript> list = svyLibTemplateScriptService.selectSvyLibTemplateScriptList(svyLibTemplateScript);
        ExcelUtil<SvyLibTemplateScript> util = new ExcelUtil<SvyLibTemplateScript>(SvyLibTemplateScript.class);
        util.exportExcel(response, list, "模板问卷题目数据");
@@ -62,8 +67,7 @@
     */
    //@PreAuthorize("@ss.hasPermi('system:script:query')")
    @GetMapping(value = "/{topicid}")
    public AjaxResult getInfo(@PathVariable("topicid") Long topicid)
    {
    public AjaxResult getInfo(@PathVariable("topicid") Long topicid) {
        return success(svyLibTemplateScriptService.selectSvyLibTemplateScriptByTopicid(topicid));
    }
@@ -74,8 +78,7 @@
    @Log(title = "模板问卷题目", businessType = BusinessType.INSERT)
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/add")
    public AjaxResult add(@RequestBody SvyLibTemplateScript svyLibTemplateScript)
    {
    public AjaxResult add(@RequestBody SvyLibTemplateScript svyLibTemplateScript) {
        SysUser user = getLoginUser().getUser();
        svyLibTemplateScript.setOrgid(user.getOrgid());
        return toAjax(svyLibTemplateScriptService.insertSvyLibTemplateScript(svyLibTemplateScript));
@@ -88,8 +91,7 @@
    @Log(title = "模板问卷题目", businessType = BusinessType.UPDATE)
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody SvyLibTemplateScript svyLibTemplateScript)
    {
    public AjaxResult edit(@RequestBody SvyLibTemplateScript svyLibTemplateScript) {
        return toAjax(svyLibTemplateScriptService.updateSvyLibTemplateScript(svyLibTemplateScript));
    }
@@ -98,9 +100,8 @@
     */
    //@PreAuthorize("@ss.hasPermi('system:script:remove')")
    @Log(title = "模板问卷题目", businessType = BusinessType.DELETE)
    @DeleteMapping("/{topicids}")
    public AjaxResult remove(@PathVariable Long[] topicids)
    {
    @DeleteMapping("/{topicids}")
    public AjaxResult remove(@PathVariable Long[] topicids) {
        return toAjax(svyLibTemplateScriptService.deleteSvyLibTemplateScriptByTopicids(topicids));
    }
ruoyi-admin/src/main/resources/banner.txt
@@ -1,24 +1,10 @@
Application Version: ${ruoyi.version}
Spring Boot Version: ${spring-boot.version}
////////////////////////////////////////////////////////////////////
//                          _ooOoo_                               //
//                         o8888888o                              //
//                         88" . "88                              //
//                         (| ^_^ |)                              //
//                         O\  =  /O                              //
//                      ____/`---'\____                           //
//                    .'  \\|     |//  `.                         //
//                   /  \\|||  :  |||//  \                        //
//                  /  _||||| -:- |||||-  \                       //
//                  |   | \\\  -  /// |   |                       //
//                  | \_|  ''\---/''  |   |                       //
//                  \  .-\__  `-`  ___/-. /                       //
//                ___`. .'  /--.--\  `. . ___                     //
//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
//      ========`-.____`-.___\_____/___.-`____.-'========         //
//                           `=---='                              //
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
//             ä½›ç¥–保佑       æ°¸ä¸å®•机      æ°¸æ— BUG               //
////////////////////////////////////////////////////////////////////
         â–ˆâ–ˆâ•—  â–ˆâ–ˆâ•—   â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—    â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—
         â–ˆâ–ˆâ•‘  â–ˆâ–ˆâ•‘   â–ˆâ–ˆâ•”══██╗   â–ˆâ–ˆâ•”════╝
         â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•‘   â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•”╝   â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—
         â–ˆâ–ˆâ•”══██║   â–ˆâ–ˆâ•”══██╗   â•šâ•â•â•â•â–ˆâ–ˆâ•—
         â–ˆâ–ˆâ•‘  â–ˆâ–ˆâ•‘   â–ˆâ–ˆâ•‘  â–ˆâ–ˆâ•‘   â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•”╝
         â•šâ•â•  â•šâ•â•   â•šâ•â•  â•šâ•â•   â•šâ•â•â•â•â•â•
           äº¥          å°”          æ—¶
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
@@ -96,12 +96,13 @@
        rspData.setTotal(total);
        return rspData;
    }
    protected Map<String,Object> getDataTable3(long total, List<?> list) {
        Map<String,Object> rspData = new TreeMap<>();
        rspData.put("code",HttpStatus.SUCCESS);
        rspData.put("msg","查询成功");
        rspData.put("rows",list);
        rspData.put("total",total);
    protected Map<String, Object> getDataTable3(long total, Object object) {
        Map<String, Object> rspData = new TreeMap<>();
        rspData.put("code", HttpStatus.SUCCESS);
        rspData.put("msg", "查询成功");
        rspData.put("rows", object);
        rspData.put("total", total);
        return rspData;
    }
@@ -201,6 +202,7 @@
    public String getUsername() {
        return getLoginUser().getUsername();
    }
    /**
     * èŽ·å–æœºæž„ID
     */
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
@@ -17,10 +17,7 @@
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * ç”¨æˆ·å¯¹è±¡ sys_user
@@ -255,11 +252,25 @@
    @ApiModelProperty("科室集合")
    private List<Map<String, Object>> belongDepts = new ArrayList();
    /**
     * æ»¡æ„åº¦åˆ†ç±»
     */
    @ApiModelProperty("满意度分类(问卷/语音)")
    private Map<String, Object> satisfactionCategories = new HashMap<>();
    public SysUser() {
    }
    public Map<String, Object> getSatisfactionCategories() {
        return satisfactionCategories;
    }
    public void setSatisfactionCategories(Map<String, Object> satisfactionCategories) {
        this.satisfactionCategories = satisfactionCategories;
    }
    public List<Map<String, Object>> getBelongWards() {
        return this.belongWards;
    }
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -108,9 +108,10 @@
                // è¿‡æ»¤è¯·æ±‚
                .authorizeRequests()
                // å¯¹äºŽç™»å½•login æ³¨å†Œregister éªŒè¯ç captchaImage å…è®¸åŒ¿åè®¿é—®
                .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("/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("/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("/smartor/organization/list").permitAll()
                // é™¤ä¸Šé¢å¤–的所有请求全部需要鉴权认证
                .anyRequest().authenticated().and().headers().frameOptions().disable();
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
@@ -59,7 +59,7 @@
    <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
        <include refid="selectGenTableVo"/>
        where 1=1
        where
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
        </if>
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -1045,10 +1045,8 @@
                serviceSubtaskPreachform.setPreachform(nextPreachform);
                serviceSubtaskPreachformMapper.updateSSPByCondition(serviceSubtaskPreachform);
            }
            return nextPreachform;
        }
        return null;
    }
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -14,8 +14,12 @@
import com.ruoyi.system.mapper.*;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
import com.smartor.domain.IvrLibaScriptAssort;
import com.smartor.domain.SvyLibScriptCategory;
import com.smartor.domain.SvyTaskVO;
import com.smartor.domain.SysUserOrg;
import com.smartor.mapper.IvrLibaScriptAssortMapper;
import com.smartor.mapper.SvyLibScriptCategoryMapper;
import com.smartor.mapper.SysUserDeptMapper;
import com.smartor.mapper.SysUserOrgMapper;
import org.slf4j.Logger;
@@ -51,6 +55,12 @@
    @Autowired
    private SysUserDeptMapper sysUserDeptMapper;
    @Autowired
    private IvrLibaScriptAssortMapper ivrLibaScriptAssortMapper;
    @Autowired
    private SvyLibScriptCategoryMapper svyLibScriptCategoryMapper;
    @Autowired
    private SysRoleMapper roleMapper;
@@ -287,7 +297,43 @@
                if (StringUtils.isNotEmpty(sud.getDeptName())) map.put("deptName", sud.getDeptName());
                list.add(map);
            }
            //获取当前机构的满意度问题分类
            sysUser.setBelongDepts(list);
            Map<String, Object> satisfactionCategories = new HashMap<>();
            //获取语音问题分类
            IvrLibaScriptAssort ivrLibaScriptAssort = new IvrLibaScriptAssort();
            ivrLibaScriptAssort.setOrgid(sysUser.getOrgid());
            ivrLibaScriptAssort.setType("myd");
            List<IvrLibaScriptAssort> ivrLibaScriptAssorts = ivrLibaScriptAssortMapper.selectIvrLibaScriptAssortList(ivrLibaScriptAssort);
            List<Map<String, Object>> categoryList = new ArrayList<>();
            if (!CollectionUtils.isEmpty(ivrLibaScriptAssorts)) {
                for (IvrLibaScriptAssort assort : ivrLibaScriptAssorts) {
                    Map<String, Object> map = new HashMap<>();
                    map.put("categoryid", assort.getId());
                    map.put("categoryName", assort.getIndexAssortName());
                    categoryList.add(map);
                }
            }
            satisfactionCategories.put("voiceCategories", categoryList);
            //获取问卷问题分类
            SvyLibScriptCategory svyLibScriptCategory = new SvyLibScriptCategory();
            svyLibScriptCategory.setOrgid(sysUser.getOrgid());
            svyLibScriptCategory.setType("myd");
            List<SvyLibScriptCategory> svyLibScriptCategories = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory);
            List<Map<String, Object>> questionnaireCategorys = new ArrayList<>();
            if (!CollectionUtils.isEmpty(svyLibScriptCategories)) {
                for (SvyLibScriptCategory scriptCategory : svyLibScriptCategories) {
                    Map<String, Object> map = new HashMap<>();
                    map.put("categoryid", scriptCategory.getId());
                    map.put("categoryName", scriptCategory.getName());
                    questionnaireCategorys.add(map);
                }
            }
            satisfactionCategories.put("questionnaireCategorys", CollectionUtils.isEmpty(questionnaireCategorys) ? null : questionnaireCategorys);
            //设置当前用户的声音问题分类和问卷问题分类
            sysUser.setSatisfactionCategories(satisfactionCategories);
        }
        return sysUser;
    }
smartor/src/main/java/com/smartor/common/PinYinUtil.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
package com.smartor.common;
/**
 * @author ls
 * @content
 * @date 2026/4/1
 */
public class PinYinUtil {
    /**
     * èŽ·å–æ‹¼éŸ³
     * @param name
     * @return
     */
    public static String getpy(String name) {
        if (name == null || name.isEmpty()) return "";
        StringBuilder sb = new StringBuilder();
        for (char c : name.toCharArray()) {
            if (c >= '\u4e00' && c <= '\u9fa5') {
                sb.append(getFirstPinyinLetter(c));
            } else if (Character.isLetter(c)) {
                sb.append(Character.toLowerCase(c));
            }
        }
        return sb.toString();
    }
    /**
     * æ ¹æ®æ±‰å­— GBK ç¼–码区间返回对应拼音首字母(常用汉字覆盖率 > 99%)
     */
    private static char getFirstPinyinLetter(char c) {
        try {
            byte[] bytes = String.valueOf(c).getBytes("GBK");
            if (bytes.length == 2) {
                int hb = bytes[0] & 0xFF;
                int lb = bytes[1] & 0xFF;
                int gbk = (hb << 8) | lb;
                if (gbk >= 0xB0A1 && gbk <= 0xB0C4) return 'a';
                if (gbk >= 0xB0C5 && gbk <= 0xB2C0) return 'b';
                if (gbk >= 0xB2C1 && gbk <= 0xB4ED) return 'c';
                if (gbk >= 0xB4EE && gbk <= 0xB6E9) return 'd';
                if (gbk >= 0xB6EA && gbk <= 0xB7A1) return 'e';
                if (gbk >= 0xB7A2 && gbk <= 0xB8C0) return 'f';
                if (gbk >= 0xB8C1 && gbk <= 0xB9FD) return 'g';
                if (gbk >= 0xB9FE && gbk <= 0xBBF6) return 'h';
                if (gbk >= 0xBBF7 && gbk <= 0xBFA5) return 'j';
                if (gbk >= 0xBFA6 && gbk <= 0xC0AB) return 'k';
                if (gbk >= 0xC0AC && gbk <= 0xC2E7) return 'l';
                if (gbk >= 0xC2E8 && gbk <= 0xC4C2) return 'm';
                if (gbk >= 0xC4C3 && gbk <= 0xC5B5) return 'n';
                if (gbk >= 0xC5B6 && gbk <= 0xC5BD) return 'o';
                if (gbk >= 0xC5BE && gbk <= 0xC6D9) return 'p';
                if (gbk >= 0xC6DA && gbk <= 0xC8BA) return 'q';
                if (gbk >= 0xC8BB && gbk <= 0xC8F5) return 'r';
                if (gbk >= 0xC8F6 && gbk <= 0xCBF0) return 's';
                if (gbk >= 0xCBFA && gbk <= 0xCDD9) return 't';
                if (gbk >= 0xCDDA && gbk <= 0xCEF3) return 'w';
                if (gbk >= 0xCEF4 && gbk <= 0xD188) return 'x';
                if (gbk >= 0xD1B9 && gbk <= 0xD4D0) return 'y';
                if (gbk >= 0xD4D1 && gbk <= 0xD7F9) return 'z';
            }
        } catch (Exception ignored) {
        }
        return c;
    }
}
smartor/src/main/java/com/smartor/domain/DTO/DetailTraceDealDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,85 @@
package com.smartor.domain.DTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * æ»¡æ„åº¦å¼‚常处理情况请求对象
 *
 * @author lihu
 * @date 2026-03-24
 */
@Data
@ApiModel("满意度异常处理情况响应对象")
public class DetailTraceDealDTO extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * é—®é¢˜å†…容
     */
    @ApiModelProperty("问题内容")
    @Excel(name = "问题内容")
    private String questiontext;
    /**
     * [{
     *        "deptName": "科室名称",
     *        "deptCode": "科室编号"
     *     },
     * {
     *       "deptName": "科室名称",
     *       "deptCode": "科室编号"
     *     }
     * ]
     */
    @ApiModelProperty("负责科室")
    @Excel(name = "负责科室")
    private List<Map<String, Object>> responsibleDept;
    /**
     * {
     *        "effectiveFillNum": "有效填写",
     *       "exceptionFillNum": "异常填写"
     *     }
     */
    @ApiModelProperty("填写情况")
    @Excel(name = "填写情况")
    private Map<String, Object> fillSituation;
    /**
     * {
     *        "yesDeal": "已处理异常数据量",
     *        "noDeal": "未处理异常数据量"
     *        "all": "总异常数据量"
     *     }
     */
    @ApiModelProperty("异常问题处理数量")
    @Excel(name = "异常问题处理数量")
    private Map<String, Object> exceptionQuesNum;
    /**
     * å¤„理人
     */
    @ApiModelProperty("最新处理人")
    @Excel(name = "处理人")
    private String handleBy;
    /**
     * å¤„理时间
     */
    @ApiModelProperty("最新处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date handleTime;
}
smartor/src/main/java/com/smartor/domain/DTO/ServiceSubtaskDetailDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
package com.smartor.domain.DTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * è¯­éŸ³ä»»åŠ¡å‘¼å«æ˜Žç»†å¯¹è±¡ ivr_taskcalldetail
 *
 * @author smartor
 * @date 2023-03-24
 */
@Data
@ApiModel(value = "ServiceSubtaskDetailDTO", description = "问题回答明细")
public class ServiceSubtaskDetailDTO extends BaseEntity {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    private Long id;
    @ApiModelProperty(value = "问题文本")
    private String questiontext;
    @ApiModelProperty(value = "通过正则解析的值")
    private String matchedtext;
    @ApiModelProperty(value = "问题id")
    private Long scriptid;
    @ApiModelProperty(value = "指标值(该问题的所有选项内容用”&“分割)")
    private String targetvalue;
    @ApiModelProperty(value = "分数")
    private String score;
}
smartor/src/main/java/com/smartor/domain/IvrLibaScriptAssort.java
@@ -52,6 +52,13 @@
    @ApiModelProperty("序号")
    @Excel(name = "序号")
    private Integer seqno;
    /**
     * é—®é¢˜ç±»åž‹ï¼ˆä¾‹å¦‚,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...
     */
    @ApiModelProperty("问题类型(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...")
    @Excel(name = "问题类型(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...")
    private String type;
}
smartor/src/main/java/com/smartor/domain/IvrLibaScriptTargetoption.java
@@ -134,10 +134,10 @@
    private String groupid;
    /**
     * æ˜¯å¦å¼‚常标识
     * æ˜¯å¦å¼‚常标识:0正常  1异常  2警告
     */
    @ApiModelProperty("是否异常标识")
    @Excel(name = "是否异常标识")
    @ApiModelProperty("是否异常标识:0正常  1异常  2警告")
    @Excel(name = "是否异常标识:0正常  1异常  2警告")
    private Long isabnormal;
    /**
@@ -218,4 +218,11 @@
    @ApiModelProperty(value = "是否结束 0:不结束   1:结束")
    private Integer isEnd;
    /**
     * é—®é¢˜id
     */
    @Excel(name = "异常选项:1否(默认)    2是")
    @ApiModelProperty(value = "异常选项:1否(默认)    2是")
    private Long isException;
}
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java
@@ -37,11 +37,18 @@
    private Long scriptno;
    /**
     * ç±»åˆ«ID
     * è¯­éŸ³é—®é¢˜ç±»åˆ«ID(对应的是ivr_liba_script_ssort)
     */
    @Excel(name = "类别ID")
    @ApiModelProperty(value = "类别ID")
    private Long assortid;
    @Excel(name = "语音问题类别ID(对应的是ivr_liba_script_ssort)")
    @ApiModelProperty(value = "语音问题类别ID(对应的是ivr_liba_script_ssort)")
    private Long scriptAssortid;
    /**
     * è¯­éŸ³é—®é¢˜ç±»åˆ«åç§°ï¼ˆå¯¹åº”的是ivr_liba_script_ssort)
     */
    @Excel(name = "语音问题类别名称(对应的是ivr_liba_script_ssort)")
    @ApiModelProperty(value = "语音问题类别名称(对应的是ivr_liba_script_ssort)")
    private String scriptAssortname;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
@@ -87,8 +94,8 @@
    /**
     * é—®é¢˜ç±»åž‹
     */
    @Excel(name = "问题类型")
    @ApiModelProperty(value = "问题类型")
    @Excel(name = "问题类型(1.单选 2多选 3填空 4其它)")
    @ApiModelProperty(value = "问题类型(1.单选 2多选 3填空 4其它)")
    private String scriptType;
    /**
@@ -175,12 +182,8 @@
    @ApiModelProperty(value = "听不清话术语音")
    private String noClearlyVoice;
    /**
     * ç±»åˆ«å
     */
    @Excel(name = "类别名")
    @ApiModelProperty(value = "类别名")
    private String categoryName;
//    /**
//     * æŒ‡æ ‡é€‰é¡¹
@@ -317,6 +320,22 @@
    @ApiModelProperty(value = "组别")
    private String groupName;
    @Excel(name = "责任科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室名称(如果多个科室用逗号分割)")
    private String dutyDeptName;
    @Excel(name = "责任科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室编码(如果多个科室用逗号分割)")
    private String dutyDeptCode;
    @Excel(name = "报备科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室名称(如果多个科室用逗号分割)")
    private String reportDeptName;
    @Excel(name = "报备科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室编码(如果多个科室用逗号分割)")
    private String reportDeptCode;
//    /**
//     * é—®é¢˜ç»“果(给“值类型”是文本或者数值用的)
//     */
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
@@ -183,11 +183,20 @@
    private String categoryName;
    /**
     * ç±»åˆ«ID
     * è¯­éŸ³é—®é¢˜ç±»åˆ«ID(对应的是ivr_liba_script_ssort)
     */
    @Excel(name = "类别ID")
    @ApiModelProperty(value = "类别ID")
    private Long assortid;
    @Excel(name = "语音问题类别ID(对应的是ivr_liba_script_ssort)")
    @ApiModelProperty(value = "语音问题类别ID(对应的是ivr_liba_script_ssort)")
    private Long scriptAssortid;
    /**
     * è¯­éŸ³é—®é¢˜ç±»åˆ«åç§°ï¼ˆå¯¹åº”的是ivr_liba_script_ssort)
     */
    @Excel(name = "语音问题类别名称(对应的是ivr_liba_script_ssort)")
    @ApiModelProperty(value = "语音问题类别名称(对应的是ivr_liba_script_ssort)")
    private String scriptAssortname;
//    /**
//     * æŒ‡æ ‡é€‰é¡¹
@@ -350,6 +359,22 @@
    @ApiModelProperty(value = "通用库匹配的值")
    private String commonValue = "";
    @Excel(name = "责任科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室名称(如果多个科室用逗号分割)")
    private String dutyDeptName;
    @Excel(name = "责任科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室编码(如果多个科室用逗号分割)")
    private String dutyDeptCode;
    @Excel(name = "报备科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室名称(如果多个科室用逗号分割)")
    private String reportDeptName;
    @Excel(name = "报备科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室编码(如果多个科室用逗号分割)")
    private String reportDeptCode;
    /**
     * è¯æœ¯é€‰é¡¹
     */
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java
@@ -142,17 +142,17 @@
    private String groupid;
    /**
     * æ˜¯å¦å¼‚常标识
     * æ˜¯å¦å¼‚常标识:0正常  1异常  2警告
     */
    @Excel(name = "是否异常标识")
    @ApiModelProperty(value = "是否异常标识")
    @Excel(name = "是否异常标识:0正常  1异常  2警告")
    @ApiModelProperty(value = "是否异常标识:0正常  1异常  2警告")
    private Long isabnormal;
    /**
     * æ˜¯å¦å¼‚常标识
     * é€‰é¡¹åˆ†æ•°
     */
    @Excel(name = "是否异常标识")
    @ApiModelProperty(value = "是否异常标识")
    @Excel(name = "选项分数")
    @ApiModelProperty(value = "选项分数")
    private BigDecimal score;
//    /**
@@ -256,4 +256,11 @@
     */
    @ApiModelProperty(value = "服务的名称")
    private String sendTaskname;
    /**
     * é—®é¢˜id
     */
    @Excel(name = "异常选项:1否(默认)    2是")
    @ApiModelProperty(value = "异常选项:1否(默认)    2是")
    private Long isException;
}
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -143,19 +143,23 @@
    @ApiModelProperty(value = "听不清话术语音")
    private String noClearlyVoice;
    /**
     * ç±»åˆ«å
     */
    @Excel(name = "类别名")
    @ApiModelProperty(value = "类别名")
    private String categoryName;
    /**
     * ç±»åˆ«ID
     * è¯­éŸ³é—®é¢˜ç±»åˆ«åç§°ï¼ˆå¯¹åº”的是ivr_liba_script_ssort)
     */
    @Excel(name = "类别ID")
    @ApiModelProperty(value = "类别ID")
    private Long assortid;
    @Excel(name = "语音问题类别名称(对应的是ivr_liba_script_ssort)")
    @ApiModelProperty(value = "语音问题类别名称(对应的是ivr_liba_script_ssort)")
    private String scriptAssortname;
    /**
     * è¯­éŸ³é—®é¢˜ç±»åˆ«ID(对应的是ivr_liba_script_ssort)
     */
    @Excel(name = "语音问题类别ID(对应的是ivr_liba_script_ssort)")
    @ApiModelProperty(value = "语音问题类别ID(对应的是ivr_liba_script_ssort)")
    private Long scriptAssortid;
    /**
     * æŒ‡æ ‡é€‰é¡¹
@@ -311,6 +315,22 @@
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private Long nextScriptno;
    @Excel(name = "责任科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室名称(如果多个科室用逗号分割)")
    private String dutyDeptName;
    @Excel(name = "责任科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室编码(如果多个科室用逗号分割)")
    private String dutyDeptCode;
    @Excel(name = "报备科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室名称(如果多个科室用逗号分割)")
    private String reportDeptName;
    @Excel(name = "报备科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室编码(如果多个科室用逗号分割)")
    private String reportDeptCode;
    /**
     * é—®é¢˜é€‰é¡¹
     */
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -173,18 +173,18 @@
    private String groupName;
    /**
     * ç±»åˆ«å
     * è¯­éŸ³é—®é¢˜ç±»åˆ«åç§°ï¼ˆå¯¹åº”的是ivr_liba_script_ssort)
     */
    @Excel(name = "类别名")
    @ApiModelProperty(value = "类别名")
    private String categoryName;
    @Excel(name = "语音问题类别名称(对应的是ivr_liba_script_ssort)")
    @ApiModelProperty(value = "语音问题类别名称(对应的是ivr_liba_script_ssort)")
    private String scriptAssortname;
    /**
     * ç±»åˆ«ID
     * è¯­éŸ³é—®é¢˜ç±»åˆ«ID(对应的是ivr_liba_script_ssort)
     */
    @Excel(name = "类别ID")
    @ApiModelProperty(value = "类别ID")
    private Long assortid;
    @Excel(name = "语音问题类别ID(对应的是ivr_liba_script_ssort)")
    @ApiModelProperty(value = "语音问题类别ID(对应的是ivr_liba_script_ssort)")
    private Long scriptAssortid;
    /**
     * æŒ‡æ ‡é€‰é¡¹
     */
@@ -341,13 +341,29 @@
    private Integer sort;
    /**
     * å¼‚常预警:0绿色;1红色;2黄色
     * å¼‚常预警:0绿色; 1红色  2黄色;
     */
    @ApiModelProperty(value = "异常预警:0绿色;1红色;2黄色")
    @ApiModelProperty(value = "异常预警:0绿色; 1红色  2黄色;")
    private Long isabnormal;
    private List<Integer> sendTaskids;
    @Excel(name = "责任科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室名称(如果多个科室用逗号分割)")
    private String dutyDeptName;
    @Excel(name = "责任科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室编码(如果多个科室用逗号分割)")
    private String dutyDeptCode;
    @Excel(name = "报备科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室名称(如果多个科室用逗号分割)")
    private String reportDeptName;
    @Excel(name = "报备科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室编码(如果多个科室用逗号分割)")
    private String reportDeptCode;
    /**
     * è¯æœ¯é€‰é¡¹
     */
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java
@@ -145,10 +145,10 @@
    private String groupid;
    /**
     * æ˜¯å¦å¼‚常标识
     * æ˜¯å¦é¢„警标识
     */
    @Excel(name = "是否异常标识")
    @ApiModelProperty(value = "是否异常标识")
    @Excel(name = "是否异常标识:0正常  1异常  2警告")
    @ApiModelProperty(value = "是否异常标识:0正常  1异常  2警告")
    private Long isabnormal;
    /**
@@ -215,6 +215,13 @@
    private Long scriptid;
    /**
     * é—®é¢˜id
     */
    @Excel(name = "异常选项:1否(默认)    2是")
    @ApiModelProperty(value = "异常选项:1否(默认)    2是")
    private Long isException;
    /**
     * æ­£åˆ™å…³é”®å­—(含)
     */
    @Excel(name = "正则关键字(含)")
smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
@@ -144,7 +144,7 @@
     */
    @Excel(name = "科室编码")
    @ApiModelProperty("科室编码")
    private String deptCode;
    private String deptcode;
    /**
     * ç§‘室
smartor/src/main/java/com/smartor/domain/ServiceSubTaskCacheReq.java
@@ -34,5 +34,4 @@
    @ApiModelProperty(value = "试卷类型:1 éšè®¿   2 é—®å·")
    private Integer type;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -152,7 +152,7 @@
     * ä»»åŠ¡ç±»åž‹(门诊,住院,复诊…)
     */
    @Excel(name = "任务类型:1,机器人语音(随访)  2,问卷;3,通知(宣教)")
    @ApiModelProperty(value = "任务类型:1,机器人语音(随访)  2,问卷;3,宣教; 4.通知)")
    @ApiModelProperty(value = "任务类型:1,语音(随访)  2,问卷;3,宣教; 4.通知)")
    private String type;
    /**
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java
@@ -37,6 +37,9 @@
    @ApiModelProperty(value = "电话号码")
    private String phone;
    @ApiModelProperty(value = "分数")
    private String score;
    @ApiModelProperty(value = "操作人 ")
    private String operate;
@@ -58,7 +61,7 @@
    @ApiModelProperty(value = "回答时间")
    private Long answertime;
    @ApiModelProperty(value = "")
    @ApiModelProperty(value = "患者不响应(无响应):1否   2是")
    private Long silent;
    @ApiModelProperty(value = "")
@@ -97,6 +100,11 @@
    @ApiModelProperty(value = "模板问题编号")
    private Long templatequestionnum;
    @ApiModelProperty(value = "模板类型:1.语音 2.问卷")
    private Integer templateType;
    @ApiModelProperty(value = "基础模板ID")
    private Integer libTemplateid;
    @ApiModelProperty(value = "交换机ID")
    private Long switchid;
@@ -157,7 +165,7 @@
    @ApiModelProperty(value = "删除标记")
    private String delFlag;
    @ApiModelProperty(value = "问题类型")
    @ApiModelProperty(value = "问题类型(1.单选 2多选 3问答 4填空  5其它)")
    private String valueType;
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailTrace.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,345 @@
package com.smartor.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªå¯¹è±¡ service_subtask_detail_trace
 *
 * @author lihu
 * @date 2026-03-24
 */
@Data
@ApiModel("随访任务异常记录跟踪")
public class ServiceSubtaskDetailTrace extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * ä¸»é”®
     */
    @ApiModelProperty("主键")
    //数据库自增改成@TableId(type = IdType.AUTO)
    private Long id;
    /**
     * æ˜Žç»†id
     */
    @ApiModelProperty("明细id")
    @Excel(name = "明细id")
    private Long detailId;
    /**
     * å­ä»»åŠ¡ID
     */
    @ApiModelProperty("子任务ID")
    @Excel(name = "子任务ID")
    private Long subId;
    /**
     * ä»»åŠ¡ID
     */
    @ApiModelProperty("任务ID")
    @Excel(name = "任务ID")
    private Long taskid;
    /**
     * ä»»åŠ¡æ¨¡æ¿ID
     */
    @ApiModelProperty("任务模板ID")
    @Excel(name = "任务模板ID")
    private Long templateid;
    /**
     * ä»»åŠ¡æ¨¡æ¿é—®é¢˜é¢˜å·
     */
    @ApiModelProperty("任务模板问题题号")
    @Excel(name = "任务模板问题题号")
    private Long templatequestionnum;
    /**
     * é—®é¢˜é€‰é¡¹id
     */
    @ApiModelProperty("问题选项id")
    @Excel(name = "问题选项id")
    private Long switchid;
    /**
     * é—®é¢˜æ–‡æœ¬
     */
    @ApiModelProperty("问题文本  ")
    @Excel(name = "问题文本  ")
    private String questiontext;
    /**
     * é—®é¢˜è¯­éŸ³
     */
    @ApiModelProperty("问题语音  ")
    @Excel(name = "问题语音  ")
    private String questionvoice;
    /**
     * ç±»åˆ«
     */
    @ApiModelProperty("类别")
    @Excel(name = "类别")
    private String categoryname;
//    /** æŒ‡æ ‡é€‰é¡¹ */
//    @ApiModelProperty("指标选项")
//     @Excel(name = "指标选项")
//    private String targetoptions;
    /**
     * æŒ‡æ ‡id
     */
    @ApiModelProperty("指标id")
    @Excel(name = "指标id")
    private Long targetid;
    /**
     * æŒ‡æ ‡é€‰é¡¹å€¼ï¼ˆæ­£åˆ™åŒ¹é…çš„选项值)
     */
    @ApiModelProperty("指标选项值(正则匹配的选项值)")
    @Excel(name = "指标选项值", readConverterExp = "æ­£=则匹配的选项值")
    private String targetvalue;
    /**
     * é€šè¿‡æ­£åˆ™è§£æžçš„值
     */
    @ApiModelProperty("通过正则解析的值")
    @Excel(name = "通过正则解析的值")
    private String matchedtext;
    /**
     * æ‹¨å·uuid
     */
    @ApiModelProperty("拨号uuid")
    @Excel(name = "拨号uuid")
    private String uuid;
    /**
     * GUID
     */
    @ApiModelProperty("GUID")
    @Excel(name = "GUID")
    private String guid;
    /**
     * é—®é¢˜ç±»åž‹:语音、问卷
     */
    @ApiModelProperty("问题类型:语音、问卷")
    @Excel(name = "问题类型:(1.单选 2多选 3问答 4填空  5其它)")
    private String valueType;
    /**
     * é—®é¢˜ç±»åž‹:语音、问卷
     */
    @ApiModelProperty("问题类型:语音、问卷")
    @Excel(name = "模板类型:1.语音 2.问卷")
    private Integer templateType;
    /**
     * é—®é¢˜ç±»åž‹
     */
    @ApiModelProperty("问题分类:(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)")
    @Excel(name = "问题分类:(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)")
    private String type;
    /**
     * é—®é¢˜ID
     */
    @ApiModelProperty("问题ID")
    @Excel(name = "问题ID")
    private Long scriptid;
    /**
     * é€‰é¡¹ç­”案的附加信息
     */
    @ApiModelProperty("选项答案的附加信息")
    @Excel(name = "选项答案的附加信息")
    private String answerps;
    /**
     * å¯¹ç­”案的评语
     */
    @ApiModelProperty("对答案的评语")
    @Excel(name = "对答案的评语")
    private String comment;
    /**
     * å›žç­”结果
     */
    @ApiModelProperty("回答结果")
    @Excel(name = "回答结果")
    private String asrtext;
    /**
     * å½•音地址
     */
    @ApiModelProperty("录音地址")
    @Excel(name = "录音地址")
    private String recordpath;
    /**
     * å½•音URL
     */
    @ApiModelProperty("录音URL")
    @Excel(name = "录音URL")
    private String recordurl;
    /**
     * æ‚£è€…ID
     */
    @ApiModelProperty("患者ID")
    @Excel(name = "患者ID")
    private Long patid;
    /**
     * åŒ…含患者姓名、患者电话、就诊科室等
     */
    @ApiModelProperty("包含患者姓名、患者电话、就诊科室等")
    @Excel(name = "包含患者姓名、患者电话、就诊科室等")
    private String patdesc;
    /**
     * å¤„理科室id
     */
    @ApiModelProperty("处理科室id")
    @Excel(name = "处理科室id")
    private Long todeptid;
    /**
     * å¤„理科室编号
     */
    @ApiModelProperty("处理科室编号")
    @Excel(name = "处理科室编号")
    private String todeptcode;
    /**
     * å¤„理科室名称
     */
    @ApiModelProperty("处理科室名称")
    @Excel(name = "处理科室名称")
    private String todeptname;
    /**
     * å¤„理结果(处理科室)
     */
    @ApiModelProperty("处理结果(处理科室)")
    @Excel(name = "处理结果", readConverterExp = "处=理科室")
    private String handleresult;
    /**
     * å¤„理详细说明(处理科室)
     */
    @ApiModelProperty("处理详细说明(处理科室)")
    @Excel(name = "处理详细说明", readConverterExp = "处=理科室")
    private String handledesc;
    /**
     * å¤„理标记:0未处理,1已处理
     */
    @ApiModelProperty("处理标记:0未处理,1已处理")
    @Excel(name = "处理标记:0未处理,1已处理")
    private String handleFlag;
    /**
     * å¤„理人
     */
    @ApiModelProperty("处理人")
    @Excel(name = "处理人")
    private String handleBy;
    /**
     * å¤„理时间
     */
    @ApiModelProperty("处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date handleTime;
    /**
     * æŠ„送科室,多个科室
     */
    @ApiModelProperty("抄送科室,多个科室")
    @Excel(name = "抄送科室,多个科室")
    private String ccdepts;
    /**
     * æœ€ç»ˆï¼ˆè´¨ç®¡éƒ¨é—¨ï¼‰æ„è§
     */
    @ApiModelProperty("最终(质管部门)意见")
    @Excel(name = "最终", readConverterExp = "è´¨=管部门")
    private String finaloption;
    /**
     * æœ€ç»ˆï¼ˆè´¨ç®¡éƒ¨é—¨ï¼‰æ„è§æ—¶é—´
     */
    @ApiModelProperty("最终(质管部门)意见时间")
    @Excel(name = "最终", readConverterExp = "è´¨=管部门")
    private Date finaltime;
    /**
     * æ“ä½œäºº
     */
    @ApiModelProperty("操作人 ")
    @Excel(name = "操作人 ")
    private String operate;
    /**
     * åŒ»é™¢æœºæž„ID
     */
    @ApiModelProperty("医院机构ID")
    @Excel(name = "医院机构ID")
    private String orgid;
    /**
     * ä¸Šä¼ æ ‡å¿—(0:未上传 1:已上传)
     */
    @ApiModelProperty("上传标志(0:未上传 1:已上传)")
    @Excel(name = "上传标志", readConverterExp = "0=:未上传,1=:已上传")
    private Long isupload;
    /**
     * ä¸Šä¼ æ—¶é—´
     */
    @ApiModelProperty("上传时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date uploadTime;
    /**
     * åˆ é™¤æ ‡å¿—(0:未删除 1:已删除)
     */
    @ApiModelProperty("删除标志(0:未删除 1:已删除)")
    private String delFlag;
    /**
     * çˆ¶GUID
     */
    @ApiModelProperty("父GUID")
    @Excel(name = "父GUID")
    private String pguid;
    /**
     * çˆ¶ID
     */
    @ApiModelProperty("父ID")
    @Excel(name = "父ID")
    private Integer pid;
    /**
     * ç±»åˆ«ID
     */
    @ApiModelProperty("类别ID")
    @Excel(name = "类别ID")
    private Long categoryid;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java
@@ -96,6 +96,12 @@
    @ApiModelProperty(value = "模板问题编号")
    private Long templatequestionnum;
    @ApiModelProperty(value = "基础模板ID")
    private Integer libTemplateid;
    @ApiModelProperty(value = "模板类型:1.语音 2.问卷")
    private Integer templateType;
    @ApiModelProperty(value = "交换机ID")
    private Long switchid;
@@ -103,6 +109,8 @@
    @ApiModelProperty(value = "问题文本")
    private String questiontext;
    @ApiModelProperty(value = "分数")
    private String score;
    @ApiModelProperty(value = "问题语音")
    private String questionvoice;
@@ -152,7 +160,7 @@
    private String valueType;
    @ApiModelProperty(value = "问题id")
    @ApiModelProperty(value = "问题id:对应的taskTemplateScript的ID")
    private Long scriptid;
    @ApiModelProperty(value = "选项答案的附加信息")
smartor/src/main/java/com/smartor/domain/ServiceSubtaskPreachform.java
@@ -56,7 +56,7 @@
     * <p>
     * äººå·¥éšè®¿çŠ¶æ€ï¼š1未执行   2待人工确认  3拒接拒访  4号码错误   5执行失败   6不执行  7 è¶…æ—¶     9完成
     * <p>
     * é¢è®¿çŠ¶æ€ï¼š1未执行   9完成
     *
     */
    @ApiModelProperty("发送状态")
    private String sendstate;
smartor/src/main/java/com/smartor/domain/SvyLibScriptCategory.java
@@ -75,4 +75,11 @@
    @ApiModelProperty("序号")
    private Integer seqno;
    /**
     * é—®é¢˜ç±»åž‹ï¼ˆä¾‹å¦‚,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)
     */
    @Excel(name = "问题类型(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)")
    @ApiModelProperty("问题类型(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)")
    private String type;
}
smartor/src/main/java/com/smartor/domain/SvyLibScriptCategoryVO.java
@@ -41,6 +41,20 @@
    @ApiModelProperty("问卷题目id")
    private Long topicid;
    /**
     * é—®é¢˜ç±»åž‹ï¼ˆä¾‹å¦‚,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)
     */
    @Excel(name = "问题类型(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)")
    @ApiModelProperty("问题类型(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)")
    private String type;
    /**
     * å­å¯¹è±¡
     */
    @ApiModelProperty("子对象集")
    private List<SvyLibScriptCategory> svyLibScriptCategoryList = new ArrayList<>();
    /**
     * çˆ¶ID
     */
@@ -67,11 +81,5 @@
    @Excel(name = "医院机构id")
    @ApiModelProperty("医院机构id")
    private String orgid;
    /**
     * å­å¯¹è±¡
     */
    @ApiModelProperty("子对象集")
    private List<SvyLibScriptCategory> svyLibScriptCategoryList = new ArrayList<>();
}
smartor/src/main/java/com/smartor/domain/SvyLibScriptOption.java
@@ -76,9 +76,9 @@
    private Long detailismandatory;
    /**
     * æ˜¯å¦å¼‚常项目
     * æ˜¯å¦å¼‚常标识:0正常  1异常  2警告
     */
    @ApiModelProperty(value = "是否异常项目")
    @ApiModelProperty(value = "是否异常标识:0正常  1异常  2警告")
    private Long isabnormal;
    /**
@@ -202,5 +202,11 @@
    @ApiModelProperty(value = "附件信息")
    private String appenddesc;
    /**
     * å¼‚常选项:1否(默认)    2是
     */
    @ApiModelProperty(value = "异常选项:1否(默认)    2是")
    private Integer isException;
}
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
@@ -135,7 +135,6 @@
    @ApiModelProperty("上传时间")
    private Date uploadTime;
    /**
     * çˆ¶ID
     */
@@ -151,11 +150,18 @@
    private String guid;
    /**
     * åˆ†ç±»id
     * å¯¹åº”的是svy_lib_script_category的主键
     */
    @Excel(name = "分类id")
    @ApiModelProperty("分类id")
    @Excel(name = "对应的是svy_lib_script_category的主键")
    @ApiModelProperty("对应的是svy_lib_script_category的主键")
    private Long categoryid;
    /**
     * ç±»åˆ«å
     */
    @ApiModelProperty(value = "对应的是svy_lib_script_category的类别名")
    private String categoryName;
    /**
     * é¢˜ç›®å†…容
     */
@@ -276,4 +282,23 @@
    @ApiModelProperty(value = "组别")
    private String groupName;
    @Excel(name = "责任科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室名称(如果多个科室用逗号分割)")
    private String dutyDeptName;
    @Excel(name = "责任科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室编码(如果多个科室用逗号分割)")
    private String dutyDeptCode;
    @Excel(name = "报备科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室名称(如果多个科室用逗号分割)")
    private String reportDeptName;
    @Excel(name = "报备科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室编码(如果多个科室用逗号分割)")
    private String reportDeptCode;
    @Excel(name = "分类ID集合")
    @ApiModelProperty(value = "分类ID集合")
    private List<Long> categoryids;
}
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java
@@ -170,9 +170,16 @@
    /**
     * åˆ†ç±»id
     */
    @Excel(name = "分类id")
    @ApiModelProperty("分类id")
    @Excel(name = "对应的是svy_lib_script_category的id")
    @ApiModelProperty("对应的是svy_lib_script_category的id")
    private Long categoryid;
    /**
     * ç±»åˆ«å
     */
    @ApiModelProperty(value = "对应的是svy_lib_script_category的类别名")
    private String categoryName;
    /**
     * é¢˜ç›®å†…容
@@ -274,4 +281,23 @@
    @ApiModelProperty("选项答案的附加信息")
    private String answerps;
    @Excel(name = "责任科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室名称(如果多个科室用逗号分割)")
    private String dutyDeptName;
    @Excel(name = "责任科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室编码(如果多个科室用逗号分割)")
    private String dutyDeptCode;
    @Excel(name = "报备科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室名称(如果多个科室用逗号分割)")
    private String reportDeptName;
    @Excel(name = "报备科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室编码(如果多个科室用逗号分割)")
    private String reportDeptCode;
    @Excel(name = "分类ID集合")
    @ApiModelProperty(value = "分类ID集合")
    private List<Long> categoryids;
}
smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java
@@ -166,8 +166,8 @@
    /**
     * æ˜¯å¦å¼‚常标识
     */
    @Excel(name = "是否异常标识")
    @ApiModelProperty(value = "是否异常标识")
    @Excel(name = "是否异常标识:0正常  1异常  2警告")
    @ApiModelProperty(value = "是否异常标识:0正常  1异常  2警告")
    private Long isabnormal;
//    /**
@@ -277,4 +277,10 @@
     */
    @ApiModelProperty(value = "服务的名称")
    private String sendTaskname;
//
//    /**
//     * å¼‚常选项:1否(默认)    2是
//     */
//    @ApiModelProperty(value = "异常选项:1否(默认)    2是")
//    private Integer isException;
}
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
@@ -85,14 +85,14 @@
    /**
     * ç±»åˆ«å
     */
    @ApiModelProperty(value = "类别名")
    @ApiModelProperty(value = "对应的是svy_lib_script_category的类别名")
    private String categoryName;
    /**
     * ç±»åˆ«ID
     */
    @Excel(name = "类别ID")
    @ApiModelProperty(value = "类别ID")
    @Excel(name = "对应的是svy_lib_script_category的类别ID")
    @ApiModelProperty(value = "对应的是svy_lib_script_category的类别ID")
    private Long categoryid;
    /**
     * è¯æœ¯å†…容
@@ -246,4 +246,20 @@
    @ApiModelProperty(value = "组别")
    private String groupName;
    @Excel(name = "责任科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室名称(如果多个科室用逗号分割)")
    private String dutyDeptName;
    @Excel(name = "责任科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室编码(如果多个科室用逗号分割)")
    private String dutyDeptCode;
    @Excel(name = "报备科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室名称(如果多个科室用逗号分割)")
    private String reportDeptName;
    @Excel(name = "报备科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室编码(如果多个科室用逗号分割)")
    private String reportDeptCode;
}
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -335,6 +335,22 @@
    @ApiModelProperty(value = "选中该选项后,需要给当前患者立即发送的服务的id集合")
    private List<Integer> sendTaskids;
    @Excel(name = "责任科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室名称(如果多个科室用逗号分割)")
    private String dutyDeptName;
    @Excel(name = "责任科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "责任科室编码(如果多个科室用逗号分割)")
    private String dutyDeptCode;
    @Excel(name = "报备科室名称(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室名称(如果多个科室用逗号分割)")
    private String reportDeptName;
    @Excel(name = "报备科室编码(如果多个科室用逗号分割)")
    @ApiModelProperty(value = "报备科室编码(如果多个科室用逗号分割)")
    private String reportDeptCode;
    /**
     * è¯æœ¯é€‰é¡¹
     */
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java
@@ -116,7 +116,7 @@
    /**
     * æ˜¯å¦å¼‚常标识
     */
    @ApiModelProperty(value = "是否异常标识")
    @ApiModelProperty(value = "是否异常标识:0正常  1异常  2警告")
    private Long isabnormal;
    /**
@@ -259,4 +259,9 @@
    @ApiModelProperty(value = "是否是用户选择的选项")
    private Boolean isUserOperation = false;
//    /**
//     * å¼‚常选项:1否(默认)    2是
//     */
//    @ApiModelProperty(value = "异常选项:1否(默认)    2是")
//    private Integer isException;
}
smartor/src/main/java/com/smartor/domain/SysUserOrg.java
@@ -25,17 +25,17 @@
    /** ç”¨æˆ·ID */
    @ApiModelProperty("用户ID")
            @Excel(name = "用户ID")
    @Excel(name = "用户ID")
    private String userId;
    /** é™¢åŒºID */
    @ApiModelProperty("院区ID")
            @Excel(name = "院区ID")
    @Excel(name = "院区ID")
    private String campusid;
    /** æœºæž„ID */
    @ApiModelProperty("机构ID")
            @Excel(name = "机构ID")
    @Excel(name = "机构ID")
    private String orgid;
    /** åˆ é™¤æ ‡å¿—(0:未删除 1:已删除) */
smartor/src/main/java/com/smartor/domain/VO/DetailTraceDealVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package com.smartor.domain.VO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * æ»¡æ„åº¦å¼‚常处理情况请求对象
 *
 * @author lihu
 * @date 2026-03-24
 */
@Data
@ApiModel("满意度异常处理情况请求对象")
public class DetailTraceDealVO extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * å¤„理科室编号
     */
    @ApiModelProperty("处理科室编号")
    @Excel(name = "处理科室编号")
    private String todeptcode;
    /**
     * å¤„理科室名称
     */
    @ApiModelProperty("处理科室名称")
    @Excel(name = "处理科室名称")
    private String todeptname;
    /**
     * ä»»åŠ¡æ¨¡æ¿ID
     */
    @ApiModelProperty("任务模板ID")
    @Excel(name = "任务模板ID")
    private Long templateid;
    /**
     * å¤„理时间
     */
    @ApiModelProperty("处理开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date handleStartTime;
    /**
     * å¤„理时间
     */
    @ApiModelProperty("处理结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date handleEndTime;
    /**
     * é—®é¢˜ç±»åž‹
     */
    @ApiModelProperty("问题分类:(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)")
    @Excel(name = "问题分类:(例如,门诊满意度:mzmyd     ä½é™¢æ»¡æ„åº¦ï¼šzymyd  ...)")
    private String type;
}
smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionReqVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
package com.smartor.domain.VO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.smartor.domain.entity.PatSatisfactionDetailEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.*;
/**
 * æ‚£è€…满意度统计请求入参
 *
 * @author ls
 * @date 2026-03-27
 */
@ApiModel(value = "PatSatisfactionReqVO", description = "患者满意度统计请求入参")
@Data
public class PatSatisfactionReqVO extends BaseEntity {
    private static final long serialVersionUID = 1L;
//    /**
//     * ä¸»é”®id集合
//     */
//    @ApiModelProperty(value = "基础模板问题id集合")
//    private List<Long> scriptids;
    /**
     * æ¨¡æ¿ID
     */
    @ApiModelProperty(value = "模板ID")
    private Integer templateid;
    /**
     * scriptids里的问题id只能是一个类型,不能是混合类型
     * æ¨¡æ¿ç±»åž‹ï¼š1.语音 2.问卷
     */
    @NotNull(message = "模板类型不能为空")
    @ApiModelProperty(value = "模板类型(scriptids里的问题id只能是一个类型,不能是混合类型):1.语音 2.问卷")
    private Integer type;
    /**
     * æŸ¥è¯¢å¼€å§‹æ—¶é—´
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "查询开始时间")
    @ApiModelProperty(value = "查询开始时间")
    private Date startTime;
    /**
     * æŸ¥è¯¢ç»“束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "查询结束时间")
    @ApiModelProperty(value = "查询结束时间")
    private Date endTime;
    /**
     * éƒ¨é—¨é›†åˆ
     */
    @NotNull(message = "部门集合")
    @ApiModelProperty(value = "部门集合")
    private List<String> deptcodes;
    /**
     * éƒ¨é—¨é›†åˆ
     */
    @NotNull(message = "问卷类型:1语音   2问券")
    @ApiModelProperty(value = "问卷类型:1语音   2问券")
    private Integer questionType;
    /**
     * æ‚£è€…服务类型:6、出院满意度调查    14住院满意度   15门诊满意度  16常用满意度
     */
    @ApiModelProperty(value = "患者服务类型:6、出院满意度调查    14住院满意度   15门诊满意度  16常用满意度    (默认查全部)")
    private List<String> serviceTypes = new ArrayList<>(Arrays.asList("6", "14", "15", "16"));
    /**
     * ç—…区编号
     */
    @ApiModelProperty(value = "病区集合")
    private List<String> hospitaldistrictcodes;
}
smartor/src/main/java/com/smartor/domain/VO/PatSatisfactionResVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
package com.smartor.domain.VO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.smartor.domain.entity.PatSatisfactionDetailEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
 * æ‚£è€…满意度统计返参
 *
 * @author ls
 * @date 2026-03-30
 */
@ApiModel(value = "PatSatisfactionReqVO", description = "患者满意度统计返参")
@Data
public class PatSatisfactionResVO extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * ä¸»é”®id集合
     */
    @ApiModelProperty(value = "答题总人数(已经回答问题的)")
    private Integer totalPerson;
    /**
     * æ€»ç­”题率
     */
    @ApiModelProperty(value = "总答题率")
    private Double totalAnswerRate;
    /**
     * ç—…区编号
     */
    @ApiModelProperty(value = "题目明细统计集合")
    private List<PatSatisfactionDetailEntity> patSatisfactionDetailEntities;
}
smartor/src/main/java/com/smartor/domain/VO/SatisfactionExceptConfigQuestionReqVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
package com.smartor.domain.VO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * æ»¡æ„åº¦å¼‚常配置题目请求信息
 *
 * @author lihu
 * @date 2026-03-31
 */
@Data
@ApiModel("满意度异常配置题目请求信息")
public class SatisfactionExceptConfigQuestionReqVO extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * ä»»åŠ¡ç±»åž‹(门诊,住院,复诊…)
     */
    @Excel(name = "任务类型:1 è¯­éŸ³  2 é—®å·ï¼›")
    @ApiModelProperty(value = "任务类型:1.语音  2.问卷")
    private String scriptType;
    /**
     * é¢˜ç›®ä¸»é¢˜
     */
    @ApiModelProperty("题目主题")
    @Excel(name = "题目主题")
    private String questionTopic;
    /**
     * é¢˜ç›®å†…容
     */
    @ApiModelProperty("题目内容")
    @Excel(name = "题目内容")
    private String questionContent;
    /**
     * æ˜¯å¦å¯ç”¨ 0可用  1不可用
     */
    @ApiModelProperty("是否可用 0可用  1不可用")
    @Excel(name = "是否可用 0可用  1不可用")
    private String isavailable;
    /**
     * æ˜¯å¦å¯ç”¨ 0可用  1不可用
     */
    @ApiModelProperty("是否可用 0可用  1不可用")
    @Excel(name = "满意度类型(例如:mzmyd、 zymyd、 cymyd ï¼‰")
    private String type;
}
smartor/src/main/java/com/smartor/domain/VisitPlan.java
@@ -29,53 +29,53 @@
    /** å‡ºé™¢æ—¥æœŸ */
    @ApiModelProperty("出院日期")
            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
            @Excel(name = "出院日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "出院日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date outHospDate;
    /** è®¡åˆ’随访日期 */
    @ApiModelProperty("计划随访日期")
            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
            @Excel(name = "计划随访日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "计划随访日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date planVisitDate;
    /** è¯­éŸ³åŸºç¡€æ¨¡æ¿ID(商议的固定模板放这个表里) */
    @ApiModelProperty("语音基础模板ID(商议的固定模板放这个表里)")
            @Excel(name = "语音基础模板ID", readConverterExp = "商=议的固定模板放这个表里")
     @Excel(name = "语音基础模板ID", readConverterExp = "商=议的固定模板放这个表里")
    private Long ivrLibaTemplateId;
    /** æ‚£è€…ID */
    @ApiModelProperty("患者ID")
            @Excel(name = "患者ID")
     @Excel(name = "患者ID")
    private Long patid;
    /** æ‚£è€…手机号 */
    @ApiModelProperty("患者手机号")
            @Excel(name = "患者手机号")
     @Excel(name = "患者手机号")
    private String phone;
    /** service_task主键 */
    @ApiModelProperty("service_task主键")
            @Excel(name = "service_task主键")
     @Excel(name = "service_task主键")
    private Long taskId;
    /** å­ä»»åŠ¡ID */
    @ApiModelProperty("子任务ID")
            @Excel(name = "子任务ID")
     @Excel(name = "子任务ID")
    private Long subTaskId;
    /** ä»»åŠ¡æ¨¡æ¿ID */
    @ApiModelProperty("任务模板ID")
            @Excel(name = "任务模板ID")
     @Excel(name = "任务模板ID")
    private Long taskTemplateId;
    /** 0 æœªæ‰§è¡Œ    1已执行 */
    @ApiModelProperty("0 æœªæ‰§è¡Œ    1已执行")
            @Excel(name = "0 æœªæ‰§è¡Œ    1已执行")
     @Excel(name = "0 æœªæ‰§è¡Œ    1已执行")
    private Long isExecute;
    /** å…¬ä¼—号ID */
    @ApiModelProperty("公众号ID")
            @Excel(name = "公众号ID")
     @Excel(name = "公众号ID")
    private String openid;
        }
smartor/src/main/java/com/smartor/domain/entity/PatSatisfactionDetailEntity.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,76 @@
package com.smartor.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * æ‚£è€…满意度统详情
 *
 * @author ls
 * @date 2026-03-30
 */
@ApiModel(value = "PatSatisfactionDetailEntity", description = "患者满意度统详情")
@Data
public class PatSatisfactionDetailEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * é—®é¢˜å†…容
     */
    @ApiModelProperty(value = "问题内容")
    private String scriptContent;
    /**
     * ç­”题人数
     */
    @ApiModelProperty(value = "答题人数")
    private Integer answerPerson;
    /**
     * ç­”题人数
     */
    @ApiModelProperty(value = "未答题人数")
    private Integer noAnswerPerson;
    /**
     * å¹³å‡åˆ†
     */
    @ApiModelProperty(value = "平均分")
    private Double averageScore;
    /**
     * æœ€é«˜åˆ†
     */
    @ApiModelProperty(value = "最高分")
    private Double maxScore;
    /**
     * æœ€ä½Žåˆ†
     */
    @ApiModelProperty(value = "最低分")
    private Double minScore;
    /**
     * ç­”题率
     */
    @ApiModelProperty(value = "答题率")
    private Double answerRate;
    /**
     * å„选项(matchedtext)数量及占比
     * key=matchedtext,value={count: æ•°é‡, ratio: å æ¯”}
     */
    @ApiModelProperty(value = "各选项数量及占比")
    private Map<String, Map<String, Object>> matchedtextStats;
}
smartor/src/main/java/com/smartor/domain/entity/ServiceSubtaskSatisfactionEntity.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
package com.smartor.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.smartor.domain.TaskSendTimeVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * æ‚£è€…满意度发送人数统计
 *
 * @author ls
 * @date 2026-03-27
 */
@ApiModel(value = "ServiceSubtaskSatisfactionEntity", description = "单一随访任务入参")
@Data
public class ServiceSubtaskSatisfactionEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "任务类型(1、语音;2、问卷表;)")
    private Integer type;
    /**
     * åŸºç¡€æ¨¡æ¿Ids
     */
    @ApiModelProperty(value = "基础模板Ids")
    private List<Long> libTemplateIds;
    /**
     * æŸ¥è¯¢å¼€å§‹æ—¶é—´
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "查询开始时间")
    @ApiModelProperty(value = "查询开始时间")
    private Date startTime;
    /**
     * æŸ¥è¯¢ç»“束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "查询结束时间")
    @ApiModelProperty(value = "查询结束时间")
    private Date endTime;
    /**
     * éƒ¨é—¨é›†åˆ
     */
    @NotNull(message = "部门集合")
    @ApiModelProperty(value = "部门集合")
    private List<String> deptcodes;
    /**
     * ç—…区编号
     */
    @ApiModelProperty(value = "病区集合")
    private List<String> hospitaldistrictcodes;
}
smartor/src/main/java/com/smartor/mapper/IvrLibaTemplateScriptMapper.java
@@ -1,9 +1,13 @@
package com.smartor.mapper;
import com.smartor.domain.IvrLibaTemplateScript;
import com.smartor.domain.VO.PatSatisfactionReqVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
 * æ¨¡ç‰ˆé—®é¢˜è¯æœ¯åº“Mapper接口
@@ -12,8 +16,7 @@
 * @date 2023-12-23
 */
@Mapper
public interface IvrLibaTemplateScriptMapper
{
public interface IvrLibaTemplateScriptMapper {
    /**
     * æŸ¥è¯¢æ¨¡ç‰ˆé—®é¢˜è¯æœ¯åº“
     *
@@ -61,4 +64,6 @@
     * @return ç»“æžœ
     */
    public int deleteIvrLibaTemplateScriptByIDs(Long[] IDs);
    public List<IvrLibaTemplateScript> queryLibTemplateIds(@Param("scriptAssortids") List<Long> scriptAssortids);
}
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskDetailMapper.java
@@ -1,8 +1,10 @@
package com.smartor.mapper;
import com.smartor.domain.DTO.ServiceSubtaskDetailDTO;
import com.smartor.domain.ServiceSubtaskDetail;
import com.smartor.domain.ServiceSubtaskDetailTarget;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -13,8 +15,7 @@
 * @date 2023-03-24
 */
@Mapper
public interface ServiceSubtaskDetailMapper
{
public interface ServiceSubtaskDetailMapper {
    /**
     * æŸ¥è¯¢è¯­éŸ³ä»»åŠ¡å‘¼å«æ˜Žç»†
     *
@@ -22,6 +23,10 @@
     * @return è¯­éŸ³ä»»åŠ¡å‘¼å«æ˜Žç»†
     */
    public ServiceSubtaskDetail selectServiceSubtaskDetailByCalldetailid(String calldetailid);
    public List<ServiceSubtaskDetailDTO> queryFillCount(@Param("subids") List<Long> subids, @Param("questiontext") String questiontext);
    public ServiceSubtaskDetailDTO isExistServiceSubtaskDetail(@Param("subid") Long subid, @Param("scriptid") Long scriptid);
    /**
     * æŸ¥è¯¢è¯­éŸ³ä»»åŠ¡å‘¼å«æ˜Žç»†åˆ—è¡¨
@@ -46,6 +51,7 @@
     * @return ç»“æžœ
     */
    public int updateServiceSubtaskDetail(ServiceSubtaskDetail serviceSubtaskDetail);
    public int updateSSDByCondition(ServiceSubtaskDetail serviceSubtaskDetail);
    /**
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskDetailTraceMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
package com.smartor.mapper;
import java.util.List;
import com.smartor.domain.VO.DetailTraceDealVO;
import org.apache.ibatis.annotations.Mapper;
import com.smartor.domain.ServiceSubtaskDetailTrace;
/**
 * éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªMapper接口
 *
 * @author lihu
 * @date 2026-03-24
 */
@Mapper
public interface ServiceSubtaskDetailTraceMapper {
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param id éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªä¸»é”®
     * @return éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     */
    public ServiceSubtaskDetailTrace selectServiceSubtaskDetailTtraceById(Long id);
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªåˆ—è¡¨
     *
     * @param ServiceSubtaskDetailTtrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªé›†åˆ
     */
    public List<ServiceSubtaskDetailTrace> selectServiceSubtaskDetailTtraceList(ServiceSubtaskDetailTrace ServiceSubtaskDetailTtrace);
    public List<ServiceSubtaskDetailTrace> tracedeallist(DetailTraceDealVO detailTraceDealVO);
    /**
     * æ–°å¢žéšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param ServiceSubtaskDetailTtrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return ç»“æžœ
     */
    public int insertServiceSubtaskDetailTtrace(ServiceSubtaskDetailTrace ServiceSubtaskDetailTtrace);
    /**
     * ä¿®æ”¹éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param ServiceSubtaskDetailTtrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return ç»“æžœ
     */
    public int updateServiceSubtaskDetailTtrace(ServiceSubtaskDetailTrace ServiceSubtaskDetailTtrace);
    /**
     * åˆ é™¤éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param id éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteServiceSubtaskDetailTtraceById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteServiceSubtaskDetailTtraceByIds(Long[] ids);
}
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -1,7 +1,9 @@
package com.smartor.mapper;
import com.smartor.domain.*;
import com.smartor.domain.VO.PatSatisfactionReqVO;
import com.smartor.domain.entity.ServiceSubtaskEntity;
import com.smartor.domain.entity.ServiceSubtaskSatisfactionEntity;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -33,10 +35,12 @@
     */
    public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtaskEntity serviceSubtaskVO);
    public List<ServiceSubtask> selectSatisfactionSubtaskList(PatSatisfactionReqVO serviceSubtaskVO);
    /**
     * ç”¨äºŽè¡¥å¿æŸ¥è¯¢
     *
     * @param ServiceSubtaskEntity
     * @param serviceSubtaskVO
     * @return
     */
    public List<ServiceSubtask> getCompensateServiceSubtaskList(ServiceSubtaskEntity serviceSubtaskVO);
@@ -158,26 +162,28 @@
     *
     * @param serviceSubtaskVO æŸ¥è¯¢æ¡ä»¶
     * @return Map<String, Object> åŒ…含各状态统计数据
     *         wzx: æœªæ‰§è¡Œæ•°é‡
     *         ysf: å·²éšè®¿æ•°é‡
     *         fssb: å‘送失败数量
     *         yfs: å·²å‘送数量
     *         dsf: å¾…随访数量
     *         blq: ä¸ç†ç¬æ•°é‡
     *         yc: å¼‚常数量
     * wzx: æœªæ‰§è¡Œæ•°é‡
     * ysf: å·²éšè®¿æ•°é‡
     * fssb: å‘送失败数量
     * yfs: å·²å‘送数量
     * dsf: å¾…随访数量
     * blq: ä¸ç†ç¬æ•°é‡
     * yc: å¼‚常数量
     */
    public Map<String, Object> countByCondition(ServiceSubtaskEntity serviceSubtaskVO);
    /**
     * ç»Ÿè®¡ä»»åŠ¡å„ç§çŠ¶æ€çš„æ•°é‡ï¼ˆä¼˜åŒ–ç‰ˆï¼‰
     *
     * @param serviceSubtaskVO æŸ¥è¯¢æ¡ä»¶
     * @return Map<String, Object> åŒ…含各状态统计数据
     *         pendingVisitCount: å½“前登录人截止今日待随访总量
     *         failedVisitCount: å½“前登录人随访任务失败总量
     *         abnormalVisitVount: å½“前登录人随访任务异常总量
     *         allVisitCount: å½“前登录人随访任务总量
     * pendingVisitCount: å½“前登录人截止今日待随访总量
     * failedVisitCount: å½“前登录人随访任务失败总量
     * abnormalVisitVount: å½“前登录人随访任务异常总量
     * allVisitCount: å½“前登录人随访任务总量
     */
    public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity serviceSubtaskVO);
    /**
     * èŽ·å–é—¨è¯Šéšè®¿äººæ•°
     *
@@ -186,4 +192,6 @@
     */
    PatMedRes selectVisitCount(PatMedReq patMedReq);
    List<Long> querySendCount(ServiceSubtaskSatisfactionEntity serviceSubtaskSatisfactionEntity);
}
smartor/src/main/java/com/smartor/mapper/SvyLibTemplateScriptMapper.java
@@ -1,7 +1,9 @@
package com.smartor.mapper;
import com.smartor.domain.IvrLibaTemplateScript;
import com.smartor.domain.SvyLibTemplateScript;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -60,4 +62,9 @@
     * @return ç»“æžœ
     */
    public int deleteSvyLibTemplateScriptByTopicids(Long[] topicids);
    public List<SvyLibTemplateScript> querySvyLibTemplateIds(@Param("scriptCategoryids") List<Long> scriptCategoryids);
}
smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java
@@ -1,19 +1,23 @@
package com.smartor.service;
import java.util.List;
import java.util.Map;
import com.smartor.domain.PatSatisfaction;
import com.smartor.domain.VO.PatSatisfactionReqVO;
import com.smartor.domain.VO.PatSatisfactionResVO;
/**
 * æ‚£è€…满意度Service接口
 *
 *
 * @author lihu
 * @date 2025-06-30
 */
public interface IPatSatisfactionService
public interface IPatSatisfactionService
{
    /**
     * æŸ¥è¯¢æ‚£è€…满意度
     *
     *
     * @param id æ‚£è€…满意度主键
     * @return æ‚£è€…满意度
     */
@@ -21,7 +25,7 @@
    /**
     * æŸ¥è¯¢æ‚£è€…满意度列表
     *
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return æ‚£è€…满意度集合
     */
@@ -29,7 +33,7 @@
    /**
     * æ–°å¢žæ‚£è€…满意度
     *
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return ç»“æžœ
     */
@@ -37,7 +41,7 @@
    /**
     * ä¿®æ”¹æ‚£è€…满意度
     *
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return ç»“æžœ
     */
@@ -45,7 +49,7 @@
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…满意度
     *
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ‚£è€…满意度主键集合
     * @return ç»“æžœ
     */
@@ -53,9 +57,26 @@
    /**
     * åˆ é™¤æ‚£è€…满意度信息
     *
     *
     * @param id æ‚£è€…满意度主键
     * @return ç»“æžœ
     */
    public int deletePatSatisfactionById(Long id);
    /**
     * æ‚£è€…满意度统计
     *
     * @param patSatisfactionReqVO æ‚£è€…满意度统计条件
     * @return æ‚£è€…满意度统计结果
     */
    public PatSatisfactionResVO statistics( PatSatisfactionReqVO patSatisfactionReqVO);
    /**
     * æ‚£è€…满意度柱状图信息
     *
     * @param patSatisfactionReqVO æ‚£è€…满意度柱状图信息
     * @return æ‚£è€…满意度柱状图信息
     */
    public Map<String, Object> satisfactionGraph(PatSatisfactionReqVO patSatisfactionReqVO);
}
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java
@@ -70,6 +70,8 @@
     */
    public Integer saveQuestionAnswer(ServiceSubTaskAnswerReq serviceSubTaskAnswerReq,Long flag);
    public Integer saveQuestionDetail(ServiceSubTaskCacheReq serviceSubTaskCacheReq,Long flag);
    public Boolean saveMYDQuestionAnswer(ServiceSubTaskMYDAnswerReq serviceSubTaskMYDAnswerReq);
    /**
smartor/src/main/java/com/smartor/service/IServiceSubtaskDetailTraceService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,81 @@
package com.smartor.service;
import java.util.List;
import java.util.Map;
import com.smartor.domain.DTO.DetailTraceDealDTO;
import com.smartor.domain.ServiceSubtaskDetailTrace;
import com.smartor.domain.VO.DetailTraceDealVO;
import com.smartor.domain.VO.SatisfactionExceptConfigQuestionReqVO;
import org.springframework.web.bind.annotation.RequestBody;
/**
 * éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªService接口
 *
 * @author lihu
 * @date 2026-03-24
 */
public interface IServiceSubtaskDetailTraceService
{
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param id éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªä¸»é”®
     * @return éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     */
    public ServiceSubtaskDetailTrace selectServiceSubtaskDetailTtraceById(Long id);
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªåˆ—è¡¨
     *
     * @param serviceSubtaskDetailTtrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªé›†åˆ
     */
    public List<ServiceSubtaskDetailTrace> selectServiceSubtaskDetailTtraceList(ServiceSubtaskDetailTrace serviceSubtaskDetailTtrace);
    /**
     * å¼‚常问题处理情况查询
     * @param detailTraceDealVO
     * @return
     */
    public List<DetailTraceDealDTO> tracedeallist(DetailTraceDealVO detailTraceDealVO);
    /**
     * æ–°å¢žéšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param serviceSubtaskDetailTtrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return ç»“æžœ
     */
    public int insertServiceSubtaskDetailTtrace(ServiceSubtaskDetailTrace serviceSubtaskDetailTtrace);
    /**
     * ä¿®æ”¹éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param serviceSubtaskDetailTtrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return ç»“æžœ
     */
    public int updateServiceSubtaskDetailTtrace(ServiceSubtaskDetailTrace serviceSubtaskDetailTtrace);
    /**
     * æ‰¹é‡åˆ é™¤éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param ids éœ€è¦åˆ é™¤çš„随访任务异常记录跟踪主键集合
     * @return ç»“æžœ
     */
    public int deleteServiceSubtaskDetailTtraceByIds(Long[] ids);
    /**
     * åˆ é™¤éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªä¿¡æ¯
     *
     * @param id éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteServiceSubtaskDetailTtraceById(Long id);
    /**
     * èŽ·å–æ»¡æ„åº¦å¼‚å¸¸é…ç½®é¢˜ç›®
     * @param questionReqVO
     * @return
     */
    public Map<String, Object> getSatisfactionExceptConfigQuestion(SatisfactionExceptConfigQuestionReqVO questionReqVO);
}
smartor/src/main/java/com/smartor/service/impl/IvrLibaScriptAssortServiceImpl.java
@@ -3,6 +3,7 @@
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.smartor.common.PinYinUtil;
import com.smartor.domain.*;
import com.smartor.mapper.IvrLibaScriptAssortMapper;
import com.smartor.service.IIvrLibaScriptAssortService;
@@ -88,6 +89,9 @@
        } else {
            ivrLibaScriptAssort.setSeqno(seqMax + 1);
        }
        if (ivrLibaScriptAssort.getIndexAssortName() != null && ivrLibaScriptAssort.getIndexAssortName().contains("满意度") && ivrLibaScriptAssort.getPid() != -1) {
            ivrLibaScriptAssort.setType(PinYinUtil.getpy(ivrLibaScriptAssort.getIndexAssortName()));
        }
        i = ivrLibaScriptAssortMapper.insertIvrLibaScriptAssort(ivrLibaScriptAssort);
        log.info("问题话术分类库一级树的主键:{}", ivrLibaScriptAssort.getId());
@@ -125,6 +129,9 @@
    @Override
    public int updateIvrLibaScriptAssort(IvrLibaScriptAssort ivrLibaScriptAssort) {
        ivrLibaScriptAssort.setUpdateTime(DateUtils.getNowDate());
        if (ivrLibaScriptAssort.getIndexAssortName() != null && ivrLibaScriptAssort.getIndexAssortName().contains("满意度") && ivrLibaScriptAssort.getPid() != -1) {
            ivrLibaScriptAssort.setType(PinYinUtil.getpy(ivrLibaScriptAssort.getIndexAssortName()));
        }
        return ivrLibaScriptAssortMapper.updateIvrLibaScriptAssort(ivrLibaScriptAssort);
    }
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -218,11 +218,6 @@
        log.info("ivrTaskTemplates的查询结果为:{},数量为 : {}", ivrTaskTemplates.get(0), ivrTaskTemplates.size());
        //定义IvrLibaTemplateVO ç”¨äºŽè¿”参
        IvrTaskTemplateVO templateVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplates.get(0), IvrTaskTemplateVO.class);
//
//        //获取tag信息
//        IvrLibaTemplateTag ivrLibaTemplateTag = new IvrLibaTemplateTag();
//        ivrLibaTemplateTag.setTemplateid(ivrTaskTemplates.get(0).getID());
//        List<IvrLibaTemplateTag> ivrLibaTemplateTags = ivrLibaTemplateTagMapper.selectIvrLibaTemplateTagList(ivrLibaTemplateTag);
        //查询话术
        IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript();
@@ -257,7 +252,7 @@
            }
            ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions);
        }
        Collections.sort(ivrTaskTemplateScriptVOS, Comparator.comparing(IvrTaskTemplateScriptVO::getTargetid));
        Collections.sort(ivrTaskTemplateScriptVOS, Comparator.comparing(IvrTaskTemplateScriptVO::getSort));
        //数据组装
//        templateVO.setIvrTaskTemplateTagList(ivrLibaTemplateTags);
        templateVO.setIvrTaskTemplateScriptVOList(ivrTaskTemplateScriptVOS);
smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java
@@ -1,13 +1,23 @@
package com.smartor.service.impl;
import java.util.List;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
import com.ruoyi.common.utils.Arith;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.smartor.domain.*;
import com.smartor.domain.DTO.ServiceSubtaskDetailDTO;
import com.smartor.domain.VO.PatSatisfactionReqVO;
import com.smartor.domain.VO.PatSatisfactionResVO;
import com.smartor.domain.entity.PatSatisfactionDetailEntity;
import com.smartor.domain.entity.ServiceSubtaskSatisfactionEntity;
import com.smartor.mapper.*;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smartor.mapper.PatSatisfactionMapper;
import com.smartor.domain.PatSatisfaction;
import com.smartor.service.IPatSatisfactionService;
/**
@@ -20,6 +30,30 @@
public class PatSatisfactionServiceImpl implements IPatSatisfactionService {
    @Autowired
    private PatSatisfactionMapper patSatisfactionMapper;
    @Autowired
    private ServiceSubtaskMapper serviceSubtaskMapper;
    @Autowired
    private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper;
    @Autowired
    private IvrLibaTemplateScriptMapper ivrLibaTemplateScriptMapper;
    @Autowired
    private IvrLibaScriptAssortMapper ivrLibaScriptAssortMapper;
    @Autowired
    private SvyLibScriptCategoryMapper svyLibScriptCategoryMapper;
    @Autowired
    private IvrLibaTemplateTargetoptionMapper ivrLibaTemplateTargetoptionMapper;
    @Autowired
    private SvyLibTemplateTargetoptionMapper svyLibTemplateTargetoptionMapper;
    @Autowired
    private SvyLibTemplateScriptMapper svyLibTemplateScriptMapper;
    /**
     * æŸ¥è¯¢æ‚£è€…满意度
@@ -99,4 +133,355 @@
    public int deletePatSatisfactionById(Long id) {
        return patSatisfactionMapper.deletePatSatisfactionById(id);
    }
    /**
     * æ‚£è€…满意度统计
     *
     * @param patSatisfactionReqVO æ‚£è€…满意度统计条件
     * @return æ‚£è€…满意度统计结果
     */
    @Override
    public PatSatisfactionResVO statistics(PatSatisfactionReqVO patSatisfactionReqVO) {
        //定义返参
        PatSatisfactionResVO result = new PatSatisfactionResVO();
        //答题总人数(已经回答问题的)
        int totalPerson = 0;
        // æ€»äººæ•°ï¼ˆåŒ…含未回答的)
        int allPerson = 0;
        //患者满意度统详情
        List<PatSatisfactionDetailEntity> patSatisfactionDetailEntities = new ArrayList<>();
        List<ServiceSubtask> serviceSubtasks = serviceSubtaskMapper.selectSatisfactionSubtaskList(patSatisfactionReqVO);
        // æŒ‰type分组: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. å…ˆèŽ·å–ivr_liba_script_assort的满意度分类ID
            IvrLibaScriptAssort ivrLibaScriptAssort = new IvrLibaScriptAssort();
            ivrLibaScriptAssort.setOrgid(patSatisfactionReqVO.getOrgid());
            List<IvrLibaScriptAssort> ivrLibaScriptAssorts = ivrLibaScriptAssortMapper.selectIvrLibaScriptAssortList(ivrLibaScriptAssort);
            List<Long> mydIdList = ivrLibaScriptAssorts.stream().filter(item -> item.getType() != null && item.getType().contains("myd")).map(IvrLibaScriptAssort::getId).collect(Collectors.toList());
            //2 å†èŽ·å–è¯¥é—®é¢˜æ»¡æ„åº¦åˆ†ç±»ä¸‹çš„IvrLibaTemplateScript的集合
            List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.queryLibTemplateIds(mydIdList);
            //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);
                    });
                    // ä»ŽfillCount中取targetvalue(&分隔的当前问题的所有选项),补全未出现的选项,count和ratio均为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. å…ˆèŽ·å–svy_lib_script_category的满意度分类ID
            SvyLibScriptCategory svyLibScriptCategory = new SvyLibScriptCategory();
            svyLibScriptCategory.setOrgid(patSatisfactionReqVO.getOrgid());
            List<SvyLibScriptCategory> svyLibScriptCategories = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory);
            List<Long> mydIdList = svyLibScriptCategories.stream().filter(item -> item.getType() != null && item.getType().contains("myd")).map(SvyLibScriptCategory::getId).collect(Collectors.toList());
            //2 å†èŽ·å–è¯¥é—®é¢˜æ»¡æ„åº¦åˆ†ç±»ä¸‹çš„IvrLibaTemplateScript的集合
            List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.querySvyLibTemplateIds(mydIdList);
            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);
                    });
                    // ä»ŽfillCount中取targetvalue(&分隔的当前问题的所有选项),补全未出现的选项,count和ratio均为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=满意度分类下的总人数和填报人数)
        Map<String, Object> zzt = new HashMap<>();
        // è®°å½•一下每种分类的填报情况
        Map<String, List<ServiceSubtaskDetailDTO>> assortNameFillCountMap = new HashMap<>();
        if (patSatisfactionReqVO.getType() == null || patSatisfactionReqVO.getType() == 1) {
            //1. å…ˆèŽ·å–ivr_liba_script_assort的满意度分类ID
            IvrLibaScriptAssort ivrLibaScriptAssort = new IvrLibaScriptAssort();
            ivrLibaScriptAssort.setOrgid(patSatisfactionReqVO.getOrgid());
            List<IvrLibaScriptAssort> ivrLibaScriptAssorts = ivrLibaScriptAssortMapper.selectIvrLibaScriptAssortList(ivrLibaScriptAssort);
            List<Long> mydIdList = ivrLibaScriptAssorts.stream().filter(item -> item.getType() != null && item.getType().contains("myd")).map(IvrLibaScriptAssort::getId).collect(Collectors.toList());
            //2 å†èŽ·å–è¯¥é—®é¢˜æ»¡æ„åº¦åˆ†ç±»ä¸‹çš„IvrLibaTemplateScript的集合
            List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.queryLibTemplateIds(mydIdList);
            //3 æŒ‰scriptAssortname分组,并获取每个集合进行遍历,计算每个分类的总人数和填报人数
            Map<String, List<IvrLibaTemplateScript>> scriptGroupByAssortName = ivrLibaTemplateScripts.stream().filter(item -> item.getScriptAssortname() != null).collect(Collectors.groupingBy(IvrLibaTemplateScript::getScriptAssortname));
            if (scriptGroupByAssortName != null && !scriptGroupByAssortName.isEmpty()) {
                for (String assortNameKey : scriptGroupByAssortName.keySet()) {
                    //记录总人数
                    Double subidAll = 0.0;
                    //记录总的填报人数
                    Double fillCountAll = 0.0;
                    //获取该分类的填报总数量
                    List<ServiceSubtaskDetailDTO> allFillCountList = new ArrayList<>();
                    List<IvrLibaTemplateScript> ivrLibaTemplateScriptList = scriptGroupByAssortName.get(assortNameKey);
                    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(assortNameKey, personCount);
                    assortNameFillCountMap.put(assortNameKey, allFillCountList);
                }
            }
        }
        if (patSatisfactionReqVO.getType() == null || patSatisfactionReqVO.getType() == 2) {
            //1. å…ˆèŽ·å–svy_lib_script_category的满意度分类ID
            SvyLibScriptCategory svyLibScriptCategory = new SvyLibScriptCategory();
            svyLibScriptCategory.setOrgid(patSatisfactionReqVO.getOrgid());
            List<SvyLibScriptCategory> svyLibScriptCategories = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory);
            List<Long> mydIdList = svyLibScriptCategories.stream().filter(item -> item.getType() != null && item.getType().contains("myd")).map(SvyLibScriptCategory::getId).collect(Collectors.toList());
            //2 å†èŽ·å–è¯¥é—®é¢˜æ»¡æ„åº¦åˆ†ç±»ä¸‹çš„IvrLibaTemplateScript的集合
            List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.querySvyLibTemplateIds(mydIdList);
            //3 æŒ‰scriptAssortname分组,并获取每个集合进行遍历,计算每个分类的总人数和填报人数
            Map<String, List<SvyLibTemplateScript>> scriptGroupByatCegoryName = svyLibTemplateScripts.stream().filter(item -> item.getCategoryName() != null).collect(Collectors.groupingBy(SvyLibTemplateScript::getCategoryName));
            if (scriptGroupByatCegoryName != null && !scriptGroupByatCegoryName.isEmpty()) {
                for (String categoryNameKey : scriptGroupByatCegoryName.keySet()) {
                    //记录总人数
                    Double subidAll = 0.0;
                    //记录总的填报人数
                    Double fillCountAll = 0.0;
                    //获取该分类的填报总数量
                    List<ServiceSubtaskDetailDTO> allFillCountList = new ArrayList<>();
                    List<SvyLibTemplateScript> svyLibTemplateScriptList = scriptGroupByatCegoryName.get(categoryNameKey);
                    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(categoryNameKey);
                    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(categoryNameKey);
                        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(categoryNameKey, personCount);
                    }
                }
            }
        }
        return zzt;
    }
    /**
     * èŽ·å–æœ€é«˜åˆ†
     *
     * @param options
     * @return
     */
    private Double maxScore(List<IvrLibaTemplateTargetoption> options) {
        if (CollectionUtils.isEmpty(options)) return 0.0;
        OptionalDouble maxOpt = options.stream().filter(dto -> dto.getScore() != null).mapToDouble(dto -> dto.getScore().doubleValue()).max();
        return maxOpt.isPresent() ? new BigDecimal(maxOpt.getAsDouble()).setScale(1, RoundingMode.HALF_UP).doubleValue() : 0.0;
    }
    /**
     * èŽ·å–æœ€ä½Žåˆ†
     *
     * @param options
     * @return
     */
    private Double minScore(List<IvrLibaTemplateTargetoption> options) {
        if (CollectionUtils.isEmpty(options)) return 0.0;
        OptionalDouble minOpt = options.stream().filter(dto -> dto.getScore() != null).mapToDouble(dto -> dto.getScore().doubleValue()).min();
        return minOpt.isPresent() ? new BigDecimal(minOpt.getAsDouble()).setScale(1, RoundingMode.HALF_UP).doubleValue() : 0.0;
    }
    /**
     * èŽ·å–å¹³å‡åˆ†
     *
     * @param fillCount
     * @return
     */
    private Double averageScore(List<ServiceSubtaskDetailDTO> fillCount) {
        if (CollectionUtils.isEmpty(fillCount)) return 0.0;
        double sum = fillCount.stream().filter(dto -> dto.getScore() != null && !dto.getScore().isEmpty()).mapToDouble(dto -> Double.parseDouble(dto.getScore())).sum();
        return new BigDecimal(sum / fillCount.size()).setScale(1, RoundingMode.HALF_UP).doubleValue();
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -9,10 +9,13 @@
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.domain.DTO.ServiceSubtaskDetailDTO;
import com.smartor.domain.entity.ServiceSubtaskEntity;
import com.smartor.mapper.*;
import com.smartor.service.IServiceSubtaskAnswerService;
import com.smartor.service.IServiceSubtaskDetailTraceService;
import com.smartor.service.IServiceTaskService;
import com.sun.org.apache.bcel.internal.generic.NEW;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -23,6 +26,7 @@
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
 * ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹Service业务层处理
@@ -49,6 +53,12 @@
    private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper;
    @Autowired
    private SvyLibScriptCategoryMapper svyLibScriptCategoryMapper;
    @Autowired
    private IvrLibaScriptAssortMapper ivrLibaScriptAssortMapper;
    @Autowired
    private IServiceTaskService serviceTaskService;
    @Autowired
@@ -60,6 +70,9 @@
    @Autowired
    private PatMedOuthospMapper patMedOuthospMapper;
    @Autowired
    private IServiceSubtaskDetailTraceService traceService;
    @Value("${pri_key}")
    private String pri_key;
@@ -185,9 +198,7 @@
                        for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) {
                            if (svyTaskTemplateScriptVO.getSort() == 1L) {
                                //说明是第一题
//                                SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(cacheList.get(0), SvyTaskTemplateScriptVO.class);
                                List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(0).getSvyTaskTemplateTargetoptions();
//                                List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(svyTaskTemplateTargetoptions, SvyTaskTemplateTargetoption.class);
                                svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions);
                                Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid);
                                if (map == null) continue aa;
@@ -307,6 +318,141 @@
        }
        return 1;
    }
    @Override
    public Integer saveQuestionDetail(ServiceSubTaskCacheReq serviceSubTaskCacheReq, Long flag) {
        Long tid = Long.valueOf(serviceSubTaskCacheReq.getParam1());
        Long pid = Long.valueOf(serviceSubTaskCacheReq.getParam2());
        Double score = null;
        if (ObjectUtils.isNotEmpty(serviceSubTaskCacheReq)) {
            Long nextScriptno = null;
            String isabnormalFlag = "0";
            if (serviceSubTaskCacheReq.getType() == 2) {
                List<SvyTaskTemplateScriptVO> cacheList = serviceSubTaskCacheReq.getSvyTaskTemplateScriptVOS();
                cacheList.sort(Comparator.comparingLong(SvyTaskTemplateScriptVO::getSort));
                log.info("问卷回答结果:{}", cacheList);
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        //这个时间要找到第一题
                        for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) {
                            if (svyTaskTemplateScriptVO.getSort() == 1L) {
                                //说明是第一题
                                List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(0).getSvyTaskTemplateTargetoptions();
                                svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions);
                                Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid);
                                if (map == null) continue;
                                if (!Objects.isNull(map.get("nextScriptNo")))
                                    nextScriptno = Long.valueOf(map.get("nextScriptNo"));
                                if (score == null) {
                                    score = Double.valueOf(map.get("score"));
                                } else {
                                    score = score + Double.valueOf(map.get("score"));
                                }
                                isabnormalFlag = map.get("isabnormal");
                            }
                        }
                    } else {
                        SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = cacheList.get(i);
                        log.info("svyTaskTemplateScriptVO的信息为:{},i的值为:{}", svyTaskTemplateScriptVO.getScriptno(), i);
                        List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(i).getSvyTaskTemplateTargetoptions();
                        svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions);
                        if (svyTaskTemplateScriptVO.getSort() != null && svyTaskTemplateScriptVO.getSort().equals(nextScriptno)) {
                            Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid);
                            log.error("nextScriptNo的信息为:{}", map.get("nextScriptNo"));
                            if (!Objects.isNull(map.get("nextScriptNo")))
                                nextScriptno = Long.valueOf(map.get("nextScriptNo"));
                            if (score == null) {
                                score = Double.valueOf(map.get("score"));
                            } else {
                                score = score + Double.valueOf(map.get("score"));
                            }
                            isabnormalFlag = map.get("isabnormal");
                        }
                    }
                }
            } else if (serviceSubTaskCacheReq.getType() == 1) {
                List<IvrTaskTemplateScriptVO> cacheList = serviceSubTaskCacheReq.getIvrTaskTemplateScriptVOList();
                cacheList.sort(Comparator.comparingLong(IvrTaskTemplateScriptVO::getSort));
                log.error("电话随访问卷回答结果:{}", cacheList.size());
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        //这个时间要找到第一题
                        for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : cacheList) {
                            if (ivrTaskTemplateScriptVO.getSort() == 1L) {
                                //说明是第一题
                                List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = cacheList.get(0).getIvrTaskScriptTargetoptionList();
                                ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions);
                                //它俩都是ivr_task_templatescript_id,所以这里需要设置一下
                                ivrTaskTemplateScriptVO.setId(ivrTaskTemplateScriptVO.getScriptID());
                                Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid);
                                if (!Objects.isNull(map.get("nextScriptNo")))
                                    nextScriptno = Long.valueOf(map.get("nextScriptNo"));
                                if (score == null) {
                                    score = Double.valueOf(map.get("score"));
                                } else {
                                    score = score + Double.valueOf(map.get("score"));
                                }
                                isabnormalFlag = map.get("isabnormal");
                            }
                        }
                    } else {
                        IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(cacheList.get(i), IvrTaskTemplateScriptVO.class);
                        List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(cacheList.get(i).getIvrTaskScriptTargetoptionList(), IvrTaskTemplateTargetoption.class);
                        ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions);
                        if (ivrTaskTemplateScriptVO.getSort() != null && Long.valueOf(ivrTaskTemplateScriptVO.getSort()).equals(nextScriptno)) {
                            Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid);
                            log.error("----nextScriptNo2的信息为:{}", map.get("nextScriptNo"));
                            if (!Objects.isNull(map.get("nextScriptNo")))
                                nextScriptno = Long.valueOf(map.get("nextScriptNo"));
                            if (score == null) {
                                score = Double.valueOf(map.get("score"));
                            } else {
                                score = score + Double.valueOf(map.get("score"));
                            }
                            isabnormalFlag = map.get("isabnormal");
                        }
                    }
                }
            }
            //查询出该任务中正在执行的患者信息
            ServiceSubtaskEntity ssVO = new ServiceSubtaskEntity();
            ssVO.setTaskid(tid);
            ssVO.setPatid(pid);
            List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(ssVO);
            ServiceSubtask serviceSubtask = new ServiceSubtask();
            serviceSubtask.setTaskid(tid);
            serviceSubtask.setPatid(pid);
            serviceSubtask.setSubmit(1L);
            serviceSubtask.setIsabnormal(Integer.valueOf(isabnormalFlag));
            serviceSubtask.setSendstate(6L);
            serviceSubtask.setExcep(isabnormalFlag);
            serviceSubtask.setFinishtime(new Date());
            serviceSubtask.setUpdateTime(new Date());
            if (score != null) serviceSubtask.setScore(BigDecimal.valueOf(score));
            serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask);
            //将当前发送状态改成9完成
            ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform();
            serviceSubtaskPreachform.setPreachform(serviceSubtaskList.get(0).getCurrentPreachform());
            serviceSubtaskPreachform.setSubid(serviceSubtask.getId());
            serviceSubtaskPreachform.setTaskid(serviceSubtask.getTaskid());
            List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform);
            if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) {
                ServiceSubtaskPreachform ssp = serviceSubtaskPreachforms.get(0);
                ssp.setSendstate("9");
                serviceSubtaskPreachformMapper.updateServiceSubtaskPreachform(ssp);
            }
        }
        return 1;
    }
    @Override
    public Boolean saveMYDQuestionAnswer(ServiceSubTaskMYDAnswerReq serviceSubTaskMYDAnswerReq) {
@@ -672,6 +818,7 @@
            }
            serviceSubtaskDetailVO.setAsrtext(StringUtils.isEmpty(svyTaskTemplateScriptVO.getScriptResult()) ? "" : svyTaskTemplateScriptVO.getScriptResult().replaceAll("^\"|\"$", ""));
            serviceSubtaskDetailVO.setMatchedtext(StringUtils.isEmpty(svyTaskTemplateScriptVO.getScriptResult()) ? "" : svyTaskTemplateScriptVO.getScriptResult().replaceAll("^\"|\"$", ""));
            serviceSubtaskDetailVO.setScore(svyTaskTemplateScriptVO.getScore() != null ? svyTaskTemplateScriptVO.getScore().toString() : "0");
        } else {
            //非单多选
            if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getScriptResult())) {
@@ -694,6 +841,8 @@
        serviceSubtaskDetailVO.setComment(null);
        serviceSubtaskDetailVO.setCreateTime(new Date());
        serviceSubtaskDetailVO.setUpdateTime(new Date());
        serviceSubtaskDetailVO.setTemplateType(2);
        serviceSubtaskDetailVO.setLibTemplateid(CollectionUtils.isNotEmpty(selectServiceSubtaskList) ? selectServiceSubtaskList.get(0).getLibtemplateid().intValue() : null);
        if (ObjectUtils.isNotEmpty(serviceTask)) {
            serviceSubtaskDetailVO.setGuid(serviceTask.getGuid());
            serviceSubtaskDetailVO.setOrgid(serviceTask.getOrgid());
@@ -701,7 +850,74 @@
        serviceSubtaskDetailVO.setSubId(CollectionUtils.isNotEmpty(selectServiceSubtaskList) ? selectServiceSubtaskList.get(0).getId() : null);
        serviceSubtaskDetailVO.setTemplatequestionnum(svyTaskTemplateScriptVO.getId());
        ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class);
        serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
        //先用subid和scriptid查询一下是否存在,如果存在则更新,不存在则插入
        ServiceSubtaskDetailDTO existServiceSubtaskDetail = serviceSubtaskDetailMapper.isExistServiceSubtaskDetail(serviceSubtaskDetailVO.getSubId(), serviceSubtaskDetailVO.getScriptid());
        if (ObjectUtils.isNotEmpty(existServiceSubtaskDetail)) {
            serviceSubtaskDetail.setId(existServiceSubtaskDetail.getId());
            serviceSubtaskDetail.setUpdateTime(new Date());
            serviceSubtaskDetailMapper.updateServiceSubtaskDetail(serviceSubtaskDetail);
        } else {
            serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
        }
        //获取一下问题选项
        SvyTaskTemplateTargetoption stt = null;
        Long isabnormalFlag = 0L;
        for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption : svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions()) {
            if (svyTaskTemplateTargetoption.getOptioncontent().trim().equals(svyTaskTemplateScriptVO.getScriptResult()))
                stt = svyTaskTemplateTargetoption;
        }
        //判断一下当前的问题是不是满意度问题,并且dutyDeptCode是否有值,并且选项是不是异常选项,如果全符合,则往满意度问题异常表新增
        if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getDutyDeptCode()) && 1 == stt.getIsabnormal()) {
            isabnormalFlag = 1L;
            ServiceSubtaskDetailTrace subtaskDetailTrace = new ServiceSubtaskDetailTrace();
            subtaskDetailTrace.setDetailId(serviceSubtaskDetail.getId());
            subtaskDetailTrace.setSubId(serviceSubtaskDetailVO.getSubId());
            subtaskDetailTrace.setTaskid(serviceSubtaskDetailVO.getTaskid());
            subtaskDetailTrace.setTemplateid(StringUtils.isNotEmpty(serviceSubtaskDetailVO.getTemplateid()) ? Long.valueOf(serviceSubtaskDetailVO.getTemplateid()) : null);
            subtaskDetailTrace.setTemplatequestionnum(svyTaskTemplateScriptVO.getScriptid());
            subtaskDetailTrace.setSwitchid(stt.getId());
            subtaskDetailTrace.setQuestiontext(svyTaskTemplateScriptVO.getScriptContent());
            subtaskDetailTrace.setQuestionvoice(null);
            subtaskDetailTrace.setCategoryname(svyTaskTemplateScriptVO.getCategoryName());
            subtaskDetailTrace.setCategoryid(svyTaskTemplateScriptVO.getCategoryid());
            //获取所有选项
            subtaskDetailTrace.setTargetid(stt.getId());
            subtaskDetailTrace.setTargetvalue(serviceSubtaskDetailVO.getTargetvalue());
            subtaskDetailTrace.setMatchedtext(stt.getOptioncontent());
            subtaskDetailTrace.setGuid(svyTaskTemplateScriptVO.getGuid());
            subtaskDetailTrace.setValueType(serviceSubtaskDetail.getValueType());
            subtaskDetailTrace.setTemplateType(2);
            SvyLibScriptCategory svyLibScriptCategory = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryById(svyTaskTemplateScriptVO.getCategoryid());
            subtaskDetailTrace.setType(svyLibScriptCategory != null ? svyLibScriptCategory.getType() : null);
            subtaskDetailTrace.setScriptid(svyTaskTemplateScriptVO.getId());
            subtaskDetailTrace.setAsrtext(stt.getOptioncontent());
            subtaskDetailTrace.setRecordpath(null);
            subtaskDetailTrace.setPatid(selectServiceSubtaskList.get(0).getPatid());
            subtaskDetailTrace.setPatdesc(selectServiceSubtaskList.get(0).getSendname() + "," + selectServiceSubtaskList.get(0).getPhone() + "," + selectServiceSubtaskList.get(0).getDeptname());
            subtaskDetailTrace.setTodeptcode(svyTaskTemplateScriptVO.getDutyDeptCode());
            subtaskDetailTrace.setTodeptname(svyTaskTemplateScriptVO.getDutyDeptName());
            subtaskDetailTrace.setOrgid(selectServiceSubtaskList.get(0).getOrgid());
            subtaskDetailTrace.setHandleFlag("0");
            subtaskDetailTrace.setCreateTime(new Date());
            subtaskDetailTrace.setUpdateTime(new Date());
            subtaskDetailTrace.setOrgid(selectServiceSubtaskList.get(0).getOrgid());
            traceService.insertServiceSubtaskDetailTtrace(subtaskDetailTrace);
        } else if (ObjectUtils.isNotEmpty(stt) && stt.getIsabnormal() == 1L) {
            //这里主要是怕医护人员把异常选项改成了非异常的,这里就需要查一下这条数据是不是在满意度异常表,如果在,则要删除
            ServiceSubtaskDetailTrace subtaskDetailTrace = new ServiceSubtaskDetailTrace();
            subtaskDetailTrace.setSubId(serviceSubtaskDetailVO.getSubId());
            subtaskDetailTrace.setScriptid(svyTaskTemplateScriptVO.getId());
            List<ServiceSubtaskDetailTrace> serviceSubtaskDetailTraces = traceService.selectServiceSubtaskDetailTtraceList(subtaskDetailTrace);
            if (CollectionUtils.isNotEmpty(serviceSubtaskDetailTraces)) {
                traceService.deleteServiceSubtaskDetailTtraceById(serviceSubtaskDetailTraces.get(0).getId());
            }
        }
        //如何这需要服务补偿的服务ID不为空的话,则进行立即发送
        log.error("------svyTaskTemplateScriptVO.getSendTaskids()的值为:{},selectServiceSubtaskList的值为:{}", svyTaskTemplateScriptVO.getSendTaskids(), selectServiceSubtaskList.size());
@@ -713,6 +929,7 @@
        map.put("nextScriptNo", nextScriptNo);
        map.put("score", score);
        map.put("id", "" + serviceSubtaskDetail.getId());
        map.put("isabnormal", isabnormalFlag.toString());
        return map;
    }
@@ -809,7 +1026,7 @@
        //下题跳转
        String nextScriptNo = null;
        ServiceSubtaskDetailVO serviceSubtaskDetailVO = new ServiceSubtaskDetailVO();
        List<ServiceSubtaskOptionAnswer> answerList = new ArrayList<>();
        String isabnormalFlag = "0";
        if (ivrTaskTemplateScriptVO.getScriptType().equals("1") || ivrTaskTemplateScriptVO.getScriptType().equals("2")) {
            //1、2为单选或多选
            for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) {
@@ -821,20 +1038,25 @@
                }
            }
            nextScriptNo = ivrTaskTemplateScriptVO.getNextScriptno().toString();
            nextScriptNo = ivrTaskTemplateScriptVO.getNextScriptno() == null ? null : ivrTaskTemplateScriptVO.getNextScriptno().toString();
            if (ivrTaskTemplateScriptVO.getScore() != null) {
                score = String.valueOf(ivrTaskTemplateScriptVO.getScore());
            }
            if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getQuestionResult())) {
                serviceSubtaskDetailVO.setAsrtext(ivrTaskTemplateScriptVO.getQuestionResult().replaceAll("^\"|\"$", ""));
                serviceSubtaskDetailVO.setMatchedtext(ivrTaskTemplateScriptVO.getQuestionResult().replaceAll("^\"|\"$", ""));
            } else {
                //医生手动填报时,值是在ivrtext中
                serviceSubtaskDetailVO.setAsrtext(ivrTaskTemplateScriptVO.getIvrtext());
                serviceSubtaskDetailVO.setMatchedtext(ivrTaskTemplateScriptVO.getIvrtext());
            }
        } else {
            //非单多选
            if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getQuestionResult())) {
                serviceSubtaskDetailVO.setAsrtext(ivrTaskTemplateScriptVO.getQuestionResult().replaceAll("^\"|\"$", ""));
                serviceSubtaskDetailVO.setMatchedtext(ivrTaskTemplateScriptVO.getQuestionResult().replaceAll("^\"|\"$", ""));
                nextScriptNo = ivrTaskTemplateScriptVO.getNextScriptno().toString();
                serviceSubtaskDetailVO.setScore(ivrTaskTemplateScriptVO.getScore() != null ? ivrTaskTemplateScriptVO.getScore().toString() : "0");
                nextScriptNo = ivrTaskTemplateScriptVO.getNextScriptno() == null ? null : ivrTaskTemplateScriptVO.getNextScriptno().toString();
                if (ivrTaskTemplateScriptVO.getScore() != null) {
                    score = String.valueOf(ivrTaskTemplateScriptVO.getScore());
                }
@@ -844,7 +1066,7 @@
        serviceSubtaskDetailVO.setQuestiontext(ivrTaskTemplateScriptVO.getScriptContent());
        serviceSubtaskDetailVO.setTaskid(Long.valueOf(taskid));
        serviceSubtaskDetailVO.setPatid(Long.valueOf(patid));
        serviceSubtaskDetailVO.setScriptid(ivrTaskTemplateScriptVO.getScriptID());
        serviceSubtaskDetailVO.setScriptid(ivrTaskTemplateScriptVO.getScriptID() == null ? ivrTaskTemplateScriptVO.getId() : ivrTaskTemplateScriptVO.getScriptID());
        serviceSubtaskDetailVO.setTemplatequestionnum(ivrTaskTemplateScriptVO.getId());
        serviceSubtaskDetailVO.setValueType(ivrTaskTemplateScriptVO.getScriptType());
        serviceSubtaskDetailVO.setComment(null);
@@ -854,8 +1076,80 @@
        serviceSubtaskDetailVO.setUpdateTime(new Date());
        serviceSubtaskDetailVO.setSubId(selectServiceSubtaskList.get(0).getId());
        serviceSubtaskDetailVO.setTemplatequestionnum(ivrTaskTemplateScriptVO.getId());
        serviceSubtaskDetailVO.setTemplateType(1);
        serviceSubtaskDetailVO.setTemplateid(ivrTaskTemplateScriptVO.getTemplateID() == null ? null : ivrTaskTemplateScriptVO.getTemplateID().toString());
        serviceSubtaskDetailVO.setLibTemplateid(selectServiceSubtaskList.get(0).getLibtemplateid() != null ? selectServiceSubtaskList.get(0).getLibtemplateid().intValue() : null);
        ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class);
        serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
        //先用subid和scriptid查询一下是否存在,如果存在则更新,不存在则插入
        ServiceSubtaskDetailDTO existServiceSubtaskDetail = serviceSubtaskDetailMapper.isExistServiceSubtaskDetail(serviceSubtaskDetailVO.getSubId(), serviceSubtaskDetailVO.getScriptid());
        if (ObjectUtils.isNotEmpty(existServiceSubtaskDetail)) {
            serviceSubtaskDetail.setId(existServiceSubtaskDetail.getId());
            serviceSubtaskDetail.setUpdateTime(new Date());
            serviceSubtaskDetailMapper.updateServiceSubtaskDetail(serviceSubtaskDetail);
        } else {
            serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
        }
        IvrTaskTemplateTargetoption stt = null;
        for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) {
            if (ivrTaskTemplateTargetoption.getTargetvalue().trim().equals(ivrTaskTemplateScriptVO.getIvrtext()))
                stt = ivrTaskTemplateTargetoption;
        }
        //判断一下当前的问题是不是满意度问题,并且dutyDeptCode是否有值,并且选项是不是异常选项,如果全符合,则往满意度问题异常表新增
        if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getDutyDeptCode()) && 1 == stt.getIsabnormal()) {
            isabnormalFlag = "1";
            ServiceSubtaskDetailTrace subtaskDetailTrace = new ServiceSubtaskDetailTrace();
            subtaskDetailTrace.setDetailId(serviceSubtaskDetail.getId());
            subtaskDetailTrace.setSubId(serviceSubtaskDetailVO.getSubId());
            subtaskDetailTrace.setTaskid(serviceSubtaskDetailVO.getTaskid());
            subtaskDetailTrace.setTemplateid(ivrTaskTemplateScriptVO.getTemplateID()!=null ? Long.valueOf(ivrTaskTemplateScriptVO.getTemplateID()) : null);
            subtaskDetailTrace.setTemplatequestionnum(ivrTaskTemplateScriptVO.getSort() == null ? null : Long.valueOf(ivrTaskTemplateScriptVO.getSort()));
            //获取分类信息
            IvrLibaScriptAssort ivrLibaScriptAssort = null;
            if (ivrTaskTemplateScriptVO.getScriptAssortid() != null)
                ivrLibaScriptAssort = ivrLibaScriptAssortMapper.selectIvrLibaScriptAssortById(ivrTaskTemplateScriptVO.getScriptAssortid());
            //获取用户选出的选项的ID
            subtaskDetailTrace.setSwitchid(stt.getId());
            subtaskDetailTrace.setQuestiontext(ivrTaskTemplateScriptVO.getScriptContent());
            subtaskDetailTrace.setQuestionvoice(null);
            subtaskDetailTrace.setCategoryname(StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getScriptAssortname()) ? ivrTaskTemplateScriptVO.getScriptAssortname() : (ivrLibaScriptAssort != null ? ivrLibaScriptAssort.getIndexAssortName() : ""));
            subtaskDetailTrace.setCategoryid(ivrTaskTemplateScriptVO.getScriptAssortid());
            //获取所有选项
            subtaskDetailTrace.setTargetid(null);
            subtaskDetailTrace.setTargetvalue(serviceSubtaskDetailVO.getTargetvalue());
            subtaskDetailTrace.setMatchedtext(ivrTaskTemplateScriptVO.getIvrtext());
            subtaskDetailTrace.setGuid(ivrTaskTemplateScriptVO.getGuid());
            subtaskDetailTrace.setValueType(serviceSubtaskDetail.getValueType());
            subtaskDetailTrace.setTemplateType(1);
            subtaskDetailTrace.setType(ivrLibaScriptAssort != null ? ivrLibaScriptAssort.getType() : null);
            subtaskDetailTrace.setScriptid(ivrTaskTemplateScriptVO.getId() == null ? ivrTaskTemplateScriptVO.getScriptID() : ivrTaskTemplateScriptVO.getId());
            subtaskDetailTrace.setAsrtext(ivrTaskTemplateScriptVO.getIvrtext());
            subtaskDetailTrace.setRecordpath(null);
            subtaskDetailTrace.setPatid(selectServiceSubtaskList.get(0).getPatid());
            subtaskDetailTrace.setPatdesc(selectServiceSubtaskList.get(0).getSendname() + "," + selectServiceSubtaskList.get(0).getPhone() + "," + selectServiceSubtaskList.get(0).getDeptname());
            subtaskDetailTrace.setTodeptcode(ivrTaskTemplateScriptVO.getDutyDeptCode());
            subtaskDetailTrace.setTodeptname(ivrTaskTemplateScriptVO.getDutyDeptName());
            subtaskDetailTrace.setOrgid(selectServiceSubtaskList.get(0).getOrgid());
            subtaskDetailTrace.setHandleFlag("0");
            subtaskDetailTrace.setCreateTime(new Date());
            subtaskDetailTrace.setUpdateTime(new Date());
            subtaskDetailTrace.setOrgid(selectServiceSubtaskList.get(0).getOrgid());
            traceService.insertServiceSubtaskDetailTtrace(subtaskDetailTrace);
        } else if (stt.getIsabnormal() != null && stt.getIsabnormal() != 1L) {
            //这里主要是怕医护人员把异常选项改成了非异常的,这里就需要查一下这条数据是不是在满意度异常表,如果在,则要删除
            ServiceSubtaskDetailTrace subtaskDetailTrace = new ServiceSubtaskDetailTrace();
            subtaskDetailTrace.setSubId(serviceSubtaskDetailVO.getSubId());
            subtaskDetailTrace.setScriptid(ivrTaskTemplateScriptVO.getScriptID() == null ? ivrTaskTemplateScriptVO.getId() : ivrTaskTemplateScriptVO.getScriptID());
            List<ServiceSubtaskDetailTrace> serviceSubtaskDetailTraces = traceService.selectServiceSubtaskDetailTtraceList(subtaskDetailTrace);
            if (CollectionUtils.isNotEmpty(serviceSubtaskDetailTraces)) {
                traceService.deleteServiceSubtaskDetailTtraceById(serviceSubtaskDetailTraces.get(0).getId());
            }
        }
        //如何这需要服务补偿的服务ID不为空的话,则进行立即发送
        if (CollectionUtils.isNotEmpty(ivrTaskTemplateScriptVO.getSendTaskids()) && CollectionUtils.isNotEmpty(selectServiceSubtaskList)) {
@@ -866,6 +1160,7 @@
        Map<String, String> map = new HashMap<>();
        map.put("nextScriptNo", nextScriptNo);
        map.put("score", score);
        map.put("isabnormal", isabnormalFlag);
        return map;
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailTraceServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,278 @@
package com.smartor.service.impl;
import java.util.*;
import java.util.stream.Collectors;
import com.github.pagehelper.util.StringUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.domain.DTO.DetailTraceDealDTO;
import com.smartor.domain.VO.DetailTraceDealVO;
import com.smartor.domain.VO.SatisfactionExceptConfigQuestionReqVO;
import com.smartor.mapper.ServiceSubtaskDetailMapper;
import com.smartor.mapper.ServiceSubtaskDetailTraceMapper;
import com.smartor.mapper.SvyLibScriptCategoryMapper;
import com.smartor.mapper.SvyLibTemplateScriptMapper;
import com.smartor.service.*;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªService业务层处理
 *
 * @author lihu
 * @date 2026-03-24
 */
@Service
public class ServiceSubtaskDetailTraceServiceImpl implements IServiceSubtaskDetailTraceService {
    @Autowired
    private ServiceSubtaskDetailTraceMapper serviceSubtaskDetailTraceMapper;
    @Autowired
    private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper;
    @Autowired
    private ISvyLibScriptCategoryService iSvyLibScriptCategoryService;
    @Autowired
    private SvyLibScriptCategoryMapper svyLibScriptCategoryMapper;
    @Autowired
    private ISvyLibTemplateScriptService isvyLibTemplateScriptService;
    @Autowired
    private IIvrLibaScriptAssortService iIvrLibaScriptAssortService;
    @Autowired
    private IIvrLibaTemplateScriptService iIvrLibaTemplateScriptService;
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param id éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªä¸»é”®
     * @return éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     */
    @Override
    public ServiceSubtaskDetailTrace selectServiceSubtaskDetailTtraceById(Long id) {
        return serviceSubtaskDetailTraceMapper.selectServiceSubtaskDetailTtraceById(id);
    }
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªåˆ—è¡¨
     *
     * @param serviceSubtaskDetailTrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     */
    @Override
    public List<ServiceSubtaskDetailTrace> selectServiceSubtaskDetailTtraceList(ServiceSubtaskDetailTrace serviceSubtaskDetailTrace) {
        return serviceSubtaskDetailTraceMapper.selectServiceSubtaskDetailTtraceList(serviceSubtaskDetailTrace);
    }
    @Override
    public List<DetailTraceDealDTO> tracedeallist(DetailTraceDealVO detailTraceDealVO) {
        // èŽ·å–æ‰€æœ‰éœ€è¦å¤„ç†çš„è®°å½•
        List<ServiceSubtaskDetailTrace> tracedeallist = serviceSubtaskDetailTraceMapper.tracedeallist(detailTraceDealVO);
        // æŒ‰ questiontext åˆ†ç»„
        Map<String, List<ServiceSubtaskDetailTrace>> groupByQuestion = tracedeallist.stream()
                .filter(t -> t.getQuestiontext() != null)
                .collect(Collectors.groupingBy(ServiceSubtaskDetailTrace::getQuestiontext));
        List<DetailTraceDealDTO> detailTraceDealDTOList = new ArrayList<>();
        for (Map.Entry<String, List<ServiceSubtaskDetailTrace>> entry : groupByQuestion.entrySet()) {
            List<ServiceSubtaskDetailTrace> group = entry.getValue();
            DetailTraceDealDTO dto = new DetailTraceDealDTO();
            // é—®é¢˜å†…容
            dto.setQuestiontext(entry.getKey());
            // è´Ÿè´£ç§‘室(去重)
            List<Map<String, Object>> responsibleDept = group.stream()
                    .filter(t -> t.getTodeptcode() != null)
                    .collect(Collectors.collectingAndThen(
                            Collectors.toMap(
                                    ServiceSubtaskDetailTrace::getTodeptcode,
                                    t -> {
                                        Map<String, Object> deptMap = new HashMap<>();
                                        deptMap.put("deptName", t.getTodeptname());
                                        deptMap.put("deptCode", t.getTodeptcode());
                                        return deptMap;
                                    },
                                    (existing, replacement) -> existing
                            ),
                            map -> new ArrayList<>(map.values())
                    ));
            dto.setResponsibleDept(responsibleDept);
            // æœ‰æ•ˆå¡«å†™æ•°ï¼šé€šè¿‡ç»„内的 scriptid åŽ» service_subtask_detail è¡¨æŸ¥è¯¢
            List<Long> scriptIds = group.stream()
                    .map(ServiceSubtaskDetailTrace::getScriptid)
                    .filter(Objects::nonNull)
                    .distinct()
                    .collect(Collectors.toList());
            long effectiveFillNum = 0L;
            if (CollectionUtils.isNotEmpty(scriptIds)) {
                ServiceSubtaskDetail query = new ServiceSubtaskDetail();
                query.setDelFlag("0");
                for (Long scriptId : scriptIds) {
                    query.setScriptid(scriptId);
                    List<ServiceSubtaskDetail> details = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(query);
                    effectiveFillNum += CollectionUtils.isEmpty(details) ? 0 : details.size();
                }
            }
            // å¼‚常填写数 = å½“前分组的 List æ•°é‡
            long exceptionFillNum = group.size();
            Map<String, Object> fillSituation = new HashMap<>();
            fillSituation.put("effectiveFillNum", effectiveFillNum);
            fillSituation.put("exceptionFillNum", exceptionFillNum);
            dto.setFillSituation(fillSituation);
            // å¼‚常问题处理数量:从 handleFlag ç»Ÿè®¡
            long yesDeal = group.stream().filter(t -> "1".equals(t.getHandleFlag())).count();
            long noDeal = group.stream().filter(t -> !"1".equals(t.getHandleFlag())).count();
            Map<String, Object> exceptionQuesNum = new HashMap<>();
            exceptionQuesNum.put("yesDeal", yesDeal);
            exceptionQuesNum.put("noDeal", noDeal);
            exceptionQuesNum.put("all", exceptionFillNum);
            dto.setExceptionQuesNum(exceptionQuesNum);
            // æœ€æ–°å¤„理人和处理时间(取 handleTime æœ€æ–°çš„一条)
            group.stream()
                    .filter(t -> t.getHandleTime() != null)
                    .max(Comparator.comparing(ServiceSubtaskDetailTrace::getHandleTime))
                    .ifPresent(latest -> {
                        dto.setHandleBy(latest.getHandleBy());
                        dto.setHandleTime(latest.getHandleTime());
                    });
            detailTraceDealDTOList.add(dto);
        }
        return detailTraceDealDTOList;
    }
    /**
     * æ–°å¢žéšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param serviceSubtaskDetailTrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return ç»“æžœ
     */
    @Override
    public int insertServiceSubtaskDetailTtrace(ServiceSubtaskDetailTrace serviceSubtaskDetailTrace) {
        serviceSubtaskDetailTrace.setCreateTime(DateUtils.getNowDate());
        return serviceSubtaskDetailTraceMapper.insertServiceSubtaskDetailTtrace(serviceSubtaskDetailTrace);
    }
    /**
     * ä¿®æ”¹éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param serviceSubtaskDetailTrace éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     * @return ç»“æžœ
     */
    @Override
    public int updateServiceSubtaskDetailTtrace(ServiceSubtaskDetailTrace serviceSubtaskDetailTrace) {
        serviceSubtaskDetailTrace.setUpdateTime(DateUtils.getNowDate());
        return serviceSubtaskDetailTraceMapper.updateServiceSubtaskDetailTtrace(serviceSubtaskDetailTrace);
    }
    /**
     * æ‰¹é‡åˆ é™¤éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ª
     *
     * @param ids éœ€è¦åˆ é™¤çš„随访任务异常记录跟踪主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteServiceSubtaskDetailTtraceByIds(Long[] ids) {
        return serviceSubtaskDetailTraceMapper.deleteServiceSubtaskDetailTtraceByIds(ids);
    }
    /**
     * åˆ é™¤éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªä¿¡æ¯
     *
     * @param id éšè®¿ä»»åŠ¡å¼‚å¸¸è®°å½•è·Ÿè¸ªä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteServiceSubtaskDetailTtraceById(Long id) {
        return serviceSubtaskDetailTraceMapper.deleteServiceSubtaskDetailTtraceById(id);
    }
    @Override
    public Map<String, Object> getSatisfactionExceptConfigQuestion(SatisfactionExceptConfigQuestionReqVO questionReqVO) {
        // åˆå§‹åŒ–结果集
        Map<String, Object> result = new HashMap<>();
        if (StringUtils.isEmpty(questionReqVO.getScriptType()) || questionReqVO.getScriptType().equals("1")) {
            List<Map<String, Object>> voicetDataList = new ArrayList<>();
            //获取满意度的分类
            IvrLibaScriptAssort ivrLibaScriptAssort = new IvrLibaScriptAssort();
            ivrLibaScriptAssort.setType("myd");
            if (!StringUtils.isEmpty(questionReqVO.getType())) ivrLibaScriptAssort.setType(questionReqVO.getType());
            List<IvrLibaScriptAssortVO> ivrLibaScriptAssortVOS = iIvrLibaScriptAssortService.selectIvrLibaScriptAssortList(ivrLibaScriptAssort);
            List<Long> assortIdList = Optional.ofNullable(ivrLibaScriptAssortVOS).filter(list -> !list.isEmpty()).map(list -> list.stream().map(IvrLibaScriptAssortVO::getId).collect(Collectors.toList())).orElse(Collections.emptyList());
            //用来记录满意度的所有问题
            List<IvrLibaTemplateScript> ivrLibaTemplateScriptList = new ArrayList<>();
            if (CollectionUtils.isNotEmpty(assortIdList)) {
                for (Long assortId : assortIdList) {
                    IvrLibaTemplateScript ivrLibaTemplateScript = new IvrLibaTemplateScript();
                    ivrLibaTemplateScript.setScriptAssortid(assortId);
                    List<IvrLibaTemplateScript> ivrLibaTemplateScripts = iIvrLibaTemplateScriptService.selectIvrLibaTemplateScriptList(ivrLibaTemplateScript);
                    ivrLibaTemplateScriptList.addAll(ivrLibaTemplateScripts);
                }
                for (IvrLibaTemplateScript ivrLibaTemplateScript : ivrLibaTemplateScriptList) {
                    Map<String, Object> voicetData = new HashMap<>();
                    voicetData.put("questionId", ivrLibaTemplateScript.getId());
                    voicetData.put("libtemplateid", ivrLibaTemplateScript.getTemplateid());
                    voicetData.put("questionContent", ivrLibaTemplateScript.getScriptContent());
                    voicetData.put("questionTopic", ivrLibaTemplateScript.getScriptTopic());
                    voicetData.put("questionType", ivrLibaTemplateScript.getScriptType());
                    voicetData.put("categoryName", ivrLibaTemplateScript.getScriptAssortname());
                    voicetData.put("categoryId", ivrLibaTemplateScript.getScriptAssortid());
                    voicetDataList.add(voicetData);
                }
            }
            //语音数据返回集合
            result.put("voiceDataList", voicetDataList);
        }
        if (StringUtils.isEmpty(questionReqVO.getScriptType()) || questionReqVO.getScriptType().equals("2")) {
            List<Map<String, Object>> questionnaireDataList = new ArrayList<>();
            //获取满意度的分类
            SvyLibScriptCategory svyLibScriptCategory = new SvyLibScriptCategory();
            svyLibScriptCategory.setType("myd");
            if (!StringUtils.isEmpty(questionReqVO.getType())) svyLibScriptCategory.setType(questionReqVO.getType());
            List<SvyLibScriptCategory> svyLibScriptCategoryVOS = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory);
            List<Long> assortIdList = Optional.ofNullable(svyLibScriptCategoryVOS).filter(list -> !list.isEmpty()).map(list -> list.stream().map(SvyLibScriptCategory::getId).collect(Collectors.toList())).orElse(Collections.emptyList());
            //用来记录满意度的所有问题
            List<SvyLibTemplateScript> svyLibTemplateScriptList = new ArrayList<>();
            if (CollectionUtils.isNotEmpty(assortIdList)) {
                for (Long categoryid : assortIdList) {
                    SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript();
                    svyLibTemplateScript.setCategoryid(categoryid);
                    List<SvyLibTemplateScript> svyLibTemplateScripts = isvyLibTemplateScriptService.selectSvyLibTemplateScriptList(svyLibTemplateScript);
                    svyLibTemplateScriptList.addAll(svyLibTemplateScripts);
                }
                for (SvyLibTemplateScript svyLibTemplateScript : svyLibTemplateScriptList) {
                    Map<String, Object> voicetData = new HashMap<>();
                    voicetData.put("questionId", svyLibTemplateScript.getId());
                    voicetData.put("libtemplateid", svyLibTemplateScript.getSvyid());
                    voicetData.put("questionContent", svyLibTemplateScript.getScriptContent());
                    voicetData.put("questionTopic", svyLibTemplateScript.getScriptTopic());
                    voicetData.put("questionType", svyLibTemplateScript.getScriptType());
                    voicetData.put("categoryName", svyLibTemplateScript.getCategoryName());
                    voicetData.put("categoryId", svyLibTemplateScript.getCategoryid());
                    questionnaireDataList.add(voicetData);
                }
            }
            //问卷数据返回集合
            result.put("questionnaireDataList", questionnaireDataList);
        }
        return result;
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -1,6 +1,5 @@
package com.smartor.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
@@ -16,11 +15,8 @@
import com.smartor.domain.entity.ServiceSubtaskEntity;
import com.smartor.mapper.*;
import com.smartor.service.*;
import com.sun.org.apache.bcel.internal.generic.NEW;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -104,7 +100,7 @@
    private IServiceOutPathService iServiceOutPathService;
    @Autowired
    private IPatMedOuthospService iPatMedOuthospService;
    private IServiceSubtaskDetailTraceService traceService;
    @Autowired
    private FtpService ftpService;
@@ -117,6 +113,9 @@
    @Autowired
    private PatArchiveMapper patArchiveMapper;
    @Autowired
    private SvyLibScriptCategoryMapper svyLibScriptCategoryMapper;
    @Value("${pri_key}")
    private String pri_key;
@@ -205,12 +204,12 @@
            try {
                List<Map<String, Object>> mapList = objectMapper.readValue(serviceTask.getPreachformDesc(), List.class);
                serviceTaskVO.setPreachformList(mapList);
                if(ObjectUtils.isNotEmpty(serviceTask.getTaskid())){
                if (ObjectUtils.isNotEmpty(serviceTask.getTaskid())) {
                    ServiceTaskoper operVo = new ServiceTaskoper();
                    operVo.setTaskId(serviceTask.getTaskid());
                    operVo.setOrgid(serviceTask.getOrgid());
                    List<ServiceTaskoper> serviceTaskopers = serviceTaskoperService.selectServiceTaskoperList(operVo);
                    if(ObjectUtils.isNotEmpty(serviceTaskopers)){
                    if (ObjectUtils.isNotEmpty(serviceTaskopers)) {
                        serviceTaskVO.setOplevelcode(serviceTaskopers.get(0).getOplevelcode());
                    }
                }
@@ -231,12 +230,12 @@
        serviceTaskVO.setShowTimeNoon(serviceTask.getShowTimeNoon());
        serviceTaskVO.setShowTimeNight(serviceTask.getShowTimeNight());
        serviceTaskVO.setPreachform(serviceTask.getPreachform());
        if(ObjectUtils.isNotEmpty(serviceTask.getTaskid())){
        if (ObjectUtils.isNotEmpty(serviceTask.getTaskid())) {
            ServiceTaskoper operVo = new ServiceTaskoper();
            operVo.setTaskId(serviceTask.getTaskid());
            operVo.setOrgid(serviceTask.getOrgid());
            List<ServiceTaskoper> serviceTaskopers = serviceTaskoperService.selectServiceTaskoperList(operVo);
            if(ObjectUtils.isNotEmpty(serviceTaskopers)){
            if (ObjectUtils.isNotEmpty(serviceTaskopers)) {
                serviceTaskVO.setOplevelcode(serviceTaskopers.get(0).getOplevelcode());
            }
        }
@@ -273,7 +272,7 @@
                patTaskRelevance.setDiagname(serviceSubtask1.getLeavediagname());
                patTaskRelevance.setPatid(serviceSubtask1.getPatid());
                patTaskRelevance.setSendStatus(serviceSubtask1.getSendstate());
                patTaskRelevance.setDeptCode(serviceSubtask1.getDeptcode());
                patTaskRelevance.setDeptcode(serviceSubtask1.getDeptcode());
                patTaskRelevance.setDeptName(serviceSubtask1.getDeptname());
                patTaskRelevance.setLeavehospitaldistrictcode(serviceSubtask1.getLeavehospitaldistrictcode());
                patTaskRelevance.setLeavehospitaldistrictname(serviceSubtask1.getLeavehospitaldistrictname());
@@ -295,7 +294,7 @@
                patTaskRelevance.setFinishtime(serviceSubtask1.getFinishtime());
                patTaskRelevance.setAddr(serviceSubtask1.getAddr());
                patTaskRelevance.setDeptName(serviceSubtask1.getDeptname());
                patTaskRelevance.setDeptCode(serviceSubtask1.getDeptcode());
                patTaskRelevance.setDeptcode(serviceSubtask1.getDeptcode());
                patTaskRelevance.setBedNo(serviceSubtask1.getBedNo());
                patTaskRelevance.setDiagname(serviceSubtask1.getLeavediagname());
                patTaskRelevance.setPatid(serviceSubtask1.getPatid());
@@ -577,6 +576,15 @@
            if (StringUtils.isNotEmpty(serviceTaskVO.getLibtemplateid())) {
                serviceTask.setLibtemplateid(serviceTaskVO.getLibtemplateid());
                serviceTask.setLibtemplatename(serviceTaskVO.getLibtemplatename());
            }else {
                if (ObjectUtils.isNotEmpty(serviceTaskVO.getSvyTaskTemplateVO())) {
                    serviceTask.setLibtemplateid(""+serviceTaskVO.getSvyTaskTemplateVO().getTemplateid());
                    serviceTask.setLibtemplatename(""+serviceTaskVO.getLibtemplatename());
                }
                if (ObjectUtils.isNotEmpty(serviceTaskVO.getIvrTaskTemplateVO())) {
                    serviceTask.setLibtemplateid(""+serviceTaskVO.getIvrTaskTemplateVO().getLibtemplateid());
                    serviceTask.setLibtemplatename(""+serviceTaskVO.getIvrTaskTemplateVO().getLibtemplatename());
                }
            }
            if (serviceTaskVO.getTemplateid() != null) {
                serviceTask.setTemplateid(serviceTaskVO.getTemplateid());
@@ -672,8 +680,8 @@
            serviceSubtask.setTaskid(serviceTask.getTaskid().longValue());
            serviceSubtask.setTemplatename(tempName);
            serviceSubtask.setTemplateid(tempid);
            serviceSubtask.setLibtemplateid(ObjectUtils.isEmpty(serviceTaskVO.getLibtemplateid()) ? null : Long.valueOf(serviceTaskVO.getLibtemplateid()));
            serviceSubtask.setLibtemplatename(serviceTaskVO.getLibtemplatename());
            serviceSubtask.setLibtemplateid(ObjectUtils.isEmpty(serviceTask.getLibtemplateid()) ? null : Long.valueOf(serviceTask.getLibtemplateid()));
            serviceSubtask.setLibtemplatename(serviceTask.getLibtemplatename());
            //新增
            if (CollectionUtils.isNotEmpty(serviceTaskVO.getPatTaskRelevances())) {
                for (PatTaskRelevance patTaskRelevance : serviceTaskVO.getPatTaskRelevances()) {
@@ -690,7 +698,7 @@
                    serviceSubtask.setSendstate(1L);
                    if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1)
                        serviceSubtask.setSendstate(2L);
                    serviceSubtask.setDeptcode(patTaskRelevance.getDeptCode());
                    serviceSubtask.setDeptcode(patTaskRelevance.getDeptcode());
                    serviceSubtask.setDeptname(patTaskRelevance.getDeptName());
                    serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode());
                    serviceSubtask.setLeavehospitaldistrictname(patTaskRelevance.getLeavehospitaldistrictname());
@@ -930,7 +938,7 @@
                    serviceSubtask.setAddr(patTaskRelevance.getAddr());
                    serviceSubtask.setPatid(patTaskRelevance.getPatid());
                    serviceSubtask.setOpenid(patTaskRelevance.getOpenid());
                    serviceSubtask.setDeptcode(patTaskRelevance.getDeptCode());
                    serviceSubtask.setDeptcode(patTaskRelevance.getDeptcode());
                    serviceSubtask.setLeavehospitaldistrictname(patTaskRelevance.getLeavehospitaldistrictname());
                    serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode());
                    serviceSubtask.setDeptname(patTaskRelevance.getDeptName());
@@ -1332,7 +1340,7 @@
                    ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallReqYQVO.getTaskid()));
                    //记录电话发送状态
                    setFailPreachForm(serviceSubtask, "3", "通话正常结束", "9");
                    //删除结束语的患存
                    //删除结束语的缓存
                    redisCache.deleteObject(phoneCallReqYQVO.getUuid() + "- jsy");
                } else {
                    redisCache.setCacheObject(phoneCallReqYQVO.getUuid() + "PlayEventCallbackPlaystop", true, 120, TimeUnit.MINUTES);
@@ -1548,6 +1556,53 @@
                        serviceSubTaskDetailReq.setGuid(phoneCallReqYQVO.getGuid());
                        serviceSubTaskDetailReq.setOrgid(phoneCallReqYQVO.getOrgid());
                        saveQuestionAnswerPhone(serviceSubTaskDetailReq);
                        //判断一下当前的问题是不是满意度问题,并且dutyDeptCode是否有值,并且选项是不是异常选项,如果全符合,则往满意度问题异常表新增
                        if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getDutyDeptCode()) && 1 == ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getIsabnormal()) {
                            ServiceSubtaskDetailTrace subtaskDetailTrace = new ServiceSubtaskDetailTrace();
                            //用taskid、subid和scriptid去获取detailid
                            ServiceSubtaskDetail ssd = new ServiceSubtaskDetail();
                            ssd.setSubId(serviceSubtask.getId());
                            ssd.setTaskid(serviceSubtask.getTaskid());
                            ssd.setScriptid(StringUtils.isNotEmpty(scriptId) ? Long.valueOf(scriptId) : null);
                            List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(ssd);
                            subtaskDetailTrace.setDetailId(CollectionUtils.isNotEmpty(serviceSubtaskDetails) ? serviceSubtaskDetails.get(0).getId() : null);
                            subtaskDetailTrace.setSubId(serviceSubtask.getId());
                            subtaskDetailTrace.setTaskid(serviceSubtask.getTaskid());
                            subtaskDetailTrace.setTemplateid(ivrTaskTemplateScriptVO.getId());
                            subtaskDetailTrace.setTemplatequestionnum(ivrTaskTemplateScriptVO.getScriptno());
                            subtaskDetailTrace.setSwitchid(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getId());
                            subtaskDetailTrace.setQuestiontext(ivrTaskTemplateScriptVO.getScriptContent());
                            subtaskDetailTrace.setQuestionvoice(null);
                            subtaskDetailTrace.setCategoryname(ivrTaskTemplateScriptVO.getScriptAssortname());
                            subtaskDetailTrace.setCategoryid(ivrTaskTemplateScriptVO.getScriptAssortid());
                            //获取所有选项
                            String optionDescStr = Optional.ofNullable(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()).filter(list -> !list.isEmpty()).map(list -> list.stream().map(IvrTaskTemplateTargetoption::getOptiondesc).filter(Objects::nonNull).collect(Collectors.joining("&"))).orElse("");
                            subtaskDetailTrace.setTargetid(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getId());
                            subtaskDetailTrace.setTargetvalue(optionDescStr);
                            subtaskDetailTrace.setMatchedtext(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getOptiondesc());
                            subtaskDetailTrace.setValueType(serviceSubtaskDetails.get(0).getValueType());
                            subtaskDetailTrace.setTemplateType(1);
                            SvyLibScriptCategory svyLibScriptCategory = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryById(ivrTaskTemplateScriptVO.getScriptAssortid());
                            subtaskDetailTrace.setType(svyLibScriptCategory.getType());
                            subtaskDetailTrace.setScriptid(ivrTaskTemplateScriptVO.getId());
                            subtaskDetailTrace.setAsrtext(phoneCallReqYQVO.getAsrtext());
                            subtaskDetailTrace.setRecordpath(phoneCallReqYQVO.getRecordpath());
                            subtaskDetailTrace.setPatid(serviceSubtask.getPatid());
                            subtaskDetailTrace.setPatdesc(serviceSubtask.getSendname() + "," + serviceSubtask.getPhone() + "," + serviceSubtask.getDeptname());
                            subtaskDetailTrace.setTodeptcode(ivrTaskTemplateScriptVO.getDutyDeptCode());
                            subtaskDetailTrace.setTodeptname(ivrTaskTemplateScriptVO.getDutyDeptName());
                            subtaskDetailTrace.setOrgid(serviceSubtask.getOrgid());
                            subtaskDetailTrace.setHandleFlag("0");
                            subtaskDetailTrace.setGuid(phoneCallReqYQVO.getGuid());
                            subtaskDetailTrace.setCreateTime(new Date());
                            subtaskDetailTrace.setUpdateTime(new Date());
                            subtaskDetailTrace.setOrgid(phoneCallReqYQVO.getOrgid());
                            traceService.insertServiceSubtaskDetailTtrace(subtaskDetailTrace);
                        }
                        //判断一下,这个选项结果是不是还有继续问下去的必要,例如选项结果是别人不想继续回答问题,就要结束掉
                        if (ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getIsEnd() == 1) {
                            redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
@@ -2070,7 +2125,7 @@
                    //设置一下问题分类
                    IvrTaskTemplateScript ivrTaskTemplateScript = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptByID(serviceSubtaskDetail.getScriptid());
                    if (ivrTaskTemplateScript != null)
                        serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScript.getAssortid());
                        serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScript.getScriptAssortid());
                }
                serviceSubtaskDetail.setSubId(selectServiceSubtaskList.get(0).getId());
@@ -2088,7 +2143,7 @@
                        //设置一下问题分类
                        IvrTaskTemplateScript ivrTaskTemplateScript = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptByID(serviceSubtaskDetail.getScriptid());
                        if (ivrTaskTemplateScript != null)
                            serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScript.getAssortid());
                            serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScript.getScriptAssortid());
                    }
                    serviceSubtaskDetail.setCreateTime(new Date());
                    serviceSubtaskDetail.setGuid(serviceSubTaskDetailReq.getGuid());
@@ -2539,7 +2594,7 @@
                    ivrTaskTemplateScript.setTemplateID(templateid);
                    ivrTaskTemplateScript.setOrgid(serviceTask.getOrgid());
                    //先默认为1吧,assortid=1  ä»£è¡¨æ˜¯æ»¡æ„åº¦
                    ivrTaskTemplateScript.setAssortid(ivrCategoryid);
                    ivrTaskTemplateScript.setScriptAssortid(ivrCategoryid);
                    List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript);
                    if (CollectionUtils.isNotEmpty(ivrTaskTemplateScripts)) {
                        //需要先计算出发送量,再乘以单个问券满意度题目数量,得到满意度题目总量(包含了未做的)
@@ -3231,7 +3286,7 @@
                if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 6)) {
                    serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L);
                }
                if (serviceSubtask.getSendstate() != null &&  (serviceSubtask.getSendstate() == 5 || serviceSubtask.getSendstate() == 7)) {
                if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 5 || serviceSubtask.getSendstate() == 7)) {
                    serviceSubtaskStatistic.setFollowUpFail(serviceSubtaskStatistic.getFollowUpFail() + 1L);
                }
                if (serviceSubtaskStatistic.getNeedFollowUp() > 0) {
@@ -3349,7 +3404,7 @@
                if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 6)) {
                    serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L);
                }
                if (serviceSubtask.getSendstate() != null &&  (serviceSubtask.getSendstate() == 5 || serviceSubtask.getSendstate() == 7)) {
                if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 5 || serviceSubtask.getSendstate() == 7)) {
                    serviceSubtaskStatistic.setFollowUpFail(serviceSubtaskStatistic.getFollowUpFail() + 1L);
                }
                if (serviceSubtaskStatistic.getNeedFollowUp() > 0) {
@@ -3438,7 +3493,7 @@
        serviceSubtaskDetail.setAssigntime(System.currentTimeMillis());
        serviceSubtaskDetail.setStarttime(System.currentTimeMillis());
        serviceSubtaskDetail.setAnswertime(System.currentTimeMillis());
        serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScriptVO.getAssortid());
        serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScriptVO.getScriptAssortid());
        serviceSubtaskDetail.setAsrtext("无应答");
        if (StringUtils.isNotEmpty(phoneCallReqYQVO.getAsrtext()))
            serviceSubtaskDetail.setAsrtext(phoneCallReqYQVO.getAsrtext());
@@ -3453,11 +3508,13 @@
        serviceSubtaskDetail.setTargetoptions(ivrTaskTemplateScriptVO.getTargetOptions());
        serviceSubtaskDetail.setExtemplateText(ivrTaskTemplateScriptVO.getExtemplateText());
        serviceSubtaskDetail.setScriptid(ivrTaskTemplateScriptVO.getId());
        serviceSubtaskDetail.setLibTemplateid(serviceSubtask.getLibtemplateid() != null ? serviceSubtask.getLibtemplateid().intValue() : null);
        int i = 1;
        for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) {
            if (ivrTaskTemplateTargetoption.getIsUserOperation() == 1) {
                serviceSubtaskDetail.setMatchedtext(ivrTaskTemplateTargetoption.getTargetvalue());
                serviceSubtaskDetail.setScore(ivrTaskTemplateTargetoption.getScore() != null ? ivrTaskTemplateTargetoption.getScore().toString() : "0");
            }
            serviceSubtaskDetail.setTargetvalue(StringUtils.isEmpty(serviceSubtaskDetail.getTargetvalue()) ? ivrTaskTemplateTargetoption.getTargetvalue() : serviceSubtaskDetail.getTargetvalue() + "&" + ivrTaskTemplateTargetoption.getTargetvalue());
        }
@@ -3788,6 +3845,7 @@
            }
        }
        //尽管失败,这里也将当前发送方式继续设置成“电话”,sendstate设置成3;因为ryTask里的补偿的定时任务运行时,会找到这条subtask,并进行处理
        serviceSubtask.setCurrentPreachform(preachform);
        serviceSubtask.setSendstate(3L);
        //如果等于9,则说明电话正常结束了
@@ -3948,7 +4006,7 @@
        }).collect(Collectors.toList());
    }
    public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity entity){
    public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity entity) {
        return serviceSubtaskMapper.getCurrentUserServiceSubtaskCount(entity);
    }
}
smartor/src/main/java/com/smartor/service/impl/SvyLibScriptCategoryServiceImpl.java
@@ -3,6 +3,7 @@
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.smartor.common.PinYinUtil;
import com.smartor.domain.IvrLibaTargetAssort;
import com.smartor.domain.SvyLibScriptCategory;
import com.smartor.domain.SvyLibScriptCategoryVO;
@@ -50,23 +51,7 @@
    @Override
    public List<SvyLibScriptCategoryVO> selectSvyLibScriptCategoryList(SvyLibScriptCategory svyLibScriptCategory) {
        List<SvyLibScriptCategory> svyLibScriptCategories = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory);
////        //将pid为空的,过滤掉
//        svyLibScriptCategories = svyLibScriptCategories.stream().filter(assort -> assort.getPid() == null).collect(Collectors.toList());
//
//        List<SvyLibScriptCategoryVO> SvyLibScriptCategoryVO = DtoConversionUtils.sourceToTarget(svyLibScriptCategories, SvyLibScriptCategoryVO.class);
//        //遍历查出来的数据,通过 id=pid èŽ·å–ä»–ä»¬çš„å­æ•°æ®
//        for (SvyLibScriptCategoryVO svyLibScriptCategoryVO : SvyLibScriptCategoryVO) {
//            if (svyLibScriptCategoryVO.getPid() != null) {
//                continue;
//            }
//            SvyLibScriptCategory svyLibScriptCategory1 = new SvyLibScriptCategory();
//            svyLibScriptCategory1.setPid(svyLibScriptCategoryVO.getId());
//            List<SvyLibScriptCategory> svyLibScriptCategories1 = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory1);
//            if (!Collections.isEmpty(svyLibScriptCategories1)) {
//                svyLibScriptCategoryVO.setSvyLibScriptCategoryList(svyLibScriptCategories1);
//            }
//        }
  List<SvyLibScriptCategoryVO> svyLibScriptCategoryVOS = DtoConversionUtils.sourceToTarget(svyLibScriptCategories, SvyLibScriptCategoryVO.class);
        List<SvyLibScriptCategoryVO> svyLibScriptCategoryVOS = DtoConversionUtils.sourceToTarget(svyLibScriptCategories, SvyLibScriptCategoryVO.class);
        List<SvyLibScriptCategoryVO> rootList = new ArrayList<>();
        Map<Long, SvyLibScriptCategoryVO> categoryMap = new HashMap<>();
@@ -76,7 +61,7 @@
            categoryMap.put(category.getId(), category);
        }
            for (SvyLibScriptCategoryVO category : svyLibScriptCategoryVOS) {
        for (SvyLibScriptCategoryVO category : svyLibScriptCategoryVOS) {
            if (category.getPid() == null || category.getPid() == -1) {
                // é¡¶å±‚节点
                rootList.add(category);
@@ -113,6 +98,9 @@
    @Override
    public int updateSvyLibScriptCategory(SvyLibScriptCategory svyLibScriptCategory) {
        svyLibScriptCategory.setUpdateTime(DateUtils.getNowDate());
        if (svyLibScriptCategory.getName() != null && svyLibScriptCategory.getName().contains("满意度") && svyLibScriptCategory.getPid() != -1) {
            svyLibScriptCategory.setType(PinYinUtil.getpy(svyLibScriptCategory.getName()));
        }
        return svyLibScriptCategoryMapper.updateSvyLibScriptCategory(svyLibScriptCategory);
    }
@@ -165,6 +153,9 @@
        svyLibScriptCategory.setUpdateTime(new Date());
        svyLibScriptCategory.setCreateTime(new Date());
        if (svyLibScriptCategory.getPid() == null) svyLibScriptCategory.setPid((long) -1);
        if (svyLibScriptCategory.getName() != null && svyLibScriptCategory.getName().contains("满意度") && svyLibScriptCategory.getPid() != -1) {
            svyLibScriptCategory.setType(PinYinUtil.getpy(svyLibScriptCategory.getName()));
        }
        i = svyLibScriptCategoryMapper.insertSvyLibScriptCategory(svyLibScriptCategory);
        log.info("问题话术分类库一级树的主键:{}", svyLibScriptCategory.getId());
@@ -182,6 +173,10 @@
                if (seqMax1 != null) {
                    svyLibScriptCategory1.setSeqno(seqMax1 + 1);
                }
                if (svyLibScriptCategory1.getName() != null && svyLibScriptCategory1.getName().contains("满意度")) {
                    svyLibScriptCategory1.setType(PinYinUtil.getpy(svyLibScriptCategory1.getName()));
                }
                svyLibScriptCategory1.setGuid(svyLibScriptCategoryVO.getGuid());
                svyLibScriptCategory1.setOrgid(svyLibScriptCategoryVO.getOrgid());
                svyLibScriptCategoryMapper.insertSvyLibScriptCategory(svyLibScriptCategory1);
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
@@ -35,6 +35,8 @@
    @Autowired
    private SvyLibTemplateTagMapper svyLibTemplateTagMapper;
    @Autowired
    private SvyLibScriptCategoryMapper svyLibScriptCategoryMapper;
    @Autowired
    private Icd10AssociationMapper icd10AssociationMapper;
    /**
@@ -182,6 +184,13 @@
            for (SvyLibTemplateScript svyLibScript : svyLibTemplate.getSvyTemplateLibScripts()) {
                svyLibScript.setGuid(svyLibTemplateVO.getGuid());
                svyLibScript.setOrgid(svyLibTemplateVO.getOrgid());
                //获取一下分类名称
                if(StringUtils.isEmpty(svyLibScript.getCategoryName())){
                    SvyLibScriptCategory svyLibScriptCategory = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryById(svyLibScript.getCategoryid());
                    if(svyLibScriptCategory != null) svyLibScript.setCategoryName(svyLibScriptCategory.getName());
                }
                //对题目进行处理
                if (svyLibScript.getIsoperation() != null) {
                    //问题的操作不为空
smartor/src/main/resources/mapper/smartor/IvrLibaScriptAssortMapper.xml
@@ -14,23 +14,36 @@
        <result property="seqno" column="seqno"/>
        <result property="guid" column="guid"/>
        <result property="orgid" column="orgid"/>
        <result property="type" column="type"/>
    </resultMap>
    <sql id="selectIvrLibaScriptAssortVo">
        select id, index_assort_name, guid, orgid,del_flag, create_time, update_time, pid, seqno
        select id,
               index_assort_name,
               guid,
               orgid,
               del_flag,
               create_time,
               update_time,
               pid,
               seqno,
               type
        from ivr_liba_script_assort
    </sql>
    <select id="selectIvrLibaScriptAssortList" parameterType="com.smartor.domain.IvrLibaScriptAssort"
            resultMap="IvrLibaScriptAssortResult">
        <include refid="selectIvrLibaScriptAssortVo"/>
        where 1=1
            <if test="indexAssortName != null  and indexAssortName != ''">and index_assort_name like concat('%',
                #{indexAssortName}, '%')
            </if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            and del_flag=0
        where del_flag=0
        <if test="indexAssortName != null  and indexAssortName != ''">and index_assort_name like concat('%',
            #{indexAssortName}, '%')
        </if>
        <if test="type != null  and type != ''">and type like concat('%',
            #{type}, '%')
        </if>
        <if test="pid != null ">and pid = #{pid}</if>
        <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
        and del_flag=0
        order by seqno asc
    </select>
@@ -57,6 +70,7 @@
            <if test="seqno != null">seqno,</if>
            <if test="guid != null">guid,</if>
            <if test="orgid != null">orgid,</if>
            <if test="type != null">type,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="indexAssortName != null and indexAssortName != ''">#{indexAssortName},</if>
@@ -67,6 +81,7 @@
            <if test="seqno != null">#{seqno},</if>
            <if test="guid != null">#{guid},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="type != null">#{type},</if>
        </trim>
    </insert>
@@ -81,6 +96,7 @@
            <if test="seqno != null">seqno = #{seqno},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="type != null">type = #{type},</if>
        </trim>
        where id = #{id}
    </update>
@@ -88,7 +104,7 @@
    <update id="deleteIvrLibaScriptAssortById" parameterType="Long">
        update ivr_liba_script_assort
        <trim prefix="SET" suffixOverrides=",">
           del_flag = 1
            del_flag = 1
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml
@@ -37,12 +37,14 @@
        <result property="appenddesc" column="appenddesc"/>
        <result property="picturePath" column="picture_path"/>
        <result property="isEnd" column="is_end"/>
        <result property="isException" column="is_exception"/>
    </resultMap>
    <sql id="selectIvrLibaScriptTargetoptionVo">
        select id,
               targetid,
               is_end,
               is_exception,
               picture_path,
               targetname,
               appendflag,
@@ -92,6 +94,7 @@
            <if test="appendflag != null">and appendflag = #{appendflag}</if>
            <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
            <if test="picturePath != null">and picture_path = #{picturePath}</if>
            <if test="isException != null">and is_exception = #{isException}</if>
    </select>
    <select id="selectIvrLibaScriptTargetoptionByTargetoptionid" parameterType="String"
@@ -135,6 +138,7 @@
            <if test="appenddesc != null">appenddesc,</if>
            <if test="picturePath != null">picture_path,</if>
            <if test="isEnd != null ">is_end,</if>
            <if test="isException != null ">is_exception,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
@@ -169,6 +173,7 @@
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="picturePath != null">#{picturePath},</if>
            <if test="isEnd != null ">#{isEnd},</if>
            <if test="isException != null ">#{isException},</if>
        </trim>
    </insert>
@@ -206,6 +211,7 @@
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="picturePath != null">picture_path = #{picturePath},</if>
            <if test="isEnd != null ">is_end = #{isEnd},</if>
            <if test="isException != null ">is_exception = #{isException},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -22,7 +22,7 @@
        <result property="submoduleVoice" column="submoduleVoice"/>
        <result property="noClearlyText" column="noClearlyText"/>
        <result property="noClearlyVoice" column="noClearlyVoice"/>
        <result property="categoryName" column="categoryName"/>
        <result property="scriptAssortname" column="script_assortname"/>
        <result property="playWavOnly" column="playWavOnly"/>
        <result property="valueType" column="value_type"/>
        <result property="delFlag" column="del_flag"/>
@@ -48,14 +48,23 @@
        <result property="sort" column="sort"/>
        <result property="score" column="score"/>
        <result property="groupName" column="group_name"/>
        <result property="assortid" column="assortid"/>
        <result property="scriptAssortid" column="script_assortid"/>
        <result property="dutyDeptName" column="duty_dept_name"/>
        <result property="dutyDeptCode" column="duty_dept_code"/>
        <result property="reportDeptCode" column="report_dept_name"/>
        <result property="reportDeptName" column="report_dept_code"/>
    </resultMap>
    <sql id="selectIvrLibaTemplateScriptVo">
        select id,
               scriptno,
               sort,
               assortid,
               script_assortname,
               duty_dept_name,
               duty_dept_code,
               report_dept_name,
               report_dept_code,
               script_assortid,
               group_name,
               branch_flag,
               branch_nextscriptno,
@@ -75,7 +84,6 @@
               submoduleVoice,
               noClearlyText,
               noClearlyVoice,
               categoryName,
               targetid,
               value_type,
               targetvalue,
@@ -101,50 +109,64 @@
    <select id="selectIvrLibaTemplateScriptList" parameterType="com.smartor.domain.IvrLibaTemplateScript"
            resultMap="IvrLibaTemplateScriptResult">
        <include refid="selectIvrLibaTemplateScriptVo"/>
        where 1=1
            and del_flag = 0
            <if test="scriptno != null ">and scriptno = #{scriptno}</if>
            <if test="assortid != null ">and assortid = #{assortid}</if>
            <if test="groupName != null ">and group_name = #{groupName}</if>
            <if test="scriptDesc != null ">and script_desc = #{scriptDesc}</if>
            <if test="templateid != null ">and templateid = #{templateid}</if>
            <if test="scriptPoint != null  and scriptPoint != ''">and script_point = #{scriptPoint}</if>
            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
            <if test="ivrVoice != null  and ivrVoice != ''">and ivr_voice = #{ivrVoice}</if>
            <if test="ivrtext != null  and ivrtext != ''">and ivrtext = #{ivrtext}</if>
            <if test="noMatchText != null  and noMatchText != ''">and noMatchText = #{noMatchText}</if>
            <if test="noMatchVoice != null  and noMatchVoice != ''">and noMatchVoice = #{noMatchVoice}</if>
            <if test="slienceText != null  and slienceText != ''">and slienceText = #{slienceText}</if>
            <if test="slienceVoice != null  and slienceVoice != ''">and slienceVoice = #{slienceVoice}</if>
            <if test="submoduleText != null  and submoduleText != ''">and submoduleText = #{submoduleText}</if>
            <if test="submoduleVoice != null  and submoduleVoice != ''">and submoduleVoice = #{submoduleVoice}</if>
            <if test="noClearlyText != null  and noClearlyText != ''">and noClearlyText = #{noClearlyText}</if>
            <if test="noClearlyVoice != null  and noClearlyVoice != ''">and noClearlyVoice = #{noClearlyVoice}</if>
            <if test="nextScriptno != null  and nextScriptno != ''">and next_scriptno = #{nextScriptno}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                #{branchNextscriptno}
            </if>
            <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
                '%')
            </if>
            <if test="scriptTopic != null  and scriptTopic != ''">and script_topic like concat('%',
                #{scriptTopic},
                '%')
            </if>
            <if test="playWavOnly != null ">and playWavOnly = #{playWavOnly}</if>
            <if test="valueType != null ">and value_type = #{valueType}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
            <if test="isMust != null  and isMust != ''">and is_must = #{isMust}</if>
            <if test="scriptType != null">and script_type = #{scriptType}</if>
            <if test="sort != null">and sort = #{sort}</if>
            <if test="score != null">and score = #{score}</if>
        where del_flag = 0
        <if test="scriptno != null ">and scriptno = #{scriptno}</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>
        <if test="templateid != null ">and templateid = #{templateid}</if>
        <if test="scriptPoint != null  and scriptPoint != ''">and script_point = #{scriptPoint}</if>
        <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
        <if test="ivrVoice != null  and ivrVoice != ''">and ivr_voice = #{ivrVoice}</if>
        <if test="ivrtext != null  and ivrtext != ''">and ivrtext = #{ivrtext}</if>
        <if test="noMatchText != null  and noMatchText != ''">and noMatchText = #{noMatchText}</if>
        <if test="noMatchVoice != null  and noMatchVoice != ''">and noMatchVoice = #{noMatchVoice}</if>
        <if test="slienceText != null  and slienceText != ''">and slienceText = #{slienceText}</if>
        <if test="slienceVoice != null  and slienceVoice != ''">and slienceVoice = #{slienceVoice}</if>
        <if test="submoduleText != null  and submoduleText != ''">and submoduleText = #{submoduleText}</if>
        <if test="submoduleVoice != null  and submoduleVoice != ''">and submoduleVoice = #{submoduleVoice}</if>
        <if test="noClearlyText != null  and noClearlyText != ''">and noClearlyText = #{noClearlyText}</if>
        <if test="noClearlyVoice != null  and noClearlyVoice != ''">and noClearlyVoice = #{noClearlyVoice}</if>
        <if test="nextScriptno != null  and nextScriptno != ''">and next_scriptno = #{nextScriptno}</if>
        <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
        <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
            #{branchNextscriptno}
        </if>
        <if test="scriptAssortname != null  and scriptAssortname != ''">and script_assortname like concat('%',
            #{scriptAssortname},
            '%')
        </if>
        <if test="dutyDeptName != null  and dutyDeptName != ''">and duty_dept_name like concat('%', #{dutyDeptName},
            '%')
        </if>
        <if test="dutyDeptCode != null  and dutyDeptCode != ''">and duty_dept_code like concat('%', #{dutyDeptCode},
            '%')
        </if>
        <if test="reportDeptName != null  and reportDeptName != ''">and report_dept_name like concat('%',
            #{reportDeptName},
            '%')
        </if>
        <if test="reportDeptCode != null  and reportDeptCode != ''">and report_dept_code like concat('%',
            #{reportDeptCode},
            '%')
        </if>
        <if test="scriptTopic != null  and scriptTopic != ''">and script_topic like concat('%',
            #{scriptTopic},
            '%')
        </if>
        <if test="playWavOnly != null ">and playWavOnly = #{playWavOnly}</if>
        <if test="valueType != null ">and value_type = #{valueType}</if>
        <if test="isupload != null ">and isupload = #{isupload}</if>
        <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
        <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
        <if test="pid != null ">and pid = #{pid}</if>
        <if test="guid != null  and guid != ''">and guid = #{guid}</if>
        <if test="targetid != null ">and targetid = #{targetid}</if>
        <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
        <if test="isMust != null  and isMust != ''">and is_must = #{isMust}</if>
        <if test="scriptType != null">and script_type = #{scriptType}</if>
        <if test="sort != null">and sort = #{sort}</if>
        <if test="score != null">and score = #{score}</if>
    </select>
    <select id="selectIvrLibaTemplateScriptByID" parameterType="Long" resultMap="IvrLibaTemplateScriptResult">
@@ -171,7 +193,7 @@
            <if test="submoduleVoice != null">submoduleVoice,</if>
            <if test="noClearlyText != null">noClearlyText,</if>
            <if test="noClearlyVoice != null">noClearlyVoice,</if>
            <if test="categoryName != null">categoryName,</if>
            <if test="scriptAssortname != null">script_assortname,</if>
            <if test="playWavOnly != null">playWavOnly,</if>
            <if test="valueType != null">value_type,</if>
            <if test="delFlag != null and delFlag != ''">del_flag,</if>
@@ -198,7 +220,11 @@
            <if test="score != null ">score,</if>
            <if test="ivrtext != null ">ivrtext,</if>
            <if test="groupName != null ">group_name,</if>
            <if test="assortid != null ">assortid,</if>
            <if test="scriptAssortid != null ">script_assortid,</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">duty_dept_name,</if>
            <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>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="scriptno != null">#{scriptno},</if>
@@ -215,7 +241,7 @@
            <if test="submoduleVoice != null">#{submoduleVoice},</if>
            <if test="noClearlyText != null">#{noClearlyText},</if>
            <if test="noClearlyVoice != null">#{noClearlyVoice},</if>
            <if test="categoryName != null">#{categoryName},</if>
            <if test="scriptAssortname != null">#{scriptAssortname},</if>
            <if test="playWavOnly != null">#{playWavOnly},</if>
            <if test="valueType != null">#{valueType},</if>
            <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
@@ -242,7 +268,11 @@
            <if test="score != null ">#{score},</if>
            <if test="ivrtext != null ">#{ivrtext},</if>
            <if test="groupName != null ">#{groupName},</if>
            <if test="assortid != null ">#{assortid},</if>
            <if test="scriptAssortid != null ">#{scriptAssortid},</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">#{dutyDeptName},</if>
            <if test="dutyDeptCode != null  and dutyDeptCode != ''">#{dutyDeptCode},</if>
            <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
            <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
        </trim>
    </insert>
@@ -263,7 +293,7 @@
            <if test="submoduleVoice != null">submoduleVoice = #{submoduleVoice},</if>
            <if test="noClearlyText != null">noClearlyText = #{noClearlyText},</if>
            <if test="noClearlyVoice != null">noClearlyVoice = #{noClearlyVoice},</if>
            <if test="categoryName != null">categoryName = #{categoryName},</if>
            <if test="scriptAssortname != null">script_assortname = #{scriptAssortname},</if>
            <if test="playWavOnly != null">playWavOnly = #{playWavOnly},</if>
            <if test="valueType != null">value_type = #{valueType},</if>
            <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
@@ -288,10 +318,14 @@
            <if test="branchFlag != null  and branchFlag != ''">branch_flag = #{branchFlag},</if>
            <if test="score != null ">score = #{score},</if>
            <if test="groupName != null ">group_name = #{groupName},</if>
            <if test="assortid != null ">assortid = #{assortid},</if>
            <if test="scriptAssortid != null ">script_assortid = #{scriptAssortid},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno =
                #{branchNextscriptno},
            </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>
            <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code = #{reportDeptCode},</if>
        </trim>
        where id = #{id}
    </update>
@@ -309,5 +343,17 @@
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    <select id="queryLibTemplateIds" resultMap="IvrLibaTemplateScriptResult">
        <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>
        </if>
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
@@ -41,11 +41,13 @@
        <result property="isEnd" column="is_end"/>
        <result property="sendTaskid" column="send_taskid"/>
        <result property="sendTaskname" column="send_taskname"/>
        <result property="isException" column="is_exception"/>
    </resultMap>
    <sql id="selectIvrLibaTemplateTargetoptionVo">
        select id,
               targetid,
               is_exception,
               send_taskid,
               send_taskname,
               is_end,
@@ -75,6 +77,7 @@
        where 1=1
            and del_flag = 0
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="isException != null ">and is_exception = #{isException}</if>
            <if test="isEnd != null ">and is_end = #{isEnd}</if>
            <if test="score != null ">and score = #{score}</if>
            <if test="targetname != null ">and targetname = #{targetname}</if>
@@ -150,6 +153,7 @@
            <if test="isEnd != null ">is_end,</if>
            <if test="sendTaskid != null">send_taskid,</if>
            <if test="sendTaskname != null">send_taskname,</if>
            <if test="isException != null">is_exception,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="targetid != null">#{targetid},</if>
@@ -186,6 +190,7 @@
            <if test="isEnd != null ">#{isEnd},</if>
            <if test="sendTaskid != null">#{sendTaskid},</if>
            <if test="sendTaskname != null">#{sendTaskname},</if>
            <if test="isException != null">#{isException},</if>
        </trim>
    </insert>
@@ -226,6 +231,7 @@
            <if test="isEnd != null ">is_end = #{isEnd},</if>
            <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if>
            <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if>
            <if test="isException != null">is_exception = #{isException},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -17,7 +17,7 @@
        <result property="submoduleVoice" column="submoduleVoice"/>
        <result property="noClearlyText" column="noClearlyText"/>
        <result property="noClearlyVoice" column="noClearlyVoice"/>
        <result property="categoryName" column="categoryName"/>
        <result property="scriptAssortname" column="script_assortname"/>
        <result property="targetOptions" column="targetOptions"/>
        <result property="language" column="language"/>
        <result property="playWavOnly" column="playWavOnly"/>
@@ -48,13 +48,21 @@
        <result property="ivrtext" column="ivrtext"/>
        <result property="groupName" column="group_name"/>
        <result property="scriptTopic" column="script_topic"/>
        <result property="assortid" column="assortid"/>
        <result property="scriptAssortid" column="script_assortid"/>
        <result property="dutyDeptName" column="duty_dept_name"/>
        <result property="dutyDeptCode" column="duty_dept_code"/>
        <result property="reportDeptCode" column="report_dept_name"/>
        <result property="reportDeptName" column="report_dept_code"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateScriptVo">
        select id,
               taskid,
               assortid,
               duty_dept_name,
               duty_dept_code,
               report_dept_name,
               report_dept_code,
               script_assortid,
               sort,
               ivrtext,
               script_type,
@@ -74,7 +82,7 @@
               submoduleVoice,
               noClearlyText,
               noClearlyVoice,
               categoryName,
               script_assortname,
               targetOptions, language, playWavOnly, value_type, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, targettype, targetid, targetvalue, otherdata, is_must, question_result
        from ivr_task_template_script
    </sql>
@@ -83,48 +91,63 @@
            resultMap="IvrTaskTemplateScriptResult">
        <include refid="selectIvrTaskTemplateScriptVo"/>
        where 1=1
            and del_flag = 0
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="assortid != null ">and assortid = #{assortid}</if>
            <if test="score != null ">and score = #{score}</if>
            <if test="scriptTopic != null ">and script_topic = #{scriptTopic}</if>
            <if test="ivrtext != null ">and ivrtext = #{ivrtext}</if>
            <if test="sort != null ">and sort = #{sort}</if>
            <if test="templateID != null ">and templateID = #{templateID}</if>
            <if test="questionPoint != null  and questionPoint != ''">and questionPoint = #{questionPoint}</if>
            <if test="noMatchText != null  and noMatchText != ''">and noMatchText = #{noMatchText}</if>
            <if test="noMatchVoice != null  and noMatchVoice != ''">and noMatchVoice = #{noMatchVoice}</if>
            <if test="slienceText != null  and slienceText != ''">and slienceText = #{slienceText}</if>
            <if test="slienceVoice != null  and slienceVoice != ''">and slienceVoice = #{slienceVoice}</if>
            <if test="submoduleText != null  and submoduleText != ''">and submoduleText = #{submoduleText}</if>
            <if test="submoduleVoice != null  and submoduleVoice != ''">and submoduleVoice = #{submoduleVoice}</if>
            <if test="noClearlyText != null  and noClearlyText != ''">and noClearlyText = #{noClearlyText}</if>
            <if test="noClearlyVoice != null  and noClearlyVoice != ''">and noClearlyVoice = #{noClearlyVoice}</if>
            <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
                '%')
            </if>
            <if test="targetOptions != null  and targetOptions != ''">and targetOptions = #{targetOptions}</if>
            <if test="language != null  and language != ''">and language = #{language}</if>
            <if test="playWavOnly != null ">and playWavOnly = #{playWavOnly}</if>
            <if test="valueType != null ">and value_type = #{valueType}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
            <if test="otherdata != null  and otherdata != ''">and otherdata = #{otherdata}</if>
            <if test="isMust != null  and isMust != ''">and is_must = #{isMust}</if>
            <if test="questionResult != null  and questionResult != ''">and question_result = #{questionResult}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
            <if test="scriptType != null  and scriptType != ''">and script_type = #{scriptType}</if>
            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
            <if test="nextScriptno != null  and nextScriptno != ''">and next_scriptno = #{nextScriptno}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                #{branchNextscriptno}
            </if>
        and del_flag = 0
        <if test="taskid != null ">and taskid = #{taskid}</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>
        <if test="ivrtext != null ">and ivrtext = #{ivrtext}</if>
        <if test="sort != null ">and sort = #{sort}</if>
        <if test="templateID != null ">and templateID = #{templateID}</if>
        <if test="questionPoint != null  and questionPoint != ''">and questionPoint = #{questionPoint}</if>
        <if test="noMatchText != null  and noMatchText != ''">and noMatchText = #{noMatchText}</if>
        <if test="noMatchVoice != null  and noMatchVoice != ''">and noMatchVoice = #{noMatchVoice}</if>
        <if test="slienceText != null  and slienceText != ''">and slienceText = #{slienceText}</if>
        <if test="slienceVoice != null  and slienceVoice != ''">and slienceVoice = #{slienceVoice}</if>
        <if test="submoduleText != null  and submoduleText != ''">and submoduleText = #{submoduleText}</if>
        <if test="submoduleVoice != null  and submoduleVoice != ''">and submoduleVoice = #{submoduleVoice}</if>
        <if test="noClearlyText != null  and noClearlyText != ''">and noClearlyText = #{noClearlyText}</if>
        <if test="noClearlyVoice != null  and noClearlyVoice != ''">and noClearlyVoice = #{noClearlyVoice}</if>
        <if test="scriptAssortname != null  and scriptAssortname != ''">and script_assortname like concat('%',
            #{scriptAssortname},
            '%')
        </if>
        <if test="dutyDeptName != null  and dutyDeptName != ''">and duty_dept_name like concat('%', #{dutyDeptName},
            '%')
        </if>
        <if test="dutyDeptCode != null  and dutyDeptCode != ''">and duty_dept_code like concat('%', #{dutyDeptCode},
            '%')
        </if>
        <if test="reportDeptName != null  and reportDeptName != ''">and report_dept_name like concat('%',
            #{reportDeptName},
            '%')
        </if>
        <if test="reportDeptCode != null  and reportDeptCode != ''">and report_dept_code like concat('%',
            #{reportDeptCode},
            '%')
        </if>
        <if test="targetOptions != null  and targetOptions != ''">and targetOptions = #{targetOptions}</if>
        <if test="language != null  and language != ''">and language = #{language}</if>
        <if test="playWavOnly != null ">and playWavOnly = #{playWavOnly}</if>
        <if test="valueType != null ">and value_type = #{valueType}</if>
        <if test="isupload != null ">and isupload = #{isupload}</if>
        <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
        <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
        <if test="pid != null ">and pid = #{pid}</if>
        <if test="guid != null  and guid != ''">and guid = #{guid}</if>
        <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
        <if test="targetid != null ">and targetid = #{targetid}</if>
        <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
        <if test="otherdata != null  and otherdata != ''">and otherdata = #{otherdata}</if>
        <if test="isMust != null  and isMust != ''">and is_must = #{isMust}</if>
        <if test="questionResult != null  and questionResult != ''">and question_result = #{questionResult}</if>
        <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
        <if test="scriptType != null  and scriptType != ''">and script_type = #{scriptType}</if>
        <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
        <if test="nextScriptno != null  and nextScriptno != ''">and next_scriptno = #{nextScriptno}</if>
        <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
            #{branchNextscriptno}
        </if>
    </select>
    <select id="selectIvrTaskTemplateScriptByID" parameterType="Long" resultMap="IvrTaskTemplateScriptResult">
@@ -147,7 +170,7 @@
            <if test="submoduleVoice != null">submoduleVoice,</if>
            <if test="noClearlyText != null">noClearlyText,</if>
            <if test="noClearlyVoice != null">noClearlyVoice,</if>
            <if test="categoryName != null">categoryName,</if>
            <if test="scriptAssortname != null">script_assortname,</if>
            <if test="targetOptions != null">targetOptions,</if>
            <if test="language != null">language,</if>
            <if test="playWavOnly != null">playWavOnly,</if>
@@ -173,11 +196,15 @@
            <if test="scriptType != null  and scriptType != ''">script_type,</if>
            <if test="scriptContent != null  and scriptContent != ''">script_content,</if>
            <if test="sort != null ">sort,</if>
            <if test="nextScriptno != null  and nextScriptno != ''">next_scriptno,</if>
            <if test="nextScriptno != null ">next_scriptno,</if>
            <if test="score != null ">score,</if>
            <if test="ivrtext != null ">ivrtext,</if>
            <if test="scriptTopic != null ">script_topic,</if>
            <if test="assortid != null ">assortid,</if>
            <if test="scriptAssortid != null ">script_assortid,</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">duty_dept_name,</if>
            <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>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -191,7 +218,7 @@
            <if test="submoduleVoice != null">#{submoduleVoice},</if>
            <if test="noClearlyText != null">#{noClearlyText},</if>
            <if test="noClearlyVoice != null">#{noClearlyVoice},</if>
            <if test="categoryName != null">#{categoryName},</if>
            <if test="scriptAssortname != null">#{scriptAssortname},</if>
            <if test="targetOptions != null">#{targetOptions},</if>
            <if test="language != null">#{language},</if>
            <if test="playWavOnly != null">#{playWavOnly},</if>
@@ -217,11 +244,15 @@
            <if test="scriptType != null  and scriptType != ''">#{scriptType},</if>
            <if test="scriptContent != null  and scriptContent != ''">#{scriptContent},</if>
            <if test="sort != null">#{sort},</if>
            <if test="nextScriptno != null  and nextScriptno != ''">#{nextScriptno},</if>
            <if test="nextScriptno != null">#{nextScriptno},</if>
            <if test="score != null ">#{score},</if>
            <if test="ivrtext != null ">#{ivrtext},</if>
            <if test="scriptTopic != null ">#{scriptTopic},</if>
            <if test="assortid != null ">#{assortid},</if>
            <if test="scriptAssortid != null ">#{scriptAssortid},</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">#{dutyDeptName},</if>
            <if test="dutyDeptCode != null  and dutyDeptCode != ''">#{dutyDeptCode},</if>
            <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
            <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
        </trim>
    </insert>
@@ -239,7 +270,7 @@
            <if test="submoduleVoice != null">submoduleVoice = #{submoduleVoice},</if>
            <if test="noClearlyText != null">noClearlyText = #{noClearlyText},</if>
            <if test="noClearlyVoice != null">noClearlyVoice = #{noClearlyVoice},</if>
            <if test="categoryName != null">categoryName = #{categoryName},</if>
            <if test="scriptAssortname != null">script_assortname = #{scriptAssortname},</if>
            <if test="targetOptions != null">targetOptions = #{targetOptions},</if>
            <if test="language != null">language = #{language},</if>
            <if test="playWavOnly != null">playWavOnly = #{playWavOnly},</if>
@@ -267,17 +298,22 @@
            <if test="scriptType != null  and scriptType != ''">script_type = #{scriptType},</if>
            <if test="scriptContent != null  and scriptContent != ''">script_content = #{scriptContent},</if>
            <if test="sort != null">sort = #{sort},</if>
            <if test="nextScriptno != null  and nextScriptno != ''">next_scriptno = #{nextScriptno},</if>
            <if test="nextScriptno != null ">next_scriptno = #{nextScriptno},</if>
            <if test="score != null">score = #{score},</if>
            <if test="ivrtext != null">ivrtext = #{ivrtext},</if>
            <if test="scriptTopic != null ">script_topic = #{scriptTopic},</if>
            <if test="assortid != null ">assortid = #{assortid},</if>
            <if test="scriptAssortid != null ">script_assortid = #{scriptAssortid},</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>
            <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code = #{reportDeptCode},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteIvrTaskTemplateScriptByID" parameterType="Long">
        update  ivr_task_template_script set del_flag=1
        update ivr_task_template_script
        set del_flag=1
        where ID = #{ID}
    </delete>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
@@ -44,11 +44,13 @@
        <result property="isEnd" column="is_end"/>
        <result property="sendTaskid" column="send_taskid"/>
        <result property="sendTaskname" column="send_taskname"/>
        <result property="isException" column="is_exception"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateTargetoptionVo">
        select id,
               taskid,
               is_exception,
               send_taskid,
               send_taskname,
               is_end,
@@ -73,6 +75,7 @@
        <include refid="selectIvrTaskTemplateTargetoptionVo"/>
        where 1=1
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="isException != null ">and is_exception = #{isException}</if>
            <if test="isEnd != null ">and is_end = #{isEnd}</if>
            <if test="templateID != null ">and templateID = #{templateID}</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
@@ -157,6 +160,7 @@
            <if test="isEnd != null ">is_end,</if>
            <if test="sendTaskid != null">send_taskid,</if>
            <if test="sendTaskname != null">send_taskname,</if>
            <if test="isException != null ">is_exception,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -196,6 +200,7 @@
            <if test="isEnd != null ">#{isEnd},</if>
            <if test="sendTaskid != null">#{sendTaskid},</if>
            <if test="sendTaskname != null">#{sendTaskname},</if>
            <if test="isException != null ">#{isException},</if>
        </trim>
    </insert>
@@ -239,6 +244,7 @@
            <if test="isEnd != null ">is_end = #{isEnd},</if>
            <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if>
            <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if>
            <if test="isException != null ">is_exception = #{isException},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
@@ -370,14 +370,14 @@
        {CALL sp_query_outhosp(
                #{outhospno,     jdbcType=VARCHAR,  mode=IN},
                #{serialnum,     jdbcType=VARCHAR,  mode=IN},
                #{patid,         jdbcType=BIGINT,   mode=IN},
                #{patid,         jdbcType=INTEGER,   mode=IN},
                #{patname,       jdbcType=VARCHAR,  mode=IN},
                #{patno,        jdbcType=VARCHAR,  mode=IN},
                #{hospitalname,  jdbcType=VARCHAR,  mode=IN},
                #{hospitalcode,  jdbcType=VARCHAR,  mode=IN},
                #{icd10code,     jdbcType=VARCHAR,  mode=IN},
                #{diagname,      jdbcType=VARCHAR,  mode=IN},
                #{deptid,        jdbcType=BIGINT,   mode=IN},
                #{deptid,        jdbcType=INTEGER,   mode=IN},
                #{deptcode,      jdbcType=VARCHAR,  mode=IN},
                #{deptname,      jdbcType=VARCHAR,  mode=IN},
                #{drcode,        jdbcType=VARCHAR,  mode=IN},
@@ -385,8 +385,8 @@
                #{beginAdmitdate,jdbcType=DATE,     mode=IN},
                #{endAdmitdate,  jdbcType=DATE,     mode=IN},
                #{orgid,         jdbcType=VARCHAR,  mode=IN},
                #{isupload,      jdbcType=BIGINT,   mode=IN},
                #{schemestatus,  jdbcType=BIGINT,   mode=IN},
                #{isupload,      jdbcType=INTEGER,   mode=IN},
                #{schemestatus,  jdbcType=INTEGER,   mode=IN},
                #{hpi,         jdbcType=VARCHAR,  mode=IN},
                #{mainsuit,         jdbcType=VARCHAR,  mode=IN},
                #{pid,   jdbcType=INTEGER,  mode=IN},
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -18,6 +18,7 @@
        <result property="assigntime" column="assigntime"/>
        <result property="starttime" column="starttime"/>
        <result property="answertime" column="answertime"/>
        <result property="silent" column="silent"/>
        <result property="dtmfKey" column="dtmf_key"/>
        <result property="musicpath" column="musicpath"/>
@@ -55,6 +56,9 @@
        <result property="patid" column="patid"/>
        <result property="guid" column="guid"/>
        <result property="extemplateText" column="extemplate_text"/>
        <result property="templateType" column="template_type"/>
        <result property="libTemplateid" column="lib_templateid"/>
        <result property="score" column="score"/>
    </resultMap>
    <resultMap type="com.smartor.domain.ServiceSubtaskDetailTarget" id="ServiceSubtaskDetailTargetResult">
        <result property="targetid" column="targetid"/>
@@ -66,6 +70,7 @@
    <sql id="selectServiceSubtaskDetailVo">
        select id,
               sub_id,
               lib_templateid,
               targetid,
               answerps,
               scriptid,
@@ -113,6 +118,8 @@
               update_by,
               update_time,
               value_type,
               template_type,
               score,
               create_by
        from service_subtask_detail
    </sql>
@@ -121,56 +128,79 @@
            resultMap="ServiceSubtaskDetailResult">
        <include refid="selectServiceSubtaskDetailVo"/>
        where 1=1
            <if test="subId != null">and sub_id = #{subId}</if>
            <if test="targetid != null">and targetid = #{targetid}</if>
            <if test="extemplateText != null">and extemplate_text = #{extemplateText}</if>
            <if test="taskid != null">and taskid = #{taskid}</if>
            <if test="uuid != null  and uuid != ''">and uuid = #{uuid}</if>
            <if test="phone != null  and phone != ''">and phone = #{phone}</if>
            <if test="operate != null  and operate != ''">and operate = #{operate}</if>
            <if test="displayno != null  and displayno != ''">and displayno = #{displayno}</if>
            <if test="inbound != null ">and inbound = #{inbound}</if>
            <if test="incoming != null ">and incoming = #{incoming}</if>
            <if test="assigntime != null ">and assigntime = #{assigntime}</if>
            <if test="starttime != null ">and starttime = #{starttime}</if>
            <if test="answertime != null ">and answertime = #{answertime}</if>
            <if test="silent != null ">and silent = #{silent}</if>
            <if test="dtmfKey != null  and dtmfKey != ''">and dtmf_key = #{dtmfKey}</if>
            <if test="musicpath != null  and musicpath != ''">and musicpath = #{musicpath}</if>
            <if test="sentIndex != null ">and sent_index = #{sentIndex}</if>
            <if test="sentBegin != null ">and sent_begin = #{sentBegin}</if>
            <if test="asrtext != null  and asrtext != ''">and asrtext = #{asrtext}</if>
            <if test="beginTime != null ">and begin_time = #{beginTime}</if>
            <if test="endTime != null ">and end_time = #{endTime}</if>
            <if test="sentEnd != null ">and sent_end = #{sentEnd}</if>
            <if test="recordpath != null  and recordpath != ''">and recordpath = #{recordpath}</if>
            <if test="recordurl != null  and recordurl != ''">and recordurl = #{recordurl}</if>
            <if test="templateid != null  and templateid != ''">and templateid = #{templateid}</if>
            <if test="templatequestionnum != null ">and templatequestionnum = #{templatequestionnum}</if>
            <if test="switchid != null ">and switchid = #{switchid}</if>
            <if test="categoryid != null ">and categoryid = #{categoryid}</if>
            <if test="questiontext != null  and questiontext != ''">and questiontext = #{questiontext}</if>
            <if test="questionvoice != null  and questionvoice != ''">and questionvoice = #{questionvoice}</if>
            <if test="categoryname != null  and categoryname != ''">and categoryname like concat('%', #{categoryname},
                '%')
            </if>
            <if test="targetoptions != null  and targetoptions != ''">and targetoptions = #{targetoptions}</if>
            <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
            <if test="matchedtext != null  and matchedtext != ''">and matchedtext = #{matchedtext}</if>
            <if test="addtime != null ">and addtime = #{addtime}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="valueType != null  and valueType != ''">and value_type = #{valueType}</if>
            <if test="answerps != null  and answerps != ''">and answerps = #{answerps}</if>
            <if test="comment != null  and comment != ''">and comment = #{comment}</if>
            <if test="scriptid != null ">and scriptid = #{scriptid}</if>
            <if test=" patid != null">and patid = #{patid}</if>
        <if test="subId != null">and sub_id = #{subId}</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>
        <if test="extemplateText != null">and extemplate_text = #{extemplateText}</if>
        <if test="taskid != null">and taskid = #{taskid}</if>
        <if test="uuid != null  and uuid != ''">and uuid = #{uuid}</if>
        <if test="phone != null  and phone != ''">and phone = #{phone}</if>
        <if test="operate != null  and operate != ''">and operate = #{operate}</if>
        <if test="displayno != null  and displayno != ''">and displayno = #{displayno}</if>
        <if test="inbound != null ">and inbound = #{inbound}</if>
        <if test="incoming != null ">and incoming = #{incoming}</if>
        <if test="assigntime != null ">and assigntime = #{assigntime}</if>
        <if test="starttime != null ">and starttime = #{starttime}</if>
        <if test="answertime != null ">and answertime = #{answertime}</if>
        <if test="silent != null ">and silent = #{silent}</if>
        <if test="dtmfKey != null  and dtmfKey != ''">and dtmf_key = #{dtmfKey}</if>
        <if test="musicpath != null  and musicpath != ''">and musicpath = #{musicpath}</if>
        <if test="sentIndex != null ">and sent_index = #{sentIndex}</if>
        <if test="sentBegin != null ">and sent_begin = #{sentBegin}</if>
        <if test="asrtext != null  and asrtext != ''">and asrtext = #{asrtext}</if>
        <if test="beginTime != null ">and begin_time = #{beginTime}</if>
        <if test="endTime != null ">and end_time = #{endTime}</if>
        <if test="sentEnd != null ">and sent_end = #{sentEnd}</if>
        <if test="recordpath != null  and recordpath != ''">and recordpath = #{recordpath}</if>
        <if test="recordurl != null  and recordurl != ''">and recordurl = #{recordurl}</if>
        <if test="templateid != null  and templateid != ''">and templateid = #{templateid}</if>
        <if test="templatequestionnum != null ">and templatequestionnum = #{templatequestionnum}</if>
        <if test="switchid != null ">and switchid = #{switchid}</if>
        <if test="categoryid != null ">and categoryid = #{categoryid}</if>
        <if test="questiontext != null  and questiontext != ''">and questiontext = #{questiontext}</if>
        <if test="questionvoice != null  and questionvoice != ''">and questionvoice = #{questionvoice}</if>
        <if test="categoryname != null  and categoryname != ''">and categoryname like concat('%', #{categoryname},
            '%')
        </if>
        <if test="targetoptions != null  and targetoptions != ''">and targetoptions = #{targetoptions}</if>
        <if test="targetvalue != null  and targetvalue != ''">and targetvalue = #{targetvalue}</if>
        <if test="matchedtext != null  and matchedtext != ''">and matchedtext = #{matchedtext}</if>
        <if test="addtime != null ">and addtime = #{addtime}</if>
        <if test="isupload != null ">and isupload = #{isupload}</if>
        <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
        <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
        <if test="valueType != null  and valueType != ''">and value_type = #{valueType}</if>
        <if test="answerps != null  and answerps != ''">and answerps = #{answerps}</if>
        <if test="comment != null  and comment != ''">and comment = #{comment}</if>
        <if test="scriptid != null ">and scriptid = #{scriptid}</if>
        <if test="patid != null">and patid = #{patid}</if>
        <if test="score != null">and score = #{score}</if>
    </select>
    <select id="selectServiceSubtaskDetailByCalldetailid" parameterType="String" resultMap="ServiceSubtaskDetailResult">
        <include refid="selectServiceSubtaskDetailVo"/>
        where id = #{id}
    </select>
    <select id="queryFillCount" resultType="com.smartor.domain.DTO.ServiceSubtaskDetailDTO">
        select id,questiontext,matchedtext,targetvalue,score
        from service_subtask_detail
        where del_flag = 0
        and sub_id in
        <foreach item="subid" collection="subids" open="(" separator="," close=")">
            #{subid}
        </foreach>
        <if test="questiontext != null">and questiontext = #{questiontext}</if>
    </select>
    <select id="isExistServiceSubtaskDetail" resultType="com.smartor.domain.DTO.ServiceSubtaskDetailDTO">
        select id, questiontext, matchedtext, score
        from service_subtask_detail
        where del_flag = 0
        <if test="subid != null ">and sub_id = #{subid}</if>
        <if test="scriptid != null">and scriptid = #{scriptid}</if>
    </select>
    <insert id="insertServiceSubtaskDetail" parameterType="com.smartor.domain.ServiceSubtaskDetail"
@@ -228,6 +258,9 @@
            <if test=" extemplateText != null">extemplate_text,</if>
            <if test=" guid != null">guid,</if>
            <if test=" categoryid != null">categoryid,</if>
            <if test="templateType != null">template_type,</if>
            <if test="libTemplateid != null">lib_templateid,</if>
            <if test="score != null">score,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
@@ -280,6 +313,9 @@
            <if test="extemplateText != null">#{extemplateText},</if>
            <if test="guid != null">#{guid},</if>
            <if test="categoryid != null">#{categoryid},</if>
            <if test="templateType != null">#{templateType},</if>
            <if test="libTemplateid != null">#{libTemplateid},</if>
            <if test="score != null">#{score},</if>
        </trim>
    </insert>
@@ -333,8 +369,11 @@
            <if test="scriptid != null ">scriptid = #{scriptid},</if>
            <if test=" patid != null">patid = #{patid},</if>
            <if test=" extemplateText != null">extemplate_text = #{extemplateText},</if>
            <if test="libTemplateid != null">lib_templateid = #{libTemplateid},</if>
            <if test=" guid != null">guid = #{guid},</if>
            <if test=" categoryid != null">categoryid = #{categoryid},</if>
            <if test="templateType != null">template_type = #{templateType},</if>
            <if test="score != null">score = #{score},</if>
        </trim>
        where id = #{id}
    </update>
@@ -392,6 +431,9 @@
            <if test=" extemplateText != null">extemplate_text = #{extemplateText},</if>
            <if test=" guid != null">guid = #{guid},</if>
            <if test=" categoryid != null">categoryid = #{categoryid},</if>
            <if test="templateType != null">template_type = #{templateType},</if>
            <if test="libTemplateid != null">lib_templateid = #{libTemplateid},</if>
            <if test="score != null">score = #{score},</if>
        </trim>
        where patid = #{patid} and scriptid = #{scriptid} and sub_id = #{subId}
    </update>
@@ -418,7 +460,7 @@
        FROM service_subtask_detail
            JOIN service_task
        ON service_task.taskid = service_subtask_detail.taskid
        JOIN ivr_liba_target ON ivr_liba_target.id = service_subtask_detail.targetid
            JOIN ivr_liba_target ON ivr_liba_target.id = service_subtask_detail.targetid
        WHERE
            targetid = #{targetid}
        GROUP BY service_task.taskid,
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailTraceMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,653 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.ServiceSubtaskDetailTraceMapper">
    <resultMap type="com.smartor.domain.ServiceSubtaskDetailTrace" id="ServiceSubtaskDetailTtraceResult">
        <result property="id" column="id"/>
        <result property="detailId" column="detail_id"/>
        <result property="subId" column="sub_id"/>
        <result property="taskid" column="taskid"/>
        <result property="templateid" column="templateid"/>
        <result property="templatequestionnum" column="templatequestionnum"/>
        <result property="switchid" column="switchid"/>
        <result property="questiontext" column="questiontext"/>
        <result property="questionvoice" column="questionvoice"/>
        <result property="categoryname" column="categoryname"/>
        <result property="targetid" column="targetid"/>
        <result property="targetvalue" column="targetvalue"/>
        <result property="matchedtext" column="matchedtext"/>
        <result property="uuid" column="uuid"/>
        <result property="guid" column="guid"/>
        <result property="valueType" column="value_type"/>
        <result property="scriptid" column="scriptid"/>
        <result property="answerps" column="answerps"/>
        <result property="comment" column="comment"/>
        <result property="asrtext" column="asrtext"/>
        <result property="recordpath" column="recordpath"/>
        <result property="recordurl" column="recordurl"/>
        <result property="patid" column="patid"/>
        <result property="patdesc" column="patdesc"/>
        <result property="todeptid" column="todeptid"/>
        <result property="todeptcode" column="todeptcode"/>
        <result property="todeptname" column="todeptname"/>
        <result property="handleresult" column="handleresult"/>
        <result property="handledesc" column="handledesc"/>
        <result property="handleFlag" column="handle_flag"/>
        <result property="handleBy" column="handle_by"/>
        <result property="handleTime" column="handle_time"/>
        <result property="ccdepts" column="ccdepts"/>
        <result property="finaloption" column="finaloption"/>
        <result property="finaltime" column="finaltime"/>
        <result property="operate" column="operate"/>
        <result property="orgid" column="orgid"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="createTime" column="create_time"/>
        <result property="delFlag" column="del_flag"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="pguid" column="pguid"/>
        <result property="pid" column="pid"/>
        <result property="categoryid" column="categoryid"/>
        <result property="templateType" column="template_type"/>
    </resultMap>
    <sql id="selectServiceSubtaskDetailTtraceVo">
        select id,
               detail_id,
               template_type,
               sub_id,
               taskid,
               templateid,
               templatequestionnum,
               switchid,
               questiontext,
               questionvoice,
               categoryname,
               targetid,
               targetvalue,
               matchedtext,
               uuid,
               guid,
               value_type,
               scriptid,
               answerps,
               comment,
               asrtext,
               recordpath,
               recordurl,
               patid,
               patdesc,
               todeptid,
               todeptcode,
               todeptname,
               handleresult,
               handledesc,
               handle_flag,
               handle_by,
               handle_time,
               ccdepts,
               finaloption,
               finaltime,
               operate,
               orgid,
               isupload,
               upload_time,
               create_time,
               del_flag,
               update_by,
               update_time,
               create_by,
               pguid,
               type,
               pid,
               categoryid
        from service_subtask_detail_trace
    </sql>
    <select id="selectServiceSubtaskDetailTtraceList" parameterType="com.smartor.domain.ServiceSubtaskDetailTrace"
            resultMap="ServiceSubtaskDetailTtraceResult">
        <include refid="selectServiceSubtaskDetailTtraceVo"/>
        where del_flag=0
        <if test="detailId != null ">
            and detail_id = #{detailId}
        </if>
        <if test="templateType != null ">
            and template_type = #{templateType}
        </if>
        <if test="subId != null ">
            and sub_id = #{subId}
        </if>
        <if test="taskid != null ">
            and taskid = #{taskid}
        </if>
        <if test="templateid != null  and templateid != ''">
            and templateid = #{templateid}
        </if>
        <if test="templatequestionnum != null ">
            and templatequestionnum = #{templatequestionnum}
        </if>
        <if test="switchid != null ">
            and switchid = #{switchid}
        </if>
        <if test="questiontext != null  and questiontext != ''">
            and questiontext = #{questiontext}
        </if>
        <if test="questionvoice != null  and questionvoice != ''">
            and questionvoice = #{questionvoice}
        </if>
        <if test="categoryname != null  and categoryname != ''">
            and categoryname like concat('%', #{categoryname}, '%')
        </if>
        <if test="targetid != null ">
            and targetid = #{targetid}
        </if>
        <if test="targetvalue != null  and targetvalue != ''">
            and targetvalue = #{targetvalue}
        </if>
        <if test="matchedtext != null  and matchedtext != ''">
            and matchedtext = #{matchedtext}
        </if>
        <if test="uuid != null  and uuid != ''">
            and uuid = #{uuid}
        </if>
        <if test="guid != null  and guid != ''">
            and guid = #{guid}
        </if>
        <if test="valueType != null  and valueType != ''">
            and value_type = #{valueType}
        </if>
        <if test="scriptid != null ">
            and scriptid = #{scriptid}
        </if>
        <if test="answerps != null  and answerps != ''">
            and answerps = #{answerps}
        </if>
        <if test="comment != null  and comment != ''">
            and comment = #{comment}
        </if>
        <if test="asrtext != null  and asrtext != ''">
            and asrtext = #{asrtext}
        </if>
        <if test="recordpath != null  and recordpath != ''">
            and recordpath = #{recordpath}
        </if>
        <if test="recordurl != null  and recordurl != ''">
            and recordurl = #{recordurl}
        </if>
        <if test="patid != null ">
            and patid = #{patid}
        </if>
        <if test="patdesc != null  and patdesc != ''">
            and patdesc = #{patdesc}
        </if>
        <if test="todeptid != null ">
            and todeptid = #{todeptid}
        </if>
        <if test="todeptcode != null  and todeptcode != ''">
            and todeptcode = #{todeptcode}
        </if>
        <if test="todeptname != null  and todeptname != ''">
            and todeptname like concat('%', #{todeptname}, '%')
        </if>
        <if test="handleresult != null  and handleresult != ''">
            and handleresult = #{handleresult}
        </if>
        <if test="handledesc != null  and handledesc != ''">
            and handledesc = #{handledesc}
        </if>
        <if test="handleFlag != null  and handleFlag != ''">
            and handle_flag = #{handleFlag}
        </if>
        <if test="handleBy != null  and handleBy != ''">
            and handle_by = #{handleBy}
        </if>
        <if test="handleTime != null ">
            and handle_time = #{handleTime}
        </if>
        <if test="ccdepts != null  and ccdepts != ''">
            and ccdepts = #{ccdepts}
        </if>
        <if test="finaloption != null  and finaloption != ''">
            and finaloption = #{finaloption}
        </if>
        <if test="finaltime != null ">
            and finaltime = #{finaltime}
        </if>
        <if test="operate != null  and operate != ''">
            and operate = #{operate}
        </if>
        <if test="orgid != null  and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="isupload != null ">
            and isupload = #{isupload}
        </if>
        <if test="uploadTime != null ">
            and upload_time = #{uploadTime}
        </if>
        <if test="pguid != null  and pguid != ''">
            and pguid = #{pguid}
        </if>
        <if test="pid != null ">
            and pid = #{pid}
        </if>
        <if test="categoryid != null ">
            and categoryid = #{categoryid}
        </if>
        <if test="type != null  and type != ''">
            and type = #{type}
        </if>
    </select>
    <select id="tracedeallist" parameterType="com.smartor.domain.VO.DetailTraceDealVO"
            resultMap="ServiceSubtaskDetailTtraceResult">
        <include refid="selectServiceSubtaskDetailTtraceVo"/>
        where del_flag=0
        <if test="templateid != null  and templateid != ''">
            and templateid = #{templateid}
        </if>
        <if test="todeptcode != null  and todeptcode != ''">
            and FIND_IN_SET(#{todeptcode}, todeptcode)
        </if>
        <if test="todeptname != null  and todeptname != ''">
            and todeptname like concat('%', #{todeptname}, '%')
        </if>
        <if test="handleStartTime != null and handleEndTime != null">
            and handle_time between #{handleStartTime} and #{handleEndTime}
        </if>
        <if test="orgid != null  and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="type != null  and type != ''">
            and type = #{type}
        </if>
    </select>
    <select id="selectServiceSubtaskDetailTtraceById" parameterType="Long"
            resultMap="ServiceSubtaskDetailTtraceResult">
        <include refid="selectServiceSubtaskDetailTtraceVo"/>
        where del_flag=0 and id = #{id}
    </select>
    <insert id="insertServiceSubtaskDetailTtrace" parameterType="com.smartor.domain.ServiceSubtaskDetailTrace"
            useGeneratedKeys="true" keyProperty="id">
        insert into service_subtask_detail_trace
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="detailId != null">detail_id,
            </if>
            <if test="subId != null">sub_id,
            </if>
            <if test="taskid != null">taskid,
            </if>
            <if test="templateid != null">templateid,
            </if>
            <if test="templatequestionnum != null">templatequestionnum,
            </if>
            <if test="switchid != null">switchid,
            </if>
            <if test="questiontext != null">questiontext,
            </if>
            <if test="questionvoice != null">questionvoice,
            </if>
            <if test="categoryname != null">categoryname,
            </if>
            <if test="targetid != null">targetid,
            </if>
            <if test="targetvalue != null">targetvalue,
            </if>
            <if test="matchedtext != null">matchedtext,
            </if>
            <if test="uuid != null">uuid,
            </if>
            <if test="guid != null">guid,
            </if>
            <if test="valueType != null">value_type,
            </if>
            <if test="scriptid != null">scriptid,
            </if>
            <if test="answerps != null">answerps,
            </if>
            <if test="comment != null">comment,
            </if>
            <if test="asrtext != null">asrtext,
            </if>
            <if test="recordpath != null">recordpath,
            </if>
            <if test="recordurl != null">recordurl,
            </if>
            <if test="patid != null">patid,
            </if>
            <if test="patdesc != null">patdesc,
            </if>
            <if test="todeptid != null">todeptid,
            </if>
            <if test="todeptcode != null">todeptcode,
            </if>
            <if test="todeptname != null">todeptname,
            </if>
            <if test="handleresult != null">handleresult,
            </if>
            <if test="handledesc != null">handledesc,
            </if>
            <if test="handleFlag != null">handle_flag,
            </if>
            <if test="handleBy != null">handle_by,
            </if>
            <if test="handleTime != null">handle_time,
            </if>
            <if test="ccdepts != null">ccdepts,
            </if>
            <if test="finaloption != null">finaloption,
            </if>
            <if test="finaltime != null">finaltime,
            </if>
            <if test="operate != null">operate,
            </if>
            <if test="orgid != null">orgid,
            </if>
            <if test="isupload != null">isupload,
            </if>
            <if test="uploadTime != null">upload_time,
            </if>
            <if test="createTime != null">create_time,
            </if>
            <if test="delFlag != null">del_flag,
            </if>
            <if test="updateBy != null">update_by,
            </if>
            <if test="updateTime != null">update_time,
            </if>
            <if test="createBy != null">create_by,
            </if>
            <if test="pguid != null">pguid,
            </if>
            <if test="pid != null">pid,
            </if>
            <if test="categoryid != null">categoryid,
            </if>
            <if test="type != null">type,
            </if>
            <if test="templateType != null">template_type,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="detailId != null">#{detailId},
            </if>
            <if test="subId != null">#{subId},
            </if>
            <if test="taskid != null">#{taskid},
            </if>
            <if test="templateid != null">#{templateid},
            </if>
            <if test="templatequestionnum != null">#{templatequestionnum},
            </if>
            <if test="switchid != null">#{switchid},
            </if>
            <if test="questiontext != null">#{questiontext},
            </if>
            <if test="questionvoice != null">#{questionvoice},
            </if>
            <if test="categoryname != null">#{categoryname},
            </if>
            <if test="targetid != null">#{targetid},
            </if>
            <if test="targetvalue != null">#{targetvalue},
            </if>
            <if test="matchedtext != null">#{matchedtext},
            </if>
            <if test="uuid != null">#{uuid},
            </if>
            <if test="guid != null">#{guid},
            </if>
            <if test="valueType != null">#{valueType},
            </if>
            <if test="scriptid != null">#{scriptid},
            </if>
            <if test="answerps != null">#{answerps},
            </if>
            <if test="comment != null">#{comment},
            </if>
            <if test="asrtext != null">#{asrtext},
            </if>
            <if test="recordpath != null">#{recordpath},
            </if>
            <if test="recordurl != null">#{recordurl},
            </if>
            <if test="patid != null">#{patid},
            </if>
            <if test="patdesc != null">#{patdesc},
            </if>
            <if test="todeptid != null">#{todeptid},
            </if>
            <if test="todeptcode != null">#{todeptcode},
            </if>
            <if test="todeptname != null">#{todeptname},
            </if>
            <if test="handleresult != null">#{handleresult},
            </if>
            <if test="handledesc != null">#{handledesc},
            </if>
            <if test="handleFlag != null">#{handleFlag},
            </if>
            <if test="handleBy != null">#{handleBy},
            </if>
            <if test="handleTime != null">#{handleTime},
            </if>
            <if test="ccdepts != null">#{ccdepts},
            </if>
            <if test="finaloption != null">#{finaloption},
            </if>
            <if test="finaltime != null">#{finaltime},
            </if>
            <if test="operate != null">#{operate},
            </if>
            <if test="orgid != null">#{orgid},
            </if>
            <if test="isupload != null">#{isupload},
            </if>
            <if test="uploadTime != null">#{uploadTime},
            </if>
            <if test="createTime != null">#{createTime},
            </if>
            <if test="delFlag != null">#{delFlag},
            </if>
            <if test="updateBy != null">#{updateBy},
            </if>
            <if test="updateTime != null">#{updateTime},
            </if>
            <if test="createBy != null">#{createBy},
            </if>
            <if test="pguid != null">#{pguid},
            </if>
            <if test="pid != null">#{pid},
            </if>
            <if test="categoryid != null">#{categoryid},
            </if>
            <if test="type != null">#{type},
            </if>
            <if test="templateType != null">#{templateType},
            </if>
        </trim>
    </insert>
    <update id="updateServiceSubtaskDetailTtrace" parameterType="com.smartor.domain.ServiceSubtaskDetailTrace">
        update service_subtask_detail_trace
        <trim prefix="SET" suffixOverrides=",">
            <if test="detailId != null">detail_id =
                #{detailId},
            </if>
            <if test="subId != null">sub_id =
                #{subId},
            </if>
            <if test="taskid != null">taskid =
                #{taskid},
            </if>
            <if test="templateid != null">templateid =
                #{templateid},
            </if>
            <if test="templatequestionnum != null">templatequestionnum =
                #{templatequestionnum},
            </if>
            <if test="switchid != null">switchid =
                #{switchid},
            </if>
            <if test="questiontext != null">questiontext =
                #{questiontext},
            </if>
            <if test="questionvoice != null">questionvoice =
                #{questionvoice},
            </if>
            <if test="categoryname != null">categoryname =
                #{categoryname},
            </if>
            <if test="targetid != null">targetid =
                #{targetid},
            </if>
            <if test="targetvalue != null">targetvalue =
                #{targetvalue},
            </if>
            <if test="matchedtext != null">matchedtext =
                #{matchedtext},
            </if>
            <if test="uuid != null">uuid =
                #{uuid},
            </if>
            <if test="guid != null">guid =
                #{guid},
            </if>
            <if test="valueType != null">value_type =
                #{valueType},
            </if>
            <if test="scriptid != null">scriptid =
                #{scriptid},
            </if>
            <if test="answerps != null">answerps =
                #{answerps},
            </if>
            <if test="comment != null">comment =
                #{comment},
            </if>
            <if test="asrtext != null">asrtext =
                #{asrtext},
            </if>
            <if test="recordpath != null">recordpath =
                #{recordpath},
            </if>
            <if test="recordurl != null">recordurl =
                #{recordurl},
            </if>
            <if test="patid != null">patid =
                #{patid},
            </if>
            <if test="patdesc != null">patdesc =
                #{patdesc},
            </if>
            <if test="todeptid != null">todeptid =
                #{todeptid},
            </if>
            <if test="todeptcode != null">todeptcode =
                #{todeptcode},
            </if>
            <if test="todeptname != null">todeptname =
                #{todeptname},
            </if>
            <if test="handleresult != null">handleresult =
                #{handleresult},
            </if>
            <if test="handledesc != null">handledesc =
                #{handledesc},
            </if>
            <if test="handleFlag != null">handle_flag =
                #{handleFlag},
            </if>
            <if test="handleBy != null">handle_by =
                #{handleBy},
            </if>
            <if test="handleTime != null">handle_time =
                #{handleTime},
            </if>
            <if test="ccdepts != null">ccdepts =
                #{ccdepts},
            </if>
            <if test="finaloption != null">finaloption =
                #{finaloption},
            </if>
            <if test="finaltime != null">finaltime =
                #{finaltime},
            </if>
            <if test="operate != null">operate =
                #{operate},
            </if>
            <if test="orgid != null">orgid =
                #{orgid},
            </if>
            <if test="isupload != null">isupload =
                #{isupload},
            </if>
            <if test="uploadTime != null">upload_time =
                #{uploadTime},
            </if>
            <if test="createTime != null">create_time =
                #{createTime},
            </if>
            <if test="delFlag != null">del_flag =
                #{delFlag},
            </if>
            <if test="updateBy != null">update_by =
                #{updateBy},
            </if>
            <if test="updateTime != null">update_time =
                #{updateTime},
            </if>
            <if test="createBy != null">create_by =
                #{createBy},
            </if>
            <if test="pguid != null">pguid =
                #{pguid},
            </if>
            <if test="pid != null">pid =
                #{pid},
            </if>
            <if test="categoryid != null">categoryid =
                #{categoryid},
            </if>
            <if test="type != null">type =
                #{type},
            </if>
            <if test="templateType != null">template_type =
                #{templateType},
            </if>
        </trim>
        where id = #{id}
    </update>
    <update id="deleteServiceSubtaskDetailTtraceById" parameterType="Long">
        update service_subtask_detail_trace
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id = #{id}
    </update>
    <update id="deleteServiceSubtaskDetailTtraceByIds" parameterType="String">
        update service_subtask_detail_trace
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
</mapper>
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -469,6 +469,41 @@
        <if test="sort != null  and sort==9">order by sendname asc</if>
        <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
    </select>
    <select id="selectSatisfactionSubtaskList" parameterType="com.smartor.domain.VO.PatSatisfactionReqVO"
            resultMap="ServiceSubtaskResult">
        <include refid="selectServiceSubtaskVo"/>
        where 1=1
        and del_flag = 0
        <if test="questionType != null">and type = #{questionType}</if>
        <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator=","
                     close=")">
                #{hospitaldistrictcode}
            </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="serviceTypes != null and serviceTypes.size() > 0">
            AND service_type IN
            <foreach collection="serviceTypes" 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') &lt;= date_format(#{endTime},'%y%m%d')
        </if>
    </select>
    <select id="getCompensateServiceSubtaskList" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity"
            resultMap="ServiceSubtaskResult">
        <include refid="selectServiceSubtaskVo"/>
@@ -1910,10 +1945,10 @@
    <select id="getDeptRanking" parameterType="com.smartor.domain.PatMedReq" resultType="com.smartor.domain.PatMedRes">
        SELECT deptname,
               count(1) AS rc
        count(1) AS rc
        FROM service_subtask
        WHERE DATE_FORMAT(finishtime, '%Y-%m-%d') >= #{startDate}
          AND DATE_FORMAT(finishtime, '%Y-%m-%d') &lt;= #{endDate}
        AND DATE_FORMAT(finishtime, '%Y-%m-%d') &lt;= #{endDate}
        <if test="orgid != null">
            AND orgid = #{orgid}
        </if>
@@ -2036,47 +2071,47 @@
            </foreach>
        </if>
<!--        UNION ALL-->
        <!--        UNION ALL-->
<!--        &#45;&#45; é—¨è¯Šäººæ¬¡æ•°æ®-->
<!--        SELECT-->
<!--        <choose>-->
<!--            <when test="timeType == 'day'">-->
<!--                DATE_FORMAT(admitdate, '%Y-%m-%d') AS timePeriod,-->
<!--            </when>-->
<!--            <when test="timeType == 'month'">-->
<!--                DATE_FORMAT(admitdate, '%Y-%m') AS timePeriod,-->
<!--            </when>-->
<!--            <when test="timeType == 'year'">-->
<!--                DATE_FORMAT(admitdate, '%Y') AS timePeriod,-->
<!--            </when>-->
<!--            <when test="timeType == 'week'">-->
<!--                CONCAT(YEAR(admitdate), '-W', LPAD(WEEK(admitdate, 1), 2, '0')) AS timePeriod,-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                DATE_FORMAT(admitdate, '%Y-%m-%d') AS timePeriod,-->
<!--            </otherwise>-->
<!--        </choose>-->
<!--        0 AS dischargeFollowCount,-->
<!--        0 AS outpatientFollowCount,-->
<!--        0 AS pmiCount,-->
<!--        1 AS pmoCount-->
<!--        FROM pat_med_outhosp-->
<!--        WHERE del_flag = '0'-->
<!--        <if test="startDate != null and endDate != null">-->
<!--            AND admitdate >= #{startDate}-->
<!--            AND admitdate &lt;= DATE_ADD(#{endDate}, INTERVAL 1 DAY)-->
<!--        </if>-->
<!--        <if test="orgid != null">-->
<!--            AND orgid = #{orgid}-->
<!--        </if>-->
        <!--        &#45;&#45; é—¨è¯Šäººæ¬¡æ•°æ®-->
        <!--        SELECT-->
        <!--        <choose>-->
        <!--            <when test="timeType == 'day'">-->
        <!--                DATE_FORMAT(admitdate, '%Y-%m-%d') AS timePeriod,-->
        <!--            </when>-->
        <!--            <when test="timeType == 'month'">-->
        <!--                DATE_FORMAT(admitdate, '%Y-%m') AS timePeriod,-->
        <!--            </when>-->
        <!--            <when test="timeType == 'year'">-->
        <!--                DATE_FORMAT(admitdate, '%Y') AS timePeriod,-->
        <!--            </when>-->
        <!--            <when test="timeType == 'week'">-->
        <!--                CONCAT(YEAR(admitdate), '-W', LPAD(WEEK(admitdate, 1), 2, '0')) AS timePeriod,-->
        <!--            </when>-->
        <!--            <otherwise>-->
        <!--                DATE_FORMAT(admitdate, '%Y-%m-%d') AS timePeriod,-->
        <!--            </otherwise>-->
        <!--        </choose>-->
        <!--        0 AS dischargeFollowCount,-->
        <!--        0 AS outpatientFollowCount,-->
        <!--        0 AS pmiCount,-->
        <!--        1 AS pmoCount-->
        <!--        FROM pat_med_outhosp-->
        <!--        WHERE del_flag = '0'-->
        <!--        <if test="startDate != null and endDate != null">-->
        <!--            AND admitdate >= #{startDate}-->
        <!--            AND admitdate &lt;= DATE_ADD(#{endDate}, INTERVAL 1 DAY)-->
        <!--        </if>-->
        <!--        <if test="orgid != null">-->
        <!--            AND orgid = #{orgid}-->
        <!--        </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="deptcodes != null and deptcodes.size() > 0">-->
        <!--            AND deptcode IN-->
        <!--            <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")">-->
        <!--                #{deptcode}-->
        <!--            </foreach>-->
        <!--        </if>-->
        ) AS combined_data
        GROUP BY timePeriod
@@ -2298,9 +2333,11 @@
        </if>
    </select>
    <select id="getCurrentUserServiceSubtaskCount" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" resultType="map">
    <select id="getCurrentUserServiceSubtaskCount" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity"
            resultType="map">
        SELECT
        COUNT(CASE WHEN sendstate = 2 AND date_format(visit_time,'%y%m%d') &lt;= date_format(CURDATE(),'%y%m%d') THEN 1 END) AS pendingVisitCount,
        COUNT(CASE WHEN sendstate = 2 AND date_format(visit_time,'%y%m%d') &lt;= date_format(CURDATE(),'%y%m%d') THEN 1
        END) AS pendingVisitCount,
        COUNT(CASE WHEN sendstate = 5 THEN 1 END) AS failedVisitCount,
        SUM(CASE WHEN excep IS NOT NULL AND excep = '1' THEN 1 ELSE 0 END) AS abnormalVisitCount,
        SUM(CASE WHEN excep IS NOT NULL AND excep = '2' THEN 1 ELSE 0 END) AS warnningVisitCount,
@@ -2329,4 +2366,52 @@
        </if>
    </select>
    <select id="querySendCount" parameterType="com.smartor.domain.entity.ServiceSubtaskSatisfactionEntity"
            resultType="Long">
        select distinct id from service_subtask
        where del_flag = 0
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="type != null ">and type = #{type}</if>
        <if test="startTime != null">
            AND date_format(visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')
        </if>
        <if test="endTime != null">
            AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
        </if>
        <if test=" libTemplateIds != null and libTemplateIds.size()>0">
            AND libtemplateid IN
            <foreach collection="libTemplateIds" item="libTemplateId" open="(" separator=","
                     close=")">
                #{libTemplateId}
            </foreach>
        </if>
        <if test="(hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0) or (deptcodes != null and deptcodes.size() > 0)">
            AND (
            <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0">
                leavehospitaldistrictcode IN
                <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="("
                         separator=","
                         close=")">
                    #{hospitaldistrictcode}
                </foreach>
            </if>
            <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0 and deptcodes != null and deptcodes.size() > 0">
                OR
            </if>
            <if test="deptcodes != null and deptcodes.size() > 0">
                deptcode IN
                <foreach collection="deptcodes" item="deptcode" open="(" separator=","
                         close=")">
                    #{deptcode}
                </foreach>
            </if>
            )
        </if>
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/SvyLibScriptOptionMapper.xml
@@ -35,6 +35,7 @@
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="isException" column="is_exception"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="appendflag" column="appendflag"/>
@@ -77,6 +78,7 @@
               update_by,
               update_time,
               isupload,
               is_exception,
               upload_time
        from svy_lib_scriptoption
    </sql>
@@ -114,6 +116,7 @@
            <if test="appendflag != null">and appendflag = #{appendflag}</if>
            <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
            <if test="picturePath != null">and picture_path = #{picturePath}</if>
            <if test="isException != null">and is_exception = #{isException}</if>
    </select>
    <select id="selectSvyLibScriptOptionByOptionid" parameterType="Long" resultMap="SvyLibScriptOptionResult">
@@ -159,6 +162,7 @@
            <if test="appenddesc != null">appenddesc,</if>
            <if test="picturePath != null">picture_path,</if>
            <if test="guid != null">guid,</if>
            <if test="isException != null">is_exception,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="topicid != null">#{topicid},</if>
@@ -195,6 +199,7 @@
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="picturePath != null">#{picturePath},</if>
            <if test="guid != null">#{guid},</if>
            <if test="isException != null">#{isException},</if>
        </trim>
    </insert>
@@ -234,6 +239,7 @@
            <if test="appendflag != null">appendflag = #{appendflag},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="picturePath != null">picture_path = #{picturePath},</if>
            <if test="isException != null">is_exception = #{isException},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -46,11 +46,19 @@
        <result property="targetoptions" column="targetoptions"/>
        <result property="prompt" column="prompt"/>
        <result property="groupName" column="group_name"/>
        <result property="dutyDeptName" column="duty_dept_name"/>
        <result property="dutyDeptCode" column="duty_dept_code"/>
        <result property="reportDeptCode" column="report_dept_name"/>
        <result property="reportDeptName" column="report_dept_code"/>
    </resultMap>
    <sql id="selectSvyLibTemplateScriptVo">
        select id,
               script_type,
               duty_dept_name,
               duty_dept_code,
               report_dept_name,
               report_dept_code,
               targetid,
               group_name,
               targetname,
@@ -81,6 +89,7 @@
               pid,
               guid,
               categoryid,
               categoryName,
               script_content,
               suitway,
               script_picture,
@@ -93,43 +102,66 @@
            resultMap="SvyLibTemplateScriptResult">
        <include refid="selectSvyLibTemplateScriptVo"/>
        where 1=1
            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="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>
            <if test="tag != null  and tag != ''">and tag = #{tag}</if>
            <if test="sort != null ">and sort = #{sort}</if>
            <if test="ismandatory != null  and ismandatory != ''">and ismandatory = #{ismandatory}</if>
            <if test="ishide != null ">and ishide = #{ishide}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="prompt != null  and prompt != ''">and prompt = #{prompt}</if>
            <if test="categoryid != null ">and categoryid = #{categoryid}</if>
            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
            <if test="suitway != null  and suitway != ''">and suitway = #{suitway}</if>
            <if test="isavailable != null  and isavailable != ''">and isavailable = #{isavailable}</if>
            <if test="language != null  and language != ''">and language = #{language}</if>
            <if test="otherdata != null  and otherdata != ''">and otherdata = #{otherdata}</if>
            <if test="valueType != null  and valueType != ''">and value_type = #{valueType}</if>
            <if test="reply != null  and reply != ''">and reply = #{reply}</if>
            <if test="scoretype != null  and scoretype != ''">and scoretype = #{scoretype}</if>
            <if test="scriptTopic != null  and scriptTopic != ''">and script_topic = #{scriptTopic}</if>
            <if test="svyid != null  ">and svyid = #{svyid}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                #{branchNextscriptno}
            </if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="targetname != null  and targetname != ''">and targetname = #{targetname}</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="targetoptions != null  and targetoptions != ''">and targetoptions = #{targetoptions}</if>
            <if test="score != null">and score = #{score}</if>
            <if test="groupName != null">and group_name = #{groupName}</if>
        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="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>
        <if test="tag != null  and tag != ''">and tag = #{tag}</if>
        <if test="sort != null ">and sort = #{sort}</if>
        <if test="ismandatory != null  and ismandatory != ''">and ismandatory = #{ismandatory}</if>
        <if test="ishide != null ">and ishide = #{ishide}</if>
        <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
        <if test="isupload != null ">and isupload = #{isupload}</if>
        <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
        <if test="pid != null ">and pid = #{pid}</if>
        <if test="guid != null  and guid != ''">and guid = #{guid}</if>
        <if test="prompt != null  and prompt != ''">and prompt = #{prompt}</if>
        <if test="categoryid != null ">and categoryid = #{categoryid}</if>
        <if test="categoryName != null ">and categoryName = #{categoryName}</if>
        <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
        <if test="suitway != null  and suitway != ''">and suitway = #{suitway}</if>
        <if test="isavailable != null  and isavailable != ''">and isavailable = #{isavailable}</if>
        <if test="language != null  and language != ''">and language = #{language}</if>
        <if test="otherdata != null  and otherdata != ''">and otherdata = #{otherdata}</if>
        <if test="valueType != null  and valueType != ''">and value_type = #{valueType}</if>
        <if test="reply != null  and reply != ''">and reply = #{reply}</if>
        <if test="scoretype != null  and scoretype != ''">and scoretype = #{scoretype}</if>
        <if test="scriptTopic != null  and scriptTopic != ''">and script_topic = #{scriptTopic}</if>
        <if test="svyid != null  ">and svyid = #{svyid}</if>
        <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
        <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
            #{branchNextscriptno}
        </if>
        <if test="targetid != null ">and targetid = #{targetid}</if>
        <if test="targetname != null  and targetname != ''">and targetname = #{targetname}</if>
        <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
        <if test="targetoptions != null  and targetoptions != ''">and targetoptions = #{targetoptions}</if>
        <if test="score != null">and score = #{score}</if>
        <if test="groupName != null">and group_name = #{groupName}</if>
        <if test="dutyDeptName != null  and dutyDeptName != ''">and duty_dept_name like concat('%', #{dutyDeptName},
            '%')
        </if>
        <if test="dutyDeptCode != null  and dutyDeptCode != ''">and duty_dept_code like concat('%', #{dutyDeptCode},
            '%')
        </if>
        <if test="reportDeptName != null  and reportDeptName != ''">and report_dept_name like concat('%',
            #{reportDeptName},
            '%')
        </if>
        <if test="reportDeptCode != null  and reportDeptCode != ''">and report_dept_code like concat('%',
            #{reportDeptCode},
            '%')
        </if>
        <if test="categoryids != null">
            and categoryid in
            <foreach collection="categoryids" item="categoryid" open="(" separator=","
                     close=")">
                #{categoryid}
            </foreach>
        </if>
        <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
    </select>
    <select id="selectSvyLibTemplateScriptByTopicid" parameterType="Long" resultMap="SvyLibTemplateScriptResult">
@@ -181,6 +213,11 @@
            <if test="targetoptions != null  and targetoptions != ''">targetoptions,</if>
            <if test="prompt != null  and prompt != ''">prompt,</if>
            <if test="groupName != null  and groupName != ''">group_name,</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">duty_dept_name,</if>
            <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="categoryName != null  and categoryName != ''">categoryName,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="nextScriptno != null">#{nextScriptno},</if>
@@ -223,6 +260,11 @@
            <if test="targetoptions != null  and targetoptions != ''">#{targetoptions},</if>
            <if test="prompt != null  and prompt != ''">#{prompt},</if>
            <if test="groupName != null  and groupName != ''">#{groupName},</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">#{dutyDeptName},</if>
            <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="categoryName != null  and categoryName != ''">#{categoryName},</if>
        </trim>
    </insert>
@@ -271,6 +313,11 @@
            <if test="targetoptions != null  and targetoptions != ''">targetoptions = #{targetoptions},</if>
            <if test="prompt != null  and prompt != ''">prompt = #{prompt},</if>
            <if test="groupName != null  and groupName != ''">group_name = #{groupName},</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>
            <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code = #{reportDeptCode},</if>
            <if test="categoryName != null  and categoryName != ''">categoryName = #{categoryName},</if>
        </trim>
        where id = #{id}
    </update>
@@ -287,4 +334,15 @@
            #{id}
        </foreach>
    </delete>
    <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>
        </if>
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
@@ -48,6 +48,7 @@
    <sql id="selectSvyLibTemplateTargetoptionVo">
        select id,
               groupid,
--                is_exception,
               send_taskid,
               send_taskname,
               score,
smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml
@@ -17,6 +17,7 @@
        <result property="updateTime" column="update_time"/>
        <result property="orgid" column="orgid"/>
        <result property="seqno" column="seqno"/>
        <result property="type" column="type"/>
    </resultMap>
    <sql id="selectSvyLibScriptCategoryVo">
@@ -31,6 +32,7 @@
               update_by,
               update_time,
               seqno,
               type,
               orgid
        from svy_lib_script_category
    </sql>
@@ -46,6 +48,7 @@
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="orgid != null ">and orgid = #{orgid}</if>
            <if test="seqno != null ">and seqno = #{seqno}</if>
            <if test="type != null  and type != ''">and type like concat('%', #{type}, '%')</if>
        order by seqno asc
    </select>
@@ -69,6 +72,7 @@
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="orgid != null">orgid,</if>
            <if test="type != null">type,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="name != null">#{name},</if>
@@ -82,6 +86,7 @@
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="type != null">#{type},</if>
        </trim>
    </insert>
@@ -99,6 +104,7 @@
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="type != null">type = #{type},</if>
        </trim>
        where id = #{id}
    </update>
@@ -120,7 +126,7 @@
    <select id="selectSeqMax" resultType="integer">
        select max(seqno) seqno
        from ivr_liba_template_assort
        from svy_lib_script_category
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
@@ -45,12 +45,19 @@
        <result property="prompt" column="prompt"/>
        <result property="groupName" column="group_name"/>
        <result property="categoryid" column="categoryid"/>
        <result property="dutyDeptName" column="duty_dept_name"/>
        <result property="dutyDeptCode" column="duty_dept_code"/>
        <result property="reportDeptCode" column="report_dept_name"/>
        <result property="reportDeptName" column="report_dept_code"/>
    </resultMap>
    <sql id="selectSvyTaskTemplateScriptVo">
        select id,
               sort,
               duty_dept_name,
               duty_dept_code,
               report_dept_name,
               report_dept_code,
               ishide,
               prompt,
               categoryid,
@@ -82,6 +89,18 @@
            <if test="scriptDesc != null  and scriptDesc != ''">and script_desc = #{scriptDesc}</if>
            <if test="language != null  and language != ''">and language = #{language}</if>
            <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
                '%')
            </if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">and duty_dept_name like concat('%', #{dutyDeptName},
                '%')
            </if>
            <if test="dutyDeptCode != null  and dutyDeptCode != ''">and duty_dept_code like concat('%', #{dutyDeptCode},
                '%')
            </if>
            <if test="reportDeptName != null  and reportDeptName != ''">and report_dept_name like concat('%', #{reportDeptName},
                '%')
            </if>
            <if test="reportDeptCode != null  and reportDeptCode != ''">and report_dept_code like concat('%', #{reportDeptCode},
                '%')
            </if>
            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
@@ -160,6 +179,10 @@
            <if test="groupName != null ">group_name,</if>
            <if test="ishide != null ">ishide,</if>
            <if test="categoryid != null ">categoryid,</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">duty_dept_name,</if>
            <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>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -201,6 +224,10 @@
            <if test="groupName != null ">#{groupName},</if>
            <if test="ishide != null ">#{ishide},</if>
            <if test="categoryid != null ">#{categoryid},</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">#{dutyDeptName},</if>
            <if test="dutyDeptCode != null  and dutyDeptCode != ''">#{dutyDeptCode},</if>
            <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
            <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
        </trim>
    </insert>
@@ -248,6 +275,10 @@
            <if test="groupName != null ">group_name = #{groupName},</if>
            <if test="ishide != null ">ishide = #{ishide},</if>
            <if test="categoryid != null ">categoryid = #{categoryid},</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>
            <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code = #{reportDeptCode},</if>
        </trim>
        where id = #{d}
    </update>