| | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.Role; |
| | | import cc.mrbird.febs.common.core.entity.system.SystemUser; |
| | | import cc.mrbird.febs.server.hr.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.server.hr.entity.EmpDimissionLog; |
| | |
| | | throw new FebsException("已存在此员工编号"); |
| | | } |
| | | try { |
| | | //EmpBaseInfo tempInfo = this.empBaseInfoService. |
| | | this.empBaseInfoService.createEmpBaseInfo(empBaseinfo); |
| | | } catch (Exception e) { |
| | | String message = "新增员工基本信息失败"; |
| | |
| | | List<EmpBaseInfo> allRoles = empBaseInfoService.list(wrapper); |
| | | return new FebsResponse().data(allRoles); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | |
| | | request.setPageSize(this.empBaseInfoService.count()); |
| | | List<EmpBaseInfo> records = this.empBaseInfoService.findZsEmpBaseInfos(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpBaseInfo.class, response).downXlsx(records, false); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "exportWithField",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | | public void exportWithField(QueryRequest request, HttpServletResponse response, String exportField,EmpBaseInfo empBaseinfo) throws IOException { |
| | | request.setPageSize(25535); |
| | | request.setPageNum(1); |
| | | List<EmpBaseInfo> exportList = this.empBaseInfoService.findZsEmpBaseInfos(request, empBaseinfo).getRecords(); |
| | | List<Map<String, Object>> listMapDicItem = new ArrayList(); |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, listMapDicItem); |
| | | String fileName = "在职员工列表"; |
| | | Date currentDate = new Date(); |
| | | String dateStr = DateUtil.formatDate(currentDate); |
| | | boolean result = PoiExportExcel.exportCommonExcel(response, fileName + dateStr, fileName, allList); |
| | | } |
| | | |
| | | @ApiOperation(value = "导入员工") |
| | |
| | | empOccupationalService.importEmpOccupational(listObject.get(10)); |
| | | empLaborTroubleService.importEmpLaborTrouble(listObject.get(11)); |
| | | empBadRecordService.importEmpBadRecord(listObject.get(12)); |
| | | empRemarkinfoService.importEmpBadRecord(listObject.get(13)); |
| | | empRemarkinfoService.importEmpRemarkInfo(listObject.get(13)); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("导入员工", e); |
| | |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("image/{empId}") |
| | | public void getImage(@PathVariable String empId, HttpServletResponse response) throws FebsException { |
| | | try { |
| | | this.empBaseInfoService.getImage(empId,response); |
| | | } catch (Exception e) { |
| | | String message = "获取员工图片异常"; |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "在职人员基本信息增加") |
| | | @PostMapping("addInEmp") |
| | | @PreAuthorize("hasAuthority('empBaseinfo:add')") |
| | | public FebsResponse addInEmpBaseInfo(@Valid EmpBaseInfo empBaseinfo) throws FebsException { |
| | | try { |
| | | return new FebsResponse().data(empBaseInfoService.addInEmpBaseInfo(empBaseinfo)); |
| | | } catch (Exception e) { |
| | | String message = "新增员工基本信息失败"; |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | } |