| | |
| | | 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.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | 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.apache.commons.collections4.CollectionUtils; |
| | | 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()); |
| | | List<ServiceSubtask> serviceSubtaskList = 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() { |
| | | ivrTaskcall.setPageNum(null); |
| | | ivrTaskcall.setPageSize(null); |
| | | serviceSubtaskService.patItem(ivrTaskcall); |
| | | serviceSubtaskVO.setPageNum(null); |
| | | serviceSubtaskVO.setPageSize(null); |
| | | serviceSubtaskService.patItem(serviceSubtaskVO); |
| | | } |
| | | }); |
| | | return getDataTable2(total, serviceSubtaskList); |
| | | return getDataTable2(total, list); |
| | | // return getDataTable(serviceSubtaskService.patItem(ivrTaskcall)); |
| | | } |
| | | |
| | |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") |
| | | @Log(title = "单一任务(随访宣教)", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ServiceSubtask serviceSubtask) { |
| | | ServiceSubtaskVO serviceSubtaskVO = DtoConversionUtils.sourceToTarget(serviceSubtask, ServiceSubtaskVO.class); |
| | | List<ServiceSubtask> list = serviceSubtaskService.selectServiceSubtaskList(serviceSubtaskVO); |
| | | ExcelUtil<ServiceSubtask> util = new ExcelUtil<ServiceSubtask>(ServiceSubtask.class); |
| | | util.exportExcel(response, list, "单一任务(随访)数据"); |
| | | public void export(HttpServletResponse response, ServiceSubtaskVO serviceSubtaskVO) { |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskService.patItem(serviceSubtaskVO); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskList)) { |
| | | List<ServiceSubtaskExportVO> serviceSubtaskExportVOS = DtoConversionUtils.sourceToTarget(serviceSubtaskList, ServiceSubtaskExportVO.class); |
| | | ExcelUtil<ServiceSubtaskExportVO> util = new ExcelUtil<ServiceSubtaskExportVO>(ServiceSubtaskExportVO.class); |
| | | util.exportExcel(response, serviceSubtaskExportVOS, "随访导出数据"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody ServiceSubtask serviceSubtask) { |
| | | return toAjax(serviceSubtaskService.updateServiceSubtask(serviceSubtask)); |
| | | } |
| | | |
| | | @ApiOperation("新增子任务") |
| | | @PostMapping("/addSubTask") |
| | | public AjaxResult addSubTask(@RequestBody ServiceSubtask serviceSubtask) { |
| | | return toAjax(serviceSubtaskService.insertServiceSubtask(serviceSubtask)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 电话回调任务(雨绮) |
| | | * 电话任务拉取(雨绮) |
| | | */ |
| | | @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(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return getDataTable(serviceSubtaskService.getSfFzInfoEveryMonth(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取随访统计比例 |
| | | */ |
| | | @ApiOperation("获取随访统计比例") |
| | | @PostMapping("/getSfStatistics") |
| | | public AjaxResult getSfStatistics(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { |
| | | return error("服务类型不能为空"); |
| | | } |
| | | return success(serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | } |