From 9b40918a35b8667eb6364fcaac44da7b4274a653 Mon Sep 17 00:00:00 2001 From: Wan Chen Date: Wed, 9 Sep 2020 18:28:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0createBy=E3=80=81updateBy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/vm/java/serviceImpl.java.vm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm index 4592abce8..1304f1939 100644 --- a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -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}());