liusheng
2024-07-20 37f2e4e68c0d55e094981fa478fc198b907f87dc
代码提交
已添加2个文件
已修改31个文件
650 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaScriptVO.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchive.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskCacheReq.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceTaskService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatArchivetagServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java
@@ -6,6 +6,9 @@
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.ServiceSubTaskAnswerReq;
import com.smartor.domain.ServiceSubTaskCacheReq;
import com.smartor.domain.ServiceSubTaskDetailReq;
import com.smartor.domain.ServiceSubtaskAnswer;
import com.smartor.service.IServiceSubtaskAnswerService;
import io.swagger.annotations.Api;
@@ -99,4 +102,16 @@
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceSubtaskAnswerService.deleteServiceSubtaskAnswerByIds(ids));
    }
    @ApiOperation("患者问题结果记录(外链)")
    @PostMapping("/saveQuestionAnswer")
    public AjaxResult saveQuestionAnswer(@RequestBody ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) {
        return toAjax(serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq));
    }
    @ApiOperation("患者问题结果记录缓存(外链)")
    @PostMapping("/saveQuestionCache")
    public AjaxResult saveQuestionCache(@RequestBody ServiceSubTaskCacheReq serviceSubTaskCacheReq) {
        return toAjax(serviceSubtaskAnswerService.saveQuestionCache(serviceSubTaskCacheReq));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -105,13 +105,14 @@
        serviceSubtaskService.phoneCallBack(phoneCallBackVO);
        return success();
    }
    /**
     * æ‚£è€…问题结果记录
     */
    @ApiOperation("患者问题结果记录")
    @PostMapping("/saveQuestionAnswer")
    public AjaxResult saveQuestionAnswer(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
        return toAjax(serviceSubtaskService.saveQuestionAnswer(serviceSubTaskDetailReq));
    @ApiOperation("患者问题结果记录(电话)")
    @PostMapping("/saveQuestionAnswerPhone")
    public AjaxResult saveQuestionAnswerPhone(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
        return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq));
    }
}
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
@@ -181,6 +181,15 @@
    }
    /**
     * èŽ·å–æ‰€æœ‰key
     *
     * @return
     */
    public Set<String> getAllKeys() {
        return redisTemplate.keys("*");
    }
    /**
     * èŽ·å¾—ç¼“å­˜çš„Map
     *
     * @param key
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -1,6 +1,7 @@
package com.ruoyi.quartz.task;
import com.smartor.domain.ServiceThirdData;
import com.smartor.service.IServiceSubtaskAnswerService;
import com.smartor.service.IServiceThirdDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -17,6 +18,8 @@
public class RyTask {
    @Autowired
    private IServiceThirdDataService iServiceThirdDataService;
    @Autowired
    private IServiceSubtaskAnswerService serviceSubtaskAnswerService;
    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
        System.out.println(StringUtils.format("执行多参方法: å­—符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
@@ -40,4 +43,11 @@
        iServiceThirdDataService.queryList(serviceThirdData);
    }
    /**
     * å®šæ—¶å¤„理外链的数据
     */
    public void runServiceSubTaskAnswer() {
        serviceSubtaskAnswerService.saveQuestionAnswer(null);
    }
}
smartor/src/main/java/com/smartor/domain/IvrLibaScriptVO.java
@@ -328,4 +328,18 @@
    @Excel(name = "标签")
    @ApiModelProperty(value = "标签")
    private String tag;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
}
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java
@@ -36,6 +36,20 @@
    private Long scriptno;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
    /**
     * æ¨¡æ¿ID
     */
    @Excel(name = "模板ID")
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
@@ -176,8 +176,24 @@
    /**
     * é—®é¢˜ç±»åž‹
     */
    @ApiModelProperty(value = "问题类型")
    @ApiModelProperty(value = "适用题型(1.单选 2多选 3填空 4其它)")
    private String scriptType;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
    /**
     * ä¸Šä¼ æ ‡è®°
@@ -251,7 +267,7 @@
     * ä¸‹ä¸€é¢˜
     */
    @ApiModelProperty(value = "下一题")
    private Integer nextScriptno;
    private Long nextScriptno;
    /**
     * æ ‡ç­¾
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java
@@ -190,6 +190,13 @@
    private Long pid;
    /**
     * é€‰é¡¹ç»­å·
     */
    @Excel(name = "选项续号")
    @ApiModelProperty(value = "选项续号")
    private Long optionNo;
    /**
     * GUID
     */
    @Excel(name = "GUID")
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -25,7 +25,7 @@
     * ä¸»é”®ID
     */
    @ApiModelProperty(value = "主键")
    private Long ID;
    private Long id;
    /**
     * ä»»åŠ¡id
@@ -232,4 +232,19 @@
    @ApiModelProperty(value = "是否存在操作:1 æ–°å¢ž 2修改 3删除")
    private Integer isoperation;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
}
smartor/src/main/java/com/smartor/domain/PatArchive.java
@@ -28,7 +28,7 @@
     * è‡ªå¢žID
     */
    @ApiModelProperty("自增ID")
    private Long patid;
    private Long id;
    /**
     * å§“名
@@ -235,8 +235,4 @@
    @Excel(name = " ä¼šå‘˜å±žæ€§:0非会员,1一般会员、2重要会员 ")
    private String viptype;
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("patid", getPatid()).append("name", getName()).append("sex", getSex()).append("idcardno", getIdcardno()).append("birthdate", getBirthdate()).append("age", getAge()).append("sourcefrom", getSourcefrom()).append("archivetime", getArchivetime()).append("archiveby", getArchiveby()).append("telcode", getTelcode()).append("relativetelcode", getRelativetelcode()).append("idcardtype", getIdcardtype()).append("orgid", getOrgid()).append("openid", getOpenid()).append("delFlag", getDelFlag()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("isupload", getIsupload()).append("uploadTime", getUploadTime()).toString();
    }
}
smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * ç”µè¯é—®é¢˜å›žç­”明细
 *
 * @author ls
 * @date 2023-06-05
 */
