package com.ruoyi.postCheck.controller;

import com.ruoyi.common.constant.PostPlanEnum;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
import com.ruoyi.postCheck.service.IPostPlanJoinProblemService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Api(tags = "3.2.1-岗检问题录入")
@RestController
@RequestMapping("/postCheck/postPlanJoinProblem")
public class PostPlanJoinProblemController extends BaseController {
    @Autowired
    private IPostPlanJoinProblemService postPlanJoinProblemService;

    /**
     * 查询岗检问题录入列表列表
     */
    @ApiOperation("查询岗检问题录入列表")
    @ApiImplicitParams({
//                    @ApiImplicitParam(name = "id", value = "id", dataType = "Long", dataTypeClass = Long.class),
//                    @ApiImplicitParam(name = "name", value = "name", dataType = "Long", dataTypeClass = Long.class),

            @ApiImplicitParam(name = "planInfoId", value = "岗检计划明细ID（岗检问题录入时列表的唯一标识）", dataType = "Long", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "checkGroupId", value = "检查工作组ID", dataType = "Long", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "checkGroupName", value = "检查工作组名称", dataType = "String", dataTypeClass = String.class),
            @ApiImplicitParam(name = "checkTeamId", value = "检查小组id", dataType = "Long", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "checkTeamName", value = "检查小组名称", dataType = "String", dataTypeClass = String.class),

            @ApiImplicitParam(name = "checkedUserNames", value = "检查人员中文名称逗号拼接", dataType = "String", dataTypeClass = String.class),
            @ApiImplicitParam(name = "checkTime", value = "问题录入中的检查时间：岗检计划开始时间-yyyy-MM-dd", dataType = "String", dataTypeClass = String.class),

            @ApiImplicitParam(name = "checkedDeptId", value = "被检查部门ID", dataType = "Long", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "checkedDeptName", value = "被检查部门名称", dataType = "String", dataTypeClass = String.class),
            @ApiImplicitParam(name = "checkedPostId", value = "被检查岗位ID", dataType = "Long", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "checkedPostName", value = "被检查岗位名称", dataType = "String", dataTypeClass = String.class),
            @ApiImplicitParam(name = "status", value = "岗检状态", dataType = "Integer", dataTypeClass = Integer.class),

            @ApiImplicitParam(name = "pageNum", value = "页码从1开始", dataType = "Integer", dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "pageSize", value = "分页大小", dataType = "Integer", dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "orderBy", value = "排序字段", dataType = "String", dataTypeClass = String.class)
    })
//    @PreAuthorize("@ss.hasPermi('postCheck:postPlanJoinProblem:list')")
    @GetMapping("/list")
    public TableDataInfo list(PostPlanJoinProblem postPlanJoinProblem) {
        startPage();
//        startPage("desc", "t1.create_time");
//        岗检计划明细表-岗检状态：1-未检；2-已检；
        postPlanJoinProblem.setStatus(PostPlanEnum.INFO_STATUS_YES.getValue());
        List<PostPlanJoinProblem> list = postPlanJoinProblemService.selectPostPlanJoinProblemList(postPlanJoinProblem);
        return getDataTable(list);
    }
}
