From 0b02577ab12ac83a0530b7e0495b513dd0cdabca Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期二, 02 七月 2024 11:25:08 +0800 Subject: [PATCH] 代码提交 --- smartor/src/main/java/com/smartor/domain/SvyTaskAnswer.java | 108 + smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java | 7 smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml | 160 ++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskController.java | 26 smartor/src/main/java/com/smartor/service/AIRobotPhoneCallBackService.java | 7 smartor/src/main/java/com/smartor/service/ISvyTaskAnswerService.java | 62 + ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java | 6 smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml | 36 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskAnswerController.java | 91 + smartor/src/main/java/com/smartor/mapper/ServiceSubtaskRecordMapper.java | 63 + smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java | 78 smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java | 278 ++++ smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml | 160 ++ smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml | 5 smartor/src/main/java/com/smartor/service/impl/SvyTaskAnswerServiceImpl.java | 97 + ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/AIRobot/AIRobotPhoneCallBackController.java | 24 smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java | 10 smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java | 9 ruoyi-admin/src/main/java/com/ruoyi/web/test/DingTalkService.java | 10 smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java | 47 smartor/src/main/java/com/smartor/domain/ServiceTaskScriptQues.java | 10 smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml | 15 smartor/src/main/java/com/smartor/domain/ServiceTask.java | 10 smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java | 4 smartor/src/main/java/com/smartor/service/ISvyTaskService.java | 4 ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java | 89 + ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java | 2 smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java | 128 ++ smartor/src/main/java/com/smartor/domain/ServiceSubTaskDetailReq.java | 11 smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java | 7 smartor/src/main/java/com/smartor/service/ISvyTaskSingleService.java | 2 smartor/src/main/java/com/smartor/domain/ServiceSubtask.java | 4 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java | 5 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java | 38 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java | 4 smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java | 75 smartor/src/main/java/com/smartor/mapper/ServiceTaskMapper.java | 63 + ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskRecordController.java | 91 + smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | 356 +++-- ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java | 176 ++ smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java | 67 + smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java | 15 smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java | 4 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskRecordServiceImpl.java | 90 + smartor/src/main/java/com/smartor/service/IServiceSubtaskRecordService.java | 62 + smartor/src/main/java/com/smartor/mapper/SvyTaskAnswerMapper.java | 63 + smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java | 12 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTasksingledetailController.java | 9 smartor/src/main/java/com/smartor/service/impl/SvyTaskServiceImpl.java | 113 + smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml | 32 smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java | 12 smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java | 87 + smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 40 smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java | 240 +++ /dev/null | 190 --- smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java | 76 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java | 42 smartor/src/main/java/com/smartor/service/IServiceTaskService.java | 67 + smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java | 58 59 files changed, 2,922 insertions(+), 735 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java index b9295e9..dae2a6a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java @@ -10,11 +10,12 @@ import com.smartor.common.SendService; import com.smartor.config.RobotPhoneUtils; import com.smartor.domain.*; -import com.smartor.mapper.IvrTaskMapper; -import com.smartor.mapper.IvrTaskSingleMapper; +import com.smartor.mapper.ServiceSubtaskMapper; +import com.smartor.mapper.ServiceTaskMapper; import com.smartor.mapper.SvyTaskMapper; import com.smartor.mapper.SvyTaskSingleMapper; import com.smartor.service.IIvrTaskTemplateService; +import com.smartor.service.IServiceSubtaskRecordService; import com.smartor.service.ISvyTaskTemplateService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -24,9 +25,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.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; @@ -46,9 +45,9 @@ private static IIvrTaskTemplateService ivrTaskTemplateService; - private static IvrTaskSingleMapper ivrTaskcallMapper; + private static ServiceSubtaskMapper ivrTaskcallMapper; - private static IvrTaskMapper ivrTaskMapper; + private static ServiceTaskMapper ivrTaskMapper; private static SendService sendService; @@ -64,6 +63,9 @@ @Autowired private ISvyTaskTemplateService iSvyTaskTemplateService; + + @Autowired + private IServiceSubtaskRecordService serviceSubtaskRecordService; // 鍒涘缓鍥哄畾澶у皬鐨勭嚎绋嬫睜 private static final ExecutorService executorService = Executors.newFixedThreadPool(10); @@ -89,12 +91,12 @@ } @Autowired - public void setIvrTaskcallMapper(IvrTaskSingleMapper ivrTaskcallMapper) { + public void setIvrTaskcallMapper(ServiceSubtaskMapper ivrTaskcallMapper) { RedisMqReceiver.ivrTaskcallMapper = ivrTaskcallMapper; } @Autowired - public void setIvrTaskMapper(IvrTaskMapper ivrTaskMapper) { + public void setIvrTaskMapper(ServiceTaskMapper ivrTaskMapper) { RedisMqReceiver.ivrTaskMapper = ivrTaskMapper; } @@ -155,7 +157,7 @@ */ private void sfHandle(CommonTaskcallMQ commonTaskcallMQ) { //鍒ゆ柇涓�涓媍ommonTaskcallMQ涓殑stopstate鏄惁涓巌vr_task涓殑涓�鑷达紝涓嶄竴鑷达紝鍒欒鏄庢槸鏆傚仠浜� - IvrTask ivrTask1 = ivrTaskMapper.selectIvrTaskByTaskid(commonTaskcallMQ.getTaskid()); + ServiceTask ivrTask1 = ivrTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid()); if (ivrTask1.getStopState() != commonTaskcallMQ.getStopState()) { //灏嗘秷鎭粠闃熷垪涓墧闄� return; @@ -175,16 +177,26 @@ IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO); //閫氳繃浠诲姟ID鎷垮埌鎮h�呬俊鎭� - IvrTaskSingle ivrTaskcall = new IvrTaskSingle(); + ServiceSubtask ivrTaskcall = new ServiceSubtask(); ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid()); - List<IvrTaskSingle> ivrTaskcalls = ivrTaskcallMapper.selectIvrTaskcallList(ivrTaskcall); + List<ServiceSubtask> ivrTaskcalls = ivrTaskcallMapper.selectServiceSubtaskList(ivrTaskcall); if (descByCode.equals("鐢佃瘽")) { - for (IvrTaskSingle ivrTaskcall1 : ivrTaskcalls) { - IvrTask ivrTask = ivrTaskMapper.selectIvrTaskByTaskid(ivrTaskcall1.getTaskid()); + for (ServiceSubtask ivrTaskcall1 : ivrTaskcalls) { + ServiceTask ivrTask = ivrTaskMapper.selectServiceTaskByTaskid(ivrTaskcall1.getTaskid()); if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) { //濡備綍浠诲姟琚�滄殏鍋溾�濇垨鈥滅粓姝⑩�� break; } + + //浠诲姟鍙戦�佽褰曪紙杩欎釜浠g爜搴旇鍐欏湪phoneTask涓紝鍏堝啓鍦ㄨ繖锛屽悗闈㈠啀鏀癸級 + ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); + serviceSubtaskRecord.setTaskid(ivrTaskcall1.getTaskid().toString()); + serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); + serviceSubtaskRecord.setTasktype(ivrTaskcall1.getType()); + serviceSubtaskRecord.setPreachform("3"); + serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); + serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); + //閫氳繃澶氱嚎绋嬬殑鏂瑰紡鍘绘墦鐢佃瘽 executorService.submit(new PhoneTask(ivrTaskcall1, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils)); } @@ -200,18 +212,28 @@ String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); - for (IvrTaskSingle ivrTaskSingle : ivrTaskcalls) { + for (ServiceSubtask ivrTaskSingle : ivrTaskcalls) { String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key); SendMagParam sendMagParam = new SendMagParam(); sendMagParam.setType("4"); sendMagParam.setUrl(req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid); - sendService.sendMsg(sendMagParam); + Boolean aBoolean = sendService.sendMsg(sendMagParam); + + //浠诲姟鍙戦�佽褰� + ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); + serviceSubtaskRecord.setTaskid(ivrTaskSingle.getTaskid().toString()); + serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); + serviceSubtaskRecord.setTasktype(ivrTaskSingle.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 (IvrTaskSingle ivrTaskSingle : ivrTaskcalls) { + for (ServiceSubtask ivrTaskSingle : ivrTaskcalls) { String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key); SendMagParam sendMagParam = new SendMagParam(); sendMagParam.setType("5"); @@ -222,7 +244,17 @@ Map map = new HashMap(); map.put("first", ivrTask1.getTaskName()); sendMagParam.setContent(JSON.toJSONString(map)); - sendService.sendMsg(sendMagParam); + Boolean aBoolean = sendService.sendMsg(sendMagParam); + + //浠诲姟鍙戦�佽褰� + ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); + serviceSubtaskRecord.setTaskid(ivrTaskSingle.getTaskid().toString()); + serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); + serviceSubtaskRecord.setTasktype(ivrTaskSingle.getType()); + serviceSubtaskRecord.setPreachform("4"); + serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); + serviceSubtaskRecord.setResult(aBoolean == true ? "鎴愬姛" : "澶辫触"); + serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); } } //閫氱煡 MQ 娑堟伅宸茶鎺ユ敹,鍙互ACK(浠庨槦鍒椾腑鍒犻櫎)浜� 锛堣繖涓渶瑕佹牴鎹笟鍔″啀鍘诲鐞咥CK锛� @@ -267,6 +299,15 @@ //濡備綍浠诲姟琚�滄殏鍋溾�濇垨鈥滅粓姝⑩�� break; } + + //浠诲姟鍙戦�佽褰曪紙杩欎釜浠g爜搴旇鍐欏湪phoneTask涓紝鍏堝啓鍦ㄨ繖锛屽悗闈㈠啀鏀癸級 + ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); + serviceSubtaskRecord.setTaskid(svyTaskSingle1.getTaskid().toString()); + serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); + serviceSubtaskRecord.setTasktype(svyTaskSingle1.getType()); + serviceSubtaskRecord.setPreachform("3"); + serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); + serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); //閫氳繃澶氱嚎绋嬬殑鏂瑰紡鍘绘墦鐢佃瘽 // executorService.submit(new PhoneTask(ivrTaskcall1, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils)); } @@ -291,7 +332,17 @@ Map map = new HashMap(); map.put("first", svyTask.getTaskName()); sendMagParam.setContent(JSON.toJSONString(map)); - sendService.sendMsg(sendMagParam); + Boolean aBoolean = sendService.sendMsg(sendMagParam); + + //浠诲姟鍙戦�佽褰� + ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); + serviceSubtaskRecord.setTaskid(svyTaskSingle1.getTaskid().toString()); + serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); + serviceSubtaskRecord.setTasktype(svyTaskSingle1.getType()); + serviceSubtaskRecord.setPreachform("4"); + serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); + serviceSubtaskRecord.setResult(aBoolean == true ? "鎴愬姛" : "澶辫触"); + serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); } } //閫氱煡 MQ 娑堟伅宸茶鎺ユ敹,鍙互ACK(浠庨槦鍒椾腑鍒犻櫎)浜� 锛堣繖涓渶瑕佹牴鎹笟鍔″啀鍘诲鐞咥CK锛� diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/AIRobot/AIRobotPhoneCallBackController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/AIRobot/AIRobotPhoneCallBackController.java index ed5f7ec..645cf83 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/AIRobot/AIRobotPhoneCallBackController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/AIRobot/AIRobotPhoneCallBackController.java @@ -1,35 +1,19 @@ package com.ruoyi.web.controller.smartor.AIRobot; -import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.DtoConversionUtils; -import com.ruoyi.common.utils.PageUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.smartor.config.RobotPhoneUtils; -import com.smartor.domain.IvrTaskSingle; -import com.smartor.domain.IvrTaskSingleVO; -import com.smartor.domain.PhoneCallBackVO; -import com.smartor.domain.SendTaskVO; -import com.smartor.domain.robot.RobotScritpTemplateVO; import com.smartor.domain.robot.back.RobotAIDialogBack; import com.smartor.domain.robot.back.RobotCallBack; import com.smartor.domain.robot.back.RobotcdrInfoBack; import com.smartor.service.AIRobotPhoneCallBackService; -import com.smartor.service.IIvrTaskSingleService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 鍗曚竴浠诲姟锛堥殢璁匡級Controller diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java index aa0a338..2005733 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java @@ -23,9 +23,9 @@ * @author ruoyi * @date 2023-06-26 */ -@Api(description = "CommonTaskController") +@Api(description = "閫氱敤浠诲姟Controller") @RestController -@RequestMapping("/commonTask") +@RequestMapping("/smartor/commonTask") public class CommonTaskController extends BaseController { @Autowired private IServiceThirdDataService iServiceThirdDataService; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java deleted file mode 100644 index 4ec3a5e..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.ruoyi.web.controller.smartor; - -import com.github.pagehelper.ISelect; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.DtoConversionUtils; -import com.ruoyi.common.utils.PageUtils; -import com.ruoyi.common.utils.RSAPublicKeyExample; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.smartor.domain.*; -import com.smartor.service.IIvrTaskService; -import com.smartor.service.IIvrTaskSingleService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -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.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 闅忚浠诲姟Controller - * - * @author smartor - * @date 2023-03-24 - */ -@Slf4j -@Api(description = "闅忚浠诲姟") -@RestController -@RequestMapping("/smartor/ivrtask") -public class IvrTaskController extends BaseController { - @Autowired - private IIvrTaskService ivrTaskService; - - @Autowired - private IIvrTaskSingleService iIvrTaskCallService; - - @Value("${pub_key}") - private String pub_key; - - @Value("${pri_key}") - private String pri_key; - - /** - * 鏌ヨ璇煶浠诲姟鍒楄〃 - */ - @ApiOperation("鏌ヨ浠诲姟鍒楄〃") - @PreAuthorize("@ss.hasPermi('smartor:ivrtask:list')") - @PostMapping("/list") - public TableDataInfo list(@RequestBody IvrTask ivrTask) { - PageUtils.startPageByPost(ivrTask.getPageNum(), ivrTask.getPageSize()); - List<IvrTask> list = ivrTaskService.selectIvrTaskList(ivrTask); - List<IvrTaskVO> ivrTaskVOS = DtoConversionUtils.sourceToTarget(list, IvrTaskVO.class); - - if (CollectionUtils.isNotEmpty(ivrTaskVOS)) { - for (IvrTaskVO ivrTaskVO : ivrTaskVOS) { - IvrTaskSingle ivrTaskcall = new IvrTaskSingle(); - ivrTaskcall.setTaskid(ivrTaskVO.getTaskid()); - List<IvrTaskSingle> ivrTaskcalls = iIvrTaskCallService.selectIvrTaskcallList(ivrTaskcall); - if (CollectionUtils.isNotEmpty(ivrTaskcalls)) { - //宸插彂閫� - long yfs = ivrTaskcalls.stream().filter(ivrTaskcall1 -> ivrTaskcall1.getSendstate() != null && ivrTaskcall1.getSendstate() == 3L).collect(Collectors.toList()).stream().count(); - //鏈彂閫� - long wfs = ivrTaskcalls.stream().filter(ivrTaskcall1 -> ivrTaskcall1.getSendstate() != null && ivrTaskcall1.getSendstate() == 2L).collect(Collectors.toList()).stream().count(); - ivrTaskVO.setYfs(yfs); - ivrTaskVO.setWfs(wfs); - } - } - //鑾峰彇total - long total = PageUtils.count(new ISelect() { - @Override - public void doSelect() { - ivrTask.setPageNum(null); - ivrTask.setPageSize(null); - ivrTaskService.selectIvrTaskList(ivrTask); - } - }); - - return getDataTable2(total, ivrTaskVOS); - } - - return getDataTable2(0, ivrTaskVOS); - } - - /** - * 瀵煎嚭浠诲姟鍒楄〃 - */ - @ApiOperation("瀵煎嚭浠诲姟鍒楄〃") - @PreAuthorize("@ss.hasPermi('smartor:ivrtask:export')") - @Log(title = "璇煶浠诲姟", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, IvrTask ivrTask) { - List<IvrTask> list = ivrTaskService.selectIvrTaskList(ivrTask); - ExcelUtil<IvrTask> util = new ExcelUtil<IvrTask>(IvrTask.class); - util.exportExcel(response, list, "璇煶浠诲姟鏁版嵁"); - } - - /** - * 鑾峰彇浠诲姟璇︾粏淇℃伅 - */ - @ApiOperation("鑾峰彇浠诲姟璇︾粏淇℃伅") - @PreAuthorize("@ss.hasPermi('smartor:ivrtask:query')") - @GetMapping(value = "/{taskid}") - public AjaxResult getInfo(@PathVariable("taskid") Long taskid) { - return success(ivrTaskService.selectIvrTaskByTaskid(taskid)); - } - - /** - * 鏂板浠诲姟 - */ - @ApiOperation("鏂板浠诲姟") - @PreAuthorize("@ss.hasPermi('smartor:ivrtask:add')") - @Log(title = "璇煶浠诲姟", businessType = BusinessType.INSERT) - @PostMapping("/add") - public AjaxResult add(@RequestBody IvrTask ivrTask) { - return toAjax(ivrTaskService.insertIvrTask(ivrTask)); - } - - /** - * 淇敼璇煶浠诲姟 - */ - @ApiOperation("淇敼浠诲姟") - @PreAuthorize("@ss.hasPermi('smartor:ivrtask:edit')") - @Log(title = "浠诲姟", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - public AjaxResult edit(@RequestBody IvrTask ivrTask) { - return toAjax(ivrTaskService.updateIvrTask(ivrTask)); - } - -// /** -// * 鍒犻櫎璇煶浠诲姟 -// */ -// @ApiOperation("鍒犻櫎浠诲姟") -// @PreAuthorize("@ss.hasPermi('smartor:ivrtask:remove')") -// @Log(title = "璇煶浠诲姟", businessType = BusinessType.DELETE) -// @GetMapping("/remove/{taskids}") -// public AjaxResult remove(@PathVariable Long[] taskids) { -// return toAjax(ivrTaskService.deleteIvrTaskByTaskids(taskids)); -// } -// - - /** - * 鍒犻櫎浠诲姟(鍖呮嫭瀹冨搴旂殑鎮h�呬俊鎭�) - */ - @ApiOperation("鍒犻櫎浠诲姟(鍖呮嫭瀹冨搴旂殑鎮h�呬俊鎭�)") - @PreAuthorize("@ss.hasPermi('smartor:ivrtask:remove')") - @Log(title = "璇煶浠诲姟", businessType = BusinessType.DELETE) - @GetMapping("/remove/{removeTask}") - public AjaxResult removeTask(@PathVariable Long taskId) { - return toAjax(ivrTaskService.deleteIvrTaskByTaskid(taskId)); - } - - /** - * 閫氳繃浠诲姟ID鍜屾偅鑰匢D鑾峰彇鍗曚釜浜虹殑棰樼洰淇℃伅 - * - * @return - */ - @ApiOperation("閫氳繃浠诲姟ID鍜屾偅鑰匢D鑾峰彇鍗曚釜浜虹殑棰樼洰淇℃伅") - @PostMapping("/getScriptInfoByCondition") - public TableDataInfo getScriptInfoByCondition(@RequestBody IvrTaskScriptQues ivrTaskScriptQues) { - RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); - Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskScriptQues.getParam1(), pri_key)); - Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskScriptQues.getParam2(), pri_key)); - log.info("tid鍜宲id鐨勫�间负锛歿},{}", tid, pid); - return getDataTable(ivrTaskService.getScriptInfoByCondition(tid, pid)); - } - -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java index afb0515..5e93144 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskcalldetailController.java @@ -1,29 +1,19 @@ -package com.smartor.controller; +package com.ruoyi.web.controller.smartor; -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.smartor.domain.IvrTaskcalldetailReq; -import com.smartor.domain.PhoneCallBackVO; -import io.swagger.annotations.ApiOperation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.smartor.domain.IvrTaskcalldetail; import com.smartor.service.IIvrTaskcalldetailService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 璇煶浠诲姟鍛煎彨鏄庣粏Controller @@ -97,16 +87,6 @@ @GetMapping("/remove/{calldetailids}") public AjaxResult remove(@PathVariable String[] calldetailids) { return toAjax(ivrTaskcalldetailService.deleteIvrTaskcalldetailByCalldetailids(calldetailids)); - } - - - /** - * 鎮h�呴棶棰樼粨鏋滆褰� - */ - @ApiOperation("鎮h�呴棶棰樼粨鏋滆褰�") - @PostMapping("/saveQuestionAnswer") - public AjaxResult saveQuestionAnswer(@RequestBody IvrTaskcalldetailReq ivrTaskcalldetailReq) { - return toAjax(ivrTaskcalldetailService.saveQuestionAnswer(ivrTaskcalldetailReq)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java similarity index 65% rename from ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java index 8bfbfd5..ae992bf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java @@ -11,9 +11,7 @@ import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.smartor.domain.*; -import com.smartor.domain.robot.back.RobotAIDialogBack; -import com.smartor.domain.robot.back.RobotCallBack; -import com.smartor.service.IIvrTaskSingleService; +import com.smartor.service.IServiceSubtaskService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -33,10 +31,10 @@ @Slf4j @Api(description = "鍗曚竴浠诲姟锛堥殢璁垮鏁欙級") @RestController -@RequestMapping("/smartor/tasksingle") -public class IvrTaskSingleController extends BaseController { +@RequestMapping("/smartor/serviceSubtask") +public class ServiceSubtaskController extends BaseController { @Autowired - private IIvrTaskSingleService ivrTaskcallService; + private IServiceSubtaskService serviceSubtaskService; /** * 鏌ヨ鎮h�呴殢璁夸俊鎭� @@ -44,9 +42,9 @@ @ApiOperation("鏌ヨ鎮h�呴殢璁夸俊鎭�") @PreAuthorize("@ss.hasPermi('system:taskcall:list')") @PostMapping("/patItem") - public TableDataInfo patItem(@RequestBody IvrTaskSingle ivrTaskcall) { + public TableDataInfo patItem(@RequestBody ServiceSubtask ivrTaskcall) { PageUtils.startPageByPost(ivrTaskcall.getPageNum(), ivrTaskcall.getPageSize()); - return getDataTable(ivrTaskcallService.patItem(ivrTaskcall)); + return getDataTable(serviceSubtaskService.patItem(ivrTaskcall)); } /** @@ -55,9 +53,9 @@ @PreAuthorize("@ss.hasPermi('system:taskcall:export')") @Log(title = "鍗曚竴浠诲姟锛堥殢璁垮鏁欙級", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, IvrTaskSingle ivrTaskcall) { - List<IvrTaskSingle> list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall); - ExcelUtil<IvrTaskSingle> util = new ExcelUtil<IvrTaskSingle>(IvrTaskSingle.class); + public void export(HttpServletResponse response, ServiceSubtask ivrTaskcall) { + List<ServiceSubtask> list = serviceSubtaskService.selectServiceSubtaskList(ivrTaskcall); + ExcelUtil<ServiceSubtask> util = new ExcelUtil<ServiceSubtask>(ServiceSubtask.class); util.exportExcel(response, list, "鍗曚竴浠诲姟锛堥殢璁匡級鏁版嵁"); } @@ -67,7 +65,7 @@ @PreAuthorize("@ss.hasPermi('system:taskcall:query')") @GetMapping(value = "/getInfo/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(ivrTaskcallService.selectIvrTaskcallById(id)); + return success(serviceSubtaskService.selectServiceSubtaskById(id)); } /** @@ -77,12 +75,12 @@ @PreAuthorize("@ss.hasPermi('system:task:add')") @Log(title = "鍗曚竴浠诲姟锛堥殢璁匡級", businessType = BusinessType.INSERT) @PostMapping("/insertOrUpdateTask") - public AjaxResult insertOrUpdateHeTask(@RequestBody IvrTaskVO ivrTaskVO) { + public AjaxResult insertOrUpdateHeTask(@RequestBody ServiceTaskVO ivrTaskVO) { LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); ivrTaskVO.setCreateBy(user.getNickName()); - return toAjax(ivrTaskcallService.insertOrUpdateTask(ivrTaskVO)); + return toAjax(serviceSubtaskService.insertOrUpdateTask(ivrTaskVO)); } /** @@ -90,10 +88,10 @@ */ @ApiOperation("鏍规嵁鏉′欢鏌ヨ浠诲姟淇℃伅") @PostMapping("/queryTaskByCondition") - public AjaxResult queryTaskByCondition(@RequestBody IvrTaskSingleVO ivrTaskcallVO) { + public AjaxResult queryTaskByCondition(@RequestBody ServiceSubtaskVO ivrTaskcallVO) { //鏍规嵁鍏ュ弬鏌ヨ淇℃伅 - IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, IvrTaskSingle.class); - IvrTaskVO ivrTaskVO = ivrTaskcallService.queryTaskByCondition(ivrTaskcall); + ServiceSubtask ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, ServiceSubtask.class); + ServiceTaskVO ivrTaskVO = serviceSubtaskService.queryTaskByCondition(ivrTaskcall); return success(ivrTaskVO); } @@ -104,8 +102,16 @@ @PostMapping("/phoneCallBack") public AjaxResult phoneCallBack(@RequestBody PhoneCallBackVO phoneCallBackVO) { // log.error("鐢佃瘽鍥炶皟浠诲姟鎴愬姛浜嗕笉锛焮}", phoneCallBackVO); - ivrTaskcallService.phoneCallBack(phoneCallBackVO); + serviceSubtaskService.phoneCallBack(phoneCallBackVO); return success(); } + /** + * 鎮h�呴棶棰樼粨鏋滆褰� + */ + @ApiOperation("鎮h�呴棶棰樼粨鏋滆褰�") + @PostMapping("/saveQuestionAnswer") + public AjaxResult saveQuestionAnswer(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) { + return toAjax(serviceSubtaskService.saveQuestionAnswer(serviceSubTaskDetailReq)); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskRecordController.java new file mode 100644 index 0000000..fc6a416 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskRecordController.java @@ -0,0 +1,91 @@ +package com.ruoyi.web.controller.smartor; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.smartor.domain.ServiceSubtaskRecord; +import com.smartor.service.IServiceSubtaskRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆慍ontroller + * + * @author ruoyi + * @date 2024-07-01 + */ +@RestController +@RequestMapping("/smartor/subTaskRecord") +public class ServiceSubtaskRecordController extends BaseController { + @Autowired + private IServiceSubtaskRecordService serviceSubtaskRecordService; + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + */ + @PreAuthorize("@ss.hasPermi('system:record:list')") + @GetMapping("/list") + public TableDataInfo list(ServiceSubtaskRecord serviceSubtaskRecord) { + startPage(); + List<ServiceSubtaskRecord> list = serviceSubtaskRecordService.selectServiceSubtaskRecordList(serviceSubtaskRecord); + return getDataTable(list); + } + + /** + * 瀵煎嚭銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + */ + @PreAuthorize("@ss.hasPermi('system:record:export')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ServiceSubtaskRecord serviceSubtaskRecord) { + List<ServiceSubtaskRecord> list = serviceSubtaskRecordService.selectServiceSubtaskRecordList(serviceSubtaskRecord); + ExcelUtil<ServiceSubtaskRecord> util = new ExcelUtil<ServiceSubtaskRecord>(ServiceSubtaskRecord.class); + util.exportExcel(response, list, "銆愯濉啓鍔熻兘鍚嶇О銆戞暟鎹�"); + } + + /** + * 鑾峰彇銆愯濉啓鍔熻兘鍚嶇О銆戣缁嗕俊鎭� + */ + @PreAuthorize("@ss.hasPermi('system:record:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(serviceSubtaskRecordService.selectServiceSubtaskRecordById(id)); + } + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:record:add')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ServiceSubtaskRecord serviceSubtaskRecord) { + return toAjax(serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord)); + } + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:record:edit')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ServiceSubtaskRecord serviceSubtaskRecord) { + return toAjax(serviceSubtaskRecordService.updateServiceSubtaskRecord(serviceSubtaskRecord)); + } + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:record:remove')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(serviceSubtaskRecordService.deleteServiceSubtaskRecordByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java new file mode 100644 index 0000000..463467c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java @@ -0,0 +1,176 @@ +package com.ruoyi.web.controller.smartor; + +import com.github.pagehelper.ISelect; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.DtoConversionUtils; +import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.common.utils.RSAPublicKeyExample; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.smartor.domain.*; +import com.smartor.service.IServiceSubtaskService; +import com.smartor.service.IServiceTaskService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 闅忚浠诲姟Controller + * + * @author smartor + * @date 2023-03-24 + */ +@Slf4j +@Api(description = "闅忚浠诲姟") +@RestController +@RequestMapping("/smartor/servicetask") +public class ServiceTaskController extends BaseController { + @Autowired + private IServiceTaskService serviceTaskService; + + @Autowired + private IServiceSubtaskService iServiceTaskCallService; + + @Value("${pub_key}") + private String pub_key; + + @Value("${pri_key}") + private String pri_key; + + /** + * 鏌ヨ璇煶浠诲姟鍒楄〃 + */ + @ApiOperation("鏌ヨ浠诲姟鍒楄〃") + @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:list')") + @PostMapping("/list") + public TableDataInfo list(@RequestBody ServiceTask serviceTask) { + PageUtils.startPageByPost(serviceTask.getPageNum(), serviceTask.getPageSize()); + List<ServiceTask> list = serviceTaskService.selectServiceTaskList(serviceTask); + List<ServiceTaskVO> ServiceTaskVOS = DtoConversionUtils.sourceToTarget(list, ServiceTaskVO.class); + + if (CollectionUtils.isNotEmpty(ServiceTaskVOS)) { + for (ServiceTaskVO ServiceTaskVO : ServiceTaskVOS) { + ServiceSubtask ServiceTaskcall = new ServiceSubtask(); + ServiceTaskcall.setTaskid(ServiceTaskVO.getTaskid()); + List<ServiceSubtask> ServiceTaskcalls = iServiceTaskCallService.selectServiceSubtaskList(ServiceTaskcall); + if (CollectionUtils.isNotEmpty(ServiceTaskcalls)) { + //宸插彂閫� + long yfs = ServiceTaskcalls.stream().filter(serviceTaskcall1 -> serviceTaskcall1.getSendstate() != null && serviceTaskcall1.getSendstate() == 3L).collect(Collectors.toList()).stream().count(); + //鏈彂閫� + long wfs = ServiceTaskcalls.stream().filter(serviceTaskcall1 -> serviceTaskcall1.getSendstate() != null && serviceTaskcall1.getSendstate() == 2L).collect(Collectors.toList()).stream().count(); + ServiceTaskVO.setYfs(yfs); + ServiceTaskVO.setWfs(wfs); + } + } + //鑾峰彇total + long total = PageUtils.count(new ISelect() { + @Override + public void doSelect() { + serviceTask.setPageNum(null); + serviceTask.setPageSize(null); + serviceTaskService.selectServiceTaskList(serviceTask); + } + }); + + return getDataTable2(total, ServiceTaskVOS); + } + + return getDataTable2(0, ServiceTaskVOS); + } + + /** + * 瀵煎嚭浠诲姟鍒楄〃 + */ + @ApiOperation("瀵煎嚭浠诲姟鍒楄〃") + @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:export')") + @Log(title = "璇煶浠诲姟", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ServiceTask ServiceTask) { + List<ServiceTask> list = serviceTaskService.selectServiceTaskList(ServiceTask); + ExcelUtil<ServiceTask> util = new ExcelUtil<ServiceTask>(ServiceTask.class); + util.exportExcel(response, list, "璇煶浠诲姟鏁版嵁"); + } + + /** + * 鑾峰彇浠诲姟璇︾粏淇℃伅 + */ + @ApiOperation("鑾峰彇浠诲姟璇︾粏淇℃伅") + @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:query')") + @GetMapping(value = "/{taskid}") + public AjaxResult getInfo(@PathVariable("taskid") Long taskid) { + return success(serviceTaskService.selectServiceTaskByTaskid(taskid)); + } + + /** + * 鏂板浠诲姟 + */ + @ApiOperation("鏂板浠诲姟") + @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:add')") + @Log(title = "璇煶浠诲姟", businessType = BusinessType.INSERT) + @PostMapping("/add") + public AjaxResult add(@RequestBody ServiceTask ServiceTask) { + return toAjax(serviceTaskService.insertServiceTask(ServiceTask)); + } + + /** + * 淇敼璇煶浠诲姟 + */ + @ApiOperation("淇敼浠诲姟") + @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:edit')") + @Log(title = "浠诲姟", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + public AjaxResult edit(@RequestBody ServiceTask ServiceTask) { + return toAjax(serviceTaskService.updateServiceTask(ServiceTask)); + } + +// /** +// * 鍒犻櫎璇煶浠诲姟 +// */ +// @ApiOperation("鍒犻櫎浠诲姟") +// @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:remove')") +// @Log(title = "璇煶浠诲姟", businessType = BusinessType.DELETE) +// @GetMapping("/remove/{taskids}") +// public AjaxResult remove(@PathVariable Long[] taskids) { +// return toAjax(ServiceTaskService.deleteServiceTaskByTaskids(taskids)); +// } +// + + /** + * 鍒犻櫎浠诲姟(鍖呮嫭瀹冨搴旂殑鎮h�呬俊鎭�) + */ + @ApiOperation("鍒犻櫎浠诲姟(鍖呮嫭瀹冨搴旂殑鎮h�呬俊鎭�)") + @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:remove')") + @Log(title = "璇煶浠诲姟", businessType = BusinessType.DELETE) + @GetMapping("/remove/{removeTask}") + public AjaxResult removeTask(@PathVariable Long taskId) { + return toAjax(serviceTaskService.deleteServiceTaskByTaskid(taskId)); + } + + /** + * 閫氳繃浠诲姟ID鍜屾偅鑰匢D鑾峰彇鍗曚釜浜虹殑棰樼洰淇℃伅 + * + * @return + */ + @ApiOperation("閫氳繃浠诲姟ID鍜屾偅鑰匢D鑾峰彇鍗曚釜浜虹殑棰樼洰淇℃伅") + @PostMapping("/getScriptInfoByCondition") + public TableDataInfo getScriptInfoByCondition(@RequestBody ServiceTaskScriptQues serviceTaskScriptQues) { + RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); + Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam1(), pri_key)); + Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam2(), pri_key)); + log.info("tid鍜宲id鐨勫�间负锛歿},{}", tid, pid); + return getDataTable(serviceTaskService.getScriptInfoByCondition(tid, pid)); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskAnswerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskAnswerController.java new file mode 100644 index 0000000..d37af2a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskAnswerController.java @@ -0,0 +1,91 @@ +package com.ruoyi.web.controller.smartor; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.smartor.domain.SvyTaskAnswer; +import com.smartor.service.ISvyTaskAnswerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 浠诲姟闂嵎闂閫夐」Controller + * + * @author ruoyi + * @date 2024-06-27 + */ +@RestController +@RequestMapping("/system/answer") +public class SvyTaskAnswerController extends BaseController { + @Autowired + private ISvyTaskAnswerService svyTaskAnswerService; + + /** + * 鏌ヨ浠诲姟闂嵎闂閫夐」鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('system:answer:list')") + @GetMapping("/list") + public TableDataInfo list(SvyTaskAnswer svyTaskAnswer) { + startPage(); + List<SvyTaskAnswer> list = svyTaskAnswerService.selectSvyTaskAnswerList(svyTaskAnswer); + return getDataTable(list); + } + + /** + * 瀵煎嚭浠诲姟闂嵎闂閫夐」鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('system:answer:export')") + @Log(title = "浠诲姟闂嵎闂閫夐」", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SvyTaskAnswer svyTaskAnswer) { + List<SvyTaskAnswer> list = svyTaskAnswerService.selectSvyTaskAnswerList(svyTaskAnswer); + ExcelUtil<SvyTaskAnswer> util = new ExcelUtil<SvyTaskAnswer>(SvyTaskAnswer.class); + util.exportExcel(response, list, "浠诲姟闂嵎闂閫夐」鏁版嵁"); + } + + /** + * 鑾峰彇浠诲姟闂嵎闂閫夐」璇︾粏淇℃伅 + */ + @PreAuthorize("@ss.hasPermi('system:answer:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(svyTaskAnswerService.selectSvyTaskAnswerById(id)); + } + + /** + * 鏂板浠诲姟闂嵎闂閫夐」 + */ + @PreAuthorize("@ss.hasPermi('system:answer:add')") + @Log(title = "浠诲姟闂嵎闂閫夐」", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SvyTaskAnswer svyTaskAnswer) { + return toAjax(svyTaskAnswerService.insertSvyTaskAnswer(svyTaskAnswer)); + } + + /** + * 淇敼浠诲姟闂嵎闂閫夐」 + */ + @PreAuthorize("@ss.hasPermi('system:answer:edit')") + @Log(title = "浠诲姟闂嵎闂閫夐」", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SvyTaskAnswer svyTaskAnswer) { + return toAjax(svyTaskAnswerService.updateSvyTaskAnswer(svyTaskAnswer)); + } + + /** + * 鍒犻櫎浠诲姟闂嵎闂閫夐」 + */ + @PreAuthorize("@ss.hasPermi('system:answer:remove')") + @Log(title = "浠诲姟闂嵎闂閫夐」", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(svyTaskAnswerService.deleteSvyTaskAnswerByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskController.java index ca8e739..876adb6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskController.java @@ -8,14 +8,17 @@ import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.DtoConversionUtils; import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.common.utils.RSAPublicKeyExample; import com.ruoyi.common.utils.poi.ExcelUtil; import com.smartor.domain.*; import com.smartor.service.ISvyTaskService; import com.smartor.service.ISvyTaskSingleService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +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.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -29,14 +32,22 @@ * @author ruoyi * @date 2024-06-12 */ +@Slf4j @Api(description = " 闂嵎浠诲姟锛堜换鍔★級") @RestController @RequestMapping("/smartor/svytask") public class SvyTaskController extends BaseController { @Autowired private ISvyTaskService svyTaskService; + @Autowired private ISvyTaskSingleService iSvyTaskSingleService; + + @Value("${pub_key}") + private String pub_key; + + @Value("${pri_key}") + private String pri_key; /** * 鏌ヨ闂嵎浠诲姟锛堜换鍔★級鍒楄〃 @@ -135,4 +146,19 @@ public AjaxResult remove(@PathVariable Long[] taskids) { return toAjax(svyTaskService.deleteSvyTaskByTaskids(taskids)); } + + /** + * 閫氳繃浠诲姟ID鍜屾偅鑰匢D鑾峰彇鍗曚釜浜虹殑棰樼洰淇℃伅 + * + * @return + */ + @ApiOperation("閫氳繃浠诲姟ID鍜屾偅鑰匢D鑾峰彇鍗曚釜浜虹殑棰樼洰淇℃伅") + @PostMapping("/getSvyScriptInfoByCondition") + public TableDataInfo getScriptInfoByCondition(@RequestBody ServiceTaskScriptQues ivrTaskScriptQues) { + RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); + Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskScriptQues.getParam1(), pri_key)); + Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskScriptQues.getParam2(), pri_key)); + log.info("tid鍜宲id鐨勫�间负锛歿},{}", tid, pid); + return getDataTable(svyTaskService.getScriptInfoByCondition(tid, pid)); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTasksingledetailController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTasksingledetailController.java index c8ae9a4..7206675 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTasksingledetailController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTasksingledetailController.java @@ -95,4 +95,13 @@ { return toAjax(svyTasksingledetailService.deleteSvyTasksingledetailByCalldetailids(calldetailids)); } +// +// /** +// * 鎮h�呴棶棰樼粨鏋滆褰� +// */ +// @ApiOperation("鎮h�呴棶棰樼粨鏋滆褰�") +// @PostMapping("/saveQuestionAnswer") +// public AjaxResult saveQuestionAnswer(@RequestBody IvrTaskcalldetailReq ivrTaskcalldetailReq) { +// return toAjax(ivrTaskcalldetailService.saveQuestionAnswer(ivrTaskcalldetailReq)); +// } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java b/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java index 8a6a3c8..686abe4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java @@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit; public class PhoneTask implements Runnable { - private IvrTaskSingle ivrTaskSingle; + private ServiceSubtask ivrTaskSingle; private List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVO; private RedisCache redisCache; private IvrTaskTemplateVO ivrTaskTemplateVO; @@ -27,8 +27,8 @@ private RobotPhoneUtils robotPhoneUtils; - public PhoneTask(IvrTaskSingle ivrTaskSingle, IvrTaskTemplateVO ivrTaskTemplateVO, RedisCache redisCache, SendService sendService, String phonePath, RobotPhoneUtils robotPhoneUtils) { - this.ivrTaskSingle = DtoConversionUtils.sourceToTarget(ivrTaskSingle, IvrTaskSingle.class); + public PhoneTask(ServiceSubtask ivrTaskSingle, IvrTaskTemplateVO ivrTaskTemplateVO, RedisCache redisCache, SendService sendService, String phonePath, RobotPhoneUtils robotPhoneUtils) { + this.ivrTaskSingle = DtoConversionUtils.sourceToTarget(ivrTaskSingle, ServiceSubtask.class); this.ivrTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList(), IvrTaskTemplateScriptVO.class); this.ivrTaskTemplateVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO, IvrTaskTemplateVO.class); this.redisCache = redisCache; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/test/DingTalkService.java b/ruoyi-admin/src/main/java/com/ruoyi/web/test/DingTalkService.java index d53be27..800b7b8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/test/DingTalkService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/test/DingTalkService.java @@ -7,16 +7,12 @@ import com.dingtalk.api.request.OapiGettokenRequest; import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request; import com.dingtalk.api.request.OapiUserListidRequest; -import com.dingtalk.api.response.*; +import com.dingtalk.api.response.OapiGettokenResponse; +import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response; +import com.dingtalk.api.response.OapiUserListidResponse; import com.taobao.api.ApiException; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index cfe0c21..ae1d940 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -108,7 +108,7 @@ // 杩囨护璇锋眰 .authorizeRequests() // 瀵逛簬鐧诲綍login 娉ㄥ唽register 楠岃瘉鐮乧aptchaImage 鍏佽鍖垮悕璁块棶 - .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo","/socket","/API_ESB_Service","/API_ESB_Service/Run","/magic/web/**","/smartor/tasksingle/phoneCallBack","/smartor/robot/callstatus","/smartor/robot/aidialog","/smartor/robot/cdrinfo","/getToken","/smartor/ivrtask/getScriptInfoByCondition","/smartor/ivrtaskcalldetail/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/tasksingle/phoneCallBack", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/serviceTask/getScriptInfoByCondition", "/smartor/ivrtaskcalldetail/saveQuestionAnswer").permitAll() // 闈欐�佽祫婧愶紝鍙尶鍚嶈闂� .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() // 闄や笂闈㈠鐨勬墍鏈夎姹傚叏閮ㄩ渶瑕侀壌鏉冭璇� diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java index e5b8b60..0ed0b41 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java +++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java @@ -358,13 +358,6 @@ private Long noVoiceNum; /** - * 寮�鍦虹櫧 - */ - @Excel(name = "寮�鍦虹櫧") - @ApiModelProperty(value = "寮�鍦虹櫧") - private String prologue; - - /** * 妯℃澘搴撴ā鐗圛D */ @Excel(name = "妯℃澘搴撴ā鐗圛D") @@ -378,5 +371,10 @@ @ApiModelProperty(value = "妯℃澘搴撴ā鐗堝悕绉�") private String libtemplatename; + /** + * 鎸囧璇� + */ + @ApiModelProperty(value = "鎸囧璇�") + private String instruction; } diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java index 9bba1e6..66b9b8b 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java +++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java @@ -379,6 +379,11 @@ @ApiModelProperty(value = "鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎") private Integer isoperation; + /** + * 鎸囧璇� + */ + @ApiModelProperty(value = "鎸囧璇�") + private String instruction; /** * 鍏佽閲嶆嫧娆℃暟 diff --git a/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java b/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java index 0e21fef..c7d45e2 100644 --- a/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java +++ b/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java @@ -1,12 +1,10 @@ package com.smartor.domain; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; import java.util.Date; @@ -123,7 +121,7 @@ */ @Excel(name = "鍙戦�佺姸鎬� 锛�1 琚鍙� 2 寰呭彂閫� 3 宸插彂閫�") @ApiModelProperty("鍙戦�佺姸鎬� 锛�1 琚鍙� 2 寰呭彂閫� 3 宸插彂閫�") - private Integer sendStatus; + private Long sendState; /** @@ -155,6 +153,13 @@ @ApiModelProperty("鎿嶄綔浜�") private String operatePerson; + /** + * 灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌锛� + */ + @Excel(name = "灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌锛�") + @ApiModelProperty("灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌锛�") + private String hospType; + /** * 鎺ユ敹鏃堕棿 diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskcalldetailReq.java b/smartor/src/main/java/com/smartor/domain/ServiceSubTaskDetailReq.java similarity index 68% rename from smartor/src/main/java/com/smartor/domain/IvrTaskcalldetailReq.java rename to smartor/src/main/java/com/smartor/domain/ServiceSubTaskDetailReq.java index 5c8a560..820bd48 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskcalldetailReq.java +++ b/smartor/src/main/java/com/smartor/domain/ServiceSubTaskDetailReq.java @@ -13,14 +13,14 @@ import java.util.List; /** - * 闂鍥炵瓟鏄庣粏 ivr_taskcalldetailReq + * 闂鍥炵瓟鏄庣粏 * * @author ls * @date 2023-06-05 */ -@ApiModel(value = "IvrTaskcalldetailReq", description = "闂鍥炵瓟鏄庣粏") +@ApiModel(value = "ServiceSubTaskDetailReq", description = "闂鍥炵瓟鏄庣粏") @Data -public class IvrTaskcalldetailReq { +public class ServiceSubTaskDetailReq { @ApiModelProperty(value = "浠诲姟ID") private String param1; @@ -28,7 +28,10 @@ @ApiModelProperty(value = "鎮h�匢D") private String param2; - @ApiModelProperty(value = "闂鍥炵瓟鏄庣粏") + @ApiModelProperty(value = "闅忚闂鍥炵瓟鏄庣粏") private List<IvrTaskcalldetail> ivrTaskcalldetailList; + @ApiModelProperty(value = "闂嵎闂鍥炵瓟鏄庣粏") + private List<SvyTasksingledetail> svyTasksingledetailList; + } diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java similarity index 98% rename from smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java rename to smartor/src/main/java/com/smartor/domain/ServiceSubtask.java index ae8e550..da13128 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java +++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java @@ -15,9 +15,9 @@ * @author ruoyi * @date 2024-02-02 */ -@ApiModel(value = "IvrTaskSingle", description = "鍗曚竴闅忚浠诲姟") +@ApiModel(value = "ServiceSubtask", description = "鍗曚竴闅忚浠诲姟") @Data -public class IvrTaskSingle extends BaseEntity { +public class ServiceSubtask extends BaseEntity { private static final long serialVersionUID = 1L; /** diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java new file mode 100644 index 0000000..9b062ae --- /dev/null +++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskRecord.java @@ -0,0 +1,128 @@ +package com.smartor.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆戝璞� service_subtask_records + * + * @author ruoyi + * @date 2024-07-01 + */ +@Data +public class ServiceSubtaskRecord extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 浠诲姟鎵ц璁板綍ID + */ + @ApiModelProperty(value = "涓婚敭") + private Long id; + + /** + * 瀛愪换鍔D + */ + @Excel(name = "瀛愪换鍔D") + @ApiModelProperty(value = "瀛愪换鍔D") + private String taskid; + + /** + * 浠诲姟UUID + */ + @Excel(name = "浠诲姟UUID ") + @ApiModelProperty(value = "浠诲姟UUID") + private String uuid; + + /** + * 浠诲姟绫诲瀷(0閫氱煡銆�1瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧鈥︹��) + */ + @Excel(name = "浠诲姟绫诲瀷(0閫氱煡銆�1瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧鈥︹��)") + @ApiModelProperty(value = "浠诲姟绫诲瀷(0閫氱煡銆�1瀹f暀銆�2闂ㄨ瘖銆�3鍑洪櫌銆�4澶嶈瘖銆�5浣撴銆�6闂嵎銆�7鍖绘妧鈥︹��)") + private String tasktype; + + /** + * 浠诲姟褰㈠紡 1,澶氬獟浣� 2,绾歌川 3,鐢佃瘽 4,鐭俊 5.寰俊鍏紬鍙� 6.寰俊灏忕▼搴� 7.鏀粯瀹� 8.鏅鸿兘灏忕▼搴� 9.閽夐拤 + */ + @Excel(name = "浠诲姟褰㈠紡 1,澶氬獟浣� 2,绾歌川 3,鐢佃瘽 4,鐭俊 5.寰俊鍏紬鍙� 6.寰俊灏忕▼搴� 7.鏀粯瀹� 8.鏅鸿兘灏忕▼搴� 9.閽夐拤") + @ApiModelProperty(value = "浠诲姟褰㈠紡 1,澶氬獟浣� 2,绾歌川 3,鐢佃瘽 4,鐭俊 5.寰俊鍏紬鍙� 6.寰俊灏忕▼搴� 7.鏀粯瀹� 8.鏅鸿兘灏忕▼搴� 9.閽夐拤") + private String preachform; + + /** + * 璁板綍灞炴�э細0-鏈�鏂拌褰曪紝1-鍘嗗彶璁板綍 + */ + @Excel(name = "璁板綍灞炴�э細0-鏈�鏂拌褰曪紝1-鍘嗗彶璁板綍") + @ApiModelProperty(value = "璁板綍灞炴�э細0-鏈�鏂拌褰曪紝1-鍘嗗彶璁板綍") + private String recordtype; + + /** + * 寮�濮嬫椂闂� + */ + @Excel(name = "寮�濮嬫椂闂�") + @ApiModelProperty(value = "寮�濮嬫椂闂�") + private Long startTime; + + /** + * 缁撴潫鏃堕棿 + */ + @Excel(name = "缁撴潫鏃堕棿") + @ApiModelProperty(value = "缁撴潫鏃堕棿") + private Long endTime; + + /** + * 鎵ц缁撴灉 + */ + @Excel(name = "鎵ц缁撴灉") + @ApiModelProperty(value = "鎵ц缁撴灉") + private String result; + + /** + * 鍒犻櫎鏍囧織锛�0锛氭湭鍒犻櫎 1锛氬凡鍒犻櫎锛� + */ + @ApiModelProperty(value = "鍒犻櫎鏍囧織锛�0锛氭湭鍒犻櫎 1锛氬凡鍒犻櫎锛�") + private String delFlag; + + /** + * 涓婁紶鏍囧織锛�0锛氭湭涓婁紶 1锛氬凡涓婁紶锛� + */ + @Excel(name = "涓婁紶鏍囧織", readConverterExp = "0=锛氭湭涓婁紶,1=锛氬凡涓婁紶") + @ApiModelProperty(value = "涓婁紶鏍囧織锛�0锛氭湭涓婁紶 1锛氬凡涓婁紶锛�") + private Long isupload; + + /** + * 涓婁紶鏃堕棿 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "涓婁紶鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty(value = "涓婁紶鏃堕棿") + private Date uploadTime; + + /** + * 鏈烘瀯ID + */ + @Excel(name = "鏈烘瀯ID") + @ApiModelProperty(value = "鏈烘瀯ID") + private String orgid; + + /** + * 鐖禝D + */ + @Excel(name = "鐖禝D") + @ApiModelProperty(value = "鐖禝D") + private Long pid; + + /** + * GUID + */ + @Excel(name = "GUID") + @ApiModelProperty(value = "GUID") + private String guid; + + +} diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java similarity index 98% rename from smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java rename to smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java index 4bca535..9c88a3c 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java +++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java @@ -17,9 +17,9 @@ * @author ruoyi * @date 2024-02-02 */ -@ApiModel(value = "IvrTaskSingleVO", description = "鍗曚竴闅忚浠诲姟鍏ュ弬") +@ApiModel(value = "ServiceSubtaskVO", description = "鍗曚竴闅忚浠诲姟鍏ュ弬") @Data -public class IvrTaskSingleVO extends BaseEntity { +public class ServiceSubtaskVO extends BaseEntity { private static final long serialVersionUID = 1L; /** diff --git a/smartor/src/main/java/com/smartor/domain/IvrTask.java b/smartor/src/main/java/com/smartor/domain/ServiceTask.java similarity index 95% rename from smartor/src/main/java/com/smartor/domain/IvrTask.java rename to smartor/src/main/java/com/smartor/domain/ServiceTask.java index 31f92f8..850bf5d 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTask.java +++ b/smartor/src/main/java/com/smartor/domain/ServiceTask.java @@ -15,9 +15,9 @@ * @author smartor * @date 2023-03-24 */ -@ApiModel(value = "IvrTask", description = "浠诲姟瀵硅薄") +@ApiModel(value = "ServiceTask", description = "浠诲姟瀵硅薄") @Data -public class IvrTask extends BaseEntity { +public class ServiceTask extends BaseEntity { private static final long serialVersionUID = 1L; /** @@ -146,10 +146,10 @@ private Date checktime; /** - * 1锛屽嚭闄㈤殢璁匡紱2锛屼綋妫�閫氱煡锛�3锛屾弧鎰忓害璋冩煡锛�4锛屽鏁欙紱 + * "1锛岄殢璁匡紱2锛岄棶鍗凤紱3.瀹f暀锛� */ - @Excel(name = " 1锛屽嚭闄㈤殢璁匡紱2锛屼綋妫�閫氱煡锛�3锛屾弧鎰忓害璋冩煡锛�4锛屽鏁欙紱 ") - @ApiModelProperty(value = "1锛屽嚭闄㈤殢璁匡紱2锛屼綋妫�閫氱煡锛�3锛屾弧鎰忓害璋冩煡锛�4锛屽鏁欙紱") + @Excel(name = "1锛岄殢璁匡紱2锛岄棶鍗凤紱3.瀹f暀锛� ") + @ApiModelProperty(value = "1锛岄殢璁匡紱2锛岄棶鍗凤紱3.瀹f暀锛�") private String type; /** diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskScriptQues.java b/smartor/src/main/java/com/smartor/domain/ServiceTaskScriptQues.java similarity index 64% rename from smartor/src/main/java/com/smartor/domain/IvrTaskScriptQues.java rename to smartor/src/main/java/com/smartor/domain/ServiceTaskScriptQues.java index 410966e..30d8560 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskScriptQues.java +++ b/smartor/src/main/java/com/smartor/domain/ServiceTaskScriptQues.java @@ -1,23 +1,19 @@ 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; - /** - * 璇煶浠诲姟瀵硅薄 ivr_task + * 璇煶浠诲姟瀵硅薄 service_task * * @author smartor * @date 2023-03-24 */ -@ApiModel(value = "IvrTaskScriptQues", description = "浠诲姟瀵硅薄") +@ApiModel(value = "ServiceTaskScriptQues", description = "浠诲姟瀵硅薄") @Data -public class IvrTaskScriptQues { +public class ServiceTaskScriptQues { /** * taskid diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskVO.java b/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java similarity index 96% rename from smartor/src/main/java/com/smartor/domain/IvrTaskVO.java rename to smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java index 1a4310a..c7dc32d 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskVO.java +++ b/smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java @@ -5,9 +5,8 @@ import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -19,7 +18,7 @@ * @date 2023-03-24 */ @Data -public class IvrTaskVO extends BaseEntity { +public class ServiceTaskVO extends BaseEntity { private static final long serialVersionUID = 1L; /** @@ -249,7 +248,7 @@ */ @Excel(name = " 瀹f偅鑰呬笌鍗曚竴浠诲姟鍏宠仈琛ㄩ泦鍚�") @ApiModelProperty(value = "鎮h�呬笌鍗曚竴浠诲姟鍏宠仈琛ㄩ泦鍚�") - private List<PatTaskRelevance> patTaskRelevances; + private List<PatTaskRelevance> patTaskRelevances = new ArrayList<>(); /** * 鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎 diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java index 7ccc877..3141387 100644 --- a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java +++ b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java @@ -39,8 +39,8 @@ /** * 闂嵎ID */ - @Excel(name = " 闂嵎ID ") - @ApiModelProperty("闂嵎ID") + @Excel(name = " 闂嵎妯℃澘ID ") + @ApiModelProperty("闂嵎妯℃澘ID") private Long svyid; /** @@ -55,7 +55,7 @@ */ @Excel(name = " 棰樼洰Code ") @ApiModelProperty("棰樼洰Code") - private String scriptCode; + private String seqno; /** * 鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎 @@ -68,7 +68,7 @@ */ @Excel(name = " 棰樼洰 ") @ApiModelProperty("棰樼洰") - private String script; + private String scriptContent; /** * 棰樼洰鏍囩 @@ -158,7 +158,7 @@ */ @Excel(name = "棰樼洰鍐呭") @ApiModelProperty("棰樼洰鎻忚堪") - private String scriptContent; + private String scriptDesc; /** * 棰樼洰鍥剧墖 @@ -235,6 +235,6 @@ */ @Excel(name = "棰樼洰涓婚") @ApiModelProperty("棰樼洰涓婚") - private String topic; + private String scriptTopic; } diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java new file mode 100644 index 0000000..9508f72 --- /dev/null +++ b/smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java @@ -0,0 +1,240 @@ +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; + +/** + * 妯℃澘闂嵎棰樼洰瀵硅薄 svy_lib_template_script + * + * @author ruoyi + * @date 2024-06-18 + */ +@Data +@ApiModel(value = "SvyLibTemplateScriptVO", description = "妯℃澘闂嵎棰樼洰瀵硅薄") +public class SvyLibTemplateScriptVO extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 鑷ID + */ + @ApiModelProperty("鑷ID") + private Long id; + + /** + * 鑰佺増鏈琁D + */ + @Excel(name = " 鑰佺増鏈琁D ") + @ApiModelProperty("鑰佺増鏈琁D") + private Long oldid; + + /** + * 闂嵎ID + */ + @Excel(name = " 闂嵎妯℃澘ID ") + @ApiModelProperty("闂嵎妯℃澘ID") + private Long svyid; + + /** + * 棰樼洰绫诲瀷;鏋氫妇 1.鍗曢�� 2澶氶�� 3濉┖ 4鍏跺畠 + */ + @Excel(name = " 棰樼洰绫诲瀷;鏋氫妇 1.鍗曢�� 2澶氶�� 3濉┖ 4鍏跺畠") + @ApiModelProperty("棰樼洰绫诲瀷;鏋氫妇 1.鍗曢�� 2澶氶�� 3濉┖ 4鍏跺畠") + private String scriptType; + + /** + * 棰樼洰Code + */ + @Excel(name = " 棰樼洰Code ") + @ApiModelProperty("棰樼洰Code") + private String seqno; + + /** + * 鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎 + */ + @ApiModelProperty(value = "鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎") + private Integer isoperation; + + /** + * 棰樼洰 + */ + @Excel(name = " 棰樼洰 ") + @ApiModelProperty("棰樼洰") + private String scriptContent; + + /** + * 棰樼洰鏍囩 + */ + @Excel(name = "棰樼洰鏍囩") + @ApiModelProperty("棰樼洰鏍囩") + private String tag; + + /** + * 鎺掑簭 + */ + @Excel(name = " 鎺掑簭 ") + @ApiModelProperty("鎺掑簭") + private Long sort; + + /** + * 鏄惁蹇呭~ 0蹇呭~ 1涓嶅繀濉� + */ + @Excel(name = " 鏄惁蹇呭~ 0蹇呭~ 1涓嶅繀濉�") + @ApiModelProperty("鏄惁蹇呭~ 0蹇呭~ 1涓嶅繀濉�") + private String ismandatory; + + /** + * 鏄惁闅愯棌 + */ + @Excel(name = " 鏄惁闅愯棌 ") + @ApiModelProperty("鏄惁闅愯棌") + private Long ishide; + + /** + * 鍒犻櫎鏍囪 + */ + @ApiModelProperty("鍒犻櫎鏍囪") + private String delFlag; + + /** + * 鏈烘瀯ID + */ + @Excel(name = " 鏈烘瀯ID ") + @ApiModelProperty("鏈烘瀯ID") + private String orgid; + + /** + * 涓婁紶鏍囪 + */ + @Excel(name = " 涓婁紶鏍囪 ") + @ApiModelProperty("涓婁紶鏍囪") + private Long isupload; + + /** + * 涓婁紶鏃堕棿 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = " 涓婁紶鏃堕棿 ", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty("涓婁紶鏃堕棿") + private Date uploadTime; + + /** + * 搴熷純 + */ + @ApiModelProperty("锛堝簾寮冿級") + private Long svyTopicid; + + /** + * 鐖禝D + */ + @Excel(name = "鐖禝D") + @ApiModelProperty("鐖禝D") + private Long pid; + + /** + * GUID + */ + @Excel(name = "GUID") + @ApiModelProperty("GUID") + private String guid; + + /** + * 鍒嗙被id + */ + @Excel(name = "鍒嗙被id") + @ApiModelProperty("鍒嗙被id") + private Long categoryid; + + /** + * 棰樼洰鍐呭 + */ + @Excel(name = "棰樼洰鍐呭") + @ApiModelProperty("棰樼洰鎻忚堪") + private String scriptDesc; + + /** + * 棰樼洰鍥剧墖 + */ + @Excel(name = "棰樼洰鍥剧墖") + @ApiModelProperty("棰樼洰鍥剧墖") + private String scriptPicture; + + /** + * 閫傜敤鏂瑰紡锛氳皟鏌ヨ〃1锛屾櫤鑳借闊�2銆佷汉宸�3 + */ + @Excel(name = "閫傜敤鏂瑰紡锛氳皟鏌ヨ〃1锛屾櫤鑳借闊�2銆佷汉宸�3") + @ApiModelProperty("閫傜敤鏂瑰紡锛氳皟鏌ヨ〃1锛屾櫤鑳借闊�2銆佷汉宸�3") + private String suitway; + + /** + * 鏄惁鍙敤 0鍙敤 1涓嶅彲鐢� + */ + @Excel(name = "鏄惁鍙敤 0鍙敤 1涓嶅彲鐢�") + @ApiModelProperty("鏄惁鍙敤 0鍙敤 1涓嶅彲鐢�") + private String isavailable; + + /** + * 璇█ + */ + @Excel(name = "璇█") + @ApiModelProperty("璇█") + private String language; + + /** + * 鍏跺畠鏁版嵁锛堝瓨鍌ㄥ彉閲忥級 + */ + @Excel(name = "鍏跺畠鏁版嵁", readConverterExp = "瀛�=鍌ㄥ彉閲�") + @ApiModelProperty("鍏跺畠鏁版嵁锛堝瓨鍌ㄥ彉閲忥級") + private String otherdata; + + /** + * 鍊肩被鍨嬶紙1 閫夐」 2 鏂囨湰 3 鏁板�硷級 + */ + @Excel(name = "鍊肩被鍨�", readConverterExp = "1=,閫�=椤�,2=,鏂�=鏈�,3=,鏁�=鍊�") + @ApiModelProperty("鍊肩被鍨嬶紙1 閫夐」 2 鏂囨湰 3 鏁板�硷級") + private String valueType; + + /** + * 鍥炲锛堟寚闂鐨勫洖澶嶏紝缁欓棶绛旈鐢ㄧ殑锛� + */ + @Excel(name = "鍥炲", readConverterExp = "鎸�=闂鐨勫洖澶嶏紝缁欓棶绛旈鐢ㄧ殑") + @ApiModelProperty("鍥炲锛堟寚闂鐨勫洖澶嶏紝缁欓棶绛旈鐢ㄧ殑锛�") + private String reply; + + /** + * 鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾� + */ + @Excel(name = "鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾�") + @ApiModelProperty("鍒嗗�肩被鍨嬶細1锛氭暟瀛楋紝2锛氱瓑绾�") + private String scoretype; + + /** + * 妯℃澘闂閫夐」闆嗗悎 + */ + @Excel(name = "妯℃澘闂閫夐」闆嗗悎") + @ApiModelProperty("妯℃澘闂閫夐」闆嗗悎") + private List<SvyLibTemplateTargetoption> svyLibTemplateTargetoptions = new ArrayList<>(); + + /** + * 棰樼洰鍒嗗�硷細鏁板瓧1,2绛夛紱瀛楁瘝A銆丅锛孋锛孌绛夛紱 + */ + @Excel(name = "棰樼洰鍒嗗�硷細鏁板瓧1,2绛夛紱瀛楁瘝A銆丅锛孋锛孌绛夛紱") + @ApiModelProperty("棰樼洰鍒嗗�硷細鏁板瓧1,2绛夛紱瀛楁瘝A銆丅锛孋锛孌绛夛紱") + private String score; + + /** + * 棰樼洰涓婚 + */ + @Excel(name = "棰樼洰涓婚") + @ApiModelProperty("棰樼洰涓婚") + private String scriptTopic; + + +} diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskAnswer.java b/smartor/src/main/java/com/smartor/domain/SvyTaskAnswer.java new file mode 100644 index 0000000..84086c3 --- /dev/null +++ b/smartor/src/main/java/com/smartor/domain/SvyTaskAnswer.java @@ -0,0 +1,108 @@ +package com.smartor.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 浠诲姟闂嵎闂閫夐」瀵硅薄 svy_task_answer + * + * @author ruoyi + * @date 2024-06-27 + */ +@Data +@ApiModel(value = "SvyTaskAnswer", description = "浠诲姟闂嵎闂閫夐」瀵硅薄") +public class SvyTaskAnswer extends BaseEntity { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "鑷ID") + private Long id; + + /** + * 浠诲姟ID + */ + @ApiModelProperty(value = "浠诲姟ID") + private Long taskid; + + /** + * 瀛愪换鍔D + */ + @ApiModelProperty(value = "瀛愪换鍔D") + private Long singleid; + + /** + * 棰樼洰ID + */ + @ApiModelProperty(value = "棰樼洰ID") + private Long scriptid; + + /** + * 棰樼洰绫诲瀷 + */ + @ApiModelProperty(value = "棰樼洰绫诲瀷") + private Long scriptType; + + /** + * 寰楀垎锛�1銆�2銆�3锛屾垨A銆丅銆丆锛屾垨浼樸�佽壇銆佸強鏍硷級 + */ + @ApiModelProperty(value = "寰楀垎 1=銆�2銆�3锛屾垨A銆丅銆丆锛屾垨浼樸�佽壇銆佸強鏍�") + private String score; + + /** + * 鍥炵瓟锛堝厑璁稿閫夛級 + */ + @ApiModelProperty(value = "鍥炵瓟 鍏�=璁稿閫�") + private String answer; + + /** + * 璇勮 + */ + @ApiModelProperty(value = "璇勮") + private String comment; + + /** + * 闇�瑕佽窡杩涳紙鏄細1銆佸惁锛�0锛� + */ + @ApiModelProperty(value = "闇�瑕佽窡杩� 鏄�=锛�1銆佸惁锛�0") + private String istrack; + + /** + * 寮傚父棰勮锛堟槸锛�1銆佸惁锛�0锛� + */ + @ApiModelProperty(value = "寮傚父棰勮 鏄�=锛�1銆佸惁锛�0") + private String isabnormal; + + /** + * 鍒犻櫎鏍囧織锛�0锛氭湭鍒犻櫎 1锛氬凡鍒犻櫎锛� + */ + private String delFlag; + + /** + * 涓婁紶鏍囧織锛�0锛氭湭涓婁紶 1锛氬凡涓婁紶锛� + */ + @ApiModelProperty(value = "涓婁紶鏍囧織 0=锛氭湭涓婁紶,1=锛氬凡涓婁紶") + private Long isupload; + + /** + * 涓婁紶鏃堕棿 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "涓婁紶鏃堕棿") + private Date uploadTime; + + /** + * 鐖禝D + */ + @ApiModelProperty(value = "鐖禝D") + private String pid; + + /** + * GUID + */ + @ApiModelProperty(value = "GUID") + private String guid; + +} diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java index 358f631..7f9eb93 100644 --- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java +++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java @@ -223,5 +223,15 @@ @ApiModelProperty(value = "浠诲姟ID") private Long taskid; + @ApiModelProperty(value = "寮�鍦虹櫧") + private String prologue; + + @ApiModelProperty(value = "鎸囧璇�") + private String instruction; + + @ApiModelProperty(value = "缁撴潫璇�") + private String conclusion; + + } diff --git a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java index 75689cd..0de95b7 100644 --- a/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java +++ b/smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java @@ -230,6 +230,15 @@ @ApiModelProperty(value = "鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎") private Integer isoperation; + @ApiModelProperty(value = "寮�鍦虹櫧") + private String prologue; + + @ApiModelProperty(value = "鎸囧璇�") + private String instruction; + + @ApiModelProperty(value = "缁撴潫璇�") + private String conclusion; + @ApiModelProperty(value = "妯℃澘闂闆嗗悎") private List<SvyTaskTemplateScriptVO> svyTaskTemplateScriptVOS = new ArrayList<>(); diff --git a/smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java b/smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java deleted file mode 100644 index 8320b14..0000000 --- a/smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.smartor.mapper; - -import java.util.List; -import com.smartor.domain.IvrTask; -import org.apache.ibatis.annotations.Mapper; - -/** - * 璇煶浠诲姟Mapper鎺ュ彛 - * - * @author smartor - * @date 2023-03-24 - */ -@Mapper -public interface IvrTaskMapper -{ - /** - * 鏌ヨ璇煶浠诲姟 - * - * @param taskid 璇煶浠诲姟涓婚敭 - * @return 璇煶浠诲姟 - */ - public IvrTask selectIvrTaskByTaskid(Long taskid); - - /** - * 鏌ヨ璇煶浠诲姟鍒楄〃 - * - * @param ivrTask 璇煶浠诲姟 - * @return 璇煶浠诲姟闆嗗悎 - */ - public List<IvrTask> selectIvrTaskList(IvrTask ivrTask); - - /** - * 鏂板璇煶浠诲姟 - * - * @param ivrTask 璇煶浠诲姟 - * @return 缁撴灉 - */ - public int insertIvrTask(IvrTask ivrTask); - - /** - * 淇敼璇煶浠诲姟 - * - * @param ivrTask 璇煶浠诲姟 - * @return 缁撴灉 - */ - public int updateIvrTask(IvrTask ivrTask); - - /** - * 鍒犻櫎璇煶浠诲姟 - * - * @param taskid 璇煶浠诲姟涓婚敭 - * @return 缁撴灉 - */ - public Boolean deleteIvrTaskByTaskid(Long taskid); - - /** - * 鎵归噺鍒犻櫎璇煶浠诲姟 - * - * @param taskids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 - * @return 缁撴灉 - */ - public int deleteIvrTaskByTaskids(Long[] taskids); -} diff --git a/smartor/src/main/java/com/smartor/mapper/IvrTaskSingleMapper.java b/smartor/src/main/java/com/smartor/mapper/IvrTaskSingleMapper.java deleted file mode 100644 index fc13c8b..0000000 --- a/smartor/src/main/java/com/smartor/mapper/IvrTaskSingleMapper.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.smartor.mapper; - -import com.smartor.domain.IvrTaskSingle; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 鍗曚竴浠诲姟锛堥殢璁匡級Mapper鎺ュ彛 - * - * @author ruoyi - * @date 2024-02-02 - */ -@Mapper -public interface IvrTaskSingleMapper { - /** - * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @param id 鍗曚竴浠诲姟锛堥殢璁匡級涓婚敭 - * @return 鍗曚竴浠诲姟锛堥殢璁匡級 - */ - public IvrTaskSingle selectIvrTaskcallById(Long id); - - /** - * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級鍒楄〃 - * - * @param ivrTaskSingle 鍗曚竴浠诲姟锛堥殢璁匡級 - * @return 鍗曚竴浠诲姟锛堥殢璁匡級闆嗗悎 - */ - public List<IvrTaskSingle> selectIvrTaskcallList(IvrTaskSingle ivrTaskSingle); - - /** - * 鏂板鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @param ivrTaskSingle 鍗曚竴浠诲姟锛堥殢璁匡級 - * @return 缁撴灉 - */ - public int insertIvrTaskcall(IvrTaskSingle ivrTaskSingle); - - /** - * 淇敼鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @return 缁撴灉 - */ - public Boolean updateIvrTaskcall(IvrTaskSingle ivrTaskSingle); - - public Boolean updateIvrTaskcallByCondition(IvrTaskSingle ivrTaskSingle); - - /** - * 鍒犻櫎鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @param id 鍗曚竴浠诲姟锛堥殢璁匡級涓婚敭 - * @return 缁撴灉 - */ - public int deleteIvrTaskcallById(Long id); - - public int deleteIvrTaskcallByCondition(@Param("taskid") Long id, @Param("patid") Long patid); - - /** - * 鍒犻櫎鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @return 缁撴灉 - */ - public List<IvrTaskSingle> getDataByTime(@Param("beganTime") String beganTime, @Param("endTime") String endTime); - -} diff --git a/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java b/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java new file mode 100644 index 0000000..447ab4c --- /dev/null +++ b/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java @@ -0,0 +1,67 @@ +package com.smartor.mapper; + +import com.smartor.domain.ServiceSubtask; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 鍗曚竴浠诲姟锛堥殢璁匡級Mapper鎺ュ彛 + * + * @author ruoyi + * @date 2024-02-02 + */ +@Mapper +public interface ServiceSubtaskMapper { + /** + * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @param id 鍗曚竴浠诲姟锛堥殢璁匡級涓婚敭 + * @return 鍗曚竴浠诲姟锛堥殢璁匡級 + */ + public ServiceSubtask selectServiceSubtaskById(Long id); + + /** + * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級鍒楄〃 + * + * @param serviceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級 + * @return 鍗曚竴浠诲姟锛堥殢璁匡級闆嗗悎 + */ + public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtask serviceSubtask); + + /** + * 鏂板鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @param ServiceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級 + * @return 缁撴灉 + */ + public int insertServiceSubtask(ServiceSubtask ServiceSubtask); + + /** + * 淇敼鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @return 缁撴灉 + */ + public Boolean updateServiceSubtask(ServiceSubtask ServiceSubtask); + + public Boolean updateServiceSubtaskByCondition(ServiceSubtask ServiceSubtask); + + /** + * 鍒犻櫎鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @param id 鍗曚竴浠诲姟锛堥殢璁匡級涓婚敭 + * @return 缁撴灉 + */ + public int deleteServiceSubtaskById(Long id); + + public int deleteServiceSubtaskByCondition(@Param("taskid") Long id, @Param("patid") Long patid); + + /** + * 鍒犻櫎鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @return 缁撴灉 + */ + public List<ServiceSubtask> getDataByTime(@Param("beganTime") String beganTime, @Param("endTime") String endTime); + +} diff --git a/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskRecordMapper.java b/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskRecordMapper.java new file mode 100644 index 0000000..20ca630 --- /dev/null +++ b/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskRecordMapper.java @@ -0,0 +1,63 @@ +package com.smartor.mapper; + +import com.smartor.domain.ServiceSubtaskRecord; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆慚apper鎺ュ彛 + * + * @author ruoyi + * @date 2024-07-01 + */ +@Mapper +public interface ServiceSubtaskRecordMapper { + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆� + */ + public ServiceSubtaskRecord selectServiceSubtaskRecordById(Long id); + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆戦泦鍚� + */ + public List<ServiceSubtaskRecord> selectServiceSubtaskRecordList(ServiceSubtaskRecord serviceSubtaskRecord); + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + public int insertServiceSubtaskRecord(ServiceSubtaskRecord serviceSubtaskRecord); + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + public int updateServiceSubtaskRecord(ServiceSubtaskRecord serviceSubtaskRecord); + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 缁撴灉 + */ + public int deleteServiceSubtaskRecordById(Long id); + + /** + * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteServiceSubtaskRecordByIds(Long[] ids); +} diff --git a/smartor/src/main/java/com/smartor/mapper/ServiceTaskMapper.java b/smartor/src/main/java/com/smartor/mapper/ServiceTaskMapper.java new file mode 100644 index 0000000..db1adf5 --- /dev/null +++ b/smartor/src/main/java/com/smartor/mapper/ServiceTaskMapper.java @@ -0,0 +1,63 @@ +package com.smartor.mapper; + +import java.util.List; +import com.smartor.domain.ServiceTask; +import org.apache.ibatis.annotations.Mapper; + +/** + * 璇煶浠诲姟Mapper鎺ュ彛 + * + * @author smartor + * @date 2023-03-24 + */ +@Mapper +public interface ServiceTaskMapper +{ + /** + * 鏌ヨ璇煶浠诲姟 + * + * @param taskid 璇煶浠诲姟涓婚敭 + * @return 璇煶浠诲姟 + */ + public ServiceTask selectServiceTaskByTaskid(Long taskid); + + /** + * 鏌ヨ璇煶浠诲姟鍒楄〃 + * + * @param ServiceTask 璇煶浠诲姟 + * @return 璇煶浠诲姟闆嗗悎 + */ + public List<ServiceTask> selectServiceTaskList(ServiceTask ServiceTask); + + /** + * 鏂板璇煶浠诲姟 + * + * @param ServiceTask 璇煶浠诲姟 + * @return 缁撴灉 + */ + public int insertServiceTask(ServiceTask ServiceTask); + + /** + * 淇敼璇煶浠诲姟 + * + * @param ServiceTask 璇煶浠诲姟 + * @return 缁撴灉 + */ + public int updateServiceTask(ServiceTask ServiceTask); + + /** + * 鍒犻櫎璇煶浠诲姟 + * + * @param taskid 璇煶浠诲姟涓婚敭 + * @return 缁撴灉 + */ + public Boolean deleteServiceTaskByTaskid(Long taskid); + + /** + * 鎵归噺鍒犻櫎璇煶浠诲姟 + * + * @param taskids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteServiceTaskByTaskids(Long[] taskids); +} diff --git a/smartor/src/main/java/com/smartor/mapper/SvyTaskAnswerMapper.java b/smartor/src/main/java/com/smartor/mapper/SvyTaskAnswerMapper.java new file mode 100644 index 0000000..5f9b438 --- /dev/null +++ b/smartor/src/main/java/com/smartor/mapper/SvyTaskAnswerMapper.java @@ -0,0 +1,63 @@ +package com.smartor.mapper; + +import com.smartor.domain.SvyTaskAnswer; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 浠诲姟闂嵎闂閫夐」Mapper鎺ュ彛 + * + * @author ruoyi + * @date 2024-06-27 + */ +@Mapper +public interface SvyTaskAnswerMapper { + /** + * 鏌ヨ浠诲姟闂嵎闂閫夐」 + * + * @param id 浠诲姟闂嵎闂閫夐」涓婚敭 + * @return 浠诲姟闂嵎闂閫夐」 + */ + public SvyTaskAnswer selectSvyTaskAnswerById(Long id); + + /** + * 鏌ヨ浠诲姟闂嵎闂閫夐」鍒楄〃 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 浠诲姟闂嵎闂閫夐」闆嗗悎 + */ + public List<SvyTaskAnswer> selectSvyTaskAnswerList(SvyTaskAnswer svyTaskAnswer); + + /** + * 鏂板浠诲姟闂嵎闂閫夐」 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 缁撴灉 + */ + public int insertSvyTaskAnswer(SvyTaskAnswer svyTaskAnswer); + + /** + * 淇敼浠诲姟闂嵎闂閫夐」 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 缁撴灉 + */ + public int updateSvyTaskAnswer(SvyTaskAnswer svyTaskAnswer); + + /** + * 鍒犻櫎浠诲姟闂嵎闂閫夐」 + * + * @param id 浠诲姟闂嵎闂閫夐」涓婚敭 + * @return 缁撴灉 + */ + public int deleteSvyTaskAnswerById(Long id); + + /** + * 鎵归噺鍒犻櫎浠诲姟闂嵎闂閫夐」 + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteSvyTaskAnswerByIds(Long[] ids); +} diff --git a/smartor/src/main/java/com/smartor/service/AIRobotPhoneCallBackService.java b/smartor/src/main/java/com/smartor/service/AIRobotPhoneCallBackService.java index 1bea79b..367b6c5 100644 --- a/smartor/src/main/java/com/smartor/service/AIRobotPhoneCallBackService.java +++ b/smartor/src/main/java/com/smartor/service/AIRobotPhoneCallBackService.java @@ -1,14 +1,8 @@ package com.smartor.service; -import com.smartor.domain.IvrTaskSingle; -import com.smartor.domain.IvrTaskSingleVO; -import com.smartor.domain.PhoneCallBackVO; -import com.smartor.domain.SendTaskVO; import com.smartor.domain.robot.back.RobotAIDialogBack; import com.smartor.domain.robot.back.RobotCallBack; import com.smartor.domain.robot.back.RobotcdrInfoBack; - -import java.util.List; /** * 鏈嶅姟鍥炶皟Service鎺ュ彛 @@ -37,6 +31,7 @@ /** * 鎸傛満璁¤垂淇℃伅杩斿洖鏁版嵁鎺ュ彛 + * * @param robotcdrInfoBack * @return */ diff --git a/smartor/src/main/java/com/smartor/service/IIvrTaskService.java b/smartor/src/main/java/com/smartor/service/IIvrTaskService.java deleted file mode 100644 index 85319fe..0000000 --- a/smartor/src/main/java/com/smartor/service/IIvrTaskService.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.smartor.service; - -import java.util.List; - -import com.smartor.domain.IvrLibaTemplateScript; -import com.smartor.domain.IvrLibaTemplateScriptVO; -import com.smartor.domain.IvrTask; -import com.smartor.domain.SendTaskVO; -import org.springframework.web.bind.annotation.PathVariable; - -/** - * 璇煶浠诲姟Service鎺ュ彛 - * - * @author smartor - * @date 2023-03-24 - */ -public interface IIvrTaskService { - /** - * 鏌ヨ璇煶浠诲姟 - * - * @param taskid 璇煶浠诲姟涓婚敭 - * @return 璇煶浠诲姟 - */ - public IvrTask selectIvrTaskByTaskid(Long taskid); - - /** - * 鏌ヨ璇煶浠诲姟鍒楄〃 - * - * @param ivrTask 璇煶浠诲姟 - * @return 璇煶浠诲姟闆嗗悎 - */ - public List<IvrTask> selectIvrTaskList(IvrTask ivrTask); - - /** - * 鏂板璇煶浠诲姟 - * - * @param ivrTask 璇煶浠诲姟 - * @return 缁撴灉 - */ - public int insertIvrTask(IvrTask ivrTask); - - /** - * 淇敼璇煶浠诲姟 - * - * @param ivrTask 璇煶浠诲姟 - * @return 缁撴灉 - */ - public int updateIvrTask(IvrTask ivrTask); - - /** - * 鎵归噺鍒犻櫎璇煶浠诲姟 - * - * @param taskids 闇�瑕佸垹闄ょ殑璇煶浠诲姟涓婚敭闆嗗悎 - * @return 缁撴灉 - */ - public int deleteIvrTaskByTaskids(Long[] taskids); - - /** - * 鍒犻櫎璇煶浠诲姟淇℃伅 - * - * @param taskid 璇煶浠诲姟涓婚敭 - * @return 缁撴灉 - */ - public Boolean deleteIvrTaskByTaskid(Long taskid); - - public List<IvrLibaTemplateScriptVO> getScriptInfoByCondition(Long taskid, Long patid); - -} diff --git a/smartor/src/main/java/com/smartor/service/IIvrTaskSingleService.java b/smartor/src/main/java/com/smartor/service/IIvrTaskSingleService.java deleted file mode 100644 index 2dce489..0000000 --- a/smartor/src/main/java/com/smartor/service/IIvrTaskSingleService.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.smartor.service; - -import com.smartor.domain.IvrTaskSingle; -import com.smartor.domain.IvrTaskVO; -import com.smartor.domain.PhoneCallBackVO; -import com.smartor.domain.SendTaskVO; - -import java.util.List; - -/** - * 鍗曚竴浠诲姟锛堥殢璁匡級Service鎺ュ彛 - * - * @author ruoyi - * @date 2024-02-02 - */ -public interface IIvrTaskSingleService { - /** - * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @param id 鍗曚竴浠诲姟锛堥殢璁匡級涓婚敭 - * @return 鍗曚竴浠诲姟锛堥殢璁匡級 - */ - public IvrTaskSingle selectIvrTaskcallById(Long id); - - /** - * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級鍒楄〃 - * - * @param ivrTaskcall 鍗曚竴浠诲姟锛堥殢璁匡級 - * @return 鍗曚竴浠诲姟锛堥殢璁匡級闆嗗悎 - */ - public List<IvrTaskSingle> selectIvrTaskcallList(IvrTaskSingle ivrTaskcall); - - /** - * 鏍规嵁鏉′欢鏌ヨ浠诲姟淇℃伅 - * - * @param ivrTaskcall - * @return - */ - public IvrTaskVO queryTaskByCondition(IvrTaskSingle ivrTaskcall); - - /** - * 鏌ヨ鎮h�呴殢璁夸俊鎭� - */ - public List<IvrTaskSingle> patItem(IvrTaskSingle ivrTaskcall); - - /** - * 鏂板鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @param ivrTaskcall 鍗曚竴浠诲姟锛堥殢璁匡級 - * @return 缁撴灉 - */ - public int insertIvrTaskcall(IvrTaskSingle ivrTaskcall); - - /** - * 淇敼鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @param ivrTaskcall 鍗曚竴浠诲姟锛堥殢璁匡級 - * @return 缁撴灉 - */ - public Boolean updateIvrTaskcall(IvrTaskSingle ivrTaskcall); - - /** - * 鎵归噺鍒犻櫎鍗曚竴浠诲姟锛堥殢璁匡級 - * - * @param ids 闇�瑕佸垹闄ょ殑鍗曚竴浠诲姟锛堥殢璁匡級涓婚敭闆嗗悎 - * @return 缁撴灉 - */ - public int deleteIvrTaskcallByIds(Long[] ids); - - /** - * 鏂板瀹f暀浠诲姟 - * - * @param ivrTaskVO 鍗曚竴浠诲姟 - * @return 缁撴灉 - */ - public int insertOrUpdateTask(IvrTaskVO ivrTaskVO); - - - - /** - * 鐢佃瘽鍥炶皟浠诲姟 - * - * @param phoneCallBackVO - * @return 缁撴灉 - */ - public void phoneCallBack(PhoneCallBackVO phoneCallBackVO); - -} diff --git a/smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java b/smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java index dd60851..bc0f41b 100644 --- a/smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java +++ b/smartor/src/main/java/com/smartor/service/IIvrTaskcalldetailService.java @@ -1,9 +1,8 @@ package com.smartor.service; -import java.util.List; - import com.smartor.domain.IvrTaskcalldetail; -import com.smartor.domain.IvrTaskcalldetailReq; + +import java.util.List; /** * 璇煶浠诲姟鍛煎彨鏄庣粏Service鎺ュ彛 @@ -59,6 +58,4 @@ * @return 缁撴灉 */ public int deleteIvrTaskcalldetailByCalldetailid(String calldetailid); - - public Integer saveQuestionAnswer(IvrTaskcalldetailReq ivrTaskcalldetailReq); } diff --git a/smartor/src/main/java/com/smartor/service/IServiceSubtaskRecordService.java b/smartor/src/main/java/com/smartor/service/IServiceSubtaskRecordService.java new file mode 100644 index 0000000..40ebf08 --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/IServiceSubtaskRecordService.java @@ -0,0 +1,62 @@ +package com.smartor.service; + +import com.smartor.domain.ServiceSubtaskRecord; + +import java.util.List; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice鎺ュ彛 + * + * @author ruoyi + * @date 2024-07-01 + */ +public interface IServiceSubtaskRecordService +{ + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆� + */ + public ServiceSubtaskRecord selectServiceSubtaskRecordById(Long id); + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆戦泦鍚� + */ + public List<ServiceSubtaskRecord> selectServiceSubtaskRecordList(ServiceSubtaskRecord serviceSubtaskRecord); + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + public int insertServiceSubtaskRecord(ServiceSubtaskRecord serviceSubtaskRecord); + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + public int updateServiceSubtaskRecord(ServiceSubtaskRecord serviceSubtaskRecord); + + /** + * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿泦鍚� + * @return 缁撴灉 + */ + public int deleteServiceSubtaskRecordByIds(Long[] ids); + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 缁撴灉 + */ + public int deleteServiceSubtaskRecordById(Long id); +} diff --git a/smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java b/smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java new file mode 100644 index 0000000..8fb4c45 --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java @@ -0,0 +1,87 @@ +package com.smartor.service; + +import com.smartor.domain.*; +import com.smartor.domain.ServiceSubtask; + +import java.util.List; + +/** + * 鍗曚竴浠诲姟锛堥殢璁匡級Service鎺ュ彛 + * + * @author ruoyi + * @date 2024-02-02 + */ +public interface IServiceSubtaskService { + /** + * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @param id 鍗曚竴浠诲姟锛堥殢璁匡級涓婚敭 + * @return 鍗曚竴浠诲姟锛堥殢璁匡級 + */ + public ServiceSubtask selectServiceSubtaskById(Long id); + + /** + * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級鍒楄〃 + * + * @param ServiceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級 + * @return 鍗曚竴浠诲姟锛堥殢璁匡級闆嗗悎 + */ + public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtask ServiceSubtask); + + /** + * 鏍规嵁鏉′欢鏌ヨ浠诲姟淇℃伅 + * + * @param ServiceSubtask + * @return + */ + public ServiceTaskVO queryTaskByCondition(ServiceSubtask ServiceSubtask); + + /** + * 鏌ヨ鎮h�呴殢璁夸俊鎭� + */ + public List<ServiceSubtask> patItem(ServiceSubtask ServiceSubtask); + + /** + * 鏂板鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @param ServiceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級 + * @return 缁撴灉 + */ + public int insertServiceSubtask(ServiceSubtask ServiceSubtask); + + /** + * 淇敼鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @param ServiceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級 + * @return 缁撴灉 + */ + public Boolean updateServiceSubtask(ServiceSubtask ServiceSubtask); + + /** + * 鎵归噺鍒犻櫎鍗曚竴浠诲姟锛堥殢璁匡級 + * + * @param ids 闇�瑕佸垹闄ょ殑鍗曚竴浠诲姟锛堥殢璁匡級涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteServiceSubtaskByIds(Long[] ids); + + /** + * 鏂板瀹f暀浠诲姟 + * + * @param ivrTaskVO 鍗曚竴浠诲姟 + * @return 缁撴灉 + */ + public int insertOrUpdateTask(ServiceTaskVO ivrTaskVO); + + + /** + * 鐢佃瘽鍥炶皟浠诲姟 + * + * @param phoneCallBackVO + * @return 缁撴灉 + */ + public void phoneCallBack(PhoneCallBackVO phoneCallBackVO); + + public Integer saveQuestionAnswer(ServiceSubTaskDetailReq serviceSubTaskDetailReq); + +} diff --git a/smartor/src/main/java/com/smartor/service/IServiceTaskService.java b/smartor/src/main/java/com/smartor/service/IServiceTaskService.java new file mode 100644 index 0000000..1379dc5 --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/IServiceTaskService.java @@ -0,0 +1,67 @@ +package com.smartor.service; + +import java.util.List; + +import com.smartor.domain.IvrLibaTemplateScriptVO; +import com.smartor.domain.ServiceTask; +import com.smartor.domain.SvyLibTemplateScriptVO; + +/** + * 璇煶浠诲姟Service鎺ュ彛 + * + * @author smartor + * @date 2023-03-24 + */ +public interface IServiceTaskService { + /** + * 鏌ヨ璇煶浠诲姟 + * + * @param taskid 璇煶浠诲姟涓婚敭 + * @return 璇煶浠诲姟 + */ + public ServiceTask selectServiceTaskByTaskid(Long taskid); + + /** + * 鏌ヨ璇煶浠诲姟鍒楄〃 + * + * @param ServiceTask 璇煶浠诲姟 + * @return 璇煶浠诲姟闆嗗悎 + */ + public List<ServiceTask> selectServiceTaskList(ServiceTask ServiceTask); + + /** + * 鏂板璇煶浠诲姟 + * + * @param ServiceTask 璇煶浠诲姟 + * @return 缁撴灉 + */ + public int insertServiceTask(ServiceTask ServiceTask); + + /** + * 淇敼璇煶浠诲姟 + * + * @param ServiceTask 璇煶浠诲姟 + * @return 缁撴灉 + */ + public int updateServiceTask(ServiceTask ServiceTask); + + /** + * 鎵归噺鍒犻櫎璇煶浠诲姟 + * + * @param taskids 闇�瑕佸垹闄ょ殑璇煶浠诲姟涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteServiceTaskByTaskids(Long[] taskids); + + /** + * 鍒犻櫎璇煶浠诲姟淇℃伅 + * + * @param taskid 璇煶浠诲姟涓婚敭 + * @return 缁撴灉 + */ + public Boolean deleteServiceTaskByTaskid(Long taskid); + + public List getScriptInfoByCondition(Long taskid, Long patid); + + +} diff --git a/smartor/src/main/java/com/smartor/service/ISvyTaskAnswerService.java b/smartor/src/main/java/com/smartor/service/ISvyTaskAnswerService.java new file mode 100644 index 0000000..9c9ae75 --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/ISvyTaskAnswerService.java @@ -0,0 +1,62 @@ +package com.smartor.service; + +import com.smartor.domain.SvyTaskAnswer; + +import java.util.List; + +/** + * 浠诲姟闂嵎闂閫夐」Service鎺ュ彛 + * + * @author ruoyi + * @date 2024-06-27 + */ +public interface ISvyTaskAnswerService +{ + /** + * 鏌ヨ浠诲姟闂嵎闂閫夐」 + * + * @param id 浠诲姟闂嵎闂閫夐」涓婚敭 + * @return 浠诲姟闂嵎闂閫夐」 + */ + public SvyTaskAnswer selectSvyTaskAnswerById(Long id); + + /** + * 鏌ヨ浠诲姟闂嵎闂閫夐」鍒楄〃 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 浠诲姟闂嵎闂閫夐」闆嗗悎 + */ + public List<SvyTaskAnswer> selectSvyTaskAnswerList(SvyTaskAnswer svyTaskAnswer); + + /** + * 鏂板浠诲姟闂嵎闂閫夐」 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 缁撴灉 + */ + public int insertSvyTaskAnswer(SvyTaskAnswer svyTaskAnswer); + + /** + * 淇敼浠诲姟闂嵎闂閫夐」 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 缁撴灉 + */ + public int updateSvyTaskAnswer(SvyTaskAnswer svyTaskAnswer); + + /** + * 鎵归噺鍒犻櫎浠诲姟闂嵎闂閫夐」 + * + * @param ids 闇�瑕佸垹闄ょ殑浠诲姟闂嵎闂閫夐」涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteSvyTaskAnswerByIds(Long[] ids); + + /** + * 鍒犻櫎浠诲姟闂嵎闂閫夐」淇℃伅 + * + * @param id 浠诲姟闂嵎闂閫夐」涓婚敭 + * @return 缁撴灉 + */ + public int deleteSvyTaskAnswerById(Long id); +} diff --git a/smartor/src/main/java/com/smartor/service/ISvyTaskService.java b/smartor/src/main/java/com/smartor/service/ISvyTaskService.java index 92818a2..4e1af2a 100644 --- a/smartor/src/main/java/com/smartor/service/ISvyTaskService.java +++ b/smartor/src/main/java/com/smartor/service/ISvyTaskService.java @@ -1,5 +1,7 @@ package com.smartor.service; +import com.smartor.domain.IvrLibaTemplateScriptVO; +import com.smartor.domain.SvyLibTemplateScriptVO; import com.smartor.domain.SvyTask; import java.util.List; @@ -59,4 +61,6 @@ * @return 缁撴灉 */ public int deleteSvyTaskByTaskid(Long taskid); + + public List<SvyLibTemplateScriptVO> getScriptInfoByCondition(Long taskid, Long patid); } diff --git a/smartor/src/main/java/com/smartor/service/ISvyTaskSingleService.java b/smartor/src/main/java/com/smartor/service/ISvyTaskSingleService.java index 3c576d0..aed624b 100644 --- a/smartor/src/main/java/com/smartor/service/ISvyTaskSingleService.java +++ b/smartor/src/main/java/com/smartor/service/ISvyTaskSingleService.java @@ -1,7 +1,5 @@ package com.smartor.service; -import com.smartor.domain.IvrTaskSingle; -import com.smartor.domain.IvrTaskVO; import com.smartor.domain.SvyTaskSingle; import com.smartor.domain.SvyTaskVO; diff --git a/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java index 34d0dc1..0067dc4 100644 --- a/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java @@ -9,7 +9,7 @@ import com.ruoyi.common.utils.DtoConversionUtils; import com.smartor.domain.*; import com.smartor.service.CommonTaskService; -import com.smartor.service.IIvrTaskService; +import com.smartor.service.IServiceTaskService; import com.smartor.service.ISvyTaskService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -33,7 +33,7 @@ @Service public class CommonTaskServiceImpl implements CommonTaskService { @Autowired - private IIvrTaskService ivrTaskService; + private IServiceTaskService ivrTaskService; @Autowired private ISvyTaskService iSvyTaskService; @@ -60,14 +60,14 @@ } public int sfSend(SendTaskVO sendTaskVO) { - IvrTask ivrTask = ivrTaskService.selectIvrTaskByTaskid(sendTaskVO.getTaskId()); + ServiceTask ivrTask = ivrTaskService.selectServiceTaskByTaskid(sendTaskVO.getTaskId()); if (sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 3 || sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 4) { //浠诲姟鏆傚仠鎴栫粓姝� - IvrTask ivrTask3 = new IvrTask(); - ivrTask3.setTaskid(sendTaskVO.getTaskId()); - ivrTask3.setStopState(ivrTask.getStopState() + 1); - ivrTask3.setSendState(sendTaskVO.getSendState()); - ivrTaskService.updateIvrTask(ivrTask3); + ServiceTask serviceTask = new ServiceTask(); + serviceTask.setTaskid(sendTaskVO.getTaskId()); + serviceTask.setStopState(ivrTask.getStopState() + 1); + serviceTask.setSendState(sendTaskVO.getSendState()); + ivrTaskService.updateServiceTask(serviceTask); return 0; } @@ -82,10 +82,10 @@ redisCache.setCacheObject(content, content, 1, TimeUnit.SECONDS); //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓� - IvrTask ivrTask2 = new IvrTask(); - ivrTask2.setTaskid(ivrTask.getTaskid()); - ivrTask2.setSendState(2); - ivrTaskService.updateIvrTask(ivrTask2); + ServiceTask serviceTask = new ServiceTask(); + serviceTask.setTaskid(ivrTask.getTaskid()); + serviceTask.setSendState(2); + ivrTaskService.updateServiceTask(serviceTask); } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1") || StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("3")) { //鏃堕棿娈靛彂閫� ObjectMapper objectMapper = new ObjectMapper(); @@ -121,10 +121,10 @@ redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS); } //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓� - IvrTask ivrTask2 = new IvrTask(); - ivrTask2.setTaskid(ivrTask.getTaskid()); - ivrTask2.setSendState(2); - ivrTaskService.updateIvrTask(ivrTask2); + ServiceTask serviceTask = new ServiceTask(); + serviceTask.setTaskid(ivrTask.getTaskid()); + serviceTask.setSendState(2); + ivrTaskService.updateServiceTask(serviceTask); } } return 1; @@ -134,11 +134,11 @@ SvyTask svyTask = iSvyTaskService.selectSvyTaskByTaskid(sendTaskVO.getTaskId()); if (sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 3 || sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 4) { //浠诲姟鏆傚仠鎴栫粓姝� - SvyTask svyTask1 = new SvyTask(); - svyTask1.setTaskid(sendTaskVO.getTaskId()); - svyTask1.setStopState(svyTask.getStopState() + 1); - svyTask1.setSendState(sendTaskVO.getSendState().toString()); - iSvyTaskService.updateSvyTask(svyTask1); + SvyTask serviceTask = new SvyTask(); + serviceTask.setTaskid(sendTaskVO.getTaskId()); + serviceTask.setStopState(svyTask.getStopState() + 1); + serviceTask.setSendState(sendTaskVO.getSendState().toString()); + iSvyTaskService.updateSvyTask(serviceTask); return 0; } @@ -154,10 +154,10 @@ redisCache.setCacheObject(content, content, 1, TimeUnit.SECONDS); //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓� - SvyTask svyTask2 = new SvyTask(); - svyTask2.setTaskid(svyTask.getTaskid()); - svyTask2.setSendState("2"); - iSvyTaskService.updateSvyTask(svyTask2); + SvyTask serviceTask = new SvyTask(); + serviceTask.setTaskid(svyTask.getTaskid()); + serviceTask.setSendState("2"); + iSvyTaskService.updateSvyTask(serviceTask); } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1") || StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("3")) { //鏃堕棿娈靛彂閫� ObjectMapper objectMapper = new ObjectMapper(); @@ -193,10 +193,10 @@ redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS); } //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓� - SvyTask svyTask3 = new SvyTask(); - svyTask3.setTaskid(svyTask.getTaskid()); - svyTask3.setSendState("2"); - iSvyTaskService.updateSvyTask(svyTask3); + SvyTask serviceTask = new SvyTask(); + serviceTask.setTaskid(svyTask.getTaskid()); + serviceTask.setSendState("2"); + iSvyTaskService.updateSvyTask(serviceTask); } } return 1; diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java index 51b2150..1fa2142 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java @@ -165,32 +165,12 @@ //瀵规ā鏉胯瘽鏈拰閫夐」杩涜澶勭悊锛堣瘽鏈〃涓庢寚鏍囪〃杩涜鍚堝苟浜嗭紝锛� if (CollectionUtils.isNotEmpty(ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList())) { for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList()) { - if (ivrLibaTemplateScriptVO.getIsoperation() != null && ivrLibaTemplateScriptVO.getIsoperation() == 1) { - //鏂板 - IvrLibaTemplateScript ivrLibaTemplateScript = DtoConversionUtils.sourceToTarget(ivrLibaTemplateScriptVO, IvrLibaTemplateScript.class); - ivrLibaTemplateScript.setTemplateID(ivrLibaTemplate.getID()); - ivrLibaTemplateScript.setCreateTime(new Date()); - ivrLibaTemplateScriptMapper.insertIvrLibaTemplateScript(ivrLibaTemplateScript); - //瀵归�夐」鐩繘琛屽鐞� - dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getID()); - - } else if (ivrLibaTemplateScriptVO.getIsoperation() != null && ivrLibaTemplateScriptVO.getIsoperation() == 2) { - //淇敼 - IvrLibaTemplateScript ivrLibaTemplateScript = DtoConversionUtils.sourceToTarget(ivrLibaTemplateScriptVO, IvrLibaTemplateScript.class); - ivrLibaTemplateScript.setTemplateID(ivrLibaTemplate.getID()); - ivrLibaTemplateScript.setUpdateTime(new Date()); - ivrLibaTemplateScriptMapper.updateIvrLibaTemplateScript(ivrLibaTemplateScript); - //瀵归�夐」鐩繘琛屽鐞� - dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getID()); - - } else if (ivrLibaTemplateScriptVO.getIsoperation() != null && ivrLibaTemplateScriptVO.getIsoperation() == 3) { - //鍒犻櫎 - if (ivrLibaTemplateScriptVO.getID() == null) { - log.info("鍒犻櫎澶辫触,妯℃澘璇濇湳id涓虹┖"); - } else { - ivrLibaTemplateScriptVO.setUpdateTime(new Date()); - ivrLibaTemplateScriptMapper.deleteIvrLibaTemplateScriptByID(ivrLibaTemplateScriptVO.getID()); - } + if (ivrLibaTemplateScriptVO.getIsoperation() != null) { + IvrLibaTemplateScript ivrLibaTemplateScript = scriptHandle(ivrLibaTemplate, ivrLibaTemplateScriptVO, 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()); } } } @@ -212,6 +192,36 @@ return i; } + private IvrLibaTemplateScript scriptHandle(IvrLibaTemplate ivrLibaTemplate, IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO, Integer isoperation) { + IvrLibaTemplateScript ivrLibaTemplateScript = DtoConversionUtils.sourceToTarget(ivrLibaTemplateScriptVO, IvrLibaTemplateScript.class); + if (isoperation == 1) { + //鏂板 + ivrLibaTemplateScript.setTemplateID(ivrLibaTemplate.getID()); + ivrLibaTemplateScript.setCreateTime(new Date()); + ivrLibaTemplateScriptMapper.insertIvrLibaTemplateScript(ivrLibaTemplateScript); + //瀵归�夐」鐩繘琛屽鐞� + dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getID(),isoperation); + + } else if (isoperation == 2) { + //淇敼 + ivrLibaTemplateScript.setTemplateID(ivrLibaTemplate.getID()); + ivrLibaTemplateScript.setUpdateTime(new Date()); + ivrLibaTemplateScriptMapper.updateIvrLibaTemplateScript(ivrLibaTemplateScript); + //瀵归�夐」鐩繘琛屽鐞� + dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getID(), isoperation); + + } else if (isoperation == 3) { + //鍒犻櫎 + if (ivrLibaTemplateScriptVO.getID() == null) { + log.info("鍒犻櫎澶辫触,妯℃澘璇濇湳id涓虹┖"); + } else { + ivrLibaTemplateScriptVO.setUpdateTime(new Date()); + ivrLibaTemplateScriptMapper.deleteIvrLibaTemplateScriptByID(ivrLibaTemplateScriptVO.getID()); + } + } + return ivrLibaTemplateScript; + } + /** * 閫夐」澶勭悊 * @@ -219,12 +229,18 @@ * @param ivrLibaTemplateScript * @param tmpID */ - private void dealOption(List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptionList, IvrLibaTemplateScript ivrLibaTemplateScript, Long tmpID) { + private void dealOption(List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptionList, IvrLibaTemplateScript ivrLibaTemplateScript, Long tmpID, Integer isoperation) { log.info("ivrLibaTemplateScript鐨勫�间负锛歿}", ivrLibaTemplateScript); //瀵规ā鏉挎寚鏍囬�夐」杩涜澶勭悊 + Integer lsIsoperation = isoperation; if (CollectionUtils.isNotEmpty(ivrLibaTemplateTargetoptionList)) { for (IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption : ivrLibaTemplateTargetoptionList) { - if (ivrLibaTemplateTargetoption.getIsoperation() != null && ivrLibaTemplateTargetoption.getIsoperation() == 1) { + if (ivrLibaTemplateTargetoption.getIsoperation() != null) { + isoperation = ivrLibaTemplateTargetoption.getIsoperation(); + } else { + isoperation = lsIsoperation; + } + if (isoperation == 1) { //鏂板 ivrLibaTemplateTargetoption.setTemplateID(tmpID); ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScript.getID()); @@ -233,7 +249,7 @@ if (CollectionUtils.isNotEmpty(ivrLibaTemplateTargetoption.getNodynamiccruxs())) ivrLibaTemplateTargetoption.setNodynamiccruxsJson(JSON.toJSONString(ivrLibaTemplateTargetoption.getNodynamiccruxs())); ivrLibaTemplateTargetOptionMapper.insertIvrLibaTemplateTargetoption(ivrLibaTemplateTargetoption); - } else if (ivrLibaTemplateTargetoption.getIsoperation() != null && ivrLibaTemplateTargetoption.getIsoperation() == 2) { + } else if (isoperation == 2) { //淇敼 ivrLibaTemplateTargetoption.setTemplateID(tmpID); ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScript.getID()); @@ -242,7 +258,7 @@ if (CollectionUtils.isNotEmpty(ivrLibaTemplateTargetoption.getNodynamiccruxs())) ivrLibaTemplateTargetoption.setNodynamiccruxsJson(JSON.toJSONString(ivrLibaTemplateTargetoption.getNodynamiccruxs())); ivrLibaTemplateTargetOptionMapper.updateIvrLibaTemplateTargetoption(ivrLibaTemplateTargetoption); - } else if (ivrLibaTemplateTargetoption.getIsoperation() != null && ivrLibaTemplateTargetoption.getIsoperation() == 3) { + } else if (isoperation == 3) { //鍒犻櫎 if (ivrLibaTemplateTargetoption.getId() == null) { log.info("鍒犻櫎澶辫触,妯℃澘鎸囨爣閫夐」id涓虹┖"); diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java deleted file mode 100644 index cb2053c..0000000 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.smartor.service.impl; - -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.TimeUnit; - -import com.alibaba.fastjson2.JSON; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.exception.base.BaseException; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.DtoConversionUtils; -import org.apache.commons.lang3.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.stereotype.Service; -import com.smartor.service.IIvrTaskService; -import org.springframework.transaction.annotation.Transactional; - -/** - * 璇煶浠诲姟Service涓氬姟灞傚鐞� - * - * @author smartor - * @date 2023-03-24 - */ -@Slf4j -@Service -public class IvrTaskServiceImpl implements IIvrTaskService { - @Autowired - private IvrTaskMapper ivrTaskMapper; - - @Autowired - private IvrTaskSingleMapper ivrTaskcallMapper; - - @Autowired - private IvrLibaTemplateScriptMapper ivrLibaTemplateScriptMapper; - - @Autowired - private PatArchiveMapper patArchiveMapper; - - @Autowired - private IvrLibaTemplateTargetoptionMapper ivrLibaTemplateTargetOptionMapper; - - @Autowired - private RedisCache redisCache; - - /** - * 鏌ヨ璇煶浠诲姟 - * - * @param taskid 璇煶浠诲姟涓婚敭 - * @return 璇煶浠诲姟 - */ - @Override - public IvrTask selectIvrTaskByTaskid(Long taskid) { - return ivrTaskMapper.selectIvrTaskByTaskid(taskid); - } - - /** - * 鏌ヨ璇煶浠诲姟鍒楄〃 - * - * @param ivrTask 璇煶浠诲姟 - * @return 璇煶浠诲姟 - */ - @Override - public List<IvrTask> selectIvrTaskList(IvrTask ivrTask) { - return ivrTaskMapper.selectIvrTaskList(ivrTask); - } - - /** - * 鏂板璇煶浠诲姟 - * - * @param ivrTask 璇煶浠诲姟 - * @return 缁撴灉 - */ - @Override - public int insertIvrTask(IvrTask ivrTask) { - ivrTask.setCreateTime(DateUtils.getNowDate()); - return ivrTaskMapper.insertIvrTask(ivrTask); - } - - /** - * 淇敼璇煶浠诲姟 - * - * @param ivrTask 璇煶浠诲姟 - * @return 缁撴灉 - */ - @Override - public int updateIvrTask(IvrTask ivrTask) { - ivrTask.setUpdateTime(DateUtils.getNowDate()); - return ivrTaskMapper.updateIvrTask(ivrTask); - } - - /** - * 鎵归噺鍒犻櫎璇煶浠诲姟 - * - * @param taskids 闇�瑕佸垹闄ょ殑璇煶浠诲姟涓婚敭 - * @return 缁撴灉 - */ - @Override - public int deleteIvrTaskByTaskids(Long[] taskids) { - return ivrTaskMapper.deleteIvrTaskByTaskids(taskids); - } - - /** - * 鍒犻櫎璇煶浠诲姟淇℃伅 - * - * @param taskid 璇煶浠诲姟涓婚敭 - * @return 缁撴灉 - */ - @Transactional(rollbackFor = Exception.class) - @Override - public Boolean deleteIvrTaskByTaskid(Long taskid) { - IvrTaskSingle ivrTaskcall = new IvrTaskSingle(); - ivrTaskcall.setTaskid(taskid); - ivrTaskcall.setDelFlag("1"); - Boolean aBoolean = ivrTaskcallMapper.updateIvrTaskcall(ivrTaskcall); - Boolean isSuccess = false; - if (!aBoolean) { - new BaseException("浠诲姟鍒犻櫎澶辫触"); - } - isSuccess = ivrTaskMapper.deleteIvrTaskByTaskid(taskid); - return isSuccess; - } - - @Override - public List<IvrLibaTemplateScriptVO> getScriptInfoByCondition(Long taskid, Long patid) { - //閫氳繃浠诲姟ID鑾峰彇妯℃澘ID - IvrTask ivrTask = selectIvrTaskByTaskid(taskid); - - //閫氳繃妯℃澘ID鑾峰彇闂淇℃伅 - IvrLibaTemplateScript ivrLibaTemplateScript = new IvrLibaTemplateScript(); - ivrLibaTemplateScript.setTemplateID(ivrTask.getTemplateid()); - ivrLibaTemplateScript.setDelFlag("0"); - List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.selectIvrLibaTemplateScriptList(ivrLibaTemplateScript); - if (CollectionUtils.isEmpty(ivrLibaTemplateScripts) || ivrLibaTemplateScripts.size() == 0) { - log.info("ivrLibaTemplateScripts涓虹┖浜嗭紝璇峰敖蹇仈绯荤鐞嗗憳澶勭悊"); - return new ArrayList<>(); - } - List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOS = DtoConversionUtils.sourceToTarget(ivrLibaTemplateScripts, IvrLibaTemplateScriptVO.class); - - //鑾峰彇鎮h�呬俊鎭� - PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patid); - - //閫氳繃鎮h�呬俊鎭拰浠诲姟淇℃伅涓殑textParam瀵归棶棰樹腑鐨勫彉閲忚繘琛屽~鍏� - ObjectMapper objectMapper = new ObjectMapper(); - Map<String, Map<String, String>> ivrTaskMap = null; - try { - ivrTaskMap = objectMapper.readValue(ivrTask.getTextParam(), Map.class); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - List<Map<String, String>> mapList = new ArrayList<>(); - - for (Map<String, String> map : ivrTaskMap.values()) { - mapList.add(map); - } - - //灏嗘ā鏉块棶棰樿瘽鏈噷鐨勯�氶厤绗︽浛鎹� - for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOS) { - if (StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getQuestionText())) { - for (Map<String, String> map : mapList) { - for (String key : map.keySet()) { - - ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : "")); - } - } - //鏇挎崲鎮h�呬釜浜轰俊鎭暟鎹� - ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : "")); - ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : "")); - ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : "")); - - //鑾峰彇闂閫夐」 - IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption(); - ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScriptVO.getID()); - List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptions = ivrLibaTemplateTargetOptionMapper.selectIvrLibaTemplateTargetoptionList(ivrLibaTemplateTargetoption); - ivrLibaTemplateScriptVO.setIvrLibaScriptTargetoptionList(ivrLibaTemplateTargetoptions); - } - } - - - return ivrLibaTemplateScriptVOS; - } - - -} diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java index a4ca342..ef56751 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java @@ -91,45 +91,22 @@ } log.info("鏂板闅忚浠诲姟闅忚妯℃澘鐨刬d涓猴細{}", ivrTaskTemplate.getID()); - //瀵规ā鏉胯瘽鏈拰閫夐」杩涜澶勭悊锛堣瘽鏈〃涓庢寚鏍囪〃杩涜鍚堝苟浜嗭紝锛� if (CollectionUtils.isNotEmpty(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList())) { log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()鏄惁鏈夋暟鎹搱锛歿}", ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()); for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()) { - if (ivrTaskTemplateScriptVO.getIsoperation() != null && ivrTaskTemplateScriptVO.getIsoperation() == 1 || ivrTaskTemplateScriptVO.getIsoperation() == null && ivrTaskTemplateVO.getIsoperation() == 1) { - //鏂板 - IvrTaskTemplateScript ivrTaskTemplateScript = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScriptVO, IvrTaskTemplateScript.class); - ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID()); - ivrTaskTemplateScript.setCreateTime(new Date()); - ivrTaskTemplateScriptMapper.insertIvrTaskTemplateScript(ivrTaskTemplateScript); - ivrTaskTemplateScript.setIsoperation(1); - //瀵归�夐」鐩繘琛屽鐞� - dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID()); - - } else if (ivrTaskTemplateScriptVO.getIsoperation() != null && ivrTaskTemplateScriptVO.getIsoperation() == 2) { - //淇敼 - IvrTaskTemplateScript ivrTaskTemplateScript = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScriptVO, IvrTaskTemplateScript.class); - ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID()); - ivrTaskTemplateScript.setUpdateTime(new Date()); - ivrTaskTemplateScriptMapper.updateIvrTaskTemplateScript(ivrTaskTemplateScript); - ivrTaskTemplateScript.setIsoperation(2); - //瀵归�夐」鐩繘琛屽鐞� - dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID()); - - } else if (ivrTaskTemplateScriptVO.getIsoperation() != null && ivrTaskTemplateScriptVO.getIsoperation() == 3) { - //鍒犻櫎 - if (ivrTaskTemplateScriptVO.getID() == null) { - log.info("鍒犻櫎澶辫触,妯℃澘璇濇湳id涓虹┖"); - } else { - ivrTaskTemplateScriptVO.setUpdateTime(new Date()); - ivrTaskTemplateScriptMapper.deleteIvrTaskTemplateScriptByID(ivrTaskTemplateScriptVO.getID()); - } + if (ivrTaskTemplateScriptVO.getIsoperation() != null) { + IvrTaskTemplateScript ivrTaskTemplateScript = scriptHandle(ivrTaskTemplate, ivrTaskTemplateScriptVO, ivrTaskTemplateScriptVO.getIsoperation()); + dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID(), ivrTaskTemplateScriptVO.getIsoperation()); + } else { + IvrTaskTemplateScript ivrTaskTemplateScript = scriptHandle(ivrTaskTemplate, ivrTaskTemplateScriptVO, ivrTaskTemplateVO.getIsoperation()); + dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID(), ivrTaskTemplateVO.getIsoperation()); } } } - return ivrTaskTemplate.getID().intValue(); } + /** * 淇敼闅忚浠诲姟闅忚妯℃澘搴� @@ -229,13 +206,46 @@ return templateVO; } + private IvrTaskTemplateScript scriptHandle(IvrTaskTemplate ivrTaskTemplate, IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, Integer isoperation) { + IvrTaskTemplateScript ivrTaskTemplateScript = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScriptVO, IvrTaskTemplateScript.class); - private void dealOption(List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptionList, IvrTaskTemplateScript ivrTaskTemplateScript, Long tmpID) { + if (isoperation == 1) { + //鏂板 + ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID()); + ivrTaskTemplateScript.setCreateTime(new Date()); + ivrTaskTemplateScriptMapper.insertIvrTaskTemplateScript(ivrTaskTemplateScript); + ivrTaskTemplateScript.setIsoperation(1); + } else if (isoperation == 2) { + //淇敼 + ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID()); + ivrTaskTemplateScript.setUpdateTime(new Date()); + ivrTaskTemplateScriptMapper.updateIvrTaskTemplateScript(ivrTaskTemplateScript); + ivrTaskTemplateScript.setIsoperation(2); + + } else if (isoperation == 3) { + //鍒犻櫎 + if (ivrTaskTemplateScriptVO.getID() == null) { + log.info("鍒犻櫎澶辫触,妯℃澘璇濇湳id涓虹┖"); + } else { + ivrTaskTemplateScriptVO.setUpdateTime(new Date()); + ivrTaskTemplateScriptMapper.deleteIvrTaskTemplateScriptByID(ivrTaskTemplateScriptVO.getID()); + } + } + return ivrTaskTemplateScript; + } + + private void dealOption(List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptionList, IvrTaskTemplateScript ivrTaskTemplateScript, Long tmpID, Integer isoperation) { log.info("ivrLibaTemplateScript鐨勫�间负锛歿}", ivrTaskTemplateScript); + Integer lsisoperation = isoperation; //瀵规ā鏉挎寚鏍囬�夐」杩涜澶勭悊 if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoptionList)) { for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateTargetoptionList) { - if (ivrTaskTemplateTargetoption.getIsoperation() != null && ivrTaskTemplateTargetoption.getIsoperation() == 1 || ivrTaskTemplateTargetoption.getIsoperation() == null && ivrTaskTemplateScript.getIsoperation() == 1) { + if (ivrTaskTemplateTargetoption.getIsoperation() != null) { + isoperation = ivrTaskTemplateTargetoption.getIsoperation(); + } else { + isoperation = lsisoperation; + } + if (isoperation == 1) { //鏂板 ivrTaskTemplateTargetoption.setTemplateID(tmpID); ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScript.getID()); @@ -244,7 +254,7 @@ if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoption.getNodynamiccruxs())) ivrTaskTemplateTargetoption.setNodynamiccruxsJson(JSON.toJSONString(ivrTaskTemplateTargetoption.getNodynamiccruxs())); ivrTaskTemplateTargetoptionMapper.insertIvrTaskTemplateTargetoption(ivrTaskTemplateTargetoption); - } else if (ivrTaskTemplateTargetoption.getIsoperation() != null && ivrTaskTemplateTargetoption.getIsoperation() == 2) { + } else if (isoperation == 2) { //淇敼 ivrTaskTemplateTargetoption.setTemplateID(tmpID); ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScript.getID()); @@ -253,7 +263,7 @@ if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoption.getNodynamiccruxs())) ivrTaskTemplateTargetoption.setNodynamiccruxsJson(JSON.toJSONString(ivrTaskTemplateTargetoption.getNodynamiccruxs())); ivrTaskTemplateTargetoptionMapper.updateIvrTaskTemplateTargetoption(ivrTaskTemplateTargetoption); - } else if (ivrTaskTemplateTargetoption.getIsoperation() != null && ivrTaskTemplateTargetoption.getIsoperation() == 3) { + } else if (isoperation == 3) { //鍒犻櫎 if (ivrTaskTemplateTargetoption.getId() == null) { log.info("鍒犻櫎澶辫触,妯℃澘鎸囨爣閫夐」id涓虹┖"); diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java index 2123083..fda900c 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskcalldetailServiceImpl.java @@ -1,22 +1,15 @@ package com.smartor.service.impl; -import java.util.Date; -import java.util.List; -import java.util.UUID; - import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.RSAPublicKeyExample; -import com.smartor.domain.IvrTaskSingle; -import com.smartor.domain.IvrTaskcalldetailReq; -import com.smartor.mapper.IvrTaskSingleMapper; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import com.smartor.mapper.IvrTaskcalldetailMapper; import com.smartor.domain.IvrTaskcalldetail; +import com.smartor.mapper.IvrTaskcalldetailMapper; +import com.smartor.mapper.ServiceSubtaskMapper; import com.smartor.service.IIvrTaskcalldetailService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; /** * 璇煶浠诲姟鍛煎彨鏄庣粏Service涓氬姟灞傚鐞� @@ -31,10 +24,8 @@ private IvrTaskcalldetailMapper ivrTaskcalldetailMapper; @Autowired - private IvrTaskSingleMapper ivrTaskSingleMapper; + private ServiceSubtaskMapper ivrTaskSingleMapper; - @Value("${pri_key}") - private String pri_key; /** @@ -105,26 +96,4 @@ return ivrTaskcalldetailMapper.deleteIvrTaskcalldetailByCalldetailid(calldetailid); } - @Override - public Integer saveQuestionAnswer(IvrTaskcalldetailReq ivrTaskcalldetailReq) { - RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); - Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskcalldetailReq.getParam1(), pri_key)); - Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskcalldetailReq.getParam2(), pri_key)); - IvrTaskSingle ivrTaskSingle = new IvrTaskSingle(); - ivrTaskSingle.setTaskid(tid); - ivrTaskSingle.setPatid(pid); - List<IvrTaskSingle> ivrTaskSingles = ivrTaskSingleMapper.selectIvrTaskcallList(ivrTaskSingle); - if (CollectionUtils.isEmpty(ivrTaskSingles) || ivrTaskSingles.size() == 0) { - log.error("鎶ラ敊浜嗭紝ivrTaskSingles鏁版嵁涓虹┖浜嗭細{}", ivrTaskSingle); - return 0; - } - - for (IvrTaskcalldetail ivrTaskcalldetail : ivrTaskcalldetailReq.getIvrTaskcalldetailList()) { - ivrTaskcalldetail.setCallid(ivrTaskSingles.get(0).getId().toString()); - ivrTaskcalldetail.setCalldetailid(UUID.randomUUID().toString()); - ivrTaskcalldetail.setCreateTime(new Date()); - ivrTaskcalldetailMapper.insertIvrTaskcalldetail(ivrTaskcalldetail); - } - return 1; - } } diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskRecordServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskRecordServiceImpl.java new file mode 100644 index 0000000..fbffad8 --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskRecordServiceImpl.java @@ -0,0 +1,90 @@ +package com.smartor.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.smartor.domain.ServiceSubtaskRecord; +import com.smartor.mapper.ServiceSubtaskRecordMapper; +import com.smartor.service.IServiceSubtaskRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2024-07-01 + */ +@Service +public class ServiceSubtaskRecordServiceImpl implements IServiceSubtaskRecordService { + @Autowired + private ServiceSubtaskRecordMapper serviceSubtaskRecordMapper; + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @Override + public ServiceSubtaskRecord selectServiceSubtaskRecordById(Long id) { + return serviceSubtaskRecordMapper.selectServiceSubtaskRecordById(id); + } + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @Override + public List<ServiceSubtaskRecord> selectServiceSubtaskRecordList(ServiceSubtaskRecord serviceSubtaskRecord) { + return serviceSubtaskRecordMapper.selectServiceSubtaskRecordList(serviceSubtaskRecord); + } + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + @Override + public int insertServiceSubtaskRecord(ServiceSubtaskRecord serviceSubtaskRecord) { + serviceSubtaskRecord.setCreateTime(DateUtils.getNowDate()); + return serviceSubtaskRecordMapper.insertServiceSubtaskRecord(serviceSubtaskRecord); + } + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param serviceSubtaskRecord 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + @Override + public int updateServiceSubtaskRecord(ServiceSubtaskRecord serviceSubtaskRecord) { + serviceSubtaskRecord.setUpdateTime(DateUtils.getNowDate()); + return serviceSubtaskRecordMapper.updateServiceSubtaskRecord(serviceSubtaskRecord); + } + + /** + * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 缁撴灉 + */ + @Override + public int deleteServiceSubtaskRecordByIds(Long[] ids) { + return serviceSubtaskRecordMapper.deleteServiceSubtaskRecordByIds(ids); + } + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 缁撴灉 + */ + @Override + public int deleteServiceSubtaskRecordById(Long id) { + return serviceSubtaskRecordMapper.deleteServiceSubtaskRecordById(id); + } +} diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java similarity index 71% rename from smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java rename to smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java index c6bb3b5..a8e83f2 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java @@ -8,16 +8,18 @@ import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DtoConversionUtils; +import com.ruoyi.common.utils.RSAPublicKeyExample; import com.smartor.config.PhoneUtils; import com.smartor.domain.*; import com.smartor.mapper.*; -import com.smartor.service.IIvrTaskService; -import com.smartor.service.IIvrTaskSingleService; +import com.smartor.service.IServiceSubtaskService; +import com.smartor.service.IServiceTaskService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -35,27 +37,35 @@ */ @Slf4j @Service -public class IvrTaskSingleServiceImpl implements IIvrTaskSingleService { +public class ServiceSubtaskServiceImpl implements IServiceSubtaskService { @Autowired - private IvrTaskSingleMapper ivrTaskSingleMapper; + private ServiceSubtaskMapper serviceSubtaskMapper; @Autowired - private IIvrTaskService ivrTaskService; + private IvrTaskcalldetailMapper ivrTaskcalldetailMapper; + @Autowired + private SvyTasksingledetailMapper svyTasksingledetailMapper; @Autowired - private IvrTaskTemplateTargetoptionMapper ivrTaskScriptTargetoptionMapper; + private IServiceTaskService serviceTaskService; @Autowired - private IvrLibaTemplateScriptMapper ivrTaskTemplateScriptMapper; + private IvrTaskTemplateTargetoptionMapper serviceTaskScriptTargetoptionMapper; @Autowired - private IvrTaskVisitResultMapper ivrTaskVisitResultMapper; + private IvrLibaTemplateScriptMapper ivrLibaTemplateScriptMapper; + + @Autowired + private IvrTaskVisitResultMapper serviceTaskVisitResultMapper; @Autowired private RedisCache redisCache; @Autowired private IvrLibaExtemplatescriptMapper ivrLibaExtemplatescriptMapper; + + @Value("${pri_key}") + private String pri_key; /** @@ -65,117 +75,119 @@ * @return 鍗曚竴浠诲姟锛堥殢璁匡級 */ @Override - public IvrTaskSingle selectIvrTaskcallById(Long id) { - return ivrTaskSingleMapper.selectIvrTaskcallById(id); + public ServiceSubtask selectServiceSubtaskById(Long id) { + return serviceSubtaskMapper.selectServiceSubtaskById(id); } /** * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級鍒楄〃 * - * @param ivrTaskcall 鍗曚竴浠诲姟锛堥殢璁匡級 + * @param ServiceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級 * @return 鍗曚竴浠诲姟锛堥殢璁匡級 */ @Override - public List<IvrTaskSingle> selectIvrTaskcallList(IvrTaskSingle ivrTaskcall) { - return ivrTaskSingleMapper.selectIvrTaskcallList(ivrTaskcall); + public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtask ServiceSubtask) { + return serviceSubtaskMapper.selectServiceSubtaskList(ServiceSubtask); } @Override - public IvrTaskVO queryTaskByCondition(IvrTaskSingle ivrTaskcall) { + public ServiceTaskVO queryTaskByCondition(ServiceSubtask ServiceSubtask) { //瀹氫箟鎮h�呬笌鍗曚竴浠诲姟鍏宠仈琛ㄩ泦鍚� List<PatTaskRelevance> patTaskRelevances = new ArrayList<>(); - List<IvrTaskSingle> list = selectIvrTaskcallList(ivrTaskcall); + List<ServiceSubtask> list = selectServiceSubtaskList(ServiceSubtask); if (CollectionUtils.isEmpty(list) || list.size() == 0) { - return new IvrTaskVO(); + return new ServiceTaskVO(); } - IvrTask ivrTask = ivrTaskService.selectIvrTaskByTaskid(ivrTaskcall.getTaskid()); - //灏嗘煡鍑烘潵鐨勬暟鎹�掑叆ivrTasksingleVO涓� - IvrTaskVO ivrTaskVO = DtoConversionUtils.sourceToTarget(list.get(0), IvrTaskVO.class); - ivrTaskVO.setShowDate(ivrTask.getShowDate()); - ivrTaskVO.setShowTimeMorn(ivrTask.getShowTimeMorn()); - ivrTaskVO.setShowTimeNoon(ivrTask.getShowTimeNoon()); - ivrTaskVO.setShowTimeNight(ivrTask.getShowTimeNight()); - ivrTaskVO.setPreachform(ivrTask.getPreachform()); - String sendTimeSlot = ivrTask.getSendTimeSlot(); + ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(ServiceSubtask.getTaskid()); + //灏嗘煡鍑烘潵鐨勬暟鎹�掑叆ServiceSubtaskVO涓� + ServiceTaskVO serviceTaskVO = DtoConversionUtils.sourceToTarget(list.get(0), ServiceTaskVO.class); + serviceTaskVO.setShowDate(serviceTask.getShowDate()); + serviceTaskVO.setShowTimeMorn(serviceTask.getShowTimeMorn()); + serviceTaskVO.setShowTimeNoon(serviceTask.getShowTimeNoon()); + serviceTaskVO.setShowTimeNight(serviceTask.getShowTimeNight()); + serviceTaskVO.setPreachform(serviceTask.getPreachform()); + String sendTimeSlot = serviceTask.getSendTimeSlot(); ObjectMapper objectMapper = new ObjectMapper(); try { //鑾峰彇鍒板彂閫佹椂闂寸殑闆嗗悎 if (com.ruoyi.common.utils.StringUtils.isNotEmpty(sendTimeSlot)) { List<TaskSendTimeVO> taskSendTimeVOList = objectMapper.readValue(sendTimeSlot, List.class); - ivrTaskVO.setSendTimeslot(taskSendTimeVOList); - ivrTaskVO.setSendType(ivrTask.getSendType()); + serviceTaskVO.setSendTimeslot(taskSendTimeVOList); + serviceTaskVO.setSendType(serviceTask.getSendType()); } //鏂囨湰鍙橀噺鍙傛暟 - if (com.ruoyi.common.utils.StringUtils.isNotEmpty(ivrTask.getTextParam())) { - Map<String, Map<String, String>> textParam = objectMapper.readValue(ivrTask.getTextParam(), Map.class); - ivrTaskVO.setTextParam(textParam); + if (com.ruoyi.common.utils.StringUtils.isNotEmpty(serviceTask.getTextParam())) { + Map<String, Map<String, String>> textParam = objectMapper.readValue(serviceTask.getTextParam(), Map.class); + serviceTaskVO.setTextParam(textParam); } } catch (JsonProcessingException e) { e.printStackTrace(); } - for (IvrTaskSingle ivrTaskcall1 : list) { + for (ServiceSubtask serviceSubtask1 : list) { PatTaskRelevance patTaskRelevance = new PatTaskRelevance(); - if (!ivrTaskcall1.getHospType().equals("2")) { - log.info("闅忚鏌ヨ涓嶄负鍑洪櫌锛寋}", ivrTaskcall1.getHospType()); + if (!serviceSubtask1.getHospType().equals("2")) { + log.info("闅忚鏌ヨ涓嶄负鍑洪櫌锛寋}", serviceSubtask1.getHospType()); //鑾峰彇鍒版偅鑰呬俊鎭紝骞舵斁鍏ュ埌闆嗗悎涓� - patTaskRelevance.setName(ivrTaskcall1.getSendname()); - patTaskRelevance.setAge(ivrTaskcall1.getAge()); - patTaskRelevance.setSfzh(ivrTaskcall1.getSfzh()); - patTaskRelevance.setPhone(ivrTaskcall1.getPhone()); - patTaskRelevance.setAddr(ivrTaskcall1.getAddr()); - patTaskRelevance.setDiagname(ivrTaskcall1.getDiagname()); - patTaskRelevance.setPatid(ivrTaskcall1.getPatid()); + patTaskRelevance.setName(serviceSubtask1.getSendname()); + patTaskRelevance.setAge(serviceSubtask1.getAge()); + patTaskRelevance.setSfzh(serviceSubtask1.getSfzh()); + patTaskRelevance.setPhone(serviceSubtask1.getPhone()); + patTaskRelevance.setAddr(serviceSubtask1.getAddr()); + patTaskRelevance.setDiagname(serviceSubtask1.getDiagname()); + patTaskRelevance.setPatid(serviceSubtask1.getPatid()); + patTaskRelevance.setSendState(serviceSubtask1.getSendstate()); patTaskRelevances.add(patTaskRelevance); } - if (ivrTaskcall1.getHospType().equals("2")) { - log.info("闅忚鏌ヨ涓哄嚭闄紝{}", ivrTaskcall1.getHospType()); - patTaskRelevance.setName(ivrTaskcall1.getSendname()); - patTaskRelevance.setAge(ivrTaskcall1.getAge()); - patTaskRelevance.setSfzh(ivrTaskcall1.getSfzh()); - patTaskRelevance.setPhone(ivrTaskcall1.getPhone()); - patTaskRelevance.setAddr(ivrTaskcall1.getAddr()); - patTaskRelevance.setDeptName(ivrTaskcall1.getDeptname()); - patTaskRelevance.setBedNo(ivrTaskcall1.getBedNo()); - patTaskRelevance.setDiagname(ivrTaskcall1.getDiagname()); - patTaskRelevance.setPatid(ivrTaskcall1.getPatid()); + if (serviceSubtask1.getHospType().equals("2")) { + log.info("闅忚鏌ヨ涓哄嚭闄紝{}", serviceSubtask1.getHospType()); + patTaskRelevance.setName(serviceSubtask1.getSendname()); + patTaskRelevance.setAge(serviceSubtask1.getAge()); + patTaskRelevance.setSfzh(serviceSubtask1.getSfzh()); + patTaskRelevance.setPhone(serviceSubtask1.getPhone()); + patTaskRelevance.setAddr(serviceSubtask1.getAddr()); + patTaskRelevance.setDeptName(serviceSubtask1.getDeptname()); + patTaskRelevance.setBedNo(serviceSubtask1.getBedNo()); + patTaskRelevance.setDiagname(serviceSubtask1.getDiagname()); + patTaskRelevance.setPatid(serviceSubtask1.getPatid()); + patTaskRelevance.setSendState(serviceSubtask1.getSendstate()); patTaskRelevances.add(patTaskRelevance); } } - ivrTaskVO.setPatTaskRelevances(patTaskRelevances); - return ivrTaskVO; + serviceTaskVO.setPatTaskRelevances(patTaskRelevances); + return serviceTaskVO; } @Override - public List<IvrTaskSingle> patItem(IvrTaskSingle ivrTaskSingle) { + public List<ServiceSubtask> patItem(ServiceSubtask serviceSubtask) { - return this.selectIvrTaskcallList(ivrTaskSingle); + return this.selectServiceSubtaskList(serviceSubtask); } /** * 鏂板鍗曚竴浠诲姟锛堥殢璁匡級 * - * @param ivrTaskcall 鍗曚竴浠诲姟锛堥殢璁匡級 + * @param serviceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級 * @return 缁撴灉 */ @Override - public int insertIvrTaskcall(IvrTaskSingle ivrTaskcall) { - ivrTaskcall.setCreateTime(DateUtils.getNowDate()); - return ivrTaskSingleMapper.insertIvrTaskcall(ivrTaskcall); + public int insertServiceSubtask(ServiceSubtask serviceSubtask) { + serviceSubtask.setCreateTime(DateUtils.getNowDate()); + return serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); } /** * 淇敼鍗曚竴浠诲姟锛堥殢璁匡級 * - * @param ivrTaskcall 鍗曚竴浠诲姟锛堥殢璁匡級 + * @param serviceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級 * @return 缁撴灉 */ @Override - public Boolean updateIvrTaskcall(IvrTaskSingle ivrTaskcall) { - ivrTaskcall.setUpdateTime(DateUtils.getNowDate()); - return ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); + public Boolean updateServiceSubtask(ServiceSubtask serviceSubtask) { + serviceSubtask.setUpdateTime(DateUtils.getNowDate()); + return serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); } /** @@ -184,10 +196,10 @@ * @return 缁撴灉 */ @Override - public int deleteIvrTaskcallByIds(Long[] ids) { + public int deleteServiceSubtaskByIds(Long[] ids) { Integer i = 0; for (Long id : ids) { - i = ivrTaskSingleMapper.deleteIvrTaskcallById(id); + i = serviceSubtaskMapper.deleteServiceSubtaskById(id); } return i; } @@ -199,84 +211,83 @@ */ @Transactional(rollbackFor = Exception.class) @Override - public int insertOrUpdateTask(IvrTaskVO ivrTaskVO) { - if (ObjectUtils.isEmpty(ivrTaskVO)) { + public int insertOrUpdateTask(ServiceTaskVO serviceTaskVO) { + if (ObjectUtils.isEmpty(serviceTaskVO)) { log.info("浠诲姟鍏ュ弬涓虹┖锛岃妫�鏌ュ叆鍙�"); throw new BaseException("浠诲姟鍏ュ弬涓虹┖锛岃妫�鏌ュ叆鍙�"); } Integer integer = 1; - IvrTask ivrTask = DtoConversionUtils.sourceToTarget(ivrTaskVO, IvrTask.class); - ivrTask.setTextParam(JSON.toJSONString(ivrTaskVO.getTextParam())); - if (ivrTaskVO.getIsoperation() != null && ivrTaskVO.getIsoperation() == 1) { + ServiceTask serviceTask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceTask.class); + serviceTask.setTextParam(JSON.toJSONString(serviceTaskVO.getTextParam())); + if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 1) { //寰�浠诲姟琛ㄤ腑锛屾柊澧炰换鍔� - if (ObjectUtils.isNotEmpty(ivrTaskVO.getSendTimeslot())) - ivrTask.setSendTimeSlot(JSON.toJSONString(ivrTaskVO.getSendTimeslot())); - if (ivrTask.getSendState() == null) ivrTask.setSendState(1); - ivrTask.setTemplateid(ivrTaskVO.getLibtemplateid()); - ivrTaskService.insertIvrTask(ivrTask); + if (ObjectUtils.isNotEmpty(serviceTaskVO.getSendTimeslot())) + serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot())); + if (serviceTask.getSendState() == null) serviceTask.setSendState(1); + serviceTask.setTemplateid(serviceTaskVO.getLibtemplateid()); + serviceTaskService.insertServiceTask(serviceTask); //灏嗕换鍔′俊鎭斁鍒版湇鍔¤〃涓� - IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskVO, IvrTaskSingle.class); - ivrTaskcall.setTaskid(ivrTask.getTaskid().longValue()); + ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceSubtask.class); + serviceSubtask.setTaskid(serviceTask.getTaskid().longValue()); //鏂板 - if (CollectionUtils.isNotEmpty(ivrTaskVO.getPatTaskRelevances())) { - for (PatTaskRelevance patTaskRelevance : ivrTaskVO.getPatTaskRelevances()) { + if (CollectionUtils.isNotEmpty(serviceTaskVO.getPatTaskRelevances())) { + for (PatTaskRelevance patTaskRelevance : serviceTaskVO.getPatTaskRelevances()) { //灏嗕换鍔′俊鎭柊澧炲埌闅忚鏈嶅姟琛ㄤ腑 - ivrTaskcall.setSendname(patTaskRelevance.getName()); - ivrTaskcall.setAge(patTaskRelevance.getAge()); - ivrTaskcall.setSfzh(patTaskRelevance.getSfzh()); - ivrTaskcall.setPhone(patTaskRelevance.getPhone()); - ivrTaskcall.setAddr(patTaskRelevance.getAddr()); - ivrTaskcall.setPatid(patTaskRelevance.getPatid()); - ivrTaskcall.setCreateTime(DateUtils.getNowDate()); - ivrTaskcall.setSendstate(1L); - ivrTaskcall.setType(ivrTaskVO.getHospType()); - ivrTaskSingleMapper.insertIvrTaskcall(ivrTaskcall); - integer = ivrTaskcall.getId().intValue(); + 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()); + serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); + integer = serviceSubtask.getId().intValue(); } } - } else if (ivrTaskVO.getIsoperation() != null && ivrTaskVO.getIsoperation() == 2) { + } else if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 2) { //浠诲姟淇敼 - if (ObjectUtils.isNotEmpty(ivrTaskVO.getSendTimeslot())) - ivrTask.setSendTimeSlot(JSON.toJSONString(ivrTaskVO.getSendTimeslot())); + if (ObjectUtils.isNotEmpty(serviceTaskVO.getSendTimeslot())) + serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot())); //淇敼鎿嶄綔锛岄渶瑕佸皢stopState鐘舵��+1 - IvrTask ivrTask1 = ivrTaskService.selectIvrTaskByTaskid(ivrTask.getTaskid()); - ivrTask.setStopState(ivrTask1.getStopState() + 1); - ivrTask.setTemplateid(ivrTaskVO.getLibtemplateid()); - ivrTaskService.updateIvrTask(ivrTask); + ServiceTask serviceTask1 = serviceTaskService.selectServiceTaskByTaskid(serviceTask.getTaskid()); + serviceTask.setStopState(serviceTask1.getStopState() + 1); + serviceTask.setTemplateid(serviceTaskVO.getLibtemplateid()); + serviceTaskService.updateServiceTask(serviceTask); - if (CollectionUtils.isNotEmpty(ivrTaskVO.getPatTaskRelevances())) { - for (PatTaskRelevance patTaskRelevance : ivrTaskVO.getPatTaskRelevances()) { + if (CollectionUtils.isNotEmpty(serviceTaskVO.getPatTaskRelevances())) { + for (PatTaskRelevance patTaskRelevance : serviceTaskVO.getPatTaskRelevances()) { - IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskVO, IvrTaskSingle.class); - ivrTaskcall.setSendname(patTaskRelevance.getName()); - ivrTaskcall.setAge(patTaskRelevance.getAge()); - ivrTaskcall.setSfzh(patTaskRelevance.getSfzh()); - ivrTaskcall.setPhone(patTaskRelevance.getPhone()); - ivrTaskcall.setAddr(patTaskRelevance.getAddr()); - ivrTaskcall.setPatid(patTaskRelevance.getPatid()); - ivrTaskcall.setType(ivrTaskVO.getHospType()); - ivrTaskcall.setCreateTime(DateUtils.getNowDate()); - - ivrTaskcall.setTextParam(new Gson().toJson(ivrTaskVO.getTextParam())); + 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.setType(serviceTaskVO.getHospType()); + serviceSubtask.setCreateTime(DateUtils.getNowDate()); + serviceSubtask.setHospType(patTaskRelevance.getHospType()); + serviceSubtask.setTextParam(new Gson().toJson(serviceTaskVO.getTextParam())); if (patTaskRelevance.getIsoperation() != null) { if (patTaskRelevance.getIsoperation() == 2) - ivrTaskSingleMapper.updateIvrTaskcallByCondition(ivrTaskcall); + serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask); if (patTaskRelevance.getIsoperation() == 1) { - ivrTaskcall.setSendstate(1L); - ivrTaskSingleMapper.insertIvrTaskcall(ivrTaskcall); + serviceSubtask.setSendstate(1L); + serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); } if (patTaskRelevance.getIsoperation() == 3) // 閫氳繃taskid鍜宲atid鍘诲垹闄よ鏉℃暟鎹� - ivrTaskSingleMapper.deleteIvrTaskcallByCondition(ivrTaskVO.getTaskid(), patTaskRelevance.getPatid()); + serviceSubtaskMapper.deleteServiceSubtaskByCondition(serviceTaskVO.getTaskid(), patTaskRelevance.getPatid()); } - integer = ivrTaskcall.getTaskid().intValue(); + integer = serviceSubtask.getTaskid().intValue(); } } } - - return integer; } @@ -303,14 +314,14 @@ } Map<String, Object> map = redisCache.getCacheObject(phoneCallBackVO.getUuid()); - IvrTaskSingle ivrTaskcall = (IvrTaskSingle) map.get("ivrTaskSingle"); - List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVOs = (List<IvrTaskTemplateScriptVO>) map.get("ivrTaskTemplateScriptVO"); + ServiceSubtask serviceSubtask = (ServiceSubtask) map.get("ServiceSubtask"); + List<IvrTaskTemplateScriptVO> IvrTaskTemplateScriptVOs = (List<IvrTaskTemplateScriptVO>) map.get("IvrTaskTemplateScriptVO"); //灏唘uid鏇存柊鍒版暟鎹簱涓� - ivrTaskcall.setSenduuid(phoneCallBackVO.getUuid()); - ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); + serviceSubtask.setSenduuid(phoneCallBackVO.getUuid()); + serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); //鑾峰彇妯℃澘淇℃伅 - IvrTaskTemplateVO ivrTaskTemplateVO = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "ivrTaskTemplateVO"); + IvrTaskTemplateVO ivrTaskTemplateVO = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "IvrTaskTemplateVO"); //璇煶璇嗗埆缁撴灉涓婃姤鎺ュ彛: 3 Integer noVoice = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "noVoice"); @@ -325,7 +336,7 @@ //鍒ゆ柇noVoice鏄惁宸茬粡鍒颁簡鏈�澶у�� if (noVoice == ivrTaskTemplateVO.getNoVoiceNum().intValue()) { //宸茬粡闂簡瀵瑰簲鐨勯亶鏁帮紝灏卞垽鏂槸鍚﹁繕鏈変笅涓�棰� - if (nowQuestion.getTargetid() == ivrTaskTemplateScriptVOs.size()) { + if (nowQuestion.getTargetid() == IvrTaskTemplateScriptVOs.size()) { //娌℃湁涓嬩竴棰樹簡锛屽氨鎸傛柇鐢佃瘽锛屾挱鏀剧粨鏉熻 redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); phoneUtils.ttsPlayback(ivrTaskTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); @@ -333,7 +344,7 @@ } else { //鏈変笅涓�棰� redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); - IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(ivrTaskTemplateScriptVOs, nowQuestion); + IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(IvrTaskTemplateScriptVOs, nowQuestion); // 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙� String date = simpleDateFormat1.format(new Date()); log.info("鍘昏皟鐢╰ts鍚堟垚鍜屾挱鏀炬帴鍙�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); @@ -372,35 +383,35 @@ //璇存槑鍖归厤姝g‘浜� //杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉� nowQuestion.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(true); - ivrTaskScriptTargetoptionMapper.updateIvrTaskTemplateTargetoption(nowQuestion.getIvrTaskScriptTargetoptionList().get(j)); + 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 ivrTaskVisitResult = DtoConversionUtils.sourceToTarget(ivrTaskcall, IvrTaskVisitResult.class); - ivrTaskVisitResult.setId(null); - ivrTaskVisitResult.setQuestion(nowQuestion.getQuestionText()); - ivrTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult()); - ivrTaskVisitResult.setCreateTime(new Date()); - ivrTaskVisitResult.setOptionResult(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue()); - ivrTaskVisitResultMapper.insertIvrTaskVisitResult(ivrTaskVisitResult); + IvrTaskVisitResult serviceTaskVisitResult = DtoConversionUtils.sourceToTarget(serviceSubtask, IvrTaskVisitResult.class); + serviceTaskVisitResult.setId(null); + serviceTaskVisitResult.setQuestion(nowQuestion.getQuestionText()); + serviceTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult()); + serviceTaskVisitResult.setCreateTime(new Date()); + serviceTaskVisitResult.setOptionResult(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue()); + serviceTaskVisitResultMapper.insertIvrTaskVisitResult(serviceTaskVisitResult); //灏嗗尮閰嶅埌鐨勬爣璇嗘敼鎴恡rue isppd = true; //鑾峰彇涓嬩竴棰� Long nextQuestion = nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getNextQuestion(); - for (IvrTaskTemplateScriptVO script : ivrTaskTemplateScriptVOs) { + for (IvrTaskTemplateScriptVO script : IvrTaskTemplateScriptVOs) { if (script.getTargetid() == nextQuestion) { QuestionMessage questionMessage = new QuestionMessage(); questionMessage.setNowQuestion(script); - questionMessage.setQuestionList(ivrTaskTemplateScriptVOs); + questionMessage.setQuestionList(IvrTaskTemplateScriptVOs); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); phoneUtils.ttsPlayback(script.getQuestionText(), phoneCallBackVO.getUuid()); return; - } else if (nextQuestion > ivrTaskTemplateScriptVOs.size()) { + } else if (nextQuestion > IvrTaskTemplateScriptVOs.size()) { //娌℃湁涓嬩竴棰樹簡锛屽氨缁撴潫浜� String date = simpleDateFormat1.format(new Date()); log.error("娌℃湁涓嬩竴棰樹簡锛屽氨缁撴潫浜�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); @@ -430,10 +441,10 @@ //鏃犲尮閰嶆鏁板幓鍒ゆ柇鏄惁鍒版渶澶ц闂鏁帮紝骞朵笖鎵�鏈夌殑閫夐」閮藉尮閰嶅畬浜� if (mateNum == ivrTaskTemplateVO.getMateNum().intValue()) { //濡傛灉涓嬩竴棰樹负绌�.鍒欐柊鐨勬暟鎹繑鍥�,骞跺姞涓婃劅璋㈣ - if (nowQuestion.getTargetid() < ivrTaskTemplateScriptVOs.size()) { + if (nowQuestion.getTargetid() < IvrTaskTemplateScriptVOs.size()) { QuestionMessage questionMessage = new QuestionMessage(); - IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(ivrTaskTemplateScriptVOs, nowQuestion); - questionMessage.setQuestionList(ivrTaskTemplateScriptVOs); + 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); @@ -540,11 +551,11 @@ //// e.printStackTrace(); //// } // -// IvrTaskSingle ivrTaskcall = (IvrTaskSingle) map.get("ivrTaskcall"); +// ServiceSubtask ServiceSubtask = (ServiceSubtask) map.get("ServiceSubtask"); // List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOs = (List<IvrLibaTemplateScriptVO>) map.get("ivrLibaTemplateScriptVO"); // //灏唘uid鏇存柊鍒版暟鎹簱涓� -// ivrTaskcall.setSenduuid(phoneCallBackVO.getUuid()); -// ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); +// ServiceSubtask.setSenduuid(phoneCallBackVO.getUuid()); +// ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask); // // //鑾峰彇妯℃澘淇℃伅 // IvrLibaTemplateVO ivrLibaTemplateVO = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "ivrLibaTemplateVO"); @@ -562,16 +573,16 @@ // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "uint8", 1, 120, TimeUnit.MINUTES); // } // -// if (integer != null && integer == ivrTaskcall.getRecallcount().intValue()) { +// if (integer != null && integer == ServiceSubtask.getRecallcount().intValue()) { // log.info("鏃犱汉鎺ュ惉锛歿}, {}", phoneCallBackVO.getErrResult(), phoneCallBackVO.getUuid()); // //杩炵画鎵撹瀹氭锛屽鏋滆娌′汉鎺ワ紝閭e氨缁撴潫 -// ivrTaskcall.setResult(phoneCallBackVO.getErrResult()); -// ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); +// ServiceSubtask.setResult(phoneCallBackVO.getErrResult()); +// ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask); // redisCache.deleteObject(phoneCallBackVO.getUuid() + "uint8"); -// } else if (integer != null && integer < ivrTaskcall.getRecallcount().intValue()) { +// } else if (integer != null && integer < ServiceSubtask.getRecallcount().intValue()) { // //杩涜閲嶆嫧 // PhoneUtils phoneUtils = new PhoneUtils(); -// phoneUtils.ob(null, null, null, null, null, null, null, ivrTaskcall.getPhone(), phoneCallBackVO.getUuid(), true); +// phoneUtils.ob(null, null, null, null, null, null, null, ServiceSubtask.getPhone(), phoneCallBackVO.getUuid(), true); // } // } // @@ -581,20 +592,20 @@ // // 0-鎸搩 // Integer integer = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "enumState"); // -// if (integer != null && integer < ivrTaskcall.getRecallcount().intValue()) { +// 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 == ivrTaskcall.getRecallcount().intValue()) { -// ivrTaskcall.setResult("鏃犱汉鎺ュ惉"); -// ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); +// } else if (integer != null && integer == ServiceSubtask.getRecallcount().intValue()) { +// ServiceSubtask.setResult("鏃犱汉鎺ュ惉"); +// ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask); // redisCache.deleteObject(phoneCallBackVO.getUuid() + "enumState"); // } // } else if (phoneCallBackVO.getEnumState() == 2) { // //鎮h�呮寕鏂數璇� // log.info("鎮h�呮寕鏂數璇濓細{}", phoneCallBackVO.getUuid()); -// ivrTaskcall.setResult(phoneCallBackVO.getHangUpResult()); -// ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); +// ServiceSubtask.setResult(phoneCallBackVO.getHangUpResult()); +// ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask); // redisCache.deleteObject(phoneCallBackVO.getUuid() + "enumState"); // } // @@ -749,13 +760,46 @@ // return phoneCallBackVO; // } + @Override + public Integer saveQuestionAnswer(ServiceSubTaskDetailReq serviceSubTaskDetailReq) { + RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); + Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam1(), pri_key)); + Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam2(), pri_key)); + ServiceSubtask ivrTaskSingle = new ServiceSubtask(); + ivrTaskSingle.setTaskid(tid); + ivrTaskSingle.setPatid(pid); + List<ServiceSubtask> ivrTaskSingles = serviceSubtaskMapper.selectServiceSubtaskList(ivrTaskSingle); + if (CollectionUtils.isEmpty(ivrTaskSingles) || ivrTaskSingles.size() == 0) { + log.error("鎶ラ敊浜嗭紝ivrTaskSingles鏁版嵁涓虹┖浜嗭細{}", ivrTaskSingle); + return 0; + } + int i = 0; + if (CollectionUtils.isNotEmpty(serviceSubTaskDetailReq.getIvrTaskcalldetailList())) { + //闅忚 + for (IvrTaskcalldetail ivrTaskcalldetail : serviceSubTaskDetailReq.getIvrTaskcalldetailList()) { + ivrTaskcalldetail.setCallid(ivrTaskSingles.get(0).getId().toString()); + ivrTaskcalldetail.setCalldetailid(UUID.randomUUID().toString()); + ivrTaskcalldetail.setCreateTime(new Date()); + i = ivrTaskcalldetailMapper.insertIvrTaskcalldetail(ivrTaskcalldetail); + } + } else if (CollectionUtils.isNotEmpty(serviceSubTaskDetailReq.getSvyTasksingledetailList())) { + //闂嵎 + for (SvyTasksingledetail svyTasksingledetail : serviceSubTaskDetailReq.getSvyTasksingledetailList()) { + svyTasksingledetail.setCallid(ivrTaskSingles.get(0).getId().toString()); + svyTasksingledetail.setCalldetailid(UUID.randomUUID().toString()); + svyTasksingledetail.setCreateTime(new Date()); + i = svyTasksingledetailMapper.insertSvyTasksingledetail(svyTasksingledetail); + } + } + return i; + } - private IvrTaskTemplateScriptVO getNextQuestion(List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVOList, IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO) { + private IvrTaskTemplateScriptVO getNextQuestion(List<IvrTaskTemplateScriptVO> IvrTaskTemplateScriptVOList, IvrTaskTemplateScriptVO IvrTaskTemplateScriptVO) { - for (int j = 0; j < ivrTaskTemplateScriptVOList.size(); j++) { - if (ivrTaskTemplateScriptVOList.get(j).getTargetid() == ivrTaskTemplateScriptVO.getTargetid() + 1) { + for (int j = 0; j < IvrTaskTemplateScriptVOList.size(); j++) { + if (IvrTaskTemplateScriptVOList.get(j).getTargetid() == IvrTaskTemplateScriptVO.getTargetid() + 1) { // 瀵硅鏉emplateScriptVO杩涜澶勭悊 - return ivrTaskTemplateScriptVOList.get(j); + return IvrTaskTemplateScriptVOList.get(j); } } return null; diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java new file mode 100644 index 0000000..12c60fd --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java @@ -0,0 +1,278 @@ +package com.smartor.service.impl; + +import java.util.*; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.base.BaseException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.DtoConversionUtils; +import org.apache.commons.lang3.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.stereotype.Service; +import com.smartor.service.IServiceTaskService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 璇煶浠诲姟Service涓氬姟灞傚鐞� + * + * @author smartor + * @date 2023-03-24 + */ +@Slf4j +@Service +public class ServiceTaskServiceImpl implements IServiceTaskService { + @Autowired + private ServiceTaskMapper serviceTaskMapper; + + @Autowired + private ServiceSubtaskMapper serviceSubtaskMapper; + + @Autowired + private IvrLibaTemplateScriptMapper ivrLibaTemplateScriptMapper; + + @Autowired + private SvyLibTemplateScriptMapper svyLibTemplateScriptMapper; + + @Autowired + private PatArchiveMapper patArchiveMapper; + + @Autowired + private IvrLibaTemplateTargetoptionMapper ivrLibaTemplateTargetOptionMapper; + + @Autowired + private SvyLibTemplateTargetoptionMapper svyLibTemplateTargetoptionMapper; + + @Autowired + private RedisCache redisCache; + + /** + * 鏌ヨ璇煶浠诲姟 + * + * @param taskid 璇煶浠诲姟涓婚敭 + * @return 璇煶浠诲姟 + */ + @Override + public ServiceTask selectServiceTaskByTaskid(Long taskid) { + return serviceTaskMapper.selectServiceTaskByTaskid(taskid); + } + + /** + * 鏌ヨ璇煶浠诲姟鍒楄〃 + * + * @param serviceTask 璇煶浠诲姟 + * @return 璇煶浠诲姟 + */ + @Override + + public List<ServiceTask> selectServiceTaskList(ServiceTask serviceTask) { + return serviceTaskMapper.selectServiceTaskList(serviceTask); + } + + /** + * 鏂板璇煶浠诲姟 + * + * @param serviceTask 璇煶浠诲姟 + * @return 缁撴灉 + */ + @Override + public int insertServiceTask(ServiceTask serviceTask) { + serviceTask.setCreateTime(DateUtils.getNowDate()); + return serviceTaskMapper.insertServiceTask(serviceTask); + } + + /** + * 淇敼璇煶浠诲姟 + * + * @param serviceTask 璇煶浠诲姟 + * @return 缁撴灉 + */ + @Override + public int updateServiceTask(ServiceTask serviceTask) { + serviceTask.setUpdateTime(DateUtils.getNowDate()); + return serviceTaskMapper.updateServiceTask(serviceTask); + } + + /** + * 鎵归噺鍒犻櫎璇煶浠诲姟 + * + * @param taskids 闇�瑕佸垹闄ょ殑璇煶浠诲姟涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteServiceTaskByTaskids(Long[] taskids) { + return serviceTaskMapper.deleteServiceTaskByTaskids(taskids); + } + + /** + * 鍒犻櫎璇煶浠诲姟淇℃伅 + * + * @param taskid 璇煶浠诲姟涓婚敭 + * @return 缁撴灉 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public Boolean deleteServiceTaskByTaskid(Long taskid) { + ServiceSubtask ServiceTaskcall = new ServiceSubtask(); + ServiceTaskcall.setTaskid(taskid); + ServiceTaskcall.setDelFlag("1"); + Boolean aBoolean = serviceSubtaskMapper.updateServiceSubtask(ServiceTaskcall); + Boolean isSuccess = false; + if (!aBoolean) { + new BaseException("浠诲姟鍒犻櫎澶辫触"); + } + isSuccess = serviceTaskMapper.deleteServiceTaskByTaskid(taskid); + return isSuccess; + } + + @Override + public List getScriptInfoByCondition(Long taskid, Long patid) { + //閫氳繃浠诲姟ID鑾峰彇妯℃澘ID + ServiceTask serviceTask = selectServiceTaskByTaskid(taskid); + List info = new ArrayList(); + if (serviceTask.getType().equals("1")) { + //闅忚 + info = sfInfo(serviceTask, patid); + } else if (serviceTask.getType().equals("2")) { + //闂嵎 + info = wjInfo(serviceTask, patid); + } else { + //瀹f暀 + } + + //鍙鎵撳紑浜嗛〉闈紝灏辩畻鎴愬姛 + ServiceSubtask ServiceTaskSingle = new ServiceSubtask(); + ServiceTaskSingle.setTaskid(taskid); + ServiceTaskSingle.setPatid(patid); + ServiceTaskSingle.setResult("success"); + ServiceTaskSingle.setFinishtime(new Date()); + serviceSubtaskMapper.updateServiceSubtaskByCondition(ServiceTaskSingle); + + return info; + } + + /** + * 闅忚淇℃伅 + * + * @param serviceTask + * @param patid + * @return + */ + public List sfInfo(ServiceTask serviceTask, Long patid) { + //閫氳繃妯℃澘ID鑾峰彇闂淇℃伅 + IvrLibaTemplateScript ivrLibaTemplateScript = new IvrLibaTemplateScript(); + ivrLibaTemplateScript.setTemplateID(serviceTask.getTemplateid()); + ivrLibaTemplateScript.setDelFlag("0"); + List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.selectIvrLibaTemplateScriptList(ivrLibaTemplateScript); + if (CollectionUtils.isEmpty(ivrLibaTemplateScripts) || ivrLibaTemplateScripts.size() == 0) { + log.info("ivrLibaTemplateScripts涓虹┖浜嗭紝璇峰敖蹇仈绯荤鐞嗗憳澶勭悊"); + return new ArrayList<>(); + } + List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOS = DtoConversionUtils.sourceToTarget(ivrLibaTemplateScripts, IvrLibaTemplateScriptVO.class); + + //鑾峰彇鎮h�呬俊鎭� + PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patid); + + //閫氳繃鎮h�呬俊鎭拰浠诲姟淇℃伅涓殑textParam瀵归棶棰樹腑鐨勫彉閲忚繘琛屽~鍏� + ObjectMapper objectMapper = new ObjectMapper(); + Map<String, Map<String, String>> serviceTaskMap = null; + try { + serviceTaskMap = objectMapper.readValue(serviceTask.getTextParam(), Map.class); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + List<Map<String, String>> mapList = new ArrayList<>(); + + for (Map<String, String> map : serviceTaskMap.values()) { + mapList.add(map); + } + + //灏嗘ā鏉块棶棰樿瘽鏈噷鐨勯�氶厤绗︽浛鎹� + for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOS) { + if (StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getQuestionText())) { + for (Map<String, String> map : mapList) { + for (String key : map.keySet()) { + + ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : "")); + } + } + //鏇挎崲鎮h�呬釜浜轰俊鎭暟鎹� + ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : "")); + ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : "")); + ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : "")); + + //鑾峰彇闂閫夐」 + IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption(); + ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScriptVO.getID()); + List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptions = ivrLibaTemplateTargetOptionMapper.selectIvrLibaTemplateTargetoptionList(ivrLibaTemplateTargetoption); + ivrLibaTemplateScriptVO.setIvrLibaScriptTargetoptionList(ivrLibaTemplateTargetoptions); + } + } + return ivrLibaTemplateScriptVOS; + } + + /** + * 闂嵎淇℃伅 + * + * @param serviceTask + * @param patid + * @return + */ + private List wjInfo(ServiceTask serviceTask, Long patid) { + //閫氳繃妯℃澘ID鑾峰彇闂淇℃伅 + SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript(); + svyLibTemplateScript.setSvyid(Long.valueOf(serviceTask.getTemplateid())); + svyLibTemplateScript.setDelFlag("0"); + List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript); + if (CollectionUtils.isEmpty(svyLibTemplateScripts) || svyLibTemplateScripts.size() == 0) { + log.info("ivrLibaTemplateScripts涓虹┖浜嗭紝璇峰敖蹇仈绯荤鐞嗗憳澶勭悊"); + return new ArrayList<>(); + } + List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOS = DtoConversionUtils.sourceToTarget(svyLibTemplateScripts, SvyLibTemplateScriptVO.class); + + //鑾峰彇鎮h�呬俊鎭� + PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patid); + + //閫氳繃鎮h�呬俊鎭拰浠诲姟淇℃伅涓殑textParam瀵归棶棰樹腑鐨勫彉閲忚繘琛屽~鍏� + ObjectMapper objectMapper = new ObjectMapper(); + Map<String, Map<String, String>> ivrTaskMap = null; + try { + ivrTaskMap = objectMapper.readValue(serviceTask.getTextParam(), Map.class); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + List<Map<String, String>> mapList = new ArrayList<>(); + + for (Map<String, String> map : ivrTaskMap.values()) { + mapList.add(map); + } + + //灏嗘ā鏉块棶棰樿瘽鏈噷鐨勯�氶厤绗︽浛鎹� + for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : svyLibTemplateScriptVOS) { + if (StringUtils.isNotEmpty(svyLibTemplateScriptVO.getScriptContent())) { + for (Map<String, String> map : mapList) { + for (String key : map.keySet()) { + + svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : "")); + } + } + //鏇挎崲鎮h�呬釜浜轰俊鎭暟鎹� + svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : "")); + svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : "")); + svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : "")); + + //鑾峰彇闂閫夐」 + SvyLibTemplateTargetoption svyLibTemplateTargetoption = new SvyLibTemplateTargetoption(); + svyLibTemplateTargetoption.setScriptid(svyLibTemplateScriptVO.getId()); + List<SvyLibTemplateTargetoption> svyLibTemplateTargetoptions = svyLibTemplateTargetoptionMapper.selectSvyLibTemplateTargetoptionList(svyLibTemplateTargetoption); + svyLibTemplateScriptVO.setSvyLibTemplateTargetoptions(svyLibTemplateTargetoptions); + } + } + return svyLibTemplateScriptVOS; + } +} diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyTaskAnswerServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyTaskAnswerServiceImpl.java new file mode 100644 index 0000000..e2da976 --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/impl/SvyTaskAnswerServiceImpl.java @@ -0,0 +1,97 @@ +package com.smartor.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.smartor.domain.SvyTaskAnswer; +import com.smartor.mapper.SvyTaskAnswerMapper; +import com.smartor.service.ISvyTaskAnswerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 浠诲姟闂嵎闂閫夐」Service涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2024-06-27 + */ +@Service +public class SvyTaskAnswerServiceImpl implements ISvyTaskAnswerService +{ + @Autowired + private SvyTaskAnswerMapper svyTaskAnswerMapper; + + /** + * 鏌ヨ浠诲姟闂嵎闂閫夐」 + * + * @param id 浠诲姟闂嵎闂閫夐」涓婚敭 + * @return 浠诲姟闂嵎闂閫夐」 + */ + @Override + public SvyTaskAnswer selectSvyTaskAnswerById(Long id) + { + return svyTaskAnswerMapper.selectSvyTaskAnswerById(id); + } + + /** + * 鏌ヨ浠诲姟闂嵎闂閫夐」鍒楄〃 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 浠诲姟闂嵎闂閫夐」 + */ + @Override + public List<SvyTaskAnswer> selectSvyTaskAnswerList(SvyTaskAnswer svyTaskAnswer) + { + return svyTaskAnswerMapper.selectSvyTaskAnswerList(svyTaskAnswer); + } + + /** + * 鏂板浠诲姟闂嵎闂閫夐」 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 缁撴灉 + */ + @Override + public int insertSvyTaskAnswer(SvyTaskAnswer svyTaskAnswer) + { + svyTaskAnswer.setCreateTime(DateUtils.getNowDate()); + return svyTaskAnswerMapper.insertSvyTaskAnswer(svyTaskAnswer); + } + + /** + * 淇敼浠诲姟闂嵎闂閫夐」 + * + * @param svyTaskAnswer 浠诲姟闂嵎闂閫夐」 + * @return 缁撴灉 + */ + @Override + public int updateSvyTaskAnswer(SvyTaskAnswer svyTaskAnswer) + { + svyTaskAnswer.setUpdateTime(DateUtils.getNowDate()); + return svyTaskAnswerMapper.updateSvyTaskAnswer(svyTaskAnswer); + } + + /** + * 鎵归噺鍒犻櫎浠诲姟闂嵎闂閫夐」 + * + * @param ids 闇�瑕佸垹闄ょ殑浠诲姟闂嵎闂閫夐」涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteSvyTaskAnswerByIds(Long[] ids) + { + return svyTaskAnswerMapper.deleteSvyTaskAnswerByIds(ids); + } + + /** + * 鍒犻櫎浠诲姟闂嵎闂閫夐」淇℃伅 + * + * @param id 浠诲姟闂嵎闂閫夐」涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteSvyTaskAnswerById(Long id) + { + return svyTaskAnswerMapper.deleteSvyTaskAnswerById(id); + } +} diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyTaskServiceImpl.java index 6f74476..830c70d 100644 --- a/smartor/src/main/java/com/smartor/service/impl/SvyTaskServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/SvyTaskServiceImpl.java @@ -1,13 +1,22 @@ package com.smartor.service.impl; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import com.ruoyi.common.utils.DateUtils; -import com.smartor.domain.SvyTask; -import com.smartor.mapper.SvyTaskMapper; +import com.ruoyi.common.utils.DtoConversionUtils; +import com.smartor.domain.*; +import com.smartor.mapper.*; import com.smartor.service.ISvyTaskService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.Date; import java.util.List; +import java.util.Map; /** * 缁煎悎闂嵎浠诲姟锛堜换鍔★級Service涓氬姟灞傚鐞� @@ -15,11 +24,23 @@ * @author ruoyi * @date 2024-06-12 */ +@Slf4j @Service -public class SvyTaskServiceImpl implements ISvyTaskService -{ +public class SvyTaskServiceImpl implements ISvyTaskService { @Autowired private SvyTaskMapper svyTaskMapper; + + @Autowired + private SvyLibTemplateScriptMapper svyLibTemplateScriptMapper; + + @Autowired + private SvyLibTemplateTargetoptionMapper svyLibTemplateTargetoptionMapper; + + @Autowired + private SvyTaskSingleMapper svyTaskSingleMapper; + + @Autowired + private PatArchiveMapper patArchiveMapper; /** * 鏌ヨ缁煎悎闂嵎浠诲姟锛堜换鍔★級 @@ -28,8 +49,7 @@ * @return 缁煎悎闂嵎浠诲姟锛堜换鍔★級 */ @Override - public SvyTask selectSvyTaskByTaskid(Long taskid) - { + public SvyTask selectSvyTaskByTaskid(Long taskid) { return svyTaskMapper.selectSvyTaskByTaskid(taskid); } @@ -40,8 +60,7 @@ * @return 缁煎悎闂嵎浠诲姟锛堜换鍔★級 */ @Override - public List<SvyTask> selectSvyTaskList(SvyTask svyTask) - { + public List<SvyTask> selectSvyTaskList(SvyTask svyTask) { return svyTaskMapper.selectSvyTaskList(svyTask); } @@ -52,8 +71,7 @@ * @return 缁撴灉 */ @Override - public int insertSvyTask(SvyTask svyTask) - { + public int insertSvyTask(SvyTask svyTask) { svyTask.setCreateTime(DateUtils.getNowDate()); return svyTaskMapper.insertSvyTask(svyTask); } @@ -65,8 +83,7 @@ * @return 缁撴灉 */ @Override - public int updateSvyTask(SvyTask svyTask) - { + public int updateSvyTask(SvyTask svyTask) { svyTask.setUpdateTime(DateUtils.getNowDate()); return svyTaskMapper.updateSvyTask(svyTask); } @@ -78,8 +95,7 @@ * @return 缁撴灉 */ @Override - public int deleteSvyTaskByTaskids(Long[] taskids) - { + public int deleteSvyTaskByTaskids(Long[] taskids) { return svyTaskMapper.deleteSvyTaskByTaskids(taskids); } @@ -90,8 +106,73 @@ * @return 缁撴灉 */ @Override - public int deleteSvyTaskByTaskid(Long taskid) - { + public int deleteSvyTaskByTaskid(Long taskid) { return svyTaskMapper.deleteSvyTaskByTaskid(taskid); } + + @Override + public List<SvyLibTemplateScriptVO> getScriptInfoByCondition(Long taskid, Long patid) { + //閫氳繃浠诲姟ID鑾峰彇妯℃澘ID + SvyTask svyTask = selectSvyTaskByTaskid(taskid); + + //閫氳繃妯℃澘ID鑾峰彇闂淇℃伅 + SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript(); + svyLibTemplateScript.setSvyid(Long.valueOf(svyTask.getTemplateid())); + svyLibTemplateScript.setDelFlag("0"); + List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript); + if (CollectionUtils.isEmpty(svyLibTemplateScripts) || svyLibTemplateScripts.size() == 0) { + log.info("ivrLibaTemplateScripts涓虹┖浜嗭紝璇峰敖蹇仈绯荤鐞嗗憳澶勭悊"); + return new ArrayList<>(); + } + List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOS = DtoConversionUtils.sourceToTarget(svyLibTemplateScripts, SvyLibTemplateScriptVO.class); + + //鑾峰彇鎮h�呬俊鎭� + PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patid); + + //閫氳繃鎮h�呬俊鎭拰浠诲姟淇℃伅涓殑textParam瀵归棶棰樹腑鐨勫彉閲忚繘琛屽~鍏� + ObjectMapper objectMapper = new ObjectMapper(); + Map<String, Map<String, String>> ivrTaskMap = null; + try { + ivrTaskMap = objectMapper.readValue(svyTask.getTextParam(), Map.class); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + List<Map<String, String>> mapList = new ArrayList<>(); + + for (Map<String, String> map : ivrTaskMap.values()) { + mapList.add(map); + } + + //灏嗘ā鏉块棶棰樿瘽鏈噷鐨勯�氶厤绗︽浛鎹� + for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : svyLibTemplateScriptVOS) { + if (StringUtils.isNotEmpty(svyLibTemplateScriptVO.getScriptContent())) { + for (Map<String, String> map : mapList) { + for (String key : map.keySet()) { + + svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : "")); + } + } + //鏇挎崲鎮h�呬釜浜轰俊鎭暟鎹� + svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : "")); + svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : "")); + svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : "")); + + //鑾峰彇闂閫夐」 + SvyLibTemplateTargetoption svyLibTemplateTargetoption = new SvyLibTemplateTargetoption(); + svyLibTemplateTargetoption.setScriptid(svyLibTemplateScriptVO.getId()); + List<SvyLibTemplateTargetoption> svyLibTemplateTargetoptions = svyLibTemplateTargetoptionMapper.selectSvyLibTemplateTargetoptionList(svyLibTemplateTargetoption); + svyLibTemplateScriptVO.setSvyLibTemplateTargetoptions(svyLibTemplateTargetoptions); + } + } + + //鍙鎵撳紑浜嗛〉闈㈠氨绠楁垚鍔� + SvyTaskSingle svyTaskSingle = new SvyTaskSingle(); + svyTaskSingle.setTaskid(taskid); + svyTaskSingle.setPatid(patid); + svyTaskSingle.setResult("success"); + svyTaskSingle.setFinishtime(new Date()); + svyTaskSingleMapper.updateSvyTaskSingle(svyTaskSingle); + + return svyLibTemplateScriptVOS; + } } diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java index ec35965..8de8496 100644 --- a/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java @@ -136,6 +136,7 @@ svyTaskSingle.setAddr(patTaskRelevance.getAddr()); svyTaskSingle.setPatid(patTaskRelevance.getPatid()); svyTaskSingle.setSendstate(1L); + svyTaskSingle.setHospType(patTaskRelevance.getHospType()); svyTaskSingle.setCreateTime(DateUtils.getNowDate()); svyTaskSingleMapper.insertSvyTaskSingle(svyTaskSingle); integer = svyTaskSingle.getId().intValue(); @@ -162,6 +163,7 @@ svyTaskSingle.setPhone(patTaskRelevance.getPhone()); svyTaskSingle.setAddr(patTaskRelevance.getAddr()); svyTaskSingle.setPatid(patTaskRelevance.getPatid()); + svyTaskSingle.setHospType(patTaskRelevance.getHospType()); svyTaskSingle.setCreateTime(DateUtils.getNowDate()); svyTaskSingle.setTextParam(new Gson().toJson(svyTaskVO.getTextParamMap())); if (patTaskRelevance.getIsoperation() != null) { @@ -222,6 +224,7 @@ patTaskRelevance.setAddr(svyTaskSingle1.getAddr()); patTaskRelevance.setDiagname(svyTaskSingle1.getDiagname()); patTaskRelevance.setPatid(svyTaskSingle1.getPatid()); + patTaskRelevance.setSendState(svyTaskSingle1.getSendstate()); patTaskRelevances.add(patTaskRelevance); } if (svyTaskSingle1.getHospType().equals("2")) { @@ -235,6 +238,7 @@ patTaskRelevance.setBedNo(svyTaskSingle1.getBedno()); patTaskRelevance.setDiagname(svyTaskSingle1.getDiagname()); patTaskRelevance.setPatid(svyTaskSingle1.getPatid()); + patTaskRelevance.setSendState(svyTaskSingle1.getSendstate()); patTaskRelevances.add(patTaskRelevance); } } diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java index a18eb0d..15cf5da 100644 --- a/smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/SvyTaskTemplateServiceImpl.java @@ -135,38 +135,15 @@ if (CollectionUtils.isNotEmpty(svyTaskTemplateVO.getSvyTaskTemplateScriptVOS())) { log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()鏄惁鏈夋暟鎹搱锛歿}", svyTaskTemplateVO.getSvyTaskTemplateScriptVOS()); for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : svyTaskTemplateVO.getSvyTaskTemplateScriptVOS()) { - if (svyTaskTemplateScriptVO.getIsoperation() != null && svyTaskTemplateScriptVO.getIsoperation() == 1 || svyTaskTemplateScriptVO.getIsoperation() == null && svyTaskTemplateScriptVO.getIsoperation() == 1) { - //鏂板 - SvyTaskTemplateScript svyTaskTemplateScript = DtoConversionUtils.sourceToTarget(svyTaskTemplateScriptVO, SvyTaskTemplateScript.class); - svyTaskTemplateScript.setTemplateID(svyTaskTemplate.getId()); - svyTaskTemplateScript.setCreateTime(new Date()); - svyTaskTemplateScriptMapper.insertSvyTaskTemplateScript(svyTaskTemplateScript); - svyTaskTemplateScript.setIsoperation(1); - //瀵归�夐」鐩繘琛屽鐞� - dealOption(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions(), svyTaskTemplateScript, svyTaskTemplate.getId()); - - } else if (svyTaskTemplateScriptVO.getIsoperation() != null && svyTaskTemplateScriptVO.getIsoperation() == 2) { - //淇敼 - SvyTaskTemplateScript svyTaskTemplateScript = DtoConversionUtils.sourceToTarget(svyTaskTemplateScriptVO, SvyTaskTemplateScript.class); - svyTaskTemplateScript.setTemplateID(svyTaskTemplate.getId()); - svyTaskTemplateScript.setUpdateTime(new Date()); - svyTaskTemplateScriptMapper.updateSvyTaskTemplateScript(svyTaskTemplateScript); - svyTaskTemplateScript.setIsoperation(2); - //瀵归�夐」鐩繘琛屽鐞� - dealOption(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions(), svyTaskTemplateScript, svyTaskTemplate.getId()); - - } else if (svyTaskTemplateScriptVO.getIsoperation() != null && svyTaskTemplateScriptVO.getIsoperation() == 3) { - //鍒犻櫎 - if (svyTaskTemplateScriptVO.getID() == null) { - log.info("鍒犻櫎澶辫触,妯℃澘璇濇湳id涓虹┖"); - } else { - svyTaskTemplateScriptVO.setUpdateTime(new Date()); - svyTaskTemplateScriptMapper.deleteSvyTaskTemplateScriptByID(svyTaskTemplateScriptVO.getID()); - } + if (svyTaskTemplateScriptVO.getIsoperation() != null) { + SvyTaskTemplateScript svyTaskTemplateScript = scriptHandle(svyTaskTemplate, svyTaskTemplateScriptVO, svyTaskTemplateScriptVO.getIsoperation()); + dealOption(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions(), svyTaskTemplateScript, svyTaskTemplate.getId(), svyTaskTemplateScriptVO.getIsoperation()); + } else { + SvyTaskTemplateScript svyTaskTemplateScript = scriptHandle(svyTaskTemplate, svyTaskTemplateScriptVO, svyTaskTemplateVO.getIsoperation()); + dealOption(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions(), svyTaskTemplateScript, svyTaskTemplate.getId(), svyTaskTemplateVO.getIsoperation()); } } } - return i; } @@ -229,12 +206,44 @@ } - private void dealOption(List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions, SvyTaskTemplateScript svyTaskTemplateScript, Long tmpID) { + private SvyTaskTemplateScript scriptHandle(SvyTaskTemplate svyTaskTemplate, SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Integer isoperation) { + SvyTaskTemplateScript svyTaskTemplateScript = DtoConversionUtils.sourceToTarget(svyTaskTemplateScriptVO, SvyTaskTemplateScript.class); + if (isoperation == 1) { + //鏂板 + svyTaskTemplateScript.setTemplateID(svyTaskTemplate.getId()); + svyTaskTemplateScript.setCreateTime(new Date()); + svyTaskTemplateScriptMapper.insertSvyTaskTemplateScript(svyTaskTemplateScript); + svyTaskTemplateScript.setIsoperation(1); + } else if (isoperation == 2) { + //淇敼 + svyTaskTemplateScript.setTemplateID(svyTaskTemplate.getId()); + svyTaskTemplateScript.setUpdateTime(new Date()); + svyTaskTemplateScriptMapper.updateSvyTaskTemplateScript(svyTaskTemplateScript); + svyTaskTemplateScript.setIsoperation(2); + } else if (isoperation == 3) { + if (svyTaskTemplateScriptVO.getID() == null) { + log.info("鍒犻櫎澶辫触,妯℃澘璇濇湳id涓虹┖"); + } else { + svyTaskTemplateScriptVO.setUpdateTime(new Date()); + svyTaskTemplateScriptMapper.deleteSvyTaskTemplateScriptByID(svyTaskTemplateScriptVO.getID()); + } + } + return svyTaskTemplateScript; + } + + private void dealOption(List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions, SvyTaskTemplateScript svyTaskTemplateScript, Long tmpID, Integer isoperation) { log.info("svyTaskTemplateScript鐨勫�间负锛歿}", svyTaskTemplateScript); + Integer lsIsoperation = isoperation; //瀵规ā鏉挎寚鏍囬�夐」杩涜澶勭悊 if (CollectionUtils.isNotEmpty(svyTaskTemplateTargetoptions)) { for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption : svyTaskTemplateTargetoptions) { - if (svyTaskTemplateTargetoption.getIsoperation() != null && svyTaskTemplateTargetoption.getIsoperation() == 1 || svyTaskTemplateTargetoption.getIsoperation() == null && svyTaskTemplateTargetoption.getIsoperation() == 1) { + // 濡傛灉閫夐」鏈韩鐨刼peration涓嶄负绌猴紝灏辩敤鑷繁鐨�;涓嶇劧锛屽氨鐢ㄤ紶杩囨潵鐨� + if (svyTaskTemplateTargetoption.getIsoperation() != null) { + isoperation = svyTaskTemplateTargetoption.getIsoperation(); + } else { + isoperation = lsIsoperation; + } + if (isoperation == 1) { //鏂板 svyTaskTemplateTargetoption.setTemplateID(tmpID); svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScript.getID()); @@ -243,7 +252,7 @@ if (CollectionUtils.isNotEmpty(svyTaskTemplateTargetoption.getNodynamiccruxs())) svyTaskTemplateTargetoption.setNodynamiccruxsJson(JSON.toJSONString(svyTaskTemplateTargetoption.getNodynamiccruxs())); svyTaskTemplateTargetoptionMapper.insertSvyTaskTemplateTargetoption(svyTaskTemplateTargetoption); - } else if (svyTaskTemplateTargetoption.getIsoperation() != null && svyTaskTemplateTargetoption.getIsoperation() == 2) { + } else if (isoperation == 2) { //淇敼 svyTaskTemplateTargetoption.setTemplateID(tmpID); svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScript.getID()); @@ -252,7 +261,7 @@ if (CollectionUtils.isNotEmpty(svyTaskTemplateTargetoption.getNodynamiccruxs())) svyTaskTemplateTargetoption.setNodynamiccruxsJson(JSON.toJSONString(svyTaskTemplateTargetoption.getNodynamiccruxs())); svyTaskTemplateTargetoptionMapper.updateSvyTaskTemplateTargetoption(svyTaskTemplateTargetoption); - } else if (svyTaskTemplateTargetoption.getIsoperation() != null && svyTaskTemplateTargetoption.getIsoperation() == 3) { + } else if (isoperation == 3) { //鍒犻櫎 if (svyTaskTemplateTargetoption.getId() == null) { log.info("鍒犻櫎澶辫触,妯℃澘鎸囨爣閫夐」id涓虹┖"); diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml index 40d3f32..acd0b89 100644 --- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml @@ -59,12 +59,14 @@ <result property="libtemplateid" column="libtemplateid"/> <result property="libtemplatename" column="libtemplatename"/> <result property="recallcount" column="recallcount"/> + <result property="instruction" column="instruction"/> </resultMap> <sql id="selectIvrTaskTemplateVo"> select ID, taskid, recallcount, + instruction, libtemplateid, libtemplatename, taskname, @@ -201,6 +203,7 @@ <if test="recallcount != null">recallcount,</if> <if test="libtemplateid != null ">libtemplateid,</if> <if test="libtemplatename != null ">libtemplatename,</if> + <if test="instruction != null ">instruction,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="taskid != null">#{taskid},</if> @@ -256,6 +259,7 @@ <if test="recallcount != null">#{recallcount},</if> <if test="libtemplateid != null ">#{libtemplateid},</if> <if test="libtemplatename != null ">#{libtemplatename},</if> + <if test="instruction != null ">#{instruction},</if> </trim> </insert> @@ -315,6 +319,7 @@ <if test="recallcount != null">recallcount = #{recallcount},</if> <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if> <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> + <if test="instruction != null ">instruction = #{instruction},</if> </trim> where ID = #{ID} </update> diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml similarity index 94% rename from smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml rename to smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml index 69ddcbb..cf647f6 100644 --- a/smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml @@ -2,9 +2,9 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.smartor.mapper.IvrTaskSingleMapper"> +<mapper namespace="com.smartor.mapper.ServiceSubtaskMapper"> - <resultMap type="com.smartor.domain.IvrTaskSingle" id="IvrTaskcallResult"> + <resultMap type="com.smartor.domain.ServiceSubtask" id="ServiceSubtaskResult"> <result property="id" column="id"/> <result property="sendname" column="sendname"/> <result property="phone" column="phone"/> @@ -56,7 +56,7 @@ <result property="libtemplateid" column="libtemplateid"/> </resultMap> - <sql id="selectIvrTaskcallVo"> + <sql id="selectServiceSubtaskVo"> select id, hosp_type, libtemplateid, @@ -107,11 +107,11 @@ deptname, stop_state, diagname - from ivr_task_single + from service_subtask </sql> - <select id="selectIvrTaskcallList" parameterType="com.smartor.domain.IvrTaskSingle" resultMap="IvrTaskcallResult"> - <include refid="selectIvrTaskcallVo"/> + <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask" resultMap="ServiceSubtaskResult"> + <include refid="selectServiceSubtaskVo"/> <where> del_flag=0 <if test="sendname != null and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if> @@ -156,14 +156,14 @@ order by update_time desc,id desc </select> - <select id="selectIvrTaskcallById" parameterType="Long" resultMap="IvrTaskcallResult"> - <include refid="selectIvrTaskcallVo"/> + <select id="selectServiceSubtaskById" parameterType="Long" resultMap="ServiceSubtaskResult"> + <include refid="selectServiceSubtaskVo"/> where id = #{id} </select> - <insert id="insertIvrTaskcall" parameterType="com.smartor.domain.IvrTaskSingle" useGeneratedKeys="true" + <insert id="insertServiceSubtask" parameterType="com.smartor.domain.ServiceSubtask" useGeneratedKeys="true" keyProperty="id"> - insert into ivr_task_single + insert into service_subtask <trim prefix="(" suffix=")" suffixOverrides=","> <if test="sendname != null">sendname,</if> <if test="phone != null">phone,</if> @@ -266,8 +266,8 @@ </trim> </insert> - <update id="updateIvrTaskcall" parameterType="com.smartor.domain.IvrTaskSingle"> - update ivr_task_single + <update id="updateServiceSubtask" parameterType="com.smartor.domain.ServiceSubtask"> + update service_subtask <trim prefix="SET" suffixOverrides=","> <if test="sendname != null">sendname = #{sendname},</if> <if test="phone != null">phone = #{phone},</if> @@ -321,8 +321,8 @@ where id = #{id} </update> - <update id="updateIvrTaskcallByCondition" parameterType="com.smartor.domain.IvrTaskSingle"> - update ivr_task_single + <update id="updateServiceSubtaskByCondition" parameterType="com.smartor.domain.ServiceSubtask"> + update service_subtask <trim prefix="SET" suffixOverrides=","> <if test="sendname != null">sendname = #{sendname},</if> <if test="phone != null">phone = #{phone},</if> @@ -376,23 +376,23 @@ where patid = #{patid} and taskid = #{taskid} </update> - <update id="deleteIvrTaskcallById" parameterType="Long"> - update ivr_task_single + <update id="deleteServiceSubtaskById" parameterType="Long"> + update service_subtask <trim prefix="SET" suffixOverrides=","> del_flag =1 </trim> where id = #{id} </update> - <update id="deleteIvrTaskcallByCondition" > - update ivr_task_single + <update id="deleteServiceSubtaskByCondition" > + update service_subtask <trim prefix="SET" suffixOverrides=","> del_flag =1 </trim> where patid = #{patid} and taskid = #{taskid} </update> - <select id="getDataByTime" resultMap="IvrTaskcallResult"> + <select id="getDataByTime" resultMap="ServiceSubtaskResult"> select id, sendname, @@ -441,7 +441,7 @@ patid, deptname, diagname - FROM ivr_task_single, + FROM service_subtask, JSON_TABLE(send_time_slot, '$[*]' COLUMNS ( begantime DATETIME PATH '$.begantime', endtime DATETIME PATH '$.endtime' diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml new file mode 100644 index 0000000..383dac3 --- /dev/null +++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.smartor.mapper.ServiceSubtaskRecordMapper"> + + <resultMap type="com.smartor.domain.ServiceSubtaskRecord" id="ServiceSubtaskRecordResult"> + <result property="id" column="id"/> + <result property="taskid" column="taskid"/> + <result property="uuid" column="uuid"/> + <result property="tasktype" column="tasktype"/> + <result property="preachform" column="preachform"/> + <result property="recordtype" column="recordtype"/> + <result property="startTime" column="start_time"/> + <result property="endTime" column="end_time"/> + <result property="result" column="result"/> + <result property="delFlag" column="del_flag"/> + <result property="updateBy" column="update_by"/> + <result property="updateTime" column="update_time"/> + <result property="createBy" column="create_by"/> + <result property="createTime" column="create_time"/> + <result property="isupload" column="isupload"/> + <result property="uploadTime" column="upload_time"/> + <result property="orgid" column="orgid"/> + <result property="pid" column="pid"/> + <result property="guid" column="guid"/> + </resultMap> + + <sql id="selectServiceSubtaskRecordVo"> + select id, + taskid, + uuid, + tasktype, + preachform, + recordtype, + start_time, + end_time, + result, + del_flag, + update_by, + update_time, + create_by, + create_time, + isupload, + upload_time, + orgid, + pid, + guid + from service_subtask_record + </sql> + + <select id="selectServiceSubtaskRecordList" parameterType="com.smartor.domain.ServiceSubtaskRecord" + resultMap="ServiceSubtaskRecordResult"> + <include refid="selectServiceSubtaskRecordVo"/> + <where> + <if test="taskid != null and taskid != ''">and taskid = #{taskid}</if> + <if test="uuid != null and uuid != ''">and uuid = #{uuid}</if> + <if test="tasktype != null and tasktype != ''">and tasktype = #{tasktype}</if> + <if test="preachform != null and preachform != ''">and preachform = #{preachform}</if> + <if test="recordtype != null and recordtype != ''">and recordtype = #{recordtype}</if> + <if test="startTime != null ">and start_time = #{startTime}</if> + <if test="endTime != null ">and end_time = #{endTime}</if> + <if test="result != null and result != ''">and result = #{result}</if> + <if test="isupload != null ">and isupload = #{isupload}</if> + <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> + <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> + <if test="pid != null ">and pid = #{pid}</if> + <if test="guid != null and guid != ''">and guid = #{guid}</if> + </where> + </select> + + <select id="selectServiceSubtaskRecordById" parameterType="Long" resultMap="ServiceSubtaskRecordResult"> + <include refid="selectServiceSubtaskRecordVo"/> + where id = #{id} + </select> + + <insert id="insertServiceSubtaskRecord" parameterType="com.smartor.domain.ServiceSubtaskRecord"> + insert into service_subtask_record + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">id,</if> + <if test="taskid != null">taskid,</if> + <if test="uuid != null">uuid,</if> + <if test="tasktype != null">tasktype,</if> + <if test="preachform != null">preachform,</if> + <if test="recordtype != null">recordtype,</if> + <if test="startTime != null">start_time,</if> + <if test="endTime != null">end_time,</if> + <if test="result != null">result,</if> + <if test="delFlag != null">del_flag,</if> + <if test="updateBy != null">update_by,</if> + <if test="updateTime != null">update_time,</if> + <if test="createBy != null">create_by,</if> + <if test="createTime != null">create_time,</if> + <if test="isupload != null">isupload,</if> + <if test="uploadTime != null">upload_time,</if> + <if test="orgid != null">orgid,</if> + <if test="pid != null">pid,</if> + <if test="guid != null">guid,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null">#{id},</if> + <if test="taskid != null">#{taskid},</if> + <if test="uuid != null">#{uuid},</if> + <if test="tasktype != null">#{tasktype},</if> + <if test="preachform != null">#{preachform},</if> + <if test="recordtype != null">#{recordtype},</if> + <if test="startTime != null">#{startTime},</if> + <if test="endTime != null">#{endTime},</if> + <if test="result != null">#{result},</if> + <if test="delFlag != null">#{delFlag},</if> + <if test="updateBy != null">#{updateBy},</if> + <if test="updateTime != null">#{updateTime},</if> + <if test="createBy != null">#{createBy},</if> + <if test="createTime != null">#{createTime},</if> + <if test="isupload != null">#{isupload},</if> + <if test="uploadTime != null">#{uploadTime},</if> + <if test="orgid != null">#{orgid},</if> + <if test="pid != null">#{pid},</if> + <if test="guid != null">#{guid},</if> + </trim> + </insert> + + <update id="updateServiceSubtaskRecord" parameterType="com.smartor.domain.ServiceSubtaskRecord"> + update service_subtask_record + <trim prefix="SET" suffixOverrides=","> + <if test="taskid != null">taskid = #{taskid},</if> + <if test="uuid != null">uuid = #{uuid},</if> + <if test="tasktype != null">tasktype = #{tasktype},</if> + <if test="preachform != null">preachform = #{preachform},</if> + <if test="recordtype != null">recordtype = #{recordtype},</if> + <if test="startTime != null">start_time = #{startTime},</if> + <if test="endTime != null">end_time = #{endTime},</if> + <if test="result != null">result = #{result},</if> + <if test="delFlag != null">del_flag = #{delFlag},</if> + <if test="updateBy != null">update_by = #{updateBy},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> + <if test="createBy != null">create_by = #{createBy},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="isupload != null">isupload = #{isupload},</if> + <if test="uploadTime != null">upload_time = #{uploadTime},</if> + <if test="orgid != null">orgid = #{orgid},</if> + <if test="pid != null">pid = #{pid},</if> + <if test="guid != null">guid = #{guid},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteServiceSubtaskRecordById" parameterType="Long"> + delete + from service_subtask_record + where id = #{id} + </delete> + + <delete id="deleteServiceSubtaskRecordByIds" parameterType="String"> + delete from service_subtask_record where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> +</mapper> diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml similarity index 93% rename from smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml rename to smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml index 8bd3dbf..4ea6872 100644 --- a/smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml @@ -2,9 +2,9 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.smartor.mapper.IvrTaskMapper"> +<mapper namespace="com.smartor.mapper.ServiceTaskMapper"> - <resultMap type="com.smartor.domain.IvrTask" id="IvrTaskResult"> + <resultMap type="com.smartor.domain.ServiceTask" id="ServiceTaskResult"> <result property="taskid" column="taskid"/> <result property="taskName" column="task_name"/> <result property="templateid" column="templateid"/> @@ -46,7 +46,7 @@ <result property="textParam" column="text_param"/> </resultMap> - <sql id="selectIvrTaskVo"> + <sql id="selectServiceTaskVo"> select taskid, task_name, show_date, @@ -86,11 +86,11 @@ send_state, send_time_slot, orgid - from ivr_task + from service_task </sql> - <select id="selectIvrTaskList" parameterType="com.smartor.domain.IvrTask" resultMap="IvrTaskResult"> - <include refid="selectIvrTaskVo"/> + <select id="selectServiceTaskList" parameterType="com.smartor.domain.ServiceTask" resultMap="ServiceTaskResult"> + <include refid="selectServiceTaskVo"/> <where> <if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if> <if test="sendTimeSlot != null and sendTimeSlot != ''">and send_time_slot like concat('%', #{sendTimeSlot}, @@ -123,14 +123,14 @@ order by update_time desc,taskid desc </select> - <select id="selectIvrTaskByTaskid" parameterType="Long" resultMap="IvrTaskResult"> - <include refid="selectIvrTaskVo"/> + <select id="selectServiceTaskByTaskid" parameterType="Long" resultMap="ServiceTaskResult"> + <include refid="selectServiceTaskVo"/> where taskid = #{taskid} </select> - <insert id="insertIvrTask" parameterType="com.smartor.domain.IvrTask" useGeneratedKeys="true" + <insert id="insertServiceTask" parameterType="com.smartor.domain.ServiceTask" useGeneratedKeys="true" keyProperty="taskid"> - insert into ivr_task + insert into service_task <trim prefix="(" suffix=")" suffixOverrides=","> <if test="taskName != null">task_name,</if> <if test="templateid != null">templateid,</if> @@ -214,8 +214,8 @@ </trim> </insert> - <update id="updateIvrTask" parameterType="com.smartor.domain.IvrTask"> - update ivr_task + <update id="updateServiceTask" parameterType="com.smartor.domain.ServiceTask"> + update service_task <trim prefix="SET" suffixOverrides=","> <if test="taskName != null">task_name = #{taskName},</if> <if test="templateid != null">templateid = #{templateid},</if> @@ -259,16 +259,16 @@ where taskid = #{taskid} </update> - <update id="deleteIvrTaskByTaskid" parameterType="Long"> - update ivr_task + <update id="deleteServiceTaskByTaskid" parameterType="Long"> + update service_task <trim prefix="SET" suffixOverrides=","> del_flag =1 </trim> where taskid = #{taskid} </update> - <update id="deleteIvrTaskByTaskids" parameterType="String"> - update ivr_task + <update id="deleteServiceTaskByTaskids" parameterType="String"> + update service_task <trim prefix="SET" suffixOverrides=","> del_flag =1 </trim> diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml index 3e134ad..af88d7d 100644 --- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml @@ -9,8 +9,8 @@ <result property="oldid" column="oldid"/> <result property="svyid" column="svyid"/> <result property="scriptType" column="script_type"/> - <result property="scriptCode" column="script_code"/> - <result property="script" column="script"/> + <result property="seqno" column="seqno"/> + <result property="scriptDesc" column="script_desc"/> <result property="tag" column="tag"/> <result property="sort" column="sort"/> <result property="ismandatory" column="ismandatory"/> @@ -37,7 +37,7 @@ <result property="scoretype" column="scoretype"/> <result property="score" column="score"/> <result property="scriptPicture" column="script_picture"/> - <result property="topic" column="topic"/> + <result property="scriptTopic" column="script_topic"/> </resultMap> <sql id="selectSvyLibTemplateScriptVo"> @@ -45,8 +45,8 @@ oldid, svyid, script_type, - script_code, - script, + seqno, + script_desc, tag, sort, ismandatory, @@ -66,7 +66,7 @@ script_content, suitway, script_picture, - topic, + script_topic, isavailable, language, otherdata, value_type, reply, scoretype, score from svy_lib_template_script </sql> @@ -79,8 +79,8 @@ <if test="oldid != null ">and oldid = #{oldid}</if> <if test="svyid != null ">and svyid = #{svyid}</if> <if test="scriptType != null and scriptType != ''">and script_type = #{scriptType}</if> - <if test="scriptCode != null and scriptCode != ''">and script_code = #{scriptCode}</if> - <if test="script != null and script != ''">and script = #{script}</if> + <if test="seqno != null and seqno != ''">and seqno = #{seqno}</if> + <if test="scriptDesc != null and scriptDesc != ''">and script_desc = #{scriptDesc}</if> <if test="tag != null and tag != ''">and tag = #{tag}</if> <if test="sort != null ">and sort = #{sort}</if> <if test="ismandatory != null and ismandatory != ''">and ismandatory = #{ismandatory}</if> @@ -101,7 +101,7 @@ <if test="reply != null and reply != ''">and reply = #{reply}</if> <if test="scoretype != null and scoretype != ''">and scoretype = #{scoretype}</if> <if test="score != null and score != ''">and score = #{score}</if> - <if test="topic != null and topic != ''">and topic = #{topic}</if> + <if test="scriptTopic != null and scriptTopic != ''">and script_topic = #{scriptTopic}</if> </where> </select> @@ -117,8 +117,8 @@ <if test="oldid != null">oldid,</if> <if test="svyid != null">svyid,</if> <if test="scriptType != null">script_type,</if> - <if test="scriptCode != null">script_code,</if> - <if test="script != null">script,</if> + <if test="seqno != null">seqno,</if> + <if test="scriptDesc != null">script_desc,</if> <if test="tag != null">tag,</if> <if test="sort != null">sort,</if> <if test="ismandatory != null">ismandatory,</if> @@ -145,14 +145,14 @@ <if test="scoretype != null">scoretype,</if> <if test="score != null">score,</if> <if test="scriptPicture != null">script_picture,</if> - <if test="topic != null">topic,</if> + <if test="scriptTopic != null">script_topic,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="oldid != null">#{oldid},</if> <if test="svyid != null">#{svyid},</if> <if test="scriptType != null">#{scriptType},</if> - <if test="scriptCode != null">#{scriptCode},</if> - <if test="script != null">#{script},</if> + <if test="seqno != null">#{seqno},</if> + <if test="scriptDesc != null">#{scriptDesc},</if> <if test="tag != null">#{tag},</if> <if test="sort != null">#{sort},</if> <if test="ismandatory != null">#{ismandatory},</if> @@ -179,7 +179,7 @@ <if test="scoretype != null">#{scoretype},</if> <if test="score != null">#{score},</if> <if test="scriptPicture != null">#{scriptPicture},</if> - <if test="topic != null">#{topic},</if> + <if test="scriptTopic != null">#{scriptTopic},</if> </trim> </insert> @@ -189,8 +189,8 @@ <if test="oldid != null">oldid = #{oldid},</if> <if test="svyid != null">svyid = #{svyid},</if> <if test="scriptType != null">script_type = #{scriptType},</if> - <if test="scriptCode != null">script_code = #{scriptCode},</if> - <if test="script != null">script = #{script},</if> + <if test="seqno != null">seqno = #{seqno},</if> + <if test="scriptDesc != null">script_desc = #{scriptDesc},</if> <if test="tag != null">tag = #{tag},</if> <if test="sort != null">sort = #{sort},</if> <if test="ismandatory != null">ismandatory = #{ismandatory},</if> @@ -217,7 +217,7 @@ <if test="scoretype != null">scoretype = #{scoretype},</if> <if test="score != null">score = #{score},</if> <if test="scriptPicture != null">script_picture = #{scriptPicture},</if> - <if test="topic != null">topic = #{topic},</if> + <if test="scriptTopic != null">script_topic = #{scriptTopic},</if> </trim> where id = #{id} </update> diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml new file mode 100644 index 0000000..1df042f --- /dev/null +++ b/smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.smartor.mapper.SvyTaskAnswerMapper"> + + <resultMap type="com.smartor.domain.SvyTaskAnswer" id="SvyTaskAnswerResult"> + <result property="id" column="id"/> + <result property="taskid" column="taskid"/> + <result property="singleid" column="singleid"/> + <result property="scriptid" column="scriptid"/> + <result property="scriptType" column="script_type"/> + <result property="score" column="score"/> + <result property="answer" column="answer"/> + <result property="comment" column="comment"/> + <result property="istrack" column="istrack"/> + <result property="isabnormal" column="isabnormal"/> + <result property="delFlag" column="del_flag"/> + <result property="createBy" column="create_by"/> + <result property="createTime" column="create_time"/> + <result property="updateBy" column="update_by"/> + <result property="updateTime" column="update_time"/> + <result property="isupload" column="isupload"/> + <result property="uploadTime" column="upload_time"/> + <result property="pid" column="pid"/> + <result property="guid" column="guid"/> + </resultMap> + + <sql id="selectSvyTaskAnswerVo"> + select id, + taskid, + singleid, + scriptid, + script_type, + score, + answer, + comment, + istrack, + isabnormal, + del_flag, + create_by, + create_time, + update_by, + update_time, + isupload, + upload_time, + pid, + guid + from svy_task_answer + </sql> + + <select id="selectSvyTaskAnswerList" parameterType="com.smartor.domain.SvyTaskAnswer" + resultMap="SvyTaskAnswerResult"> + <include refid="selectSvyTaskAnswerVo"/> + <where> + <if test="taskid != null ">and taskid = #{taskid}</if> + <if test="singleid != null ">and singleid = #{singleid}</if> + <if test="scriptid != null ">and scriptid = #{scriptid}</if> + <if test="scriptType != null ">and script_type = #{scriptType}</if> + <if test="score != null and score != ''">and score = #{score}</if> + <if test="answer != null and answer != ''">and answer = #{answer}</if> + <if test="comment != null and comment != ''">and comment = #{comment}</if> + <if test="istrack != null and istrack != ''">and istrack = #{istrack}</if> + <if test="isabnormal != null and isabnormal != ''">and isabnormal = #{isabnormal}</if> + <if test="isupload != null ">and isupload = #{isupload}</if> + <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> + <if test="pid != null and pid != ''">and pid = #{pid}</if> + <if test="guid != null and guid != ''">and guid = #{guid}</if> + </where> + </select> + + <select id="selectSvyTaskAnswerById" parameterType="Long" resultMap="SvyTaskAnswerResult"> + <include refid="selectSvyTaskAnswerVo"/> + where id = #{id} + </select> + + <insert id="insertSvyTaskAnswer" parameterType="com.smartor.domain.SvyTaskAnswer"> + insert into svy_task_answer + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">id,</if> + <if test="taskid != null">taskid,</if> + <if test="singleid != null">singleid,</if> + <if test="scriptid != null">scriptid,</if> + <if test="scriptType != null">script_type,</if> + <if test="score != null">score,</if> + <if test="answer != null">answer,</if> + <if test="comment != null">comment,</if> + <if test="istrack != null">istrack,</if> + <if test="isabnormal != null">isabnormal,</if> + <if test="delFlag != null">del_flag,</if> + <if test="createBy != null">create_by,</if> + <if test="createTime != null">create_time,</if> + <if test="updateBy != null">update_by,</if> + <if test="updateTime != null">update_time,</if> + <if test="isupload != null">isupload,</if> + <if test="uploadTime != null">upload_time,</if> + <if test="pid != null">pid,</if> + <if test="guid != null">guid,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null">#{id},</if> + <if test="taskid != null">#{taskid},</if> + <if test="singleid != null">#{singleid},</if> + <if test="scriptid != null">#{scriptid},</if> + <if test="scriptType != null">#{scriptType},</if> + <if test="score != null">#{score},</if> + <if test="answer != null">#{answer},</if> + <if test="comment != null">#{comment},</if> + <if test="istrack != null">#{istrack},</if> + <if test="isabnormal != null">#{isabnormal},</if> + <if test="delFlag != null">#{delFlag},</if> + <if test="createBy != null">#{createBy},</if> + <if test="createTime != null">#{createTime},</if> + <if test="updateBy != null">#{updateBy},</if> + <if test="updateTime != null">#{updateTime},</if> + <if test="isupload != null">#{isupload},</if> + <if test="uploadTime != null">#{uploadTime},</if> + <if test="pid != null">#{pid},</if> + <if test="guid != null">#{guid},</if> + </trim> + </insert> + + <update id="updateSvyTaskAnswer" parameterType="com.smartor.domain.SvyTaskAnswer"> + update svy_task_answer + <trim prefix="SET" suffixOverrides=","> + <if test="taskid != null">taskid = #{taskid},</if> + <if test="singleid != null">singleid = #{singleid},</if> + <if test="scriptid != null">scriptid = #{scriptid},</if> + <if test="scriptType != null">script_type = #{scriptType},</if> + <if test="score != null">score = #{score},</if> + <if test="answer != null">answer = #{answer},</if> + <if test="comment != null">comment = #{comment},</if> + <if test="istrack != null">istrack = #{istrack},</if> + <if test="isabnormal != null">isabnormal = #{isabnormal},</if> + <if test="delFlag != null">del_flag = #{delFlag},</if> + <if test="createBy != null">create_by = #{createBy},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="updateBy != null">update_by = #{updateBy},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> + <if test="isupload != null">isupload = #{isupload},</if> + <if test="uploadTime != null">upload_time = #{uploadTime},</if> + <if test="pid != null">pid = #{pid},</if> + <if test="guid != null">guid = #{guid},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteSvyTaskAnswerById" parameterType="Long"> + delete + from svy_task_answer + where id = #{id} + </delete> + + <delete id="deleteSvyTaskAnswerByIds" parameterType="String"> + delete from svy_task_answer where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> +</mapper> diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml index 9d762db..c86f309 100644 --- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml @@ -38,11 +38,17 @@ <result property="valueType" column="value_type"/> <result property="reply" column="reply"/> <result property="taskid" column="taskid"/> + <result property="prologue" column="prologue"/> + <result property="instruction" column="instruction"/> + <result property="conclusion" column="conclusion"/> </resultMap> <sql id="selectSvyTaskTemplateVo"> select id, templateid, + prologue, + instruction, + conclusion, categoryid, svycode, svyname, @@ -154,6 +160,9 @@ <if test="valueType != null">value_type,</if> <if test="reply != null">reply,</if> <if test="taskid != null">taskid,</if> + <if test="prologue != null">prologue,</if> + <if test="instruction != null">instruction,</if> + <if test="conclusion != null">conclusion,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="templateid != null">#{templateid},</if> @@ -188,6 +197,9 @@ <if test="valueType != null">#{valueType},</if> <if test="reply != null">#{reply},</if> <if test="taskid != null">#{taskid},</if> + <if test="prologue != null">#{prologue},</if> + <if test="instruction != null">#{instruction},</if> + <if test="conclusion != null">#{conclusion},</if> </trim> </insert> @@ -226,6 +238,9 @@ <if test="valueType != null">value_type = #{valueType},</if> <if test="reply != null">reply = #{reply},</if> <if test="taskid != null">taskid = #{taskid},</if> + <if test="prologue != null">prologue = #{prologue},</if> + <if test="instruction != null">instruction = #{instruction},</if> + <if test="conclusion != null">conclusion = #{conclusion},</if> </trim> where id = #{id} </update> -- Gitblit v1.9.3