@ApiModel(value = "ServiceSubTaskDetailReq", description = "问题回答明细")
@Data
public class ServiceSubTaskAnswerReq {
    @ApiModelProperty(value = "任务ID")
    private String param1;
    @ApiModelProperty(value = "患者ID")
    private String param2;
    @ApiModelProperty(value = "试卷类型:1 éšè®¿   2 é—®å·")
    private Integer type;
}
smartor/src/main/java/com/smartor/domain/ServiceSubTaskCacheReq.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * ç”µè¯é—®é¢˜å›žç­”明细
 *
 * @author ls
 * @date 2023-06-05
 */
@ApiModel(value = "ServiceSubTaskDetailReq", description = "问题回答明细")
@Data
public class ServiceSubTaskCacheReq {
    @ApiModelProperty(value = "任务ID")
    private String param1;
    @ApiModelProperty(value = "患者ID")
    private String param2;
    @ApiModelProperty(value = "问题回答明细")
    private List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList;
    @ApiModelProperty(value = "问题回答明细")
    List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOList;
}
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
@@ -241,4 +241,18 @@
    @ApiModelProperty("svy_lib_script题目id")
    private Long scriptid;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
}
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java
@@ -28,6 +28,22 @@
    @ApiModelProperty("自增ID")
    private Long id;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
    /**
     * ä¸‹ä¸€ä¸ªé—®é¢˜ç¼–号
     */
smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java
@@ -57,6 +57,13 @@
    private Long templateID;
    /**
     * é€‰é¡¹ç¼–号
     */
    @Excel(name = "选项编号")
    @ApiModelProperty(value = "选项编号")
    private Long optionNo;
    /**
     * è¯æœ¯ID
     */
    @Excel(name = "话术ID")
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
@@ -23,7 +23,7 @@
    /**
     * ä¸»é”®ID
     */
    private Long ID;
    private Long id;
    /**
     * ä»»åŠ¡id
@@ -189,4 +189,18 @@
    @ApiModelProperty("题目主题")
    private String scriptTopic;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
}
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -187,6 +187,22 @@
    @ApiModelProperty(value = "是否存在操作:1 æ–°å¢ž 2修改 3删除")
    private Integer isoperation;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
    /**
     * è¯æœ¯é€‰é¡¹
     */
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java
@@ -1,5 +1,8 @@
package com.smartor.service;
import com.smartor.domain.ServiceSubTaskAnswerReq;
import com.smartor.domain.ServiceSubTaskCacheReq;
import com.smartor.domain.ServiceSubTaskDetailReq;
import com.smartor.domain.ServiceSubtaskAnswer;
import java.util.List;
@@ -10,8 +13,7 @@
 * @author ruoyi
 * @date 2024-07-18
 */
public interface IServiceSubtaskAnswerService
{
public interface IServiceSubtaskAnswerService {
    /**
     * æŸ¥è¯¢ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹
     *
@@ -59,4 +61,21 @@
     * @return ç»“æžœ
     */
    public int deleteServiceSubtaskAnswerById(Long id);
    /**
     * å°†ç¼“存的数据保存到数据库
     *
     * @param serviceSubTaskAnswerReq
     * @return
     */
    public Integer saveQuestionAnswer(ServiceSubTaskAnswerReq serviceSubTaskAnswerReq);
    /**
     * å°†é—®é¢˜ä¿å­˜åˆ°ç¼“å­˜
     *
     * @param serviceSubTaskCacheReq
     * @return
     */
    public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq);
}
smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
@@ -82,6 +82,6 @@
     */
    public void phoneCallBack(PhoneCallBackVO phoneCallBackVO);
    public Integer saveQuestionAnswer(ServiceSubTaskDetailReq serviceSubTaskDetailReq);
    public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq);
}
smartor/src/main/java/com/smartor/service/IServiceTaskService.java
@@ -61,6 +61,12 @@
     */
    public Boolean deleteServiceTaskByTaskid(Long taskid);
    /**
     *
     * @param taskid
     * @param patid
     * @return
     */
    public List getScriptInfoByCondition(Long taskid, Long patid);
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -248,7 +248,7 @@
                if (isoperation == 1) {
                    //新增
                    ivrTaskTemplateTargetoption.setTemplateID(tmpID);
                    ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScript.getID());
                    ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScript.getId());
                    if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoption.getDynamiccruxs()))
                        ivrTaskTemplateTargetoption.setDynamiccruxsJson(JSON.toJSONString(ivrTaskTemplateTargetoption.getDynamiccruxs()));
                    if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoption.getNodynamiccruxs()))
