package com.bonus.material.work.controller;

import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.work.domain.AuditFlow;
import com.bonus.material.work.domain.SysWorkflowType;
import com.bonus.material.work.service.IAuditFlowService;
import com.bonus.material.work.service.IDirectAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author js
 * @description 业务办理--人员审批
 * @date 2025/2/17 13:13
 */
@Api(tags = "审批人员接口")
@RestController
@RequestMapping("/auditFlow")
public class AuditFlowController extends BaseController {

    @Resource
    private IAuditFlowService service;



    /**
     * 新增人员判断
     */
    @ApiOperation(value = "新增任务人员判断")
    @PostMapping("/checkLegal")
    public AjaxResult checkLegal(@RequestBody AuditFlow flow )
    {
        try {
             int rs = service.checkLegal(flow);
             if(rs>1){
                 return new AjaxResult(200,"人员合法！");
             }else{
                 return new AjaxResult(500,"人员不在范围内！");
             }

        }catch (Exception e){
            return error("接口调用失败！");
        }
    }

}
