|  |  | 
 |  |  | import com.smartor.mapper.PatMedOuthospMapper; | 
 |  |  | import com.smartor.service.IServiceSubtaskRecordService; | 
 |  |  | 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; | 
 |  |  | 
 |  |  |     private IServiceSubtaskService serviceSubtaskService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private IServiceTaskService serviceTaskService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private IServiceSubtaskRecordService serviceSubtaskRecordService; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:taskcall:list')") | 
 |  |  |     @PostMapping("/patItem") | 
 |  |  |     public TableDataInfo patItem(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { | 
 |  |  |         PageUtils.startPageByPost(serviceSubtaskVO.getPageNum(), serviceSubtaskVO.getPageSize()); | 
 |  |  |         List<ServiceSubtask> serviceSubtaskList = null; | 
 |  |  |         LoginUser loginUser = getLoginUser(); | 
 |  |  |         SysUser user = loginUser.getUser(); | 
 |  |  |         serviceSubtaskVO.setOrgid(user.getOrgid()); | 
 |  |  |         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.setOrgid(serviceSubtask.getOrgid()); | 
 |  |  |             if (ObjectUtils.isNotEmpty((serviceSubtask.getTaskid()))) | 
 |  |  |                 serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); | 
 |  |  |             serviceSubtask.setServiceSubtaskRecordList(serviceSubtaskRecordService.selectServiceSubtaskRecordList(serviceSubtaskRecord)); | 
 |  |  |  | 
 |  |  |             ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); | 
 |  |  |             if (ObjectUtils.isNotEmpty(serviceTask)) serviceSubtask.setPreachform(serviceTask.getPreachform()); | 
 |  |  |         } | 
 |  |  |         Map<String, Object> map = serviceSubtaskService.patItemCount(serviceSubtaskVO); | 
 |  |  |         map.put("serviceSubtaskList", serviceSubtaskList); | 
 |  |  | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |         return getDataTable2(total, list); | 
 |  |  | //        return getDataTable(serviceSubtaskService.patItem(ivrTaskcall)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") | 
 |  |  |     @Log(title = "单一任务(随访宣教)", businessType = BusinessType.EXPORT) | 
 |  |  |     @PostMapping("/patItemExport") | 
 |  |  |     public void patItemExport(HttpServletResponse response, @RequestBody ServiceSubtaskVO serviceSubtaskVO) { | 
 |  |  |     public void patItemExport(HttpServletResponse response, ServiceSubtaskVO serviceSubtaskVO) { | 
 |  |  |         List<ServiceSubtask> serviceSubtaskList = null; | 
 |  |  |         if (serviceSubtaskVO != null) { | 
 |  |  |             if (serviceSubtaskVO.getPageNum() != null && serviceSubtaskVO.getPageSize() != null) | 
 |  |  | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         ExcelUtil<ServiceSubtaskExprot> util = new ExcelUtil<ServiceSubtaskExprot>(ServiceSubtaskExprot.class); | 
 |  |  |         util.exportExcel(response, serviceSubtaskExprots, "患者随访信息表单"); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 随访数据查询 | 
 |  |  |      */ | 
 |  |  |     @Log(title = "随访数据查询", businessType = BusinessType.EXPORT) | 
 |  |  |     @PostMapping("/querySubtaskList") | 
 |  |  |     public AjaxResult querySubtaskList(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { | 
 |  |  |         PageUtils.startPageByPost(serviceSubtaskVO.getPageNum(), serviceSubtaskVO.getPageSize()); | 
 |  |  |         serviceSubtaskService.selectServiceSubtaskList(serviceSubtaskVO); | 
 |  |  |         return success(serviceSubtaskService.selectServiceSubtaskList(serviceSubtaskVO)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 再次随访数据查询 | 
 |  |  |      */ | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") | 
 |  |  |     @Log(title = "再次随访数据查询", businessType = BusinessType.EXPORT) | 
 |  |  |     @PostMapping("/querySubtaskListAgain") | 
 |  |  |     public TableDataInfo querySubtaskListAgain(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { | 
 |  |  |         PageUtils.startPageByPost(serviceSubtaskVO.getPageNum(), serviceSubtaskVO.getPageSize()); | 
 |  |  |         serviceSubtaskService.selectServiceSubtaskListAgain(serviceSubtaskVO); | 
 |  |  |         return getDataTable(serviceSubtaskService.selectServiceSubtaskListAgain(serviceSubtaskVO)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取单一任务(随访)详细信息 | 
 |  |  |      */ | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:taskcall:query')") | 
 |  |  | 
 |  |  |     @Log(title = "单一任务(随访)", businessType = BusinessType.INSERT) | 
 |  |  |     @PostMapping("/insertOrUpdateTask") | 
 |  |  |     public AjaxResult insertOrUpdateHeTask(@RequestBody ServiceTaskVO ivrTaskVO) { | 
 |  |  |         log.error("insertOrUpdateHeTask的入参为:{}", ivrTaskVO); | 
 |  |  |         log.info("insertOrUpdateHeTask的入参为:{}", ivrTaskVO); | 
 |  |  |         LoginUser loginUser = getLoginUser(); | 
 |  |  |         SysUser user = loginUser.getUser(); | 
 |  |  |         ivrTaskVO.setCreateBy(user.getNickName()); | 
 |  |  | 
 |  |  |     @ApiOperation("电话ASR通话回调(雨绮)") | 
 |  |  |     @PostMapping("/phoneCallBackYQ") | 
 |  |  |     public PhoneCallBackYQVO phoneCallBackYQ(@RequestBody PhoneCallReqYQVO phoneCallReqYQVO) { | 
 |  |  |         log.error("电话ASR通话回调(雨绮) ?{}", phoneCallReqYQVO); | 
 |  |  | //        SysUser user = getLoginUser().getUser(); | 
 |  |  | //        phoneCallReqYQVO.setOrgid(user.getOrgid()); | 
 |  |  |         log.info("电话ASR通话回调(雨绮) ?{}", phoneCallReqYQVO); | 
 |  |  |         PhoneCallBackYQVO phoneCallBackYQVO = serviceSubtaskService.phoneCallBackYQ(phoneCallReqYQVO); | 
 |  |  |         return phoneCallBackYQVO; | 
 |  |  |     } | 
 |  |  | 
 |  |  |     @ApiOperation("电话任务拉取(雨绮)") | 
 |  |  |     @PostMapping("/taskPull") | 
 |  |  |     public List<PullTaskVO> taskPull() { | 
 |  |  |         log.error("电话任务拉取(雨绮)"); | 
 |  |  |         log.info("电话任务拉取(雨绮)"); | 
 |  |  |         List<PullTaskVO> pullTaskVOList = serviceSubtaskService.taskPull(); | 
 |  |  | //        List<PullTaskVO> pullTaskVOList = new ArrayList<>(); | 
 |  |  |  | 
 |  |  |         log.error("电话任务拉取(雨绮):{}", pullTaskVOList); | 
 |  |  |         log.info("电话任务拉取数据(雨绮):{}", pullTaskVOList); | 
 |  |  |         return pullTaskVOList; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation("通话记录回调(雨绮)") | 
 |  |  |     @PostMapping("/recordAccept") | 
 |  |  |     public AjaxResult recordAccept(@RequestBody PhoneCallRecordVO phoneCallRecordVO) { | 
 |  |  |         log.error("通话记录回调(雨绮):{}", phoneCallRecordVO); | 
 |  |  | //        return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq)); | 
 |  |  | //        SysUser user = getLoginUser().getUser(); | 
 |  |  | //        phoneCallRecordVO.setOrgid(user.getOrgid()); | 
 |  |  |         log.info("通话记录回调(雨绮):{}", phoneCallRecordVO); | 
 |  |  |         serviceSubtaskService.recordAccept(phoneCallRecordVO); | 
 |  |  |         return success(); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取随访统计比例 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("获取随访满意度统计") | 
 |  |  |     @PostMapping("/getSfStatisticsJoy") | 
 |  |  |     public AjaxResult getSfStatisticsJoy(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { | 
 |  |  |         if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { | 
 |  |  |             return error("服务类型不能为空"); | 
 |  |  |         } | 
 |  |  |         return success(serviceSubtaskService.getSfStatisticsJoy(serviceSubtaskCountReq)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 随访统计导出 | 
 |  |  |      */ | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") | 
 |  |  | 
 |  |  |         util.exportExcel(response, sfStatistics, "随访统计导出"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 随访统计导出 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("服务统计查询-按时间维度统计出院/门诊随访数据") | 
 |  |  |     @PostMapping("/getServiceStatistics") | 
 |  |  |     public AjaxResult getServiceStatistics(@RequestBody ServiceStatisticsRequest serviceStatisticsRequest) { | 
 |  |  |         SysUser user = getLoginUser().getUser(); | 
 |  |  |         serviceStatisticsRequest.setOrgid(user.getOrgid()); | 
 |  |  |         List<ServiceStatisticsResponse> serviceStatistics = serviceSubtaskService.getServiceStatistics(serviceStatisticsRequest); | 
 |  |  |         return success(serviceStatistics); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取随访统计比例 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("获取随访满意度明细") | 
 |  |  |     @PostMapping("/getSfStatisticsJoydetails") | 
 |  |  |     public AjaxResult getSfStatisticsJoydetails(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { | 
 |  |  |         if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() == 0 && serviceSubtaskCountReq.getDeptcodes().size() == 0) { | 
 |  |  |             return error("科室或病区不能为空"); | 
 |  |  |         } | 
 |  |  |         return success(serviceSubtaskService.getSfStatisticsJoydetails(serviceSubtaskCountReq)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |