|
@@ -1,23 +1,25 @@
|
|
|
package com.boman.gen.service;
|
|
|
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
-import java.util.concurrent.locks.Condition;
|
|
|
-
|
|
|
import com.boman.common.core.constant.UserConstants;
|
|
|
+import com.boman.common.core.text.Convert;
|
|
|
import com.boman.common.core.utils.DateUtils;
|
|
|
import com.boman.common.core.utils.SecurityUtils;
|
|
|
import com.boman.common.core.utils.StringUtils;
|
|
|
+import com.boman.common.core.utils.obj.ObjectUtils;
|
|
|
import com.boman.common.log.enums.BusinessType;
|
|
|
import com.boman.gen.domain.GenTable;
|
|
|
+import com.boman.gen.domain.GenTableColumn;
|
|
|
import com.boman.gen.domain.TableSql;
|
|
|
+import com.boman.gen.mapper.GenTableColumnMapper;
|
|
|
import com.boman.gen.mapper.GenTableMapper;
|
|
|
import com.boman.gen.mapper.TableSqlMapper;
|
|
|
+import com.google.common.collect.Maps;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import com.boman.common.core.text.Convert;
|
|
|
-import com.boman.gen.domain.GenTableColumn;
|
|
|
-import com.boman.gen.mapper.GenTableColumnMapper;
|
|
|
+
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
* 业务字段 服务层实现
|
|
@@ -60,6 +62,27 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
|
|
return genTableColumnMapper.selectGenTableColumnByColumnId(columnId);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ * 根据字段编号获取字段详细信息, 把此外键对应的名称返回给前台
|
|
|
+ * @param columnId pk
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public GenTableColumn getByIdWithForeignKey(Long columnId) {
|
|
|
+ GenTableColumn tableColumn = selectGenTableColumnListByColumnId(columnId);
|
|
|
+ String foreignKey = tableColumn.getForeignKey();
|
|
|
+ if (ObjectUtils.isNotEmpty(foreignKey)) {
|
|
|
+ GenTableColumn fkTableColumn = selectGenTableColumnListByColumnId(Long.parseLong(foreignKey));
|
|
|
+ String columnName = fkTableColumn.getColumnName();
|
|
|
+ Map<String, String> map = Maps.newHashMap();
|
|
|
+ map.put("name", foreignKey);
|
|
|
+ map.put("value", columnName);
|
|
|
+ tableColumn.setFkInfo(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tableColumn;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* 查询业务字段列表
|
|
|
*
|