| | |
| | | |
| | | import cc.mrbird.febs.common.core.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.entity.constant.StringConstant; |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | |
| | | import cc.mrbird.febs.server.hr.entity.EmpBaseInfo; |
| | | import cc.mrbird.febs.server.hr.entity.EmpDimissionLog; |
| | | import cc.mrbird.febs.server.hr.entity.EmpJobChange; |
| | | import cc.mrbird.febs.server.hr.feign.IRemoteDeptService; |
| | | import cc.mrbird.febs.server.hr.feign.IRemoteDicItemService; |
| | | import cc.mrbird.febs.server.hr.service.*; |
| | | import cc.mrbird.febs.server.hr.util.PoiExportExcel; |
| | |
| | | @RequestMapping("empBaseInfo") |
| | | @RequiredArgsConstructor |
| | | public class EmpBaseInfoController { |
| | | |
| | | private final IRemoteDeptService remoteDeptService; |
| | | private final IEmpBaseInfoService empBaseInfoService; |
| | | private final IEmpWorkExperienceService empWorkExperienceService; |
| | | private final IEmpPhysicalExamService empPhysicalExamService; |
| | |
| | | throw new FebsException("已存在此身份证号:" + empBaseinfo.getCertificateNumb()); |
| | | } |
| | | try { |
| | | empBaseinfo.setEntryType("20"); |
| | | this.empBaseInfoService.createEmpBaseInfo(empBaseinfo); |
| | | } catch (Exception e) { |
| | | String message = "新增员工基本信息失败"; |
| | |
| | | @GetMapping("options") |
| | | public FebsResponse roles() { |
| | | QueryWrapper<EmpBaseInfo> wrapper=new QueryWrapper(); |
| | | wrapper.eq("empStatus",0); |
| | | wrapper.eq("delFlag",0); |
| | | wrapper.orderByDesc("createTime"); |
| | | List<EmpBaseInfo> allRoles = empBaseInfoService.list(wrapper); |
| | | wrapper.eq("a.empStatus",0); |
| | | wrapper.eq("a.delFlag",0); |
| | | wrapper.orderByDesc("a.createTime"); |
| | | wrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | List<EmpBaseInfo> allRoles = empBaseInfoService.listAll(wrapper); |
| | | return new FebsResponse().data(allRoles); |
| | | } |
| | | |
| | |
| | | empPhysicalExamService.importEmpPhysicalExam(listObject.get(2),returnList,dicItems); |
| | | empContractInfoService.importEmpContractInfo(listObject.get(3),returnList,dicItems); |
| | | empDimissionAttendService.importEmpDimissionAttend(listObject.get(4),returnList); |
| | | empLeaveInfoService.importEmpLeaveInfo(listObject.get(5),returnList); |
| | | empLeaveInfoService.importEmpLeaveInfo(listObject.get(5),returnList,dicItems); |
| | | empResignService.importEmpResign(listObject.get(6),returnList); |
| | | empUnemploymentService.importEmpUnemployment(listObject.get(7),returnList); |
| | | empInsuranceService.importEmpInsurance(listObject.get(8),returnList,dicItems); |
| | |
| | | |
| | | @ApiOperation(value = "关闭员工档案") |
| | | @PostMapping("dimission") |
| | | @PreAuthorize("hasAuthority('empBaseinfo:dimission')") |
| | | public void dimissionEmp(EmpDimissionLog empDimissionLog) throws FebsException { |
| | | try { |
| | | this.empBaseInfoService.closeEmpArchives(empDimissionLog); |
| | |
| | | } |
| | | @ApiOperation(value = "员工岗位变更") |
| | | @PostMapping("jobChange") |
| | | @PreAuthorize("hasAuthority('empBaseinfo:jobChange')") |
| | | public void changeEmpJob(EmpJobChange empJobChange) throws FebsException { |
| | | try { |
| | | this.empBaseInfoService.changeEmpJob(empJobChange); |
| | |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "社保提醒人员基本信息翻页列表") |
| | | @GetMapping("insurance/alert") |
| | | @PreAuthorize("hasAuthority('empBaseinfo:list')") |
| | | public FebsResponse insuranceAlertEmpBaseInfoList(QueryRequest request, EmpBaseInfo empBaseinfo) { |
| | | Map<String, Object> dataTable = FebsUtil.getDataTable(this.empBaseInfoService.findInsuranceEmpBaseInfos(request, empBaseinfo)); |
| | | return new FebsResponse().data(dataTable); |
| | | } |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export/insurance",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出社保提醒数据", exceptionMessage = "导出Excel失败") |
| | | public void exportInsuranceWithField(QueryRequest request, HttpServletResponse response, String exportField,EmpBaseInfo empBaseinfo) throws IOException { |
| | | request.setPageSize(25535); |
| | | request.setPageNum(1); |
| | | List<EmpBaseInfo> exportList = this.empBaseInfoService.findInsuranceEmpBaseInfos(request, empBaseinfo).getRecords(); |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, null); |
| | | String fileName = "社保四险员工列表"; |
| | | Date currentDate = new Date(); |
| | | String dateStr = DateUtil.formatDate(currentDate); |
| | | boolean result = PoiExportExcel.exportCommonExcel(response, fileName + dateStr, fileName, allList); |
| | | } |
| | | } |