|
@@ -3,7 +3,6 @@ package com.boman.system.common;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.boman.common.core.utils.SecurityUtils;
|
|
|
import com.boman.common.core.utils.collection.CollectionUtils;
|
|
|
import com.boman.common.core.utils.obj.ObjectUtils;
|
|
|
import com.boman.common.core.web.domain.AjaxResult;
|
|
@@ -12,18 +11,17 @@ import com.boman.common.redis.service.RedisService;
|
|
|
import com.boman.gen.controller.MyController;
|
|
|
import com.boman.gen.domain.GenTable;
|
|
|
import com.boman.gen.domain.GenTableColumn;
|
|
|
+import com.boman.system.domain.SysDictData;
|
|
|
import com.boman.system.mapper.StandardlyMapper;
|
|
|
import com.boman.system.service.*;
|
|
|
import com.boman.system.utils.IdUtils;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.http.HttpMethod;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.net.URI;
|
|
|
import java.sql.Timestamp;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -31,8 +29,6 @@ import java.util.stream.Collectors;
|
|
|
import static com.boman.common.core.utils.obj.ObjectUtils.*;
|
|
|
import static com.boman.system.common.FormDataConstant.CONDITION;
|
|
|
import static com.boman.system.common.FormDataConstant.SHOW_DATA;
|
|
|
-import static com.boman.common.core.utils.obj.ObjectUtils.*;
|
|
|
-import static com.boman.system.common.FormDataConstant.*;
|
|
|
|
|
|
/**
|
|
|
* @author shiqian
|
|
@@ -56,6 +52,8 @@ public class TableServiceCmdService {
|
|
|
private IBaseUpdateService updateService;
|
|
|
@Resource
|
|
|
private RestTemplate restTemplate;
|
|
|
+ @Resource
|
|
|
+ private ISysDictTypeService dictTypeService;
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
|
|
|
|
|
@@ -429,7 +427,7 @@ public class TableServiceCmdService {
|
|
|
// todo redis中未找到,要去查数据库,然后再塞进去
|
|
|
private GenTable getTableFromRedisByTableName(String redisKeyPrefix, String tableName) {
|
|
|
GenTable genTable = redisService.getCacheObject(redisKeyPrefix + requireNonNull(tableName));
|
|
|
- return requireNonNull(genTable);
|
|
|
+ return requireNonNull(genTable, "未找到表对应的信息");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -445,6 +443,15 @@ public class TableServiceCmdService {
|
|
|
public AjaxResult getByTableName(BaseTableSaveDTO condition) {
|
|
|
// requiredNonNull(condition.getTable(), "表名为空");
|
|
|
GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
|
|
|
+ List<GenTableColumn> columns = genTable.getColumns();
|
|
|
+ for (GenTableColumn column : columns) {
|
|
|
+ String dictType = column.getDictType();
|
|
|
+ if (ObjectUtils.isNotEmpty(dictType)) {
|
|
|
+ List<SysDictData> sysDictData = dictTypeService.selectDictDataByType(dictType);
|
|
|
+ column.setSysDictData(sysDictData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return AjaxResult.success(genTable);
|
|
|
}
|
|
|
}
|