提交 f19d799d authored 作者: ww1xhqc's avatar ww1xhqc

model layer 更新详细信息,字段修改

上级 21c81f3f
...@@ -28,7 +28,6 @@ public class ColumnInfo extends BaseEntity { ...@@ -28,7 +28,6 @@ public class ColumnInfo extends BaseEntity {
* 是否primary key, 0是,1否 * 是否primary key, 0是,1否
*/ */
@ApiModelProperty("是否主键") @ApiModelProperty("是否主键")
@Column(name = "primary_key")
private Integer primaryKey; private Integer primaryKey;
@ApiModelProperty("列名") @ApiModelProperty("列名")
......
package com.tykj.workflowcore.model_layer.model; package com.tykj.workflowcore.model_layer.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
...@@ -9,13 +11,19 @@ import lombok.Data; ...@@ -9,13 +11,19 @@ import lombok.Data;
* @Date 2021/3/1 9:58 * @Date 2021/3/1 9:58
* @Version 1.0 * @Version 1.0
*/ */
@ApiModel("列信息")
@Data @Data
public class ColumnVO { public class ColumnVO {
private String filedType; @ApiModelProperty("是否主键")
private Integer primaryKey = 1;
@ApiModelProperty("字段类型")
private String fieldType;
@ApiModelProperty("字段名")
private String fieldName; private String fieldName;
private String filedDescription; @ApiModelProperty("中文描述")
private Integer filedLength; private String fieldDescription;
private Integer primaryKey=1; @ApiModelProperty("字段长度,有默认值")
private Integer fieldLength;
} }
...@@ -50,6 +50,8 @@ public class TableInfo extends BaseEntity implements Serializable { ...@@ -50,6 +50,8 @@ public class TableInfo extends BaseEntity implements Serializable {
@ApiModelProperty("执行人(保留字段)") @ApiModelProperty("执行人(保留字段)")
private String reviser; private String reviser;
@ApiModelProperty("父表名称")
private String parentTable;
@Lob @Lob
@ApiModelProperty("表对应hbm.xml") @ApiModelProperty("表对应hbm.xml")
......
...@@ -2,6 +2,8 @@ package com.tykj.workflowcore.model_layer.model; ...@@ -2,6 +2,8 @@ package com.tykj.workflowcore.model_layer.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
...@@ -13,11 +15,19 @@ import java.util.List; ...@@ -13,11 +15,19 @@ import java.util.List;
* @Date 2021/3/1 9:56 * @Date 2021/3/1 9:56
* @Version 1.0 * @Version 1.0
*/ */
@ApiModel("表信息")
@Data @Data
public class TableVO { public class TableVO {
@ApiModelProperty("中文描述")
private String modelTitle; private String modelTitle;
@ApiModelProperty("表名")
private String modelName; private String modelName;
@ApiModelProperty("模型类型")
private Integer modelType;
@ApiModelProperty("父表名称")
private String parentTable;
@ApiModelProperty("列数组")
private List<ColumnVO> dataList; private List<ColumnVO> dataList;
} }
...@@ -128,9 +128,9 @@ public class ModelImpl implements ModelService { ...@@ -128,9 +128,9 @@ public class ModelImpl implements ModelService {
for (ColumnVO columnVO : dataList) { for (ColumnVO columnVO : dataList) {
ColumnInfo columnInfo = new ColumnInfo(); ColumnInfo columnInfo = new ColumnInfo();
columnInfo.setName(columnVO.getFieldName()); columnInfo.setName(columnVO.getFieldName());
columnInfo.setType(columnVO.getFiledType()); columnInfo.setType(columnVO.getFieldType());
columnInfo.setLength(columnVO.getFiledLength()); columnInfo.setLength(columnVO.getFieldLength());
columnInfo.setCnName(columnVO.getFiledDescription()); columnInfo.setCnName(columnVO.getFieldDescription());
columnInfo.setDbName(tableInfo.getCnName()); columnInfo.setDbName(tableInfo.getCnName());
columnInfo.setDbId(tableInfo.getId()); columnInfo.setDbId(tableInfo.getId());
columnInfoDao.save(columnInfo); columnInfoDao.save(columnInfo);
...@@ -264,7 +264,7 @@ public class ModelImpl implements ModelService { ...@@ -264,7 +264,7 @@ public class ModelImpl implements ModelService {
if (declaredField.isAnnotationPresent(javax.persistence.Id.class)){ if (declaredField.isAnnotationPresent(javax.persistence.Id.class)){
columnVO.setPrimaryKey(0); columnVO.setPrimaryKey(0);
} }
columnVO.setFiledType(getTypeName(genericType.toString())); columnVO.setFieldType(getTypeName(genericType.toString()));
columnVO.setFieldName(getClassName(declaredField.toString())); columnVO.setFieldName(getClassName(declaredField.toString()));
//获得属性中文描述 //获得属性中文描述
...@@ -278,9 +278,9 @@ public class ModelImpl implements ModelService { ...@@ -278,9 +278,9 @@ public class ModelImpl implements ModelService {
apiModelPropertyDocument.append(annotation.example() + "|"); apiModelPropertyDocument.append(annotation.example() + "|");
} }
columnVO.setFiledDescription(apiModelPropertyDocument.toString()); columnVO.setFieldDescription(apiModelPropertyDocument.toString());
} else { } else {
columnVO.setFiledDescription("无描述"); columnVO.setFieldDescription("无描述");
} }
list.add(columnVO); list.add(columnVO);
} }
...@@ -297,9 +297,9 @@ public class ModelImpl implements ModelService { ...@@ -297,9 +297,9 @@ public class ModelImpl implements ModelService {
for (ColumnVO columnVO : dataList) { for (ColumnVO columnVO : dataList) {
ColumnInfo columnInfo = new ColumnInfo(); ColumnInfo columnInfo = new ColumnInfo();
columnInfo.setName(columnVO.getFieldName()); columnInfo.setName(columnVO.getFieldName());
columnInfo.setType(columnVO.getFiledType()); columnInfo.setType(columnVO.getFieldType());
columnInfo.setLength(columnVO.getFiledLength()); columnInfo.setLength(columnVO.getFieldLength());
columnInfo.setCnName(columnVO.getFiledDescription()); columnInfo.setCnName(columnVO.getFieldDescription());
columnInfo.setPrimaryKey(columnVO.getPrimaryKey()); columnInfo.setPrimaryKey(columnVO.getPrimaryKey());
//暂定 简单类型 //暂定 简单类型
if ("class java.lang.String".equals(genericType.toString())){ if ("class java.lang.String".equals(genericType.toString())){
......
...@@ -47,7 +47,7 @@ public class CreatTableUtil { ...@@ -47,7 +47,7 @@ public class CreatTableUtil {
" </id>"; " </id>";
for (ColumnVO columnVO : dataList) { for (ColumnVO columnVO : dataList) {
xmlMapping += xmlMapping +=
" <property type=\"" + columnVO.getFiledType() + "\" name=\"" + columnVO.getFieldName() + " <property type=\"" + columnVO.getFieldType() + "\" name=\"" + columnVO.getFieldName() +
"\" column=\"" + columnVO.getFieldName() + "\"/>\n"; "\" column=\"" + columnVO.getFieldName() + "\"/>\n";
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论