@@ -257,7 +257,7 @@
                } else if (isoperation == 2) {
                    //修改
                    ivrTaskTemplateTargetoption.setTemplateID(tmpID);
                    ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScript.getID());
                    ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScript.getId());
                    if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoption.getDynamiccruxs()))
                        ivrTaskTemplateTargetoption.setDynamiccruxsJson(JSON.toJSONString(ivrTaskTemplateTargetoption.getDynamiccruxs()));
                    if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoption.getNodynamiccruxs()))
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -100,9 +100,9 @@
        patArchives.add(patArchive);
        patArchiveMapper.insertPatArchive(patArchives);
        if (CollectionUtils.isNotEmpty(patArchives)) {
            patArchives.get(0).getPatid();
            log.info("患者id为: {}", patArchives.get(0).getPatid());
            return patArchives.get(0).getPatid().intValue();
            patArchives.get(0).getId();
            log.info("患者id为: {}", patArchives.get(0).getId());
            return patArchives.get(0).getId().intValue();
        }
        return null;
    }
@@ -137,7 +137,7 @@
                    //新增
                    patArchivetag.setUpdateBy(null);
                    patArchivetag.setCreateTime(new Date());
                    patArchivetag.setPatid(patArchive.getPatid());
                    patArchivetag.setPatid(patArchive.getId());
                    patArchivetagMapper.insertPatArchivetag(patArchivetag);
                } else if (patArchivetag.getIsoperation() != null && patArchivetag.getIsoperation() == 3 || patArchivetag.getIsoperation() == null && patArchiveVO.getIsoperation() == 3) {
                    patArchivetag.setDelFlag("1");
@@ -478,7 +478,7 @@
        //根据患者ID进行分组
        Map<Long, List<PatArchive>> listMap = patArchiveList.stream().collect(Collectors.groupingBy(PatArchive::getPatid));
        Map<Long, List<PatArchive>> listMap = patArchiveList.stream().collect(Collectors.groupingBy(PatArchive::getId));
        //对数据进行封装
        for (List<PatArchive> list : listMap.values()) {
@@ -515,7 +515,7 @@
                for (int j = 0; j < patArchivetags1.size(); j++) {
                    PatArchivetagAndPatientInfo patArchivetagAndPatientInfo = DtoConversionUtils.sourceToTarget(patArchivetags1.get(j), PatArchivetagAndPatientInfo.class);
                    PatArchive patArchive = new PatArchive();
                    patArchive.setPatid(patArchivetagAndPatientInfo.getPatid());
                    patArchive.setId(patArchivetagAndPatientInfo.getPatid());
                    List<PatArchive> patArchiveList = patArchiveMapper.selectPatArchiveList(patArchive);
                    patArchivetagAndPatientInfo.setPatNum(patArchiveList.size());
                    // patArchivetagAndPatientInfo.setPatArchives(patArchiveList);
@@ -529,7 +529,7 @@
            for (int j = 0; j < patArchivetags1.size(); j++) {
                PatArchivetagAndPatientInfo patArchivetagAndPatientInfo = DtoConversionUtils.sourceToTarget(patArchivetags1.get(j), PatArchivetagAndPatientInfo.class);
                PatArchive patArchive = new PatArchive();
                patArchive.setPatid(patArchivetagAndPatientInfo.getPatid());
                patArchive.setId(patArchivetagAndPatientInfo.getPatid());
                List<PatArchive> patArchiveList = patArchiveMapper.selectPatArchiveList(patArchive);
                //  patArchivetagAndPatientInfo.setPatArchives(patArchiveList);
                patArchivetagAndPatientInfo.setPatNum(patArchiveList.size());
smartor/src/main/java/com/smartor/service/impl/PatArchivetagServiceImpl.java
@@ -1,17 +1,14 @@
package com.smartor.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.smartor.domain.PatArchivetag;
import com.smartor.domain.PatArchivetagAndPatientInfo;
import com.smartor.mapper.PatArchiveMapper;
import com.smartor.mapper.PatArchivetagMapper;
import com.smartor.service.IPatArchivetagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * æ‚£è€…档案标签Service业务层处理
 *
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -1,13 +1,24 @@
package com.smartor.service.impl;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.smartor.domain.ServiceSubtaskAnswer;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.ServiceSubtaskAnswerMapper;
import com.smartor.mapper.ServiceSubtaskMapper;
import com.smartor.service.IServiceSubtaskAnswerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
 * ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹Service业务层处理
@@ -15,11 +26,20 @@
 * @author ruoyi
 * @date 2024-07-18
 */
@Slf4j
@Service
public class ServiceSubtaskAnswerServiceImpl implements IServiceSubtaskAnswerService
{
public class ServiceSubtaskAnswerServiceImpl implements IServiceSubtaskAnswerService {
    @Autowired
    private ServiceSubtaskAnswerMapper serviceSubtaskAnswerMapper;
    @Autowired
    private ServiceSubtaskMapper serviceSubtaskMapper;
    @Autowired
    private RedisCache redisCache;
    @Value("${pri_key}")
    private String pri_key;
    /**
     * æŸ¥è¯¢ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹
@@ -28,8 +48,7 @@
     * @return ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹
     */
    @Override
    public ServiceSubtaskAnswer selectServiceSubtaskAnswerById(Long id)
    {
    public ServiceSubtaskAnswer selectServiceSubtaskAnswerById(Long id) {
        return serviceSubtaskAnswerMapper.selectServiceSubtaskAnswerById(id);
    }
@@ -40,8 +59,7 @@
     * @return ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹
     */
    @Override
    public List<ServiceSubtaskAnswer> selectServiceSubtaskAnswerList(ServiceSubtaskAnswer serviceSubtaskAnswer)
    {
    public List<ServiceSubtaskAnswer> selectServiceSubtaskAnswerList(ServiceSubtaskAnswer serviceSubtaskAnswer) {
        return serviceSubtaskAnswerMapper.selectServiceSubtaskAnswerList(serviceSubtaskAnswer);
    }
@@ -52,8 +70,7 @@
     * @return ç»“æžœ
     */
    @Override
    public int insertServiceSubtaskAnswer(ServiceSubtaskAnswer serviceSubtaskAnswer)
    {
    public int insertServiceSubtaskAnswer(ServiceSubtaskAnswer serviceSubtaskAnswer) {
        serviceSubtaskAnswer.setCreateTime(DateUtils.getNowDate());
        return serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer);
    }
@@ -65,8 +82,7 @@
     * @return ç»“æžœ
     */
    @Override
    public int updateServiceSubtaskAnswer(ServiceSubtaskAnswer serviceSubtaskAnswer)
    {
    public int updateServiceSubtaskAnswer(ServiceSubtaskAnswer serviceSubtaskAnswer) {
        serviceSubtaskAnswer.setUpdateTime(DateUtils.getNowDate());
        return serviceSubtaskAnswerMapper.updateServiceSubtaskAnswer(serviceSubtaskAnswer);
    }
@@ -78,8 +94,7 @@
     * @return ç»“æžœ
     */
    @Override
    public int deleteServiceSubtaskAnswerByIds(Long[] ids)
    {
    public int deleteServiceSubtaskAnswerByIds(Long[] ids) {
        return serviceSubtaskAnswerMapper.deleteServiceSubtaskAnswerByIds(ids);
    }
@@ -90,8 +105,146 @@
     * @return ç»“æžœ
     */
    @Override
    public int deleteServiceSubtaskAnswerById(Long id)
    {
    public int deleteServiceSubtaskAnswerById(Long id) {
        return serviceSubtaskAnswerMapper.deleteServiceSubtaskAnswerById(id);
    }
    @Override
    public Integer saveQuestionAnswer(ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) {
        Set<String> allKeys = redisCache.getAllKeys();
        if (ObjectUtils.isNotEmpty(serviceSubTaskAnswerReq)) {
            //需要立即执行
            RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
            Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam1(), pri_key));
            Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam2(), pri_key));
            allKeys = new HashSet<>();
            if (serviceSubTaskAnswerReq.getType() == 1) {
                allKeys.add(redisCache.getCacheObject(pid + "-" + tid + "-SFscriptCache"));
            } else if (serviceSubTaskAnswerReq.getType() == 2) {
                allKeys.add(redisCache.getCacheObject(pid + "-" + tid + "-WJscriptCache"));
            }
        }
        Long nextScriptno = null;
        for (String key : allKeys) {
            String[] split = key.split("-");
            if (key.contains("-SFscriptCache")) {
                //包含了,说明了是随访问题
                List<IvrLibaTemplateScriptVO> cacheList = redisCache.getCacheList(key);
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        // è¯´æ˜Žæ˜¯ç¬¬ä¸€é¢˜
                        IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO = cacheList.get(0);
                        //将第一题的信息放到表中
                        setSFInfo(ivrLibaTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                        nextScriptno = cacheList.get(0).getNextScriptno();
                    } else {
                        //不是第 ä¸€ é¢˜
                        for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : cacheList) {
                            if (ivrLibaTemplateScriptVO.getId() == nextScriptno) {
                                setSFInfo(ivrLibaTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                                nextScriptno = ivrLibaTemplateScriptVO.getNextScriptno();
                            }
                        }
                    }
                }
            } else if (key.contains("-WJscriptCache")) {
                List<SvyLibTemplateScriptVO> cacheList = redisCache.getCacheList(key);
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        // è¯´æ˜Žæ˜¯ç¬¬ä¸€é¢˜
                        //将第一题的信息放到表中
                        setWJInfo(cacheList.get(0), Long.valueOf(split[1]), Long.valueOf(split[0]));
                        nextScriptno = Long.valueOf(cacheList.get(0).getNextScriptno());
                    } else {
                        for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : cacheList) {
                            if (svyLibTemplateScriptVO.getId() == nextScriptno) {
                                //将第一题的信息放到表中
                                setWJInfo(svyLibTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                                nextScriptno = Long.valueOf(cacheList.get(0).getNextScriptno());
                            }
                        }
                    }
                }
            }
            //将该key和value从redis中,删除
            redisCache.deleteObject(key);
        }
        return 1;
    }
    /**
     * å°†é—®é¢˜ä¿å­˜åˆ°ç¼“存中
     *
     * @param serviceSubTaskCacheReq
     * @return
     */
    @Override
    public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq) {
        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
        Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam1(), pri_key));
        Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam2(), pri_key));
        if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList())) {
            //随访
            redisCache.setCacheObject(pid + "-" + tid + "-SFscriptCache", serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList());
        } else if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getSvyLibTemplateScriptVOList())) {
            //问卷
            redisCache.setCacheObject(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyLibTemplateScriptVOList());
        }
        return 1;
    }
    private void setSFInfo(IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO, Long taskid, Long patid) {
        ServiceSubtaskAnswer serviceSubtaskAnswer = null;
        String dx = "";
        if (ivrLibaTemplateScriptVO.getScriptType().equals("1") || ivrLibaTemplateScriptVO.getScriptType().equals("2")) {
            //1、2为单选或多选
            for (IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption : ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList()) {
                //获取用户选中的选项号
                dx = dx + "," + ivrLibaTemplateTargetoption.getOptionNo().toString();
            }
        } else {
            //非单多选
            if (CollectionUtils.isNotEmpty(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList())) {
                dx = ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList().get(0).getAppenddesc();
            }
        }
        serviceSubtaskAnswer.setTaskid(Long.valueOf(taskid));
        serviceSubtaskAnswer.setPatId(Long.valueOf(patid));
        serviceSubtaskAnswer.setScriptid(ivrLibaTemplateScriptVO.getId());
        serviceSubtaskAnswer.setScriptType(Long.valueOf(ivrLibaTemplateScriptVO.getScriptType()));
        serviceSubtaskAnswer.setAnswer(dx.substring(1));
        serviceSubtaskAnswer.setComment(null);
        serviceSubtaskAnswer.setCreateTime(new Date());
        serviceSubtaskAnswer.setUpdateTime(new Date());
        serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer);
    }
    private void setWJInfo(SvyLibTemplateScriptVO svyLibTemplateScriptVO, Long taskid, Long patid) {
        ServiceSubtaskAnswer serviceSubtaskAnswer = null;
        String dx = "";
        if (svyLibTemplateScriptVO.getScriptType().equals("1") || svyLibTemplateScriptVO.getScriptType().equals("2")) {
            //1、2为单选或多选
            for (SvyLibTemplateTargetoption svyLibTemplateTargetoption : svyLibTemplateScriptVO.getSvyLibTemplateTargetoptions()) {
                //获取用户选中的选项号
                dx = dx + "," + svyLibTemplateTargetoption.getOptionNo().toString();
            }
        } else {
            //非单多选
            if (CollectionUtils.isNotEmpty(svyLibTemplateScriptVO.getSvyLibTemplateTargetoptions())) {
                dx = svyLibTemplateScriptVO.getSvyLibTemplateTargetoptions().get(0).getAppenddesc();
            }
        }
        serviceSubtaskAnswer.setTaskid(Long.valueOf(taskid));
        serviceSubtaskAnswer.setPatId(Long.valueOf(patid));
        serviceSubtaskAnswer.setScriptid(svyLibTemplateScriptVO.getId());
        serviceSubtaskAnswer.setScriptType(Long.valueOf(svyLibTemplateScriptVO.getScriptType()));
        serviceSubtaskAnswer.setAnswer(dx.substring(1));
        serviceSubtaskAnswer.setComment(null);
        serviceSubtaskAnswer.setCreateTime(new Date());
        serviceSubtaskAnswer.setUpdateTime(new Date());
        serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer);
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -759,7 +759,7 @@
//    }
    @Override
    public Integer saveQuestionAnswer(ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
    public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
        Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam1(), pri_key));
        Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam2(), pri_key));
smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java
@@ -246,7 +246,7 @@
                if (isoperation == 1) {
                    //新增
                    svyTaskTemplateTargetoption.setTemplateID(tmpID);
                    svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScript.getID());
                    svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScript.getId());
                    if (CollectionUtils.isNotEmpty(svyTaskTemplateTargetoption.getDynamiccruxs()))
                        svyTaskTemplateTargetoption.setDynamiccruxsJson(JSON.toJSONString(svyTaskTemplateTargetoption.getDynamiccruxs()));
                    if (CollectionUtils.isNotEmpty(svyTaskTemplateTargetoption.getNodynamiccruxs()))
@@ -255,7 +255,7 @@
                } else if (isoperation == 2) {
                    //修改
                    svyTaskTemplateTargetoption.setTemplateID(tmpID);
                    svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScript.getID());
                    svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScript.getId());
                    if (CollectionUtils.isNotEmpty(svyTaskTemplateTargetoption.getDynamiccruxs()))
                        svyTaskTemplateTargetoption.setDynamiccruxsJson(JSON.toJSONString(svyTaskTemplateTargetoption.getDynamiccruxs()));
                    if (CollectionUtils.isNotEmpty(svyTaskTemplateTargetoption.getNodynamiccruxs()))
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -42,11 +42,15 @@
        <result property="isMust" column="is_must"/>
        <result property="scriptDesc" column="script_desc"/>
        <result property="scriptType" column="script_type"/>
        <result property="branchFlag" column="branch_flag"/>
        <result property="branchNextscriptno" column="branch_nextscriptno"/>
    </resultMap>
    <sql id="selectIvrLibaTemplateScriptVo">
        select id,
               scriptno,
               branch_flag,
               branch_nextscriptno,
               templateid,
               script_type,
               scriptid,
