package com.zjrs.ggfw.portal.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import org.mohrss.leaf.core.framework.persistens.PageResult;
import org.mohrss.leaf.core.framework.web.controller.AjaxResponse;
import com.zjrs.ggfw.portal.bpo.SxblBPO;
import com.zjrs.ggfw.portal.dto.*;
import com.zjrs.ggfw.portal.po.RsWbBjSub;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api("事项办理")
@RestController
@RequestMapping("/api/portal/sxbl")
public class SxblController {
    /**
     * 日志
     */
    private static final Logger LOG = LoggerFactory.getLogger(SxblController.class);
    
    @Resource
    private SxblBPO sxblBPO;
    
    @ApiOperation(value = "获取用户办件事项列表", notes = "获取用户办件事项列表")
    @PostMapping("/queryBjList")
    public AjaxResponse queryBjList(@RequestBody @Validated SxblQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
            PageResult pageResult = sxblBPO.getBjList(dto);
            ajaxResponse.setData("data", pageResult);
            ajaxResponse.setData("pagesize", dto.getPagesize());
            ajaxResponse.setData("pagenum", dto.getPagenum());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "自助终端获取用户办件事项列表", notes = "自助终端获取用户办件事项列表")
    @PostMapping("/queryZzzdBjList")
    public AjaxResponse queryZzzdBjList(@RequestBody @Validated BjjdZzzdQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getZzzdBjList(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取受理信息流程环节列表", notes = "获取受理信息流程环节列表")
    @PostMapping("/getSlxxHj")
    public AjaxResponse getSlxxHj(@RequestBody @Validated SlxxHjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getSlxxHj(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "初始化事项办件信息", notes = "初始化事项办件信息")
    @PostMapping("/getInitBj")
    public AjaxResponse getInitBj(@RequestBody @Validated SxblInitDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getInitBj(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取事项办件信息", notes = "获取事项办件信息")
    @PostMapping("/queryBjDetail")
    public AjaxResponse queryBjDetail(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getBjDetail(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存事项办件信息", notes = "保存事项办件信息")
    @PostMapping("/saveBj")
    public AjaxResponse saveBj(@RequestBody @Validated BjDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.saveBj(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "删除事项办件信息", notes = "删除事项办件信息")
    @PostMapping("/deleteBj")
    public AjaxResponse deleteBj(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.deleteBj(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存政府信息依申请公开（个人）", notes = "保存政府信息依申请公开（个人）")
    @PostMapping("/saveGrZfxxysqgk")
    public AjaxResponse saveGrZfxxysqgk(@RequestBody @Validated ZfxxysqgkGrDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.saveGrZfxxysqgk(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存政府信息依申请公开（单位）", notes = "保存政府信息依申请公开（单位）")
    @PostMapping("/saveDwZfxxysqgk")
    public AjaxResponse saveDwZfxxysqgk(@RequestBody @Validated ZfxxysqgkDwDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.saveDwZfxxysqgk(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存信访事项", notes = "保存信访事项")
    @PostMapping("/saveXfsxtc")
    public AjaxResponse saveXfsxtc(@RequestBody @Validated XfsxtcDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.saveXfsxtc(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "保存欠薪线索反映", notes = "保存欠薪线索反映")
    @PostMapping("/saveQxxsfy")
    public AjaxResponse saveQxxsfy(@RequestBody @Validated QxxxfyxxDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }
            ajaxResponse = sxblBPO.saveQxxsfy(dto);
        return ajaxResponse;
    }

    @ApiOperation(value = "保存档案转递（机要寄档）", notes = "保存档案转递（机要寄档）")
    @PostMapping("/saveDazd")
    public AjaxResponse saveDazd(@RequestBody @Validated DazdDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }
        try {
            ajaxResponse = sxblBPO.saveDazd(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "党员材料转递", notes = "党员材料转递")
    @PostMapping("/saveDyclzd")
    public AjaxResponse saveDyclzd(@RequestBody @Validated DazdDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }
        try {
            ajaxResponse = sxblBPO.saveDyclzd(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存高层次人才认定", notes = "保存高层次人才认定")
    @PostMapping("/saveGccrcrd")
    public AjaxResponse saveGccrcrd(@RequestBody @Validated GccrcrdDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.saveGccrcrd(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "暂存高层次人才认定", notes = "暂存高层次人才认定")
    @PostMapping("/saveTempGccrcrd")
    public AjaxResponse saveTempGccrcrd(@RequestBody GccrcrdDTO dto) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
            ajaxResponse = sxblBPO.saveTempGccrcrd(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存社会保障卡信息", notes = "保存社会保障卡信息")
    @PostMapping("/saveShbzkxx")
    public AjaxResponse saveShbzkxx(@RequestBody @Validated ShbzkxxDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.saveShbzkxx(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存PSAM卡业务信息", notes = "保存PSAM卡业务信息")
    @PostMapping("/savePsamYwxx")
    public AjaxResponse savePsamYwxx(@RequestBody @Validated PsamDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.savePsamYwxx(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取欠薪线索反映信息", notes = "获取欠薪线索反映信息")
    @PostMapping("/getQxxsfy")
    public AjaxResponse getQxxsfy(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }
        ajaxResponse = sxblBPO.getQxxsfy(dto);
        return ajaxResponse;
    }

    @ApiOperation(value = "获取档案转递（机要寄档）", notes = "获取档案转递（机要寄档）")
    @PostMapping("/getDazd")
    public AjaxResponse getDazd(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }
        try {
            ajaxResponse = sxblBPO.getDazd(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "获取党员材料转递", notes = "获取党员材料转递")
    @PostMapping("/getDyclzd")
    public AjaxResponse getDyclzd(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }
        try {
            ajaxResponse = sxblBPO.getDyclzd(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取政府信息依申请公开", notes = "获取政府信息依申请公开")
    @PostMapping("/getZfxxysqgk")
    public AjaxResponse getZfxxysqgk(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getZfxxysqgk(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取信访事项", notes = "获取信访事项")
    @PostMapping("/getXfsxtc")
    public AjaxResponse getXfsxtc(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getXfsxtc(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取高层次人才认定", notes = "获取高层次人才认定")
    @PostMapping("/getGccrcrd")
    public AjaxResponse getGccrcrd(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getGccrcrd(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取社会保障卡信息", notes = "获取社会保障卡信息")
    @PostMapping("/getShbzkxx")
    public AjaxResponse getShbzkxx(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getShbzkxx(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取社会保障卡历史办件信息", notes = "获取社会保障卡历史办件信息")
    @PostMapping("/getShbzkJkrz")
    public AjaxResponse getShbzkJkrz(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getShbzkJkrz(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取PSAM卡业务信息", notes = "获取PSAM卡业务信息")
    @PostMapping("/getPsamYwxx")
    public AjaxResponse getPsamYwxx(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getPsamYwxx(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取PSAM卡安装机构", notes = "获取PSAM卡安装机构")
    @GetMapping("/getPsamAzjg")
    public AjaxResponse getPsamAzjg() {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
        	ajaxResponse = sxblBPO.getPsamAzjg();
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取事项材料列表", notes = "获取事项材料列表")
    @PostMapping("/getSxclList")
    public AjaxResponse getSxclList(@RequestBody @Validated SxZllbQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
            PageResult pageResult = sxblBPO.getSxclList(dto);
            ajaxResponse.setData("data", pageResult);
            ajaxResponse.setData("pagesize", dto.getPagesize());
            ajaxResponse.setData("pagenum", dto.getPagenum());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取事项办理资料类别列表", notes = "获取事项办理资料类别列表")
    @PostMapping("/getSxSdzlList")
    public AjaxResponse getSxSdzlList(@RequestBody @Validated BjZllbQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
            PageResult pageResult = sxblBPO.getSxSdzlList(dto);
            ajaxResponse.setData("data", pageResult);
            ajaxResponse.setData("pagesize", dto.getPagesize());
            ajaxResponse.setData("pagenum", dto.getPagenum());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取事项详细信息", notes = "获取事项详细信息")
    @PostMapping("/getSxConfig")
    public AjaxResponse getSxConfig(@RequestBody @Validated SxblInitDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getRsSxConfig(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取事项已上传附件明细列表", notes = "获取事项已上传附件明细列表")
    @PostMapping("/getBjSxclList")
    public AjaxResponse getBjSxclList(@RequestBody @Validated ClfjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
            PageResult pageResult = sxblBPO.getBjSxclList(dto);
            ajaxResponse.setData("data", pageResult);
            ajaxResponse.setData("pagesize", dto.getPagesize());
            ajaxResponse.setData("pagenum", dto.getPagenum());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取事项配置样表下载附件信息", notes = "获取事项配置样表下载附件信息")
    @PostMapping("/getSxConfigFile")
    public AjaxResponse getSxConfigFile(@RequestBody @Validated SxConfigFileQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getRsSxConfigFile(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "上传附件", notes = "上传附件")
    @PostMapping("/uploadfile")
    public AjaxResponse uploadfile(@RequestBody @Validated ClfjDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.uploadfile(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    
    @ApiOperation(value = "删除附件", notes = "删除附件")
    @PostMapping("/deletefile")
    public AjaxResponse deletefile(@RequestBody @Validated ClfjDelDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	sxblBPO.delClfj(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "提交办件申请", notes = "提交办件申请")
    @PostMapping("/submitBj")
    public AjaxResponse submitBj(@RequestBody @Validated BjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.submitBj(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "提交社会保障卡办件申请", notes = "提交社会保障卡办件申请")
    @PostMapping("/submitShbzk")
    public AjaxResponse submitShbzk(@RequestBody @Validated ShbzkBjDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.submitShbzk(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取PSAM卡反馈流水号列表信息", notes = "获取PSAM卡反馈流水号列表信息")
    @PostMapping("/getRsPsamAzfkList")
    public AjaxResponse getRsPsamAzfkList(@RequestBody @Validated PsamFkxxListQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getRsPsamAzfkList(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取PSAM卡反馈详细信息", notes = "获取PSAM卡反馈详细信息")
    @PostMapping("/getRsPsamAzfkxxb")
    public AjaxResponse getRsPsamAzfkxxb(@RequestBody @Validated PsamFkxxQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getRsPsamAzfkxx(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存PSAM卡反馈信息", notes = "保存PSAM卡反馈信息")
    @PostMapping("/saveRsPsamAzfkxxb")
    public AjaxResponse saveRsPsamAzfkxxb(@RequestBody @Validated PsamFkxxDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.saveRsPsamAzfkxx(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "提交PSAM卡反馈信息", notes = "提交PSAM卡反馈信息")
    @PostMapping("/submitRsPsamAzfkxx")
    public AjaxResponse submitRsPsamAzfkxx(@RequestBody @Validated PsamFkxxListQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.submitRsPsamAzfkxx(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "保存好差评信息", notes = "保存好差评信息")
    @PostMapping("/saveRsJkHcp")
    public AjaxResponse saveRsJkHcp(@RequestBody @Validated HcpDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.saveRsJkHcp(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "查询好差评信息", notes = "查询好差评信息")
    @PostMapping("/getRsJkHcp")
    public AjaxResponse getRsJkHcp(@RequestBody @Validated SlxxHjQueryDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
    	if(bindingResult.hasErrors()) {
    		ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
    	}
        try {
        	ajaxResponse = sxblBPO.getRsJkHcp(dto);
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取待评价业务数", notes = "获取待评价业务数")
    @GetMapping("/getHcpBjCnt")
    public AjaxResponse getHcpBjCnt() {
        AjaxResponse ajaxResponse = new AjaxResponse();
        try {
        	ajaxResponse = sxblBPO.getHcpBjCnt();
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }
    
    @ApiOperation(value = "获取办件信息结果附件列表", notes = "获取办件信息结果附件列表")
    @PostMapping("/getFjList")
    public AjaxResponse getFjList(@RequestBody @Validated SxblFjDTO dto, BindingResult bindingResult) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        //校验入参
        if(bindingResult.hasErrors()) {
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg(bindingResult.getFieldError().getDefaultMessage());
            return ajaxResponse;
        }
        try {
            PageResult pageResult = sxblBPO.getFjList(dto);
            ajaxResponse.setData("data", pageResult);
            ajaxResponse.setData("pagesize", dto.getPagesize());
            ajaxResponse.setData("pagenum", dto.getPagenum());
        } catch (Exception e) {
            LOG.error(e.toString());
            ajaxResponse.setAppcode("1");
            ajaxResponse.setErrorMsg("系统异常");
        }
        return ajaxResponse;
    }

    @ApiOperation(value = "保存一件事业务信息", notes = "保存一件事业务信息")
    @PostMapping("/saveYjsYwxx")
    public AjaxResponse saveYjsYwxx(@RequestBody @Validated YjsQueryDTO dto) {
        sxblBPO.saveYjsYwxx(dto);
        return new AjaxResponse();
    }

    @ApiOperation(value = "获取一件事业务信息", notes = "获取一件事业务信息")
    @PostMapping("/getYjsYwxx")
    public AjaxResponse getYjsYwxx(@RequestBody @Validated YjsQueryDTO dto) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        List<RsWbBjSub> resultList =  sxblBPO.getYjsYwxx(dto);
        ajaxResponse.setData("data",resultList);
        return ajaxResponse;
    }

    @ApiOperation(value = "校验当前用户类型是否可以办理该事项", notes = "校验当前用户类型是否可以办理该事项")
    @GetMapping("/checkCondition")
    public AjaxResponse checkCondition(String sxbm) {
        sxblBPO.checkCondition(sxbm);
        return new AjaxResponse();
    }
}    