| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.apache.poi.hssf.usermodel.HSSFDateUtil; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.util.DateUtils; |
| | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | OperationCertificateImportVo operationCertificateImportVo = list.get(i); |
| | | OperationCertificate operationCertificate = new OperationCertificate(); |
| | | operationCertificate.setNum(identityService.getNumByTypeAndLength("OperationCertificate",4)); |
| | | //判空 |
| | | if(StringUtils.isBlank(operationCertificateImportVo.getName())){ |
| | | errorMessage.add("第" + (i + 1) + "行导入失败,原因:人员不能为空!"); |
| | | errorLines++; |
| | | continue; |
| | | } |
| | | if(StringUtils.isBlank(operationCertificateImportVo.getTechnicalLevel())){ |
| | | errorMessage.add("第" + (i + 1) + "行导入失败,原因:技能等级不能为空!"); |
| | | errorLines++; |
| | | continue; |
| | | } |
| | | if(StringUtils.isBlank(operationCertificateImportVo.getProfession())){ |
| | | errorMessage.add("第" + (i + 1) + "行导入失败,原因:工种不能为空!"); |
| | | errorLines++; |
| | | continue; |
| | | } |
| | | if(StringUtils.isBlank(operationCertificateImportVo.getWorkNo())){ |
| | | errorMessage.add("第" + (i + 1) + "行导入失败,原因:工作证号不能为空!"); |
| | | errorLines++; |
| | | continue; |
| | | } |
| | | if(StringUtils.isBlank(operationCertificateImportVo.getAppointmentCardNum())){ |
| | | errorMessage.add("第" + (i + 1) + "行导入失败,原因:上岗证号不能为空!"); |
| | | errorLines++; |
| | | continue; |
| | | } |
| | | if(StringUtils.isBlank(operationCertificateImportVo.getEquipmentNum())){ |
| | | errorMessage.add("第" + (i + 1) + "行导入失败,原因:统一编号不能为空!"); |
| | | errorLines++; |
| | | continue; |
| | | } |
| | | if(operationCertificateImportVo.getIssueDate() == null){ |
| | | errorMessage.add("第" + (i + 1) + "行导入失败,原因:发证日期不能为空!"); |
| | | errorLines++; |
| | | continue; |
| | | } |
| | | if(StringUtils.isBlank(operationCertificateImportVo.getNum())){ |
| | | operationCertificate.setNum(identityService.getNumByTypeAndLength("OperationCertificate",4)); |
| | | }else { |
| | | operationCertificate.setNum(operationCertificateImportVo.getNum()); |
| | | } |
| | | //根据人员姓名查询人员id |
| | | List<SysUser> userList = userService.lambdaQuery().eq(SysUser::getRealname,operationCertificateImportVo.getName().trim()) |
| | | .eq(SysUser::getWorkNo,operationCertificateImportVo.getWorkNo().trim()).eq(SysUser::getDelFlag, CommonConstant.DEL_FLAG_0).list(); |
| | |
| | | } catch (Exception e) { |
| | | errorMessage.add("发生异常:" + e.getMessage()); |
| | | log.error(e.getMessage(), e); |
| | | return (Result<?>) errorMessage; |
| | | return Result.error(errorMessage.toString()); |
| | | // return (Result<?>) errorMessage; |
| | | } finally { |
| | | try { |
| | | file.getInputStream().close(); |