| | |
| | | package cc.mrbird.febs.server.hr.controller; |
| | | |
| | | import cc.mrbird.febs.server.hr.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.server.hr.constant.MyConstant; |
| | | import cc.mrbird.febs.server.hr.entity.EmpResign; |
| | | import cc.mrbird.febs.server.hr.entity.EmpUnemployment; |
| | | import cc.mrbird.febs.server.hr.service.IEmpUnemploymentService; |
| | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.wuwenze.poi.ExcelKit; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | | public void export(QueryRequest request, EmpUnemployment empBaseinfo, HttpServletResponse response) { |
| | | |
| | | request.setPageSize(this.empUnemploymentService.count()); |
| | | List<EmpUnemployment> records = this.empUnemploymentService.findEmpUnemployments(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpUnemployment.class, response).downXlsx(records, false); |
| | | } |
| | |
| | | this.empUnemploymentService.createEmpUnemployment(empUnemployment); |
| | | } catch (Exception e) { |
| | | String message = "新增失业金领取表失败"; |
| | | if (StrUtil.equals(e.getMessage(), MyConstant.MESSAGE)){ |
| | | message = e.getMessage(); |
| | | } |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |
| | |
| | | } |
| | | |
| | | @DeleteMapping("{ids}") |
| | | @PreAuthorize("hasAuthority('empUnemployment:delete')") |
| | | public void logicDeleteEmpUnemployment(@PathVariable("ids") String ids) throws FebsException { |
| | | try { |
| | | this.empUnemploymentService.logicDelEmpUnemployment(ids); |
| | |
| | | this.empUnemploymentService.updateEmpUnemployment(empUnemployment); |
| | | } catch (Exception e) { |
| | | String message = "修改失业金领取表失败"; |
| | | if (StrUtil.equals(e.getMessage(), MyConstant.MESSAGE)){ |
| | | message = e.getMessage(); |
| | | } |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |