Gaokun Wang 1 сар өмнө
parent
commit
527ddca559

+ 0 - 43
eco-nexus-core/auth-biz/src/main/java/org/eco/vip/auth/controller/dept/DeptController.java

@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2025 GaoKunW
- *
- */
-
-package org.eco.vip.auth.controller.dept;
-
-
-import jakarta.annotation.Resource;
-import org.eco.vip.auth.domain.dept.Dept;
-import org.eco.vip.auth.domain.dept.vo.DeptVO;
-import org.eco.vip.auth.service.dept.IDeptService;
-import org.eco.vip.orm.pojo.CommonResult;
-import org.eco.vip.orm.pojo.PageResult;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import static org.eco.vip.orm.pojo.CommonResult.success;
-
-/**
- * @author GaoKunW
- *
- * @description DeptController
- * @date 2025/3/10 20:59
- */
-@RestController
-@RequestMapping("/system/dept")
-public class DeptController {
-    @Resource
-    private IDeptService deptService;
-
-    @GetMapping("/get")
-    public Dept getDept() {
-        return deptService.getById("2");
-    }
-
-    @GetMapping("/page")
-    public CommonResult<PageResult<DeptVO>> page() {
-        return success(deptService.selectPage());
-    }
-
-}

+ 0 - 85
eco-nexus-core/auth-biz/src/main/java/org/eco/vip/auth/domain/dept/Dept.java

@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2025 GaoKunW
- */
-
-package org.eco.vip.auth.domain.dept;
-
-
-import com.mybatisflex.annotation.Column;
-import com.mybatisflex.annotation.Id;
-import com.mybatisflex.annotation.Table;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.eco.vip.orm.domain.BaseEntity;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @description Dept
- *
- * @author GaoKunW
- * @date 2025/3/10 20:57
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@Table("system_dept_t")
-public class Dept extends BaseEntity {
-    /**
-     * 部门ID
-     */
-    @Id
-    private String deptId;
-
-    /**
-     * 父部门ID
-     */
-    private String parentId;
-
-    /**
-     * 祖级列表
-     */
-//    private String ancestors;
-
-    /**
-     * 部门名称
-     */
-    private String deptName;
-
-    /**
-     * 显示顺序
-     */
-    private Integer orderNum;
-
-    /**
-     * 负责人
-     */
-//    @Trans(type = TransType.SIMPLE, targetClassName = "org.eco.vip.auth.domain.user.User", fields = "userName", ref = "leader")
-//    private Long leaderId;
-
-    /**
-     * 负责人
-     */
-//    private String leader;
-
-    /**
-     * 联系电话
-     */
-    private String phone;
-
-    /**
-     * 邮箱
-     */
-    private String email;
-
-    /**
-     * 父部门名称
-     */
-    @Column(ignore = true)
-    private String parentName;
-
-    /**
-     * 子部门
-     */
-    private List<Dept> children = new ArrayList<>();
-}

+ 0 - 73
eco-nexus-core/auth-biz/src/main/java/org/eco/vip/auth/domain/dept/vo/DeptVO.java

@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2025 GaoKunW
- */
-
-package org.eco.vip.auth.domain.dept.vo;
-
-
-import com.fhs.core.trans.anno.Trans;
-import com.fhs.core.trans.constant.TransType;
-import com.mybatisflex.annotation.Id;
-import io.github.linpeilie.annotations.AutoMapper;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.eco.vip.auth.domain.dept.Dept;
-import org.eco.vip.orm.domain.BaseEntity;
-
-/**
- * @description DeptVO
- *
- * @author GaoKunW
- * @date 2025/7/1 23:22
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@AutoMapper(target = Dept.class, reverseConvertGenerate = false)
-public class DeptVO extends BaseEntity {
-    /**
-     * 部门ID
-     */
-    @Id
-    private String deptId;
-
-    /**
-     * 父部门ID
-     */
-    private String parentId;
-
-    /**
-     * 祖级列表
-     */
-    private String ancestors;
-
-    /**
-     * 部门名称
-     */
-    private String deptName;
-
-    /**
-     * 显示顺序
-     */
-    private Integer orderNum;
-
-    /**
-     * 负责人
-     */
-    @Trans(type = TransType.SIMPLE, targetClassName = "org.eco.vip.auth.domain.user.User", fields = "userName", ref = "leader")
-    private Long leaderId;
-
-    /**
-     * 负责人
-     */
-    private String leader;
-
-    /**
-     * 联系电话
-     */
-    private String phone;
-
-    /**
-     * 邮箱
-     */
-    private String email;
-}

