|
@@ -677,8 +677,13 @@ public class TBUserController {
|
|
String errorColumn = e.getCause().toString();
|
|
String errorColumn = e.getCause().toString();
|
|
String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length())
|
|
String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length())
|
|
.replaceAll("'", "");
|
|
.replaceAll("'", "");
|
|
- throw new BusinessException(
|
|
|
|
- "机构id[" + orgId + "]下的" + FieldUniqueEnum.convertToCode(columnStr) + "数据不允许重复插入");
|
|
|
|
|
|
+ if (Objects.nonNull(columnStr) && columnStr.contains("#23000")) {
|
|
|
|
+ throw new BusinessException(
|
|
|
|
+ "机构id[" + orgId + "]下的" + FieldUniqueEnum.org_login_name.getCode() + "数据不允许重复插入");
|
|
|
|
+ } else {
|
|
|
|
+ throw new BusinessException(
|
|
|
|
+ "机构id[" + orgId + "]下的" + FieldUniqueEnum.convertToCode(columnStr) + "数据不允许重复插入");
|
|
|
|
+ }
|
|
} else if (e instanceof BusinessException) {
|
|
} else if (e instanceof BusinessException) {
|
|
throw new BusinessException(e.getMessage());
|
|
throw new BusinessException(e.getMessage());
|
|
} else {
|
|
} else {
|