package ink.wgink.module.activiti.controller.route.oa;

import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.module.activiti.service.oa.IOaFormReportRouteService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @ClassName: OaController
 * @Description: Oa管理
 * @Author: wanggeng
 * @Date: 2022/3/23 09:54
 * @Version: 1.0
 */
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "oa管理")
@Controller
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/oa")
public class OaRouteController extends DefaultBaseController {

    @Autowired
    private IOaFormReportRouteService oaFormReportRouteService;

    @GetMapping("list-procdef")
    public ModelAndView listProcdef() {
        ModelAndView mv = new ModelAndView("oa/list-procdef");
        return mv;
    }

    @GetMapping("list-task-of-mine")
    public ModelAndView listTaskOfMine() {
        ModelAndView mv = new ModelAndView("oa/list-task-of-mine");
        return mv;
    }

    @GetMapping("list-history-task-of-mine")
    public ModelAndView listHistoryOfMine() {
        ModelAndView mv = new ModelAndView("oa/list-history-task-of-mine");
        return mv;
    }

    @GetMapping("list-process-log")
    public ModelAndView listLog() {
        ModelAndView mv = new ModelAndView("oa/list-process-log");
        return mv;
    }

    @GetMapping("list-unread-of-mine")
    public ModelAndView listUnreadOfMine() {
        ModelAndView mv = new ModelAndView("oa/list-unread-of-mine");
        return mv;
    }

    @GetMapping("list-read-of-mine")
    public ModelAndView listReadOfMine() {
        ModelAndView mv = new ModelAndView("oa/list-read-of-mine");
        return mv;
    }

    @GetMapping("update-read/code/{formCode}/version/{formVersion}/cc-id/{ccId}")
    public void updateRead(@PathVariable("formCode") String formCode,
                           @PathVariable("formVersion") Integer formVersion,
                           @PathVariable("ccId") String ccId,
                           HttpSession httpSession,
                           HttpServletRequest httpServletRequest,
                           HttpServletResponse httpServletResponse) {
        oaFormReportRouteService.updateRead(formCode, formVersion, ccId, httpSession, httpServletRequest, httpServletResponse);
    }



    @GetMapping("list-start-of-mine")
    public ModelAndView listStartOfMine() {
        ModelAndView mv = new ModelAndView("oa/list-start-of-mine");
        return mv;
    }
}
