diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index a4ab46be..08765bd9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -3,6 +3,8 @@ package com.ruoyi.system.service.impl; import java.util.ArrayList; import java.util.Iterator; import java.util.List; + +import com.ruoyi.common.utils.DateUtils; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -203,6 +205,7 @@ public class SysDeptServiceImpl implements ISysDeptService throw new BusinessException("部门停用,不允许新增"); } dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); + dept.setCreateTime(DateUtils.getNowDate()); return deptMapper.insertDept(dept); } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index f98108ce..475cb9f2 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" email, status, create_by, - create_time + create_time )values( #{deptId}, #{parentId}, @@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{email}, #{status}, #{createBy}, - sysdate() + #{createTime} )