| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.crypto.digest.BCrypt; |
| | | import cn.hutool.http.HtmlUtil; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import jakarta.validation.ConstraintViolation; |
| | | import jakarta.validation.ConstraintViolationException; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.StreamUtils; |
| | | import org.dromara.common.core.utils.ValidatorUtils; |
| | | import org.dromara.common.excel.core.ExcelListener; |
| | | import org.dromara.common.excel.core.ExcelResult; |
| | |
| | | } |
| | | } catch (Exception e) { |
| | | failureNum++; |
| | | String msg = "<br/>" + failureNum + "、账号 " + sysUser.getUserName() + " 导入失败:"; |
| | | failureMsg.append(msg).append(e.getMessage()); |
| | | String msg = "<br/>" + failureNum + "、账号 " + HtmlUtil.cleanHtmlTag(userVo.getUserName()) + " 导入失败:"; |
| | | String message = e.getMessage(); |
| | | if (e instanceof ConstraintViolationException cvException) { |
| | | message = StreamUtils.join(cvException.getConstraintViolations(), ConstraintViolation::getMessage, ", "); |
| | | } |
| | | failureMsg.append(msg).append(message); |
| | | log.error(msg, e); |
| | | } |
| | | } |