对于数据库不以字母开头的数据,默认加上GRP_前缀。确保数据库可以正常创建
This commit is contained in:
+7
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.tag.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -82,6 +83,12 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
onlCgformTag.setUpdateBy(sysUser.getUsername());
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
|
||||
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
|
||||
|
||||
// 数据库的字段名称必须以字母开头,若不以字母开头加上固定的grp前缀
|
||||
if (!Validator.isMatchRegex("^[a-zA-Z]*$", onlCgformTag.getDbFieldName())){
|
||||
onlCgformTag.setDbFieldName("GRP_" + onlCgformTag.getDbFieldName());
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(onlCgformTag.getDbFieldEnName())){
|
||||
onlCgformTag.setDbFieldEnName(onlCgformTag.getDbFieldEnName().replace(" ","_"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user