@@ -104,6 +108,9 @@
            <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>
@@ -170,6 +177,8 @@
            <if test="isMust != null  and isMust != ''">is_must,</if>
            <if test="scriptDesc != null ">script_desc,</if>
            <if test="scriptType != null ">script_type,</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag,</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="scriptno != null">#{scriptno},</if>
@@ -207,6 +216,8 @@
            <if test="isMust != null  and isMust != ''">#{isMust},</if>
            <if test="scriptDesc != null ">#{scriptDesc},</if>
            <if test="scriptType != null ">#{scriptType},</if>
            <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">#{branchNextscriptno},</if>
        </trim>
    </insert>
@@ -247,8 +258,12 @@
            <if test="isMust != null  and isMust != ''">is_must = #{isMust}</if>
            <if test="scriptDesc != null ">script_desc = #{scriptDesc}</if>
            <if test="scriptType != null ">script_type = #{scriptType}</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag = #{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno =
                #{branchNextscriptno},
            </if>
        </trim>
        where ID = #{ID}
        where id = #{id}
    </update>
    <update id="deleteIvrLibaTemplateScriptByID" parameterType="Long">
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
@@ -35,6 +35,7 @@
        <result property="nextQuestion" column="next_question"/>
        <result property="appendflag" column="appendflag"/>
        <result property="appenddesc" column="appenddesc"/>
        <result property="optionNo" column="option_no"/>
    </resultMap>
    <sql id="selectIvrLibaTemplateTargetoptionVo">
@@ -53,6 +54,7 @@
               nodynamiccruxs,
               dynamiccruxs,
               targetid,
               option_no,
               next_question,
               optiondesc, language, version, groupid, isabnormal, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid
        from ivr_liba_template_targetoption
@@ -88,6 +90,7 @@
            <if test="dynamiccruxsJson != null ">and dynamiccruxs = #{dynamiccruxsJson}</if>
            <if test="appendflag != null">and appendflag = #{appendflag}</if>
            <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
            <if test="optionNo != null">and option_no = #{optionNo}</if>
        </where>
    </select>
@@ -130,6 +133,7 @@
            <if test="dynamiccruxsJson != null ">dynamiccruxs,</if>
            <if test="appendflag != null">appendflag,</if>
            <if test="appenddesc != null">appenddesc,</if>
            <if test="optionNo != null">option_no,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="targetid != null">#{targetid},</if>
@@ -161,6 +165,7 @@
            <if test="dynamiccruxsJson != null ">#{dynamiccruxsJson},</if>
            <if test="appendflag != null">#{appendflag},</if>
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="optionNo != null">#{optionNo},</if>
        </trim>
    </insert>
@@ -196,6 +201,7 @@
            <if test="dynamiccruxsJson != null ">dynamiccruxs = #{dynamiccruxsJson},</if>
            <if test="appendflag != null">appendflag = #{appendflag},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="optionNo != null">option_no = #{optionNo},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -5,7 +5,7 @@
<mapper namespace="com.smartor.mapper.IvrTaskTemplateScriptMapper">
    <resultMap type="com.smartor.domain.IvrTaskTemplateScript" id="IvrTaskTemplateScriptResult">
        <result property="ID"    column="ID"    />
        <result property="id"    column="id"    />
        <result property="taskid"    column="taskid"    />
        <result property="templateID"    column="templateID"    />
        <result property="questionPoint"    column="questionPoint"    />
@@ -38,10 +38,12 @@
        <result property="otherdata"    column="otherdata"    />
        <result property="isMust"    column="is_must"    />
        <result property="questionResult"    column="question_result"    />
        <result property="branchFlag" column="branch_flag"/>
        <result property="branchNextscriptno" column="branch_nextscriptno"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateScriptVo">
        select ID, taskid,  templateID, questionPoint,  noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, categoryName, 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
        select ID, taskid,branch_flag,branch_nextscriptno,  templateID, questionPoint,  noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, categoryName, 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>
    <select id="selectIvrTaskTemplateScriptList" parameterType="com.smartor.domain.IvrTaskTemplateScript" resultMap="IvrTaskTemplateScriptResult">
@@ -74,12 +76,15 @@
            <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="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno = #{branchNextscriptno}
            </if>
        </where>
    </select>
    <select id="selectIvrTaskTemplateScriptByID" parameterType="Long" resultMap="IvrTaskTemplateScriptResult">
        <include refid="selectIvrTaskTemplateScriptVo"/>
        where ID = #{ID}
        where id = #{id}
    </select>
    <insert id="insertIvrTaskTemplateScript" parameterType="com.smartor.domain.IvrTaskTemplateScript" useGeneratedKeys="true" keyProperty="ID">
@@ -117,6 +122,8 @@
            <if test="otherdata != null">otherdata,</if>
            <if test="isMust != null">is_must,</if>
            <if test="questionResult != null">question_result,</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag,</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -151,6 +158,8 @@
            <if test="otherdata != null">#{otherdata},</if>
            <if test="isMust != null">#{isMust},</if>
            <if test="questionResult != null">#{questionResult},</if>
            <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">#{branchNextscriptno},</if>
         </trim>
    </insert>
@@ -189,8 +198,12 @@
            <if test="otherdata != null">otherdata = #{otherdata},</if>
            <if test="isMust != null">is_must = #{isMust},</if>
            <if test="questionResult != null">question_result = #{questionResult},</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag = #{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno =
                #{branchNextscriptno},
            </if>
        </trim>
        where ID = #{ID}
        where id = #{id}
    </update>
    <delete id="deleteIvrTaskTemplateScriptByID" parameterType="Long">
@@ -198,9 +211,9 @@
    </delete>
    <delete id="deleteIvrTaskTemplateScriptByIDs" parameterType="String">
        delete from ivr_task_template_script where ID in
        <foreach item="ID" collection="array" open="(" separator="," close=")">
            #{ID}
        delete from ivr_task_template_script where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -5,7 +5,7 @@
<mapper namespace="com.smartor.mapper.PatArchiveMapper">
    <resultMap type="com.smartor.domain.PatArchive" id="PatArchiveResult">
        <result property="patid" column="patid"/>
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="sex" column="sex"/>
        <result property="nation" column="nation"/>
@@ -39,7 +39,7 @@
    </resultMap>
    <sql id="selectPatArchiveVo">
        select patid,
        select id,
               name,
               sex,
               idcardno,
@@ -77,7 +77,7 @@
            <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
            <if test="telcode != null  and telcode != ''">and telcode = #{telcode}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="patid != null  and patid != ''">and patid = #{patid}</if>
            <if test="id != null  and id != ''">and id = #{id}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="viptype != null ">and viptype = #{viptype}</if>
@@ -87,7 +87,7 @@
    <select id="patInfoByContion" parameterType="com.smartor.domain.PatArchiveReq" resultMap="PatArchiveResult">
        select
        a.patid,
        a.id,
        a.name,
        a.sex,
        c.tagname as tag,
