xieb
2025-01-09 8a591448377eff009b0b57d430f63f3f3db42e4c
src/main/java/org/springblade/modules/assessment/service/impl/AssessmentConfigServiceImpl.java
@@ -69,7 +69,8 @@
   @Transactional(rollbackFor = Exception.class)
   public void importData(List<AssessmentConfigExcel> data, Boolean isCovered) {
      data.forEach(configExcel -> {
         System.out.println("username:" + configExcel.getUserName());
         System.out.println("username:" + configExcel.getAssessorUserName());
         if (configExcel.getUserName() != null && configExcel.getDeptName() != null) {
            AssessmentConfigEntity po = Objects.requireNonNull(BeanUtil.copy(configExcel, AssessmentConfigEntity.class));
            // 被考核人信息
@@ -77,6 +78,9 @@
            qw.eq("name", po.getUserName().trim());
            qw.eq("dept_id", Func.toStrWithEmpty(SysCache.getDeptIds("000000", po.getDeptName().trim()), StringPool.EMPTY));
            User user = userService.getOne(qw);
            if (null == user) {
               throw new RuntimeException("用户:" + po.getUserName() + ",离职或者不存在员工信息中,请核对数据");
            }
            po.setUserId(user.getId());
            po.setDeptId(Func.toLong(user.getDeptId()));
            po.setDeptName(po.getDeptName());
@@ -87,6 +91,9 @@
            beQw.eq("name", po.getAssessorUserName().trim());
            beQw.eq("dept_id", Func.toStrWithEmpty(SysCache.getDeptIds("000000", po.getAssessorDeptName().trim()), StringPool.EMPTY));
            User beUser = userService.getOne(beQw);
            if (null == beUser) {
               throw new RuntimeException("用户:" + po.getAssessorUserName() + ",不存在员工信息中,请核对数据");
            }
            po.setAssessorUserId(beUser.getId());
            po.setAssessorDeptId(Func.toLong(beUser.getDeptId()));
            po.setAssessorDeptName(po.getAssessorDeptName());