yijiusmile
2021-03-04 6328f096bc75d835ecf6c25f58f1a452b8800a86
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpLaborTroubleServiceImpl.java
@@ -11,6 +11,7 @@
import cc.mrbird.febs.server.hr.service.IEmpLaborTroubleService;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -169,16 +170,22 @@
   @Override
   @Transactional(rollbackFor = Exception.class)
   public void importEmpLaborTrouble(List<List<Object>> listObject) {
   public void importEmpLaborTrouble(List<List<Object>> listObject,List<String>  returnList) {
      for (List<Object> list : listObject) {
         if (list.size()==0){
            continue;
         }
         EmpLaborTrouble empLabortrouble = new EmpLaborTrouble();
         empLabortrouble.setArbitrationId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE));
         empLabortrouble.setEmpNumb(list.get(0).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();
         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;
         }
         empLabortrouble.setDeptName(list.get(1).toString());
         empLabortrouble.setDeptId(deptId);
         empLabortrouble.setDeptId(dept.getDeptId());
         empLabortrouble.setJobName(list.get(2).toString());
         empLabortrouble.setEmpName(list.get(3).toString());
         empLabortrouble.setCertificateNumb(list.get(4).toString());