package com.chinaweal.aiccs.aiccs.seriousillegal.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.chinaweal.aiccs.aiccs.abnormal.entity.EBaseinfo;
import com.chinaweal.aiccs.aiccs.abnormal.entity.TSHandInMat;
import com.chinaweal.aiccs.aiccs.abnormal.entity.TSWrit;
import com.chinaweal.aiccs.aiccs.abnormal.service.EBaseinfoService;
import com.chinaweal.aiccs.aiccs.abnormal.service.TSAttachmentService;
import com.chinaweal.aiccs.aiccs.abnormal.service.TSHandInMatService;
import com.chinaweal.aiccs.aiccs.abnormal.service.TSWritService;
import com.chinaweal.aiccs.aiccs.auditing.entity.TSOpinion;
import com.chinaweal.aiccs.aiccs.auditing.entity.dto.Form;
import com.chinaweal.aiccs.aiccs.auditing.service.TSOpinionService;
import com.chinaweal.aiccs.aiccs.business.entity.TSTaskList;
import com.chinaweal.aiccs.aiccs.business.entity.TSTwfProcessNode;
import com.chinaweal.aiccs.aiccs.business.service.TSTaskListService;
import com.chinaweal.aiccs.aiccs.business.service.TSTwfProcessNodeService;
import com.chinaweal.aiccs.aiccs.business.service.WorkFlowService;
import com.chinaweal.aiccs.aiccs.claim.service.TSEntBaseService;
import com.chinaweal.aiccs.aiccs.seriousillegal.entity.TSBizSerIllegalDiss;
import com.chinaweal.aiccs.aiccs.seriousillegal.entity.TSBizSerIllegalRem;
import com.chinaweal.aiccs.aiccs.seriousillegal.entity.TSSerIllegalList;
import com.chinaweal.aiccs.aiccs.seriousillegal.service.TSBizSerIllegalDissService;
import com.chinaweal.aiccs.aiccs.seriousillegal.service.TSBizSerIllegalRemService;
import com.chinaweal.aiccs.aiccs.seriousillegal.service.TSSerIllegalListService;
import com.chinaweal.aiccs.common.base.controller.BaseController;
import com.chinaweal.aiccs.common.constant.BaseDataConstant;
import com.chinaweal.aiccs.common.util.*;
import com.chinaweal.aiccs.org.service.AicorgService;
import com.chinaweal.aicorg.model.AICUser;
import com.chinaweal.youfool.framework.springboot.exception.custom.BusinessException;
import com.chinaweal.youfool.framework.springboot.rest.RestResult;
import com.chinaweal.youfool.framework.springboot.rest.ResultCode;
import com.chinaweal.youfool.framework.springboot.util.AssertUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;

@RestController
@RequestMapping("/bizSerIllegalDiss")
public class BizSerIllegalDissController extends BaseController {

    @Autowired
    private TSBizSerIllegalDissService tsBizSerIllegalDissService;
    @Autowired
    private TSTaskListService taskListService;
    @Autowired
    private TSOpinionService opinionService;
    @Autowired
    private WorkFlowService workFlowService;
    @Autowired
    private TSHandInMatService tsHandInMatService;
    @Autowired
    private TSWritService tsWritService;
    @Autowired
    private TSEntBaseService tsEntBaseService;
    @Autowired
    private TSSerIllegalListService tsSerIllegalListService;
    @Autowired
    private TSBizSerIllegalRemService tsBizSerIllegalRemService;
    @Autowired
    private TSAttachmentService attachmentService;
    @Autowired
    private EBaseinfoService eBaseinfoService;
    @Autowired
    private AicorgService aicorgService;
    @Autowired
    private TSTwfProcessNodeService tsTwfProcessNodeService;

    //严重违法失信异议 校验
    @RequestMapping(value = "/validateBizDissent.do",method = RequestMethod.POST)
    public RestResult<?> validateBiz(HttpServletRequest request, String  illegallistid){
//        AICUser aicUser = (AICUser) request.getSession().getAttribute(ConstantsUtil.USER_SESSION_NAME);
        AICUser aicUser = getLoginUser(request);

        if(aicUser==null) return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);

