代码生成同步保留必填/类型选项

pull/140/MERGE
RuoYi 3 years ago
parent 8fac26edca
commit 0e13296752

@ -109,6 +109,9 @@ public class GenConstants
/** 模糊查询 */
public static final String QUERY_LIKE = "LIKE";
/** 相等查询 */
public static final String QUERY_EQ = "EQ";
/** 需要 */
public static final String REQUIRE = "1";
}

@ -1,7 +1,6 @@
package com.ruoyi.common.core.utils.file;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

@ -304,8 +304,17 @@ public class GenTableServiceImpl implements IGenTableService
column.setColumnId(prevColumn.getColumnId());
if (column.isList())
{
// 如果是列表,继续保留字典类型
// 如果是列表,继续保留查询方式/字典类型选项
column.setDictType(prevColumn.getDictType());
column.setQueryType(prevColumn.getQueryType());
}
if (StringUtils.isNotEmpty(prevColumn.getIsRequired()) && !column.isPk()
&& (column.isInsert() || column.isEdit())
&& ((column.isUsableColumn()) || (!column.isSuperColumn())))
{
// 如果是(新增/修改&非主键/非忽略及父属性),继续保留必填/显示类型选项
column.setIsRequired(prevColumn.getIsRequired());
column.setHtmlType(prevColumn.getHtmlType());
}
genTableColumnMapper.updateGenTableColumn(column);
}

@ -42,6 +42,7 @@ public class GenUtils
column.setJavaField(StringUtils.toCamelCase(columnName));
// 设置默认类型
column.setJavaType(GenConstants.TYPE_STRING);
column.setQueryType(GenConstants.QUERY_EQ);
if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType))
{

@ -20,7 +20,7 @@ public interface SysUserMapper
public List<SysUser> selectUserList(SysUser sysUser);
/**
*
*
*
* @param user
* @return

@ -404,7 +404,7 @@ public class SysRoleServiceImpl implements ISysRoleService
*
*
* @param roleId ID
* @param userIds ID
* @param userIds ID
* @return
*/
@Override

Loading…
Cancel
Save