ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java
@@ -12,10 +12,7 @@ import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.RSAPublicKeyExample; import com.ruoyi.common.utils.poi.ExcelUtil; import com.smartor.domain.IvrTask; import com.smartor.domain.IvrTaskScriptQues; import com.smartor.domain.IvrTaskVO; import com.smartor.domain.IvrTaskSingle; import com.smartor.domain.*; import com.smartor.service.IIvrTaskService; import com.smartor.service.IIvrTaskSingleService; import io.swagger.annotations.Api; @@ -178,4 +175,13 @@ return getDataTable(ivrTaskService.getScriptInfoByCondition(tid, pid)); } /** * ä»»å¡çåéæ§è¡ãæåãç»æ¢ */ @ApiOperation("ä»»å¡çåéæ§è¡ãæåãç»æ¢") @PostMapping("/taskSend") public AjaxResult taskSend(@RequestBody SendTaskVO sendTaskVO) { return toAjax(ivrTaskService.taskSend(sendTaskVO)); } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java
@@ -98,15 +98,6 @@ } /** * ä»»å¡çåéæ§è¡ãæåãç»æ¢ */ @ApiOperation("ä»»å¡çåéæ§è¡ãæåãç»æ¢") @PostMapping("/taskSend") public AjaxResult taskSend(@RequestBody SendTaskVO sendTaskVO) { return toAjax(ivrTaskcallService.heTaskSend(sendTaskVO)); } /** * çµè¯åè°ä»»å¡(䏿µ·) */ @ApiOperation("çµè¯åè°ä»»å¡") ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java
@@ -2,6 +2,10 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.smartor.domain.IvrTaskcalldetailReq; import com.smartor.domain.PhoneCallBackVO; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -23,14 +27,13 @@ /** * è¯é³ä»»å¡å¼å«æç»Controller * * * @author smartor * @date 2023-03-24 */ @RestController @RequestMapping("/smartor/ivrtaskcalldetail") public class IvrTaskcalldetailController extends BaseController { public class IvrTaskcalldetailController extends BaseController { @Autowired private IIvrTaskcalldetailService ivrTaskcalldetailService; @@ -38,9 +41,8 @@ * æ¥è¯¢è¯é³ä»»å¡å¼å«æç»å表 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcalldetail:list')") @PostMapping("/list") public TableDataInfo list(@RequestBody IvrTaskcalldetail ivrTaskcalldetail) { @PostMapping("/list") public TableDataInfo list(@RequestBody IvrTaskcalldetail ivrTaskcalldetail) { startPage(); List<IvrTaskcalldetail> list = ivrTaskcalldetailService.selectIvrTaskcalldetailList(ivrTaskcalldetail); return getDataTable(list); @@ -52,8 +54,7 @@ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcalldetail:export')") @Log(title = "è¯é³ä»»å¡å¼å«æç»", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IvrTaskcalldetail ivrTaskcalldetail) { public void export(HttpServletResponse response, IvrTaskcalldetail ivrTaskcalldetail) { List<IvrTaskcalldetail> list = ivrTaskcalldetailService.selectIvrTaskcalldetailList(ivrTaskcalldetail); ExcelUtil<IvrTaskcalldetail> util = new ExcelUtil<IvrTaskcalldetail>(IvrTaskcalldetail.class); util.exportExcel(response, list, "è¯é³ä»»å¡å¼å«æç»æ°æ®"); @@ -64,8 +65,7 @@ */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcalldetail:query')") @GetMapping(value = "/{calldetailid}") public AjaxResult getInfo(@PathVariable("calldetailid") String calldetailid) { public AjaxResult getInfo(@PathVariable("calldetailid") String calldetailid) { return success(ivrTaskcalldetailService.selectIvrTaskcalldetailByCalldetailid(calldetailid)); } @@ -75,8 +75,7 @@ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcalldetail:add')") @Log(title = "è¯é³ä»»å¡å¼å«æç»", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult add(@RequestBody IvrTaskcalldetail ivrTaskcalldetail) { public AjaxResult add(@RequestBody IvrTaskcalldetail ivrTaskcalldetail) { return toAjax(ivrTaskcalldetailService.insertIvrTaskcalldetail(ivrTaskcalldetail)); } @@ -86,8 +85,7 @@ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcalldetail:edit')") @Log(title = "è¯é³ä»»å¡å¼å«æç»", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody IvrTaskcalldetail ivrTaskcalldetail) { public AjaxResult edit(@RequestBody IvrTaskcalldetail ivrTaskcalldetail) { return toAjax(ivrTaskcalldetailService.updateIvrTaskcalldetail(ivrTaskcalldetail)); } @@ -96,9 +94,19 @@ */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcalldetail:remove')") @Log(title = "è¯é³ä»»å¡å¼å«æç»", businessType = BusinessType.DELETE) @GetMapping("/remove/{calldetailids}") public AjaxResult remove(@PathVariable String[] calldetailids) { @GetMapping("/remove/{calldetailids}") public AjaxResult remove(@PathVariable String[] calldetailids) { return toAjax(ivrTaskcalldetailService.deleteIvrTaskcalldetailByCalldetailids(calldetailids)); } /** * æ£è é®é¢ç»æè®°å½ */ @ApiOperation("æ£è é®é¢ç»æè®°å½") @PostMapping("/saveQuestionAnswer") public AjaxResult saveQuestionAnswer(@RequestBody IvrTaskcalldetailReq ivrTaskcalldetailReq) { return toAjax(ivrTaskcalldetailService.saveQuestionAnswer(ivrTaskcalldetailReq)); } } ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -108,7 +108,7 @@ // è¿æ»¤è¯·æ± .authorizeRequests() // 对äºç»å½login 注åregister éªè¯ç captchaImage å 许å¿åè®¿é® .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo","/socket","/API_ESB_Service","/API_ESB_Service/Run","/magic/web/**","/smartor/tasksingle/phoneCallBack","/smartor/robot/callstatus","/smartor/robot/aidialog","/smartor/robot/cdrinfo","/getToken","/smartor/ivrtask/getScriptInfoByCondition").permitAll() .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo","/socket","/API_ESB_Service","/API_ESB_Service/Run","/magic/web/**","/smartor/tasksingle/phoneCallBack","/smartor/robot/callstatus","/smartor/robot/aidialog","/smartor/robot/cdrinfo","/getToken","/smartor/ivrtask/getScriptInfoByCondition","/smartor/ivrtaskcalldetail/saveQuestionAnswer").permitAll() // éæèµæºï¼å¯å¿åè®¿é® .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() // é¤ä¸é¢å¤çææè¯·æ±å ¨é¨éè¦é´æè®¤è¯ smartor/src/main/java/com/smartor/domain/IvrTaskcalldetail.java
@@ -1,7 +1,11 @@ package com.smartor.domain; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -9,526 +13,138 @@ /** * è¯é³ä»»å¡å¼å«æç»å¯¹è±¡ ivr_taskcalldetail * * * @author smartor * @date 2023-03-24 */ public class IvrTaskcalldetail extends BaseEntity { @Data @ApiModel(value = "IvrTaskcalldetail", description = "é®é¢åçæç»") public class IvrTaskcalldetail extends BaseEntity { private static final long serialVersionUID = 1L; /** */ @ApiModelProperty(value = "主é®") private String calldetailid; /** */ @Excel(name = " ") @ApiModelProperty(value = "tasksingleid") private String callid; /** */ @Excel(name = " ") @ApiModelProperty(value = "æ¨å·uuid") private String uuid; /** */ @Excel(name = " ") @ApiModelProperty(value = "çµè¯å·ç ") private String phone; /** */ @Excel(name = " ") @ApiModelProperty(value = "æä½äºº ") private String operate; /** */ @Excel(name = " ") @ApiModelProperty(value = "æ¾ç¤ºå·ç ") private String displayno; /** */ @Excel(name = " ") @ApiModelProperty(value = "") private Long inbound; /** */ @Excel(name = " ") @ApiModelProperty(value = "") private Long incoming; /** */ @Excel(name = " ") @ApiModelProperty(value = "") private Long assigntime; /** */ @Excel(name = " ") @ApiModelProperty(value = "å¼å§æ¶é´") private Long starttime; /** */ @Excel(name = " ") @ApiModelProperty(value = "åçæ¶é´") private Long answertime; /** */ @Excel(name = " ") @ApiModelProperty(value = "") private Long silent; /** */ @Excel(name = " ") @ApiModelProperty(value = "") private String dtmfKey; /** */ @Excel(name = " ") @ApiModelProperty(value = "é³ä¹è·¯å¾") private String musicpath; /** */ @Excel(name = " ") @ApiModelProperty(value = "åéç´¢å¼") private Long sentIndex; /** */ @Excel(name = " ") @ApiModelProperty(value = "åéå¼å§ç¶æ") private Long sentBegin; /** */ @Excel(name = " ") @ApiModelProperty(value = "åçç»æ") private String asrtext; /** */ @Excel(name = " ") @ApiModelProperty(value = "å¼å§æ¶é´") private Long beginTime; /** */ @Excel(name = " ") @ApiModelProperty(value = "ç»ææ¶é´") private Long endTime; /** */ @Excel(name = " ") @ApiModelProperty(value = "åéç»æç¶æ") private Long sentEnd; /** */ @Excel(name = " ") @ApiModelProperty(value = "æäº¤è·¯å¾") private String recordpath; /** */ @Excel(name = " ") @ApiModelProperty(value = "æäº¤URL") private String recordurl; /** */ @Excel(name = " ") @ApiModelProperty(value = "模æ¿ID") private String templateid; /** */ @Excel(name = " ") @ApiModelProperty(value = "模æ¿é®é¢ç¼å·") private Long templatequestionnum; /** */ @Excel(name = " ") @ApiModelProperty(value = "äº¤æ¢æºID") private Long switchid; /** */ @Excel(name = " ") @ApiModelProperty(value = "é®é¢ææ¬") private String questiontext; /** */ @Excel(name = " ") @ApiModelProperty(value = "é®é¢è¯é³") private String questionvoice; /** */ @Excel(name = " ") @ApiModelProperty(value = "ç±»å«") private String categoryname; /** */ @Excel(name = " ") @ApiModelProperty(value = "ææ é项") private String targetoptions; /** */ @Excel(name = " ") @ApiModelProperty(value = "ææ å¼ï¼æ£åå¹é çé项å¼ï¼") private String targetvalue; /** */ @Excel(name = " ") @ApiModelProperty(value = "éè¿æ£åè§£æçå¼") private String matchedtext; /** */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = " ", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty(value = "æ·»å æ¶é´") private Date addtime; /** ä¸ä¼ æ è®° */ @Excel(name = " ä¸ä¼ æ è®° ") @ApiModelProperty(value = "ä¸ä¼ æ è®°") private Long isupload; /** ä¸ä¼ æ¶é´ */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = " ä¸ä¼ æ¶é´ ", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty(value = "ä¸ä¼ æ¶é´") private Date uploadTime; /** æºæID */ @Excel(name = " æºæID ") @ApiModelProperty(value = "æºæID") private String orgid; /** å 餿 è®° */ @ApiModelProperty(value = "å 餿 è®°") private String delFlag; public void setCalldetailid(String calldetailid) { this.calldetailid = calldetailid; } @ApiModelProperty(value = "é®é¢ç±»å") private String valueType; public String getCalldetailid() { return calldetailid; } public void setCallid(String callid) { this.callid = callid; } public String getCallid() { return callid; } public void setUuid(String uuid) { this.uuid = uuid; } public String getUuid() { return uuid; } public void setPhone(String phone) { this.phone = phone; } public String getPhone() { return phone; } public void setOperate(String operate) { this.operate = operate; } public String getOperate() { return operate; } public void setDisplayno(String displayno) { this.displayno = displayno; } public String getDisplayno() { return displayno; } public void setInbound(Long inbound) { this.inbound = inbound; } public Long getInbound() { return inbound; } public void setIncoming(Long incoming) { this.incoming = incoming; } public Long getIncoming() { return incoming; } public void setAssigntime(Long assigntime) { this.assigntime = assigntime; } public Long getAssigntime() { return assigntime; } public void setStarttime(Long starttime) { this.starttime = starttime; } public Long getStarttime() { return starttime; } public void setAnswertime(Long answertime) { this.answertime = answertime; } public Long getAnswertime() { return answertime; } public void setSilent(Long silent) { this.silent = silent; } public Long getSilent() { return silent; } public void setDtmfKey(String dtmfKey) { this.dtmfKey = dtmfKey; } public String getDtmfKey() { return dtmfKey; } public void setMusicpath(String musicpath) { this.musicpath = musicpath; } public String getMusicpath() { return musicpath; } public void setSentIndex(Long sentIndex) { this.sentIndex = sentIndex; } public Long getSentIndex() { return sentIndex; } public void setSentBegin(Long sentBegin) { this.sentBegin = sentBegin; } public Long getSentBegin() { return sentBegin; } public void setAsrtext(String asrtext) { this.asrtext = asrtext; } public String getAsrtext() { return asrtext; } public void setBeginTime(Long beginTime) { this.beginTime = beginTime; } public Long getBeginTime() { return beginTime; } public void setEndTime(Long endTime) { this.endTime = endTime; } public Long getEndTime() { return endTime; } public void setSentEnd(Long sentEnd) { this.sentEnd = sentEnd; } public Long getSentEnd() { return sentEnd; } public void setRecordpath(String recordpath) { this.recordpath = recordpath; } public String getRecordpath() { return recordpath; } public void setRecordurl(String recordurl) { this.recordurl = recordurl; } public String getRecordurl() { return recordurl; } public void setTemplateid(String templateid) { this.templateid = templateid; } public String getTemplateid() { return templateid; } public void setTemplatequestionnum(Long templatequestionnum) { this.templatequestionnum = templatequestionnum; } public Long getTemplatequestionnum() { return templatequestionnum; } public void setSwitchid(Long switchid) { this.switchid = switchid; } public Long getSwitchid() { return switchid; } public void setQuestiontext(String questiontext) { this.questiontext = questiontext; } public String getQuestiontext() { return questiontext; } public void setQuestionvoice(String questionvoice) { this.questionvoice = questionvoice; } public String getQuestionvoice() { return questionvoice; } public void setCategoryname(String categoryname) { this.categoryname = categoryname; } public String getCategoryname() { return categoryname; } public void setTargetoptions(String targetoptions) { this.targetoptions = targetoptions; } public String getTargetoptions() { return targetoptions; } public void setTargetvalue(String targetvalue) { this.targetvalue = targetvalue; } public String getTargetvalue() { return targetvalue; } public void setMatchedtext(String matchedtext) { this.matchedtext = matchedtext; } public String getMatchedtext() { return matchedtext; } public void setAddtime(Date addtime) { this.addtime = addtime; } public Date getAddtime() { return addtime; } public void setIsupload(Long isupload) { this.isupload = isupload; } public Long getIsupload() { return isupload; } public void setUploadTime(Date uploadTime) { this.uploadTime = uploadTime; } public Date getUploadTime() { return uploadTime; } public void setOrgid(String orgid) { this.orgid = orgid; } public String getOrgid() { return orgid; } public void setDelFlag(String delFlag) { this.delFlag = delFlag; } public String getDelFlag() { return delFlag; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("calldetailid", getCalldetailid()) .append("callid", getCallid()) .append("uuid", getUuid()) .append("phone", getPhone()) .append("operate", getOperate()) .append("displayno", getDisplayno()) .append("inbound", getInbound()) .append("incoming", getIncoming()) .append("assigntime", getAssigntime()) .append("starttime", getStarttime()) .append("answertime", getAnswertime()) .append("silent", getSilent()) .append("dtmfKey", getDtmfKey()) .append("musicpath", getMusicpath()) .append("sentIndex", getSentIndex()) .append("sentBegin", getSentBegin()) .append("asrtext", getAsrtext()) .append("beginTime", getBeginTime()) .append("endTime", getEndTime()) .append("sentEnd", getSentEnd()) .append("recordpath", getRecordpath()) .append("recordurl", getRecordurl()) .append("templateid", getTemplateid()) .append("templatequestionnum", getTemplatequestionnum()) .append("switchid", getSwitchid()) .append("questiontext", getQuestiontext()) .append("questionvoice", getQuestionvoice()) .append("categoryname", getCategoryname()) .append("targetoptions", getTargetoptions()) .append("targetvalue", getTargetvalue()) .append("matchedtext", getMatchedtext()) .append("addtime", getAddtime()) .append("isupload", getIsupload()) .append("uploadTime", getUploadTime()) .append("orgid", getOrgid()) .append("createTime", getCreateTime()) .append("delFlag", getDelFlag()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("createBy", getCreateBy()) .toString(); } } smartor/src/main/java/com/smartor/domain/IvrTaskcalldetailReq.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ package com.smartor.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import java.util.Date; import java.util.List; /** * é®é¢åçæç» ivr_taskcalldetailReq * * @author ls * @date 2023-06-05 */ @ApiModel(value = "IvrTaskcalldetailReq", description = "é®é¢åçæç»") @Data public class IvrTaskcalldetailReq { @ApiModelProperty(value = "ä»»å¡ID") private String param1; @ApiModelProperty(value = "æ£è ID") private String param2; @ApiModelProperty(value = "é®é¢åçæç»") private List<IvrTaskcalldetail> ivrTaskcalldetailList; } smartor/src/main/java/com/smartor/service/IIvrTaskService.java
@@ -5,6 +5,7 @@ import com.smartor.domain.IvrLibaTemplateScript; import com.smartor.domain.IvrLibaTemplateScriptVO; import com.smartor.domain.IvrTask; import com.smartor.domain.SendTaskVO; import org.springframework.web.bind.annotation.PathVariable; /** @@ -63,4 +64,12 @@ public Boolean deleteIvrTaskByTaskid(Long taskid); public List<IvrLibaTemplateScriptVO> getScriptInfoByCondition(Long taskid, Long patid); /** * ä»»å¡åéæ§è¡ * * @param sendTaskVO * @return ç»æ */ public int taskSend(SendTaskVO sendTaskVO); } smartor/src/main/java/com/smartor/service/IIvrTaskSingleService.java
@@ -75,13 +75,7 @@ */ public int insertOrUpdateTask(IvrTaskVO ivrTaskVO); /** * ä»»å¡åéæ§è¡ * * @param sendTaskVO * @return ç»æ */ public int heTaskSend(SendTaskVO sendTaskVO); /** * çµè¯åè°ä»»å¡ smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java
@@ -1,19 +1,20 @@ package com.smartor.service; import java.util.List; import com.smartor.domain.IvrTaskcalldetail; import com.smartor.domain.IvrTaskcalldetailReq; /** * è¯é³ä»»å¡å¼å«æç»Serviceæ¥å£ * * * @author smartor * @date 2023-03-24 */ public interface IIvrTaskcalldetailService { public interface IIvrTaskcalldetailService { /** * æ¥è¯¢è¯é³ä»»å¡å¼å«æç» * * * @param calldetailid è¯é³ä»»å¡å¼å«æç»ä¸»é® * @return è¯é³ä»»å¡å¼å«æç» */ @@ -21,7 +22,7 @@ /** * æ¥è¯¢è¯é³ä»»å¡å¼å«æç»å表 * * * @param ivrTaskcalldetail è¯é³ä»»å¡å¼å«æç» * @return è¯é³ä»»å¡å¼å«æç»éå */ @@ -29,7 +30,7 @@ /** * æ°å¢è¯é³ä»»å¡å¼å«æç» * * * @param ivrTaskcalldetail è¯é³ä»»å¡å¼å«æç» * @return ç»æ */ @@ -37,7 +38,7 @@ /** * ä¿®æ¹è¯é³ä»»å¡å¼å«æç» * * * @param ivrTaskcalldetail è¯é³ä»»å¡å¼å«æç» * @return ç»æ */ @@ -45,7 +46,7 @@ /** * æ¹éå é¤è¯é³ä»»å¡å¼å«æç» * * * @param calldetailids éè¦å é¤çè¯é³ä»»å¡å¼å«æç»ä¸»é®éå * @return ç»æ */ @@ -53,9 +54,11 @@ /** * å é¤è¯é³ä»»å¡å¼å«æç»ä¿¡æ¯ * * * @param calldetailid è¯é³ä»»å¡å¼å«æç»ä¸»é® * @return ç»æ */ public int deleteIvrTaskcalldetailByCalldetailid(String calldetailid); public Integer saveQuestionAnswer(IvrTaskcalldetailReq ivrTaskcalldetailReq); } smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java
@@ -1,16 +1,17 @@ package com.smartor.service.impl; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; import java.text.SimpleDateFormat; import java.util.*; import com.alibaba.fastjson2.JSON; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DtoConversionUtils; import com.ruoyi.common.utils.StringUtils; import com.smartor.config.RabbitMqCallPhoneConfig; import com.smartor.domain.*; import com.smartor.mapper.*; import lombok.extern.slf4j.Slf4j; @@ -43,6 +44,9 @@ @Autowired private IvrLibaTemplateTargetoptionMapper ivrLibaTemplateTargetOptionMapper; @Autowired private RabbitMqCallPhoneConfig rabbitMqCallPhoneConfig; /** * æ¥è¯¢è¯é³ä»»å¡ @@ -180,4 +184,99 @@ return ivrLibaTemplateScriptVOS; } /** * ä»»å¡åé * * @return */ @Override public int taskSend(SendTaskVO sendTaskVO) { if (sendTaskVO.getTaskId() == null) throw new BaseException("ä»»å¡IDä¸è½ä¸ºç©ºï¼è¯·æ£æ¥åï¼åè¿è¡æ§è¡"); IvrTask ivrTask = selectIvrTaskByTaskid(sendTaskVO.getTaskId()); if (sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 3 || sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 4) { //任塿åæç»æ¢ IvrTask ivrTask3 = new IvrTask(); ivrTask3.setTaskid(sendTaskVO.getTaskId()); ivrTask3.setStopState(ivrTask.getStopState() + 1); ivrTask3.setSendState(sendTaskVO.getSendState()); updateIvrTask(ivrTask3); return 0; } //夿åéç¶ææ¯å¦ä¸ºç©º if (org.apache.commons.lang3.StringUtils.isEmpty(sendTaskVO.getSendType())) { sendTaskVO.setSendType(ivrTask.getSendType().toString()); } Long ss = ivrTask.getStopState() + 1; //夿任塿¯å¦æ¯ç«å³åé if (org.apache.commons.lang3.StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) { IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ(); ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId()); ivrTaskcallMQ.setSendType(sendTaskVO.getSendType()); ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString()); ivrTaskcallMQ.setStopState(ss); ivrTaskcallMQ.setPreachform(ivrTask.getPreachform()); String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ); ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1); //ç«å³åé rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, 0L); //å°ä»»å¡ç¶æä¿®æ¹ææ§è¡ä¸ IvrTask ivrTask2 = new IvrTask(); ivrTask2.setTaskid(ivrTask.getTaskid()); ivrTask2.setSendState(2); ivrTask2.setStopState(ss); updateIvrTask(ivrTask2); } else if (org.apache.commons.lang3.StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1")) { //æ¶é´æ®µåé ObjectMapper objectMapper = new ObjectMapper(); if (org.apache.commons.lang3.StringUtils.isNotEmpty(ivrTask.getSendTimeSlot())) { List<TaskSendTimeVO> taskSendTimeVOList = null; try { taskSendTimeVOList = objectMapper.readValue(ivrTask.getSendTimeSlot(), new TypeReference<List<TaskSendTimeVO>>() { }); } catch (JsonProcessingException e) { log.error("JsonProcessingExceptionæ¥éäºï¼{}", e.getMessage()); } for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) { //å»SendTimeslotä¸ï¼è·åææçæ¶é´æ®µ List<TaskSendTimeVO> list = new ArrayList<>(); list.add(taskSendTimeVO); //è·åå¼å§åéæ¶é´ String begantime = taskSendTimeVO.getBegantime(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //è®°å½ç®åå°åéæ¶é´ç毫ç§å¼ ï¼åéæ¶é´ç毫ç§å¼ - å½åæ¶é´ç毫ç§å¼ï¼ Long milliseconds = 1000L; try { Date date = sdf.parse(begantime); milliseconds = date.getTime() - System.currentTimeMillis(); System.out.println("æ¥ææ¯«ç§æ°ï¼" + milliseconds); } catch (Exception e) { e.printStackTrace(); } IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ(); ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId()); ivrTaskcallMQ.setSendType("1"); ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString()); ivrTaskcallMQ.setSendTimeslot(list); ivrTaskcallMQ.setStopState(ivrTask.getStopState()); Long finalMilliseconds = milliseconds; String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ); ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1); rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, milliseconds); } //å°ä»»å¡ç¶æä¿®æ¹ææ§è¡ä¸ IvrTask ivrTask2 = new IvrTask(); ivrTask2.setTaskid(ivrTask.getTaskid()); ivrTask2.setSendState(2); ivrTask2.setStopState(ss); updateIvrTask(ivrTask2); } } return 1; } } smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java
@@ -9,7 +9,6 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DtoConversionUtils; import com.smartor.config.PhoneUtils; import com.smartor.config.RabbitMqCallPhoneConfig; import com.smartor.domain.*; import com.smartor.mapper.*; import com.smartor.service.IIvrTaskService; @@ -21,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.fasterxml.jackson.core.type.TypeReference; import java.text.SimpleDateFormat; import java.util.*; @@ -59,8 +57,7 @@ @Autowired private IvrLibaExtemplatescriptMapper ivrLibaExtemplatescriptMapper; @Autowired private RabbitMqCallPhoneConfig rabbitMqCallPhoneConfig; /** @@ -278,100 +275,7 @@ return integer; } /** * ä»»å¡åé * * @return */ @Override public int heTaskSend(SendTaskVO sendTaskVO) { if (sendTaskVO.getTaskId() == null) throw new BaseException("ä»»å¡IDä¸è½ä¸ºç©ºï¼è¯·æ£æ¥åï¼åè¿è¡æ§è¡"); IvrTask ivrTask = ivrTaskService.selectIvrTaskByTaskid(sendTaskVO.getTaskId()); if (sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 3 || sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 4) { //任塿åæç»æ¢ IvrTask ivrTask3 = new IvrTask(); ivrTask3.setTaskid(sendTaskVO.getTaskId()); ivrTask3.setStopState(ivrTask.getStopState() + 1); ivrTask3.setSendState(sendTaskVO.getSendState()); ivrTaskService.updateIvrTask(ivrTask3); return 0; } //夿åéç¶ææ¯å¦ä¸ºç©º if (StringUtils.isEmpty(sendTaskVO.getSendType())) { sendTaskVO.setSendType(ivrTask.getSendType().toString()); } Long ss = ivrTask.getStopState() + 1; //夿任塿¯å¦æ¯ç«å³åé if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) { IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ(); ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId()); ivrTaskcallMQ.setSendType(sendTaskVO.getSendType()); ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString()); ivrTaskcallMQ.setStopState(ss); ivrTaskcallMQ.setPreachform(ivrTask.getPreachform()); String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ); ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1); //ç«å³åé rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, 0L); //å°ä»»å¡ç¶æä¿®æ¹ææ§è¡ä¸ IvrTask ivrTask2 = new IvrTask(); ivrTask2.setTaskid(ivrTask.getTaskid()); ivrTask2.setSendState(2); ivrTask2.setStopState(ss); ivrTaskService.updateIvrTask(ivrTask2); } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1")) { //æ¶é´æ®µåé ObjectMapper objectMapper = new ObjectMapper(); if (StringUtils.isNotEmpty(ivrTask.getSendTimeSlot())) { List<TaskSendTimeVO> taskSendTimeVOList = null; try { taskSendTimeVOList = objectMapper.readValue(ivrTask.getSendTimeSlot(), new TypeReference<List<TaskSendTimeVO>>() { }); } catch (JsonProcessingException e) { log.error("JsonProcessingExceptionæ¥éäºï¼{}", e.getMessage()); } for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) { //å»SendTimeslotä¸ï¼è·åææçæ¶é´æ®µ List<TaskSendTimeVO> list = new ArrayList<>(); list.add(taskSendTimeVO); //è·åå¼å§åéæ¶é´ String begantime = taskSendTimeVO.getBegantime(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //è®°å½ç®åå°åéæ¶é´ç毫ç§å¼ ï¼åéæ¶é´ç毫ç§å¼ - å½åæ¶é´ç毫ç§å¼ï¼ Long milliseconds = 1000L; try { Date date = sdf.parse(begantime); milliseconds = date.getTime() - System.currentTimeMillis(); System.out.println("æ¥ææ¯«ç§æ°ï¼" + milliseconds); } catch (Exception e) { e.printStackTrace(); } IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ(); ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId()); ivrTaskcallMQ.setSendType("1"); ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString()); ivrTaskcallMQ.setSendTimeslot(list); ivrTaskcallMQ.setStopState(ivrTask.getStopState()); Long finalMilliseconds = milliseconds; String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ); ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1); rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, milliseconds); } //å°ä»»å¡ç¶æä¿®æ¹ææ§è¡ä¸ IvrTask ivrTask2 = new IvrTask(); ivrTask2.setTaskid(ivrTask.getTaskid()); ivrTask2.setSendState(2); ivrTask2.setStopState(ss); ivrTaskService.updateIvrTask(ivrTask2); } } return 1; } @Override public void phoneCallBack(PhoneCallBackVO phoneCallBackVO) { smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java
@@ -1,8 +1,18 @@ package com.smartor.service.impl; import java.util.Date; import java.util.List; import java.util.UUID; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.RSAPublicKeyExample; import com.smartor.domain.IvrTaskSingle; import com.smartor.domain.IvrTaskcalldetailReq; import com.smartor.mapper.IvrTaskSingleMapper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.smartor.mapper.IvrTaskcalldetailMapper; import com.smartor.domain.IvrTaskcalldetail; @@ -10,87 +20,111 @@ /** * è¯é³ä»»å¡å¼å«æç»Serviceä¸å¡å±å¤ç * * * @author smartor * @date 2023-03-24 */ @Slf4j @Service public class IvrTaskcalldetailServiceImpl implements IIvrTaskcalldetailService { public class IvrTaskcalldetailServiceImpl implements IIvrTaskcalldetailService { @Autowired private IvrTaskcalldetailMapper ivrTaskcalldetailMapper; @Autowired private IvrTaskSingleMapper ivrTaskSingleMapper; @Value("${pri_key}") private String pri_key; /** * æ¥è¯¢è¯é³ä»»å¡å¼å«æç» * * * @param calldetailid è¯é³ä»»å¡å¼å«æç»ä¸»é® * @return è¯é³ä»»å¡å¼å«æç» */ @Override public IvrTaskcalldetail selectIvrTaskcalldetailByCalldetailid(String calldetailid) { public IvrTaskcalldetail selectIvrTaskcalldetailByCalldetailid(String calldetailid) { return ivrTaskcalldetailMapper.selectIvrTaskcalldetailByCalldetailid(calldetailid); } /** * æ¥è¯¢è¯é³ä»»å¡å¼å«æç»å表 * * * @param ivrTaskcalldetail è¯é³ä»»å¡å¼å«æç» * @return è¯é³ä»»å¡å¼å«æç» */ @Override public List<IvrTaskcalldetail> selectIvrTaskcalldetailList(IvrTaskcalldetail ivrTaskcalldetail) { public List<IvrTaskcalldetail> selectIvrTaskcalldetailList(IvrTaskcalldetail ivrTaskcalldetail) { return ivrTaskcalldetailMapper.selectIvrTaskcalldetailList(ivrTaskcalldetail); } /** * æ°å¢è¯é³ä»»å¡å¼å«æç» * * * @param ivrTaskcalldetail è¯é³ä»»å¡å¼å«æç» * @return ç»æ */ @Override public int insertIvrTaskcalldetail(IvrTaskcalldetail ivrTaskcalldetail) { public int insertIvrTaskcalldetail(IvrTaskcalldetail ivrTaskcalldetail) { ivrTaskcalldetail.setCreateTime(DateUtils.getNowDate()); return ivrTaskcalldetailMapper.insertIvrTaskcalldetail(ivrTaskcalldetail); } /** * ä¿®æ¹è¯é³ä»»å¡å¼å«æç» * * * @param ivrTaskcalldetail è¯é³ä»»å¡å¼å«æç» * @return ç»æ */ @Override public int updateIvrTaskcalldetail(IvrTaskcalldetail ivrTaskcalldetail) { public int updateIvrTaskcalldetail(IvrTaskcalldetail ivrTaskcalldetail) { ivrTaskcalldetail.setUpdateTime(DateUtils.getNowDate()); return ivrTaskcalldetailMapper.updateIvrTaskcalldetail(ivrTaskcalldetail); } /** * æ¹éå é¤è¯é³ä»»å¡å¼å«æç» * * * @param calldetailids éè¦å é¤çè¯é³ä»»å¡å¼å«æç»ä¸»é® * @return ç»æ */ @Override public int deleteIvrTaskcalldetailByCalldetailids(String[] calldetailids) { public int deleteIvrTaskcalldetailByCalldetailids(String[] calldetailids) { return ivrTaskcalldetailMapper.deleteIvrTaskcalldetailByCalldetailids(calldetailids); } /** * å é¤è¯é³ä»»å¡å¼å«æç»ä¿¡æ¯ * * * @param calldetailid è¯é³ä»»å¡å¼å«æç»ä¸»é® * @return ç»æ */ @Override public int deleteIvrTaskcalldetailByCalldetailid(String calldetailid) { public int deleteIvrTaskcalldetailByCalldetailid(String calldetailid) { return ivrTaskcalldetailMapper.deleteIvrTaskcalldetailByCalldetailid(calldetailid); } @Override public Integer saveQuestionAnswer(IvrTaskcalldetailReq ivrTaskcalldetailReq) { RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskcalldetailReq.getParam1(), pri_key)); Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskcalldetailReq.getParam2(), pri_key)); IvrTaskSingle ivrTaskSingle = new IvrTaskSingle(); ivrTaskSingle.setTaskid(tid); ivrTaskSingle.setPatid(pid); List<IvrTaskSingle> ivrTaskSingles = ivrTaskSingleMapper.selectIvrTaskcallList(ivrTaskSingle); if (CollectionUtils.isEmpty(ivrTaskSingles) || ivrTaskSingles.size() == 0) { log.error("æ¥éäºï¼ivrTaskSinglesæ°æ®ä¸ºç©ºäºï¼{}", ivrTaskSingle); return 0; } for (IvrTaskcalldetail ivrTaskcalldetail : ivrTaskcalldetailReq.getIvrTaskcalldetailList()) { ivrTaskcalldetail.setCallid(ivrTaskSingles.get(0).getId().toString()); ivrTaskcalldetail.setCalldetailid(UUID.randomUUID().toString()); ivrTaskcalldetail.setCreateTime(new Date()); ivrTaskcalldetailMapper.insertIvrTaskcalldetail(ivrTaskcalldetail); } return 1; } } smartor/src/main/resources/mapper/smartor/IvrTaskcalldetailMapper.xml
@@ -45,6 +45,7 @@ <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="createBy" column="create_by"/> <result property="valueType" column="value_type"/> </resultMap> <sql id="selectIvrTaskcalldetailVo"> @@ -87,6 +88,7 @@ del_flag, update_by, update_time, value_type, create_by from ivr_taskcalldetail </sql> @@ -131,6 +133,7 @@ <if test="isupload != null ">and isupload = #{isupload}</if> <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> <if test="valueType != null and valueType != ''">and value_type = #{valueType}</if> </where> </select> @@ -182,6 +185,7 @@ <if test="updateBy != null">update_by,</if> <if test="updateTime != null">update_time,</if> <if test="createBy != null">create_by,</if> <if test="valueType != null">value_type,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="calldetailid != null">#{calldetailid},</if> @@ -224,6 +228,7 @@ <if test="updateBy != null">#{updateBy},</if> <if test="updateTime != null">#{updateTime},</if> <if test="createBy != null">#{createBy},</if> <if test="valueType != null">#{valueType},</if> </trim> </insert> @@ -269,6 +274,7 @@ <if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateTime != null">update_time = #{updateTime},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="valueType != null">value_type = #{valueType},</if> </trim> where calldetailid = #{calldetailid} </update>