| | |
| | | .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEntryType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未知")); |
| | | .orElse("")); |
| | | p.setDimissionTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getDimissionType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未知")); |
| | | .orElse("")); |
| | | }); |
| | | iPage.setRecords(list); |
| | | return iPage; |
| | |
| | | */ |
| | | @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); |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionType())) { |
| | | queryWrapper.in("a.dimissionType", empBaseInfo.getDimissionType().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInOutType())) { |
| | | queryWrapper.and(p->{ |
| | | p.in("a.dimissionType", empBaseInfo.getInOutType().split(",")); |
| | | p.or().in("a.entryType",empBaseInfo.getInOutType().split(",")); |
| | | }); |
| | | //queryWrapper.in("a.dimissionType", empBaseInfo.getDimissionType().split(",")); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | return queryWrapper; |
| | | } |