        TSBizSerIllegalDiss paramModel = new TSBizSerIllegalDiss();
        paramModel.setIllegalListID(illegallistid);
        List<TSBizSerIllegalDiss> tsBizDissentList = tsBizSerIllegalDissService.selectbizDissentList(paramModel);
        //未发起过异议
        if(CollectionUtils.isEmpty(tsBizDissentList)) return OK;
        //发起过异议
        for(TSBizSerIllegalDiss bizDissModel: tsBizDissentList){
            List<TSTaskList> taskListModels = taskListService.selectByBizSeqID(bizDissModel.getBizSeq());
            for(TSTaskList taskListModel: taskListModels){
                if(BaseDataConstant.BUSINESS_STATUS_TRANSACT.equals(taskListModel.getBusstatus())){//存在待办未办结
                    throw new BusinessException("此记录正在申请异议，请先完成");
                }
            }
            //待办均已办结情况下判断：acceptStat 受理状态（0：不受理；1：受理）
            if(BaseDataConstant.YES.equals(bizDissModel.getAcceptStat())){
                throw new BusinessException("此记录已存在异议申请并已受理,请等待核查结果");
            }
        }

        //校验是否存在 移出待办
        TSBizSerIllegalRem bizRemModel = new TSBizSerIllegalRem();
        bizRemModel.setIllegalListID(illegallistid);
        List<TSBizSerIllegalRem> tsBizSerRemModels = tsBizSerIllegalRemService.selectBRMserIllegalList(bizRemModel);
        if(CollectionUtils.isNotEmpty(tsBizSerRemModels)){
            for(TSBizSerIllegalRem bizSerRemModel: tsBizSerRemModels){
                if(bizSerRemModel.getLostCreditExplainrem()==null || bizSerRemModel.getApprovalDate()==null){
                    //存在待办：处于经办或审查状态，不通过
                    throw new BusinessException("此记录正在进行移出业务");
                }
            }
        }
        return OK;
    }

    /**
     * 严重违法失信企业名单 异议 呈报审批
     */
    @RequestMapping(value = "/startBizDissent.do")
    public RestResult<?> startBizDissent(HttpServletRequest request, TSTaskList taskListModel, String illegallistid){
        AICUser user = getLoginUser(request);
        if(user==null) return RestResult.error(ResultCode.USER_NOT_LOGGED_IN); 

        Map<String, Object> resultMap = new HashMap<>();
        if (StringUtils.isNotBlank(taskListModel.getTasklistid())) {
            TSTaskList taskListModel1 = taskListService.selectByTasklistID(taskListModel.getTasklistid());
            TSBizSerIllegalDiss tsBizDissentModel = tsBizSerIllegalDissService.selectBizDissentByBizSeq(taskListModel1.getBizseqid());
            List<TSHandInMat> tsHandInMatModels = tsHandInMatService.selecthandInMatList(taskListModel1.getBizseqid());

            TSWrit writQueryModel = new TSWrit(); //获取列入的文书号
            writQueryModel.setPripid(tsBizDissentModel.getPriPID());
            writQueryModel.setWritstype(WorkNoUtil.WORKNOTYPE_21);
            List<TSWrit> tsWritQueryModels = tsWritService.listTswrit(writQueryModel);
            if (tsWritQueryModels.size() > 0) {
                resultMap.put("wrirsno", tsWritQueryModels.get(0).getWritsno());
            }
            EBaseinfo eBaseinfo = eBaseinfoService.getOne(new LambdaQueryWrapper<EBaseinfo>().eq(EBaseinfo::getPripid, tsBizDissentModel.getPriPID()));
            resultMap.put("eBaseinfo", eBaseinfo);
            resultMap.put("tsHandInMatModels", tsHandInMatModels);
            resultMap.put("tsBizDissentModel", tsBizDissentModel);
            resultMap.put("bizseq", taskListModel1.getBizseqid());
            resultMap.put("tasklistid", taskListModel1.getTasklistid());
            resultMap.put("workflowId", taskListModel1.getWorkflowid());
            resultMap.put("currentNode", taskListModel1.getCurrentNode());
            resultMap.put("currentNodeName", WorkFlowUtil.getNodeName(taskListModel1.getCurrentNode()));
            return RestResult.ok(resultMap);
        } else {
            String bizseq = UUID.randomUUID().toString();
            TSSerIllegalList tsSerIllegalListModel = tsSerIllegalListService.getById(illegallistid);
//            TSEntBase tsEntBaseModel = tsEntBaseService.findTsentbaseByID(tsSerIllegalListModel.getPripid());
            int days = (int) ((int) LocalDate.now().toEpochDay() - tsSerIllegalListModel.getAbntime().toEpochDay());
//            Period period = Period.between(serIllegalListModel.getAbntime(),LocalDate.now());
            if (days > 365){
                resultMap.put("reason", "你选择的企业列入严重违法失信已满1年的企业，请选择列入严重违法失信未满1年的企业进行异议");
                resultMap.put("entName",tsSerIllegalListModel.getEntname());
                return RestResult.ok(resultMap);
            }

            EBaseinfo eBaseinfo = eBaseinfoService.getOne(new LambdaQueryWrapper<EBaseinfo>().eq(EBaseinfo::getPripid, tsSerIllegalListModel.getPripid()));

            //添加待办启动流程
            taskListModel.setBizseqid(bizseq);
            taskListModel.setBustype(BaseDataConstant.SERILLEGAL_TYPE_OBJECTION);//列入严重违法失信企业 异议
            taskListModel.setBusname(tsSerIllegalListModel.getEntname());

            //添加异议表数据
            TSBizSerIllegalDiss tsBizDissentModel = new TSBizSerIllegalDiss();
            tsBizDissentModel.setBizSeq(bizseq);
            tsBizDissentModel.setIllegalListID(tsSerIllegalListModel.getIllegallistid());
            tsBizDissentModel.setPriPID(tsSerIllegalListModel.getPripid());
            tsBizDissentModel.setRegNO(tsSerIllegalListModel.getRegno());
            tsBizDissentModel.setEntName(tsSerIllegalListModel.getEntname());
//            tsBizDissentModel.setLeRepName(tsEntBaseModel.getLerepname());
            tsBizDissentModel.setLeRepName(eBaseinfo.getName());
            String regionCode = aicorgService.getRegionCodeByUser(user);
            tsBizDissentModel.setAreaCode(regionCode);
            //获取列入的决定书文号
            TSWrit writQueryModel = new TSWrit();
            writQueryModel.setPripid(tsBizDissentModel.getPriPID());
            writQueryModel.setWritstype(WorkNoUtil.WORKNOTYPE_21);
            List<TSWrit> tsWritQueryModels = tsWritService.listTswrit(writQueryModel);
            if (tsWritQueryModels.size() > 0) {
                resultMap.put("wrirsno", tsWritQueryModels.get(0).getWritsno());
            }

            taskListModel = tsBizSerIllegalDissService.startBizDissentAccept(user, null, taskListModel, tsBizDissentModel);
            resultMap.put("tsBizDissentModel", tsBizDissentModel);
            resultMap.put("tasklistid", taskListModel.getTasklistid());
            resultMap.put("workflowId", taskListModel.getWorkflowid());
            resultMap.put("bizseq", bizseq);
            resultMap.put("currentNode", FlowUtil.DISSENTWORKFLOW_ACCEPTDISSENTENTER);
            resultMap.put("currentNodeName", WorkFlowUtil.getNodeName(FlowUtil.DISSENTWORKFLOW_ACCEPTDISSENTENTER));
            return RestResult.ok(resultMap);
        }
    }


    /**
     * 严重违法失信企业名单异议 受理更新
     */
    @RequestMapping(value = "/updatebizDissent.do")
    @ResponseBody
    public RestResult<?> updatebizDissent(String currentNode, TSBizSerIllegalDiss tsBizDissentModel, Form form){
        if (FlowUtil.DISSENTWORKFLOW_ACCEPTDISSENTENTER.equals(currentNode)) { //受理环节允许更新
            List<TSHandInMat> tsHandInMatModels = new ArrayList<TSHandInMat>();
            if (CollectionUtils.isNotEmpty(form.getTsHandInMatModels())) {
                for (TSHandInMat tsHandInMatModel : form.getTsHandInMatModels()) {
                    TSHandInMat brhandInMat2 = new TSHandInMat();
                    brhandInMat2.setDoctit(tsHandInMatModel.getDoctit());
                    brhandInMat2.setIscopy(tsHandInMatModel.getIscopy());
                    brhandInMat2.setMatnum(tsHandInMatModel.getMatnum());
                    brhandInMat2.setPripid(tsBizDissentModel.getPriPID());
                    brhandInMat2.setBizseq(tsBizDissentModel.getBizSeq());
                    tsHandInMatModels.add(brhandInMat2);
                }
            }
            tsBizSerIllegalDissService.saveBizDissentApply(tsBizDissentModel, tsHandInMatModels);
        }
        return OK;
    }

    /**
     *  严重违法失信企业异议 审核意见页面
     */
    @RequestMapping(value = "/next.do")
    public RestResult<?> next(HttpServletRequest request, String tasklistid, String approve){
        AICUser user = getLoginUser(request);
        if(user==null) return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);

        TSTaskList taskListModel1 = taskListService.selectByTasklistID(tasklistid);
        if(taskListModel1==null) return RestResult.error(ResultCode.DATA_NONE);
        String currentNode = taskListModel1.getCurrentNode();
        // 获得审批意见类型
        String opinionType = BaseDataConstant.getOpinionTypeByWorkFlowNode(currentNode);

        TSBizSerIllegalDiss tsBizDissentModel = tsBizSerIllegalDissService.selectBizDissentByBizSeq(taskListModel1.getBizseqid());
        if (tsBizDissentModel == null) {
            return RestResult.error(ResultCode.DATA_NONE);
        }

        Map<String, Object> resultMap = new HashMap<>();
        TSWrit writQueryModel = new TSWrit();
        writQueryModel.setWritstype(WorkNoUtil.WORKNOTYPE_21);
        writQueryModel.setPripid(tsBizDissentModel.getPriPID());
        List<TSWrit> tsWritQueryModels = tsWritService.listTswrit(writQueryModel);
        if (tsWritQueryModels.size() > 0) {
            resultMap.put("wrirsno", tsWritQueryModels.get(0).getWritsno());
        }
        resultMap.put("acceptstat", tsBizDissentModel.getAcceptStat());
        resultMap.put("regno", tsBizDissentModel.getRegNO());
        resultMap.put("entname", tsBizDissentModel.getEntName());
        resultMap.put("situation", tsBizDissentModel.getSituation());
        resultMap.put("opinionList", opinionService.selectByAuditingID(taskListModel1.getWorkflowid()));
        resultMap.put("nextSequenceFlowList", workFlowService.findNextSequenceFlowList(taskListModel1.getWorkflowid()));
        resultMap.put("tasklistid", taskListModel1.getTasklistid());
        resultMap.put("pripid", tsBizDissentModel.getPriPID());
        resultMap.put("bizSeq", taskListModel1.getBizseqid());
        resultMap.put("serillegaldissid", tsBizDissentModel.getSerIllegalDissID());
        resultMap.put("currentNode", currentNode);
        resultMap.put("currentLinkTypeID",  opinionType); //用于意见管理
        resultMap.put("currentNodeName", WorkFlowUtil.getNodeName(currentNode));
        resultMap.put("approve", approve);
        return RestResult.ok(resultMap);
    }

    /**
     * 发送审批流程
     */
    @Transactional(rollbackFor = Exception.class)
    @RequestMapping(value = "/serDissNext.do")
    public RestResult<?> serDissNext(HttpServletRequest request, TSBizSerIllegalDiss tsBizDissentModel, TSOpinion opinionModell, String pripid,
                              String tasklistid, String nextPerformerids, String nextPerformerNames, String nextNodeID){
        AICUser user = getLoginUser(request);
        if(user==null) return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);
        //发送
        String[] ids = StringUtils.split(nextPerformerids, ",");
        String[] names = StringUtils.split(nextPerformerNames, ",");
        TSTaskList taskListModel = taskListService.selectByTasklistID(tasklistid);
        taskListModel = tsBizSerIllegalDissService.saveBizDissentAuditProcess(user, taskListModel, tsBizDissentModel, opinionModell, nextNodeID, ids, names);
        Map<String, Object> resultMap = new HashMap<>();
        resultMap.put("nextNodeID", nextNodeID);
        resultMap.put("currentNode", taskListModel.getCurrentNode());
        resultMap.put("bizSeq", taskListModel.getBizseqid());
        resultMap.put("workflowid", taskListModel.getWorkflowid());
        resultMap.put("tasklistid", tasklistid);
        return RestResult.ok(resultMap);
    }

    /**
     *进入 异议核准经办流程
     */
    @RequestMapping(value = "/nextapprove.do")
    public RestResult<?> nextapprove(Model model, String bizSeq, String tasklistid,String flag){
        TSBizSerIllegalDiss tsBizDissentModel = null;
        Map<String, Object> resultMap = new HashMap<>();
        if (StringUtils.isNotBlank(bizSeq)) {
            tsBizDissentModel = tsBizSerIllegalDissService.selectBizDissentByBizSeq(bizSeq);
            resultMap.put("acceptstat", tsBizDissentModel.getAcceptStat());
            resultMap.put("serillegaldissid", tsBizDissentModel.getSerIllegalDissID());
            resultMap.put("pripid", tsBizDissentModel.getPriPID());
        }
        resultMap.put("tasklistid", tasklistid);
        resultMap.put("bizSeq", bizSeq);
        resultMap.put("flag", StringUtils.isBlank(flag)?"0":flag);
        return RestResult.ok(resultMap);
    }

    /**
     * 进入文书打印环节
     */
    @RequestMapping(value = "/printNotice.do")
    public RestResult<?> printNotice(HttpServletRequest request, String acceptstat, String bizSeq, String workflowid){
//        AICUser aicUser = (AICUser) request.getSession().getAttribute(ConstantsUtil.USER_SESSION_NAME);
        AICUser aicUser = getLoginUser(request);
        if(aicUser==null)
            return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);
        TSWrit writQueryModel = new TSWrit();//文书号
        //获取当前时间
        Calendar ca = Calendar.getInstance();
        Map<String, Object> resultMap = new HashMap<>();
        TSBizSerIllegalDiss tsBizDissentModel = tsBizSerIllegalDissService.selectBizDissentByBizSeq(bizSeq);
        resultMap.put("entname", tsBizDissentModel.getEntName());
        resultMap.put("tsBizDissentModel", tsBizDissentModel);
        //获取机构
        TSSerIllegalList tsSerIllegalListModel = tsSerIllegalListService.getById(tsBizDissentModel.getIllegalListID());
        resultMap.put("tsSerIllegalListModel", tsSerIllegalListModel);
        if (acceptstat.equals("0")) { //异议不予受理通知书页面
            writQueryModel.setPripid(tsBizDissentModel.getPriPID());
            writQueryModel.setWritstype(WorkNoUtil.WORKNOTYPE_23);
            List<TSWrit> tsWritQueryModels = tsWritService.listTswrit(writQueryModel);
            if (tsWritQueryModels.size() > 0) {
                resultMap.put("wrirsno", tsWritQueryModels.get(0).getWritsno());
            }
            //resultMap.put("nowTime", ChineseDateUtil.format(ca.getTime()));
            resultMap.put("nowTime", ca.getTime());
            return RestResult.ok(resultMap);

        } else if (acceptstat.equals("2")) {//异议核实结果告知书
            writQueryModel.setPripid(tsBizDissentModel.getPriPID());
            writQueryModel.setWritstype(WorkNoUtil.WORKNOTYPE_24);
            List<TSWrit> tsWritQueryModels = tsWritService.listTswrit(writQueryModel);
            if (tsWritQueryModels.size() > 0) {
                resultMap.put("wrirsno", tsWritQueryModels.get(0).getWritsno());
            }
            resultMap.put("nowTime", ca.getTime());
            return RestResult.ok(resultMap);

        }else if (acceptstat.equals("3")) {//打印异议审批表
            List<TSOpinion> opinionList = opinionService.selectByAuditingID(workflowid);
            resultMap.put("opinionList", opinionList);

            writQueryModel.setPripid(tsBizDissentModel.getPriPID());
            writQueryModel.setWritstype(WorkNoUtil.WORKNOTYPE_21);
            List<TSWrit> tsWritQueryModels = tsWritService.listTswrit(writQueryModel);
            if (tsWritQueryModels.size() > 0) {
                resultMap.put("wrirsno", tsWritQueryModels.get(0).getWritsno());
            }
            return RestResult.ok(resultMap);

        } else {// acceptstat.equals("1")--异议受理通知书
            writQueryModel.setPripid(tsBizDissentModel.getPriPID());
            writQueryModel.setWritstype(WorkNoUtil.WORKNOTYPE_22);
            List<TSWrit> tsWritQueryModels = tsWritService.listTswrit(writQueryModel);
            if (tsWritQueryModels.size() > 0) {
                resultMap.put("wrirsno", tsWritQueryModels.get(0).getWritsno());
            }
            resultMap.put("nowTime", ca.getTime());
            return RestResult.ok(resultMap);
        }
    }

    /**
     * 文书打印查询--文书列表校验（不予受理的异议，无对应文书列表）
     */
    @RequestMapping(value = "/validateAccept.do",method = RequestMethod.POST)
    public RestResult<?> validateAccept(HttpServletRequest request, String bizSeq) {
        AICUser aicUser = getLoginUser(request);
        if(aicUser==null)
            return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);

        if (StringUtils.isNotBlank(bizSeq)) {
            TSBizSerIllegalDiss tsBizDissentModel = tsBizSerIllegalDissService.selectBizDissentByBizSeq(bizSeq);
            if(tsBizDissentModel != null){
                if("1".equals(tsBizDissentModel.getAcceptStat())){
                    return OK;
                } else {
                    throw new BusinessException("该异议申请未予受理，无对应文书列表");
                }
            }
        }
        throw new BusinessException("无法查找到记录，请联系管理员");
    }

    /**
     * 列出异议主体记录信息
     * @param bizSeqId 业务号
     * @return 异议主体记录信息
     * @author lroyia
     * @since 2021年3月16日 16:04:11
     */
    @ApiOperation("列出异议主体记录信息")
    @GetMapping("/listDissentEnt")
    public RestResult<?> listDissentEnt(@ApiParam("业务号") String bizSeqId){
        AssertUtils.isNotBlank(bizSeqId);
        return RestResult.ok(tsBizSerIllegalDissService.list(new LambdaQueryWrapper<TSBizSerIllegalDiss>().eq(TSBizSerIllegalDiss::getBizSeq, bizSeqId)));
    }

    @PostMapping("updateDissWrit")
    public RestResult<?> updateDissWrit(String writsid, String content){
        AssertUtils.isNotEmpty(writsid,content);
        TSWrit tsWrit = new TSWrit();
        tsWrit.setWritsid(writsid);
        tsWrit.setContent(content);
        tsWrit.setLauptime(LocalDateTime.now());
        boolean update = tsWritService.updateById(tsWrit);
        return  RestResult.ok(update);
    }

    @PostMapping("checkPrint")
    public RestResult<?> checkPrint(String workflowid) {
        Boolean isPass = false;
        List<TSTwfProcessNode> tsTwfProcessNodes = tsTwfProcessNodeService.queryByPROCESSIDAndCURRENTNODE(workflowid ,FlowUtil.DISSENTWORKFLOW_APPROVEDISSENTENTER);
        if (tsTwfProcessNodes.size() > 0) isPass = true;
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("isPass", isPass);
        return RestResult.ok(resultMap);
    }

    @PostMapping("checTask")
    public RestResult<?> checTask(String bizseq) {
        Boolean isPass = false;
        // 查看异议是否已经办结
        TSTaskList tsTaskList = taskListService.getOne(new LambdaQueryWrapper<TSTaskList>().eq(TSTaskList::getBizseqid,bizseq));
        if (BaseDataConstant.BUSINESS_STATUS_END.equals(tsTaskList.getBusstatus())) isPass = true;
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("isPass", isPass);
        return RestResult.ok(resultMap);
    }
}
