update 优化 excel导入 适配异常结构
parent
2c970e9de4
commit
1673395ad8
|
|
@ -80,7 +80,11 @@ public class SysUserImportListener extends AnalysisEventListener<SysUserImportVo
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
failureNum++;
|
failureNum++;
|
||||||
String msg = "<br/>" + failureNum + "、账号 " + userVo.getUserName() + " 导入失败:";
|
String msg = "<br/>" + failureNum + "、账号 " + userVo.getUserName() + " 导入失败:";
|
||||||
failureMsg.append(msg).append(e.getMessage());
|
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);
|
log.error(msg, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue