| | |
| | | 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; |
| | |
| | | queryWrapper.eq("a.ReportStatus", empInsurance.getReportStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empInsurance.getEmpStatus())) { |
| | | queryWrapper.eq("a.EmpStatus", empInsurance.getEmpStatus()); |
| | | queryWrapper.in("a.EmpStatus", empInsurance.getEmpStatus().split(",")); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpInsurance> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | |
| | | |
| | | @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; |
| | |
| | | returnList.add(StrUtil.format("导入社保申请服务异常: 出现位置第{}行, 原因:{}部门不存在",listObject.indexOf(list)+1,list.get(1).toString())); |
| | | continue; |
| | | } |
| | | Long empId = empBaseInfoService.getEmpIdByEmpNumb(list.get(0).toString()); |
| | | if (null == empId){ |
| | | EmpBaseInfo empBaseInfo = empBaseInfoService.getEmpBaseInfoByEmpNumb(list.get(0).toString()); |
| | | if (null == empBaseInfo){ |
| | | returnList.add(StrUtil.format("导入社保申请服务异常: 出现位置第{}行, 原因:{}员工编号不存在",listObject.indexOf(list)+1,list.get(0).toString())); |
| | | continue; |
| | | } |
| | | empInsurance.setDelFlag(2); |
| | | empInsurance.setEmpId(empId); |
| | | empInsurance.setEmpId(empBaseInfo.getEmpId()); |
| | | empInsurance.setDeptName(list.get(1).toString()); |
| | | empInsurance.setDeptId(dept.getDeptId()); |
| | | empInsurance.setJobName(list.get(2).toString()); |
| | |
| | | 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); |
| | | } |
| | |
| | | } |
| | | empInsurance.setAuditor(list.get(9).toString()); |
| | | empInsurance.setRemark(list.get(10).toString()); |
| | | empInsurance.setEmpStatus(empBaseInfo.getEmpStatus()); |
| | | this.save(empInsurance); |
| | | } |
| | | } |