修改实体类时间字段策略配置
- 将Customer、Medicine、MedicineCategory、Menu、Role、Stock、
StockInDetail、StockInRecord、StockOutDetail、StockOutRecord、
Supplier、User、Warehouse等实体类的时间字段策略从自动填充改为
FieldStrategy.NEVER,禁止自动插入和更新时间戳
- 在AuthServiceImpl中手动设置用户创建和更新时间
fix(frontend): 修复登录页面默认凭据和路由跳转逻辑
- 移除登录页面的默认用户名密码预填值
- 修复退出登录时的路由跳转问题,在MainLayout中添加router.push('/login')
- 调整用户状态管理中的路由跳转逻辑,避免重复跳转
feat(frontend): 添加出入库单据新增页面路由
- 新增stock-in/add路由指向StockInForm组件
- 新增stock-out/add路由指向StockOutForm组件
- 为新建入库单和出库单功能提供页面入口
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -16,9 +17,9 @@ public class Customer {
|
||||
private String address;
|
||||
private String type;
|
||||
private String remark;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -25,9 +26,9 @@ public class Medicine {
|
||||
private Integer shelfLife;
|
||||
private Integer warningStock;
|
||||
private String description;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -14,9 +15,9 @@ public class MedicineCategory {
|
||||
private String code;
|
||||
private Integer sortOrder;
|
||||
private String description;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@@ -19,9 +20,9 @@ public class Menu {
|
||||
private String permissionCode;
|
||||
private Integer sortOrder;
|
||||
private Integer visible;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -13,9 +14,9 @@ public class Role {
|
||||
private String code;
|
||||
private String description;
|
||||
private Integer status;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -18,9 +19,9 @@ public class Stock {
|
||||
private BigDecimal costPrice;
|
||||
private LocalDate productionDate;
|
||||
private LocalDate expiryDate;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -19,9 +20,9 @@ public class StockInDetail {
|
||||
private BigDecimal totalPrice;
|
||||
private LocalDate productionDate;
|
||||
private LocalDate expiryDate;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -20,9 +21,9 @@ public class StockInRecord {
|
||||
private LocalDate inDate;
|
||||
private Integer status;
|
||||
private String remark;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -16,9 +17,9 @@ public class StockOutDetail {
|
||||
private Integer quantity;
|
||||
private BigDecimal unitPrice;
|
||||
private BigDecimal totalPrice;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -21,9 +22,9 @@ public class StockOutRecord {
|
||||
private Integer outType;
|
||||
private Integer status;
|
||||
private String remark;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -20,9 +21,9 @@ public class Supplier {
|
||||
private String licenseNumber;
|
||||
private Integer status;
|
||||
private String remark;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -17,9 +18,9 @@ public class User {
|
||||
private String avatar;
|
||||
private Integer status;
|
||||
private LocalDateTime lastLoginTime;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kronecker.backend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -15,9 +16,9 @@ public class Warehouse {
|
||||
private String manager;
|
||||
private Integer status;
|
||||
private String remark;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private LocalDateTime updateTime;
|
||||
@TableLogic
|
||||
private Integer isDeleted;
|
||||
|
||||
@@ -77,6 +77,8 @@ public class AuthServiceImpl implements AuthService {
|
||||
user.setPhone(dto.getPhone());
|
||||
user.setEmail(dto.getEmail());
|
||||
user.setStatus(1);
|
||||
user.setCreateTime(LocalDateTime.now());
|
||||
user.setUpdateTime(LocalDateTime.now());
|
||||
userMapper.insert(user);
|
||||
|
||||
// 分配默认角色(普通员工,role code = staff, id = 3)
|
||||
|
||||
@@ -16,6 +16,7 @@ const isCollapse = computed(() => appStore.sidebarCollapsed)
|
||||
function handleCommand(command) {
|
||||
if (command === 'logout') {
|
||||
userStore.logout()
|
||||
router.push('/login')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,18 @@ const constantRoutes = [
|
||||
component: () => import('@/views/dashboard/DashboardView.vue'),
|
||||
meta: { title: '仪表盘', icon: 'Odometer' },
|
||||
},
|
||||
{
|
||||
path: 'stock-in/add',
|
||||
name: 'StockInAdd',
|
||||
component: () => import('@/views/stockIn/StockInForm.vue'),
|
||||
meta: { title: '新建入库单' },
|
||||
},
|
||||
{
|
||||
path: 'stock-out/add',
|
||||
name: 'StockOutAdd',
|
||||
component: () => import('@/views/stockOut/StockOutForm.vue'),
|
||||
meta: { title: '新建出库单' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -86,7 +86,6 @@ export const useUserStore = defineStore('user', () => {
|
||||
permissions.value = []
|
||||
localStorage.removeItem('token')
|
||||
localStorage.removeItem('refreshToken')
|
||||
router.push('/login')
|
||||
}
|
||||
|
||||
function hasPermission(perm) {
|
||||
|
||||
@@ -10,8 +10,8 @@ const userStore = useUserStore()
|
||||
const loginFormRef = ref(null)
|
||||
const loading = ref(false)
|
||||
const loginForm = reactive({
|
||||
username: 'admin',
|
||||
password: 'admin123',
|
||||
username: '',
|
||||
password: '',
|
||||
remember: false,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user