| | |
| | | } catch (Exception e) { |
| | | String message = "修改EmpAccessory失败"; |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | throw new FebsException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import cc.mrbird.febs.common.core.annotation.FieldInfo; |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | 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; |
| | | import cc.mrbird.febs.server.hr.entity.EmpJobChange; |
| | | import cc.mrbird.febs.server.hr.feign.IRemoteDicItemService; |
| | | import cn.hutool.core.annotation.AnnotationUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.wuwenze.poi.ExcelKit; |
| | |
| | | private final IEmpLaborTroubleService empLaborTroubleService; |
| | | private final IEmpBadRecordService empBadRecordService; |
| | | private final IEmpRemarkinfoService empRemarkinfoService; |
| | | private final IRemoteUserService remoteUserService; |
| | | private final IRemoteDeptService remoteDeptService; |
| | | private final IRemoteDicItemService dicItemService; |
| | | |
| | | @ApiOperation(value = "人员基本信息无翻页列表") |
| | | @GetMapping |
| | |
| | | InputStream in; |
| | | List<List<List<Object>>> listObject; |
| | | List<String> returnList = new ArrayList<>(); |
| | | List<DicItem> dicItems = dicItemService.getAllDicitemsAll(); |
| | | try { |
| | | if (!file.isEmpty()) { |
| | | in = file.getInputStream(); |
| | | listObject = PoiImportExcel.getMulitListByExcel(in, file.getOriginalFilename()); |
| | | in.close(); |
| | | empBaseInfoService.importEmpBaseInfo(listObject.get(0),returnList); |
| | | empBaseInfoService.importEmpBaseInfo(listObject.get(0),returnList,dicItems); |
| | | empWorkExperienceService.importEmpWorkExperience(listObject.get(1),returnList); |
| | | empPhysicalExamService.importEmpPhysicalExam(listObject.get(2),returnList); |
| | | empContractInfoService.importEmpContractInfo(listObject.get(3),returnList); |
| | | 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); |
| | | empResignService.importEmpResign(listObject.get(6),returnList); |
| | | empUnemploymentService.importEmpUnemployment(listObject.get(7),returnList); |
| | | empInsuranceService.importEmpInsurance(listObject.get(8),returnList); |
| | | empInsuranceService.importEmpInsurance(listObject.get(8),returnList,dicItems); |
| | | empAccidentCasesService.importEmpAccidentCases(listObject.get(9),returnList); |
| | | empOccupationalService.importEmpOccupational(listObject.get(10),returnList); |
| | | empLaborTroubleService.importEmpLaborTrouble(listObject.get(11),returnList); |
| | | empLaborTroubleService.importEmpLaborTrouble(listObject.get(11),returnList,dicItems); |
| | | empBadRecordService.importEmpBadRecord(listObject.get(12),returnList); |
| | | empRemarkinfoService.importEmpRemarkInfo(listObject.get(13),returnList); |
| | | } |
| | |
| | | } catch (Exception e) { |
| | | String message = "修改FilesUpload失败"; |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | throw new FebsException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | FROM t_label label where label.delFlag = 0 order by label.sort)) as querySql |
| | | </select> |
| | | <select id="selectPageVo" resultType="java.util.Map"> |
| | | select a.delFlag,a.empName,a.empStatus,a.empId,a.empNumb,a.age,a.archivesStatus,a.sex,a.insuranceType,a.politics,a.education,a.entryDate,a.certificateNumb, |
| | | select a.delFlag,a.empName,a.empStatus,a.empId,a.certificateNumb,a.empNumb, |
| | | (select dept_Name from t_dept as dept where dept.dept_Id= a.deptId) as deptName,a.jobName from t_emp_baseinfo a |
| | | inner join t_dept c on a.deptId = c.DEPT_ID |
| | | ${ew.customSqlSegment} |
| | |
| | | * |
| | | * @param empAccessory empAccessory |
| | | */ |
| | | void updateEmpAccessory(EmpAccessory empAccessory); |
| | | void updateEmpAccessory(EmpAccessory empAccessory) throws FebsException; |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.*; |
| | | |
| | |
| | | * 导入员工 |
| | | * @param listObject |
| | | */ |
| | | void importEmpBaseInfo(List<List<Object>> listObject,List<String> returnList) throws FebsException; |
| | | void importEmpBaseInfo(List<List<Object>> listObject,List<String> returnList,List<DicItem> dicItems) throws FebsException; |
| | | |
| | | void getImage(String empId, HttpServletResponse response) throws Exception; |
| | | |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.server.hr.entity.EmpContractInfo; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | */ |
| | | boolean momentToNormal(String ids); |
| | | |
| | | void importEmpContractInfo(List<List<Object>> listObject,List<String> returnList); |
| | | void importEmpContractInfo(List<List<Object>> listObject,List<String> returnList,List<DicItem> dicItems ); |
| | | |
| | | void terminateContract(String empIds, String operatorId); |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpInsurance; |
| | | |
| | |
| | | */ |
| | | boolean momentToNormal(String ids); |
| | | |
| | | void importEmpInsurance(List<List<Object>> listObject,List<String> returnList); |
| | | void importEmpInsurance(List<List<Object>> listObject,List<String> returnList, List<DicItem> dicItems); |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpLaborTrouble; |
| | | |
| | |
| | | */ |
| | | boolean momentToNormal(String ids); |
| | | |
| | | void importEmpLaborTrouble(List<List<Object>> listObject,List<String> returnList); |
| | | void importEmpLaborTrouble(List<List<Object>> listObject,List<String> returnList,List<DicItem> dicItems ); |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.server.hr.entity.EmpPhysicalExam; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | */ |
| | | boolean momentToNormal(String ids); |
| | | |
| | | void importEmpPhysicalExam(List<List<Object>> listObject,List<String> returnList); |
| | | void importEmpPhysicalExam(List<List<Object>> listObject,List<String> returnList,List<DicItem> dicItems); |
| | | } |
| | |
| | | * |
| | | * @param filesUpload filesUpload |
| | | */ |
| | | void updateFilesUpload(FilesUpload filesUpload); |
| | | void updateFilesUpload(FilesUpload filesUpload) throws FebsException; |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.aspectj.weaver.ast.Or; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private final EmpAccessoryMapper empAccessoryMapper; |
| | | private final FebsServerHrProperties properties; |
| | | private final IRemoteDeptService remoteDeptService; |
| | | private final String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | | .orElse("1"); |
| | | |
| | | private final IEmpBaseInfoService empBaseInfoService; |
| | | /** |
| | | * 参数2为数据中心ID 参数1为终端ID |
| | |
| | | if (StrUtil.isNotBlank(vo.getDeptName())) { |
| | | queryWrapper.like("a.deptName", vo.getDeptName()); |
| | | } |
| | | // if (StrUtil.isNotBlank(vo.getEmpName())) { |
| | | // queryWrapper.like("a.empName", vo.getEmpName().split(",")); |
| | | // } |
| | | // if (StrUtil.isNotBlank(vo.getEmpNumb())) { |
| | | // queryWrapper.like("a.empNumb", vo.getEmpNumb().split(",")); |
| | | // } |
| | | // if (StrUtil.isNotBlank(vo.getCertificateNumb())) { |
| | | // queryWrapper.like("a.certificateNumb", vo.getCertificateNumb().split(",")); |
| | | // } |
| | | // if (StrUtil.isNotBlank(vo.getDeptName())) { |
| | | // queryWrapper.like("a.deptName", vo.getDeptName().split(",")); |
| | | // } |
| | | |
| | | if (StrUtil.isNotBlank(vo.getEntryDate())) { |
| | | queryWrapper.between("a.entryDate", vo.getEntryDate().split(",")[0], vo.getEntryDate().split(",")[1]); |
| | | } |
| | |
| | | if (StrUtil.isNotBlank(vo.getPolitics())) { |
| | | queryWrapper.in("a.politics", vo.getPolitics().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(vo.getHandbookStatus())) { |
| | | queryWrapper.in("a.HandbookStatus", vo.getHandbookStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(vo.getEmpCardStatus())) { |
| | | queryWrapper.in("a.EmpCardStatus", vo.getEmpCardStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(vo.getEmpType())) { |
| | | queryWrapper.in("a.empType", vo.getEmpType().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(vo.getEntryType())) { |
| | | queryWrapper.in("a.entryType", vo.getEntryType().split(",")); |
| | | } |
| | | |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | queryWrapper.orderByAsc("a.deptName,a.empName,a.certificateNumb"); |
| | |
| | | Dict dict = MyUtil.filesUpload(file, properties.getUploadSinglePath() + nameAndCertificateNumb, snowflake.nextIdStr()); |
| | | EmpAccessory accessory = new EmpAccessory(); |
| | | accessory.setCreatetime(new Date()); |
| | | accessory.setCreator(operatorId); |
| | | accessory.setCreator(FebsUtil.getUserId()); |
| | | accessory.setDelFlag(0); |
| | | accessory.setEmpid(empId); |
| | | accessory.setFilesaddress(dict.getStr("newName")); |
| | |
| | | accessory.setAccessoryid(SequenceUtil.generateId(0L, ModuleCode.HR_FIlE)); |
| | | accessory.setFilesname(dict.getStr("fileName")); |
| | | accessory.setLabelid(labelid); |
| | | accessory.setModifier(operatorId); |
| | | accessory.setModifier(FebsUtil.getUserId()); |
| | | accessory.setModifytime(new Date()); |
| | | accessory.setVersion(0); |
| | | this.save(accessory); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpAccessory(EmpAccessory empAccessory) { |
| | | this.saveOrUpdate(empAccessory); |
| | | public void updateEmpAccessory(EmpAccessory empAccessory) throws FebsException { |
| | | if ( empAccessory.getFilesname().indexOf(".")<=0){ |
| | | throw new FebsException("文件名格式错误"); |
| | | } |
| | | LambdaUpdateWrapper<EmpAccessory> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(EmpAccessory::getAccessoryid,empAccessory.getAccessoryid()) |
| | | .set(EmpAccessory::getFilesname,empAccessory.getFilesname()).set(EmpAccessory::getFilesformat, empAccessory.getFilesname().substring( empAccessory.getFilesname().indexOf(".")+1)); |
| | | this.update(wrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | LambdaUpdateWrapper<EmpAccessory> wapper = new LambdaUpdateWrapper<>(); |
| | | wapper.in(EmpAccessory::getAccessoryid, arr); |
| | | wapper.set(EmpAccessory::getDelFlag, 1); |
| | | wapper.set(EmpAccessory::getModifier, operatorId); |
| | | wapper.set(EmpAccessory::getModifier, FebsUtil.getUserId()); |
| | | wapper.set(EmpAccessory::getModifytime, new Date()); |
| | | this.update(wapper); |
| | | |
| | |
| | | String[] arr = accessoryids.split(","); |
| | | LambdaUpdateWrapper<EmpAccessory> wapper = new LambdaUpdateWrapper<>(); |
| | | wapper.in(EmpAccessory::getAccessoryid, arr); |
| | | wapper.set(EmpAccessory::getModifier, operatorId); |
| | | wapper.set(EmpAccessory::getModifier, FebsUtil.getUserId()); |
| | | wapper.set(EmpAccessory::getModifytime, new Date()); |
| | | wapper.set(EmpAccessory::getLabelid, labelid); |
| | | this.update(wapper); |
| | |
| | | accessory.setLabelid(143007818991617L); |
| | | }else if (file1.getName().indexOf("银行卡")>=0){ |
| | | accessory.setLabelid(143073768130561L); |
| | | }else if (file1.getName().indexOf("回执")>=0){ |
| | | accessory.setLabelid(143073617135617L); |
| | | }else if (file1.getName().indexOf("证")>=0){ |
| | | accessory.setLabelid(143073812170753L); |
| | | }else{ |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importEmpBaseInfo(List<List<Object>> listObject, List<String> returnList) { |
| | | public void importEmpBaseInfo(List<List<Object>> listObject, List<String> returnList,List<DicItem> dicItems) { |
| | | for (List<Object> list : listObject) { |
| | | if (list.size() == 0) { |
| | | continue; |
| | |
| | | empBaseInfo.setEmpId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | empBaseInfo.setArchivesNumb(list.get(0).toString()); |
| | | empBaseInfo.setEmpNumb(list.get(1).toString()); |
| | | empBaseInfo.setEmpName(list.get(2).toString()); |
| | | |
| | | List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class); |
| | | empBaseInfo.setDeptName(list.get(3).toString()); |
| | | Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(3).toString())).findFirst().orElse(null); |
| | | empBaseInfo.setDeptName(list.get(2).toString()); |
| | | Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(2).toString())).findFirst().orElse(null); |
| | | if (null == dept) { |
| | | returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在", listObject.indexOf(list) + 1, list.get(3).toString())); |
| | | returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在", listObject.indexOf(list) + 1, list.get(2).toString())); |
| | | continue; |
| | | } |
| | | empBaseInfo.setEmpName(list.get(3).toString()); |
| | | empBaseInfo.setDeptId(dept.getDeptId()); |
| | | empBaseInfo.setJobName(list.get(4).toString()); |
| | | empBaseInfo.setEmpType(list.get(5).toString()); |
| | | empBaseInfo.setSex("男".equals(list.get(6).toString()) ? "1" : "2"); |
| | | empBaseInfo.setNation(list.get(7).toString()); |
| | | empBaseInfo.setCertificateNumb(list.get(8).toString()); |
| | | empBaseInfo.setMarriage(list.get(9).toString()); |
| | | |
| | | //婚姻状况 |
| | | DicItem dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"marriage")&&StrUtil.equals(j.getDicItemName(),list.get(9).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setMarriage(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(list.get(10).toString())) { |
| | | empBaseInfo.setStature(Integer.valueOf(list.get(10).toString())); |
| | | } |
| | | empBaseInfo.setPolitics(list.get(11).toString()); |
| | | |
| | | //政治面貌 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"politics")&&StrUtil.equals(j.getDicItemName(),list.get(11).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setPolitics(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | |
| | | if (StringUtils.isNotBlank(list.get(12).toString())) { |
| | | empBaseInfo.setEntryDate(DateUtil.parseDate(list.get(12).toString())); |
| | | } |
| | | empBaseInfo.setEducation(list.get(13).toString()); |
| | | |
| | | //最高学历 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"education")&&StrUtil.equals(j.getDicItemName(),list.get(13).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setEducation(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | |
| | | if (StringUtils.isNotBlank(list.get(14).toString())) { |
| | | empBaseInfo.setSeniority(Integer.valueOf(list.get(14).toString())); |
| | | } |
| | | empBaseInfo.setNativePlace(list.get(15).toString()); |
| | | //籍贯 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"nativePlace")&&StrUtil.equals(j.getDicItemName(),list.get(15).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setNativePlace(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | empBaseInfo.setCensusAddress(list.get(16).toString()); |
| | | empBaseInfo.setCurrentAddress(list.get(17).toString()); |
| | | empBaseInfo.setGuardNumb(list.get(18).toString()); |
| | |
| | | empBaseInfo.setIntroducer(list.get(21).toString()); |
| | | empBaseInfo.setBankName(list.get(22).toString()); |
| | | empBaseInfo.setBankNumb(list.get(23).toString()); |
| | | empBaseInfo.setInsuranceType(list.get(24).toString()); |
| | | //保险类型 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"insuranceType")&&StrUtil.equals(j.getDicItemName(),list.get(24).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setInsuranceType(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | empBaseInfo.setSocialNumb(list.get(25).toString()); |
| | | empBaseInfo.setFamily(list.get(26).toString()); |
| | | empBaseInfo.setUrgencyPhone(list.get(27).toString()); |
| | | empBaseInfo.setHandbookStatus(list.get(28).toString()); |
| | | empBaseInfo.setEmpCardStatus(list.get(29).toString()); |
| | | //员工手册 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"handbookStatus")&&StrUtil.equals(j.getDicItemName(),list.get(28).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setHandbookStatus(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | //工作证 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"empCardStatus")&&StrUtil.equals(j.getDicItemName(),list.get(29).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setEmpCardStatus(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | |
| | | empBaseInfo.setCertificateList(list.get(30).toString()); |
| | | empBaseInfo.setDelFlag(2); |
| | | //入职类型 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"lztype")&&StrUtil.equals(j.getDicItemName(),list.get(31).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setEntryType(dicItem.getDicItemCode()); |
| | | } |
| | | empBaseInfo.setEmpStatus("0"); |
| | | this.save(empBaseInfo); |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importEmpContractInfo(List<List<Object>> listObject,List<String> returnList) { |
| | | public void importEmpContractInfo(List<List<Object>> listObject,List<String> returnList,List<DicItem> dicItems ) { |
| | | for (List<Object> list : listObject) { |
| | | if (list.size()==0){ |
| | | continue; |
| | |
| | | if (StringUtils.isNotBlank(list.get(8).toString())) { |
| | | contractInfo.setContractPeriod(Integer.valueOf(list.get(8).toString())); |
| | | } |
| | | contractInfo.setContractStatus(list.get(9).toString()); |
| | | //合同 |
| | | DicItem dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"contractStatus")&&StrUtil.equals(j.getDicItemName(),list.get(9).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | contractInfo.setContractStatus(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | contractInfo.setTransactor(list.get(10).toString()); |
| | | contractInfo.setRemark(list.get(11).toString()); |
| | | |
| | |
| | | import cc.mrbird.febs.server.hr.service.IEmpBaseInfoService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpDimissionAttendService; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | dimissionAttend.setJobName(list.get(2).toString()); |
| | | dimissionAttend.setEmpName(list.get(3).toString()); |
| | | dimissionAttend.setCertificateNumb(list.get(4).toString()); |
| | | dimissionAttend.setAttendMonth(list.get(5).toString()); |
| | | if (StringUtils.isNotBlank(list.get(5).toString())){ |
| | | dimissionAttend.setAttendMonth(DateUtil.formatDate(DateUtil.parse(list.get(5).toString()))); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(list.get(6).toString())) { |
| | | dimissionAttend.setAttendDays(new BigDecimal(list.get(6).toString())); |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.constant.MyConstant; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBaseInfo; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importEmpInsurance(List<List<Object>> listObject,List<String> returnList) { |
| | | public void importEmpInsurance(List<List<Object>> listObject,List<String> returnList, List<DicItem> dicItems) { |
| | | for (List<Object> list : listObject) { |
| | | if (list.size()==0){ |
| | | continue; |
| | |
| | | empInsurance.setApplayDate(DateUtil.parseDate(list.get(5).toString())); |
| | | } |
| | | empInsurance.setProposer(list.get(6).toString()); |
| | | empInsurance.setInsuranceGaers(list.get(7).toString()); |
| | | //婚姻状况 |
| | | DicItem dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"insuranceGaers")&&StrUtil.equals(j.getDicItemName(),list.get(7).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empInsurance.setInsuranceGaers(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(list.get(8).toString())) { |
| | | empInsurance.setReportStatus("未报告".equals(list.get(8).toString()) ? 0 : 1); |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importEmpLaborTrouble(List<List<Object>> listObject,List<String> returnList) { |
| | | public void importEmpLaborTrouble(List<List<Object>> listObject,List<String> returnList,List<DicItem> dicItems ) { |
| | | for (List<Object> list : listObject) { |
| | | if (list.size()==0){ |
| | | continue; |
| | |
| | | if (StringUtils.isNotBlank(list.get(5).toString())) { |
| | | empLabortrouble.setArbitrationDate(DateUtil.parseDateTime(list.get(5).toString())); |
| | | } |
| | | empLabortrouble.setArbitrationType(list.get(6).toString()); |
| | | |
| | | //仲裁类型 |
| | | DicItem dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"zctype")&&StrUtil.equals(j.getDicItemName(),list.get(6).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empLabortrouble.setArbitrationType(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | |
| | | empLabortrouble.setArbitrationReason(list.get(7).toString()); |
| | | empLabortrouble.setReporter(list.get(8).toString()); |
| | | empLabortrouble.setRemark(list.get(9).toString()); |
| | |
| | | if (StringUtils.isNotBlank(list.get(7).toString())) { |
| | | leaveInfo.setLeaveDay(new BigDecimal(list.get(7).toString())); |
| | | } |
| | | leaveInfo.setLeaveType(list.get(8).toString()); |
| | | leaveInfo.setLeaveType(list.get(8).toString().equals("病假")?"1":"2"); |
| | | if (StringUtils.isNotBlank(list.get(9).toString())) { |
| | | leaveInfo.setReturnDate(DateUtil.parseDate(list.get(9).toString())); |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importEmpPhysicalExam(List<List<Object>> listObject,List<String> returnList) { |
| | | public void importEmpPhysicalExam(List<List<Object>> listObject,List<String> returnList,List<DicItem> dicItems) { |
| | | for (List<Object> list : listObject) { |
| | | if (list.size()==0){ |
| | | continue; |
| | |
| | | if (StringUtils.isNotBlank(list.get(7).toString())) { |
| | | physicalExam.setPhysicalExamDate(DateUtil.parseDate(list.get(7).toString())); |
| | | } |
| | | physicalExam.setPhysicalExamType(list.get(8).toString()); |
| | | //体检 |
| | | DicItem dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"physicalExamType")&&StrUtil.equals(j.getDicItemName(),list.get(8).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | physicalExam.setPhysicalExamType(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | physicalExam.setBloodPressure(list.get(9).toString()); |
| | | physicalExam.setTransaminase(list.get(10).toString()); |
| | | physicalExam.setEcg(list.get(11).toString()); |
| | | //心电图 |
| | | |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"ecg")&&StrUtil.equals(j.getDicItemName(),list.get(11).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | physicalExam.setEcg(dicItem.getDicItemCode()); |
| | | |
| | | } |
| | | physicalExam.setConclusion(list.get(12).toString()); |
| | | physicalExam.setReviewRecord(list.get(13).toString()); |
| | | physicalExam.setRemark(list.get(14).toString()); |
| | |
| | | if (list.size()==0){ |
| | | continue; |
| | | } |
| | | Long empId = empBaseInfoService.getEmpIdByEmpNumb(list.get(0).toString()); |
| | | EmpBaseInfo empId = empBaseInfoService.getEmpBaseInfoByEmpNumb(list.get(0).toString()); |
| | | if (null == empId){ |
| | | returnList.add(StrUtil.format("员工工作经历: 出现位置第{}行, 原因:{}员工编号不存在",listObject.indexOf(list)+1,list.get(0).toString())); |
| | | continue; |
| | | } |
| | | List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class); |
| | | Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(4).toString())).findFirst().orElse(null); |
| | | if (null == dept) { |
| | | returnList.add(StrUtil.format("员工工作经历: 出现位置第{}行, 原因:{}部门不存在",listObject.indexOf(list)+1,list.get(4).toString())); |
| | | continue; |
| | | } |
| | | EmpWorkExperience workExperience = new EmpWorkExperience(); |
| | | workExperience.setEmpId(empId); |
| | | workExperience.setEmpId(empId.getEmpId()); |
| | | //工作经历中的部门 |
| | | workExperience.setDeptName(list.get(4).toString()); |
| | | workExperience.setDeptId(dept.getDeptId()); |
| | | //实际部门ID |
| | | workExperience.setDeptId(empId.getDeptId()); |
| | | workExperience.setWorkExperienceId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | workExperience.setEmpNumb(list.get(0).toString()); |
| | | workExperience.setEmpName(list.get(1).toString()); |
| | |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cc.mrbird.febs.common.core.utils.MyUtil; |
| | | import cc.mrbird.febs.common.core.utils.SequenceUtil; |
| | | import cc.mrbird.febs.server.hr.entity.EmpAccessory; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBaseInfo; |
| | | import cc.mrbird.febs.server.hr.entity.FilesUpload; |
| | | import cc.mrbird.febs.server.hr.entity.Folder; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateFilesUpload(FilesUpload filesUpload) { |
| | | this.saveOrUpdate(filesUpload); |
| | | public void updateFilesUpload(FilesUpload filesUpload) throws FebsException { |
| | | if ( filesUpload.getFilesname().indexOf(".")<=0){ |
| | | throw new FebsException("文件名格式错误"); |
| | | } |
| | | LambdaUpdateWrapper<FilesUpload> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(FilesUpload::getFilesid,filesUpload.getFilesid()) |
| | | .set(FilesUpload::getFilesname,filesUpload.getFilesname()).set(FilesUpload::getFilesformat, filesUpload.getFilesname().substring( filesUpload.getFilesname().indexOf(".")+1)); |
| | | this.update(wrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | private String insuranceType; |
| | | private String basic; |
| | | private String empStatus; |
| | | private String empCardStatus; |
| | | private String handbookStatus; |
| | | private String empType; |
| | | private String entryType; |
| | | } |
| | |
| | | config: |
| | | server-addr: ${nacos.url}:8848 |
| | | group: DEFAULT_GROUP |
| | | prefix: febs-server-Hr |
| | | prefix: febs-server-hr |
| | | file-extension: yaml |
| | | discovery: |
| | | server-addr: ${nacos.url}:8848 |