@@ -102,7 +102,7 @@
        from pat_archive a,pat_archivetag b ,base_tag c
        <where>
            a.del_flag=0 and
            a.patid = b.patid and b.tagid = c.tagid
            a.id = b.patid and b.tagid = c.tagid
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
            <if test="telcode != null  and telcode != ''">and telcode = #{telcode}</if>
@@ -116,7 +116,7 @@
    <select id="selectPatArchiveByPatid" parameterType="Long" resultMap="PatArchiveResult">
        <include refid="selectPatArchiveVo"/>
        where patid = #{patid} and del_flag=0
        where id = #{id} and del_flag=0
    </select>
    <insert id="insertPatArchive">
@@ -206,19 +206,19 @@
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="viptype != null">viptype = #{viptype},</if>
        </trim>
        where patid = #{patid}
        where id = #{id}
    </update>
    <delete id="deletePatArchiveByPatid" parameterType="Long">
        delete
        from pat_archive
        where patid = #{patid}
        where id = #{id}
    </delete>
    <delete id="deletePatArchiveByPatids" parameterType="String">
        delete from pat_archive where patid in
        <foreach item="patid" collection="array" open="(" separator="," close=")">
            #{patid}
        delete from pat_archive where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
@@ -226,7 +226,7 @@
            resultMap="PatArchiveResult">
        SELECT
        a.patid,
        a.id,
        a.NAME,
        a.sex,
        a.nation,
@@ -257,12 +257,12 @@
        b.tagid AS tagid
        FROM
        pat_archive a
        LEFT JOIN pat_archivetag b ON a.patid = b.patid AND b.del_flag = 0
        LEFT JOIN pat_archivetag b ON a.id = b.patid AND b.del_flag = 0
        <where>
            a.del_flag = 0
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
            <if test="pid != null  and pid != ''">and a.patid = #{pid}</if>
            <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
            <if test="telcode != null  and telcode != ''">and a.telcode = #{telcode}</if>
            <if test="tagIds != null  and tagIds != ''">and b.tagid in
                <foreach collection="tagIds" item="tagId" open="(" separator="," close=")">
@@ -278,7 +278,7 @@
            resultMap="PatArchiveResult">
        select
        a.patid,
        a.id,
        a.NAME,
        d.deptname,
        a.sex,
@@ -311,13 +311,13 @@
        t.tagname
        FROM
        pat_med_inhosp d
        JOIN pat_archive a ON a.patid = d.patid
        JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        d.patid
        <where>
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
            <if test="pid != null  and pid != ''">and a.patid = #{pid}</if>
            <if test="pid != null  and pid != ''">and a.id = #{id}</if>
            <if test="telcode != null  and telcode != ''">and a.telcode = #{telcode}</if>
            <if test="hospitalname != null and hospitalname != ''">
