yz
2021-03-04 6343cac51e460280c721c9db0238b62389146590
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpPhysicalExamServiceImpl.java
@@ -12,6 +12,7 @@
import cc.mrbird.febs.common.core.utils.CastUtil;
import cc.mrbird.febs.common.redis.service.RedisService;
import cc.mrbird.febs.server.hr.entity.EmpBaseInfo;
import cn.hutool.core.util.StrUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@@ -169,14 +170,20 @@
    @Transactional(rollbackFor = Exception.class)
   public void importEmpPhysicalExam(List<List<Object>> listObject,List<String>  returnList) {
      for (List<Object> list : listObject) {
            if (list.size()==0){
                continue;
            }
         EmpPhysicalExam physicalExam = new EmpPhysicalExam();
         physicalExam.setPhysicalExamId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE));
         physicalExam.setEmpNumb(list.get(0).toString());
         physicalExam.setDeptName(list.get(1).toString());
         List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class);
         Long deptId = depts.stream().filter(d -> d.getDeptName().equals(list.get(1).toString())).findFirst().get()
               .getDeptId();
         physicalExam.setDeptId(deptId);
            Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(3).toString())).findFirst().orElse(null);
            if (null == dept) {
                returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在",listObject.indexOf(list),list.get(3).toString()));
                continue;
            }
         physicalExam.setDeptId(dept.getDeptId());
         physicalExam.setJobName(list.get(2).toString());
         physicalExam.setEmpName(list.get(3).toString());
         physicalExam.setCertificateNumb(list.get(4).toString());