update 标签管理 限制每张表最多有50个字段,字段默认长度为500

This commit is contained in:
lijiarao
2024-01-02 15:06:41 +08:00
parent 253d5aa7b6
commit 1e5a018281
5 changed files with 14 additions and 3 deletions
@@ -88,6 +88,8 @@ public class ResultCommon {
/**字段名称太长*/
public static final String TAG_ADD_ERROR_1 = "tag.add.error.1";
/**每张表最多有50个字段*/
public static final String TAG_ADD_ERROR_2 = "tag.add.error.2";
/**同一所属模块下,展示区域名称不能重复!*/
public static final String TAG_ERROR_1 = "tag.error.1";
/**该展示区域有关联数据,无法删除!*/
@@ -68,9 +68,9 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
lawsTag.setDbFieldNameOld(lawsTag1.getDbFieldName());
}
//处理DBLength为null的情况,默认为100
//处理DBLength为null的情况,默认为500
if (lawsTag.getDbLength() == null){
lawsTag.setDbLength(100);
lawsTag.setDbLength(500);
}
//设置标签存入数据库的字段类型
if(lawsTag.getFieldShowType().equals(LawsFieldTypeEnum.DATE_SINGLE.getValue())){
@@ -118,6 +118,12 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
if (lawsTag1 != null){
lawsTagMapper.updateAllById(lawsTag);
}else {
LambdaQueryWrapper<LawsTag> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsTag::getTableName,tableName);
Integer integer = lawsTagMapper.selectCount(wrapper);
if (integer >= 50) {
throw new JeroBootException(ResultCommon.TAG_ADD_ERROR_2);
}
saveOrUpdate(lawsTag);
}
@@ -63,4 +63,5 @@ tag.edit.error.1=\u56FA\u5B9A\u5B57\u6BB5,\u4E0D\u53EF\u4FEE\u6539
please.search.to.import=\u8BF7\u8F93\u5165\u68C0\u7D22\u5185\u5BB9
task.not.exists=\u4EFB\u52A1\u4E0D\u5B58\u5728
draft.not.exists=\u8349\u7A3F\u4E0D\u5B58\u5728
en.standard.number.conflict=\u4F01\u6807\u7F16\u53F7\u51B2\u7A81\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210
en.standard.number.conflict=\u4F01\u6807\u7F16\u53F7\u51B2\u7A81\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210
tag.add.error.2=\u6BCF\u5F20\u8868\u6700\u591A\u670950\u4E2A\u5B57\u6BB5\u3002
@@ -69,3 +69,4 @@ please.search.to.import=please search to import
task.not.exists=Task not exists
draft.not.exists=Draft not exists
en.standard.number.conflict=English standard number conflict
tag.add.error.2=each table can have a maximum of 50 fields.
@@ -69,3 +69,4 @@ please.search.to.import=\u8BF7\u8F93\u5165\u68C0\u7D22\u5185\u5BB9
task.not.exists=\u4EFB\u52A1\u4E0D\u5B58\u5728
draft.not.exists=\u8349\u7A3F\u4E0D\u5B58\u5728
en.standard.number.conflict=\u4F01\u6807\u7F16\u53F7\u51B2\u7A81\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210
tag.add.error.2=\u6BCF\u5F20\u8868\u6700\u591A\u670950\u4E2A\u5B57\u6BB5\u3002