@@ -348,7 +348,7 @@
                AND d.deptname LIKE concat('%',#{deptname}, '%')
            </if>
            <if test="pids != null">
                AND a.patid NOT IN
                AND a.id NOT IN
                <foreach collection="pids" item="pid" open="(" separator="," close=")">
                    #{pid}
                </foreach>
@@ -362,7 +362,7 @@
            resultMap="PatArchiveResult">
        select
        a.patid,
        a.id,
        d.deptname,
        a.name,
        a.sex,
@@ -390,11 +390,11 @@
        a.isupload,
        a.upload_time,
        a.pattype
        from pat_med_outhosp d JOIN pat_archive a ON a.patid = d.patid
        from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        d.patid
        <where>
            <if test="pid != null  and pid != ''">and a.patid = #{pid}</if>
            <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
            <if test="telcode != null  and telcode != ''">and a.telcode = #{telcode}</if>
@@ -417,7 +417,7 @@
                AND d.drname LIKE concat('%',#{drname}, '%')
            </if>
            <if test="pids != null">
                AND a.patid NOT IN
                AND a.id NOT IN
                <foreach collection="pids" item="pid" open="(" separator="," close=")">
                    #{pid}
                </foreach>
@@ -431,7 +431,7 @@
            resultMap="PatArchiveResult">
        select
        a.patid as id,
        a.id,
        a.name,
        a.sex,
        d.deptname,
@@ -459,11 +459,11 @@
        a.isupload,
        a.upload_time,
        a.pattype
        from pat_med_physical d JOIN pat_archive a ON a.patid = d.patid
        from pat_med_physical d JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
        d.patid
        <where>
            <if test="pid != null  and pid != ''">and a.patid = #{pid}</if>
            <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
            <if test="telcode != null  and telcode != ''">and a.telcode = #{telcode}</if>
@@ -487,7 +487,7 @@
                AND d.drname LIKE concat('%',#{drname}, '%')
            </if>
            <if test="pids != null">
                AND a.patid NOT IN
                AND a.id NOT IN
                <foreach collection="pids" item="pid" open="(" separator="," close=")">
                    #{pid}
                </foreach>
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -38,12 +38,16 @@
        <result property="score" column="score"/>
        <result property="scriptPicture" column="script_picture"/>
        <result property="scriptTopic" column="script_topic"/>
        <result property="branchFlag" column="branch_flag"/>
        <result property="branchNextscriptno" column="branch_nextscriptno"/>
    </resultMap>
    <sql id="selectSvyLibTemplateScriptVo">
        select id,
               script_type,
               scriptid,
               branchFlag,
               branchNextscriptno,
               svyid,
               scriptno,
               next_scriptno,
@@ -103,6 +107,9 @@
            <if test="score != null  and score != ''">and score = #{score}</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>
        </where>
    </select>
@@ -147,6 +154,8 @@
            <if test="scriptPicture != null">script_picture,</if>
            <if test="scriptTopic != null">script_topic,</if>
            <if test="svyid != null">svyid,</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag,</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="nextScriptno != null">#{nextScriptno},</if>
@@ -181,6 +190,8 @@
            <if test="scriptPicture != null">#{scriptPicture},</if>
            <if test="scriptTopic != null">#{scriptTopic},</if>
            <if test="svyid != null">#{svyid},</if>
            <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">#{branchNextscriptno},</if>
        </trim>
    </insert>
@@ -219,6 +230,10 @@
            <if test="scriptPicture != null">script_picture = #{scriptPicture},</if>
            <if test="scriptTopic != null">script_topic = #{scriptTopic},</if>
            <if test="svyid != null">svyid = #{svyid},</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag = #{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno =
                #{branchNextscriptno},
            </if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
@@ -39,12 +39,14 @@
        <result property="score" column="score"/>
        <result property="appendflag" column="appendflag"/>
        <result property="appenddesc" column="appenddesc"/>
        <result property="optionNo" column="option_no"/>
    </resultMap>
    <sql id="selectSvyLibTemplateTargetoptionVo">
        select id,
               groupid,
               score,
               option_no,
               appendflag,
               appenddesc,
               categoryName,
@@ -103,6 +105,7 @@
            <if test="picturePath != null  and picturePath != ''">and picture_path = #{picturePath}</if>
            <if test="appendflag != null">and appendflag = #{appendflag}</if>
            <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
            <if test="optionNo != null">and option_no = #{optionNo}</if>
        </where>
    </select>
@@ -148,6 +151,7 @@
            <if test="score != null">score,</if>
            <if test="appendflag != null">appendflag,</if>
            <if test="appenddesc != null">appenddesc,</if>
            <if test="optionNo != null">option_no,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="groupid != null">#{groupid},</if>
@@ -183,6 +187,7 @@
            <if test="score != null">#{score},</if>
            <if test="appendflag != null">#{appendflag},</if>
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="optionNo != null">#{optionNo},</if>
        </trim>
    </insert>
@@ -222,6 +227,7 @@
            <if test="score != null">score = #{score},</if>
            <if test="appendflag != null">appendflag = #{appendflag},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="optionNo != null">option_no = #{optionNo},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
@@ -5,7 +5,7 @@
<mapper namespace="com.smartor.mapper.SvyTaskTemplateScriptMapper">
    <resultMap type="com.smartor.domain.SvyTaskTemplateScript" id="SvyTaskTemplateScriptResult">
        <result property="ID" column="ID"/>
        <result property="id" column="id"/>
        <result property="taskid" column="taskid"/>
        <result property="scriptno" column="scriptno"/>
        <result property="templateID" column="templateID"/>
@@ -36,11 +36,16 @@
        <result property="picturePath" column="picture_path"/>
        <result property="sort" column="sort"/>
        <result property="scriptTopic" column="script_topic"/>
        <result property="branchFlag" column="branch_flag"/>
        <result property="branchNextscriptno" column="branch_nextscriptno"/>
    </resultMap>
    <sql id="selectSvyTaskTemplateScriptVo">
        select ID,
        select id,
               sort,
               branchFlag,
               branchNextscriptno,
               script_desc,
               taskid,
               scriptno,
@@ -80,12 +85,16 @@
            <if test="otherdata != null  and otherdata != ''">and otherdata = #{otherdata}</if>
            <if test="picturePath != null  and picturePath != ''">and picture_path = #{picturePath}</if>
            <if test="scriptTopic != null  and scriptTopic != ''">and script_topic = #{scriptTopic}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                #{branchNextscriptno}
            </if>
        </where>
    </select>
    <select id="selectSvyTaskTemplateScriptByID" parameterType="Long" resultMap="SvyTaskTemplateScriptResult">
        <include refid="selectSvyTaskTemplateScriptVo"/>
        where ID = #{ID}
        where id = #{id}
    </select>
    <insert id="insertSvyTaskTemplateScript" parameterType="com.smartor.domain.SvyTaskTemplateScript"
@@ -122,6 +131,8 @@
            <if test="picturePath != null">picture_path,</if>
            <if test="sort != null">sort,</if>
            <if test="scriptTopic != null">script_topic,</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag,</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -154,6 +165,8 @@
            <if test="picturePath != null">#{picturePath},</if>
            <if test="sort != null">#{sort},</if>
            <if test="scriptTopic != null">#{scriptTopic},</if>
            <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">#{branchNextscriptno},</if>
        </trim>
    </insert>
@@ -190,20 +203,24 @@
            <if test="picturePath != null">picture_path = #{picturePath},</if>
            <if test="sort != null">sort = #{sort},</if>
            <if test="scriptTopic != null">script_topic = #{scriptTopic},</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag = #{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno =
                #{branchNextscriptno},
            </if>
        </trim>
        where ID = #{ID}
        where id = #{d}
    </update>
    <delete id="deleteSvyTaskTemplateScriptByID" parameterType="Long">
        delete
        from svy_task_template_script
        where ID = #{ID}
        where id = #{id}
    </delete>
    <delete id="deleteSvyTaskTemplateScriptByIDs" parameterType="String">
        delete from svy_task_template_script where ID in
        <foreach item="ID" collection="array" open="(" separator="," close=")">
            #{ID}
        delete from svy_task_template_script where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>