代码生成增加createBy、updateBy

pull/211/head
Wan Chen 2020-09-09 18:28:29 +08:00
parent fc2b73f2a8
commit 9b40918a35
1 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import ${packageName}.mapper.${ClassName}Mapper;
import ${packageName}.domain.${ClassName}; import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service; import ${packageName}.service.I${ClassName}Service;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.framework.util.ShiroUtils;
/** /**
* ${functionName}Service业务层处理 * ${functionName}Service业务层处理
@ -76,6 +77,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
#if($column.javaField == 'createTime') #if($column.javaField == 'createTime')
${className}.setCreateTime(DateUtils.getNowDate()); ${className}.setCreateTime(DateUtils.getNowDate());
#end #end
#if($column.javaField == 'createBy')
${className}.setCreateBy(ShiroUtils.getLoginName());
#end
#end #end
#if($table.sub) #if($table.sub)
int rows = ${className}Mapper.insert${ClassName}(${className}); int rows = ${className}Mapper.insert${ClassName}(${className});
@ -102,6 +106,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
#if($column.javaField == 'updateTime') #if($column.javaField == 'updateTime')
${className}.setUpdateTime(DateUtils.getNowDate()); ${className}.setUpdateTime(DateUtils.getNowDate());
#end #end
#if($column.javaField == 'updateBy')
${className}.setUpdateBy(ShiroUtils.getLoginName());
#end
#end #end
#if($table.sub) #if($table.sub)
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}());