提交 462d6cbd authored 作者: 李秋林's avatar 李秋林

代码创建bug修改

上级 360aa2ed
package com.sfa.gen.domain; package com.sfa.gen.domain;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sfa.common.core.utils.StringUtils; import com.sfa.common.core.utils.StringUtils;
import com.sfa.common.core.web.domain.BaseDo;
import com.sfa.common.core.web.domain.BaseEntity; import com.sfa.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* 代码生成业务字段表 gen_table_column * 代码生成业务字段表 gen_table_column
* *
* @author ruoyi * @author ruoyi
*/ */
public class GenTableColumn extends BaseEntity @NoArgsConstructor
@AllArgsConstructor
@Data
@TableName(value = "gen_table_column")
public class GenTableColumn extends BaseDo
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -68,91 +78,6 @@ public class GenTableColumn extends BaseEntity ...@@ -68,91 +78,6 @@ public class GenTableColumn extends BaseEntity
/** 排序 */ /** 排序 */
private Integer sort; private Integer sort;
public void setColumnId(Long columnId)
{
this.columnId = columnId;
}
public Long getColumnId()
{
return columnId;
}
public void setTableId(Long tableId)
{
this.tableId = tableId;
}
public Long getTableId()
{
return tableId;
}
public void setColumnName(String columnName)
{
this.columnName = columnName;
}
public String getColumnName()
{
return columnName;
}
public void setColumnComment(String columnComment)
{
this.columnComment = columnComment;
}
public String getColumnComment()
{
return columnComment;
}
public void setColumnType(String columnType)
{
this.columnType = columnType;
}
public String getColumnType()
{
return columnType;
}
public void setJavaType(String javaType)
{
this.javaType = javaType;
}
public String getJavaType()
{
return javaType;
}
public void setJavaField(String javaField)
{
this.javaField = javaField;
}
public String getJavaField()
{
return javaField;
}
public String getCapJavaField()
{
return StringUtils.capitalize(javaField);
}
public void setIsPk(String isPk)
{
this.isPk = isPk;
}
public String getIsPk()
{
return isPk;
}
public boolean isPk() public boolean isPk()
{ {
return isPk(this.isPk); return isPk(this.isPk);
...@@ -163,16 +88,6 @@ public class GenTableColumn extends BaseEntity ...@@ -163,16 +88,6 @@ public class GenTableColumn extends BaseEntity
return isPk != null && StringUtils.equals("1", isPk); return isPk != null && StringUtils.equals("1", isPk);
} }
public String getIsIncrement()
{
return isIncrement;
}
public void setIsIncrement(String isIncrement)
{
this.isIncrement = isIncrement;
}
public boolean isIncrement() public boolean isIncrement()
{ {
return isIncrement(this.isIncrement); return isIncrement(this.isIncrement);
...@@ -183,36 +98,11 @@ public class GenTableColumn extends BaseEntity ...@@ -183,36 +98,11 @@ public class GenTableColumn extends BaseEntity
return isIncrement != null && StringUtils.equals("1", isIncrement); return isIncrement != null && StringUtils.equals("1", isIncrement);
} }
public void setIsRequired(String isRequired)
{
this.isRequired = isRequired;
}
public String getIsRequired()
{
return isRequired;
}
public boolean isRequired()
{
return isRequired(this.isRequired);
}
public boolean isRequired(String isRequired) public boolean isRequired(String isRequired)
{ {
return isRequired != null && StringUtils.equals("1", isRequired); return isRequired != null && StringUtils.equals("1", isRequired);
} }
public void setIsInsert(String isInsert)
{
this.isInsert = isInsert;
}
public String getIsInsert()
{
return isInsert;
}
public boolean isInsert() public boolean isInsert()
{ {
return isInsert(this.isInsert); return isInsert(this.isInsert);
...@@ -223,16 +113,6 @@ public class GenTableColumn extends BaseEntity ...@@ -223,16 +113,6 @@ public class GenTableColumn extends BaseEntity
return isInsert != null && StringUtils.equals("1", isInsert); return isInsert != null && StringUtils.equals("1", isInsert);
} }
public void setIsEdit(String isEdit)
{
this.isEdit = isEdit;
}
public String getIsEdit()
{
return isEdit;
}
public boolean isEdit() public boolean isEdit()
{ {
return isInsert(this.isEdit); return isInsert(this.isEdit);
...@@ -242,17 +122,6 @@ public class GenTableColumn extends BaseEntity ...@@ -242,17 +122,6 @@ public class GenTableColumn extends BaseEntity
{ {
return isEdit != null && StringUtils.equals("1", isEdit); return isEdit != null && StringUtils.equals("1", isEdit);
} }
public void setIsList(String isList)
{
this.isList = isList;
}
public String getIsList()
{
return isList;
}
public boolean isList() public boolean isList()
{ {
return isList(this.isList); return isList(this.isList);
...@@ -263,16 +132,6 @@ public class GenTableColumn extends BaseEntity ...@@ -263,16 +132,6 @@ public class GenTableColumn extends BaseEntity
return isList != null && StringUtils.equals("1", isList); return isList != null && StringUtils.equals("1", isList);
} }
public void setIsQuery(String isQuery)
{
this.isQuery = isQuery;
}
public String getIsQuery()
{
return isQuery;
}
public boolean isQuery() public boolean isQuery()
{ {
return isQuery(this.isQuery); return isQuery(this.isQuery);
...@@ -283,46 +142,6 @@ public class GenTableColumn extends BaseEntity ...@@ -283,46 +142,6 @@ public class GenTableColumn extends BaseEntity
return isQuery != null && StringUtils.equals("1", isQuery); return isQuery != null && StringUtils.equals("1", isQuery);
} }
public void setQueryType(String queryType)
{
this.queryType = queryType;
}
public String getQueryType()
{
return queryType;
}
public String getHtmlType()
{
return htmlType;
}
public void setHtmlType(String htmlType)
{
this.htmlType = htmlType;
}
public void setDictType(String dictType)
{
this.dictType = dictType;
}
public String getDictType()
{
return dictType;
}
public void setSort(Integer sort)
{
this.sort = sort;
}
public Integer getSort()
{
return sort;
}
public boolean isSuperColumn() public boolean isSuperColumn()
{ {
return isSuperColumn(this.javaField); return isSuperColumn(this.javaField);
......
package com.sfa.gen.mapper; package com.sfa.gen.mapper;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sfa.gen.domain.GenTableColumn; import com.sfa.gen.domain.GenTableColumn;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -12,7 +14,7 @@ import org.springframework.stereotype.Repository; ...@@ -12,7 +14,7 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
@Mapper @Mapper
public interface GenTableColumnMapper public interface GenTableColumnMapper extends BaseMapper<GenTableColumn>
{ {
/** /**
* 根据表名称查询列信息 * 根据表名称查询列信息
......
...@@ -197,12 +197,15 @@ public class GenTableServiceImpl implements IGenTableService ...@@ -197,12 +197,15 @@ public class GenTableServiceImpl implements IGenTableService
public void importGenTable(List<GenTable> tableList) public void importGenTable(List<GenTable> tableList)
{ {
String operName = SecurityUtils.getUsername(); String operName = SecurityUtils.getUsername();
Long userId = SecurityUtils.getUserId();
try try
{ {
for (GenTable table : tableList) for (GenTable table : tableList)
{ {
String tableName = table.getTableName(); String tableName = table.getTableName();
GenUtils.initTable(table, operName); GenUtils.initTable(table, operName);
table.setCreateUserId(userId);
table.setCreateBy(operName);
int row = genTableMapper.insertGenTable(table); int row = genTableMapper.insertGenTable(table);
if (row > 0) if (row > 0)
{ {
...@@ -210,6 +213,8 @@ public class GenTableServiceImpl implements IGenTableService ...@@ -210,6 +213,8 @@ public class GenTableServiceImpl implements IGenTableService
List<GenTableColumn> genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); List<GenTableColumn> genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
for (GenTableColumn column : genTableColumns) for (GenTableColumn column : genTableColumns)
{ {
column.setCreateBy(operName);
column.setCreateUserId(userId);
GenUtils.initColumnField(column, table); GenUtils.initColumnField(column, table);
genTableColumnMapper.insertGenTableColumn(column); genTableColumnMapper.insertGenTableColumn(column);
} }
......
...@@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dictType != null and dictType != ''">dict_type,</if> <if test="dictType != null and dictType != ''">dict_type,</if>
<if test="sort != null">sort,</if> <if test="sort != null">sort,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="createUserId != null and createUserId != ''">create_user_id,</if>
create_time create_time
)values( )values(
<if test="tableId != null and tableId != ''">#{tableId},</if> <if test="tableId != null and tableId != ''">#{tableId},</if>
...@@ -85,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -85,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dictType != null and dictType != ''">#{dictType},</if> <if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="sort != null">#{sort},</if> <if test="sort != null">#{sort},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createUserId != null and createUserId != ''">#{createUserId},</if>
sysdate() sysdate()
) )
</insert> </insert>
......
...@@ -139,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -139,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="genPath != null and genPath != ''">gen_path,</if> <if test="genPath != null and genPath != ''">gen_path,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="createUserId != null and createUserId != ''">create_user_id,</if>
create_time create_time
)values( )values(
<if test="tableName != null">#{tableName},</if> <if test="tableName != null">#{tableName},</if>
...@@ -155,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -155,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="genPath != null and genPath != ''">#{genPath},</if> <if test="genPath != null and genPath != ''">#{genPath},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createUserId != null and createUserId != ''">#{createUserId},</if>
sysdate() sysdate()
) )
</insert> </insert>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论