+ 0 - 21
eco-nexus-core/auth-biz/src/main/java/org/eco/vip/auth/mapper/DeptMapper.java

@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2025 GaoKunW
- *
- */
-
-package org.eco.vip.auth.mapper;
-
-
-import com.mybatisflex.core.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import org.eco.vip.auth.domain.dept.Dept;
-
-/**
- * @description DeptMapper
- *
- * @author GaoKunW
- * @date 2025/3/10 21:00
- */
-@Mapper
-public interface DeptMapper extends BaseMapper<Dept> {
-}

+ 0 - 38
eco-nexus-core/auth-biz/src/main/java/org/eco/vip/auth/service/dept/DeptService.java

@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2025 GaoKunW
- *
- */
-
-package org.eco.vip.auth.service.dept;
-
-
-import com.mybatisflex.core.paginate.Page;
-import com.mybatisflex.core.query.QueryWrapper;
-import org.eco.vip.auth.domain.dept.Dept;
-import org.eco.vip.auth.domain.dept.vo.DeptVO;
-import org.eco.vip.auth.mapper.DeptMapper;
-import org.eco.vip.orm.domain.PageQuery;
-import org.eco.vip.orm.pojo.PageResult;
-import org.eco.vip.orm.service.BaseService;
-import org.springframework.stereotype.Service;
-
-/**
- * @description DeptService
- *
- * @author GaoKunW
- * @date 2025/3/10 21:01
- */
-@Service
-public class DeptService extends BaseService<DeptMapper, Dept> implements IDeptService {
-    private QueryWrapper buildQueryWrapper() {
-        QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
-        return queryWrapper;
-    }
-
-    @Override
-    public PageResult<DeptVO> selectPage() {
-        QueryWrapper queryWrapper = buildQueryWrapper();
-        Page<DeptVO> page = this.pageAs(PageQuery.build(), queryWrapper, DeptVO.class);
-        return PageResult.build(page);
-    }
-}

+ 0 - 21
eco-nexus-core/auth-biz/src/main/java/org/eco/vip/auth/service/dept/IDeptService.java

@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2025 GaoKunW
- *
- */
-
-package org.eco.vip.auth.service.dept;
-
-
-import com.mybatisflex.core.service.IService;
-import org.eco.vip.auth.domain.dept.Dept;
-import org.eco.vip.auth.domain.dept.vo.DeptVO;
-import org.eco.vip.orm.pojo.PageResult;
-
-/**
- * @author GaoKunW
- * @description IDeptService
- * @date 2025/3/10 20:59
- */
-public interface IDeptService extends IService<Dept> {
-    PageResult<DeptVO> selectPage();
-}

+ 0 - 7
eco-nexus-core/auth-biz/src/main/resources/mapper/DeptMapper.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.eco.vip.auth.mapper.DeptMapper">
-
-</mapper>

+ 10 - 8
eco-start/src/main/resources/db/mysql/V1_0_0_1__sys-init-ddl.sql

@@ -1,13 +1,13 @@
 drop table if exists system_user_t;
 create table system_user_t
 (
-    user_id           varchar(20) not null comment '用户ID'
+    id           varchar(20) not null comment '唯一标识'
         primary key,
-    dept_id      varchar(20) not null comment '部门ID',
+    org_id      varchar(20) not null comment '组织ID',
     account      varchar(50) null comment '用户账号',
     user_name    varchar(50) null comment '用户姓名',
     nick_name    varchar(50) null comment '用户昵称',
-    user_type    varchar(30) null comment '用户类型(sys_user系统用户)',
+    user_type    varchar(30) null comment '用户类型(system系统用户)',
     email        varchar(50) null comment '用户邮箱',
     phone_number varchar(11) null comment '手机号码',
     gender       varchar(20) null comment '用户性别(0男 1女 2未知)',
@@ -28,13 +28,15 @@ create table system_user_t
                          row_format = DYNAMIC;
 
 
-drop table if exists system_dept_t;
-create table system_dept_t
+drop table if exists system_org_t;
+create table system_org_t
 (
-    dept_id          varchar(20) not null comment '部门ID'
+    id          varchar(20) not null comment '唯一标识'
         primary key,
-    parent_id   varchar(20) null comment '父部门ID',
-    dept_name   varchar(100) null comment '部门名称',
+    parent_id   varchar(20) null comment '父组织ID',
+    name   varchar(255) null comment '组织名称',
+    code   varchar(255) null comment '组织编码',
+    category   varchar(255) null comment '类别',
     order_num   int null comment '显示顺序',
     leader_id   varchar(20) null comment '负责人',
     phone       varchar(11) null comment '联系电话',