liusheng
2024-07-02 0b02577ab12ac83a0530b7e0495b513dd0cdabca
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
ÎļþÃû´Ó ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java ÐÞ¸Ä
@@ -11,9 +11,7 @@
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.*;
import com.smartor.domain.robot.back.RobotAIDialogBack;
import com.smartor.domain.robot.back.RobotCallBack;
import com.smartor.service.IIvrTaskSingleService;
import com.smartor.service.IServiceSubtaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -33,10 +31,10 @@
@Slf4j
@Api(description = "单一任务(随访宣教)")
@RestController
@RequestMapping("/smartor/tasksingle")
public class IvrTaskSingleController extends BaseController {
@RequestMapping("/smartor/serviceSubtask")
public class ServiceSubtaskController extends BaseController {
    @Autowired
    private IIvrTaskSingleService ivrTaskcallService;
    private IServiceSubtaskService serviceSubtaskService;
    /**
     * æŸ¥è¯¢æ‚£è€…随访信息
@@ -44,9 +42,9 @@
    @ApiOperation("查询患者随访信息")
    @PreAuthorize("@ss.hasPermi('system:taskcall:list')")
    @PostMapping("/patItem")
    public TableDataInfo patItem(@RequestBody IvrTaskSingle ivrTaskcall) {
    public TableDataInfo patItem(@RequestBody ServiceSubtask ivrTaskcall) {
        PageUtils.startPageByPost(ivrTaskcall.getPageNum(), ivrTaskcall.getPageSize());
        return getDataTable(ivrTaskcallService.patItem(ivrTaskcall));
        return getDataTable(serviceSubtaskService.patItem(ivrTaskcall));
    }
    /**
@@ -55,9 +53,9 @@
    @PreAuthorize("@ss.hasPermi('system:taskcall:export')")
    @Log(title = "单一任务(随访宣教)", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, IvrTaskSingle ivrTaskcall) {
        List<IvrTaskSingle> list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall);
        ExcelUtil<IvrTaskSingle> util = new ExcelUtil<IvrTaskSingle>(IvrTaskSingle.class);
    public void export(HttpServletResponse response, ServiceSubtask ivrTaskcall) {
        List<ServiceSubtask> list = serviceSubtaskService.selectServiceSubtaskList(ivrTaskcall);
        ExcelUtil<ServiceSubtask> util = new ExcelUtil<ServiceSubtask>(ServiceSubtask.class);
        util.exportExcel(response, list, "单一任务(随访)数据");
    }
@@ -67,7 +65,7 @@
    @PreAuthorize("@ss.hasPermi('system:taskcall:query')")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(ivrTaskcallService.selectIvrTaskcallById(id));
        return success(serviceSubtaskService.selectServiceSubtaskById(id));
    }
    /**
@@ -77,12 +75,12 @@
    @PreAuthorize("@ss.hasPermi('system:task:add')")
    @Log(title = "单一任务(随访)", businessType = BusinessType.INSERT)
    @PostMapping("/insertOrUpdateTask")
    public AjaxResult insertOrUpdateHeTask(@RequestBody IvrTaskVO ivrTaskVO) {
    public AjaxResult insertOrUpdateHeTask(@RequestBody ServiceTaskVO ivrTaskVO) {
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
        ivrTaskVO.setCreateBy(user.getNickName());
        return toAjax(ivrTaskcallService.insertOrUpdateTask(ivrTaskVO));
        return toAjax(serviceSubtaskService.insertOrUpdateTask(ivrTaskVO));
    }
    /**
@@ -90,10 +88,10 @@
     */
    @ApiOperation("根据条件查询任务信息")
    @PostMapping("/queryTaskByCondition")
    public AjaxResult queryTaskByCondition(@RequestBody IvrTaskSingleVO ivrTaskcallVO) {
    public AjaxResult queryTaskByCondition(@RequestBody ServiceSubtaskVO ivrTaskcallVO) {
        //根据入参查询信息
        IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, IvrTaskSingle.class);
        IvrTaskVO ivrTaskVO = ivrTaskcallService.queryTaskByCondition(ivrTaskcall);
        ServiceSubtask ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, ServiceSubtask.class);
        ServiceTaskVO ivrTaskVO = serviceSubtaskService.queryTaskByCondition(ivrTaskcall);
        return success(ivrTaskVO);
    }
@@ -104,8 +102,16 @@
    @PostMapping("/phoneCallBack")
    public AjaxResult phoneCallBack(@RequestBody PhoneCallBackVO phoneCallBackVO) {
//        log.error("电话回调任务成功了不?{}", phoneCallBackVO);
        ivrTaskcallService.phoneCallBack(phoneCallBackVO);
        serviceSubtaskService.phoneCallBack(phoneCallBackVO);
        return success();
    }
    /**
     * æ‚£è€…问题结果记录
     */
    @ApiOperation("患者问题结果记录")
    @PostMapping("/saveQuestionAnswer")
    public AjaxResult saveQuestionAnswer(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
        return toAjax(serviceSubtaskService.saveQuestionAnswer(serviceSubTaskDetailReq));
    }
}