package com.bonus.sgzb.material.controller;

import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.security.annotation.PreventRepeatSubmit;
import com.bonus.sgzb.material.domain.ToDoBean;
import com.bonus.sgzb.material.service.ToDoService;
import com.bonus.sgzb.material.vo.NoticeInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* @description  首页--代办事项
* @author hay
* @date   2024/1/15 17:16
*/
@Api(tags = " 代办事项")
@RestController
@RequestMapping("/todo")
public class ToDoController extends BaseController {
    @Autowired
    private ToDoService toDoService;

    /**
     * 代办事项列表
     */
    @ApiOperation(value = "代办事项列表")
    @GetMapping("/getToDoList")
    public TableDataInfo getToDoList(ToDoBean bean)
    {
        startPage();
        List<ToDoBean> list = toDoService.getToDoList(bean);
        return getDataTable(list);
    }

    @ApiOperation(value = "代办事件下拉")
    @PreventRepeatSubmit
    @PostMapping("/getTaskType")
    public AjaxResult getTaskType(ToDoBean bean){
        return toDoService.getTaskType(bean);
    }


    /**
     * 发送催办短信
     * @param noticeInfoVO
     * @return
     */
    @ApiOperation(value = "催办")
    @PostMapping("/urgentProcessing")
    public AjaxResult urgentProcessing(@RequestBody NoticeInfoVO noticeInfoVO){
        return toAjax(toDoService.urgentProcessing(noticeInfoVO));
    }


}
