diff --git a/backend/src/main/java/io/dataease/base/domain/SysDept.java b/backend/src/main/java/io/dataease/base/domain/SysDept.java index f424e2933f..f62eab73fc 100644 --- a/backend/src/main/java/io/dataease/base/domain/SysDept.java +++ b/backend/src/main/java/io/dataease/base/domain/SysDept.java @@ -1,7 +1,6 @@ package io.dataease.base.domain; import java.io.Serializable; -import java.util.Date; import lombok.Data; @Data @@ -22,9 +21,9 @@ public class SysDept implements Serializable { private String updateBy; - private Date createTime; + private Long createTime; - private Date updateTime; + private Long updateTime; private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/SysDeptExample.java b/backend/src/main/java/io/dataease/base/domain/SysDeptExample.java index 1cec2c1e83..6d0598519e 100644 --- a/backend/src/main/java/io/dataease/base/domain/SysDeptExample.java +++ b/backend/src/main/java/io/dataease/base/domain/SysDeptExample.java @@ -1,7 +1,6 @@ package io.dataease.base.domain; import java.util.ArrayList; -import java.util.Date; import java.util.List; public class SysDeptExample { @@ -625,52 +624,52 @@ public class SysDeptExample { return (Criteria) this; } - public Criteria andCreateTimeEqualTo(Date value) { + public Criteria andCreateTimeEqualTo(Long value) { addCriterion("create_time =", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeNotEqualTo(Date value) { + public Criteria andCreateTimeNotEqualTo(Long value) { addCriterion("create_time <>", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeGreaterThan(Date value) { + public Criteria andCreateTimeGreaterThan(Long value) { addCriterion("create_time >", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { addCriterion("create_time >=", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeLessThan(Date value) { + public Criteria andCreateTimeLessThan(Long value) { addCriterion("create_time <", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { addCriterion("create_time <=", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeIn(List values) { + public Criteria andCreateTimeIn(List values) { addCriterion("create_time in", values, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeNotIn(List values) { + public Criteria andCreateTimeNotIn(List values) { addCriterion("create_time not in", values, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeBetween(Date value1, Date value2) { + public Criteria andCreateTimeBetween(Long value1, Long value2) { addCriterion("create_time between", value1, value2, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { addCriterion("create_time not between", value1, value2, "createTime"); return (Criteria) this; } @@ -685,52 +684,52 @@ public class SysDeptExample { return (Criteria) this; } - public Criteria andUpdateTimeEqualTo(Date value) { + public Criteria andUpdateTimeEqualTo(Long value) { addCriterion("update_time =", value, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeNotEqualTo(Date value) { + public Criteria andUpdateTimeNotEqualTo(Long value) { addCriterion("update_time <>", value, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeGreaterThan(Date value) { + public Criteria andUpdateTimeGreaterThan(Long value) { addCriterion("update_time >", value, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { addCriterion("update_time >=", value, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeLessThan(Date value) { + public Criteria andUpdateTimeLessThan(Long value) { addCriterion("update_time <", value, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { addCriterion("update_time <=", value, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeIn(List values) { + public Criteria andUpdateTimeIn(List values) { addCriterion("update_time in", values, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeNotIn(List values) { + public Criteria andUpdateTimeNotIn(List values) { addCriterion("update_time not in", values, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeBetween(Date value1, Date value2) { + public Criteria andUpdateTimeBetween(Long value1, Long value2) { addCriterion("update_time between", value1, value2, "updateTime"); return (Criteria) this; } - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { addCriterion("update_time not between", value1, value2, "updateTime"); return (Criteria) this; } diff --git a/backend/src/main/java/io/dataease/base/mapper/SysDeptMapper.xml b/backend/src/main/java/io/dataease/base/mapper/SysDeptMapper.xml index 2ae55b31dd..2e5860c6fc 100644 --- a/backend/src/main/java/io/dataease/base/mapper/SysDeptMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/SysDeptMapper.xml @@ -10,8 +10,8 @@ - - + + @@ -112,8 +112,8 @@ update_time) values (#{deptId,jdbcType=BIGINT}, #{pid,jdbcType=BIGINT}, #{subCount,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{deptSort,jdbcType=INTEGER}, #{enabled,jdbcType=BIT}, - #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}) + #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, + #{updateTime,jdbcType=BIGINT}) insert into sys_dept @@ -175,10 +175,10 @@ #{updateBy,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}, + #{createTime,jdbcType=BIGINT}, - #{updateTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=BIGINT}, @@ -216,10 +216,10 @@ update_by = #{record.updateBy,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, + create_time = #{record.createTime,jdbcType=BIGINT}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=BIGINT}, @@ -236,8 +236,8 @@ enabled = #{record.enabled,jdbcType=BIT}, create_by = #{record.createBy,jdbcType=VARCHAR}, update_by = #{record.updateBy,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} @@ -267,10 +267,10 @@ update_by = #{updateBy,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, + create_time = #{createTime,jdbcType=BIGINT}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=BIGINT}, where dept_id = #{deptId,jdbcType=BIGINT} @@ -284,8 +284,8 @@ enabled = #{enabled,jdbcType=BIT}, create_by = #{createBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} where dept_id = #{deptId,jdbcType=BIGINT} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/controller/sys/SysDeptController.java b/backend/src/main/java/io/dataease/controller/sys/SysDeptController.java index a9a9a7ad11..4780dabe67 100644 --- a/backend/src/main/java/io/dataease/controller/sys/SysDeptController.java +++ b/backend/src/main/java/io/dataease/controller/sys/SysDeptController.java @@ -12,7 +12,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; - import javax.annotation.Resource; import java.util.List; import java.util.stream.Collectors; diff --git a/backend/src/main/java/io/dataease/service/sys/DeptService.java b/backend/src/main/java/io/dataease/service/sys/DeptService.java index 40d2576dea..71f9b7256b 100644 --- a/backend/src/main/java/io/dataease/service/sys/DeptService.java +++ b/backend/src/main/java/io/dataease/service/sys/DeptService.java @@ -50,7 +50,7 @@ public class DeptService { if (deptCreateRequest.isTop()){ sysDept.setPid(DEPT_ROOT_PID); } - Date now = new Date(); + long now = System.currentTimeMillis(); sysDept.setCreateTime(now); sysDept.setUpdateTime(now); sysDept.setCreateBy(null); @@ -92,7 +92,7 @@ public class DeptService { if (deptCreateRequest.isTop()){ sysDept.setPid(DEPT_ROOT_PID); } - sysDept.setUpdateTime(new Date()); + sysDept.setUpdateTime(System.currentTimeMillis()); sysDept.setUpdateBy(null); Long deptId = sysDept.getDeptId(); SysDept dept_old = sysDeptMapper.selectByPrimaryKey(deptId); diff --git a/backend/src/main/resources/db/migration/V8__system.sql b/backend/src/main/resources/db/migration/V8__system.sql index b89b6fc317..9e0094ff4e 100644 --- a/backend/src/main/resources/db/migration/V8__system.sql +++ b/backend/src/main/resources/db/migration/V8__system.sql @@ -8,8 +8,8 @@ CREATE TABLE IF NOT EXISTS `sys_dept` ( `enabled` bit(1) NOT NULL COMMENT '状态', `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', `update_by` varchar(255) DEFAULT NULL COMMENT '更新者', - `create_time` datetime DEFAULT NULL COMMENT '创建日期', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`dept_id`) USING BTREE, KEY `inx_pid` (`pid`), KEY `inx_enabled` (`enabled`) diff --git a/frontend/src/business/components/settings/sys/dept.vue b/frontend/src/business/components/settings/sys/dept.vue index 13026b9144..d471db1de4 100644 --- a/frontend/src/business/components/settings/sys/dept.vue +++ b/frontend/src/business/components/settings/sys/dept.vue @@ -31,8 +31,8 @@ -