Browse Source

[fix]

基础资料 员工管理
修改员工管理插入mapper方法,修改创建时间赋值语句;
修改员工管理新增controller方法,新增设置当前时间为创建时间语句;
dev
王晓迪 1 month ago
parent
commit
58c0566e7a
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  2. 4
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
@ -138,6 +139,7 @@ public class SysUserController extends BaseController
user.setSalt(ShiroUtils.randomSalt());
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
user.setCreateBy(ShiroUtils.getLoginName());
user.setCreateTime(DateUtils.getNowDate());
return toAjax(userService.insertUser(user));
}

4
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -213,7 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="pwdUpdateDate != null">pwd_update_date,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
create_time
<if test="createTime != null">create_time</if>
)values(
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
@ -230,7 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="pwdUpdateDate != null">#{pwdUpdateDate},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
<if test="createTime != null">#{createTime}</if>
)
</insert>

Loading…
Cancel
Save