| | |
| | | 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.utils.PageUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.service.IServiceSubtaskRecordService; |
| | | import com.smartor.service.IServiceSubtaskService; |
| | | 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.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 单一任务(随访)Controller |
| | |
| | | @Autowired |
| | | private IServiceSubtaskService serviceSubtaskService; |
| | | |
| | | @Autowired |
| | | private IServiceSubtaskRecordService serviceSubtaskRecordService; |
| | | |
| | | /** |
| | | * 查询患者随访信息 |
| | | */ |
| | | @ApiOperation("查询患者随访信息") |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:list')") |
| | | @PostMapping("/patItem") |
| | | public TableDataInfo patItem(@RequestBody ServiceSubtask ivrTaskcall) { |
| | | PageUtils.startPageByPost(ivrTaskcall.getPageNum(), ivrTaskcall.getPageSize()); |
| | | return getDataTable(serviceSubtaskService.patItem(ivrTaskcall)); |
| | | public TableDataInfo patItem(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { |
| | | List<ServiceSubtask> serviceSubtaskList = null; |
| | | if (serviceSubtaskVO != null) { |
| | | PageUtils.startPageByPost(serviceSubtaskVO.getPageNum(), serviceSubtaskVO.getPageSize()); |
| | | serviceSubtaskList = serviceSubtaskService.patItem(serviceSubtaskVO); |
| | | } |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); |
| | | serviceSubtaskRecord.setSubtaskId(serviceSubtask.getId()); |
| | | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); |
| | | serviceSubtask.setServiceSubtaskRecordList(serviceSubtaskRecordService.selectServiceSubtaskRecordList(serviceSubtaskRecord)); |
| | | } |
| | | Map<String, Object> map = serviceSubtaskService.patItemCount(serviceSubtaskVO); |
| | | map.put("serviceSubtaskList", serviceSubtaskList); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | list.add(map); |
| | | //获取total |
| | | long total = PageUtils.count(new ISelect() { |
| | | @Override |
| | | public void doSelect() { |
| | | serviceSubtaskVO.setPageNum(null); |
| | | serviceSubtaskVO.setPageSize(null); |
| | | serviceSubtaskService.patItem(serviceSubtaskVO); |
| | | } |
| | | }); |
| | | return getDataTable2(total, list); |
| | | // return getDataTable(serviceSubtaskService.patItem(ivrTaskcall)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 电话回调任务(雨绮) |
| | | * 电话任务拉取(雨绮) |
| | | */ |
| | | @ApiOperation("电话回调任务(雨绮)") |
| | | @ApiOperation("电话任务拉取(雨绮)") |
| | | @PostMapping("/taskPull") |
| | | public List<PullTaskVO> taskPull() { |
| | | log.error("电话回调任务(雨绮)"); |
| | | log.error("电话任务拉取(雨绮)"); |
| | | List<PullTaskVO> pullTaskVOList = serviceSubtaskService.taskPull(); |
| | | log.error("电话回调任务(雨绮):{}", pullTaskVOList); |
| | | log.error("电话任务拉取(雨绮):{}", pullTaskVOList); |
| | | return pullTaskVOList; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 通话记录回调 |
| | | */ |
| | | @ApiOperation("通话记录回调") |
| | | @PostMapping("/recordAccept") |
| | | public AjaxResult recordAccept(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) { |
| | | @ApiOperation("通话记录回调(上海)") |
| | | @PostMapping("/recordAcceptshanghai") |
| | | public AjaxResult recordAccepshanghait(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) { |
| | | return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq)); |
| | | } |
| | | |
| | | /** |
| | | * 通话记录回调 |
| | | */ |
| | | @ApiOperation("通话记录回调(雨绮)") |
| | | @PostMapping("/recordAccept") |
| | | public AjaxResult recordAccept(@RequestBody PhoneCallRecordVO phoneCallRecordVO) { |
| | | log.error("通话记录回调(雨绮):{}", phoneCallRecordVO); |
| | | // return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq)); |
| | | serviceSubtaskService.recordAccept(phoneCallRecordVO); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取每个月的随访、复诊量 |
| | | */ |
| | | @ApiOperation("获取每个月的随访、复诊量") |