| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.github.pagehelper.ISelect; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | |
| | | 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.IvrTask; |
| | | import com.smartor.domain.IvrTaskScriptQues; |
| | | import com.smartor.domain.IvrTaskVO; |
| | | import com.smartor.domain.IvrTaskSingle; |
| | | 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.*; |
| | | |
| | |
| | | * @author smartor |
| | | * @date 2023-03-24 |
| | | */ |
| | | @Slf4j |
| | | @Api(description = "随访任务") |
| | | @RestController |
| | | @RequestMapping("/smartor/ivrtask") |
| | |
| | | |
| | | @Autowired |
| | | private IIvrTaskSingleService iIvrTaskCallService; |
| | | |
| | | @Value("${pub_key}") |
| | | private String pub_key; |
| | | |
| | | @Value("${pri_key}") |
| | | private String pri_key; |
| | | |
| | | /** |
| | | * 查询语音任务列表 |
| | |
| | | PageUtils.startPageByPost(ivrTask.getPageNum(), ivrTask.getPageSize()); |
| | | List<IvrTask> list = ivrTaskService.selectIvrTaskList(ivrTask); |
| | | List<IvrTaskVO> ivrTaskVOS = DtoConversionUtils.sourceToTarget(list, IvrTaskVO.class); |
| | | |
| | | //设置分页 |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("查询成功"); |
| | | rspData.setRows(null); |
| | | rspData.setTotal(0); |
| | | |
| | | if (CollectionUtils.isNotEmpty(ivrTaskVOS)) { |
| | | for (IvrTaskVO ivrTaskVO : ivrTaskVOS) { |
| | |
| | | ivrTaskVO.setWfs(wfs); |
| | | } |
| | | } |
| | | //获取total |
| | | long total = PageUtils.count(new ISelect() { |
| | | @Override |
| | | public void doSelect() { |
| | | ivrTask.setPageNum(null); |
| | | ivrTask.setPageSize(null); |
| | | ivrTaskService.selectIvrTaskList(ivrTask); |
| | | } |
| | | }); |
| | | |
| | | //用于分页 |
| | | ivrTask.setPageNum(null); |
| | | ivrTask.setPageSize(null); |
| | | List<IvrTask> ivrTasks = ivrTaskService.selectIvrTaskList(ivrTask); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("查询成功"); |
| | | rspData.setRows(ivrTaskVOS); |
| | | rspData.setTotal(new PageInfo(ivrTasks).getTotal()); |
| | | return getDataTable2(total, ivrTaskVOS); |
| | | } |
| | | |
| | | return rspData; |
| | | return getDataTable2(0, ivrTaskVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | return toAjax(ivrTaskService.deleteIvrTaskByTaskid(taskId)); |
| | | } |
| | | |
| | | /** |
| | | * 通过任务ID和患者ID获取单个人的题目信息 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("通过任务ID和患者ID获取单个人的题目信息") |
| | | @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和pid的值为:{},{}", tid, pid); |
| | | return getDataTable(ivrTaskService.getScriptInfoByCondition(tid, pid)); |
| | | } |
| | | |
| | | } |