ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -14,10 +14,7 @@ import com.smartor.mapper.ServiceTaskMapper; import com.smartor.mapper.SvyTaskMapper; import com.smartor.mapper.SvyTaskSingleMapper; import com.smartor.service.IBaseSmsaccountService; import com.smartor.service.IIvrTaskTemplateService; import com.smartor.service.IServiceSubtaskRecordService; import com.smartor.service.ISvyTaskTemplateService; import com.smartor.service.*; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -26,10 +23,7 @@ import org.springframework.data.redis.listener.RedisMessageListenerContainer; import org.springframework.stereotype.Component; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; @@ -143,7 +137,7 @@ * * @param commonTaskcallMQ */ private void sfHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) { public void sfHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) { //夿ä¸ä¸commonTaskcallMQä¸çstopstateæ¯å¦ä¸ivr_taskä¸çä¸è´ï¼ä¸ä¸è´ï¼åè¯´ææ¯æåäº ServiceTask ivrTask1 = ivrTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid()); if (ivrTask1.getStopState() != commonTaskcallMQ.getStopState()) { @@ -159,10 +153,10 @@ String descByCode = ServiceFromEnum.getDescByCode(Integer.valueOf(serviceFrom)); //è¿éå¯ä»¥èèç¨çç¥æ¨¡å¼ä¼åä¸ä¸ï¼ä¸ç¶å¤ªé¾çäº //éè¿æ¨¡æ¿IDè·å模æ¿é®é¢ IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO(); ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid())); IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO); // //éè¿æ¨¡æ¿IDè·å模æ¿é®é¢ // IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO(); // ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid())); // IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO); //éè¿ä»»å¡IDæ¿å°æ£è ä¿¡æ¯ ServiceSubtask ivrTaskcall = new ServiceSubtask(); @@ -175,6 +169,37 @@ //å¦ä½ä»»å¡è¢«âæåâæâç»æ¢â break; } //è·åå°value弿å°çkey String key = getKey(); if (commonTaskcallMQ.getSendType().equals("2")) { //è¯´ææ¯ç«å³åé String value = redisCache.getCacheObject("cache-0"); ServiceSubtask serviceSubtask1 = new ServiceSubtask(); serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid()); List<ServiceSubtask> selectServiceSubtaskList1 = ivrTaskcallMapper.selectServiceSubtaskList(serviceSubtask1); for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) { if (StringUtils.isEmpty(value)) { value = "," + serviceSubtask2.getId().toString() + ","; } else { value = value + "," + serviceSubtask2.getId().toString() + ","; } } redisCache.setCacheObject("cache-0", value); } else { //éç«å³åé String value = redisCache.getCacheObject(key); ServiceSubtask serviceSubtask1 = new ServiceSubtask(); serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid()); List<ServiceSubtask> selectServiceSubtaskList1 = ivrTaskcallMapper.selectServiceSubtaskList(serviceSubtask1); for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) { if (StringUtils.isEmpty(value)) { value = "," + serviceSubtask2.getId().toString() + ","; } else { value = value + "," + serviceSubtask2.getId().toString() + ","; } } redisCache.setCacheObject(key, value); } //ä»»å¡åéè®°å½ï¼è¿ä¸ªä»£ç åºè¯¥åå¨phoneTaskä¸ï¼å åå¨è¿ï¼åé¢åæ¹ï¼ ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); @@ -185,8 +210,8 @@ serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); //éè¿å¤çº¿ç¨çæ¹å¼å»æçµè¯ executorService.submit(new PhoneTask(serviceSubtask, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils)); // //éè¿å¤çº¿ç¨çæ¹å¼å»æçµè¯ // executorService.submit(new PhoneTask(serviceSubtask, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils)); } } else if (descByCode.equals("å¤åªä½")) { //å¤åªä½ @@ -227,7 +252,7 @@ String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); SendMagParam sendMagParam = new SendMagParam(); sendMagParam.setType("5"); sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + ivrTask1.getTaskid().toString() + "¶m2=" + serviceSubtask.getPatid().toString() + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); log.info("龿¥å®æ´è·¯å¾ï¼{}", ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); //è¿ä¸ªæ¨¡æ¿IDå åæ»ï¼åé¢åæå¯é sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4"); @@ -235,7 +260,6 @@ map.put("first", ivrTask1.getTaskName()); sendMagParam.setContent(JSON.toJSONString(map)); sendMagParam.setOpenid(serviceSubtask.getOpenid()); Boolean aBoolean = sendService.sendMsg(sendMagParam); //ä»»å¡åéè®°å½ @@ -276,10 +300,12 @@ //è¿éå¯ä»¥èèç¨çç¥æ¨¡å¼ä¼åä¸ä¸ï¼ä¸ç¶å¤ªé¾çäº //éè¿æ¨¡æ¿IDè·å模æ¿é®é¢ IvrTaskTemplateVO ivrTaskTemplateVO1 = null; if (commonTaskcallMQ.getTaskType().equals("1")) { IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO(); ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid())); IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO); ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO); } //éè¿ä»»å¡IDæ¿å°æ£è ä¿¡æ¯ ServiceSubtask ivrTaskcall = new ServiceSubtask(); ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid()); @@ -348,6 +374,7 @@ Map map = new HashMap(); map.put("first", ivrTask1.getTaskName()); sendMagParam.setContent(JSON.toJSONString(map)); sendMagParam.setOpenid(ivrTaskSingle.getOpenid()); Boolean aBoolean = sendService.sendMsg(sendMagParam); //ä»»å¡åéè®°å½ @@ -490,5 +517,32 @@ // channel.basicReject(message.getMessageProperties().getDeliveryTag(), true); // } // } private String getKey() { Map<String, String> map = new HashMap<>(); for (int i = 0; i < 6; i++) { Boolean aBoolean = redisCache.hasKey("cache-" + i); if (!aBoolean) { redisCache.setCacheObject("cache-" + i, ""); map.put("cache-" + i, ""); } else { map.put("cache-" + i, redisCache.getCacheObject("cache-" + i)); } } String key = null; String value = ""; for (Map.Entry<String, String> entry : map.entrySet()) { if (StringUtils.isEmpty(value)) { value = entry.getValue(); key = entry.getKey(); } else { if (entry.getValue().split(",").length < value.split(",").length) { value = entry.getValue(); key = entry.getKey(); } } } return key; } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -222,6 +222,7 @@ public AjaxResult htmlContent(@RequestBody HtmlContentVO htmlContentVO) { // è·åæä»¶çåå§åç§° String fileName = htmlContentVO.getFileName(); FileUtils.createFile(RuoYiConfig.getUploadPath() + "/show/" + fileName.split("\\.", 2)[0]); // å°æä»¶ä¿åå°æå®ç®å½ File outputFile = new File(RuoYiConfig.getUploadPath() + "/show/" + fileName.split("\\.", 2)[0] + "/" + fileName); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"))) { ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java
@@ -257,7 +257,7 @@ if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) { //说æå¹é æ£ç¡®äº ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(true); ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(1); List<IvrTaskTemplateScriptVO> backQuset = redisCache.getCacheObject(userId + "backQuset"); //å¹é 宿å,å°ç»æä¿åå°æ°çæ°ç» backQuset.add(ivrTaskTemplateScriptVO); ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/BaseUserInfoController.java
@@ -4,6 +4,8 @@ import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.utils.StringUtils; import io.swagger.annotations.Api; 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.*; @@ -22,6 +24,7 @@ * @author ruoyi * @date 2023-05-25 */ @Api(description = "æ ç¾åç±»") @RestController @RequestMapping("/system/info") public class BaseUserInfoController extends BaseController { @@ -31,6 +34,7 @@ /** * æ¥è¯¢ç¨æ·å表 */ @ApiOperation("æ¥è¯¢ç¨æ·å表") @PreAuthorize("@ss.hasPermi('system:info:list')") @PostMapping("/list") public TableDataInfo list(@RequestBody BaseUserInfo baseUserInfo) { @@ -42,6 +46,7 @@ /** * 导åºç¨æ·å表 */ @ApiOperation("导åºç¨æ·å表") @PreAuthorize("@ss.hasPermi('system:info:export')") @Log(title = "ç¨æ·", businessType = BusinessType.EXPORT) @PostMapping("/export") @@ -54,6 +59,7 @@ /** * è·åç¨æ·è¯¦ç»ä¿¡æ¯ */ @ApiOperation("è·åç¨æ·è¯¦ç»ä¿¡æ¯") @PreAuthorize("@ss.hasPermi('system:info:query')") @GetMapping(value = "/{userid}") public AjaxResult getInfo(@PathVariable("userid") Long userid) { @@ -63,6 +69,7 @@ /** * æ°å¢ç¨æ· */ @ApiOperation("æ°å¢ç¨æ·") @PreAuthorize("@ss.hasPermi('system:info:add')") @Log(title = "ç¨æ·", businessType = BusinessType.INSERT) @PostMapping("/add") @@ -73,6 +80,7 @@ /** * ä¿®æ¹ç¨æ· */ @ApiOperation("ä¿®æ¹ç¨æ·") @PreAuthorize("@ss.hasPermi('system:info:edit')") @Log(title = "ç¨æ·", businessType = BusinessType.UPDATE) @PostMapping("/edit") @@ -83,6 +91,7 @@ /** * å é¤ç¨æ· */ @ApiOperation("å é¤ç¨æ·") @PreAuthorize("@ss.hasPermi('system:info:remove')") @Log(title = "ç¨æ·", businessType = BusinessType.DELETE) @GetMapping("/remove/{userids}") @@ -97,6 +106,7 @@ * @param noticeWay éç¥æ¹å¼ * @return */ @ApiOperation("è·å人åçèç³»æ¹å¼") @GetMapping("/reportContent") public AjaxResult getContact(@RequestParam("personCode") String personCode, @RequestParam("noticeWay") String noticeWay) { if (StringUtils.isEmpty(personCode) || StringUtils.isEmpty(noticeWay)) { ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java
@@ -36,6 +36,7 @@ /** * æ¥è¯¢é¢ç®å表ï¼ä¹ä¹çhisæ°æ®è·åæ åµï¼ */ @ApiOperation(" æ¥è¯¢é¢ç®å表ï¼ä¹ä¹çhisæ°æ®è·åæ åµï¼") @PostMapping("/list") public TableDataInfo list(@RequestBody ServiceThirdData serviceThirdData) { List<ServiceThirdData> list = iServiceThirdDataService.queryList(serviceThirdData); ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/EquipmentinfoController.java
@@ -106,7 +106,7 @@ /** * é®é¢ä¸æ¥ */ @RequestMapping("/reportContent") @PostMapping("/reportContent") public AjaxResult reportContent(@RequestBody ReportReqVo reportReqVo) { if (StringUtils.isEmpty(reportReqVo.getDealDept()) && StringUtils.isEmpty(reportReqVo.getDealPersionNO())) { return error("å¤ç人åå¤çé¨é¨ä¸è½åæ¶ä¸ºç©ºï¼"); ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java
@@ -207,7 +207,7 @@ @PostMapping("/getPatientInfo") public TableDataInfo getPatientInfo(@RequestBody PatArchiveReq patArchiveReq) { PageUtils.startPageByPost(patArchiveReq.getPageNum(), patArchiveReq.getPageSize()); List<PatTaskRelevance> patientInfo = patArchiveService.getPatientInfo(patArchiveReq); List<ServiceSubtask> patientInfo = patArchiveService.getPatientInfo(patArchiveReq); long count = PageUtils.count(new ISelect() { @Override public void doSelect() { ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedRegistrationController.java
@@ -8,6 +8,8 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.smartor.domain.PatMedRegistration; import com.smartor.service.IPatMedRegistrationService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -21,6 +23,7 @@ * @author ruoyi * @date 2024-08-01 */ @Api(description = " æ£è æå·è®°å½") @RestController @RequestMapping("/smartor/registration") public class PatMedRegistrationController extends BaseController { @@ -30,6 +33,7 @@ /** * æ¥è¯¢æ£è æå·è®°å½å表 */ @ApiOperation("æ¥è¯¢æ£è æå·è®°å½å表") @PreAuthorize("@ss.hasPermi('system:registration:list')") @GetMapping("/list") public TableDataInfo list(PatMedRegistration patMedRegistration) { @@ -41,6 +45,7 @@ /** * å¯¼åºæ£è æå·è®°å½å表 */ @ApiOperation("å¯¼åºæ£è æå·è®°å½å表") @PreAuthorize("@ss.hasPermi('system:registration:export')") @Log(title = "æ£è æå·è®°å½", businessType = BusinessType.EXPORT) @PostMapping("/export") @@ -53,6 +58,7 @@ /** * è·åæ£è æå·è®°å½è¯¦ç»ä¿¡æ¯ */ @ApiOperation("è·åæ£è æå·è®°å½è¯¦ç»ä¿¡æ¯") @PreAuthorize("@ss.hasPermi('system:registration:query')") @GetMapping(value = "/getInfo/{registid}") public AjaxResult getInfo(@PathVariable("registid") Long registid) { @@ -62,6 +68,7 @@ /** * æ°å¢æ£è æå·è®°å½ */ @ApiOperation("æ°å¢æ£è æå·è®°å½") @PreAuthorize("@ss.hasPermi('system:registration:add')") @Log(title = "æ£è æå·è®°å½", businessType = BusinessType.INSERT) @PostMapping("/add") @@ -72,6 +79,7 @@ /** * ä¿®æ¹æ£è æå·è®°å½ */ @ApiOperation("ä¿®æ¹æ£è æå·è®°å½") @PreAuthorize("@ss.hasPermi('system:registration:edit')") @Log(title = "æ£è æå·è®°å½", businessType = BusinessType.UPDATE) @PostMapping("/edit") @@ -82,6 +90,7 @@ /** * å 餿£è æå·è®°å½ */ @ApiOperation("å 餿£è æå·è®°å½") @PreAuthorize("@ss.hasPermi('system:registration:remove')") @Log(title = "æ£è æå·è®°å½", businessType = BusinessType.DELETE) @GetMapping("/remove/{registids}") ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -20,6 +20,9 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; /** @@ -101,9 +104,28 @@ @ApiOperation("çµè¯åè°ä»»å¡") @PostMapping("/phoneCallBack") public AjaxResult phoneCallBack(@RequestBody PhoneCallBackVO phoneCallBackVO) { // log.error("çµè¯åè°ä»»å¡æåäºä¸ï¼{}", phoneCallBackVO); serviceSubtaskService.phoneCallBack(phoneCallBackVO); return success(); } @ApiOperation("çµè¯ASRéè¯åè°(é¨ç»®)") @PostMapping("/phoneCallBackYQ") public PhoneCallBackYQVO phoneCallBackYQ(@RequestBody PhoneCallReqYQVO phoneCallReqYQVO) { log.error("çµè¯ASRéè¯åè°(é¨ç»®) ï¼{}", phoneCallReqYQVO); PhoneCallBackYQVO phoneCallBackYQVO = serviceSubtaskService.phoneCallBackYQ(phoneCallReqYQVO); return phoneCallBackYQVO; } /** * çµè¯åè°ä»»å¡(é¨ç»®) */ @ApiOperation("çµè¯åè°ä»»å¡(é¨ç»®)") @PostMapping("/taskPull") public List<PullTaskVO> taskPull() { log.error("çµè¯åè°ä»»å¡(é¨ç»®)"); List<PullTaskVO> pullTaskVOList = serviceSubtaskService.taskPull(); log.error("çµè¯åè°ä»»å¡(é¨ç»®):{}", pullTaskVOList); return pullTaskVOList; } /** @@ -115,4 +137,13 @@ return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq)); } /** * éè¯è®°å½åè° */ @ApiOperation("éè¯è®°å½åè°") @PostMapping("/recordAccept") public AjaxResult recordAccept(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) { return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq)); } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SmsParamController.java
@@ -2,6 +2,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -29,8 +30,7 @@ */ @RestController @RequestMapping("/smartor/smsparam") public class SmsParamController extends BaseController { public class SmsParamController extends BaseController { @Autowired private ISmsParamService smsParamService; @@ -39,8 +39,7 @@ */ @PreAuthorize("@ss.hasPermi('smartor:smsparam:list')") @PostMapping("/list") public TableDataInfo list(@RequestBody SmsParam smsParam) { public TableDataInfo list(@RequestBody SmsParam smsParam) { startPage(); List<SmsParam> list = smsParamService.selectSmsParamList(smsParam); return getDataTable(list); @@ -52,8 +51,7 @@ @PreAuthorize("@ss.hasPermi('smartor:smsparam:export')") @Log(title = "çä¿¡åæ°", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SmsParam smsParam) { public void export(HttpServletResponse response, SmsParam smsParam) { List<SmsParam> list = smsParamService.selectSmsParamList(smsParam); ExcelUtil<SmsParam> util = new ExcelUtil<SmsParam>(SmsParam.class); util.exportExcel(response, list, "çä¿¡åæ°æ°æ®"); @@ -64,8 +62,7 @@ */ @PreAuthorize("@ss.hasPermi('smartor:smsparam:query')") @GetMapping(value = "/{paramid}") public AjaxResult getInfo(@PathVariable("paramid") Long paramid) { public AjaxResult getInfo(@PathVariable("paramid") Long paramid) { return success(smsParamService.selectSmsParamByParamid(paramid)); } @@ -75,8 +72,7 @@ @PreAuthorize("@ss.hasPermi('smartor:smsparam:add')") @Log(title = "çä¿¡åæ°", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult add(@RequestBody SmsParam smsParam) { public AjaxResult add(@RequestBody SmsParam smsParam) { return toAjax(smsParamService.insertSmsParam(smsParam)); } @@ -86,8 +82,7 @@ @PreAuthorize("@ss.hasPermi('smartor:smsparam:edit')") @Log(title = "çä¿¡åæ°", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody SmsParam smsParam) { public AjaxResult edit(@RequestBody SmsParam smsParam) { return toAjax(smsParamService.updateSmsParam(smsParam)); } @@ -97,8 +92,11 @@ @PreAuthorize("@ss.hasPermi('smartor:smsparam:remove')") @Log(title = "çä¿¡åæ°", businessType = BusinessType.DELETE) @GetMapping("/remove/{paramids}") public AjaxResult remove(@PathVariable Long[] paramids) { public AjaxResult remove(@PathVariable Long[] paramids) { return toAjax(smsParamService.deleteSmsParamByParamids(paramids)); } public AjaxResult sendSmsInfo() { return null; } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibScriptCategoryController.java
@@ -11,11 +11,13 @@ import com.smartor.service.ISvyLibScriptCategoryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.beanutils.ConvertUtils; 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.Arrays; import java.util.List; /** @@ -92,8 +94,9 @@ @PreAuthorize("@ss.hasPermi('smartor:category:remove')") @Log(title = "é®å·é¢ç®åç±»", businessType = BusinessType.DELETE) @GetMapping("/remove/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(svyLibScriptCategoryService.deleteSvyLibScriptCategoryByIds(ids)); public AjaxResult remove(@PathVariable String ids) { Long[] idArray = (Long[]) ConvertUtils.convert(ids.split(","), Long.class); return toAjax(svyLibScriptCategoryService.deleteSvyLibScriptCategoryByIds(idArray)); } /** ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java
@@ -2,6 +2,9 @@ import org.junit.Test; import java.time.LocalTime; import java.time.format.DateTimeFormatter; //@SpringBootTest //@RunWith(SpringRunner.class) public class MQTest { @@ -9,7 +12,12 @@ @Test public void testSend22() { LocalTime now = LocalTime.now(); System.out.println("å½åæ¶å: " + now.format(DateTimeFormatter.ofPattern("hh:mm"))); // è·åä¸ä¸åéçæ¶å LocalTime nextMinute = now.plusMinutes(1); System.out.println("ä¸ä¸åéçæ¶å: " + nextMinute.format(DateTimeFormatter.ofPattern("hh:mm"))); } ruoyi-admin/src/main/resources/application-druid.yml
@@ -135,4 +135,4 @@ #å¤é¾è¯·æ±IPå端å£å· req_path: 8096 localIP: 192.168.2.10 localIP: 192.168.1.10 ruoyi-admin/src/main/resources/application.yml
@@ -76,7 +76,8 @@ # port: 6020 # å°åï¼å ¬å¸ï¼ host: 116.62.18.175 # host: 116.62.18.175 host: 192.168.1.10 port: 6020 # æ°æ®åºç´¢å¼ database: 0 @@ -94,7 +95,6 @@ max-active: 8 # #è¿æ¥æ± æå¤§é»å¡çå¾ æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ max-wait: -1ms # minioæä»¶ç®¡çè¿æ¥ minio: endpoint: http://192.168.1.4 ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
@@ -241,4 +241,11 @@ String baseName = FilenameUtils.getBaseName(fileName); return baseName; } public static void createFile(String path) { File file = new File(path); if (!file.exists()) { file.mkdirs(); } } } ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -108,7 +108,7 @@ // è¿æ»¤è¯·æ± .authorizeRequests() // 对äºç»å½login 注åregister éªè¯ç captchaImage å 许å¿åè®¿é® .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/tasksingle/phoneCallBack", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/serviceSubtask/saveQuestionAnswer").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/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask//phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/serviceSubtask/saveQuestionAnswer").permitAll() // éæèµæºï¼å¯å¿åè®¿é® .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() // é¤ä¸é¢å¤çææè¯·æ±å ¨é¨éè¦é´æè®¤è¯ ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java
@@ -1,6 +1,8 @@ package com.ruoyi.framework.config; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.ruoyi.common.utils.ServletUtils; @@ -10,23 +12,40 @@ * @author ruoyi */ @Component public class ServerConfig { public class ServerConfig { @Value("${server.port}") private String port; /** * è·å宿´ç请æ±è·¯å¾ï¼å æ¬ï¼ååï¼ç«¯å£ï¼ä¸ä¸æè®¿é®è·¯å¾ * * @return æå¡å°å */ public String getUrl() { public String getUrl() { HttpServletRequest request = ServletUtils.getRequest(); return getDomain(request); String domain = getDomain(request); //ä¿®æ¹ä¸ä¸ªç«¯å£ domain = replaceAfterSecondColon(domain, port); return domain; } public static String getDomain(HttpServletRequest request) { public static String getDomain(HttpServletRequest request) { StringBuffer url = request.getRequestURL(); String contextPath = request.getServletContext().getContextPath(); return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); } public static String replaceAfterSecondColon(String str, String replacement) { int firstColonIndex = str.indexOf(":"); if (firstColonIndex != -1) { int secondColonIndex = str.indexOf(":", firstColonIndex + 1); if (secondColonIndex != -1 && secondColonIndex + 1 < str.length()) { // è·å第äºä¸ªâï¼âåçé¨å String beforeSecondColon = str.substring(0, secondColonIndex + 1); // è¿åæ¿æ¢åçå符串 return beforeSecondColon + replacement; } } return str; } } ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -1,25 +1,68 @@ package com.ruoyi.quartz.task; import com.smartor.domain.ServiceThirdData; import com.smartor.service.IServiceSubtaskAnswerService; import com.smartor.service.IServiceThirdDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.alibaba.fastjson2.JSON; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.enums.ServiceFromEnum; import com.ruoyi.common.utils.RSAPublicKeyExample; import com.ruoyi.common.utils.StringUtils; import com.smartor.common.SendService; import com.smartor.domain.*; import com.smartor.mapper.ServiceSubtaskMapper; import com.smartor.mapper.ServiceTaskMapper; import com.smartor.service.*; 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.Component; import java.util.Date; import java.util.*; /** * 宿¶ä»»å¡è°åº¦æµè¯ * * @author ruoyi */ @Slf4j @Component("ryTask") public class RyTask { @Autowired private IServiceThirdDataService iServiceThirdDataService; @Autowired private IServiceSubtaskAnswerService serviceSubtaskAnswerService; @Autowired private IPatMedInhospService iPatMedInhospService; @Autowired private IServiceSubtaskService iServiceSubtaskService; @Value("${localIP}") private String localIP; @Value("${pub_key}") private String pub_key; @Value("${req_path}") private String req_path; @Autowired private ServiceTaskMapper serviceTaskMapper; @Autowired private SendService sendService; @Autowired private RedisCache redisCache; @Autowired private IServiceSubtaskRecordService serviceSubtaskRecordService; @Autowired IBaseSmsaccountService baseSmsaccountService; public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) { System.out.println(StringUtils.format("æ§è¡å¤åæ¹æ³ï¼ å符串类å{}ï¼å¸å°ç±»å{}ï¼é¿æ´å{}ï¼æµ®ç¹å{}ï¼æ´å½¢{}", s, b, l, d, i)); @@ -50,4 +93,235 @@ public void runServiceSubTaskAnswer() { serviceSubtaskAnswerService.saveQuestionAnswer(null); } /** * å¤çhisæ°æ® */ public void dealHisData() { //å°æ£è ä¿¡æ¯ãåºé¢ãé¨è¯æ°æ®å ¨é¨éé //è°ç¨dealOupHospInfoæ°æ®å¤çæ¹æ³ï¼å¤çå®åï¼å°âåºé¢è¡¨çcheck_flag=1â //è·åå½åæ¥æ ï¼ç²¾ç¡®å°å¤©ï¼å¾åæ¨ç¸åºå¤©æ°ï¼å¨æå®çåºç¡æ¨¡æ¿ä¸æ¾å¯¹åºç天æ°ï¼ï¼ //å¾ªç¯æ£è ä¿¡æ¯ï¼æ ¹æ®æ£è "åºé¢è¯æICDå¼âè·åå°ç¸å½ç模æ¿ï¼è·ååç¸åºç天æ°ï¼; //æ ¹æ®æ¥è¯¢åºæ¥ç模æ¿ï¼å»åºå®ä»»å¡ï¼åºå®ä»»å¡ï¼å·²ç»å°æ¨¡æ¿ä¹åºå®äºï¼å»å¹é æ¨¡æ¿ //æ ¹æ®å¹é åºæ¥ç模æ¿åä»»å¡ä¸æ£è ä¿¡æ¯ï¼å°æ°æ®æå ¥å°åä»»å¡è¡¨ä¸ iPatMedInhospService.dealOupHospInfo(); } /** * é¿æä»»å¡æ§è¡ */ public void longTaskSend() { //è·åä»»å¡ä¿¡æ¯ ServiceTask st =new ServiceTask(); st.setDelFlag("0"); st.setLongTask(1); List<ServiceTask> serviceTasks = serviceTaskMapper.selectServiceTaskList(st); for (ServiceTask serviceTask : serviceTasks) { //éè¿taskId,è·åæªæ§è¡çåä»»å¡ä¿¡æ¯ ServiceSubtask serviceSubtask = new ServiceSubtask(); serviceSubtask.setTaskid(serviceTask.getTaskid()); serviceSubtask.setSendstate(2L); List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask); if (CollectionUtils.isNotEmpty(selectServiceSubtaskList)) { for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) { //妿æ£è çåéæ¥ææ¯ä»å¤©ï¼åè¿è¡åé boolean dateToday = isDateToday(serviceSubtask1.getLongSendTime()); if (dateToday) { CommonTaskcallMQ commonTaskcallMQ = new CommonTaskcallMQ(); commonTaskcallMQ.setTaskid(serviceTask.getTaskid()); commonTaskcallMQ.setPreachform(serviceSubtask1.getServiceform()); sfHandle(commonTaskcallMQ, localIP); //åé宿åï¼ä¿®æ¹ç¶æ serviceSubtask1.setSendstate(3L); iServiceSubtaskService.updateServiceSubtask(serviceSubtask1); } } } } } /** * å¤ææ¥ææ¯å¦æ¯ä»å¤© * * @param date * @return */ public boolean isDateToday(Date date) { // è·åå½åæ¥æ Calendar calendarNow = Calendar.getInstance(); int todayYear = calendarNow.get(Calendar.YEAR); int todayMonth = calendarNow.get(Calendar.MONTH); int todayDay = calendarNow.get(Calendar.DAY_OF_MONTH); // å建ä¸ä¸ª Calendar å®ä¾ç¨äºæ£æ¥çæ¥æ Calendar calendarToCheck = Calendar.getInstance(); calendarToCheck.setTime(date); // æ¯è¾å¹´ãæåæ¥ return (calendarToCheck.get(Calendar.YEAR) == todayYear && calendarToCheck.get(Calendar.MONTH) == todayMonth && calendarToCheck.get(Calendar.DAY_OF_MONTH) == todayDay); } public void sfHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) { //夿ä¸ä¸commonTaskcallMQä¸çstopstateæ¯å¦ä¸ivr_taskä¸çä¸è´ï¼ä¸ä¸è´ï¼åè¯´ææ¯æåäº ServiceTask ivrTask1 = serviceTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid()); if (StringUtils.isNotEmpty(commonTaskcallMQ.getPreachform())) { //å¦ä½ä»»å¡åéæ¹å¼ä¸ä¸ºç©º String[] split = commonTaskcallMQ.getPreachform().split(","); System.out.println("splitçå¼ä¸ºï¼" + split); for (String serviceFrom : split) { String descByCode = ServiceFromEnum.getDescByCode(Integer.valueOf(serviceFrom)); //è¿éå¯ä»¥èèç¨çç¥æ¨¡å¼ä¼åä¸ä¸ï¼ä¸ç¶å¤ªé¾çäº //éè¿ä»»å¡IDæ¿å°æ£è ä¿¡æ¯ ServiceSubtask ivrTaskcall = new ServiceSubtask(); ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid()); List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall); if (descByCode.equals("çµè¯")) { for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { ServiceTask ivrTask = serviceTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) { //å¦ä½ä»»å¡è¢«âæåâæâç»æ¢â break; } //è·åå°value弿å°çkey String key = getKey(); if (commonTaskcallMQ.getSendType().equals("2")) { //è¯´ææ¯ç«å³åé String value = redisCache.getCacheObject("cache-0"); ServiceSubtask serviceSubtask1 = new ServiceSubtask(); serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid()); List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1); for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) { if (StringUtils.isEmpty(value)) { value = "," + serviceSubtask2.getId().toString() + ","; } else { value = value + "," + serviceSubtask2.getId().toString() + ","; } } redisCache.setCacheObject("cache-0", value); } else { //éç«å³åé String value = redisCache.getCacheObject(key); ServiceSubtask serviceSubtask1 = new ServiceSubtask(); serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid()); List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1); for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) { if (StringUtils.isEmpty(value)) { value = "," + serviceSubtask2.getId().toString() + ","; } else { value = value + "," + serviceSubtask2.getId().toString() + ","; } } redisCache.setCacheObject(key, value); } //ä»»å¡åéè®°å½ï¼è¿ä¸ªä»£ç åºè¯¥åå¨phoneTaskä¸ï¼å åå¨è¿ï¼åé¢åæ¹ï¼ ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); serviceSubtaskRecord.setTasktype(serviceSubtask.getType()); serviceSubtaskRecord.setPreachform("3"); serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); // //éè¿å¤çº¿ç¨çæ¹å¼å»æçµè¯ // executorService.submit(new PhoneTask(serviceSubtask, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils)); } } else if (descByCode.equals("å¤åªä½")) { //å¤åªä½ return; } else if (descByCode.equals("纸质")) { //纸质 return; } else if (descByCode.equals("çä¿¡")) { //çä¿¡ // http://localhost:8099/followvisit/particty?param1=3¶m2=348 //对urlä¸ä¸¤ä¸ªåæ°å å¯ RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); SendMagParam sendMagParam = new SendMagParam(); sendMagParam.setType("4"); sendMagParam.setPhone(serviceSubtask.getPhone()); sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false"); Boolean aBoolean = sendService.sendMsg(sendMagParam); //ä»»å¡åéè®°å½ ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); serviceSubtaskRecord.setTasktype(serviceSubtask.getType()); serviceSubtaskRecord.setPreachform("4"); serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); serviceSubtaskRecord.setResult(aBoolean == true ? "æå" : "失败"); serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); } } else if (descByCode.equals("å ¬ä¼å·")) { //å ¬ä¼å· RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); SendMagParam sendMagParam = new SendMagParam(); sendMagParam.setType("5"); sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); log.info("龿¥å®æ´è·¯å¾ï¼{}", ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); //è¿ä¸ªæ¨¡æ¿IDå åæ»ï¼åé¢åæå¯é sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4"); Map map = new HashMap(); map.put("first", ivrTask1.getTaskName()); sendMagParam.setContent(JSON.toJSONString(map)); sendMagParam.setOpenid(serviceSubtask.getOpenid()); Boolean aBoolean = sendService.sendMsg(sendMagParam); //ä»»å¡åéè®°å½ ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); serviceSubtaskRecord.setTasktype(serviceSubtask.getType()); serviceSubtaskRecord.setPreachform("4"); serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); serviceSubtaskRecord.setResult(aBoolean == true ? "æå" : "失败"); serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); } } //éç¥ MQ æ¶æ¯å·²è¢«æ¥æ¶,å¯ä»¥ACK(ä»éåä¸å é¤)äº ï¼è¿ä¸ªéè¦æ ¹æ®ä¸å¡åå»å¤çACKï¼ } } } private String getKey() { Map<String, String> map = new HashMap<>(); for (int i = 0; i < 6; i++) { Boolean aBoolean = redisCache.hasKey("cache-" + i); if (!aBoolean) { redisCache.setCacheObject("cache-" + i, ""); map.put("cache-" + i, ""); } else { map.put("cache-" + i, redisCache.getCacheObject("cache-" + i)); } } String key = null; String value = ""; for (Map.Entry<String, String> entry : map.entrySet()) { if (StringUtils.isEmpty(value)) { value = entry.getValue(); key = entry.getKey(); } else { if (entry.getValue().split(",").length < value.split(",").length) { value = entry.getValue(); key = entry.getKey(); } } } return key; } } ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java
@@ -1,6 +1,7 @@ package com.ruoyi.system.domain.vo; import com.fasterxml.jackson.annotation.JsonInclude; import java.util.List; /** @@ -9,8 +10,7 @@ * @author ruoyi */ @JsonInclude(JsonInclude.Include.NON_EMPTY) public class RouterVo { public class RouterVo { /** * è·¯ç±åå */ @@ -56,93 +56,88 @@ */ private List<RouterVo> children; public String getName() { /** * åèååéå */ private List<String> childName; public List<String> getChildName() { return childName; } public void setChildName(List<String> childName) { this.childName = childName; } public String getName() { return name; } public void setName(String name) { public void setName(String name) { this.name = name; } public String getPath() { public String getPath() { return path; } public void setPath(String path) { public void setPath(String path) { this.path = path; } public boolean getHidden() { public boolean getHidden() { return hidden; } public void setHidden(boolean hidden) { public void setHidden(boolean hidden) { this.hidden = hidden; } public String getRedirect() { public String getRedirect() { return redirect; } public void setRedirect(String redirect) { public void setRedirect(String redirect) { this.redirect = redirect; } public String getComponent() { public String getComponent() { return component; } public void setComponent(String component) { public void setComponent(String component) { this.component = component; } public String getQuery() { public String getQuery() { return query; } public void setQuery(String query) { public void setQuery(String query) { this.query = query; } public Boolean getAlwaysShow() { public Boolean getAlwaysShow() { return alwaysShow; } public void setAlwaysShow(Boolean alwaysShow) { public void setAlwaysShow(Boolean alwaysShow) { this.alwaysShow = alwaysShow; } public MetaVo getMeta() { public MetaVo getMeta() { return meta; } public void setMeta(MetaVo meta) { public void setMeta(MetaVo meta) { this.meta = meta; } public List<RouterVo> getChildren() { public List<RouterVo> getChildren() { return children; } public void setChildren(List<RouterVo> children) { public void setChildren(List<RouterVo> children) { this.children = children; } } ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseUserInfoMapper.java
@@ -2,6 +2,7 @@ import java.util.List; import com.ruoyi.system.domain.BaseUserInfo; import org.apache.ibatis.annotations.Mapper; /** * ç¨æ·Mapperæ¥å£ @@ -9,6 +10,7 @@ * @author ruoyi * @date 2023-05-25 */ @Mapper public interface BaseUserInfoMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/EquipmentinfoMapper.java
@@ -2,6 +2,7 @@ import java.util.List; import com.ruoyi.system.domain.Equipmentinfo; import org.apache.ibatis.annotations.Mapper; /** * ã请填ååè½åç§°ãMapperæ¥å£ @@ -9,6 +10,7 @@ * @author ruoyi * @date 2023-05-25 */ @Mapper public interface EquipmentinfoMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
@@ -1,6 +1,8 @@ package com.ruoyi.system.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysDept; @@ -9,6 +11,7 @@ * * @author ruoyi */ @Mapper public interface SysDeptMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java
@@ -1,6 +1,8 @@ package com.ruoyi.system.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysDictData; @@ -9,6 +11,7 @@ * * @author ruoyi */ @Mapper public interface SysDictDataMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.common.core.domain.entity.SysDictType; import org.apache.ibatis.annotations.Mapper; /** * åå ¸è¡¨ æ°æ®å± * * @author ruoyi */ @Mapper public interface SysDictTypeMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.system.domain.SysLogininfor; import org.apache.ibatis.annotations.Mapper; /** * ç³»ç»è®¿é®æ¥å¿æ åµä¿¡æ¯ æ°æ®å± * * @author ruoyi */ @Mapper public interface SysLogininforMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
@@ -1,6 +1,8 @@ package com.ruoyi.system.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysMenu; @@ -9,6 +11,7 @@ * * @author ruoyi */ @Mapper public interface SysMenuMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.system.domain.SysNotice; import org.apache.ibatis.annotations.Mapper; /** * éç¥å ¬å表 æ°æ®å± * * @author ruoyi */ @Mapper public interface SysNoticeMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.system.domain.SysOperLog; import org.apache.ibatis.annotations.Mapper; /** * æä½æ¥å¿ æ°æ®å± * * @author ruoyi */ @Mapper public interface SysOperLogMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.system.domain.SysPost; import org.apache.ibatis.annotations.Mapper; /** * å²ä½ä¿¡æ¯ æ°æ®å± * * @author ruoyi */ @Mapper public interface SysPostMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.system.domain.SysRoleDept; import org.apache.ibatis.annotations.Mapper; /** * è§è²ä¸é¨é¨å ³è表 æ°æ®å± * * @author ruoyi */ @Mapper public interface SysRoleDeptMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.common.core.domain.entity.SysRole; import org.apache.ibatis.annotations.Mapper; /** * è§è²è¡¨ æ°æ®å± * * @author ruoyi */ @Mapper public interface SysRoleMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.system.domain.SysRoleMenu; import org.apache.ibatis.annotations.Mapper; /** * è§è²ä¸èåå ³è表 æ°æ®å± * * @author ruoyi */ @Mapper public interface SysRoleMenuMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
@@ -1,6 +1,8 @@ package com.ruoyi.system.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysUser; @@ -9,6 +11,7 @@ * * @author ruoyi */ @Mapper public interface SysUserMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java
@@ -2,12 +2,14 @@ import java.util.List; import com.ruoyi.system.domain.SysUserPost; import org.apache.ibatis.annotations.Mapper; /** * ç¨æ·ä¸å²ä½å ³è表 æ°æ®å± * * @author ruoyi */ @Mapper public interface SysUserPostMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
@@ -1,6 +1,8 @@ package com.ruoyi.system.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.ruoyi.system.domain.SysUserRole; @@ -9,6 +11,7 @@ * * @author ruoyi */ @Mapper public interface SysUserRoleMapper { /** ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
@@ -8,6 +8,8 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.constant.Constants; @@ -31,8 +33,7 @@ * @author ruoyi */ @Service public class SysMenuServiceImpl implements ISysMenuService { public class SysMenuServiceImpl implements ISysMenuService { public static final String PREMISSION_STRING = "perms[\"{0}\"]"; @Autowired @@ -51,8 +52,7 @@ * @return èåå表 */ @Override public List<SysMenu> selectMenuList(Long userId) { public List<SysMenu> selectMenuList(Long userId) { return selectMenuList(new SysMenu(), userId); } @@ -63,16 +63,12 @@ * @return èåå表 */ @Override public List<SysMenu> selectMenuList(SysMenu menu, Long userId) { public List<SysMenu> selectMenuList(SysMenu menu, Long userId) { List<SysMenu> menuList = null; // 管çåæ¾ç¤ºææèåä¿¡æ¯ if (SysUser.isAdmin(userId)) { if (SysUser.isAdmin(userId)) { menuList = menuMapper.selectMenuList(menu); } else { } else { menu.getParams().put("userId", userId); menuList = menuMapper.selectMenuListByUserId(menu); } @@ -86,14 +82,11 @@ * @return æéå表 */ @Override public Set<String> selectMenuPermsByUserId(Long userId) { public Set<String> selectMenuPermsByUserId(Long userId) { List<String> perms = menuMapper.selectMenuPermsByUserId(userId); Set<String> permsSet = new HashSet<>(); for (String perm : perms) { if (StringUtils.isNotEmpty(perm)) { for (String perm : perms) { if (StringUtils.isNotEmpty(perm)) { permsSet.addAll(Arrays.asList(perm.trim().split(","))); } } @@ -107,14 +100,11 @@ * @return æéå表 */ @Override public Set<String> selectMenuPermsByRoleId(Long roleId) { public Set<String> selectMenuPermsByRoleId(Long roleId) { List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId); Set<String> permsSet = new HashSet<>(); for (String perm : perms) { if (StringUtils.isNotEmpty(perm)) { for (String perm : perms) { if (StringUtils.isNotEmpty(perm)) { permsSet.addAll(Arrays.asList(perm.trim().split(","))); } } @@ -128,15 +118,11 @@ * @return èåå表 */ @Override public List<SysMenu> selectMenuTreeByUserId(Long userId) { public List<SysMenu> selectMenuTreeByUserId(Long userId) { List<SysMenu> menus = null; if (SecurityUtils.isAdmin(userId)) { if (SecurityUtils.isAdmin(userId)) { menus = menuMapper.selectMenuTreeAll(); } else { } else { menus = menuMapper.selectMenuTreeByUserId(userId); } return getChildPerms(menus, 0); @@ -149,8 +135,7 @@ * @return éä¸èåå表 */ @Override public List<Long> selectMenuListByRoleId(Long roleId) { public List<Long> selectMenuListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); } @@ -162,11 +147,9 @@ * @return è·¯ç±å表 */ @Override public List<RouterVo> buildMenus(List<SysMenu> menus) { public List<RouterVo> buildMenus(List<SysMenu> menus) { List<RouterVo> routers = new LinkedList<RouterVo>(); for (SysMenu menu : menus) { for (SysMenu menu : menus) { RouterVo router = new RouterVo(); router.setHidden("1".equals(menu.getVisible())); router.setName(getRouteName(menu)); @@ -175,14 +158,11 @@ router.setQuery(menu.getQuery()); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); List<SysMenu> cMenus = menu.getChildren(); if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { router.setAlwaysShow(true); router.setRedirect("noRedirect"); router.setChildren(buildMenus(cMenus)); } else if (isMenuFrame(menu)) { } else if (isMenuFrame(menu)) { router.setMeta(null); List<RouterVo> childrenList = new ArrayList<RouterVo>(); RouterVo children = new RouterVo(); @@ -193,9 +173,7 @@ children.setQuery(menu.getQuery()); childrenList.add(children); router.setChildren(childrenList); } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) { } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) { router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); router.setPath("/"); List<RouterVo> childrenList = new ArrayList<RouterVo>(); @@ -210,6 +188,18 @@ } routers.add(router); } for (RouterVo routerVo : routers) { List<String> childName = new ArrayList<>(); List<RouterVo> childrens = routerVo.getChildren(); if (CollectionUtils.isNotEmpty(childrens)) { for (RouterVo routerVo1 : childrens) { if (!routerVo1.getHidden()) { childName.add(routerVo1.getMeta().getTitle()); } } } routerVo.setChildName(childName); } return routers; } @@ -220,22 +210,18 @@ * @return æ ç»æå表 */ @Override public List<SysMenu> buildMenuTree(List<SysMenu> menus) { public List<SysMenu> buildMenuTree(List<SysMenu> menus) { List<SysMenu> returnList = new ArrayList<SysMenu>(); List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList()); for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();) { for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext(); ) { SysMenu menu = (SysMenu) iterator.next(); // 妿æ¯é¡¶çº§èç¹, éå该ç¶èç¹çææåèç¹ if (!tempList.contains(menu.getParentId())) { if (!tempList.contains(menu.getParentId())) { recursionFn(menus, menu); returnList.add(menu); } } if (returnList.isEmpty()) { if (returnList.isEmpty()) { returnList = menus; } return returnList; @@ -248,8 +234,7 @@ * @return 䏿æ ç»æå表 */ @Override public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) { public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) { List<SysMenu> menuTrees = buildMenuTree(menus); return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); } @@ -261,8 +246,7 @@ * @return èåä¿¡æ¯ */ @Override public SysMenu selectMenuById(Long menuId) { public SysMenu selectMenuById(Long menuId) { return menuMapper.selectMenuById(menuId); } @@ -273,8 +257,7 @@ * @return ç»æ */ @Override public boolean hasChildByMenuId(Long menuId) { public boolean hasChildByMenuId(Long menuId) { int result = menuMapper.hasChildByMenuId(menuId); return result > 0; } @@ -286,8 +269,7 @@ * @return ç»æ */ @Override public boolean checkMenuExistRole(Long menuId) { public boolean checkMenuExistRole(Long menuId) { int result = roleMenuMapper.checkMenuExistRole(menuId); return result > 0; } @@ -299,8 +281,7 @@ * @return ç»æ */ @Override public int insertMenu(SysMenu menu) { public int insertMenu(SysMenu menu) { return menuMapper.insertMenu(menu); } @@ -311,8 +292,7 @@ * @return ç»æ */ @Override public int updateMenu(SysMenu menu) { public int updateMenu(SysMenu menu) { return menuMapper.updateMenu(menu); } @@ -323,8 +303,7 @@ * @return ç»æ */ @Override public int deleteMenuById(Long menuId) { public int deleteMenuById(Long menuId) { return menuMapper.deleteMenuById(menuId); } @@ -335,12 +314,10 @@ * @return ç»æ */ @Override public String checkMenuNameUnique(SysMenu menu) { public String checkMenuNameUnique(SysMenu menu) { Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) { if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -352,12 +329,10 @@ * @param menu èåä¿¡æ¯ * @return è·¯ç±åç§° */ public String getRouteName(SysMenu menu) { public String getRouteName(SysMenu menu) { String routerName = StringUtils.capitalize(menu.getPath()); // éå¤é¾å¹¶ä¸æ¯ä¸çº§ç®å½ï¼ç±»å为ç®å½ï¼ if (isMenuFrame(menu)) { if (isMenuFrame(menu)) { routerName = StringUtils.EMPTY; } return routerName; @@ -369,23 +344,18 @@ * @param menu èåä¿¡æ¯ * @return è·¯ç±å°å */ public String getRouterPath(SysMenu menu) { public String getRouterPath(SysMenu menu) { String routerPath = menu.getPath(); // å 龿å¼å¤ç½æ¹å¼ if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) { if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) { routerPath = innerLinkReplaceEach(routerPath); } // éå¤é¾å¹¶ä¸æ¯ä¸çº§ç®å½ï¼ç±»å为ç®å½ï¼ if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) && UserConstants.NO_FRAME.equals(menu.getIsFrame())) { if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) && UserConstants.NO_FRAME.equals(menu.getIsFrame())) { routerPath = "/" + menu.getPath(); } // éå¤é¾å¹¶ä¸æ¯ä¸çº§ç®å½ï¼ç±»å为èåï¼ else if (isMenuFrame(menu)) { else if (isMenuFrame(menu)) { routerPath = "/"; } return routerPath; @@ -397,19 +367,13 @@ * @param menu èåä¿¡æ¯ * @return ç»ä»¶ä¿¡æ¯ */ public String getComponent(SysMenu menu) { public String getComponent(SysMenu menu) { String component = UserConstants.LAYOUT; if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) { if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) { component = menu.getComponent(); } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) { } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) { component = UserConstants.INNER_LINK; } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) { } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) { component = UserConstants.PARENT_VIEW; } return component; @@ -421,10 +385,8 @@ * @param menu èåä¿¡æ¯ * @return ç»æ */ public boolean isMenuFrame(SysMenu menu) { return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) && menu.getIsFrame().equals(UserConstants.NO_FRAME); public boolean isMenuFrame(SysMenu menu) { return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) && menu.getIsFrame().equals(UserConstants.NO_FRAME); } /** @@ -433,8 +395,7 @@ * @param menu èåä¿¡æ¯ * @return ç»æ */ public boolean isInnerLink(SysMenu menu) { public boolean isInnerLink(SysMenu menu) { return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath()); } @@ -444,8 +405,7 @@ * @param menu èåä¿¡æ¯ * @return ç»æ */ public boolean isParentView(SysMenu menu) { public boolean isParentView(SysMenu menu) { return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); } @@ -456,15 +416,12 @@ * @param parentId ä¼ å ¥çç¶èç¹ID * @return String */ public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) { public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) { List<SysMenu> returnList = new ArrayList<SysMenu>(); for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();) { for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) { SysMenu t = (SysMenu) iterator.next(); // ä¸ãæ ¹æ®ä¼ å ¥çæä¸ªç¶èç¹ID,éå该ç¶èç¹çææåèç¹ if (t.getParentId() == parentId) { if (t.getParentId() == parentId) { recursionFn(list, t); returnList.add(t); } @@ -478,15 +435,12 @@ * @param list å类表 * @param t åèç¹ */ private void recursionFn(List<SysMenu> list, SysMenu t) { private void recursionFn(List<SysMenu> list, SysMenu t) { // å¾å°åèç¹å表 List<SysMenu> childList = getChildList(list, t); t.setChildren(childList); for (SysMenu tChild : childList) { if (hasChild(list, tChild)) { for (SysMenu tChild : childList) { if (hasChild(list, tChild)) { recursionFn(list, tChild); } } @@ -495,15 +449,12 @@ /** * å¾å°åèç¹å表 */ private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) { private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) { List<SysMenu> tlist = new ArrayList<SysMenu>(); Iterator<SysMenu> it = list.iterator(); while (it.hasNext()) { while (it.hasNext()) { SysMenu n = (SysMenu) it.next(); if (n.getParentId().longValue() == t.getMenuId().longValue()) { if (n.getParentId().longValue() == t.getMenuId().longValue()) { tlist.add(n); } } @@ -513,8 +464,7 @@ /** * 夿æ¯å¦æåèç¹ */ private boolean hasChild(List<SysMenu> list, SysMenu t) { private boolean hasChild(List<SysMenu> list, SysMenu t) { return getChildList(list, t).size() > 0; } @@ -523,9 +473,7 @@ * * @return æ¿æ¢åçå é¾åå */ public String innerLinkReplaceEach(String path) { return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." }, new String[] { "", "", "", "/" }); public String innerLinkReplaceEach(String path) { return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, "."}, new String[]{"" , "" , "" , "/"}); } } smartor/pom.xml
@@ -120,6 +120,16 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency> <dependency> <groupId>org.apache.axis</groupId> <artifactId>axis</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>org.apache.axis</groupId> <artifactId>axis-jaxrpc</artifactId> <version>1.4</version> </dependency> </dependencies> smartor/src/main/java/com/smartor/common/SendService.java
@@ -1,11 +1,15 @@ package com.smartor.common; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.ruoyi.common.utils.http.HttpUtils; import com.smartor.domain.*; import com.smartor.mapper.PatWildcardMapper; import com.smartor.service.DingTalkService; import com.smartor.service.ISmsParamService; import com.smartor.service.WeChatService; import com.smartor.service.impl.BaseSmsaccountServiceImpl; import lombok.extern.slf4j.Slf4j; @@ -36,6 +40,9 @@ @Autowired private WeChatService weChatService; @Autowired ISmsParamService iSmsParamService; public Boolean sendMsg(SendMagParam sendMagParam) { // 1,å¤åªä½ 2,纸质 3,çµè¯ 4,çä¿¡ 5.å¾®ä¿¡å ¬ä¼å· 6.微信å°ç¨åº 7.æ¯ä»å® 8.æºè½å°ç¨åº 9.éé switch (sendMagParam.getType()) { @@ -46,23 +53,25 @@ case ("3"): case ("4"): // BaseSmsRequest baseSmsRequest = new BaseSmsRequest(); // baseSmsRequest.setPhoneNumber(sendMagParam.getPhone()); // baseSmsRequest.setTemplateCode("SMS_461860582"); // SendSmsResponseBody sendSmsResponseBody = baseSmsaccountService.sendMsg(baseSmsRequest); //ä¸é¢ççä¿¡åéï¼ä» æµè¯ BaseSmsRequest baseSmsRequest = new BaseSmsRequest(); baseSmsRequest.setPhoneNumber("19157806063"); baseSmsRequest.setTemplateCode("SMS_279456451"); baseSmsRequest.setTemplateParam("{'code':'58965'}"); SendSmsResponseBody sendSmsResponseBody = baseSmsaccountService.sendMsg(baseSmsRequest); log.error(sendSmsResponseBody.message); if (sendSmsResponseBody.getCode().equals("OK")) { //çä¿¡ int i = iSmsParamService.sendSmsInfo(sendMagParam.getUrl(), sendMagParam.getPhone()); if (i == 1) { return true; } return false; case ("5"): //å ¬ä¼å· // String params = "service=smarthos.yygh.ApiService.push&idcard=" + sendMagParam.getIdcard() + "&url=" + sendMagParam.getUrl() + "&keyword1=null&keyword2=null&keyword3=null&keyword4=null"; // String result = HttpUtils.sendPost("/api", params); // JSONObject jsonObject = JSONObject.parseObject(result); // String code = (String) jsonObject.get("code"); // if (!code.equals(0)) { // log.error("å¾®ä¿¡å ¬ä¼å·æ¶æ¯åé失败äºï¼{}", sendMagParam); // return false; // } // return true; WeChatSendVo weChatSendVo = new WeChatSendVo(); weChatSendVo.setUrl(sendMagParam.getUrl()); weChatSendVo.setTemplateId(sendMagParam.getTmpCode()); smartor/src/main/java/com/smartor/domain/IvrLibaTemplate.java
@@ -342,6 +342,18 @@ private String revisitAfter; /** * åºé¢å¤©æ°ï¼é¿æä»»å¡ï¼åºå®é¢åï¼ç¬¬å 天åéä¿¡æ¯ï¼ */ @ApiModelProperty(value = "åºé¢å¤©æ°ï¼é¿æä»»å¡ï¼åºå®é¢åï¼ç¬¬å 天åéä¿¡æ¯ï¼") private Integer sendDay; /** * æ¯å¦æ¯é¿ææ¨¡æ¿ï¼ 0ï¼ä¸æ¯ 1ï¼æ¯ */ @ApiModelProperty(value = "æ¯å¦æ¯é¿ææ¨¡æ¿ï¼ 0ï¼ä¸æ¯ 1ï¼æ¯") private Integer longTemp; /** * pageNum */ @ApiModelProperty(value = "pageNum") smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java
@@ -213,7 +213,7 @@ * æ¯å¦æ¯ç¨æ·éæ©çé项 */ @ApiModelProperty(value = "æ¯å¦æ¯ç¨æ·éæ©çé项") private Boolean isUserOperation = false; private Integer isUserOperation = 0; /** * ä¸ä¸é¢ smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
@@ -93,7 +93,7 @@ * ç¬¬ä¸æ¬¡é®é¢ç¼å· */ @Excel(name = "ç¬¬ä¸æ¬¡é®é¢ç¼å·") @ApiModelProperty(value = "ç¬¬ä¸æ¬¡é®é¢ç¼å·") @ApiModelProperty(value = "ç¬¬ä¸æ¬¡é®é¢ç¼å·(åºå·)") private Long firstQuestionNum; /** @@ -337,7 +337,7 @@ private Long mateNum; /** * é访å * é访å,å¼åºç½ */ @Excel(name = "é访å") @ApiModelProperty(value = "é访å") @@ -377,4 +377,12 @@ @ApiModelProperty(value = "æå¯¼è¯") private String instruction; /** * åºé¢å¤©æ°ï¼é¿æä»»å¡ï¼åºå®é¢åï¼ç¬¬å 天åéä¿¡æ¯ï¼ */ @ApiModelProperty(value = "åºé¢å¤©æ°ï¼é¿æä»»å¡ï¼åºå®é¢åï¼ç¬¬å 天åéä¿¡æ¯ï¼") private Integer sendDay; } smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -8,6 +8,7 @@ import lombok.Data; import java.util.Date; import java.util.List; /** * éè®¿ä»»å¡æ¨¡çé®é¢è¯æ¯åºå¯¹è±¡ ivr_task_template_script @@ -56,6 +57,13 @@ @Excel(name = "é®é¢ç¹") @ApiModelProperty(value = "é®é¢ç¹") private String questionPoint; /** * è¯æ¯å 容 */ @Excel(name = "è¯æ¯å 容") @ApiModelProperty(value = "è¯æ¯å 容") private String scriptContent; /** * æ å¹é è¯æ¯ @@ -239,6 +247,12 @@ @ApiModelProperty(value = "æ¯å¦å卿ä½ï¼1 æ°å¢ 2ä¿®æ¹ 3å é¤") private Integer isoperation; /** * åºå· */ @ApiModelProperty(value = "åºå·") private Integer sort; /** * é项忝æ è¯(0:æ 忝1:æåæ¯) @@ -254,4 +268,16 @@ @ApiModelProperty(value = "é项忝çä¸ä¸ä¸ªè¯æ¯ç¼å·") private String branchNextscriptno; /** * é项忝çä¸ä¸ä¸ªè¯æ¯ç¼å· */ @Excel(name = "é项忝çä¸ä¸ä¸ªè¯æ¯ç¼å·") @ApiModelProperty(value = "é项忝çä¸ä¸ä¸ªè¯æ¯ç¼å·") private Long nextScriptno; /** * é®é¢é项 */ private List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptionList; } smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -282,6 +282,19 @@ private Integer isoperation; /** * é项忝æ è¯(0:æ 忝1:æåæ¯) */ @Excel(name = "é项忝æ è¯(0:æ 忝1:æåæ¯)") @ApiModelProperty(value = "é项忝æ è¯(0:æ 忝1:æåæ¯)") private String branchFlag; /** * åºå· */ @ApiModelProperty(value = "åºå·") private Integer sort; /** * è¯æ¯é项 */ @ApiModelProperty(value = "è¯æ¯é项") smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java
@@ -240,7 +240,7 @@ * æ¯å¦æ¯ç¨æ·éæ©çé项 */ @ApiModelProperty(value = "æ¯å¦æ¯ç¨æ·éæ©çé项") private Boolean isUserOperation = false; private Integer isUserOperation; /** * é项ç»å· smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
@@ -22,12 +22,11 @@ @ApiModel(value = "PatArchiveVO", description = "æ£è æ¡£æ¡å¯¹è±¡") @Data public class PatArchiveVO extends BaseEntity { private static final long serialVersionUID = 1L; /** * èªå¢ID */ @ApiModelProperty(value = "èªå¢ID") @ApiModelProperty("èªå¢ID") private Long id; /** @@ -45,26 +44,19 @@ private Long sex; /** * è¯ä»¶ç±»å */ @ApiModelProperty("è¯ä»¶ç±»å") @Excel(name = " è¯ä»¶ç±»å ") private String idcardtype; /** * è¯ä»¶å·ç */ @ApiModelProperty("è¯ä»¶å·ç ") @Excel(name = " è¯ä»¶å·ç ") private String idcardno; /** * çæ¥ */ @ApiModelProperty("çæ¥") @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = " çæ¥ ", width = 30, dateFormat = "yyyy-MM-dd") private Date birthdate; /** * å¹´é¾ */ @ApiModelProperty("å¹´é¾") @Excel(name = " å¹´é¾ ") private Long age; @ApiModelProperty("ç±è´¯") @Excel(name = " ç±è´¯ ") private String nativePlace; /** @@ -82,6 +74,37 @@ @Excel(name = " åºçå° ") private String birthplace; /** * è¯ä»¶å·ç */ @ApiModelProperty("è¯ä»¶å·ç ") @Excel(name = " è¯ä»¶å·ç ") private String idcardno; /** * çæ¥ */ @ApiModelProperty("çæ¥") @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = " çæ¥ " , width = 30, dateFormat = "yyyy-MM-dd") private Date birthdate; /** * å ¥é¢æ¶é´ */ @ApiModelProperty("å ¥é¢æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = " çæ¥ " , width = 30, dateFormat = "yyyy-MM-dd") private Date inhosptime; /** * å¹´é¾ */ @ApiModelProperty("å¹´é¾") @Excel(name = " å¹´é¾ ") private Long age; /** * æ¥æº */ @@ -89,9 +112,6 @@ @Excel(name = " æ¥æº ") private Long sourcefrom; /** * 建档æ¶é´ */ /** * 建档æ¶é´ */ @@ -104,6 +124,7 @@ * 建档人 */ @ApiModelProperty("建档人") @Excel(name = " 建档人 ") private String archiveby; /** @@ -113,17 +134,20 @@ @Excel(name = " ææºå·ç ") private String telcode; /** * 亲å±å·ç */ @ApiModelProperty("亲å±å·ç ") @Excel(name = " 亲å±å·ç ") private String relativetelcode; /** * è¯ä»¶ç±»å * æ°æ */ @ApiModelProperty("è¯ä»¶ç±»å") private String idcardtype; @ApiModelProperty("æ°æ") @Excel(name = " æ°æ ") private String nation; /** * æºæID @@ -136,6 +160,7 @@ * 微信openid */ @ApiModelProperty("微信openid") @Excel(name = " 微信openid ") private String openid; /** @@ -160,10 +185,54 @@ * æ ç¾ */ @ApiModelProperty("æ ç¾") @Excel(name = " æ ç¾ " , cellType = Excel.ColumnType.STRING) private String tag; /** * æ ç¾ */ @ApiModelProperty("æ ç¾id") @Excel(name = " æ ç¾id " , cellType = Excel.ColumnType.STRING) private Long tagid; @ApiModelProperty("æ ç¾éå") List<PatArchivetag> tagList = new ArrayList<>(); private List<PatArchivetag> tagList; /** * æ ç¾ */ @ApiModelProperty("æ£è ç±»å") @Excel(name = " æ£è ç±»å " , cellType = Excel.ColumnType.STRING) private String pattype; /** * ééå· */ @ApiModelProperty("ééå·") @Excel(name = " ééå· ") private String dduserid; /** * ééå· */ @ApiModelProperty("ç§å®¤") @Excel(name = " ç§å®¤ ") private String dept; /** * ééå· */ @ApiModelProperty("ç§å®¤") @Excel(name = " ç§å®¤ ") private String bedNo; /** * ä¼å屿§:0éä¼åï¼1ä¸è¬ä¼åã2éè¦ä¼å */ @ApiModelProperty("ä¼å屿§:0éä¼åï¼1ä¸è¬ä¼åã2éè¦ä¼å") @Excel(name = " ä¼å屿§:0éä¼åï¼1ä¸è¬ä¼åã2éè¦ä¼å ") private String viptype; @ApiModelProperty(value = "æ¯å¦å卿ä½ï¼1 æ°å¢ 2ä¿®æ¹ 3å é¤") private Integer isoperation; smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
@@ -256,4 +256,16 @@ @ApiModelProperty(value = "æ£è ç¼å·") private String patno; /** * ä½é¢æ è¯ï¼ 0ï¼å¨é¢ 1ï¼åºé¢ 2ï¼è½¬ç§ */ @ApiModelProperty(value = "ä½é¢æ è¯ï¼ 0ï¼å¨é¢ 1ï¼åºé¢ 2ï¼è½¬ç§") private String inhospstate; /** * é¿æä»»å¡ï¼æ¯å¦å¤çï¼0æªå¤ç 1å¤ç */ @ApiModelProperty(value = "é¿æä»»å¡ï¼æ¯å¦å¤çï¼0æªå¤ç 1å¤ç") private String checkFlag; } smartor/src/main/java/com/smartor/domain/PhoneCallBackYQVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,44 @@ package com.smartor.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * çµè¯ASRåè°(é¨ç»®) * * @author ls * @date 2024-08-8 */ @Data public class PhoneCallBackYQVO { /** * å¯ä»¥å¯¹å½åééçé³éè¿è¡éå½è°æ´,åå¼èå´ã-4,4ã */ @ApiModelProperty(value = "å¯ä»¥å¯¹å½åééçé³éè¿è¡éå½è°æ´,åå¼èå´ã-4,4ã") private Integer volume = 0; /** * å¯ä»¥è°æ´å½åéè¯çéé»åè°é´éæ¶é´ï¼åä½ä¸ºæ¯«ç§ï¼é»è®¤ä¸º3000 */ @ApiModelProperty(value = "å¯ä»¥è°æ´å½åéè¯çéé»åè°é´éæ¶é´ï¼åä½ä¸ºæ¯«ç§ï¼é»è®¤ä¸º3000") private Integer silent_interval = 5000; /** * è¿åå½åçæä½ç±»å,å ·ä½ç±»å * ç±»åå ï¼text æä½ ï¼é³ä¹ææ¾ æè¿°ï¼å½åå°ååºé³ä¹å å®¹çææ¾,æ¯æææ¬ãæ¬å°é³ä¹è·¯å¾æhttpé³ä¹è·¯å¾ï¼é³ä¹å 容æä»¶æ ¼å¼æ¯æwavåmp3 * ç±»åå ï¼hangup æä½ ï¼æææä½ æè¿°ï¼æ¤æ¶å¦ævalueåå¨å¼æ¶ï¼è¡¨ç¤ºææç»æè¯çå 容 * ç±»åå ï¼agent æä½ ï¼è½¬æ¥éè¯ æè¿°ï¼å°å½åéè¯è½¬æ¥å°äººå·¥åº§å¸ï¼valueå¼ä¸ºåº§å¸å·æå¤çº¿å·ç ï¼å¦æä¸ºå¤çº¿å·ç æ¶ï¼åéè¦è½å°çº¿è·¯æ¯æå¹¶åå¼å«ï¼å¦åå°å¼å«å¤±è´¥ã该æä½æ¯æå¨è½¬æ¥æ¶ææ¾é³ä¹ï¼å段为music,妿åå¨è¯¥å段å 容æ¶ï¼åè¡¨ç¤ºä¸ºè½¬æ¥æ¶åå¯¹ç«¯ææ¾çé³ä¹å 容 * ç±»åå ï¼answer æä½ ï¼åºçéè¯ æè¿°ï¼å¯¹éè¯æ§è¡åºçæä½ï¼äºæä½éç¨äºå¼å ¥æ¶é¦æ¬¡è¯·æ±çååº * ç±»åå ï¼breakoff æä½ ï¼ä¸æææ¾ æè¿°ï¼å¯¹å½åæ£å¨ææ¾çé³ä¹èµæºï¼æ§è¡åæ¢æä½ */ @ApiModelProperty(value = "è¿åå½åçæä½ç±»å,å ·ä½ç±»å请åèå读说æ") private String type; /** * ä¸åæä½ç±»åæå¯¹åºçåæ°å¼ */ @ApiModelProperty(value = "ä¸åæä½ç±»åæå¯¹åºçåæ°å¼") private String value; } smartor/src/main/java/com/smartor/domain/PhoneCallReqYQVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,131 @@ package com.smartor.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * çµè¯ASRåè°è¯·æ±(é¨ç»®) * * @author ls * @date 2024-08-8 */ @Data public class PhoneCallReqYQVO { @ApiModelProperty(value = "ä»»å¡ç¼å·(è¿éåå¨çå°±æ¯subtaskID)") private String taskid; // UUID @ApiModelProperty(value = "uuid") private String uuid; /** * å½åå¼å«çç®æ å·ç */ @ApiModelProperty(value = "å½åå¼å«çç®æ å·ç ") private String phone; /** * å½ååè°ç请æ±ç±»åï¼å æ¬ï¼AsrCallback: ASRææ¬åè° DtmfCallback:æ¶å°æé®åè° SilentCallback:éé»åè° PlayEvent:é³ä¹ææ¾å¼å§ãç»æäºä»¶åè° */ @ApiModelProperty(value = "å½ååè°ç请æ±ç±»åï¼å æ¬ï¼AsrCallback: ASRææ¬åè° DtmfCallback:æ¶å°æé®åè° SilentCallback:éé»åè° PlayEvent:é³ä¹ææ¾å¼å§ãç»æäºä»¶åè°") private String operate; /** * å½åå¼å«æ¶ä½¿ç¨ç夿¾å·ç */ @ApiModelProperty(value = "å½åå¼å«æ¶ä½¿ç¨ç夿¾å·ç ") private String displayno; /** * æ¯å¦å¼å ¥éè¯ */ @ApiModelProperty(value = "æ¯å¦å¼å ¥éè¯") private Boolean inbound = false; /** * æ¯å¦å¼å ¥éè¯ */ @ApiModelProperty(value = "æ¯å¦ä¸ºå¼å ¥è¯·æ±æä½") private Boolean incoming = false; /** * åé æ¶é´,å¼å ¥æ¶ä¸º0 */ @ApiModelProperty(value = "åé æ¶é´,å¼å ¥æ¶ä¸º0") private Long assigntime; /** * å¼å§æ¶é´ï¼å¦æå¼å ¥çå为å¼å ¥å¼å§æ¶é´ */ @ApiModelProperty(value = "å¼å§æ¶é´ï¼å¦æå¼å ¥çå为å¼å ¥å¼å§æ¶é´") private Long starttime; /** * åºçæ¶é´ */ @ApiModelProperty(value = "åºçæ¶é´") private Long answertime; /** * æ è¯å½åæ¯å¦ä¸ºéé»åè° */ @ApiModelProperty(value = "æ è¯å½åæ¯å¦ä¸ºéé»åè°") private Boolean silent = false; /** * æ¶å°çæé®å 容 */ @ApiModelProperty(value = "æ¶å°çæé®å 容") private String dtmf_key; /** * é³ä¹ææ¾æåæ¢æ¶ç¸å ³é³ä¹åç§° */ @ApiModelProperty(value = "é³ä¹ææ¾æåæ¢æ¶ç¸å ³é³ä¹åç§°") private String musicpath; /** * å½åå¥åçç´¢å¼å· */ @ApiModelProperty(value = "å½åå¥åçç´¢å¼å·") private Integer sent_index; /** * å½åæ¯å¦ä¸ºè¯´è¯å¼å§ */ @ApiModelProperty(value = "å½åæ¯å¦ä¸ºè¯´è¯å¼å§") private Boolean sent_begin; /** * å½åæ¶å°çASRè¯å«ææ¬ */ @ApiModelProperty(value = "å½åæ¶å°çASRè¯å«ææ¬") private String asrtext; /** * å½åasrææ¬éè¯å¼å§æ¶é´ç¹ï¼æ¯«ç§æ° */ @ApiModelProperty(value = "å½åasrææ¬éè¯å¼å§æ¶é´ç¹ï¼æ¯«ç§æ°") private Long begin_time; /** * å½åasrææ¬æå¤ç»ææ¶é´ç¹ï¼æ¯«ç§æ°ï¼å½åææ¬ä¸æ¯å¥åç»ææ¶ï¼å为-1 */ @ApiModelProperty(value = "å½åasrææ¬æå¤ç»ææ¶é´ç¹ï¼æ¯«ç§æ°ï¼å½åææ¬ä¸æ¯å¥åç»ææ¶ï¼å为-1") private Long end_time; /** * æ è¯å½åæ¯å¦ä¸ºå¥åç»æ */ @ApiModelProperty(value = "æ è¯å½åæ¯å¦ä¸ºå¥åç»æ") private Boolean send_end = false; /** * å½åå¥åçå½é³æä»¶è·¯å¾ï¼å¥åæªç»ææ¶ä¸ºç©º */ @ApiModelProperty(value = "å½åå¥åçå½é³æä»¶è·¯å¾ï¼å¥åæªç»ææ¶ä¸ºç©º") private String recordpath; } smartor/src/main/java/com/smartor/domain/PhoneRecordAccept.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,84 @@ package com.smartor.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * çµè¯ASRåè°è¯·æ±(é¨ç»®) * * @author ls * @date 2024-08-8 */ @Data public class PhoneRecordAccept { @ApiModelProperty(value = "ä»»å¡ç¼å·(è¿éåå¨çå°±æ¯subtaskID)") private String taskid; // UUID @ApiModelProperty(value = "uuid") private String uuid; /** * å½åå¼å«çç®æ å·ç */ @ApiModelProperty(value = "å½åå¼å«çç®æ å·ç ") private String phone; /** * å½åå¼å«æ¶ä½¿ç¨ç夿¾å·ç */ @ApiModelProperty(value = "å½åå¼å«æ¶ä½¿ç¨ç夿¾å·ç ") private String displayno; /** * æ©æçASRè¯å«ææ¬ */ private String early_asrtext; /** * åé æ¶é´,13ä½unixæ¶é´æ³ */ @ApiModelProperty(value = "åé æ¶é´,13ä½unixæ¶é´æ³") private Long assign_time; /** * å¼å§æ¶é´ï¼å¦æå¼å ¥çå为å¼å ¥å¼å§æ¶é´ */ @ApiModelProperty(value = "å¼å§æ¶é´ï¼å¦æå¼å ¥çå为å¼å ¥å¼å§æ¶é´") private Long start_time; /** * åºçæ¶é´ */ @ApiModelProperty(value = "åºçæ¶é´") private Long answer_time; /** * æææ¶é´ */ @ApiModelProperty(value = "æææ¶é´") private Long hangup_time; /** * ç»ææ¶é´ */ @ApiModelProperty(value = "ç»ææ¶é´") private Long end_time; /** * ææºæ¶çsip代ç å¼ */ @ApiModelProperty(value = "ææºæ¶çsip代ç å¼") private String hangup_sipcode; /** * ææºåå å符串 */ @ApiModelProperty(value = "ææºåå å符串") private String hangup_cause; } smartor/src/main/java/com/smartor/domain/PullTaskVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,71 @@ 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 java.util.ArrayList; import java.util.Date; import java.util.List; /** * é¨ç»®çµè¯ä»»å¡æå PullTaskVO * * @author ls * @date 2024-08-07 */ @Data @ApiModel(value = "PullTaskVO" , description = "é¨ç»®çµè¯ä»»å¡æå") public class PullTaskVO { /** * ä»»å¡ID */ @ApiModelProperty(value = "ä»»å¡ID") private String taskid; /** * ä»»å¡id */ @Excel(name = "æ¬ä»»å¡éè¦ææ¾çå¼åºç½") @ApiModelProperty(value = "æ¬ä»»å¡éè¦ææ¾çå¼åºç½") private String prologue; /** * å¼å«æ¶é´æ®µ,以mm-hh:mmæ ¼å¼è®¾ç½®,æå å·åéå¤ä¸ªæ¶é´æ®µ,æ¯ææææåæ®µ,1=8:00-12:30; */ @Excel(name = "å¼å«æ¶é´æ®µ,以mm-hh:mmæ ¼å¼è®¾ç½®,æå å·åéå¤ä¸ªæ¶é´æ®µ,æ¯ææææåæ®µ,1=8:00-12:30;") @ApiModelProperty(value = "å¼å«æ¶é´æ®µ,以mm-hh:mmæ ¼å¼è®¾ç½®,æå å·åéå¤ä¸ªæ¶é´æ®µ,æ¯ææææåæ®µ,1=8:00-12:30;") private String sections; /** * æ¬æ¬¡ä»»å¡æä½¿ç¨çé»è®¤å¤æ¾å·ç ï¼ç¨äºå¹é ç½å ³ */ @Excel(name = "æ¬æ¬¡ä»»å¡æä½¿ç¨çé»è®¤å¤æ¾å·ç ï¼ç¨äºå¹é ç½å ³") @ApiModelProperty(value = "æ¬æ¬¡ä»»å¡æä½¿ç¨çé»è®¤å¤æ¾å·ç ï¼ç¨äºå¹é ç½å ³") private String displayNo; /** * é¿éäºå¸å·appkeyæéç®,妿åå¨è¯¥å¼,å仿¬å°é ç½®çé¿éäºprofileä¸å¹é éæ©,妿æªè®¾ç½®æå¹é ä¸å°,å使ç¨é»è®¤ç¬¬1个å¸å· */ @Excel(name = "é¿éäºå¸å·appkeyæéç®,妿åå¨è¯¥å¼,å仿¬å°é ç½®çé¿éäºprofileä¸å¹é éæ©,妿æªè®¾ç½®æå¹é ä¸å°,å使ç¨é»è®¤ç¬¬1个å¸å·") @ApiModelProperty(value = "é¿éäºå¸å·appkeyæéç®,妿åå¨è¯¥å¼,å仿¬å°é ç½®çé¿éäºprofileä¸å¹é éæ©,妿æªè®¾ç½®æå¹é ä¸å°,å使ç¨é»è®¤ç¬¬1个å¸å·") private String appkey; /** * æ¬æ¬¡ä»»å¡éè¦å¤å¼çå·ç æ¸ åï¼èèç½å ³çå¹¶åè½åï¼å»ºè®®å·ç æ°éä¸ºå¹¶åæ°ç3~5å,妿æ¬å段类å为å符串ï¼å以åå·ä½ä¸ºå¤ä¸ªå·ç ä¹åçåé符 */ @Excel(name = "æ¬æ¬¡ä»»å¡éè¦å¤å¼çå·ç æ¸ åï¼èèç½å ³çå¹¶åè½åï¼å»ºè®®å·ç æ°éä¸ºå¹¶åæ°ç3~5å,妿æ¬å段类å为å符串ï¼å以åå·ä½ä¸ºå¤ä¸ªå·ç ä¹åçåé符") @ApiModelProperty(value = "æ¬æ¬¡ä»»å¡éè¦å¤å¼çå·ç æ¸ åï¼èèç½å ³çå¹¶åè½åï¼å»ºè®®å·ç æ°éä¸ºå¹¶åæ°ç3~5å,妿æ¬å段类å为å符串ï¼å以åå·ä½ä¸ºå¤ä¸ªå·ç ä¹åçåé符") private String phones; /** * æå®asrçurlè·¯å¾ï¼è¿ä¸ªè·¯å¾éè¦æä»¬è¿è¾¹æä¾ï¼å ¥åå¯ä»¥åèææ¡£ï¼ */ @ApiModelProperty(value = " æå®asrçurlè·¯å¾ï¼è¿ä¸ªè·¯å¾éè¦æä»¬è¿è¾¹æä¾ï¼å ¥åå¯ä»¥åèææ¡£ï¼") private String asrcallback = "http://35z1t16164.qicp.vip/smartor/serviceSubtask/phoneCallBackYQ"; } smartor/src/main/java/com/smartor/domain/SendMagParam.java
@@ -19,4 +19,6 @@ private String url; private String openid; private String idcard; } smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java
@@ -22,7 +22,9 @@ @ApiModelProperty(value = "æ£è ID") private String param2; @ApiModelProperty(value = "è¯å·ç±»å:1 é访 2 é®å·") private Integer type; // @ApiModelProperty(value = "è¯å·ç±»å:1 é访 2 é®å·") // private Integer type; @ApiModelProperty(value = "é®é¢ç»æè¯¦æ ") private List<ServiceSubtaskDetail> serviceSubtaskDetailList; } smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -17,7 +17,7 @@ */ @ApiModel(value = "ServiceSubtask", description = "åä¸é访任å¡") @Data public class ServiceSubtask extends BaseEntity { public class ServiceSubtask extends PatArchive { private static final long serialVersionUID = 1L; /** @@ -409,4 +409,11 @@ private String libtemplatename; /** * é¿æä»»å¡ï¼ç»æ£è åéçæ¶é´ */ @Excel(name = " é¿æä»»å¡ï¼ç»æ£è åéçæ¶é´") @ApiModelProperty(value = "é¿æä»»å¡ï¼ç»æ£è åéçæ¶é´") private Date longSendTime; } smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java
@@ -28,6 +28,9 @@ @ApiModelProperty(value = "åä»»å¡ID") private Long subId; @ApiModelProperty(value = "åä»»å¡ID") private Long taskid; @ApiModelProperty(value = "æ¨å·uuid") private String uuid; @@ -147,4 +150,17 @@ private String valueType; @ApiModelProperty(value = "é®é¢ç±»å") private Long scriptid; @ApiModelProperty(value = "éé¡¹çæ¡çéå ä¿¡æ¯") private String answerps; @ApiModelProperty(value = "å¯¹çæ¡çè¯è¯") private String comment; @ApiModelProperty(value = "æ£è ID") private Long patid; } smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,165 @@ 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 java.util.Date; import java.util.List; /** * è¯é³ä»»å¡å¼å«æç»å¯¹è±¡ ivr_taskcalldetail * * @author smartor * @date 2023-03-24 */ @Data @ApiModel(value = "ServiceSubtaskDetail", description = "é®é¢åçæç»") public class ServiceSubtaskDetailVO extends BaseEntity { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主é®") private String id; @ApiModelProperty(value = "åä»»å¡ID") private Long subId; @ApiModelProperty(value = "åä»»å¡ID") private Long taskid; @ApiModelProperty(value = "æ¨å·uuid") private String uuid; @ApiModelProperty(value = "çµè¯å·ç ") private String phone; @ApiModelProperty(value = "æä½äºº ") private String operate; @ApiModelProperty(value = "æ¾ç¤ºå·ç ") private String displayno; @ApiModelProperty(value = "") private Long inbound; @ApiModelProperty(value = "") private Long incoming; @ApiModelProperty(value = "") private Long assigntime; @ApiModelProperty(value = "å¼å§æ¶é´") private Long starttime; @ApiModelProperty(value = "åçæ¶é´") private Long answertime; @ApiModelProperty(value = "") private Long silent; @ApiModelProperty(value = "") private String dtmfKey; @ApiModelProperty(value = "é³ä¹è·¯å¾") private String musicpath; @ApiModelProperty(value = "åéç´¢å¼") private Long sentIndex; @ApiModelProperty(value = "åéå¼å§ç¶æ") private Long sentBegin; @ApiModelProperty(value = "åçç»æ") private String asrtext; @ApiModelProperty(value = "å¼å§æ¶é´") private Long beginTime; @ApiModelProperty(value = "ç»ææ¶é´") private Long endTime; @ApiModelProperty(value = "åéç»æç¶æ") private Long sentEnd; @ApiModelProperty(value = "æäº¤è·¯å¾") private String recordpath; @ApiModelProperty(value = "æäº¤URL") private String recordurl; @ApiModelProperty(value = "模æ¿ID") private String templateid; @ApiModelProperty(value = "模æ¿é®é¢ç¼å·") private Long templatequestionnum; @ApiModelProperty(value = "äº¤æ¢æºID") private Long switchid; @ApiModelProperty(value = "é®é¢ææ¬") private String questiontext; @ApiModelProperty(value = "é®é¢è¯é³") private String questionvoice; @ApiModelProperty(value = "ç±»å«") private String categoryname; @ApiModelProperty(value = "ææ é项") private String targetoptions; @ApiModelProperty(value = "ææ å¼ï¼æ£åå¹é çé项å¼ï¼") private String targetvalue; @ApiModelProperty(value = "éè¿æ£åè§£æçå¼") private String matchedtext; @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = " ", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty(value = "æ·»å æ¶é´") private Date addtime; @ApiModelProperty(value = "ä¸ä¼ æ è®°") private Long isupload; @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = " ä¸ä¼ æ¶é´ ", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty(value = "ä¸ä¼ æ¶é´") private Date uploadTime; @ApiModelProperty(value = "æºæID") private String orgid; @ApiModelProperty(value = "å 餿 è®°") private String delFlag; @ApiModelProperty(value = "é®é¢ç±»å") private String valueType; @ApiModelProperty(value = "é®é¢ç±»å") private Long scriptid; @ApiModelProperty(value = "éé¡¹çæ¡çéå ä¿¡æ¯") private String answerps; @ApiModelProperty(value = "å¯¹çæ¡çè¯è¯") private String comment; @ApiModelProperty(value = "æ£è ID") private Long patid; private List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions; } smartor/src/main/java/com/smartor/domain/ServiceTask.java
@@ -157,11 +157,18 @@ private Date checktime; /** * "1ï¼é访ï¼2ï¼é®å·ï¼3.宣æï¼ * ä»»å¡ç±»å:1ãçæµè¯ä¼°;2ãåºé¢é访;3ãé¨è¯é访 */ @Excel(name = "1ï¼é访ï¼2ï¼é®å·ï¼3.宣æï¼ ") @ApiModelProperty(value = "1ï¼é访ï¼2ï¼é®å·ï¼3.宣æï¼") @Excel(name = "ä»»å¡ç±»å(éç¥ãé®å·ãæºå¨äººè¯é³)") @ApiModelProperty(value = "ä»»å¡ç±»å(éç¥ãé®å·ãæºå¨äººè¯é³)") private String type; /** * æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå ³æï¼5ãå¤è¯éç¥ï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è æ¥åï¼ 8ãå ¶ä»éç¥) */ @Excel(name = "æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå ³æï¼5ãå¤è¯éç¥ï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è æ¥åï¼ 8ãå ¶ä»éç¥)") @ApiModelProperty(value = "æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå ³æï¼5ãå¤è¯éç¥ï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è æ¥åï¼ 8ãå ¶ä»éç¥)") private String serviceType; /** * ç±»ååç§° @@ -169,7 +176,6 @@ @Excel(name = "ç±»ååç§°") @ApiModelProperty(value = "ç±»ååç§°") private String typename; /** * ç±»ååç§° @@ -256,10 +262,10 @@ private String preachform; /** * åéç±»å: 1æå®æ¶é´åé 2å³å»åé * åéç±»å: 1æå®æ¶é´æ®µåé 2å³å»åé 3æ¶é´ç¹ */ @Excel(name = " åéç±»å: 1æå®æ¶é´åé 2å³å»åé ") @ApiModelProperty(value = "åéç±»å: 1æå®æ¶é´åé 2å³å»åé 3æ¶é´ç¹") @Excel(name = " åéç±»å: 1æå®æ¶é´æ®µåé 2å³å»åé 3æ¶é´ç¹") @ApiModelProperty(value = "åéç±»å: 1æå®æ¶é´æ®µåé 2å³å»åé 3æ¶é´ç¹") private Long sendType; /** @@ -289,6 +295,12 @@ private Integer pageSize; /** * pageSize */ @ApiModelProperty("æ¯å¦æ¯é¿æä»»å¡ 0ï¼ä¸æ¯ 1ï¼æ¯") private Integer longTask; /** * å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ï¼ */ @Excel(name = " å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ï¼") smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
@@ -144,9 +144,9 @@ private Date checktime; /** * 1ï¼åºé¢é访ï¼2ï¼ä½æ£éç¥ï¼3ï¼æ»¡æåº¦è°æ¥ï¼4ï¼å®£æï¼ * ä»»å¡ç±»å(éç¥ãé®å·ãæºå¨äººè¯é³) */ @Excel(name = " 1ï¼åºé¢é访ï¼2ï¼ä½æ£éç¥ï¼3ï¼æ»¡æåº¦è°æ¥ï¼4ï¼å®£æï¼ ") @Excel(name = " ä»»å¡ç±»å(éç¥ãé®å·ãæºå¨äººè¯é³) ") private String type; /** @@ -282,5 +282,12 @@ @ApiModelProperty(value = "å±ç¤ºæ¥æ") private String showDate; /** * æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå ³æï¼5ãå¤è¯éç¥ï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è æ¥åï¼ 8ãå ¶ä»éç¥) */ @Excel(name = "æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå ³æï¼5ãå¤è¯éç¥ï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è æ¥åï¼ 8ãå ¶ä»éç¥)") @ApiModelProperty(value = "æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå ³æï¼5ãå¤è¯éç¥ï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è æ¥åï¼ 8ãå ¶ä»éç¥)") private String serviceType; } smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java
@@ -88,7 +88,7 @@ */ @Excel(name = " çæ¬ ") @ApiModelProperty(value = "çæ¬") private BigDecimal version; private String version; /** * ä¸å¿åºä»£ç @@ -231,7 +231,6 @@ @ApiModelProperty(value = "ç»æè¯") private String conclusion; } smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -140,9 +140,9 @@ private String targetOptions; /** * åºç¡ææ ç±»åï¼1 é项 2 ææ¬ 3 æ°å¼ï¼ * é¢ç®ç±»å;æä¸¾ 1.åé 2å¤é 3填空 4å ¶å® */ @ApiModelProperty(value = "åºç¡ææ ç±»å 1=é项,2=ææ¬,3=æ°å¼") @ApiModelProperty(value = "é¢ç®ç±»å;æä¸¾ 1.åé 2å¤é 3填空 4å ¶å®") private String scriptType; /** smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java
@@ -90,7 +90,7 @@ */ @Excel(name = " çæ¬ ") @ApiModelProperty(value = "çæ¬") private BigDecimal version; private String version; /** * ä¸å¿åºä»£ç smartor/src/main/java/com/smartor/domain/VisitPlan.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,82 @@ 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 java.util.Date; /** * é访计å对象 visit_plan * * @author lihu * @date 2024-08-26 */ @Data @ApiModel("é访计å") public class VisitPlan extends BaseEntity { private static final long serialVersionUID = 1L; /** ä¸»é® */ @ApiModelProperty("主é®") //æ°æ®åºèªå¢æ¹æ@TableId(type = IdType.AUTO) private Long id; /** åºé¢æ¥æ */ @ApiModelProperty("åºé¢æ¥æ") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "åºé¢æ¥æ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date outHospDate; /** 计åéè®¿æ¥æ */ @ApiModelProperty("计åéè®¿æ¥æ") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "计åéè®¿æ¥æ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date planVisitDate; /** è¯é³åºç¡æ¨¡æ¿IDï¼åè®®çåºå®æ¨¡æ¿æ¾è¿ä¸ªè¡¨éï¼ */ @ApiModelProperty("è¯é³åºç¡æ¨¡æ¿IDï¼åè®®çåºå®æ¨¡æ¿æ¾è¿ä¸ªè¡¨éï¼") @Excel(name = "è¯é³åºç¡æ¨¡æ¿ID", readConverterExp = "å=è®®çåºå®æ¨¡æ¿æ¾è¿ä¸ªè¡¨é") private Long ivrLibaTemplateId; /** æ£è ID */ @ApiModelProperty("æ£è ID") @Excel(name = "æ£è ID") private Long patid; /** æ£è ææºå· */ @ApiModelProperty("æ£è ææºå·") @Excel(name = "æ£è ææºå·") private String phone; /** service_taskä¸»é® */ @ApiModelProperty("service_task主é®") @Excel(name = "service_task主é®") private Long taskId; /** åä»»å¡ID */ @ApiModelProperty("åä»»å¡ID") @Excel(name = "åä»»å¡ID") private Long subTaskId; /** 任塿¨¡æ¿ID */ @ApiModelProperty("任塿¨¡æ¿ID") @Excel(name = "任塿¨¡æ¿ID") private Long taskTemplateId; /** 0 æªæ§è¡ 1å·²æ§è¡ */ @ApiModelProperty("0 æªæ§è¡ 1å·²æ§è¡") @Excel(name = "0 æªæ§è¡ 1å·²æ§è¡") private Long isExecute; /** å ¬ä¼å·ID */ @ApiModelProperty("å ¬ä¼å·ID") @Excel(name = "å ¬ä¼å·ID") private String openid; } smartor/src/main/java/com/smartor/domain/robot/RobotScritpTemplateVO.java
@@ -1,16 +1,9 @@ package com.smartor.domain.robot; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import com.smartor.domain.PatTaskRelevance; import com.smartor.domain.TaskSendTimeVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; import java.util.List; import java.util.Map; /** smartor/src/main/java/com/smartor/mapper/SmsParamMapper.java
@@ -1,7 +1,9 @@ package com.smartor.mapper; import java.util.List; import com.smartor.domain.SmsParam; import org.apache.ibatis.annotations.Mapper; /** * çä¿¡åæ°Mapperæ¥å£ @@ -9,8 +11,8 @@ * @author smartor * @date 2023-03-06 */ public interface SmsParamMapper { @Mapper public interface SmsParamMapper { /** * æ¥è¯¢çä¿¡åæ° * smartor/src/main/java/com/smartor/service/IIvrTaskTemplateScriptService.java
@@ -1,6 +1,7 @@ package com.smartor.service; import com.smartor.domain.IvrTaskTemplateScript; import com.smartor.domain.IvrTaskTemplateScriptVO; import java.util.List; @@ -20,6 +21,8 @@ */ public IvrTaskTemplateScript selectIvrTaskTemplateScriptByID(Long ID); public IvrTaskTemplateScriptVO getTaskTempScriptInfoByid(Long ID); /** * æ¥è¯¢éè®¿ä»»å¡æ¨¡çé®é¢è¯æ¯åºå表 * smartor/src/main/java/com/smartor/service/IPatArchiveService.java
@@ -93,5 +93,5 @@ public List<Object> getUserTreatmentInfo(String pid, String type); public List<PatTaskRelevance> getPatientInfo(PatArchiveReq patArchiveReq); public List<ServiceSubtask> getPatientInfo(PatArchiveReq patArchiveReq); } smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
@@ -1,6 +1,7 @@ package com.smartor.service; import java.util.List; import com.smartor.domain.PatMedInhosp; /** @@ -9,8 +10,7 @@ * @author smartor * @date 2023-03-04 */ public interface IPatMedInhospService { public interface IPatMedInhospService { /** * æ¥è¯¢æ£è ä½é¢è®°å½ * @@ -58,4 +58,12 @@ * @return ç»æ */ public int deletePatMedInhospByInhospid(Long inhospid); /** * å¤çä»his忥çåºé¢æ°æ® * * @param * @return ç»æ */ public int dealOupHospInfo(); } smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java
@@ -77,6 +77,6 @@ */ public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq); public List<ServiceSubtaskAnswer> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq); public List<ServiceSubtaskDetailVO> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq); } smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
@@ -82,6 +82,21 @@ */ public void phoneCallBack(PhoneCallBackVO phoneCallBackVO); /** * çµè¯ASRéè¯åè°(é¨ç»®) * * @param phoneCallReqYQVO * @return ç»æ */ public PhoneCallBackYQVO phoneCallBackYQ(PhoneCallReqYQVO phoneCallReqYQVO); /** * é¨ç»®ä»»å¡æå * * @return */ public List<PullTaskVO> taskPull(); public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq); } smartor/src/main/java/com/smartor/service/ISmsParamService.java
@@ -1,6 +1,7 @@ package com.smartor.service; import java.util.List; import com.smartor.domain.SmsParam; /** @@ -9,8 +10,7 @@ * @author smartor * @date 2023-03-06 */ public interface ISmsParamService { public interface ISmsParamService { /** * æ¥è¯¢çä¿¡åæ° * @@ -58,4 +58,6 @@ * @return ç»æ */ public int deleteSmsParamByParamid(Long paramid); public int sendSmsInfo(String info,String phone); } smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
@@ -55,7 +55,7 @@ return wjSend(sendTaskVO); } else if (sendTaskVO.getTaskType() == 3) { //宣æ xjSend(sendTaskVO); return xjSend(sendTaskVO); } } return null; smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java
@@ -167,10 +167,10 @@ for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList()) { if (ivrLibaTemplateScriptVO.getIsoperation() != null) { IvrLibaTemplateScript ivrLibaTemplateScript = scriptHandle(ivrLibaTemplate, ivrLibaTemplateScriptVO, ivrLibaTemplateScriptVO.getIsoperation()); dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(),ivrLibaTemplateScriptVO.getIsoperation()); // dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(), ivrLibaTemplateScriptVO.getIsoperation()); } else { IvrLibaTemplateScript ivrLibaTemplateScript = scriptHandle(ivrLibaTemplate, ivrLibaTemplateScriptVO, ivrLibaTemplateVO.getIsoperation()); dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(),ivrLibaTemplateVO.getIsoperation()); // dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(), ivrLibaTemplateVO.getIsoperation()); } } } @@ -299,7 +299,7 @@ //éè¿è¯æ¯IDè·åé项 for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOS) { log.info("ivrLibaTemplateScriptVOç主é®id为ï¼{}", ivrLibaTemplateScriptVO.getId()); log.error("ivrLibaTemplateScriptVOç主é®id为ï¼{}" , ivrLibaTemplateScriptVO.getId()); IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption(); ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScriptVO.getId()); List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptions = ivrLibaTemplateTargetOptionMapper.selectIvrLibaTemplateTargetoptionList(ivrLibaTemplateTargetoption); @@ -324,7 +324,7 @@ } ivrLibaTemplateScriptVO.setIvrLibaScriptTargetoptionList(ivrLibaTemplateTargetoptions); } Collections.sort(ivrLibaTemplateScriptVOS, Comparator.comparing(IvrLibaTemplateScriptVO::getTargetid)); Collections.sort(ivrLibaTemplateScriptVOS, Comparator.comparing(IvrLibaTemplateScriptVO::getSort)); //æ°æ®ç»è£ templateVO.setIvrLibaTemplateTagList(ivrLibaTemplateTags); templateVO.setIvrLibaTemplateScriptVOList(ivrLibaTemplateScriptVOS); smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateScriptServiceImpl.java
@@ -1,8 +1,12 @@ package com.smartor.service.impl; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DtoConversionUtils; import com.smartor.domain.IvrTaskTemplateScript; import com.smartor.domain.IvrTaskTemplateScriptVO; import com.smartor.domain.IvrTaskTemplateTargetoption; import com.smartor.mapper.IvrTaskTemplateScriptMapper; import com.smartor.mapper.IvrTaskTemplateTargetoptionMapper; import com.smartor.service.IIvrTaskTemplateScriptService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,6 +23,8 @@ public class IvrTaskTemplateScriptServiceImpl implements IIvrTaskTemplateScriptService { @Autowired private IvrTaskTemplateScriptMapper ivrTaskTemplateScriptMapper; @Autowired private IvrTaskTemplateTargetoptionMapper ivrTaskTemplateTargetoptionMapper; /** * æ¥è¯¢éè®¿ä»»å¡æ¨¡çé®é¢è¯æ¯åº @@ -31,6 +37,17 @@ return ivrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptByID(ID); } @Override public IvrTaskTemplateScriptVO getTaskTempScriptInfoByid(Long ID) { IvrTaskTemplateScript ivrTaskTemplateScript = selectIvrTaskTemplateScriptByID(ID); IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScript, IvrTaskTemplateScriptVO.class); IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption = new IvrTaskTemplateTargetoption(); ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScriptVO.getId()); List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = ivrTaskTemplateTargetoptionMapper.selectIvrTaskTemplateTargetoptionList(ivrTaskTemplateTargetoption); ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); return ivrTaskTemplateScriptVO; } /** * æ¥è¯¢éè®¿ä»»å¡æ¨¡çé®é¢è¯æ¯åºå表 * smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -78,6 +78,10 @@ public int saveOrUpdateTempScript(IvrTaskTemplateVO ivrTaskTemplateVO) { Integer i = null; IvrTaskTemplate ivrTaskTemplate = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO, IvrTaskTemplate.class); //ä¼ è¿æ¥çé黿¶é´æ¯ç§ï¼éè¦æ¹ææ¯«ç§ if (ivrTaskTemplate.getSilencetime() != null) ivrTaskTemplate.setSilencetime(ivrTaskTemplate.getSilencetime() * 1000); if (ivrTaskTemplateVO.getIsoperation() != null && ivrTaskTemplateVO.getIsoperation() == 1) { //æ°å¢ ivrTaskTemplate.setCreateTime(new Date()); smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -189,8 +189,8 @@ * @return */ @Override public List<PatTaskRelevance> getPatientInfo(PatArchiveReq patArchiveReq) { List<PatTaskRelevance> PatTaskRelevances = new ArrayList<>(); public List<ServiceSubtask> getPatientInfo(PatArchiveReq patArchiveReq) { List<ServiceSubtask> serviceSubtaskList = new ArrayList<>(); List<PatArchive> patArchiveList = new ArrayList<>(); if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 1) { @@ -213,14 +213,15 @@ } } for (PatArchive patArchive : patArchiveList) { PatTaskRelevance patTaskRelevance = DtoConversionUtils.sourceToTarget(patArchive, PatTaskRelevance.class); patTaskRelevance.setCreateTime(patArchive.getCreateTime()); patTaskRelevance.setCreateBy(patArchive.getCreateBy()); patTaskRelevance.setDeptName(patArchive.getDept()); PatTaskRelevances.add(patTaskRelevance); ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(patArchive, ServiceSubtask.class); serviceSubtask.setCreateTime(patArchive.getCreateTime()); serviceSubtask.setCreateBy(patArchive.getCreateBy()); serviceSubtask.setDeptname(patArchive.getDept()); serviceSubtask.setPhone(patArchive.getTelcode()); serviceSubtaskList.add(serviceSubtask); } return PatTaskRelevances; return serviceSubtaskList; } smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -1,12 +1,23 @@ package com.smartor.service.impl; import java.time.LocalDate; import java.time.ZoneOffset; import java.util.ArrayList; import java.util.Date; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DtoConversionUtils; import com.ruoyi.common.utils.StringUtils; import com.smartor.domain.*; import com.smartor.mapper.*; 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.PatMedInhospMapper; import com.smartor.domain.PatMedInhosp; import com.smartor.service.IPatMedInhospService; import org.springframework.transaction.annotation.Transactional; /** * æ£è ä½é¢è®°å½Serviceä¸å¡å±å¤ç @@ -14,11 +25,31 @@ * @author smartor * @date 2023-03-04 */ @Slf4j @Service public class PatMedInhospServiceImpl implements IPatMedInhospService { public class PatMedInhospServiceImpl implements IPatMedInhospService { @Autowired private PatMedInhospMapper patMedInhospMapper; @Autowired private PatArchiveMapper patArchiveMapper; @Autowired private IvrLibaTemplateMapper ivrLibaTemplateMapper; @Autowired private IvrTaskTemplateMapper ivrTaskTemplateMapper; @Autowired private ServiceTaskMapper serviceTaskMapper; @Autowired private ServiceSubtaskMapper serviceSubtaskMapper; //è®°å½é¿æä»»å¡åºç¡ä¿¡æ¯ List<IvrLibaTemplate> libaTemplates = new ArrayList<>(); List<IvrTaskTemplate> ivrTaskTemplates = new ArrayList<>(); List<ServiceTask> serviceTaskList = new ArrayList<>(); /** * æ¥è¯¢æ£è ä½é¢è®°å½ @@ -27,8 +58,7 @@ * @return æ£è ä½é¢è®°å½ */ @Override public PatMedInhosp selectPatMedInhospByInhospid(Long inhospid) { public PatMedInhosp selectPatMedInhospByInhospid(Long inhospid) { return patMedInhospMapper.selectPatMedInhospByInhospid(inhospid); } @@ -39,8 +69,7 @@ * @return æ£è ä½é¢è®°å½ */ @Override public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp) { public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp) { return patMedInhospMapper.selectPatMedInhospList(patMedInhosp); } @@ -51,9 +80,9 @@ * @return ç»æ */ @Override public int insertPatMedInhosp(PatMedInhosp patMedInhosp) { public int insertPatMedInhosp(PatMedInhosp patMedInhosp) { patMedInhosp.setCreateTime(DateUtils.getNowDate()); patMedInhosp.setUpdateTime(DateUtils.getNowDate()); return patMedInhospMapper.insertPatMedInhosp(patMedInhosp); } @@ -64,8 +93,7 @@ * @return ç»æ */ @Override public int updatePatMedInhosp(PatMedInhosp patMedInhosp) { public int updatePatMedInhosp(PatMedInhosp patMedInhosp) { patMedInhosp.setUpdateTime(DateUtils.getNowDate()); return patMedInhospMapper.updatePatMedInhosp(patMedInhosp); } @@ -77,8 +105,7 @@ * @return ç»æ */ @Override public int deletePatMedInhospByInhospids(Long[] inhospids) { public int deletePatMedInhospByInhospids(Long[] inhospids) { return patMedInhospMapper.deletePatMedInhospByInhospids(inhospids); } @@ -89,8 +116,90 @@ * @return ç»æ */ @Override public int deletePatMedInhospByInhospid(Long inhospid) { public int deletePatMedInhospByInhospid(Long inhospid) { return patMedInhospMapper.deletePatMedInhospByInhospid(inhospid); } @Transactional(rollbackFor = Exception.class) @Override public int dealOupHospInfo() { //è·åé¿ææ¨¡æ¿ IvrLibaTemplate ivrTemp = new IvrLibaTemplate(); ivrTemp.setDelFlag("0"); ivrTemp.setLongTemp(1); List<IvrLibaTemplate> ivrLibaTemplates = ivrLibaTemplateMapper.selectIvrLibaTemplateList(ivrTemp); if (CollectionUtils.isNotEmpty(ivrLibaTemplates)) { for (IvrLibaTemplate ivrLibaTemplate : ivrLibaTemplates) { //è·åå°ä»»å¡æ¨¡æ¿ä¿¡æ¯ IvrTaskTemplate ivrTaskTemplate = new IvrTaskTemplate(); ivrTaskTemplate.setLibtemplateid(ivrLibaTemplate.getId().toString()); List<IvrTaskTemplate> ivrTaskTemplates = ivrTaskTemplateMapper.selectIvrTaskTemplateList(ivrTaskTemplate); if (CollectionUtils.isNotEmpty(ivrTaskTemplates)) { IvrTaskTemplate ivrTaskTemplate1 = ivrTaskTemplates.get(0); //éè¿ä»»å¡æ¨¡æ¿IDè·åä»»å¡ ServiceTask ServiceTask = new ServiceTask(); ServiceTask.setTemplateid(ivrTaskTemplate1.getId()); List<ServiceTask> serviceTasks = serviceTaskMapper.selectServiceTaskList(ServiceTask); if (CollectionUtils.isNotEmpty(serviceTasks)) { serviceTaskList.add(serviceTasks.get(0)); } ivrTaskTemplates.add(ivrTaskTemplate1); } libaTemplates.add(ivrLibaTemplate); } } PatMedInhosp patMedInhosp = new PatMedInhosp(); //è·åæªå¤ççæ°æ® patMedInhosp.setCheckFlag("0"); patMedInhosp.setInhospstate("1"); List<PatMedInhosp> patMedInhosps = patMedInhospMapper.selectPatMedInhospList(patMedInhosp); for (PatMedInhosp patMedInhosp1 : patMedInhosps) { PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedInhosp1.getPatid()); //éè¿icd10codeå»è·åç¸åºçivr_liba_template_id if (StringUtils.isNotEmpty(patMedInhosp1.getIcd10code())) { for (IvrLibaTemplate ivrLibaTemplate : libaTemplates) { String icdCode = patMedInhosp1.getIcd10code().split(",")[0]; if (ivrLibaTemplate.getIcd10code().equals(icdCode)) { //éè¿æ¨¡æ¿IDè·å任塿¨¡æ¿ for (IvrTaskTemplate ivrTaskTemplate : ivrTaskTemplates) { if (ivrTaskTemplate.getLibtemplateid().equals(ivrLibaTemplate.getId().toString())) { for (ServiceTask serviceTask : serviceTaskList) { if (serviceTask.getTemplateid() == ivrTaskTemplate.getId()) { //å°è¯¥æ£è ï¼æå ¥å°åä»»å¡è¡¨ä¸ ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class); serviceSubtask.setId(null); serviceSubtask.setTaskid(serviceTask.getTaskid()); serviceSubtask.setLibtemplateid(ivrLibaTemplate.getId()); serviceSubtask.setTemplateid(ivrTaskTemplate.getId()); serviceSubtask.setTemplatename(ivrLibaTemplate.getTemplateName()); serviceSubtask.setPatid(patMedInhosp1.getPatid()); serviceSubtask.setSendname(patMedInhosp1.getPatname()); serviceSubtask.setPhone(patArchive.getTelcode()); serviceSubtask.setSex(patArchive.getSex()); serviceSubtask.setAge(patArchive.getAge()); serviceSubtask.setSendstate(2L); serviceSubtask.setServiceform(serviceTask.getPreachform()); serviceSubtask.setHospType("2"); //æ£è åéæ¶é´ LocalDate currentDate = LocalDate.now(); LocalDate newDate = currentDate.plusDays(ivrTaskTemplate.getSendDay()); serviceSubtask.setLongSendTime(Date.from(newDate.atStartOfDay(ZoneOffset.ofHours(8)).toInstant())); serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); //å°check_flagæ¹æ1ï¼å·²å¤çï¼ PatMedInhosp patMedInhosp2 = new PatMedInhosp(); patMedInhosp2.setInhospid(patMedInhosp1.getInhospid()); patMedInhosp2.setCheckFlag("1"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp2); } } } } } } } } return 1; } } smartor/src/main/java/com/smartor/service/impl/PatMedInspectionServiceImpl.java
@@ -55,6 +55,7 @@ public int insertPatMedInspection(PatMedInspection patMedInspection) { patMedInspection.setCreateTime(DateUtils.getNowDate()); patMedInspection.setUpdateTime(DateUtils.getNowDate()); return patMedInspectionMapper.insertPatMedInspection(patMedInspection); } smartor/src/main/java/com/smartor/service/impl/PatMedRegistrationServiceImpl.java
@@ -55,6 +55,7 @@ public int insertPatMedRegistration(PatMedRegistration patMedRegistration) { patMedRegistration.setCreateTime(DateUtils.getNowDate()); patMedRegistration.setUpdateTime(DateUtils.getNowDate()); return patMedRegistrationMapper.insertPatMedRegistration(patMedRegistration); } smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -1,24 +1,16 @@ package com.smartor.service.impl; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DtoConversionUtils; import com.ruoyi.common.utils.RSAPublicKeyExample; import com.ruoyi.common.utils.StringUtils; import com.smartor.domain.*; import com.smartor.mapper.IvrTaskTemplateScriptMapper; import com.smartor.mapper.ServiceSubtaskAnswerMapper; import com.smartor.mapper.ServiceSubtaskMapper; import com.smartor.mapper.ServiceTaskMapper; import com.smartor.service.IIvrTaskTemplateService; import com.smartor.mapper.ServiceSubtaskDetailMapper; import com.smartor.mapper.SvyTaskTemplateTargetoptionMapper; import com.smartor.service.IServiceSubtaskAnswerService; import com.smartor.service.ISvyTaskTemplateService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; @@ -42,6 +34,12 @@ @Autowired private RedisCache redisCache; @Autowired private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper; @Autowired private SvyTaskTemplateTargetoptionMapper svyTaskTemplateTargetoptionMapper; @Value("${pri_key}") private String pri_key; @@ -120,51 +118,22 @@ if (ObjectUtils.isNotEmpty(serviceSubTaskAnswerReq)) { //éè¦ç«å³æ§è¡ RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); // Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam1(), pri_key)); // Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam2(), pri_key)); Long tid=Long.valueOf(serviceSubTaskAnswerReq.getParam1()); Long pid=Long.valueOf(serviceSubTaskAnswerReq.getParam2()); Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam1(), pri_key)); Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam2(), pri_key)); allKeys = new HashSet<>(); if (serviceSubTaskAnswerReq.getType() == 1) { allKeys.add(pid + "-" + tid + "-SFscriptCache"); } else if (serviceSubTaskAnswerReq.getType() == 2) { allKeys.add(pid + "-" + tid + "-WJscriptCache"); } } Long nextScriptno = null; for (String key : allKeys) { String[] split = key.split("-"); if (key.contains("-SFscriptCache")) { //å å«äº,说æäºæ¯é访é®é¢ List<IvrTaskTemplateScriptVO> cacheList = redisCache.getCacheObject(key); for (int i = 0; i < cacheList.size(); i++) { if (i == 0) { // è¯´ææ¯ç¬¬ä¸é¢ IvrTaskTemplateScriptVO ivrLibaTemplateScriptVO = cacheList.get(0); //å°ç¬¬ä¸é¢çä¿¡æ¯æ¾å°è¡¨ä¸ setSFInfo(ivrLibaTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0])); nextScriptno = cacheList.get(0).getNextScriptno(); } else { //䏿¯ç¬¬ ä¸ é¢ for (IvrTaskTemplateScriptVO ivrLibaTemplateScriptVO : cacheList) { if (ivrLibaTemplateScriptVO.getId() == nextScriptno) { setSFInfo(ivrLibaTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0])); nextScriptno = ivrLibaTemplateScriptVO.getNextScriptno(); } } } } } else if (key.contains("-WJscriptCache")) { if (key.contains("-WJscriptCache")) { List<SvyTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key); for (int i = 0; i < cacheList.size(); i++) { if (i == 0) { // è¯´ææ¯ç¬¬ä¸é¢ //å°ç¬¬ä¸é¢çä¿¡æ¯æ¾å°è¡¨ä¸ setWJInfo(cacheList.get(0), Long.valueOf(split[1]), Long.valueOf(split[0])); nextScriptno = Long.valueOf(cacheList.get(0).getNextScriptno()); nextScriptno = setWJInfo(cacheList.get(0), Long.valueOf(split[1]), Long.valueOf(split[0])); } else { for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) { if (svyTaskTemplateScriptVO.getId() == nextScriptno) { @@ -192,114 +161,84 @@ @Override public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq) { RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); // Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam1(), pri_key)); // Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam2(), pri_key)); Long tid=Long.valueOf(serviceSubTaskCacheReq.getParam1()); Long pid=Long.valueOf(serviceSubTaskCacheReq.getParam2()); if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getIvrTaskTemplateScriptVOList())) { //é访 redisCache.setCacheObject(pid + "-" + tid + "-SFscriptCache", serviceSubTaskCacheReq.getIvrTaskTemplateScriptVOList()); } else if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getSvyTaskTemplateScriptVOList())) { Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam1(), pri_key)); Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam2(), pri_key)); //é®å· redisCache.setCacheObject(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyTaskTemplateScriptVOList()); } return 1; } @Override public List<ServiceSubtaskAnswer> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq) { public List<ServiceSubtaskDetailVO> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq) { log.error("selectPatQuesTionResultçå ¥å为ï¼{}", serviceSubTaskQueryReq); ServiceSubtaskAnswer serviceSubtaskAnswer = new ServiceSubtaskAnswer(); serviceSubtaskAnswer.setTaskid(serviceSubTaskQueryReq.getTaskid()); serviceSubtaskAnswer.setPatId(serviceSubTaskQueryReq.getPatId()); serviceSubtaskAnswer.setScriptid(serviceSubTaskQueryReq.getScriptid()); List<ServiceSubtaskAnswer> serviceSubtaskAnswerList = serviceSubtaskAnswerMapper.selectServiceSubtaskAnswerList(serviceSubtaskAnswer); for (ServiceSubtaskAnswer serviceSubtaskAnswer1 : serviceSubtaskAnswerList) { ObjectMapper mapper = new ObjectMapper(); try { List<ServiceSubtaskOptionAnswer> serviceSubtaskOptionAnswer = mapper.readValue(serviceSubtaskAnswer1.getAnswer(), List.class); serviceSubtaskAnswer1.setOptionAnswer(serviceSubtaskOptionAnswer); } catch (JsonProcessingException e) { e.printStackTrace(); List<ServiceSubtaskDetailVO> serviceSubtaskDetailVOList = new ArrayList<>(); ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail(); serviceSubtaskDetail.setTaskid(serviceSubTaskQueryReq.getTaskid()); serviceSubtaskDetail.setPatid(serviceSubTaskQueryReq.getPatId()); serviceSubtaskDetail.setScriptid(serviceSubTaskQueryReq.getScriptid()); List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail); for (ServiceSubtaskDetail serviceSubtaskDetail1 : serviceSubtaskDetails) { ServiceSubtaskDetailVO serviceSubtaskDetailVO = DtoConversionUtils.sourceToTarget(serviceSubtaskDetail1, ServiceSubtaskDetailVO.class); SvyTaskTemplateTargetoption svyTaskTemplateTargetoption = new SvyTaskTemplateTargetoption(); svyTaskTemplateTargetoption.setScriptid(serviceSubtaskDetailVO.getScriptid()); svyTaskTemplateTargetoption.setTaskid(serviceSubtaskDetailVO.getTaskid()); List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateTargetoptionMapper.selectSvyTaskTemplateTargetoptionList(svyTaskTemplateTargetoption); serviceSubtaskDetailVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); serviceSubtaskDetailVOList.add(serviceSubtaskDetailVO); } } return serviceSubtaskAnswerList; return serviceSubtaskDetailVOList; } private void setSFInfo(IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, Long taskid, Long patid) { ServiceSubtaskAnswer serviceSubtaskAnswer = new ServiceSubtaskAnswer(); List<ServiceSubtaskOptionAnswer> answerList = new ArrayList<>(); if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getScriptType()) && ivrTaskTemplateScriptVO.getScriptType().equals("1") || StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getScriptType()) && ivrTaskTemplateScriptVO.getScriptType().equals("2")) { //1ã2为åéæå¤é for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) { //è·åç¨æ·éä¸çéé¡¹å· if (ivrTaskTemplateTargetoption.getIsUserOperation() == true) { ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer(); serviceSubtaskOptionAnswer.setId(ivrTaskTemplateTargetoption.getId()); serviceSubtaskOptionAnswer.setCode(ivrTaskTemplateTargetoption.getOptionCode()); serviceSubtaskOptionAnswer.setValue(ivrTaskTemplateTargetoption.getTargetvalue()); serviceSubtaskOptionAnswer.setAppenddesc(ivrTaskTemplateTargetoption.getAppenddesc()); answerList.add(serviceSubtaskOptionAnswer); } } } else { //éåå¤é if (CollectionUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList())) { log.error("IvrTaskScriptTargetoptionListçå¼ä¸ºï¼{}", ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()); ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer(); serviceSubtaskOptionAnswer.setId(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getId()); serviceSubtaskOptionAnswer.setCode(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getOptionCode()); serviceSubtaskOptionAnswer.setValue(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getTargetvalue()); serviceSubtaskOptionAnswer.setAppenddesc(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getAppenddesc()); answerList.add(serviceSubtaskOptionAnswer); } } //æ°æ®ä¿å serviceSubtaskAnswer.setTaskid(taskid); serviceSubtaskAnswer.setPatId(patid); serviceSubtaskAnswer.setScriptid(ivrTaskTemplateScriptVO.getId()); serviceSubtaskAnswer.setScriptType(Long.valueOf(ivrTaskTemplateScriptVO.getScriptType())); serviceSubtaskAnswer.setAnswer(JSON.toJSONString(answerList)); serviceSubtaskAnswer.setComment(null); serviceSubtaskAnswer.setCreateTime(new Date()); serviceSubtaskAnswer.setUpdateTime(new Date()); serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer); } private Long setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid) { //ä¸é¢è·³è½¬ Long nextScriptNo = null; private void setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid) { ServiceSubtaskAnswer serviceSubtaskAnswer = null; ServiceSubtaskDetailVO serviceSubtaskDetailVO = new ServiceSubtaskDetailVO(); List<ServiceSubtaskOptionAnswer> answerList = new ArrayList<>(); if (svyTaskTemplateScriptVO.getScriptType().equals("1") || svyTaskTemplateScriptVO.getScriptType().equals("2")) { //1ã2为åéæå¤é for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption : svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions()) { //å°é®é¢é项记å½ä¸æ¥ if (StringUtils.isEmpty(serviceSubtaskDetailVO.getTargetvalue())) { serviceSubtaskDetailVO.setTargetvalue(svyTaskTemplateTargetoption.getTargetvalue()); } else { serviceSubtaskDetailVO.setTargetvalue(serviceSubtaskDetailVO.getTargetvalue() + " " + svyTaskTemplateTargetoption.getTargetvalue()); } if (svyTaskTemplateTargetoption.getIsUserOperation() == true) { ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer(); serviceSubtaskOptionAnswer.setId(svyTaskTemplateTargetoption.getId()); serviceSubtaskOptionAnswer.setCode(svyTaskTemplateTargetoption.getOptionCode()); serviceSubtaskOptionAnswer.setValue(svyTaskTemplateTargetoption.getTargetvalue()); serviceSubtaskOptionAnswer.setAppenddesc(svyTaskTemplateTargetoption.getAppenddesc()); answerList.add(serviceSubtaskOptionAnswer); //å°éä¸çç»ææ¾å°asrtextä¸ if (StringUtils.isEmpty(serviceSubtaskDetailVO.getAsrtext())) { serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateTargetoption.getTargetvalue()); } else { //妿æ¯å¤éï¼çæ¡éè¦ç¨ & è¿è¡æ¼æ¥ serviceSubtaskDetailVO.setAsrtext(serviceSubtaskDetailVO.getAnswerps() + "&" + svyTaskTemplateTargetoption.getTargetvalue()); } if (svyTaskTemplateScriptVO.getScriptType().equals("1") && svyTaskTemplateScriptVO.getBranchFlag().equals("1")) { //æ¯åéï¼å¹¶ä¸æ¯æåæ¯ç nextScriptNo = svyTaskTemplateTargetoption.getNextQuestion(); } else { nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno(); } } } serviceSubtaskDetailVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions()); } else { //éåå¤é if (CollectionUtils.isNotEmpty(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions())) { ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer(); serviceSubtaskOptionAnswer.setId(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getId()); serviceSubtaskOptionAnswer.setCode(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getOptionCode()); serviceSubtaskOptionAnswer.setValue(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getTargetvalue()); serviceSubtaskOptionAnswer.setAppenddesc(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getAppenddesc()); answerList.add(serviceSubtaskOptionAnswer); serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateScriptVO.getScriptResult()); nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno(); } } serviceSubtaskAnswer.setTaskid(Long.valueOf(taskid)); serviceSubtaskAnswer.setPatId(Long.valueOf(patid)); serviceSubtaskAnswer.setScriptid(svyTaskTemplateScriptVO.getId()); serviceSubtaskAnswer.setScriptType(Long.valueOf(svyTaskTemplateScriptVO.getScriptType())); serviceSubtaskAnswer.setAnswer(JSON.toJSONString(answerList)); serviceSubtaskAnswer.setComment(null); serviceSubtaskAnswer.setCreateTime(new Date()); serviceSubtaskAnswer.setUpdateTime(new Date()); serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer); serviceSubtaskDetailVO.setTaskid(Long.valueOf(taskid)); serviceSubtaskDetailVO.setPatid(Long.valueOf(patid)); serviceSubtaskDetailVO.setScriptid(svyTaskTemplateScriptVO.getId()); serviceSubtaskDetailVO.setValueType(svyTaskTemplateScriptVO.getScriptType()); serviceSubtaskDetailVO.setAsrtext(JSON.toJSONString(answerList)); serviceSubtaskDetailVO.setComment(null); serviceSubtaskDetailVO.setCreateTime(new Date()); serviceSubtaskDetailVO.setUpdateTime(new Date()); ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class); serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail); return nextScriptNo; } } smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -12,6 +12,8 @@ import com.smartor.config.PhoneUtils; import com.smartor.domain.*; import com.smartor.mapper.*; import com.smartor.service.IIvrTaskTemplateScriptService; import com.smartor.service.IIvrTaskTemplateService; import com.smartor.service.IServiceSubtaskService; import com.smartor.service.IServiceTaskService; import lombok.extern.slf4j.Slf4j; @@ -24,10 +26,15 @@ import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; import static cn.hutool.poi.excel.sax.AttributeName.r; import static cn.hutool.poi.excel.sax.AttributeName.s; /** * åä¸ä»»å¡ï¼é访ï¼Serviceä¸å¡å±å¤ç @@ -42,7 +49,7 @@ private ServiceSubtaskMapper serviceSubtaskMapper; @Autowired private ServiceSubtaskDetailMapper ivrTaskcalldetailMapper; private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper; @Autowired private IServiceTaskService serviceTaskService; @@ -58,6 +65,11 @@ @Autowired private IvrLibaExtemplatescriptMapper ivrLibaExtemplatescriptMapper; @Autowired private IIvrTaskTemplateService ivrTaskTemplateService; @Autowired private IIvrTaskTemplateScriptService iIvrTaskTemplateScriptService; @Value("${pri_key}") private String pri_key; @@ -219,7 +231,8 @@ if (ObjectUtils.isNotEmpty(serviceTaskVO.getSendTimeslot())) serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot())); if (serviceTask.getSendState() == null) serviceTask.setSendState(1); serviceTask.setTemplateid(serviceTaskVO.getLibtemplateid()); serviceTask.setLibtemplateid(serviceTaskVO.getLibtemplateid().toString()); serviceTask.setTemplateid(serviceTaskVO.getTemplateid()); serviceTaskService.insertServiceTask(serviceTask); //å°ä»»å¡ä¿¡æ¯æ¾å°æå¡è¡¨ä¸ @@ -233,11 +246,6 @@ serviceSubtask.setSendname(patTaskRelevance.getName()); serviceSubtask.setAge(patTaskRelevance.getAge()); serviceSubtask.setSfzh(patTaskRelevance.getSfzh()); serviceSubtask.setPhone(patTaskRelevance.getPhone()); serviceSubtask.setAddr(patTaskRelevance.getAddr()); serviceSubtask.setPatid(patTaskRelevance.getPatid()); serviceSubtask.setCreateTime(DateUtils.getNowDate()); serviceSubtask.setSendstate(1L); serviceSubtask.setType(serviceTaskVO.getHospType()); serviceSubtask.setHospType(patTaskRelevance.getHospType()); serviceSubtask.setOpenid(patTaskRelevance.getOpenid()); @@ -255,15 +263,10 @@ serviceTask.setStopState(serviceTask1.getStopState() + 1); serviceTask.setTemplateid(serviceTaskVO.getLibtemplateid()); serviceTaskService.updateServiceTask(serviceTask); if (CollectionUtils.isNotEmpty(serviceTaskVO.getPatTaskRelevances())) { for (PatTaskRelevance patTaskRelevance : serviceTaskVO.getPatTaskRelevances()) { ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceSubtask.class); serviceSubtask.setSendname(patTaskRelevance.getName()); serviceSubtask.setAge(patTaskRelevance.getAge()); serviceSubtask.setSfzh(patTaskRelevance.getSfzh()); serviceSubtask.setPhone(patTaskRelevance.getPhone()); serviceSubtask.setAddr(patTaskRelevance.getAddr()); serviceSubtask.setPatid(patTaskRelevance.getPatid()); serviceSubtask.setOpenid(patTaskRelevance.getOpenid()); @@ -292,7 +295,6 @@ @Override public void phoneCallBack(PhoneCallBackVO phoneCallBackVO) { phoneCallBackVO.setTextResult(phoneCallBackVO.getTextResult().substring(0, phoneCallBackVO.getTextResult().length() - 1)); SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); @@ -335,15 +337,10 @@ if (noVoice == ivrTaskTemplateVO.getNoVoiceNum().intValue()) { //å·²ç»é®äºå¯¹åºçéæ°ï¼å°±å¤ææ¯å¦è¿æä¸ä¸é¢ if (nowQuestion.getTargetid() == IvrTaskTemplateScriptVOs.size()) { //没æä¸ä¸é¢äºï¼å°±ææçµè¯ï¼ææ¾ç»æè¯ redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); phoneUtils.ttsPlayback(ivrTaskTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); return; } else { //æä¸ä¸é¢ redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(IvrTaskTemplateScriptVOs, nowQuestion); // é®é¢ï¼ å»è°ç¨âttsåæåææ¾âæ¥å£ String date = simpleDateFormat1.format(new Date()); log.info("å»è°ç¨ttsåæåææ¾æ¥å£: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); phoneUtils.ttsPlayback(nowQuestion.getScriptContent(), phoneCallBackVO.getUuid()); @@ -376,60 +373,6 @@ Pattern pattern2 = Pattern.compile(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()); matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult()); } log.error("PCB--getQuestionTexté®é¢ä¸ºï¼{},UUIDï¼{}", nowQuestion.getScriptContent(), phoneCallBackVO.getUuid()); if (StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) { //说æå¹é æ£ç¡®äº //è¿éåºè¯¥å å¤æç±»åï¼å»åä¿®æ¹ï¼è®¾ç½®IsUserOperationæ¯åéé¢çæ¹æ³ nowQuestion.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(true); serviceTaskScriptTargetoptionMapper.updateIvrTaskTemplateTargetoption(nowQuestion.getIvrTaskScriptTargetoptionList().get(j)); //å°éé»ç½®ä¸º0 redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); //å°æ£è çåç¾åè¿è¡¨é IvrTaskVisitResult serviceTaskVisitResult = DtoConversionUtils.sourceToTarget(serviceSubtask, IvrTaskVisitResult.class); serviceTaskVisitResult.setId(null); serviceTaskVisitResult.setQuestion(nowQuestion.getScriptContent()); serviceTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult()); serviceTaskVisitResult.setCreateTime(new Date()); serviceTaskVisitResult.setOptionResult(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue()); serviceTaskVisitResultMapper.insertIvrTaskVisitResult(serviceTaskVisitResult); //å°å¹é å°çæ è¯æ¹ætrue isppd = true; //è·åä¸ä¸é¢ Long nextQuestion = nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getNextQuestion(); for (IvrTaskTemplateScriptVO script : IvrTaskTemplateScriptVOs) { if (script.getTargetid() == nextQuestion) { QuestionMessage questionMessage = new QuestionMessage(); questionMessage.setNowQuestion(script); questionMessage.setQuestionList(IvrTaskTemplateScriptVOs); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); phoneUtils.ttsPlayback(script.getScriptContent(), phoneCallBackVO.getUuid()); return; } else if (nextQuestion > IvrTaskTemplateScriptVOs.size()) { //没æä¸ä¸é¢äºï¼å°±ç»æäº String date = simpleDateFormat1.format(new Date()); log.error("没æä¸ä¸é¢äºï¼å°±ç»æäº: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); phoneUtils.ttsPlayback(ivrTaskTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } phoneUtils.hangup("", "", ivrTaskTemplateVO.getRevisitAfter(), "", "", "", "", phoneCallBackVO.getUuid()); return; } } return; } else { //没æå¹é ä¸å½åoption //Targetregex2 为falseï¼è¡¨ç¤ºå¨Targetregex2ä¸åå¨ è¯å¥ä¸çå ³é®åï¼è¿ä¸ªoptionå°±ä¸ç¨åç»§ç»å¹é äºï¼ç´æ¥å¹é ä¸ä¸ä¸ªoption continue; } } if (isppd != true) { @@ -444,8 +387,6 @@ IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(IvrTaskTemplateScriptVOs, nowQuestion); questionMessage.setQuestionList(IvrTaskTemplateScriptVOs); questionMessage.setNowQuestion(nextQuestion); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); String date = simpleDateFormat1.format(new Date()); log.info("妿ä¸ä¸é¢ä¸ºç©º.åæ°çæ°æ®è¿å,å¹¶å ä¸æè°¢è¯: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); phoneUtils.ttsPlayback(nextQuestion.getScriptContent(), phoneCallBackVO.getUuid()); @@ -454,7 +395,6 @@ //å°±å¯ä»¥ææçµè¯äº String date = simpleDateFormat1.format(new Date()); log.info("å°±å¯ä»¥ææçµè¯äº------: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); phoneUtils.ttsPlayback(ivrTaskTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); try { Thread.sleep(3000); @@ -481,39 +421,16 @@ } List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1); for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) { Matcher matcher = null; if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) { Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex()); matcher = pattern.matcher(returnQues.getContent()); pattern.matcher(returnQues.getContent()); } Matcher matcher2 = null; if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) { Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2()); matcher2 = pattern2.matcher(returnQues.getContent()); pattern2.matcher(returnQues.getContent()); } log.info("++++++++++++++++++++++++++éç¨åºæ¯å¦ä¸ºç©ºï¼selfRegex : {} , selfRegex2 : {}", ivrLibaExtemplatescript.getSelfRegex(), ivrLibaExtemplatescript.getSelfRegex2()); if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) { QuestionMessage questionMessage = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues"); IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = returnQues.getNowQuestion(); ivrTaskTemplateScriptVO.setSubmoduleText(ivrLibaExtemplatescript.getSwitchText()); ivrTaskTemplateScriptVO.setSubmoduleVoice(ivrLibaExtemplatescript.getSwitchWav()); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); if (ivrLibaExtemplatescript.getIsEnd() == 1) { //å°é®é¢ç½®ç©º IvrTaskTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion(); nowQuestion1.setScriptContent(null); nowQuestion1.setScriptVoice(null); questionMessage.setNowQuestion(nowQuestion1); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES); } //è°ç¨â15ãttsåæåææ¾ï¼ tts_playbackâå°ç»æä¼ å String date = simpleDateFormat1.format(new Date()); log.info("è°ç¨â15ãttsåæåææ¾------: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); phoneUtils.ttsPlayback(nowQuestion.getScriptContent() + ivrTaskTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid()); } break; } String date = simpleDateFormat1.format(new Date()); @@ -523,243 +440,409 @@ } } //ä¸é¢ç代ç ä¸è½å é¤ï¼ä¸é¢çæ¹æ³åªæ¯é åçµè¯ç«¯èè°ç¨çï¼ // @Override // public PhoneCallBackVO phoneCallBack(PhoneCallBackVO phoneCallBackVO) { // log.error("phoneCallBackVOçå ¥åï¼{},{},{},{},{},{},{}", phoneCallBackVO.getResultType(), phoneCallBackVO.getUuid(), phoneCallBackVO.getErrResult(), phoneCallBackVO.getTextResult(), phoneCallBackVO.getHangUpResult(), phoneCallBackVO.getEnumState(), phoneCallBackVO.getUint8()); // //è·åæ°æ® // Boolean aBoolean = redisCache.hasKey(phoneCallBackVO.getUuid()); // if (!aBoolean) { // throw new BaseException("该uuidä¸åå¨"); // } // Integer hangupValue = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "hangup"); // if (hangupValue != null && hangupValue == 1) { // //hangupValue == 1 éè®¿ç»æï¼ç´æ¥å¯ä»¥æçµè¯ // PhoneUtils phoneUtils = new PhoneUtils(); // phoneUtils.hangup(phoneCallBackVO.getUuid(), null, null, null, null, null, null, null); /** * çµè¯ASRéè¯åè°(é¨ç»®) * * @param phoneCallReqYQVO */ @Override public PhoneCallBackYQVO phoneCallBackYQ(PhoneCallReqYQVO phoneCallReqYQVO) { PhoneCallBackYQVO phoneCallBackYQVO = new PhoneCallBackYQVO(); //channel_create ééåå»ºçæ¶åï¼å¯ä»¥æ§è¡ä¸äºå ¶å®æä½ï¼è¬å¦å个çä¿¡ä¹ç±»ç; æä»¬çä¸å¡å¯ä»¥ä¸ç¨ç®¡ PlayEventCallback è¿ä¸ªæ¯ææ¾è¯é³ç,ææ¶ç¨ä¸å° End_time()= -1ænull表示å½åçasrtext䏿¯ä¸å¥å®æ´çè¯ if (phoneCallReqYQVO.getOperate().equals("channel_create") || phoneCallReqYQVO.getOperate().equals("PlayEventCallback") || phoneCallReqYQVO.getEnd_time() == null || phoneCallReqYQVO.getEnd_time() == -1) { return phoneCallBackYQVO; } //éè¿åä»»å¡IDè·åå°æ¨¡æ¿ä¿¡æ¯ ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallReqYQVO.getTaskid())); IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceSubtask.getTemplateid()); //è·å模æ¿é®é¢ IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript(); ivrTaskTemplateScript.setTemplateID(serviceSubtask.getTemplateid()); List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript); //è·åé®é¢ID å åºå· String scriptId = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid().trim() + "-" + phoneCallReqYQVO.getPhone().trim()); log.error("scriptIdæ¯å¤å°ï¼{}", scriptId); //å½åé¢çä¿¡æ¯ IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = iIvrTaskTemplateScriptService.getTaskTempScriptInfoByid(Long.valueOf(scriptId)); //夿UUIDæ¯å¦åå¨ Boolean aBoolean = redisCache.hasKey(phoneCallReqYQVO.getUuid()); if (!aBoolean) { //ç»éé»è®¾ç½®ä¸ä¸ªé»è®¤æ¬¡æ°å¨redisä¸ redisCache.setCacheObject(phoneCallReqYQVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); } if ("SilentCallback".equals(phoneCallReqYQVO.getOperate())) { //妿æ¯éé»åè° Integer num = redisCache.getCacheObject(phoneCallReqYQVO.getUuid() + "noVoice"); //夿éé»åè°æ¬¡æ°æ¯å¦å°ä¸æ¨¡æ¿è§å®çæ¬¡æ° if (num < ivrTaskTemplate.getNoVoiceNum()) { //å°ä¸çè¯,就继ç»é®æ£è phoneCallBackYQVO.setType("text"); phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue()); String scriptContent = ivrTaskTemplateScriptVO.getScriptContent(); phoneCallBackYQVO.setValue(getObject(serviceSubtask, scriptContent)); //å°é黿¬¡æ°å 1 Integer noVoiceNum = redisCache.getCacheObject(phoneCallReqYQVO.getUuid() + "noVoice"); redisCache.setCacheObject(phoneCallReqYQVO.getUuid() + "noVoice", noVoiceNum + 1, 120, TimeUnit.MINUTES); } else { log.error("é黿¬¡æ°è¾¾å°,ææçµè¯ï¼{}", num); //大ä¸çäºçè¯,ç´æ¥ææ phoneCallBackYQVO.setType("hangup"); phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue()); phoneCallBackYQVO.setValue(ivrTaskTemplate.getRevisitAfter()); //å°ç»æåå°detailä¸ ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq(); List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>(); serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate)); serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList); saveQuestionAnswerPhone(serviceSubTaskDetailReq); redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone()); } return phoneCallBackYQVO; } else if ("AsrCallback".equals(phoneCallReqYQVO.getOperate())) { //å¦ææ¯ææ¬åè° //æ ¹æ®é®é¢IDè·å该é®é¢çç±»å if (ivrTaskTemplateScriptVO.getScriptType().equals("1")) { //æ¯éæ©é¢ for (int j = 0; j < ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().size(); j++) { log.error("phoneCallReqYQVO.getAsrtext()çå¼ä¸ºï¼{}", phoneCallReqYQVO.getAsrtext()); if (StringUtils.isEmpty(phoneCallReqYQVO.getAsrtext())) { continue; } //å å« Matcher matcher = null; if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex())) { Pattern pattern = Pattern.compile(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()); matcher = pattern.matcher(phoneCallReqYQVO.getAsrtext()); } //ä¸å å« Matcher matcher2 = null; if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2())) { Pattern pattern2 = Pattern.compile(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()); matcher2 = pattern2.matcher(phoneCallReqYQVO.getAsrtext()); } if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) { //说æå¹é æ£ç¡®äº //è¿éåºè¯¥å å¤æç±»åï¼å»åä¿®æ¹ï¼è®¾ç½®IsUserOperationæ¯åéé¢çæ¹æ³ ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(1); serviceTaskScriptTargetoptionMapper.updateIvrTaskTemplateTargetoption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j)); //å°æ£è çåç¾åè¿service_subtask_detailä¸ ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq(); List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>(); ivrTaskTemplateScriptVO.setQuestionResult(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getOptiondesc()); serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate)); serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList); saveQuestionAnswerPhone(serviceSubTaskDetailReq); // // } // // Map<String, Object> map = redisCache.getCacheObject(phoneCallBackVO.getUuid()); //// ObjectMapper objectMapper = new ObjectMapper(); //// Map<String, Object> map = null; //// try { //// map = objectMapper.readValue(cacheObject, Map.class); //// } catch (JsonProcessingException e) { //// e.printStackTrace(); //// } // // ServiceSubtask ServiceSubtask = (ServiceSubtask) map.get("ServiceSubtask"); // List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOs = (List<IvrLibaTemplateScriptVO>) map.get("ivrLibaTemplateScriptVO"); // //å°uuidæ´æ°å°æ°æ®åºä¸ // ServiceSubtask.setSenduuid(phoneCallBackVO.getUuid()); // ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask); // // //è·å模æ¿ä¿¡æ¯ // IvrLibaTemplateVO ivrLibaTemplateVO = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "ivrLibaTemplateVO"); // // // //é¦å 夿resultType // if (phoneCallBackVO.getResultType() == 1) { // //å¼å«ç»ææ¥å£: 1 // if (phoneCallBackVO.getUint8() == 1) { // //å¼å«å¤±è´¥ï¼å»redisä¸è®°å½ä¸ä¸å¤±è´¥æ¬¡æ°ï¼è¿è¡å次å¼å« // Integer integer = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "uint8"); // if (integer != null) { // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "uint8", integer + 1, 120, TimeUnit.MINUTES); // } else { // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "uint8", 1, 120, TimeUnit.MINUTES); // } // // if (integer != null && integer == ServiceSubtask.getRecallcount().intValue()) { // log.info("æ 人æ¥å¬ï¼{}, {}", phoneCallBackVO.getErrResult(), phoneCallBackVO.getUuid()); // //è¿ç»æè§å®æ¬¡ï¼å¦æè¦æ²¡äººæ¥ï¼é£å°±ç»æ // ServiceSubtask.setResult(phoneCallBackVO.getErrResult()); // ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask); // redisCache.deleteObject(phoneCallBackVO.getUuid() + "uint8"); // } else if (integer != null && integer < ServiceSubtask.getRecallcount().intValue()) { // //è¿è¡éæ¨ // PhoneUtils phoneUtils = new PhoneUtils(); // phoneUtils.ob(null, null, null, null, null, null, null, ServiceSubtask.getPhone(), phoneCallBackVO.getUuid(), true); // } // } // // } else if (phoneCallBackVO.getResultType() == 2) { // //éè¯ç¶ææ´æ°æ¥å£: 2 // if (phoneCallBackVO.getEnumState() == 0) { // // 0-æ¯é // Integer integer = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "enumState"); // // if (integer != null && integer < ServiceSubtask.getRecallcount().intValue()) { // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "enumState", integer + 1, 120, TimeUnit.MINUTES); // } else if (integer == null) { // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "enumState", 1, 120, TimeUnit.MINUTES); // } else if (integer != null && integer == ServiceSubtask.getRecallcount().intValue()) { // ServiceSubtask.setResult("æ 人æ¥å¬"); // ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask); // redisCache.deleteObject(phoneCallBackVO.getUuid() + "enumState"); // } // } else if (phoneCallBackVO.getEnumState() == 2) { // //æ£è ææçµè¯ // log.info("æ£è ææçµè¯ï¼{}", phoneCallBackVO.getUuid()); // ServiceSubtask.setResult(phoneCallBackVO.getHangUpResult()); // ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask); // redisCache.deleteObject(phoneCallBackVO.getUuid() + "enumState"); // } // // // } else if (phoneCallBackVO.getResultType() == 3) { // //è¯é³è¯å«ç»æä¸æ¥æ¥å£: 3 // Integer noVoice = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "noVoice"); // QuestionMessage returnQues = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues"); // IvrLibaTemplateScriptVO nowQuestion = returnQues.getNowQuestion(); // PhoneUtils phoneUtils = new PhoneUtils(); // // if (StringUtils.isEmpty(phoneCallBackVO.getTextResult())) { // //æ åè¯ // //夿noVoiceæ¯å¦å·²ç»å°äºæå¤§å¼ // if (noVoice == ivrLibaTemplateVO.getNoVoiceNum().intValue()) { // //å·²ç»é®äºå¯¹åºçéæ°ï¼å°±å¤ææ¯å¦è¿æä¸ä¸é¢ // if (nowQuestion.getTargetid() == ivrLibaTemplateScriptVOs.size()) { // //没æä¸ä¸é¢äºï¼å°±ææçµè¯ï¼ææ¾ç»æè¯ // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); // phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); // } else { // //æä¸ä¸é¢ // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); // IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion); // // é®é¢ï¼ å»è°ç¨âttsåæåææ¾âæ¥å£ // phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); // } // } else { // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES); // //è°ç¨ivrLibaTemplateScriptVOä¸çslienceText(éé»è¯æ¯) // String slienceText = nowQuestion.getSlienceText(); // //éé»è¯æ¯ + é®é¢ï¼ å»è°ç¨âttsåæåææ¾âæ¥å£ // phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); // return new PhoneCallBackVO(); // } // // } else { // //æåè¯ï¼å¯¹åççé®é¢,è¿è¡æ£åå¹é ï¼è¿éåªé坹鿩é¢ï¼å ¶å®é¢åä¸è¡ï¼ // for (int j = 0; j < nowQuestion.getIvrLibaScriptTargetoptionList().size(); j++) { // //å å« // Matcher matcher = null; // if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex())) { // Pattern pattern = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()); // matcher = pattern.matcher(phoneCallBackVO.getTextResult()); // } // //ä¸å å« // Matcher matcher2 = null; // if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2())) { // Pattern pattern2 = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()); // 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()) { // //说æå¹é æ£ç¡®äº // //è¿éåºè¯¥å å¤æç±»åï¼å»åä¿®æ¹ï¼è®¾ç½®IsUserOperationæ¯åéé¢çæ¹æ³ // nowQuestion.getIvrLibaScriptTargetoptionList().get(j).setIsUserOperation(true); // ivrLibaScriptTargetoptionMapper.updateIvrLibaTemplateTargetoption(nowQuestion.getIvrLibaScriptTargetoptionList().get(j)); // // // //å°éé»ç½®ä¸º0 // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); // //è·åä¸ä¸é¢ // Integer nextQuestion = nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getNextQuestion(); // for (IvrLibaTemplateScriptVO script : ivrLibaTemplateScriptVOs) { // if (script.getTargetid() == nextQuestion) { // QuestionMessage questionMessage = new QuestionMessage(); // questionMessage.setNowQuestion(script); // questionMessage.setQuestionList(ivrLibaTemplateScriptVOs); // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); // break; // } // } // break; // } else { // //没æå¹é å° // Integer mateNum = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "mateNum"); // //æ å¹é 次æ°å»å¤ææ¯å¦å°æå¤§è¯¢é®æ¬¡æ°ï¼å¹¶ä¸ææçé项é½å¹é å®äº // 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); // } else { // //å°±å¯ä»¥ææçµè¯äº // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); // phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); // break; // } // } else if (mateNum < ivrLibaTemplateVO.getMateNum().intValue() && j == nowQuestion.getIvrLibaScriptTargetoptionList().size() - 1) { // //没æé®å°è§å®æ¬¡æ° // mateNum = mateNum + 1; // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", mateNum, 120, TimeUnit.MINUTES); // } // } // // } // //é项å¹é 宿åï¼éè¦åå»éè¿åºåè¿è¡å¹é 䏿¬¡ // String extemplateID = ivrLibaTemplateVO.getSubmoduleID(); // String[] split = extemplateID.split(","); // List<String> list = Arrays.asList(split); // List<Long> list1 = new ArrayList<>(); // if (StringUtils.isNotEmpty(extemplateID)) { // for (String str : list) { // list1.add(Long.valueOf(str)); // } // List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1); // for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) { // Matcher matcher = null; // if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) { // Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex()); // matcher = pattern.matcher(returnQues.getContent()); // } // // Matcher matcher2 = null; // if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) { // Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2()); // matcher2 = pattern2.matcher(returnQues.getContent()); // } // log.info("++++++++++++++++++++++++++éç¨åºæ¯å¦ä¸ºç©ºï¼selfRegex : {} , selfRegex2 : {}", ivrLibaExtemplatescript.getSelfRegex(), ivrLibaExtemplatescript.getSelfRegex2()); // if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) { // QuestionMessage questionMessage = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues"); // IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO = returnQues.getNowQuestion(); // ivrLibaTemplateScriptVO.setSubmoduleText(ivrLibaExtemplatescript.getSwitchText()); // ivrLibaTemplateScriptVO.setSubmoduleVoice(ivrLibaExtemplatescript.getSwitchWav()); // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); // if (ivrLibaExtemplatescript.getIsEnd() == 1) { // //å°é®é¢ç½®ç©º // IvrLibaTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion(); // nowQuestion1.setQuestionText(null); // nowQuestion1.setQuestionVoice(null); // questionMessage.setNowQuestion(nowQuestion1); // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); // // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES); // } // // //è°ç¨â15ãttsåæåææ¾ï¼ tts_playbackâå°ç»æä¼ å // // // } // break; // } // } // // } // } // return phoneCallBackVO; // } if (ivrTaskTemplateScriptVO.getBranchFlag().equals("1") || ivrTaskTemplateScriptVO.getBranchFlag().equals("0") && ivrTaskTemplateScriptVO.getNextScriptno() != 0) { Long nextQuestion = null; if (ivrTaskTemplateScriptVO.getBranchFlag().equals("1")) { nextQuestion = ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getNextQuestion(); } else { nextQuestion = ivrTaskTemplateScriptVO.getNextScriptno(); } for (IvrTaskTemplateScript script : ivrTaskTemplateScripts) { if (script.getSort() == nextQuestion.intValue()) { phoneCallBackYQVO.setType("text"); phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue()); String scriptContent = script.getScriptContent(); phoneCallBackYQVO.setValue(getObject(serviceSubtask, scriptContent)); //å°è¯¥æ£è çRedisä¸çé¢ç®IDï¼è¿è¡ä¿®æ¹ redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "-" + phoneCallReqYQVO.getPhone().trim(), script.getId().toString(), 120, TimeUnit.MINUTES); //å 餿 ååº redisCache.deleteObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid()); } } } else if (ivrTaskTemplateScriptVO.getBranchFlag().equals("0")) { if (ivrTaskTemplateScriptVO.getNextScriptno() == 0 || ivrTaskTemplateScriptVO.getNextScriptno() == null) { phoneCallBackYQVO.setType("hangup"); phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue()); //è®¾ç½®ç»æè¯ phoneCallBackYQVO.setValue(ivrTaskTemplate.getRevisitAfter()); Long id = serviceSubtask.getId(); Map<String, String> map = delRedisValue(null, id.toString()); redisCache.setCacheObject(map.get("cacheName"), map.get("val")); redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone()); redisCache.deleteObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid()); // return phoneCallBackYQVO; } } } else { continue; } } //齿²¡æå¹é å° if (StringUtils.isEmpty(phoneCallBackYQVO.getValue())) { Integer count = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid()); if (count != null && count >= ivrTaskTemplate.getMateNum()) { //妿countå·²ç»å¤§äºæçäºæ²¡æå¹é æ¬¡æ° if (ivrTaskTemplateScriptVO.getBranchFlag().equals("0") && ivrTaskTemplateScriptVO.getNextScriptno() == null || ivrTaskTemplateScriptVO.getBranchFlag().equals("0") && ivrTaskTemplateScriptVO.getNextScriptno() == 0 || ivrTaskTemplateScriptVO.getBranchFlag().equals("1") && ivrTaskTemplateScriptVO.getNextScriptno() == null || ivrTaskTemplateScriptVO.getBranchFlag().equals("1") && ivrTaskTemplateScriptVO.getNextScriptno() == 0) { //å¦ææ¯æåä¸éé¢ï¼æè 没æä¸ä¸é¢äºï¼å°±ç´æ¥ææº phoneCallBackYQVO.setType("hangup"); phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue()); if (StringUtils.isNotEmpty(phoneCallBackYQVO.getValue())) phoneCallBackYQVO.setValue(phoneCallBackYQVO.getValue() + ivrTaskTemplate.getRevisitAfter()); else phoneCallBackYQVO.setValue(ivrTaskTemplate.getRevisitAfter()); //å»redisä¸ï¼æè¯¥åä»»å¡IDå é¤ Long id = serviceSubtask.getId(); Map<String, String> map = delRedisValue(null, id.toString()); redisCache.setCacheObject(map.get("cacheName"), map.get("val")); redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone()); // return phoneCallBackYQVO; } else { //æ ¹æ®ivrTaskTemplateScriptVO.getNextScriptno()è·åä¸ä¸é¢è¿è¡æé® for (IvrTaskTemplateScript script : ivrTaskTemplateScripts) { if (script.getSort() == ivrTaskTemplateScriptVO.getNextScriptno().intValue()) { phoneCallBackYQVO.setType("text"); phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue()); String scriptContent = script.getScriptContent(); phoneCallBackYQVO.setValue(getObject(serviceSubtask, scriptContent)); //å°è¯¥æ£è çRedisä¸çé¢ç®IDï¼è¿è¡ä¿®æ¹ redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "-" + phoneCallReqYQVO.getPhone().trim(), script.getId().toString(), 120, TimeUnit.MINUTES); } } } } else { if (count == null) redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid(), 1, 120, TimeUnit.MINUTES); else redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid(), count + 1, 120, TimeUnit.MINUTES); phoneCallBackYQVO.setType("text"); phoneCallBackYQVO.setValue(ivrTaskTemplateScriptVO.getNoMatchText() + getObject(serviceSubtask, ivrTaskTemplateScriptVO.getScriptContent())); } } } else { //䏿¯éæ©é¢,ç´æ¥è®°å½çæ¡ï¼å°ç»æåå°detailä¸ ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq(); List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>(); serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate)); serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList); saveQuestionAnswerPhone(serviceSubTaskDetailReq); //妿éé¡¹åæ¯ä¸º1çè¯ï¼åéè¦æ ¹æ®é®é¢ä¸çnextScriptnoè¿è¡è·³è½¬ //é®ç颿²¡æè·³è½¬ if (ivrTaskTemplateScriptVO.getNextScriptno() != null || ivrTaskTemplateScriptVO.getNextScriptno() != 0) { for (IvrTaskTemplateScript ivrTaskTemplateScript1 : ivrTaskTemplateScripts) { if (ivrTaskTemplateScriptVO.getNextScriptno().intValue() == ivrTaskTemplateScript1.getSort()) { phoneCallBackYQVO.setType("text"); phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue()); String scriptContent = ivrTaskTemplateScript1.getScriptContent(); phoneCallBackYQVO.setValue(getObject(serviceSubtask, scriptContent)); redisCache.deleteObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid()); } } } else if (ivrTaskTemplateScriptVO.getNextScriptno() == null) { //没æä¸ä¸é¢äºï¼å°±ç»æäº phoneCallBackYQVO.setType("hangup"); phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue()); phoneCallBackYQVO.setValue(ivrTaskTemplate.getRevisitAfter()); //å»redisä¸ï¼æè¯¥åä»»å¡IDå é¤ Long id = serviceSubtask.getId(); redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone()); log.error("çµè¯ææ4"); } //é项å¹é 宿åï¼éè¦åå»éè¿åºåè¿è¡å¹é 䏿¬¡ String extemplateID = ivrTaskTemplate.getSubmoduleID(); String[] split = extemplateID.split(","); List<String> list = Arrays.asList(split); List<Long> list1 = new ArrayList<>(); if (StringUtils.isNotEmpty(extemplateID)) { for (String str : list) { list1.add(Long.valueOf(str)); } List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1); for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) { Matcher matcher = null; if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) { Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex()); matcher = pattern.matcher(phoneCallReqYQVO.getAsrtext()); } Matcher matcher2 = null; if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) { Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2()); matcher2 = pattern2.matcher(phoneCallReqYQVO.getAsrtext()); } if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) { //å°éç¨åºå¹é çï¼æ¾å°è¿åå¼ä¸ phoneCallBackYQVO.setValue(phoneCallBackYQVO.getValue() + ivrLibaExtemplatescript.getSwitchText()); } break; } } } } return phoneCallBackYQVO; } private String getObject(ServiceSubtask serviceSubtask, String scriptContent) { Map<String, Map<String, String>> param = getParam(serviceSubtask.getTaskid()); for (Map<String, String> map : param.values()) { for (String key : map.keySet()) { scriptContent = scriptContent.replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : ""); } } scriptContent.replace("${name}", StringUtils.isNotEmpty(serviceSubtask.getName()) ? serviceSubtask.getName() : ""); scriptContent.replace("${dzz}", StringUtils.isNotEmpty(serviceSubtask.getPlaceOfResidence()) ? serviceSubtask.getPlaceOfResidence() : ""); scriptContent.replace("${phone}", StringUtils.isNotEmpty(serviceSubtask.getTelcode()) ? serviceSubtask.getTelcode() : ""); return scriptContent; } /** * è·åä»»å¡éçéé 符 * * @param taskId * @return */ private Map<String, Map<String, String>> getParam(Long taskId) { ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(taskId); ObjectMapper objectMapper = new ObjectMapper(); Map<String, Map<String, String>> serviceTaskMap = null; try { serviceTaskMap = objectMapper.readValue(serviceTask.getTextParam(), Map.class); } catch (JsonProcessingException e) { e.printStackTrace(); } return serviceTaskMap; } private Map<String, String> delRedisValue(String cache, String id) { id = "," + id + ","; String val = ""; String cacheName = ""; Map<String, String> map = new HashMap<>(); if (StringUtils.isNotEmpty(cache)) { val = redisCache.getCacheObject(cache); if (!StringUtils.isEmpty(val)) { if (val.contains(id)) { val = val.replaceAll(id, ""); } } map.put("val", val); map.put("cacheName", cache); return map; } for (int i = 0; i < 6; i++) { val = redisCache.getCacheObject("cache-0" + i); if (!StringUtils.isEmpty(val)) { if (val.contains(id)) { val = val.replaceAll(id, ""); map.put("val", val); map.put("cacheName", "cache-0" + i); } } } return map; } /** * é¨ç»®ä»»å¡æå * * @return */ @Override public List<PullTaskVO> taskPull() { //pullTaskVOListç¨äºæ°æ®è¿å List<PullTaskVO> pullTaskVOList = new ArrayList<>(); String value0 = redisCache.getCacheObject("cache-0"); // cache-0为ç«å³åèµ·ç,å ¶å®çå æ¨è¿ if (!StringUtils.isEmpty(value0)) { pullTaskVOList = getPullTaskList(value0, "cache-0"); //å°cache-0çæ°æ®ï¼è½¬ç§»ä¸å¯¹å²cache-00ä¸ String cache00 = redisCache.getCacheObject("cache-0"); if (!StringUtils.isEmpty(cache00)) redisCache.setCacheObject("cache-0", cache00 + "," + value0); else redisCache.setCacheObject("cache-0", value0); redisCache.deleteObject("cache-0"); } else { for (int i = 1; i < 6; i++) { //ååºä»cache-1 å° cache-5ç第ä¸ä¸ªåä»»å¡ä¿¡æ¯ String value = redisCache.getCacheObject("cache-" + i); if (StringUtils.isEmpty(value)) continue; List<PullTaskVO> pullTaskVOList2 = getPullTaskList(value, "cache-" + i); if (CollectionUtils.isNotEmpty(pullTaskVOList2) && pullTaskVOList2.size() > 0) { pullTaskVOList.addAll(pullTaskVOList2); } redisCache.deleteObject("cache-" + i); } } return pullTaskVOList; } private List<PullTaskVO> getPullTaskList(String subIds, String cacheName) { //pullTaskVOListç¨äºæ°æ®è¿å List<PullTaskVO> pullTaskVOList = new ArrayList<>(); //newValue0ç¨äºä¿å没æå¤ççå ä»»å¡ String newValue0 = ""; //æ ¹æ®,è·ååä»»å¡çID String[] split = subIds.split(",,"); for (int i = 0; i < split.length; i++) { if (cacheName.equals("cache-0") && i < 5 || !cacheName.equals("cache-0") && i < 1) { PullTaskVO pullTaskVO = new PullTaskVO(); String subId = split[i].trim().replace(",", ""); ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(subId)); IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceSubtask.getTemplateid()); //éè¿ä»»å¡æ¨¡æ¿ä¸ç"ç¬¬ä¸æ¬¡é®é¢ç¼å·"è·å第ä¸ä¸ªé®é¢; IvrTaskTemplateScript ivrTaskTemplateScript = null; IvrTaskTemplateScript ivrTaskTemplateScript1 = new IvrTaskTemplateScript(); ivrTaskTemplateScript1.setTemplateID(ivrTaskTemplate.getId()); List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript1); aa: for (IvrTaskTemplateScript ivrTaskTemplateScript2 : ivrTaskTemplateScripts) { if (ivrTaskTemplate.getFirstQuestionNum() == Long.valueOf(ivrTaskTemplateScript2.getSort())) { ivrTaskTemplateScript = ivrTaskTemplateScript2; break aa; } } //妿ivrTaskTemplateScript为空ï¼ä¹å°±æ²¡æå¾ä¸æ§è¡çå¿ è¦äº if (ObjectUtils.isEmpty(ivrTaskTemplateScript)) return null; //è·åéé 符å¹é è¿åçé®é¢ String scrContent = getObject(serviceSubtask, ivrTaskTemplateScript.getScriptContent()); String kcb = ivrTaskTemplate.getRevisitBefore() + "," + scrContent; //å°è£ è¿åæ°æ® //taskId = åä»»å¡ID + é®é¢ID +é®é¢åºå· pullTaskVO.setTaskid(subId); pullTaskVO.setAppkey("ZurNHpaQLq6P55YS"); pullTaskVO.setSections(LocalTime.now().format(DateTimeFormatter.ofPattern("hh:mm")) + "-" + LocalTime.now().plusMinutes(1).format(DateTimeFormatter.ofPattern("hh:mm"))); pullTaskVO.setPhones(serviceSubtask.getPhone()); pullTaskVO.setPrologue(kcb); pullTaskVO.setDisplayNo("85129866"); pullTaskVOList.add(pullTaskVO); redisCache.setCacheObject(subId.trim() + "-" + serviceSubtask.getPhone().trim(), ivrTaskTemplateScript.getId().toString()); } else { if (StringUtils.isEmpty(newValue0)) { newValue0 = "," + split[i].trim() + ","; } else { newValue0 = newValue0 + "," + split[i].trim() + ","; } redisCache.setCacheObject(cacheName, newValue0); } } return pullTaskVOList; } @Override public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq) { int i = 0; if (StringUtils.isNotEmpty(serviceSubTaskDetailReq.getParam1())) { RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam1(), pri_key)); Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam2(), pri_key)); @@ -771,13 +854,18 @@ log.error("æ¥éäºï¼selectServiceSubtaskListæ°æ®ä¸ºç©ºäºï¼{}", ivrTaskSingle); return 0; } int i = 0; //é访 for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) { serviceSubtaskDetail.setSubId(selectServiceSubtaskList.get(0).getId()); serviceSubtaskDetail.setId(UUID.randomUUID().toString()); serviceSubtaskDetail.setCreateTime(new Date()); i = ivrTaskcalldetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail); i = serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail); } } else { for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) { serviceSubtaskDetail.setCreateTime(new Date()); i = serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail); } } return i; } @@ -793,4 +881,43 @@ return null; } private ServiceSubtaskDetail getServiceSubtaskDetail(PhoneCallReqYQVO phoneCallReqYQVO, IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, ServiceSubtask serviceSubtask, IvrTaskTemplate ivrTaskTemplate) { ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail(); serviceSubtaskDetail.setSubId(Long.valueOf(phoneCallReqYQVO.getTaskid())); serviceSubtaskDetail.setUuid(phoneCallReqYQVO.getUuid()); serviceSubtaskDetail.setPhone(phoneCallReqYQVO.getPhone()); serviceSubtaskDetail.setOperate(serviceSubtask.getCreateBy()); serviceSubtaskDetail.setDisplayno(phoneCallReqYQVO.getPhone()); serviceSubtaskDetail.setAssigntime(System.currentTimeMillis()); serviceSubtaskDetail.setStarttime(System.currentTimeMillis()); serviceSubtaskDetail.setAnswertime(System.currentTimeMillis()); serviceSubtaskDetail.setAsrtext("æ åºç"); if (StringUtils.isNotEmpty(phoneCallReqYQVO.getAsrtext())) serviceSubtaskDetail.setAsrtext(phoneCallReqYQVO.getAsrtext()); serviceSubtaskDetail.setBeginTime(System.currentTimeMillis()); serviceSubtaskDetail.setEndTime(System.currentTimeMillis()); serviceSubtaskDetail.setSentEnd(1L); serviceSubtaskDetail.setTemplateid(ivrTaskTemplate.getId().toString()); serviceSubtaskDetail.setTemplatequestionnum(ivrTaskTemplateScriptVO.getId()); serviceSubtaskDetail.setQuestiontext(ivrTaskTemplateScriptVO.getScriptContent()); serviceSubtaskDetail.setCategoryname(ivrTaskTemplateScriptVO.getScriptType()); serviceSubtaskDetail.setTargetoptions(ivrTaskTemplateScriptVO.getTargetOptions()); int i = 1; for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) { if (ivrTaskTemplateTargetoption.getIsUserOperation() == 1) { serviceSubtaskDetail.setMatchedtext(ivrTaskTemplateTargetoption.getTargetvalue()); } serviceSubtaskDetail.setTargetvalue(StringUtils.isEmpty(serviceSubtaskDetail.getTargetvalue()) ? i + ivrTaskTemplateTargetoption.getTargetvalue() : serviceSubtaskDetail.getTargetvalue() + " " + (i + 1) + ivrTaskTemplateTargetoption.getTargetvalue()); } serviceSubtaskDetail.setAddtime(new Date()); serviceSubtaskDetail.setIsupload(0L); serviceSubtaskDetail.setUploadTime(new Date()); serviceSubtaskDetail.setDelFlag("0"); serviceSubtaskDetail.setValueType(ivrTaskTemplateScriptVO.getScriptType()); return serviceSubtaskDetail; } } smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -172,7 +172,7 @@ public List sfInfo(ServiceTask serviceTask, Long patid) { //éè¿æ¨¡æ¿IDè·åé®é¢ä¿¡æ¯ IvrLibaTemplateScript ivrLibaTemplateScript = new IvrLibaTemplateScript(); ivrLibaTemplateScript.setTemplateid(serviceTask.getTemplateid()); ivrLibaTemplateScript.setTemplateid(Long.valueOf(serviceTask.getLibtemplateid())); ivrLibaTemplateScript.setDelFlag("0"); List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.selectIvrLibaTemplateScriptList(ivrLibaTemplateScript); if (CollectionUtils.isEmpty(ivrLibaTemplateScripts) || ivrLibaTemplateScripts.size() == 0) { smartor/src/main/java/com/smartor/service/impl/SmsParamServiceImpl.java
@@ -1,12 +1,18 @@ package com.smartor.service.impl; import java.util.List; import WebServiceClient.MessagingInsertLocator; import WebServiceClient.MessagingInsertSoap12Stub; import com.ruoyi.common.utils.DateUtils; import com.smartor.domain.SmsParam; import com.smartor.mapper.SmsParamMapper; import com.smartor.service.ISmsParamService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.smartor.mapper.SmsParamMapper; import com.smartor.domain.SmsParam; import com.smartor.service.ISmsParamService; import javax.xml.rpc.holders.IntHolder; import java.rmi.RemoteException; import java.util.Date; import java.util.List; /** * çä¿¡åæ°Serviceä¸å¡å±å¤ç @@ -15,8 +21,7 @@ * @date 2023-03-06 */ @Service public class SmsParamServiceImpl implements ISmsParamService { public class SmsParamServiceImpl implements ISmsParamService { @Autowired private SmsParamMapper smsParamMapper; @@ -27,8 +32,7 @@ * @return çä¿¡åæ° */ @Override public SmsParam selectSmsParamByParamid(Long paramid) { public SmsParam selectSmsParamByParamid(Long paramid) { return smsParamMapper.selectSmsParamByParamid(paramid); } @@ -39,8 +43,7 @@ * @return çä¿¡åæ° */ @Override public List<SmsParam> selectSmsParamList(SmsParam smsParam) { public List<SmsParam> selectSmsParamList(SmsParam smsParam) { return smsParamMapper.selectSmsParamList(smsParam); } @@ -51,11 +54,11 @@ * @return ç»æ */ @Override public int insertSmsParam(SmsParam smsParam) { public int insertSmsParam(SmsParam smsParam) { smsParam.setCreateTime(DateUtils.getNowDate()); return smsParamMapper.insertSmsParam(smsParam); } /** * ä¿®æ¹çä¿¡åæ° @@ -64,8 +67,7 @@ * @return ç»æ */ @Override public int updateSmsParam(SmsParam smsParam) { public int updateSmsParam(SmsParam smsParam) { smsParam.setUpdateTime(DateUtils.getNowDate()); return smsParamMapper.updateSmsParam(smsParam); } @@ -77,8 +79,7 @@ * @return ç»æ */ @Override public int deleteSmsParamByParamids(Long[] paramids) { public int deleteSmsParamByParamids(Long[] paramids) { return smsParamMapper.deleteSmsParamByParamids(paramids); } @@ -89,8 +90,25 @@ * @return ç»æ */ @Override public int deleteSmsParamByParamid(Long paramid) { public int deleteSmsParamByParamid(Long paramid) { return smsParamMapper.deleteSmsParamByParamid(paramid); } @Override public int sendSmsInfo(String info, String phone) { MessagingInsertSoap12Stub binding = null; try { binding = (MessagingInsertSoap12Stub) new MessagingInsertLocator().getMessagingInsertSoap12(); } catch (Exception e) { e.printStackTrace(); } String aa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<Request>\n" + "<operate>S001</operate>\n" + "<Sheets>\n" + "<Sheet>\n" + "<Content>" + info + "</Content>\n" + "<Mobile>" + phone + "</Mobile>\n" + "<DateTime>" + new Date() + "</DateTime>\n" + "<Type>é¢çº¦æå·</Type>\n" + "</Sheet>\n" + "</Sheets>\n" + "</Request>"; Integer integer = null; try { integer = binding.SMSMessageAccept(aa, new IntHolder(), new javax.xml.rpc.holders.StringHolder()); } catch (RemoteException e) { e.printStackTrace(); } return integer; } } smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
@@ -14,9 +14,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.*; import java.util.stream.Collectors; /** @@ -127,6 +125,13 @@ //åå°æ´ç好çâç¾ç åç§°âæ¿æ¢ libTemplates.get(i).setIcdname(icdname); } //å°é®é¢æåºå·æä¸ä¸åº Collections.sort(svyLibTemplateVOS.get(j).getSvyTemplateLibScripts(), new Comparator<SvyLibTemplateScript>() { @Override public int compare(SvyLibTemplateScript o1, SvyLibTemplateScript o2) { return Integer.compare(o1.getSort().intValue(), o2.getSort().intValue()); } }); } } smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml
@@ -145,7 +145,7 @@ <if test="tag != null">tag,</if> <if test="isAvailable != null">isAvailable,</if> <if test="reply != null">reply,</if> <if test="scriptContent != null">script_topic,</if> <if test="scriptContent != null">script_content,</if> <if test="scriptDesc != null">script_desc,</if> <if test="scriptVoice != null">script_voice,</if> <if test="noMatchText != null">nomatchtext,</if> smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml
@@ -41,12 +41,16 @@ <result property="revisitAfter" column="revisit_after"/> <result property="noVoiceNum" column="no_voice_num"/> <result property="silencetime" column="silencetime"/> <result property="sendDay" column="send_day"/> <result property="longTemp" column="long_temp"/> </resultMap> <sql id="selectIvrLibaTemplateVo"> select id, revisit_before, revisit_after, send_day, long_temp, templateName, firstQuestionNum, version, @@ -71,6 +75,8 @@ '%') </if> <if test="id != null ">and id = #{id}</if> <if test="sendDay != null ">and send_day = #{sendDay}</if> <if test="longTemp != null ">and long_temp = #{longTemp}</if> <if test="revisitAfter != null ">and revisit_after = #{revisitAfter}</if> <if test="revisitBefore != null ">and revisit_before = #{revisitBefore}</if> <if test="mateNum != null and mateNum > 0">and mate_num = #{mateNum}</if> @@ -150,6 +156,8 @@ <if test="revisitBefore != null ">revisit_before,</if> <if test="noVoiceNum != null and noVoiceNum > 0 ">no_voice_num,</if> <if test="silencetime != null ">silencetime,</if> <if test="sendDay != null ">send_day,</if> <if test="longTemp != null ">long_temp,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="templateName != null and templateName != ''">#{templateName},</if> @@ -187,7 +195,8 @@ <if test="revisitBefore != null ">#{revisitBefore},</if> <if test="noVoiceNum != null and noVoiceNum > 0">#{noVoiceNum},</if> <if test="silencetime != null ">#{silencetime},</if> <if test="sendDay != null ">#{sendDay},</if> <if test="longTemp != null ">#{longTemp},</if> </trim> </insert> @@ -229,7 +238,9 @@ <if test="revisitAfter != null ">revisit_after = #{revisitAfter},</if> <if test="revisitBefore != null ">revisit_before = #{revisitBefore},</if> <if test="noVoiceNum != null and noVoiceNum > 0 ">no_voice_num = #{noVoiceNum},</if> <if test="silencetime != null">silencetime = #{silencetime}</if> <if test="silencetime != null">silencetime = #{silencetime},</if> <if test="sendDay != null ">send_day = #{sendDay},</if> <if test="longTemp != null ">long_temp = #{longTemp},</if> </trim> where id = #{id} </update> smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
@@ -60,11 +60,14 @@ <result property="libtemplatename" column="libtemplatename"/> <result property="recallcount" column="recallcount"/> <result property="instruction" column="instruction"/> <result property="sendDay" column="send_day"/> </resultMap> <sql id="selectIvrTaskTemplateVo"> select id, taskid, send_day, recallcount, instruction, libtemplateid, @@ -86,6 +89,7 @@ <include refid="selectIvrTaskTemplateVo"/> <where> <if test="taskid != null ">and taskid = #{taskid}</if> <if test="sendDay != null ">and send_day = #{sendDay}</if> <if test="id != null ">and id = #{id}</if> <if test="taskname != null and taskname != ''">and taskname like concat('%', #{taskname}, '%')</if> <if test="targetid != null ">and targetid = #{targetid}</if> @@ -205,6 +209,7 @@ <if test="libtemplateid != null ">libtemplateid,</if> <if test="libtemplatename != null ">libtemplatename,</if> <if test="instruction != null ">instruction,</if> <if test="sendDay != null ">send_day,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="taskid != null">#{taskid},</if> @@ -261,6 +266,7 @@ <if test="libtemplateid != null ">#{libtemplateid},</if> <if test="libtemplatename != null ">#{libtemplatename},</if> <if test="instruction != null ">#{instruction},</if> <if test="sendDay != null ">#{sendDay},</if> </trim> </insert> @@ -321,6 +327,7 @@ <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if> <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> <if test="instruction != null ">instruction = #{instruction},</if> <if test="sendDay != null ">send_day = #{sendDay},</if> </trim> where id = #{id} </update> smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -40,17 +40,23 @@ <result property="questionResult" column="question_result"/> <result property="branchFlag" column="branch_flag"/> <result property="branchNextscriptno" column="branch_nextscriptno"/> <result property="nextScriptno" column="next_scriptno"/> <result property="scriptType" column="script_type"/> <result property="scriptContent" column="script_content"/> <result property="sort" column="sort"/> </resultMap> <sql id="selectIvrTaskTemplateScriptVo"> select id, taskid, sort, script_type, branch_flag, branch_nextscriptno, next_scriptno, templateID, questionPoint, script_content, noMatchText, noMatchVoice, slienceText, @@ -69,6 +75,7 @@ <include refid="selectIvrTaskTemplateScriptVo"/> <where> <if test="taskid != null ">and taskid = #{taskid}</if> <if test="sort != null ">and sort = #{sort}</if> <if test="templateID != null ">and templateID = #{templateID}</if> <if test="questionPoint != null and questionPoint != ''">and questionPoint = #{questionPoint}</if> <if test="noMatchText != null and noMatchText != ''">and noMatchText = #{noMatchText}</if> @@ -99,6 +106,8 @@ <if test="questionResult != null and questionResult != ''">and question_result = #{questionResult}</if> <if test="branchFlag != null and branchFlag != ''">and branch_flag = #{branchFlag}</if> <if test="scriptType != null and scriptType != ''">and script_type = #{scriptType}</if> <if test="scriptContent != null and scriptContent != ''">and script_content = #{scriptContent}</if> <if test="nextScriptno != null and nextScriptno != ''">and next_scriptno = #{nextScriptno}</if> <if test="branchNextscriptno != null and branchNextscriptno != ''">and branch_nextscriptno = #{branchNextscriptno} </if> @@ -149,6 +158,9 @@ <if test="branchFlag != null and branchFlag != ''">branch_flag,</if> <if test="branchNextscriptno != null and branchNextscriptno != ''">branch_nextscriptno,</if> <if test="scriptType != null and scriptType != ''">script_type,</if> <if test="scriptContent != null and scriptContent != ''">script_content,</if> <if test="sort != null ">sort,</if> <if test="nextScriptno != null and nextScriptno != ''">next_scriptno,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="taskid != null">#{taskid},</if> @@ -186,6 +198,9 @@ <if test="branchFlag != null and branchFlag != ''">#{branchFlag},</if> <if test="branchNextscriptno != null and branchNextscriptno != ''">#{branchNextscriptno},</if> <if test="scriptType != null and scriptType != ''">#{scriptType},</if> <if test="scriptContent != null and scriptContent != ''">#{scriptContent},</if> <if test="sort != null">#{sort},</if> <if test="nextScriptno != null and nextScriptno != ''">#{nextScriptno},</if> </trim> </insert> @@ -229,6 +244,9 @@ #{branchNextscriptno}, </if> <if test="scriptType != null and scriptType != ''">script_type = #{scriptType},</if> <if test="scriptContent != null and scriptContent != ''">script_content = #{scriptContent},</if> <if test="sort != null">sort = #{sort},</if> <if test="nextScriptno != null and nextScriptno != ''">next_scriptno = #{nextScriptno},</if> </trim> where id = #{id} </update> smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
@@ -38,12 +38,14 @@ <result property="nextQuestion" column="next_question"/> <result property="appenddesc" column="appenddesc"/> <result property="optionCode" column="option_code"/> <result property="isUserOperation" column="is_user_operation"/> </resultMap> <sql id="selectIvrTaskTemplateTargetoptionVo"> select id, taskid, templateID, is_user_operation, appenddesc, targetid, option_code, @@ -92,6 +94,7 @@ <if test="nextQuestion != null ">and next_question = #{nextQuestion}</if> <if test="appenddesc != null ">and appenddesc = #{appenddesc}</if> <if test="optionCode != null ">and option_code = #{optionCode}</if> <if test="isUserOperation != null ">and is_user_operation = #{isUserOperation}</if> </where> </select> @@ -137,6 +140,7 @@ <if test="nextQuestion != null">next_question,</if> <if test="appenddesc != null">appenddesc,</if> <if test="optionCode != null ">option_code,</if> <if test="isUserOperation != null ">is_user_operation,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="taskid != null">#{taskid},</if> @@ -171,6 +175,7 @@ <if test="nextQuestion != null">#{nextQuestion},</if> <if test="appenddesc != null">#{appenddesc},</if> <if test="optionCode != null ">#{optionCode},</if> <if test="isUserOperation != null ">#{isUserOperation},</if> </trim> </insert> @@ -209,6 +214,8 @@ <if test="nextQuestion != null">next_question = #{nextQuestion},</if> <if test="appenddesc != null">appenddesc = #{appenddesc},</if> <if test="optionCode != null ">option_code = #{optionCode},</if> <if test="isUserOperation != null ">is_user_operation = #{isUserOperation},</if> </trim> where id = #{id} </update> smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -81,6 +81,7 @@ <if test="isupload != null ">and isupload = #{isupload}</if> <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> <if test="viptype != null ">and viptype = #{viptype}</if> <if test="pattype != null ">and pattype = #{pattype}</if> </where> </select> @@ -271,6 +272,7 @@ </if> </where> order by a.update_time desc </select> @@ -359,6 +361,7 @@ AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) </if> </where> order by a.update_time desc </select> <select id="selectPatArchiveInfoByOuthosp" parameterType="com.smartor.domain.PatArchiveReq" @@ -431,6 +434,7 @@ AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) </if> </where> order by a.update_time desc </select> <select id="selectPatArchiveInfoByPhysical" parameterType="com.smartor.domain.PatArchiveReq" @@ -504,7 +508,7 @@ AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) </if> </where> order by a.update_time desc </select> </mapper> smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -46,10 +46,12 @@ <result property="schemetime" column="schemetime" /> <result property="patname" column="patname" /> <result property="patno" column="patno" /> <result property="inhospstate" column="inhospstate" /> <result property="checkFlag" column="check_flag" /> </resultMap> <sql id="selectPatMedInhospVo"> select inhospid,inhospno, serialnum, hospitalname, hospitalcode, hospitaldistrictcode, hospitaldistrictname, icd10code, diagname, starttime, endtime, deptcode, deptname, roomno, bed_no, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, patid, leavediagname, leaveicd10code, drcode, drname, schemestatus, generalschemestatus, leaveldeptcode, leaveldeptname, hospitaldistrictid, leavehospitaldistrictcode, leavehospitaldistrictname, leavehospitaldistrictid, deptid, leaveldeptid, schemetime from pat_med_inhosp select inhospid,patname,check_flag,inhospstate,patno,inhospno, serialnum, hospitalname, hospitalcode, hospitaldistrictcode, hospitaldistrictname, icd10code, diagname, starttime, endtime, deptcode, deptname, roomno, bed_no, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, patid, leavediagname, leaveicd10code, drcode, drname, schemestatus, generalschemestatus, leaveldeptcode, leaveldeptname, hospitaldistrictid, leavehospitaldistrictcode, leavehospitaldistrictname, leavehospitaldistrictid, deptid, leaveldeptid, schemetime from pat_med_inhosp </sql> <select id="selectPatMedInhospList" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult"> @@ -60,11 +62,15 @@ <if test="hospitaldistrictname != null and hospitaldistrictname != ''"> and hospitaldistrictname like concat('%', #{hospitaldistrictname}, '%')</if> <if test="endtime != null "> and endtime = #{endtime}</if> <if test="patno != null "> and patno = #{patno}</if> <if test="checkFlag != null "> and check_flag = #{checkFlag}</if> <if test="inhospstate != null "> and inhospstate = #{inhospstate}</if> <if test="schemestatus != null "> and schemestatus = #{schemestatus}</if> <if test="leavediagname != null and leavediagname != ''"> and leavediagname like concat('%', #{leavediagname}, '%')</if> <if test="drname != null and drname != ''"> and drname like concat('%', #{drname}, '%')</if> <if test="leaveldeptname != null and leaveldeptname != ''"> and leaveldeptname like concat('%', #{leaveldeptname}, '%')</if> <if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''"> and leavehospitaldistrictname like concat('%', #{leavehospitaldistrictname}, '%')</if> </where> order by update_time desc </select> <select id="selectPatMedInhospByInhospid" parameterType="Long" resultMap="PatMedInhospResult"> @@ -114,6 +120,8 @@ <if test="schemetime != null">schemetime,</if> <if test="patname!= null">patname,</if> <if test="patno != null">patno,</if> <if test="inhospstate != null">inhospstate,</if> <if test="checkFlag != null">check_flag,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="serialnum != null">#{serialnum},</if> @@ -155,6 +163,8 @@ <if test="schemetime != null">#{schemetime},</if> <if test="patname!= null">#{patname},</if> <if test="patno != null">#{patno},</if> <if test="inhospstate != null">#{inhospstate},</if> <if test="checkFlag != null">#{checkFlag},</if> </trim> </insert> @@ -200,6 +210,8 @@ <if test="schemetime != null">schemetime = #{schemetime},</if> <if test="patname!= null">patname = #{patname},</if> <if test="patno != null">patno = #{patno},</if> <if test="inhospstate != null">inhospstate = #{inhospstate},</if> <if test="checkFlag != null">check_flag = #{checkFlag},</if> </trim> where inhospid = #{inhospid} </update> smartor/src/main/resources/mapper/smartor/PatMedInspectionMapper.xml
@@ -99,6 +99,7 @@ <if test="deptname != null and deptname != ''">and deptname like concat('%', #{deptname}, '%')</if> <if test="deptid != null ">and deptid = #{deptid}</if> </where> order by update_time desc </select> <select id="selectPatMedInspectionById" parameterType="Long" resultMap="PatMedInspectionResult"> smartor/src/main/resources/mapper/smartor/PatMedRegistrationMapper.xml
@@ -84,6 +84,7 @@ <if test="pid != null ">and pid = #{pid}</if> <if test="guid != null and guid != ''">and guid = #{guid}</if> </where> order by create_time desc </select> <select id="selectPatMedRegistrationByRegistid" parameterType="Long" resultMap="PatMedRegistrationResult"> smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -7,6 +7,7 @@ <resultMap type="com.smartor.domain.ServiceSubtaskDetail" id="ServiceSubtaskDetailResult"> <result property="id" column="id"/> <result property="subId" column="sub_id"/> <result property="taskid" column="taskid"/> <result property="uuid" column="uuid"/> <result property="phone" column="phone"/> <result property="operate" column="operate"/> @@ -46,11 +47,20 @@ <result property="updateTime" column="update_time"/> <result property="createBy" column="create_by"/> <result property="valueType" column="value_type"/> <result property="scriptid" column="scriptid"/> <result property="answerps" column="answerps"/> <result property="comment" column="comment"/> <result property="patid" column="patid"/> </resultMap> <sql id="selectServiceSubtaskDetailVo"> select id, sub_id, answerps, scriptid, comment, patid, taskid, uuid, phone, operate, @@ -90,7 +100,7 @@ update_time, value_type, create_by from ivr_taskcalldetail from service_subtask_detail </sql> <select id="selectServiceSubtaskDetailList" parameterType="com.smartor.domain.ServiceSubtaskDetail" @@ -98,6 +108,7 @@ <include refid="selectServiceSubtaskDetailVo"/> <where> <if test="subId != null">and sub_id = #{subId}</if> <if test="taskid != null">and taskid = #{taskid}</if> <if test="uuid != null and uuid != ''">and uuid = #{uuid}</if> <if test="phone != null and phone != ''">and phone = #{phone}</if> <if test="operate != null and operate != ''">and operate = #{operate}</if> @@ -134,6 +145,10 @@ <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> <if test="answerps != null and answerps != ''">and answerps = #{answerps}</if> <if test="comment != null and comment != ''">and comment = #{comment}</if> <if test="scriptid != null ">and scriptid = #{scriptid}</if> <if test=" patid != null">and patid = #{patid}</if> </where> </select> @@ -143,10 +158,11 @@ </select> <insert id="insertServiceSubtaskDetail" parameterType="com.smartor.domain.ServiceSubtaskDetail"> insert into ivr_taskcalldetail insert into service_subtask_detail <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="subId != null">sub_id,</if> <if test="taskid != null">taskid,</if> <if test="uuid != null">uuid,</if> <if test="phone != null">phone,</if> <if test="operate != null">operate,</if> @@ -186,10 +202,15 @@ <if test="updateTime != null">update_time,</if> <if test="createBy != null">create_by,</if> <if test="valueType != null">value_type,</if> <if test="answerps != null and answerps != ''">answerps,</if> <if test="comment != null and comment != ''">comment,</if> <if test="scriptid != null ">scriptid,</if> <if test=" patid != null">patid,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="subId != null">#{subId},</if> <if test="taskid != null">#{taskid},</if> <if test="uuid != null">#{uuid},</if> <if test="phone != null">#{phone},</if> <if test="operate != null">#{operate},</if> @@ -229,13 +250,18 @@ <if test="updateTime != null">#{updateTime},</if> <if test="createBy != null">#{createBy},</if> <if test="valueType != null">#{valueType},</if> <if test="answerps != null and answerps != ''">#{answerps},</if> <if test="comment != null and comment != ''">#{comment},</if> <if test="scriptid != null ">#{scriptid},</if> <if test=" patid != null">#{patid},</if> </trim> </insert> <update id="updateServiceSubtaskDetail" parameterType="com.smartor.domain.ServiceSubtaskDetail"> update ivr_taskcalldetail update service_subtask_detail <trim prefix="SET" suffixOverrides=","> <if test="subId != null">sub_id = #{subId},</if> <if test="taskid != null">taskid = #{taskid},</if> <if test="uuid != null">uuid = #{uuid},</if> <if test="phone != null">phone = #{phone},</if> <if test="operate != null">operate = #{operate},</if> @@ -275,18 +301,22 @@ <if test="updateTime != null">update_time = #{updateTime},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="valueType != null">value_type = #{valueType},</if> <if test="answerps != null and answerps != ''">answerps = #{answerps},</if> <if test="comment != null and comment != ''">comment = #{comment},</if> <if test="scriptid != null ">scriptid = #{scriptid},</if> <if test=" patid != null">patid = #{patid},</if> </trim> where id = #{id} </update> <delete id="deleteServiceSubtaskDetailByCalldetailid" parameterType="String"> delete from ivr_taskcalldetail from service_subtask_detail where id = #{id} </delete> <delete id="deleteServiceSubtaskDetailByCalldetailids" parameterType="String"> delete from ivr_taskcalldetail where id in delete from service_subtask_detail where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -55,11 +55,13 @@ <result property="libtemplatename" column="libtemplatename"/> <result property="libtemplateid" column="libtemplateid"/> <result property="openid" column="openid"/> <result property="longSendTime" column="long_send_time"/> </resultMap> <sql id="selectServiceSubtaskVo"> select id, hosp_type, long_send_time, openid, libtemplateid, libtemplatename, @@ -112,7 +114,8 @@ from service_subtask </sql> <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask" resultMap="ServiceSubtaskResult"> <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask" resultMap="ServiceSubtaskResult"> <include refid="selectServiceSubtaskVo"/> <where> del_flag=0 @@ -152,9 +155,11 @@ <if test="operatorNo != null and operatorNo != ''">and operator_no = #{operatorNo}</if> <if test="wechat != null and wechat != ''">and wechat = #{wechat}</if> <if test="hospType != null and hospType != ''">and hosp_type = #{hospType}</if> <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid},</if> <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename},</if> <if test="openid != null ">and openid = #{openid},</if> <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if> <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename}</if> <if test="openid != null ">and openid = #{openid}</if> <if test="longSendTime != null ">and long_send_time = #{longSendTime}</if> <if test="sendstate != null ">and sendstate = #{sendstate}</if> </where> order by update_time desc,id desc </select> @@ -217,6 +222,8 @@ <if test="libtemplatename != null ">libtemplatename,</if> <if test="patid != null ">patid,</if> <if test="openid != null ">openid,</if> <if test="longSendTime != null ">long_send_time,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="sendname != null">#{sendname},</if> @@ -268,6 +275,8 @@ <if test="libtemplatename != null ">#{libtemplatename},</if> <if test="patid != null ">#{patid},</if> <if test="openid != null ">#{openid},</if> <if test="longSendTime != null ">#{longSendTime},</if> </trim> </insert> @@ -323,6 +332,8 @@ <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> <if test="patid != null ">patid = #{patid},</if> <if test="openid != null ">openid = #{openid},</if> <if test="longSendTime != null ">long_send_time = #{longSendTime},</if> <if test="sendstate != null ">sendstate = #{sendstate},</if> </trim> where id = #{id} </update> @@ -379,6 +390,7 @@ <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> <if test="patid != null ">patid = #{patid},</if> <if test="openid != null ">openid = #{openid},</if> <if test="longSendTime != null ">long_send_time = #{longSendTime},</if> </trim> where patid = #{patid} and taskid = #{taskid} </update> @@ -403,6 +415,7 @@ select id, sendname, long_send_time, phone, sex, age, smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -44,11 +44,14 @@ <result property="showTimeNoon" column="show_time_noon"/> <result property="showTimeNight" column="show_time_night"/> <result property="textParam" column="text_param"/> <result property="serviceType" column="service_type"/> <result property="longTask" column="long_task"/> </resultMap> <sql id="selectServiceTaskVo"> select taskid, task_name, long_task, show_date, show_time_morn, show_time_noon, @@ -85,6 +88,7 @@ send_type, send_state, send_time_slot, service_type, orgid from service_task </sql> @@ -97,6 +101,8 @@ '%') </if> <if test="templateid != null and templateid != ''">and templateid = #{templateid}</if> <if test="longTask != null and longTask != ''">and long_task = #{longTask}</if> <if test="serviceType != null and serviceType != ''">and service_type = #{serviceType}</if> <if test="templatename != null and templatename != ''">and templatename like concat('%', #{templatename}, '%') </if> @@ -178,6 +184,8 @@ <if test="showTimeNoon != null and showTimeNoon != ''">show_time_noon,</if> <if test="showTimeMorn != null and showTimeMorn != ''">show_time_morn,</if> <if test="textParam != null and textParam != ''">text_param,</if> <if test="serviceType != null and serviceType != ''">service_type,</if> <if test="longTask != null and longTask != ''">long_task,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="taskName != null">#{taskName},</if> @@ -218,6 +226,8 @@ <if test="showTimeNoon != null and showTimeNoon != ''">#{showTimeNoon},</if> <if test="showTimeMorn != null and showTimeMorn != ''">#{showTimeMorn},</if> <if test="textParam != null and textParam != ''">#{textParam},</if> <if test="serviceType != null and serviceType != ''">#{serviceType},</if> <if test="longTask != null and longTask != ''">#{longTask},</if> </trim> </insert> @@ -262,6 +272,8 @@ <if test="showTimeNoon != null and showTimeNoon != ''">show_time_noon=#{showTimeNoon},</if> <if test="showTimeMorn != null and showTimeMorn != ''">show_time_morn=#{showTimeMorn},</if> <if test="textParam != null and textParam != ''">text_param=#{textParam},</if> <if test="serviceType != null and serviceType != ''">service_type = #{serviceType},</if> <if test="longTask != null and longTask != ''">long_task = #{longTask},</if> </trim> where taskid = #{taskid} </update>