mirror of https://gitee.com/y_project/RuoYi.git
代码生成增加createBy、updateBy
parent
fc2b73f2a8
commit
9b40918a35
|
@ -23,6 +23,7 @@ import ${packageName}.mapper.${ClassName}Mapper;
|
|||
import ${packageName}.domain.${ClassName};
|
||||
import ${packageName}.service.I${ClassName}Service;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
|
||||
/**
|
||||
* ${functionName}Service业务层处理
|
||||
|
@ -76,6 +77,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
#if($column.javaField == 'createTime')
|
||||
${className}.setCreateTime(DateUtils.getNowDate());
|
||||
#end
|
||||
#if($column.javaField == 'createBy')
|
||||
${className}.setCreateBy(ShiroUtils.getLoginName());
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
int rows = ${className}Mapper.insert${ClassName}(${className});
|
||||
|
@ -102,6 +106,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
#if($column.javaField == 'updateTime')
|
||||
${className}.setUpdateTime(DateUtils.getNowDate());
|
||||
#end
|
||||
#if($column.javaField == 'updateBy')
|
||||
${className}.setUpdateBy(ShiroUtils.getLoginName());
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}());
|
||||
|
|
Loading…
Reference in New Issue