| | |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | | 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.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.service.IIvrTaskcallService; |
| | | import com.smartor.service.IIvrTaskSingleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | */ |
| | | @Api(description = "单一任务(随访宣教)") |
| | | @RestController |
| | | @RequestMapping("/smartor/taskcall") |
| | | @RequestMapping("/smartor/tasksingle") |
| | | public class IvrTaskcallController extends BaseController { |
| | | @Autowired |
| | | private IIvrTaskcallService ivrTaskcallService; |
| | | private IIvrTaskSingleService ivrTaskcallService; |
| | | |
| | | |
| | | /** |
| | | * 查询单一任务(随访)列表 |
| | | * 查询患者随访信息 |
| | | */ |
| | | @ApiOperation("查询单一任务(随访宣教)列表") |
| | | @ApiOperation("查询患者随访信息") |
| | | @PreAuthorize("@ss.hasPermi('system:taskcall:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody IvrTaskcall ivrTaskcall) { |
| | | @PostMapping("/patItem") |
| | | public TableDataInfo patItem(@RequestBody IvrTaskSingle ivrTaskcall) { |
| | | PageUtils.startPageByPost(ivrTaskcall.getPageNum(), ivrTaskcall.getPageSize()); |
| | | List<IvrTaskcall> list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall); |
| | | return getDataTable(list); |
| | | return getDataTable(ivrTaskcallService.patItem(ivrTaskcall)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PreAuthorize("@ss.hasPermi('system:taskcall:export')") |
| | | @Log(title = "单一任务(随访宣教)", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, IvrTaskcall ivrTaskcall) { |
| | | List<IvrTaskcall> list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall); |
| | | ExcelUtil<IvrTaskcall> util = new ExcelUtil<IvrTaskcall>(IvrTaskcall.class); |
| | | public void export(HttpServletResponse response, IvrTaskSingle ivrTaskcall) { |
| | | List<IvrTaskSingle> list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall); |
| | | ExcelUtil<IvrTaskSingle> util = new ExcelUtil<IvrTaskSingle>(IvrTaskSingle.class); |
| | | util.exportExcel(response, list, "单一任务(随访)数据"); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermi('system:task:add')") |
| | | @Log(title = "单一任务(随访)", businessType = BusinessType.INSERT) |
| | | @PostMapping("/insertOrUpdateTask") |
| | | public AjaxResult insertOrUpdateHeTask(@RequestBody IvrTaskcallVO ivrTaskcallVO) { |
| | | public AjaxResult insertOrUpdateHeTask(@RequestBody IvrTaskSingleVO ivrTaskcallVO) { |
| | | return toAjax(ivrTaskcallService.insertOrUpdateTask(ivrTaskcallVO)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation("根据条件查询任务信息") |
| | | @PostMapping("/queryTaskByCondition") |
| | | public AjaxResult queryTaskByCondition(@RequestBody IvrTaskcallVO ivrTaskcallVO) { |
| | | public AjaxResult queryTaskByCondition(@RequestBody IvrTaskSingleVO ivrTaskcallVO) { |
| | | //根据入参查询信息 |
| | | IvrTaskcall ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, IvrTaskcall.class); |
| | | List<IvrTaskcall> list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall); |
| | | IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, IvrTaskSingle.class); |
| | | List<IvrTaskSingle> list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall); |
| | | |
| | | //定义患者与单一任务关联表集合 |
| | | List<PatTaskRelevance> patTaskRelevances = new ArrayList<>(); |
| | | |
| | | //将查出来的数据倒入IvrTaskcallVO中 |
| | | IvrTaskcallVO ivrTaskcallVO2 = DtoConversionUtils.sourceToTarget(list.get(0), IvrTaskcallVO.class); |
| | | IvrTaskSingleVO ivrTaskcallVO2 = DtoConversionUtils.sourceToTarget(list.get(0), IvrTaskSingleVO.class); |
| | | String sendTimeSlot = list.get(0).getSendTimeSlot(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | try { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | for (IvrTaskcall ivrTaskcall1 : list) { |
| | | for (IvrTaskSingle ivrTaskcall1 : list) { |
| | | PatTaskRelevance patTaskRelevance = new PatTaskRelevance(); |
| | | //获取到患者信息,并放入到集合中 |
| | | patTaskRelevance.setName(ivrTaskcall1.getSendname()); |
| | |
| | | */ |
| | | @ApiOperation("任务发送执行") |
| | | @PostMapping("/heTaskSend") |
| | | public AjaxResult heTaskSend(@RequestBody IvrTaskcallVO ivrTaskcallVO) { |
| | | public AjaxResult heTaskSend(@RequestBody IvrTaskSingleVO ivrTaskcallVO) { |
| | | return toAjax(ivrTaskcallService.heTaskSend(ivrTaskcallVO)); |
| | | } |
| | | |