|
@@ -133,6 +133,8 @@ public class TableServiceCmdService {
|
|
String pkName = context.getPkName();
|
|
String pkName = context.getPkName();
|
|
JSONObject commitData = context.getCommitData();
|
|
JSONObject commitData = context.getCommitData();
|
|
|
|
|
|
|
|
+ checkColumn(commitData, context.getColumns());
|
|
|
|
+
|
|
// 新增
|
|
// 新增
|
|
if (ActionType.INSERT.equals(context.getActionType())) {
|
|
if (ActionType.INSERT.equals(context.getActionType())) {
|
|
Long maxId = IdUtils.getMaxId(dto.getTable(), pkName);
|
|
Long maxId = IdUtils.getMaxId(dto.getTable(), pkName);
|
|
@@ -224,6 +226,7 @@ public class TableServiceCmdService {
|
|
// 拿到每个字段对应的查询类型,=、 like、 >、 <
|
|
// 拿到每个字段对应的查询类型,=、 like、 >、 <
|
|
GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
|
|
GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
|
|
JSONObject fixedData = dto.getFixedData();
|
|
JSONObject fixedData = dto.getFixedData();
|
|
|
|
+ checkColumn(fixedData, genTable.getColumns());
|
|
fixedData = ifNullSetEmpty(fixedData);
|
|
fixedData = ifNullSetEmpty(fixedData);
|
|
|
|
|
|
// 查询条件
|
|
// 查询条件
|
|
@@ -231,12 +234,15 @@ public class TableServiceCmdService {
|
|
List<GenTableColumn> columns = genTable.getColumns();
|
|
List<GenTableColumn> columns = genTable.getColumns();
|
|
// 封装好以后的查询条件
|
|
// 封装好以后的查询条件
|
|
JSONObject packCondition = ifNullSetEmpty(packColCondition(columns, condition));
|
|
JSONObject packCondition = ifNullSetEmpty(packColCondition(columns, condition));
|
|
|
|
+ JSONArray jsonArray = fixedData.getJSONArray(SHOW_DATA);
|
|
|
|
+ checkColumn(jsonArray, genTable.getColumns());
|
|
// 需要返回到前台的列, 需要判断是否是列表展示, 4为判断列表是否可见
|
|
// 需要返回到前台的列, 需要判断是否是列表展示, 4为判断列表是否可见
|
|
- JSONArray showData = filterData(columns, 4, fixedData.getJSONArray(SHOW_DATA), MaskConstant.LIST_VISIBLE::equals);
|
|
|
|
|
|
+ JSONArray showData = filterData(columns, 4, jsonArray, MaskConstant.LIST_VISIBLE::equals);
|
|
|
|
|
|
JSONObject rows = new JSONObject();
|
|
JSONObject rows = new JSONObject();
|
|
int total = selectService.countByCondition(genTable.getTableName(), condition, packCondition);
|
|
int total = selectService.countByCondition(genTable.getTableName(), condition, packCondition);
|
|
rows.put(FormDataConstant.PAGE_TOTAL, total);
|
|
rows.put(FormDataConstant.PAGE_TOTAL, total);
|
|
|
|
+ rows.put(TABLE_HEAD_LIST, getTableHeadList(genTable));
|
|
if (total <= 0) {
|
|
if (total <= 0) {
|
|
rows.put(FormDataConstant.PAGE_ROWS, null);
|
|
rows.put(FormDataConstant.PAGE_ROWS, null);
|
|
return AjaxResult.success(rows);
|
|
return AjaxResult.success(rows);
|
|
@@ -256,7 +262,6 @@ public class TableServiceCmdService {
|
|
result = isCustomized(dto.getTable(),result,"trigger_retrieve");
|
|
result = isCustomized(dto.getTable(),result,"trigger_retrieve");
|
|
|
|
|
|
rows.put(PAGE_ROWS, result);
|
|
rows.put(PAGE_ROWS, result);
|
|
- rows.put(TABLE_HEAD_LIST, getTableHeadList(genTable));
|
|
|
|
return AjaxResult.success(rows);
|
|
return AjaxResult.success(rows);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -559,15 +564,10 @@ public class TableServiceCmdService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 功能描述: 获取表单按钮
|
|
|
|
|
|
+ * 功能描述: 单独获取按钮
|
|
* 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
|
|
* 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
|
|
- * 刷新的入口为 {@link MyController#loadTable(com.boman.gen.domain.GenTable)}
|
|
|
|
*
|
|
*
|
|
- * eg:{
|
|
|
|
- * "table": "sys_config"
|
|
|
|
- * }
|
|
|
|
- *
|
|
|
|
- * @param condition condition
|
|
|
|
|
|
+ * @param tableName tableName
|
|
* @return com.boman.common.core.web.domain.AjaxResult
|
|
* @return com.boman.common.core.web.domain.AjaxResult
|
|
*/
|
|
*/
|
|
public String getButton(String tableName) {
|
|
public String getButton(String tableName) {
|