| | |
| | | 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; |
| | |
| | | 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)); |
| | | } |
| | | } |
| | |
| | | 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)); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åæækey |
| | | * |
| | | * @return |
| | | */ |
| | | public Set<String> getAllKeys() { |
| | | return redisTemplate.keys("*"); |
| | | } |
| | | |
| | | /** |
| | | * è·å¾ç¼åçMap |
| | | * |
| | | * @param key |
| | |
| | | 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; |
| | |
| | | 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)); |
| | |
| | | iServiceThirdDataService.queryList(serviceThirdData); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 宿¶å¤çå¤é¾çæ°æ® |
| | | */ |
| | | public void runServiceSubTaskAnswer() { |
| | | serviceSubtaskAnswerService.saveQuestionAnswer(null); |
| | | } |
| | | } |
| | |
| | | @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; |
| | | } |
| | |
| | | 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") |
| | |
| | | /** |
| | | * é®é¢ç±»å |
| | | */ |
| | | @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; |
| | | |
| | | |
| | | /** |
| | | * ä¸ä¼ æ è®° |
| | |
| | | * ä¸ä¸é¢ |
| | | */ |
| | | @ApiModelProperty(value = "ä¸ä¸é¢") |
| | | private Integer nextScriptno; |
| | | private Long nextScriptno; |
| | | |
| | | /** |
| | | * æ ç¾ |
| | |
| | | private Long pid; |
| | | |
| | | /** |
| | | * é项ç»å· |
| | | */ |
| | | @Excel(name = "é项ç»å·") |
| | | @ApiModelProperty(value = "é项ç»å·") |
| | | private Long optionNo; |
| | | |
| | | /** |
| | | * GUID |
| | | */ |
| | | @Excel(name = "GUID") |
| | |
| | | * 主é®ID |
| | | */ |
| | | @ApiModelProperty(value = "主é®") |
| | | private Long ID; |
| | | private Long id; |
| | | |
| | | /** |
| | | * ä»»å¡id |
| | |
| | | @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; |
| | | |
| | | } |
| | |
| | | * èªå¢ID |
| | | */ |
| | | @ApiModelProperty("èªå¢ID") |
| | | private Long patid; |
| | | private Long id; |
| | | |
| | | /** |
| | | * å§å |
| | |
| | | @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(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | @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; |
| | | |
| | | } |
| | |
| | | @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; |
| | | |
| | | /** |
| | | * ä¸ä¸ä¸ªé®é¢ç¼å· |
| | | */ |
| | |
| | | private Long templateID; |
| | | |
| | | /** |
| | | * é项ç¼å· |
| | | */ |
| | | @Excel(name = "é项ç¼å·") |
| | | @ApiModelProperty(value = "é项ç¼å·") |
| | | private Long optionNo; |
| | | |
| | | /** |
| | | * è¯æ¯ID |
| | | */ |
| | | @Excel(name = "è¯æ¯ID") |
| | |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | private Long ID; |
| | | private Long id; |
| | | |
| | | /** |
| | | * ä»»å¡id |
| | |
| | | @ApiModelProperty("é¢ç®ä¸»é¢") |
| | | private String scriptTopic; |
| | | |
| | | /** |
| | | * é项忝æ è¯(0:æ 忝1:æåæ¯) |
| | | */ |
| | | @Excel(name = "é项忝æ è¯(0:æ 忝1:æåæ¯)") |
| | | @ApiModelProperty(value = "é项忝æ è¯(0:æ 忝1:æåæ¯)") |
| | | private String branchFlag; |
| | | |
| | | /** |
| | | * é项忝çä¸ä¸ä¸ªè¯æ¯ç¼å· |
| | | */ |
| | | @Excel(name = "é项忝çä¸ä¸ä¸ªè¯æ¯ç¼å·") |
| | | @ApiModelProperty(value = "é项忝çä¸ä¸ä¸ªè¯æ¯ç¼å·") |
| | | private String branchNextscriptno; |
| | | |
| | | } |
| | |
| | | @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; |
| | | |
| | | |
| | | /** |
| | | * è¯æ¯é项 |
| | | */ |
| | |
| | | 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; |
| | |
| | | * @author ruoyi |
| | | * @date 2024-07-18 |
| | | */ |
| | | public interface IServiceSubtaskAnswerService |
| | | { |
| | | public interface IServiceSubtaskAnswerService { |
| | | /** |
| | | * æ¥è¯¢ä»»å¡é®å·é®é¢é项 |
| | | * |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteServiceSubtaskAnswerById(Long id); |
| | | |
| | | /** |
| | | * å°ç¼åçæ°æ®ä¿åå°æ°æ®åº |
| | | * |
| | | * @param serviceSubTaskAnswerReq |
| | | * @return |
| | | */ |
| | | public Integer saveQuestionAnswer(ServiceSubTaskAnswerReq serviceSubTaskAnswerReq); |
| | | |
| | | /** |
| | | * å°é®é¢ä¿åå°ç¼å |
| | | * |
| | | * @param serviceSubTaskCacheReq |
| | | * @return |
| | | */ |
| | | public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq); |
| | | |
| | | } |
| | |
| | | */ |
| | | public void phoneCallBack(PhoneCallBackVO phoneCallBackVO); |
| | | |
| | | public Integer saveQuestionAnswer(ServiceSubTaskDetailReq serviceSubTaskDetailReq); |
| | | public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq); |
| | | |
| | | } |
| | |
| | | */ |
| | | public Boolean deleteServiceTaskByTaskid(Long taskid); |
| | | |
| | | /** |
| | | * |
| | | * @param taskid |
| | | * @param patid |
| | | * @return |
| | | */ |
| | | public List getScriptInfoByCondition(Long taskid, Long patid); |
| | | |
| | | |
| | |
| | | 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())) |
| | |
| | | } 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())) |
| | |
| | | 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; |
| | | } |
| | |
| | | //æ°å¢ |
| | | 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"); |
| | |
| | | |
| | | |
| | | //æ ¹æ®æ£è
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()) { |
| | |
| | | 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); |
| | |
| | | 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()); |
| | |
| | | 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ä¸å¡å±å¤ç |
| | | * |
| | |
| | | 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ä¸å¡å±å¤ç |
| | |
| | | * @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; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡é®å·é®é¢é项 |
| | |
| | | * @return ä»»å¡é®å·é®é¢é项 |
| | | */ |
| | | @Override |
| | | public ServiceSubtaskAnswer selectServiceSubtaskAnswerById(Long id) |
| | | { |
| | | public ServiceSubtaskAnswer selectServiceSubtaskAnswerById(Long id) { |
| | | return serviceSubtaskAnswerMapper.selectServiceSubtaskAnswerById(id); |
| | | } |
| | | |
| | |
| | | * @return ä»»å¡é®å·é®é¢é项 |
| | | */ |
| | | @Override |
| | | public List<ServiceSubtaskAnswer> selectServiceSubtaskAnswerList(ServiceSubtaskAnswer serviceSubtaskAnswer) |
| | | { |
| | | public List<ServiceSubtaskAnswer> selectServiceSubtaskAnswerList(ServiceSubtaskAnswer serviceSubtaskAnswer) { |
| | | return serviceSubtaskAnswerMapper.selectServiceSubtaskAnswerList(serviceSubtaskAnswer); |
| | | } |
| | | |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertServiceSubtaskAnswer(ServiceSubtaskAnswer serviceSubtaskAnswer) |
| | | { |
| | | public int insertServiceSubtaskAnswer(ServiceSubtaskAnswer serviceSubtaskAnswer) { |
| | | serviceSubtaskAnswer.setCreateTime(DateUtils.getNowDate()); |
| | | return serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer); |
| | | } |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateServiceSubtaskAnswer(ServiceSubtaskAnswer serviceSubtaskAnswer) |
| | | { |
| | | public int updateServiceSubtaskAnswer(ServiceSubtaskAnswer serviceSubtaskAnswer) { |
| | | serviceSubtaskAnswer.setUpdateTime(DateUtils.getNowDate()); |
| | | return serviceSubtaskAnswerMapper.updateServiceSubtaskAnswer(serviceSubtaskAnswer); |
| | | } |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteServiceSubtaskAnswerByIds(Long[] ids) |
| | | { |
| | | public int deleteServiceSubtaskAnswerByIds(Long[] ids) { |
| | | return serviceSubtaskAnswerMapper.deleteServiceSubtaskAnswerByIds(ids); |
| | | } |
| | | |
| | |
| | | * @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); |
| | | } |
| | | } |
| | |
| | | // } |
| | | |
| | | @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)); |
| | |
| | | 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())) |
| | |
| | | } 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())) |
| | |
| | | <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, |
| | |
| | | <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="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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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"> |
| | |
| | | <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"> |
| | |
| | | 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 |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | <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" /> |
| | |
| | | <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"> |
| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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"> |
| | |
| | | </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> |
| | |
| | | <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"/> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectPatArchiveVo"> |
| | | select patid, |
| | | select id, |
| | | name, |
| | | sex, |
| | | idcardno, |
| | |
| | | <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> |
| | |
| | | |
| | | <select id="patInfoByContion" parameterType="com.smartor.domain.PatArchiveReq" resultMap="PatArchiveResult"> |
| | | select |
| | | a.patid, |
| | | a.id, |
| | | a.name, |
| | | a.sex, |
| | | c.tagname as tag, |
| | |
| | | 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> |
| | |
| | | |
| | | <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"> |
| | |
| | | <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> |
| | | |
| | |
| | | resultMap="PatArchiveResult"> |
| | | |
| | | SELECT |
| | | a.patid, |
| | | a.id, |
| | | a.NAME, |
| | | a.sex, |
| | | a.nation, |
| | |
| | | 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=")"> |
| | |
| | | resultMap="PatArchiveResult"> |
| | | |
| | | select |
| | | a.patid, |
| | | a.id, |
| | | a.NAME, |
| | | d.deptname, |
| | | a.sex, |
| | |
| | | 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 != ''"> |
| | |
| | | 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> |
| | |
| | | resultMap="PatArchiveResult"> |
| | | |
| | | select |
| | | a.patid, |
| | | a.id, |
| | | d.deptname, |
| | | a.name, |
| | | a.sex, |
| | |
| | | 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> |
| | |
| | | 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> |
| | |
| | | resultMap="PatArchiveResult"> |
| | | |
| | | select |
| | | a.patid as id, |
| | | a.id, |
| | | a.name, |
| | | a.sex, |
| | | d.deptname, |
| | |
| | | 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> |
| | |
| | | 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> |
| | |
| | | <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, |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | <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, |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | <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"/> |
| | |
| | | <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, |
| | |
| | | <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" |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |