From 01bbc8f0563b33dd5ce6d59f76c3bae9931615dd Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期三, 05 六月 2024 17:32:07 +0800 Subject: [PATCH] 代码提交 --- smartor/src/main/java/com/smartor/domain/IvrTaskcalldetailReq.java | 34 ++ smartor/src/main/resources/mapper/smartor/IvrTaskcalldetailMapper.xml | 6 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java | 42 +- smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java | 76 +++- smartor/src/main/java/com/smartor/service/IIvrTaskService.java | 9 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java | 9 smartor/src/main/java/com/smartor/service/IIvrTaskSingleService.java | 8 smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java | 107 ++++++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java | 14 smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java | 98 ------ ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java | 2 smartor/src/main/java/com/smartor/domain/IvrTaskcalldetail.java | 494 +++--------------------------- smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java | 21 13 files changed, 312 insertions(+), 608 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java index 738811e..c82c985 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java +++ b/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)); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java index 17554c5..8bfbfd5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java +++ b/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("鐢佃瘽鍥炶皟浠诲姟") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java index caf07de..afb0515 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java +++ b/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)); } + + + /** + * 鎮h�呴棶棰樼粨鏋滆褰� + */ + @ApiOperation("鎮h�呴棶棰樼粨鏋滆褰�") + @PostMapping("/saveQuestionAnswer") + public AjaxResult saveQuestionAnswer(@RequestBody IvrTaskcalldetailReq ivrTaskcalldetailReq) { + return toAjax(ivrTaskcalldetailService.saveQuestionAnswer(ivrTaskcalldetailReq)); + } + } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 4e92713..cfe0c21 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -108,7 +108,7 @@ // 杩囨护璇锋眰 .authorizeRequests() // 瀵逛簬鐧诲綍login 娉ㄥ唽register 楠岃瘉鐮乧aptchaImage 鍏佽鍖垮悕璁块棶 - .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() // 闄や笂闈㈠鐨勬墍鏈夎姹傚叏閮ㄩ渶瑕侀壌鏉冭璇� diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskcalldetail.java b/smartor/src/main/java/com/smartor/domain/IvrTaskcalldetail.java index 0b1dc3f..af49a75 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskcalldetail.java +++ b/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 = "浜ゆ崲鏈篒D") 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 = "鎸囨爣鍊硷紙姝e垯鍖归厤鐨勯�夐」鍊硷級") private String targetvalue; - /** */ - @Excel(name = " ") + + @ApiModelProperty(value = "閫氳繃姝e垯瑙f瀽鐨勫��") 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(); - } } diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskcalldetailReq.java b/smartor/src/main/java/com/smartor/domain/IvrTaskcalldetailReq.java new file mode 100644 index 0000000..5c8a560 --- /dev/null +++ b/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 = "鎮h�匢D") + private String param2; + + @ApiModelProperty(value = "闂鍥炵瓟鏄庣粏") + private List<IvrTaskcalldetail> ivrTaskcalldetailList; + +} diff --git a/smartor/src/main/java/com/smartor/service/IIvrTaskService.java b/smartor/src/main/java/com/smartor/service/IIvrTaskService.java index 5b5de3d..8b21e37 100644 --- a/smartor/src/main/java/com/smartor/service/IIvrTaskService.java +++ b/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); } diff --git a/smartor/src/main/java/com/smartor/service/IIvrTaskSingleService.java b/smartor/src/main/java/com/smartor/service/IIvrTaskSingleService.java index 2614a26..2dce489 100644 --- a/smartor/src/main/java/com/smartor/service/IIvrTaskSingleService.java +++ b/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); + /** * 鐢佃瘽鍥炶皟浠诲姟 diff --git a/smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java b/smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java index 7214ca8..dd60851 100644 --- a/smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java +++ b/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); } diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java index b7c9096..8f9b2aa 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java +++ b/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) { + //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈� + 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; + } } diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java index ca7713b..5718bd1 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java +++ b/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) { - //鍘籗endTimeslot涓紝鑾峰彇鎵�鏈夌殑鏃堕棿娈� - 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) { diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java index 6f27fa5..2123083 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java +++ b/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; + } } diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskcalldetailMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskcalldetailMapper.xml index d1fe163..2502583 100644 --- a/smartor/src/main/resources/mapper/smartor/IvrTaskcalldetailMapper.xml +++ b/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> -- Gitblit v1.9.3