| | |
| | | package com.smartor.controller; |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | /** |
| | | * AIæå¾åºController |
| | | * |
| | | * |
| | | * @author smartor |
| | | * @date 2023-03-06 |
| | | */ |
| | |
| | | return success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¼å§æ§è¡(æµè¯ç¨) |
| | | */ |
| | | @GetMapping("/addUser2") |
| | | public AjaxResult addUser2() { |
| | | String s = phoneUtils.ob("","","","","","","","3001","",true); |
| | | return AjaxResult.success(s); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.IvrTaskVisitResult; |
| | | import com.smartor.service.IIvrTaskVisitResultService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä»»å¡éè®¿ç»æController |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-05-06 |
| | | */ |
| | | @Slf4j |
| | | @Api(description = "ä»»å¡éè®¿ç»æ") |
| | | @RestController |
| | | @RequestMapping("/smartor/visitResult") |
| | | public class IvrTaskVisitResultController extends BaseController { |
| | | @Autowired |
| | | private IIvrTaskVisitResultService ivrTaskVisitResultService; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiOperation("æ¥è¯¢æ£è
é访信æ¯") |
| | | @PreAuthorize("@ss.hasPermi('system:result:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(IvrTaskVisitResult ivrTaskVisitResult) { |
| | | startPage(); |
| | | List<IvrTaskVisitResult> list = ivrTaskVisitResultService.selectIvrTaskVisitResultList(ivrTaskVisitResult); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºä»»å¡éè®¿ç»æå表 |
| | | */ |
| | | @ApiOperation("导åºä»»å¡éè®¿ç»æå表") |
| | | @PreAuthorize("@ss.hasPermi('system:result:export')") |
| | | @Log(title = "ä»»å¡éè®¿ç»æ", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, IvrTaskVisitResult ivrTaskVisitResult) { |
| | | List<IvrTaskVisitResult> list = ivrTaskVisitResultService.selectIvrTaskVisitResultList(ivrTaskVisitResult); |
| | | ExcelUtil<IvrTaskVisitResult> util = new ExcelUtil<IvrTaskVisitResult>(IvrTaskVisitResult.class); |
| | | util.exportExcel(response, list, "ä»»å¡éè®¿ç»ææ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åä»»å¡éè®¿ç»æè¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("è·åä»»å¡éè®¿ç»æè¯¦ç»ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('system:result:query')") |
| | | @GetMapping(value = "/getInfo/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(ivrTaskVisitResultService.selectIvrTaskVisitResultById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä»»å¡éè®¿ç»æ |
| | | */ |
| | | @ApiOperation("æ°å¢ä»»å¡éè®¿ç»æ") |
| | | @PreAuthorize("@ss.hasPermi('system:result:add')") |
| | | @Log(title = "ä»»å¡éè®¿ç»æ", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody IvrTaskVisitResult ivrTaskVisitResult) { |
| | | return toAjax(ivrTaskVisitResultService.insertIvrTaskVisitResult(ivrTaskVisitResult)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä»»å¡éè®¿ç»æ |
| | | */ |
| | | @ApiOperation("ä¿®æ¹ä»»å¡éè®¿ç»æ") |
| | | @PreAuthorize("@ss.hasPermi('system:result:edit')") |
| | | @Log(title = "ä»»å¡éè®¿ç»æ", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody IvrTaskVisitResult ivrTaskVisitResult) { |
| | | return toAjax(ivrTaskVisitResultService.updateIvrTaskVisitResult(ivrTaskVisitResult)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»»å¡éè®¿ç»æ |
| | | */ |
| | | @ApiOperation("å é¤ä»»å¡éè®¿ç»æ") |
| | | @PreAuthorize("@ss.hasPermi('system:result:remove')") |
| | | @Log(title = "ä»»å¡éè®¿ç»æ", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(ivrTaskVisitResultService.deleteIvrTaskVisitResultByIds(ids)); |
| | | } |
| | | } |
| | |
| | | package com.smartor.controller; |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | /** |
| | | * æ£è
使£è®°å½Controller |
| | | * |
| | | * |
| | | * @author smartor |
| | | * @date 2023-03-04 |
| | | */ |
| | |
| | | public String hangup(String kg_uuid, String dnis, String data, String app_id, String ani, String special_ch, String sign, String call_uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("kg_uuid", kg_uuid); |
| | | map.put("kg_file", kg_uuid); |
| | | map.put("dnis", dnis); |
| | | map.put("data", data); |
| | | map.put("app_id", app_id); |
| | | map.put("ani", ani); |
| | | map.put("special_ch", special_ch); |
| | | map.put("sign", sign); |
| | | map.put("dnis", dnis); |
| | | map.put("call_uuid", call_uuid); |
| | | map.put("fs_node_id", ""); |
| | | |
| | | |
| | | // map.put("app_id", app_id); |
| | | // map.put("kg_uuid", kg_uuid); |
| | | // map.put("ani", ani); |
| | | // map.put("dnis", dnis); |
| | | // map.put("call_direction", call_direction_str); |
| | | // map.put("hangup_cause", hangup_cause); |
| | | // map.put("endpoint_disposition", endpoint_disposition); |
| | | // map.put("wait_msec", wait_msec); |
| | | // map.put("duration_msec", duration_msec); |
| | | // map.put("answer_msec", answer_msec); |
| | | // map.put("bill_msec", bill_msec); |
| | | // map.put("start_stamp", start_stamp); |
| | | // map.put("answered_stamp", answered_stamp); |
| | | // map.put("end_stamp", end_stamp); |
| | | // map.put("vad_total_talk_time_msec", vad_total_talk_time_msec); |
| | | // map.put("time_stamp", time_stamp); |
| | | return sendReq(map, "/tel/ai_api/hangup"); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * ä»»å¡éè®¿ç»æå¯¹è±¡ ivr_task_visit_result |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-05-06 |
| | | */ |
| | | @Data |
| | | public class IvrTaskVisitResult extends BaseEntity { |
| | | |
| | | /** |
| | | * è®°å½å
³é®å¼ID |
| | | */ |
| | | @ApiModelProperty(value = "è®°å½å
³é®å¼ID") |
| | | private Long id; |
| | | |
| | | /** |
| | | * åé人 ï¼æ£è
ï¼ |
| | | */ |
| | | @Excel(name = " åé人 ", readConverterExp = "æ£=è
") |
| | | @ApiModelProperty(value = "åé人 ï¼æ£è
ï¼") |
| | | private String sendname; |
| | | |
| | | /** |
| | | * ææºå· |
| | | */ |
| | | @Excel(name = " ææºå· ") |
| | | @ApiModelProperty(value = "ææºå·") |
| | | private String phone; |
| | | |
| | | /** |
| | | * æ§å« |
| | | */ |
| | | @Excel(name = "æ§å«") |
| | | @ApiModelProperty(value = "æ§å«") |
| | | private String sex; |
| | | |
| | | /** |
| | | * å¹´é¾ |
| | | */ |
| | | @Excel(name = "å¹´é¾ ") |
| | | @ApiModelProperty(value = "å¹´é¾") |
| | | private Long age; |
| | | |
| | | /** |
| | | * 身份è¯å· |
| | | */ |
| | | @Excel(name = " 身份è¯å· ") |
| | | @ApiModelProperty(value = "身份è¯å·") |
| | | private String sfzh; |
| | | |
| | | /** |
| | | * ä»»å¡ç±»å(0éç¥ã1宣æã2é¨è¯ã3åºé¢ã4å¤è¯ã5使£ã6é®å·ã7廿â¦â¦) |
| | | */ |
| | | @Excel(name = "ä»»å¡ç±»å(0éç¥ã1宣æã2é¨è¯ã3åºé¢ã4å¤è¯ã5使£ã6é®å·ã7廿â¦â¦)") |
| | | @ApiModelProperty(value = "ä»»å¡ç±»å(0éç¥ã1宣æã2é¨è¯ã3åºé¢ã4å¤è¯ã5使£ã6é®å·ã7廿â¦â¦)") |
| | | private String type; |
| | | |
| | | /** |
| | | * ä»»å¡ID |
| | | */ |
| | | @Excel(name = " ä»»å¡ID ") |
| | | @ApiModelProperty(value = "ä»»å¡ID") |
| | | private Long taskid; |
| | | |
| | | /** |
| | | * 模æ¿ID |
| | | */ |
| | | @Excel(name = " 模æ¿ID") |
| | | @ApiModelProperty(value = "模æ¿ID") |
| | | private String templateid; |
| | | |
| | | /** |
| | | * 模æ¿å |
| | | */ |
| | | @Excel(name = " 模æ¿å ") |
| | | @ApiModelProperty(value = "模æ¿å") |
| | | private String templatename; |
| | | |
| | | /** |
| | | * å鿥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = " å鿥æ ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å鿥æ") |
| | | private Date senddate; |
| | | |
| | | /** |
| | | * ç¨æ·ID |
| | | */ |
| | | @Excel(name = " ç¨æ·ID ") |
| | | @ApiModelProperty(value = "ç¨æ·ID") |
| | | private String userid; |
| | | |
| | | /** |
| | | * ç¨æ·å |
| | | */ |
| | | @Excel(name = " ç¨æ·å ") |
| | | @ApiModelProperty(value = "ç¨æ·å") |
| | | private String username; |
| | | |
| | | /** |
| | | * å 餿 è®° |
| | | */ |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * é®é¢ |
| | | */ |
| | | @Excel(name = "é®é¢") |
| | | @ApiModelProperty(value = "é®é¢") |
| | | private String question; |
| | | |
| | | /** |
| | | * æ£è
åççç»æ |
| | | */ |
| | | @Excel(name = "æ£è
åççç»æ") |
| | | @ApiModelProperty(value = "æ£è
åççç»æ") |
| | | private String patientAnswer; |
| | | |
| | | /** |
| | | * é项å¹é
ç»æ |
| | | */ |
| | | @Excel(name = "é项å¹é
ç»æ") |
| | | @ApiModelProperty(value = "é项å¹é
ç»æ") |
| | | private String optionResult; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.mapper; |
| | | |
| | | import com.smartor.domain.IvrTaskVisitResult; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä»»å¡éè®¿ç»æMapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-05-06 |
| | | */ |
| | | @Mapper |
| | | public interface IvrTaskVisitResultMapper { |
| | | /** |
| | | * æ¥è¯¢ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param id ä»»å¡éè®¿ç»æä¸»é® |
| | | * @return ä»»å¡éè®¿ç»æ |
| | | */ |
| | | public IvrTaskVisitResult selectIvrTaskVisitResultById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡éè®¿ç»æå表 |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ä»»å¡éè®¿ç»æéå |
| | | */ |
| | | public List<IvrTaskVisitResult> selectIvrTaskVisitResultList(IvrTaskVisitResult ivrTaskVisitResult); |
| | | |
| | | /** |
| | | * æ°å¢ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertIvrTaskVisitResult(IvrTaskVisitResult ivrTaskVisitResult); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateIvrTaskVisitResult(IvrTaskVisitResult ivrTaskVisitResult); |
| | | |
| | | /** |
| | | * å é¤ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param id ä»»å¡éè®¿ç»æä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteIvrTaskVisitResultById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteIvrTaskVisitResultByIds(Long[] ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.smartor.domain.IvrTaskVisitResult; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä»»å¡éè®¿ç»æServiceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-05-06 |
| | | */ |
| | | public interface IIvrTaskVisitResultService |
| | | { |
| | | /** |
| | | * æ¥è¯¢ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param id ä»»å¡éè®¿ç»æä¸»é® |
| | | * @return ä»»å¡éè®¿ç»æ |
| | | */ |
| | | public IvrTaskVisitResult selectIvrTaskVisitResultById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡éè®¿ç»æå表 |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ä»»å¡éè®¿ç»æéå |
| | | */ |
| | | public List<IvrTaskVisitResult> selectIvrTaskVisitResultList(IvrTaskVisitResult ivrTaskVisitResult); |
| | | |
| | | /** |
| | | * æ°å¢ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertIvrTaskVisitResult(IvrTaskVisitResult ivrTaskVisitResult); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateIvrTaskVisitResult(IvrTaskVisitResult ivrTaskVisitResult); |
| | | |
| | | /** |
| | | * æ¹éå é¤ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ids éè¦å é¤çä»»å¡éè®¿ç»æä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteIvrTaskVisitResultByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤ä»»å¡éè®¿ç»æä¿¡æ¯ |
| | | * |
| | | * @param id ä»»å¡éè®¿ç»æä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteIvrTaskVisitResultById(Long id); |
| | | } |
| | |
| | | private IvrLibaTemplateTargetoptionMapper ivrLibaScriptTargetoptionMapper; |
| | | |
| | | @Autowired |
| | | private IvrTaskVisitResultMapper ivrTaskVisitResultMapper; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void phoneCallBack(PhoneCallBackVO phoneCallBackVO) {phoneCallBackVO.setTextResult(phoneCallBackVO.getTextResult().substring(0, phoneCallBackVO.getTextResult().length() - 1)); |
| | | public void phoneCallBack(PhoneCallBackVO phoneCallBackVO) { |
| | | phoneCallBackVO.setTextResult(phoneCallBackVO.getTextResult().substring(0, phoneCallBackVO.getTextResult().length() - 1)); |
| | | |
| | | //è·åæ°æ® |
| | | Boolean aBoolean = redisCache.hasKey(phoneCallBackVO.getUuid()); |
| | |
| | | if (hangupValue != null && hangupValue == 1) { |
| | | log.info("çµè¯è¦ææäº"); |
| | | //hangupValue == 1 éè®¿ç»æï¼ç´æ¥å¯ä»¥æçµè¯ |
| | | phoneUtils.hangup(null, null, null, null, null, null, null, phoneCallBackVO.getUuid()); |
| | | log.info("çµè¯ææ----------------------------"); |
| | | phoneUtils.hangup("", "", "", "", "", "", "", phoneCallBackVO.getUuid()); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } else { |
| | | //isppdç¨æ¥è®°å½æ¯å¦å¹é
å° |
| | | Boolean isppd = false; |
| | | //æåè¯ï¼å¯¹åççé®é¢,è¿è¡æ£åå¹é
ï¼è¿éåªé坹鿩é¢ï¼å
¶å®é¢åä¸è¡ï¼ |
| | | for (int j = 0; j < nowQuestion.getIvrLibaScriptTargetoptionList().size(); j++) { |
| | | //å
å« |
| | |
| | | matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult()); |
| | | } |
| | | log.info("phoneCallBack--Targetregexçå¼ä¸ºï¼{}, phoneCallBack--Targetregex2çå¼ä¸ºï¼{}", nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex(), nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()); |
| | | if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) { |
| | | if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() |
| | | || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() |
| | | || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) { |
| | | //说æå¹é
æ£ç¡®äº |
| | | //è¿éåºè¯¥å
å¤æç±»åï¼å»åä¿®æ¹ï¼è®¾ç½®IsUserOperationæ¯åéé¢çæ¹æ³ |
| | | nowQuestion.getIvrLibaScriptTargetoptionList().get(j).setIsUserOperation(true); |
| | |
| | | //å°éé»ç½®ä¸º0 |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); |
| | | |
| | | //å°æ£è
çåç¾åè¿è¡¨é |
| | | IvrTaskVisitResult ivrTaskVisitResult = DtoConversionUtils.sourceToTarget(ivrTaskcall, IvrTaskVisitResult.class); |
| | | ivrTaskVisitResult.setId(null); |
| | | ivrTaskVisitResult.setQuestion(nowQuestion.getQuestionText()); |
| | | ivrTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult()); |
| | | ivrTaskVisitResult.setCreateTime(new Date()); |
| | | ivrTaskVisitResult.setOptionResult(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetvalue()); |
| | | ivrTaskVisitResultMapper.insertIvrTaskVisitResult(ivrTaskVisitResult); |
| | | |
| | | //å°å¹é
å°çæ è¯æ¹ætrue |
| | | isppd = true; |
| | | |
| | | //è·åä¸ä¸é¢ |
| | | Integer nextQuestion = nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getNextQuestion(); |
| | | for (IvrLibaTemplateScriptVO script : ivrLibaTemplateScriptVOs) { |
| | |
| | | //没æä¸ä¸é¢äºï¼å°±ç»æäº |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); |
| | | phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); |
| | | phoneUtils.hangup(null, null, null, null, null, null, null, phoneCallBackVO.getUuid()); |
| | | try { |
| | | Thread.sleep(3000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | phoneUtils.hangup("", "", ivrLibaTemplateVO.getRevisitAfter(), "", "", "", "", phoneCallBackVO.getUuid()); |
| | | return; |
| | | } |
| | | } |
| | | return; |
| | | } else { |
| | | //没æå¹é
å° |
| | | Integer mateNum = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "mateNum"); |
| | | if (mateNum == null) mateNum = 0; |
| | | //æ å¹é
次æ°å»å¤ææ¯å¦å°æå¤§è¯¢é®æ¬¡æ°ï¼å¹¶ä¸ææçé项é½å¹é
å®äº |
| | | if (mateNum == ivrLibaTemplateVO.getMateNum().intValue() && j == nowQuestion.getIvrLibaScriptTargetoptionList().size() - 1) { |
| | | //妿ä¸ä¸é¢ä¸ºç©º.åæ°çæ°æ®è¿å,å¹¶å ä¸æè°¢è¯ |
| | | if (nowQuestion.getTargetid() < ivrLibaTemplateScriptVOs.size()) { |
| | | QuestionMessage questionMessage = new QuestionMessage(); |
| | | IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion); |
| | | questionMessage.setQuestionList(ivrLibaTemplateScriptVOs); |
| | | questionMessage.setNowQuestion(nextQuestion); |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); |
| | | phoneUtils.ttsPlayback(nextQuestion.getQuestionText(), phoneCallBackVO.getUuid()); |
| | | return; |
| | | } else { |
| | | //å°±å¯ä»¥ææçµè¯äº |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); |
| | | phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); |
| | | phoneUtils.hangup(null, null, null, null, null, null, null, phoneCallBackVO.getUuid()); |
| | | return; |
| | | } |
| | | } else if (mateNum < ivrLibaTemplateVO.getMateNum().intValue() && j == nowQuestion.getIvrLibaScriptTargetoptionList().size() - 1) { |
| | | //没æé®å°è§å®æ¬¡æ° |
| | | mateNum = mateNum + 1; |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", mateNum, 120, TimeUnit.MINUTES); |
| | | //没æå¹é
ä¸å½åoption |
| | | //Targetregex2 为falseï¼è¡¨ç¤ºå¨Targetregex2ä¸åå¨ è¯å¥ä¸çå
³é®åï¼è¿ä¸ªoptionå°±ä¸ç¨åç»§ç»å¹é
äºï¼ç´æ¥å¹é
ä¸ä¸ä¸ªoption |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | if (isppd != true) { |
| | | //没æå¹é
å° |
| | | Integer mateNum = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "mateNum"); |
| | | if (mateNum == null) mateNum = 0; |
| | | //æ å¹é
次æ°å»å¤ææ¯å¦å°æå¤§è¯¢é®æ¬¡æ°ï¼å¹¶ä¸ææçé项é½å¹é
å®äº |
| | | if (mateNum == ivrLibaTemplateVO.getMateNum().intValue()) { |
| | | //妿ä¸ä¸é¢ä¸ºç©º.åæ°çæ°æ®è¿å,å¹¶å ä¸æè°¢è¯ |
| | | if (nowQuestion.getTargetid() < ivrLibaTemplateScriptVOs.size()) { |
| | | QuestionMessage questionMessage = new QuestionMessage(); |
| | | IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion); |
| | | questionMessage.setQuestionList(ivrLibaTemplateScriptVOs); |
| | | questionMessage.setNowQuestion(nextQuestion); |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); |
| | | phoneUtils.ttsPlayback(nextQuestion.getQuestionText(), phoneCallBackVO.getUuid()); |
| | | return; |
| | | } else { |
| | | //å°±å¯ä»¥ææçµè¯äº |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); |
| | | phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); |
| | | try { |
| | | Thread.sleep(3000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | phoneUtils.hangup("", "", ivrLibaTemplateVO.getRevisitAfter(), "", "", "", "", phoneCallBackVO.getUuid()); |
| | | return; |
| | | } |
| | | } else if (mateNum < ivrLibaTemplateVO.getMateNum().intValue()) { |
| | | //没æé®å°è§å®æ¬¡æ° |
| | | mateNum = mateNum + 1; |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", mateNum, 120, TimeUnit.MINUTES); |
| | | } |
| | | } |
| | | //é项å¹é
宿åï¼éè¦åå»éè¿åºåè¿è¡å¹é
䏿¬¡ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.smartor.domain.IvrTaskVisitResult; |
| | | import com.smartor.mapper.IvrTaskVisitResultMapper; |
| | | import com.smartor.service.IIvrTaskVisitResultService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä»»å¡éè®¿ç»æServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-05-06 |
| | | */ |
| | | @Service |
| | | public class IvrTaskVisitResultServiceImpl implements IIvrTaskVisitResultService { |
| | | @Autowired |
| | | private IvrTaskVisitResultMapper ivrTaskVisitResultMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param id ä»»å¡éè®¿ç»æä¸»é® |
| | | * @return ä»»å¡éè®¿ç»æ |
| | | */ |
| | | @Override |
| | | public IvrTaskVisitResult selectIvrTaskVisitResultById(Long id) { |
| | | return ivrTaskVisitResultMapper.selectIvrTaskVisitResultById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡éè®¿ç»æå表 |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ä»»å¡éè®¿ç»æ |
| | | */ |
| | | @Override |
| | | public List<IvrTaskVisitResult> selectIvrTaskVisitResultList(IvrTaskVisitResult ivrTaskVisitResult) { |
| | | return ivrTaskVisitResultMapper.selectIvrTaskVisitResultList(ivrTaskVisitResult); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertIvrTaskVisitResult(IvrTaskVisitResult ivrTaskVisitResult) { |
| | | ivrTaskVisitResult.setCreateTime(DateUtils.getNowDate()); |
| | | return ivrTaskVisitResultMapper.insertIvrTaskVisitResult(ivrTaskVisitResult); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ivrTaskVisitResult ä»»å¡éè®¿ç»æ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateIvrTaskVisitResult(IvrTaskVisitResult ivrTaskVisitResult) { |
| | | ivrTaskVisitResult.setUpdateTime(DateUtils.getNowDate()); |
| | | return ivrTaskVisitResultMapper.updateIvrTaskVisitResult(ivrTaskVisitResult); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ä»»å¡éè®¿ç»æ |
| | | * |
| | | * @param ids éè¦å é¤çä»»å¡éè®¿ç»æä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteIvrTaskVisitResultByIds(Long[] ids) { |
| | | return ivrTaskVisitResultMapper.deleteIvrTaskVisitResultByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»»å¡éè®¿ç»æä¿¡æ¯ |
| | | * |
| | | * @param id ä»»å¡éè®¿ç»æä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteIvrTaskVisitResultById(Long id) { |
| | | return ivrTaskVisitResultMapper.deleteIvrTaskVisitResultById(id); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.IvrTaskVisitResultMapper"> |
| | | |
| | | <resultMap type="com.smartor.domain.IvrTaskVisitResult" id="IvrTaskVisitResultResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="sendname" column="sendname"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="sex" column="sex"/> |
| | | <result property="age" column="age"/> |
| | | <result property="sfzh" column="sfzh"/> |
| | | <result property="type" column="type"/> |
| | | <result property="taskid" column="taskid"/> |
| | | <result property="templateid" column="templateid"/> |
| | | <result property="templatename" column="templatename"/> |
| | | <result property="senddate" column="senddate"/> |
| | | <result property="userid" column="userid"/> |
| | | <result property="username" column="username"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="question" column="question"/> |
| | | <result property="patientAnswer" column="patient_answer"/> |
| | | <result property="optionResult" column="option_result"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectIvrTaskVisitResultVo"> |
| | | select id, |
| | | sendname, |
| | | phone, |
| | | sex, |
| | | age, |
| | | sfzh, |
| | | type, |
| | | taskid, |
| | | templateid, |
| | | templatename, |
| | | senddate, |
| | | userid, |
| | | username, |
| | | del_flag, |
| | | update_by, |
| | | update_time, |
| | | create_by, |
| | | create_time, |
| | | question, |
| | | patient_answer, |
| | | option_result |
| | | from ivr_task_visit_result |
| | | </sql> |
| | | |
| | | <select id="selectIvrTaskVisitResultList" parameterType="com.smartor.domain.IvrTaskVisitResult" |
| | | resultMap="IvrTaskVisitResultResult"> |
| | | <include refid="selectIvrTaskVisitResultVo"/> |
| | | <where> |
| | | <if test="sendname != null and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if> |
| | | <if test="phone != null and phone != ''">and phone = #{phone}</if> |
| | | <if test="sex != null and sex != ''">and sex = #{sex}</if> |
| | | <if test="age != null ">and age = #{age}</if> |
| | | <if test="sfzh != null and sfzh != ''">and sfzh = #{sfzh}</if> |
| | | <if test="type != null and type != ''">and type = #{type}</if> |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="templateid != null and templateid != ''">and templateid = #{templateid}</if> |
| | | <if test="templatename != null and templatename != ''">and templatename like concat('%', #{templatename}, |
| | | '%') |
| | | </if> |
| | | <if test="senddate != null ">and senddate = #{senddate}</if> |
| | | <if test="userid != null and userid != ''">and userid = #{userid}</if> |
| | | <if test="username != null and username != ''">and username like concat('%', #{username}, '%')</if> |
| | | <if test="question != null and question != ''">and question = #{question}</if> |
| | | <if test="patientAnswer != null and patientAnswer != ''">and patient_answer = #{patientAnswer}</if> |
| | | <if test="optionResult != null and optionResult != ''">and option_result = #{optionResult}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectIvrTaskVisitResultById" parameterType="Long" resultMap="IvrTaskVisitResultResult"> |
| | | <include refid="selectIvrTaskVisitResultVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertIvrTaskVisitResult" parameterType="com.smartor.domain.IvrTaskVisitResult" useGeneratedKeys="true" |
| | | keyProperty="id"> |
| | | insert into ivr_task_visit_result |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="sendname != null">sendname,</if> |
| | | <if test="phone != null">phone,</if> |
| | | <if test="sex != null">sex,</if> |
| | | <if test="age != null">age,</if> |
| | | <if test="sfzh != null">sfzh,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="taskid != null">taskid,</if> |
| | | <if test="templateid != null">templateid,</if> |
| | | <if test="templatename != null">templatename,</if> |
| | | <if test="senddate != null">senddate,</if> |
| | | <if test="userid != null">userid,</if> |
| | | <if test="username != null">username,</if> |
| | | <if test="delFlag != null and delFlag != ''">del_flag,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="question != null">question,</if> |
| | | <if test="patientAnswer != null">patient_answer,</if> |
| | | <if test="optionResult != null">option_result,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="sendname != null">#{sendname},</if> |
| | | <if test="phone != null">#{phone},</if> |
| | | <if test="sex != null">#{sex},</if> |
| | | <if test="age != null">#{age},</if> |
| | | <if test="sfzh != null">#{sfzh},</if> |
| | | <if test="type != null">#{type},</if> |
| | | <if test="taskid != null">#{taskid},</if> |
| | | <if test="templateid != null">#{templateid},</if> |
| | | <if test="templatename != null">#{templatename},</if> |
| | | <if test="senddate != null">#{senddate},</if> |
| | | <if test="userid != null">#{userid},</if> |
| | | <if test="username != null">#{username},</if> |
| | | <if test="delFlag != null and delFlag != ''">#{delFlag},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="question != null">#{question},</if> |
| | | <if test="patientAnswer != null">#{patientAnswer},</if> |
| | | <if test="optionResult != null">#{optionResult},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateIvrTaskVisitResult" parameterType="com.smartor.domain.IvrTaskVisitResult"> |
| | | update ivr_task_visit_result |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="sendname != null">sendname = #{sendname},</if> |
| | | <if test="phone != null">phone = #{phone},</if> |
| | | <if test="sex != null">sex = #{sex},</if> |
| | | <if test="age != null">age = #{age},</if> |
| | | <if test="sfzh != null">sfzh = #{sfzh},</if> |
| | | <if test="type != null">type = #{type},</if> |
| | | <if test="taskid != null">taskid = #{taskid},</if> |
| | | <if test="templateid != null">templateid = #{templateid},</if> |
| | | <if test="templatename != null">templatename = #{templatename},</if> |
| | | <if test="senddate != null">senddate = #{senddate},</if> |
| | | <if test="userid != null">userid = #{userid},</if> |
| | | <if test="username != null">username = #{username},</if> |
| | | <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="question != null">question = #{question},</if> |
| | | <if test="patientAnswer != null">patient_answer = #{patientAnswer},</if> |
| | | <if test="optionResult != null">option_result = #{optionResult},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteIvrTaskVisitResultById" parameterType="Long"> |
| | | update ivr_task_visit_result |
| | | set del_flag =1 |
| | | where id = #{id} |
| | | </delete> |
| | | <update id="deleteIvrTaskVisitResultByIds" parameterType="Long"> |
| | | update ivr_task_single |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | del_flag =1 |
| | | </trim> |
| | | where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | </mapper> |