From 29d027349c605bda0b7944301cd82a25ec9c1d7a Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 07 五月 2024 16:42:03 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibIntentController.java | 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaTemplateController.java | 9
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedPhysicalController.java | 4
smartor/src/main/java/com/smartor/mapper/IvrTaskVisitResultMapper.java | 63 ++++
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskVisitResultController.java | 102 +++++++
smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java | 97 +++++--
smartor/src/main/java/com/smartor/service/IIvrTaskVisitResultService.java | 62 ++++
smartor/src/main/java/com/smartor/config/PhoneUtils.java | 22 +
smartor/src/main/java/com/smartor/domain/IvrTaskVisitResult.java | 140 ++++++++++
smartor/src/main/java/com/smartor/service/impl/IvrTaskVisitResultServiceImpl.java | 90 ++++++
smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml | 177 +++++++++++++
11 files changed, 725 insertions(+), 45 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibIntentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibIntentController.java
index 21cfe24..53d6aca 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibIntentController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibIntentController.java
@@ -1,4 +1,4 @@
-package com.smartor.controller;
+package com.ruoyi.web.controller.smartor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@@ -23,7 +23,7 @@
/**
* AI鎰忓浘搴揅ontroller
- *
+ *
* @author smartor
* @date 2023-03-06
*/
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaTemplateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaTemplateController.java
index 8500f89..e94b150 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaTemplateController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaTemplateController.java
@@ -178,13 +178,4 @@
return success();
}
-
- /**
- * 寮�濮嬫墽琛�(娴嬭瘯鐢�)
- */
- @GetMapping("/addUser2")
- public AjaxResult addUser2() {
- String s = phoneUtils.ob("","","","","","","","3001","",true);
- return AjaxResult.success(s);
- }
}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskVisitResultController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskVisitResultController.java
new file mode 100644
index 0000000..fe86834
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskVisitResultController.java
@@ -0,0 +1,102 @@
+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("鏌ヨ鎮h�呴殢璁夸俊鎭�")
+ @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));
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedPhysicalController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedPhysicalController.java
index 65fdc81..f8eaec2 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedPhysicalController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedPhysicalController.java
@@ -1,4 +1,4 @@
-package com.smartor.controller;
+package com.ruoyi.web.controller.smartor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@@ -26,7 +26,7 @@
/**
* 鎮h�呬綋妫�璁板綍Controller
- *
+ *
* @author smartor
* @date 2023-03-04
*/
diff --git a/smartor/src/main/java/com/smartor/config/PhoneUtils.java b/smartor/src/main/java/com/smartor/config/PhoneUtils.java
index 122a7f7..f9ae78a 100644
--- a/smartor/src/main/java/com/smartor/config/PhoneUtils.java
+++ b/smartor/src/main/java/com/smartor/config/PhoneUtils.java
@@ -254,13 +254,33 @@
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");
}
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskVisitResult.java b/smartor/src/main/java/com/smartor/domain/IvrTaskVisitResult.java
new file mode 100644
index 0000000..564432b
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskVisitResult.java
@@ -0,0 +1,140 @@
+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 {
+
+ /**
+ * 璁板綍鍏抽敭鍊糏D
+ */
+ @ApiModelProperty(value = "璁板綍鍏抽敭鍊糏D")
+ 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瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧鈥︹��)
+ */
+ @Excel(name = "浠诲姟绫诲瀷(0閫氱煡銆�1瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧鈥︹��)")
+ @ApiModelProperty(value = "浠诲姟绫诲瀷(0閫氱煡銆�1瀹f暀銆�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;
+
+ /**
+ * 鎮h�呭洖绛旂殑缁撴灉
+ */
+ @Excel(name = "鎮h�呭洖绛旂殑缁撴灉")
+ @ApiModelProperty(value = "鎮h�呭洖绛旂殑缁撴灉")
+ private String patientAnswer;
+
+ /**
+ * 閫夐」鍖归厤缁撴灉
+ */
+ @Excel(name = "閫夐」鍖归厤缁撴灉")
+ @ApiModelProperty(value = "閫夐」鍖归厤缁撴灉")
+ private String optionResult;
+
+}
diff --git a/smartor/src/main/java/com/smartor/mapper/IvrTaskVisitResultMapper.java b/smartor/src/main/java/com/smartor/mapper/IvrTaskVisitResultMapper.java
new file mode 100644
index 0000000..a64def9
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/mapper/IvrTaskVisitResultMapper.java
@@ -0,0 +1,63 @@
+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);
+}
diff --git a/smartor/src/main/java/com/smartor/service/IIvrTaskVisitResultService.java b/smartor/src/main/java/com/smartor/service/IIvrTaskVisitResultService.java
new file mode 100644
index 0000000..18b9979
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/service/IIvrTaskVisitResultService.java
@@ -0,0 +1,62 @@
+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);
+}
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 9ab3ad8..1d5c720 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java
@@ -49,6 +49,9 @@
private IvrLibaTemplateTargetoptionMapper ivrLibaScriptTargetoptionMapper;
@Autowired
+ private IvrTaskVisitResultMapper ivrTaskVisitResultMapper;
+
+ @Autowired
private RedisCache redisCache;
@Autowired
@@ -326,7 +329,8 @@
}
@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());
@@ -338,8 +342,7 @@
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;
}
@@ -388,6 +391,8 @@
}
} else {
+ //isppd鐢ㄦ潵璁板綍鏄惁鍖归厤鍒�
+ Boolean isppd = false;
//鏈夊洖璇濓紝瀵瑰洖绛旂殑闂,杩涜姝e垯鍖归厤锛堣繖閲屽彧閽堝閫夋嫨棰橈紝鍏跺畠棰樺瀷涓嶈锛�
for (int j = 0; j < nowQuestion.getIvrLibaScriptTargetoptionList().size(); j++) {
//鍖呭惈
@@ -403,7 +408,9 @@
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()) {
//璇存槑鍖归厤姝g‘浜�
//杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉�
nowQuestion.getIvrLibaScriptTargetoptionList().get(j).setIsUserOperation(true);
@@ -412,6 +419,19 @@
//灏嗛潤榛樼疆涓�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);
+
+ //灏嗗尮閰嶅埌鐨勬爣璇嗘敼鎴恡rue
+ isppd = true;
+
//鑾峰彇涓嬩竴棰�
Integer nextQuestion = nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getNextQuestion();
for (IvrLibaTemplateScriptVO script : ivrLibaTemplateScriptVOs) {
@@ -426,40 +446,55 @@
//娌℃湁涓嬩竴棰樹簡锛屽氨缁撴潫浜�
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);
+ //娌℃湁鍖归厤涓婂綋鍓峯ption
+ //Targetregex2 涓篺alse锛岃〃绀哄湪Targetregex2涓瓨鍦� 璇彞涓殑鍏抽敭瀛楋紝杩欎釜option灏变笉鐢ㄥ啀缁х画鍖归厤浜嗭紝鐩存帴鍖归厤涓嬩竴涓猳ption
+ 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);
}
}
//閫夐」鍖归厤瀹屾垚鍚庯紝闇�瑕佸啀鍘婚�氳繃搴撳啀杩涜鍖归厤涓�娆�
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskVisitResultServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskVisitResultServiceImpl.java
new file mode 100644
index 0000000..1e985cc
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskVisitResultServiceImpl.java
@@ -0,0 +1,90 @@
+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);
+ }
+}
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml
new file mode 100644
index 0000000..ec18f14
--- /dev/null
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml
@@ -0,0 +1,177 @@
+<?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>
--
Gitblit v1.9.3