package com.zjrs.ggfw.rlzysc.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.mohrss.leaf.core.framework.persistens.PageResult;
import org.mohrss.leaf.core.framework.web.controller.AjaxResponse;
import org.mohrss.leaf.core.framework.web.exception.AppException;
import com.zjrs.ggfw.annotation.IsHmdValid;
import com.zjrs.ggfw.rlzysc.bpo.DwzpBPO;
import com.zjrs.ggfw.rlzysc.dto.*;
import com.zjrs.ggfw.rlzysc.dto.common.PageDTO;
import com.zjrs.ggfw.rlzysc.dto.dwzp.*;
import com.zjrs.ggfw.rlzysc.dto.grzxjlxx.*;
import com.zjrs.ggfw.rlzysc.po.RsRlzyQyxxPO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import java.util.List;

@Api("单位招聘")
@RestController
@RequestMapping("/api/rlzysc/dwzp")
public class DwzpController {
    /**
     * 日志
     */
    private static final Logger LOG = LoggerFactory.getLogger(DwzpController.class);
    
    @Resource
    private DwzpBPO dwzpBPO;
    
    @ApiOperation(value = "职位发布*获取职业信息列表", notes = "获取职位发布*获取职业信息列表")
    @PostMapping("/zwfb/list")
    public AjaxResponse getZwxxList(@RequestBody @Validated DwzpZwListQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.getZwxxList(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "职位发布*查询职业信息", notes = "获取职位发布*查询职业信息")
    @PostMapping("/zwfb/query")
    public AjaxResponse getRsRlzyZwxx(@RequestBody @Validated DwzpZwxxQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.getRsRlzyZwxx(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "职位发布*保存职业信息", notes = "职位发布*保存职业信息")
    @PostMapping("/zwfb/save")
    public AjaxResponse saveRsRlzyZwxx(@RequestBody @Validated DwzpZwxxDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.saveRsRlzyZwxx(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "职位发布*删除职业信息", notes = "职位发布*删除职业信息")
    @PostMapping("/zwfb/delete")
    public AjaxResponse deleteRsRlzyZwxx(@RequestBody @Validated DwzpZwxxQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.deleteRsRlzyZwxx(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "职位发布*删除职业信息", notes = "职位发布*删除职业信息")
    @PostMapping("/zwfb/copy")
    public AjaxResponse copyZw(@RequestBody @Validated CopyZwDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }
        try {
            dwzpBPO.copyZw(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "职位发布*发布职业信息", notes = "职位发布*发布职业信息")
    @PostMapping("/zwfb/state/update")
    public AjaxResponse fbRsRlzyZwxx(@RequestBody @Validated DwzpZwxxQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.updateRsRlzyZwxxFbzt(dto,"1");
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "职位发布*取消发布职业信息", notes = "职位发布*取消发布职业信息")
    @PostMapping("/zwfb/state/cancel")
    public AjaxResponse fbCancelRsRlzyZwxx(@RequestBody @Validated DwzpZwxxQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.updateRsRlzyZwxxFbzt(dto,"0");
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "职位发布*提交内网审核职业信息", notes = "职位发布*提交内网审核职业信息")
    @PostMapping("/zwfb/submit")
    public AjaxResponse submitRsRlzyZwxx(@RequestBody @Validated DwzpZwxxQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.submitRsRlzyZwxx(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "简历管理*获取简历信息列表", notes = "简历管理*获取简历信息列表")
    @PostMapping("/jlgl/list")
    public AjaxResponse getJlxxList(@RequestBody @Validated DwzpJlListQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.getJlxxList(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "简历管理*删除简历信息", notes = "简历管理*删除简历信息")
    @PostMapping("/jlgl/delete")
    public AjaxResponse deleteRsRlzyJlgl(@RequestBody @Validated DwzpJlglUpdateDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.deleteRsRlzyJlgl(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "简历管理*更新简历状态为通过", notes = "简历管理*更新简历状态为通过")
    @PostMapping("/jlgl/state/pass")
    public AjaxResponse updateRsRlzyJlglPass(@RequestBody @Validated DwzpJlglUpdateDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.updateRsRlzyJlglZt(dto,"1");
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "简历管理*更新简历状态为不通过", notes = "简历管理*更新简历状态为不通过")
    @PostMapping("/jlgl/state/nopass")
    public AjaxResponse updateRsRlzyJlglNoPass(@RequestBody @Validated DwzpJlglUpdateDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.updateRsRlzyJlglZt(dto,"2");
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "简历管理*恢复简历为待查看", notes = "简历管理*恢复简历为待查看")
    @PostMapping("/jlgl/state/restore")
    public AjaxResponse updateRsRlzyJlglrestore(@RequestBody @Validated DwzpJlglUpdateDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.updateRsRlzyJlglZt(dto,"0");
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "简历管理*面试邀请", notes = "简历管理*面试邀请")
    @PostMapping("/jlgl/invite")
    public AjaxResponse saveMsyqrz(@RequestBody @Validated DwzpMsyqrzDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.saveMsyqrz(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "收藏*获取简历信息列表", notes = "收藏*获取简历信息列表")
    @PostMapping("/scjl/list")
    public AjaxResponse getScJlxxList(@RequestBody @Validated DwzpJlListQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.getScJlxxList(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "关注*获取简历信息列表", notes = "关注*获取简历信息列表")
    @PostMapping("/gzjl/list")
    public AjaxResponse getGzJlxxList(@RequestBody @Validated DwzpJlListQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.getGzJlxxList(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "收藏关注*删除收藏", notes = "收藏关注*删除收藏")
    @PostMapping("/scjl/delete")
    public AjaxResponse deleteRsRlzyScgz(@RequestBody @Validated DwzpScgzUpdateDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.deleteRsRlzyScgz(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "收藏关注*取消收藏", notes = "收藏关注*取消收藏")
    @PostMapping("/scjl/state/cancel")
    public AjaxResponse cancelRsRlzyScgz(@RequestBody @Validated DwzpScgzUpdateDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.updateRsRlzyScgzZt(dto,"0");
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "收藏关注*恢复收藏", notes = "收藏关注*恢复收藏")
    @PostMapping("/scjl/state/restore")
    public AjaxResponse restoreRsRlzyScgz(@RequestBody @Validated DwzpScgzUpdateDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.updateRsRlzyScgzZt(dto,"1");
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "收藏关注*添加收藏", notes = "收藏关注*添加收藏")
    @PostMapping("/scjl/add")
    public AjaxResponse addRsRlzyScgz(@RequestBody @Validated DwzpScgzDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.saveRsRlzyScgz(dto);
            ajaxResponse.setMsg("收藏成功");
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }
    
    @IsHmdValid
    @ApiOperation(value = "收藏关注*不再显示", notes = "收藏关注*不再显示")
    @PostMapping("/gzjl/blank")
    public AjaxResponse blankRsRlzyGzgs(@RequestBody @Validated DwzpGsgzQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = dwzpBPO.updateRsRlzyGzgsXszt(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(e.toString());
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取最新招聘会列表", notes = "获取最新招聘会列表")
    @PostMapping("/qyxx/zxzph/list")
    public AjaxResponse getZxzphList(@RequestBody @Valid ZphglQueryDTO dto){
        AjaxResponse ajaxResponse = new AjaxResponse();
        try{
           PageResult result = this.dwzpBPO.getZxzphList(dto);
            ajaxResponse.setData("data",result);
            ajaxResponse.setData("pagesize", dto.getPagesize());
            ajaxResponse.setData("pagenum",dto.getPagenum());
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e){
            LOG.error(e.getMessage());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "智能推荐简历信息列表", notes = "智能推荐简历信息列表")
    @PostMapping("/qyxx/tjjl/list")
    public AjaxResponse getTjjlList(@RequestBody @Valid PageDTO dto){
        LOG.info("智能推荐简历信息列表开始");
        AjaxResponse ajaxResponse = new AjaxResponse();
        Integer pagenum = dto.getPagenum();
        Integer pagesize = dto.getPagesize();
        try{
            PageResult result = this.dwzpBPO.getTjjlList(dto);
            ajaxResponse.setData("data",result);
            ajaxResponse.setData("pagenum",pagenum);
            ajaxResponse.setData("pagesize",pagesize);
        }catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        }catch (Exception e){
            LOG.error(e.getMessage());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        LOG.info("智能推荐简历信息列表结束");
        return ajaxResponse;
    }

    @ApiOperation(value = "机构端推荐简历信息列表", notes = "机构端推荐简历信息列表")
    @PostMapping("/qyxx/dwtjjl/list")
    public AjaxResponse getDwTjjlList(@RequestBody @Valid PageDTO dto){
        LOG.info("机构端推荐简历信息列表开始");
        AjaxResponse ajaxResponse = new AjaxResponse();
        Integer pagenum = dto.getPagenum();
        Integer pagesize = dto.getPagesize();
        try{
            PageResult result = this.dwzpBPO.getDwTjjlList(dto);
            ajaxResponse.setData("data",result);
            ajaxResponse.setData("pagenum",pagenum);
            ajaxResponse.setData("pagesize",pagesize);
        }catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        }catch (Exception e){
            LOG.error(e.getMessage());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        LOG.info("机构端推荐简历信息列表结束");
        return ajaxResponse;
    }


    @ApiOperation(value = "获取企业信息", notes = "湛江人力资源市场*单位招聘*企业信息*获取企业信息首页")
    @PostMapping(value = "/qyxx/getSyQyxx")
    public AjaxResponse getSyQyxx(@RequestBody @Valid ZjQueryDTO dto) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
            ajaxResponse.setData("data", dwzpBPO.getSyQyxx(dto));
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取企业信息", notes = "湛江人力资源市场*单位招聘*企业信息*获取企业信息")
    @PostMapping(value = "/qyxx/getQyxx")
    public AjaxResponse getQyxx(@RequestBody @Valid QyxxDTO dto) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
            ajaxResponse.setData("data", dwzpBPO.getQyxx(dto));
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "保存企业信息", notes = "湛江人力资源市场*单位招聘*企业信息*保存企业信息")
    @PostMapping(value = "/qyxx/saveQyxx")
    public AjaxResponse saveQyxx(@RequestBody @Valid QyxxUDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();

        //校验入参
        if (bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }

        try {
            ajaxResponse.setData("data", dwzpBPO.saveQyxx(dto));
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "头像上传", notes = "湛江人力资源市场*单位招聘*企业形象展示*头像上传")
    @PostMapping(value = "/grxxzz/txxx/uploadQyTx")
    public AjaxResponse uploadQyTx(@RequestBody @Valid DwTxSpQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.uploadQyTx(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "头像查询", notes = "湛江人力资源市场*单位招聘*企业形象展示*头像查询")
    @PostMapping(value = "/grxxzz/txxx/queryQyTx")
    public AjaxResponse queryQyTx(@RequestBody @Valid QyTxDTO dto) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
            ajaxResponse.setData("data", dwzpBPO.queryQyTx(dto));
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "视频上传", notes = "湛江人力资源市场*单位招聘*企业形象展示*视频上传")
    @PostMapping(value = "/grxxzz/spxx/uploadQySp")
    public AjaxResponse uploadQySp(@RequestBody @Valid DwTxSpQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.uploadQySp(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "视频查询", notes = "湛江人力资源市场*单位招聘*企业形象展示*视频查询")
    @PostMapping(value = "/grxxzz/spxx/queryQySp")
    public AjaxResponse queryQySp() {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
            ajaxResponse.setData("data", dwzpBPO.queryQySp());
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "保存企业信息提交审核", notes = "湛江人力资源市场*单位招聘*企业信息*保存企业信息提交审核")
    @PostMapping(value = "/qyxx/toQyxxTjsh")
    public AjaxResponse toQyxxTjsh(@RequestBody @Valid QyxxUDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.toQyxxTjsh(dto));
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "保存企业头像提交审核", notes = "湛江人力资源市场*单位招聘*企业信息*保存企业头像提交审核")
    @PostMapping(value = "/qyxx/toQytxTjsh")
    public AjaxResponse toQytxTjsh(@RequestBody @Valid DwTxSpQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.toQytxTjsh(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "保存企业视频提交审核", notes = "湛江人力资源市场*单位招聘*企业信息*保存企业视频提交审核")
    @PostMapping(value = "/qyxx/toQyspTjsh")
    public AjaxResponse toQyspTjsh(@RequestBody @Valid DwTxSpQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.toQyspTjsh(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取招聘会预定列表", notes = "湛江人力资源市场*单位招聘*招聘会预定*获取招聘会预定列表")
    @PostMapping(value = "/zphyd/list")
    public AjaxResponse getZphYdList(@RequestBody @Valid ZphYdQueryDTO dto, BindingResult bindingResult){
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getZphYdList(dto));
            ajaxResponse.setData("pagenum", dto.getPagenum());
            ajaxResponse.setData("pagesize", dto.getPagesize());
        } catch (org.mohrss.leaf.core.framework.web.exception.AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "预定招聘会", notes = "湛江人力资源市场*单位招聘*招聘会预定*预定招聘会")
    @PostMapping(value = "/zphyd/yd")
    public AjaxResponse ydZph(@RequestBody @Valid ZwYdDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.ydZph(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }


    @IsHmdValid
    @ApiOperation(value = "取消招聘会预定", notes = "湛江人力资源市场*单位招聘*招聘会预定*取消招聘会预定")
    @PostMapping(value = "/zphyd/qxyd")
    public AjaxResponse qxZphYd(@RequestBody @Valid ZjDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.qxZphYd(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "报名招聘会", notes = "湛江人力资源市场*单位招聘*招聘会预定*报名招聘会")
    @PostMapping(value = "/zphyd/bm")
    public AjaxResponse bmZph(@RequestBody @Valid ZphBmDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.bmZph(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取人才搜索器列表", notes = "湛江人力资源市场*单位招聘*人才搜索器*获取人才搜索器列表")
    @PostMapping(value = "/rcssq/list")
    public AjaxResponse getRcssqList(@RequestBody @Valid PageDTO dto, BindingResult bindingResult){
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getRcssqList(dto));
            ajaxResponse.setData("pagenum", dto.getPagenum());
            ajaxResponse.setData("pagesize", dto.getPagesize());
        } catch (org.mohrss.leaf.core.framework.web.exception.AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "保存人才搜索器", notes = "湛江人力资源市场*单位招聘*人才搜索器*保存人才搜索器")
    @PostMapping(value = "/rcssq/save")
    public AjaxResponse saveRcssq(@RequestBody @Valid RcssqUDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.saveRcssq(dto));
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "删除人才搜索器", notes = "湛江人力资源市场*单位招聘*人才搜索器*删除人才搜索器")
    @DeleteMapping(value = "/rcssq/delete/{id}")
    public AjaxResponse deleteRcssq(@PathVariable String id) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
            dwzpBPO.deleteRcssq(id);
        } catch (org.mohrss.leaf.core.framework.web.exception.AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "更新人才搜索器站内推送", notes = "湛江人力资源市场*单位招聘*人才搜索器*更新人才搜索器站内推送")
    @PostMapping(value = "/rcssq/updateZnts")
    public AjaxResponse updateZnts(@RequestBody @Valid ZjUDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.updateZnts(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }


    @ApiOperation(value = "获取人才信息列表", notes = "湛江人力资源市场*单位招聘*人才信息查询/获取人才信息列表")
    @PostMapping(value = "/crxxcx/query")
    public AjaxResponse getRcxxList(@RequestBody @Valid RcxxcxQueryDTO dto, BindingResult bindingResult){
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getRcxxList(dto));
            ajaxResponse.setData("pagenum", dto.getPagenum());
            ajaxResponse.setData("pagesize", dto.getPagesize());
        } catch (org.mohrss.leaf.core.framework.web.exception.AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取展位信息", notes = "展位使用情况查看*获取展位信息")
    @PostMapping(value = "/zphyd/getZwXx")
    public AjaxResponse getZwXx(@RequestBody @Valid ZjDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getZwXx(dto));
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }


    @ApiOperation(value = "获取企业对应招聘信息列表", notes = "预定展位**获取企业对应招聘信息列表")
    @PostMapping(value = "/zphyd/getzyxxList")
    public AjaxResponse getzyxxList(@RequestBody @Valid PageDTO dto, BindingResult bindingResult){
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getzyxxList(dto));
            ajaxResponse.setData("pagenum", dto.getPagenum());
            ajaxResponse.setData("pagesize", dto.getPagesize());
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }


    @ApiOperation(value = "获取企业对应招聘信息列表", notes = "预定展位**获取企业对应招聘信息列表")
    @PostMapping(value = "/zphyd/getzyxxList/wl")
    public AjaxResponse getWlzphzyxxList(@RequestBody @Valid PageDTO dto, BindingResult bindingResult){
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getWlzphzyxxList(dto));
            ajaxResponse.setData("pagenum", dto.getPagenum());
            ajaxResponse.setData("pagesize", dto.getPagesize());
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @IsHmdValid
    @ApiOperation(value = "预定展位提交审核", notes = "预定展位**预定展位提交审核")
    @PostMapping(value = "/zphyd/toYdSh")
    public AjaxResponse toYdSh(@RequestBody @Valid ZjDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.toYdSh(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取企业统计信息", notes = "企业信息*获取企业统计信息")
    @PostMapping(value = "/qyxx/getQytjxx")
    public AjaxResponse getQytjxx() {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
            ajaxResponse.setData("data", dwzpBPO.getQytjxx());
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取人才搜索器", notes = "湛江人力资源市场*单位招聘*人才搜索器*获取人才搜索器")
    @PostMapping(value = "/rcssq/getRcssqXx")
    public AjaxResponse getRcssqXx(@RequestBody @Valid ZjDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getRcssqXx(dto));
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }


    @ApiOperation(value = "简历智能推荐", notes = "湛江人力资源市场*单位招聘*企业信息*简历智能推荐")
    @PostMapping(value = "/qyxx/getJlzntjList")
    public AjaxResponse getJlzntjList(@RequestBody @Valid PageDTO dto, BindingResult bindingResult){
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getJlzntjList(dto));
            ajaxResponse.setData("pagenum", dto.getPagenum());
            ajaxResponse.setData("pagesize", dto.getPagesize());
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "简历人工推荐", notes = "湛江人力资源市场*单位招聘*企业信息*简历人工推荐")
    @PostMapping(value = "/qyxx/getJlrgtjList")
    public AjaxResponse getJlrgtjList(@RequestBody @Valid PageDTO dto, BindingResult bindingResult){
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            ajaxResponse.setData("data", dwzpBPO.getJlrgtjList(dto));
            ajaxResponse.setData("pagenum", dto.getPagenum());
            ajaxResponse.setData("pagesize", dto.getPagesize());
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取企业详细信息", notes = "获取企业详细信息")
    @GetMapping(value = "/qyxx/query/{id}")
    public AjaxResponse getQyxxDetail(@PathVariable String id) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
            String[] params = id.split("_");
            String uid = "";
            String zphid = "";
            if(params.length == 2) {
                uid = params[0];
                zphid = params[1];
            } else {
                uid = id;
            }
            RsRlzyQyxxPO result = this.dwzpBPO.getQyxxDetail(uid);
            ZwzpfsDTO dto = new ZwzpfsDTO();
            dto.setPagenum(1);
            dto.setPagesize(500);
            dto.setRsrlzyqxxxlsh(uid);
            dto.setZpfs("1");
            PageResult xczp = this.dwzpBPO.getZwzpfs(dto);//现场招聘
            ajaxResponse.setData("xczp",xczp);
            dto.setZpfs("2");
            dto.setRsrlzyzphgllsh(zphid);
            PageResult wlzp = StringUtils.isNotBlank(zphid) ? this.dwzpBPO.getWlzphZw(dto) : this.dwzpBPO.getZwzpfs(dto);//网络招聘
            ajaxResponse.setData("wlzp",wlzp);
            ajaxResponse.setData("result",result);
            ajaxResponse.setData("pagenum",dto.getPagenum());
            ajaxResponse.setData("pagesize",dto.getPagesize());
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "记录招聘会浏览量", notes = "湛江人力资源市场*单位招聘*记录招聘会浏览量")
    @PostMapping(value = "/zph/setZphLog")
    public AjaxResponse setZphLog(@RequestBody @Valid SetZphLogDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            List<FieldError> fieldErrors = bindingResult.getFieldErrors();
            String errmsg = "";
            for (int i=0;i<fieldErrors.size();i++){
                if (i == 0){
                    errmsg = errmsg + fieldErrors.get(i).getDefaultMessage();
                } else {
                    errmsg = errmsg + "；" + fieldErrors.get(i).getDefaultMessage();
                }
            }
            ajaxResponse.setErrorMsg(errmsg);
            return ajaxResponse;
        }
        try {
            dwzpBPO.setZphLog(dto);
        } catch (AppException e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg(e.getMessage());
        } catch (Exception e) {
            ajaxResponse.setAppcode("1");
            LOG.error(e.getMessage());
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

}
