From ac6d2918d99e29944baeda65747b5fb2fe78fde6 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Mon, 27 Feb 2023 22:53:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=EF=BC=9A=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86/=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=88=E8=BF=87=E4=BA=8E=E5=81=8F=E5=90=91?= =?UTF-8?q?=E8=A1=8C=E6=94=BF=E4=B8=9A=E5=8A=A1=E5=90=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cnadmin/system/mapper/PostMapper.java | 28 - .../cnadmin/system/mapper/UserPostMapper.java | 28 - .../cnadmin/system/model/entity/PostDO.java | 64 -- .../system/model/entity/UserPostDO.java | 53 -- .../cnadmin/system/model/query/PostQuery.java | 55 -- .../system/model/request/PostRequest.java | 78 --- .../system/model/request/UserRequest.java | 6 - .../cnadmin/system/model/vo/PostDetailVO.java | 77 --- .../cnadmin/system/model/vo/PostVO.java | 69 --- .../cnadmin/system/model/vo/UserDetailVO.java | 13 - .../cnadmin/system/service/PostService.java | 53 -- .../system/service/UserPostService.java | 56 -- .../system/service/impl/PostServiceImpl.java | 113 ---- .../service/impl/UserPostServiceImpl.java | 74 --- .../system/service/impl/UserServiceImpl.java | 9 - continew-admin-ui/src/api/common/index.ts | 10 - continew-admin-ui/src/api/system/post.ts | 54 -- continew-admin-ui/src/api/system/user.ts | 2 - continew-admin-ui/src/locale/en-US.ts | 2 - continew-admin-ui/src/locale/zh-CN.ts | 2 - .../src/router/routes/modules/system.ts | 10 - .../src/views/system/dept/index.vue | 2 +- .../src/views/system/post/index.vue | 548 ------------------ .../src/views/system/post/locale/en-US.ts | 3 - .../src/views/system/post/locale/zh-CN.ts | 3 - .../src/views/system/user/index.vue | 47 +- .../controller/common/CommonController.java | 12 - .../controller/system/PostController.java | 40 -- .../changelog/v0.0.1/continew-admin_data.sql | 23 +- .../changelog/v0.0.1/continew-admin_table.sql | 21 - 30 files changed, 4 insertions(+), 1551 deletions(-) delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/mapper/PostMapper.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/mapper/UserPostMapper.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/entity/PostDO.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/entity/UserPostDO.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/query/PostQuery.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/PostRequest.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/PostDetailVO.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/PostVO.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/PostService.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/UserPostService.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/PostServiceImpl.java delete mode 100644 continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserPostServiceImpl.java delete mode 100644 continew-admin-ui/src/api/system/post.ts delete mode 100644 continew-admin-ui/src/views/system/post/index.vue delete mode 100644 continew-admin-ui/src/views/system/post/locale/en-US.ts delete mode 100644 continew-admin-ui/src/views/system/post/locale/zh-CN.ts delete mode 100644 continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/PostController.java diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/mapper/PostMapper.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/mapper/PostMapper.java deleted file mode 100644 index 478d1000..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/mapper/PostMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.mapper; - -import top.charles7c.cnadmin.common.base.BaseMapper; -import top.charles7c.cnadmin.system.model.entity.PostDO; - -/** - * 岗位 Mapper - * - * @author Charles7c - * @since 2023/2/25 22:26 - */ -public interface PostMapper extends BaseMapper {} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/mapper/UserPostMapper.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/mapper/UserPostMapper.java deleted file mode 100644 index 803c7448..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/mapper/UserPostMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.mapper; - -import top.charles7c.cnadmin.common.base.BaseMapper; -import top.charles7c.cnadmin.system.model.entity.UserPostDO; - -/** - * 用户和岗位 Mapper - * - * @author Charles7c - * @since 2023/2/25 22:28 - */ -public interface UserPostMapper extends BaseMapper {} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/entity/PostDO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/entity/PostDO.java deleted file mode 100644 index a03b4c0f..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/entity/PostDO.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.model.entity; - -import lombok.Data; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; - -import top.charles7c.cnadmin.common.base.BaseDO; -import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; - -/** - * 岗位实体 - * - * @author Charles7c - * @since 2023/2/25 22:25 - */ -@Data -@TableName("sys_post") -public class PostDO extends BaseDO { - - private static final long serialVersionUID = 1L; - - /** - * 岗位 ID - */ - @TableId - private Long postId; - - /** - * 岗位名称 - */ - private String postName; - - /** - * 描述 - */ - private String description; - - /** - * 岗位排序 - */ - private Integer postSort; - - /** - * 状态(1启用 2禁用) - */ - private DisEnableStatusEnum status; -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/entity/UserPostDO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/entity/UserPostDO.java deleted file mode 100644 index 1638b0f2..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/entity/UserPostDO.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.model.entity; - -import java.io.Serializable; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import com.baomidou.mybatisplus.annotation.TableName; - -/** - * 用户和岗位实体 - * - * @author Charles7c - * @since 2023/2/25 22:28 - */ -@Data -@NoArgsConstructor -@TableName("sys_user_post") -public class UserPostDO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 用户 ID - */ - private Long userId; - - /** - * 岗位 ID - */ - private Long postId; - - public UserPostDO(Long userId, Long postId) { - this.userId = userId; - this.postId = postId; - } -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/query/PostQuery.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/query/PostQuery.java deleted file mode 100644 index 3e9fb71e..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/query/PostQuery.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.model.query; - -import java.io.Serializable; - -import lombok.Data; - -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springdoc.api.annotations.ParameterObject; - -import top.charles7c.cnadmin.common.annotation.Query; - -/** - * 岗位查询条件 - * - * @author Charles7c - * @since 2023/2/25 22:30 - */ -@Data -@ParameterObject -@Schema(description = "岗位查询条件") -public class PostQuery implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 岗位名称 - */ - @Schema(description = "岗位名称") - @Query(type = Query.Type.INNER_LIKE) - private String postName; - - /** - * 状态(1启用 2禁用) - */ - @Schema(description = "状态(1启用 2禁用)") - @Query - private Integer status; -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/PostRequest.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/PostRequest.java deleted file mode 100644 index ed8ac2aa..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/PostRequest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.model.request; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Null; - -import lombok.Data; - -import io.swagger.v3.oas.annotations.media.Schema; - -import org.hibernate.validator.constraints.Length; - -import top.charles7c.cnadmin.common.base.BaseRequest; -import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; - -/** - * 创建或修改岗位信息 - * - * @author Charles7c - * @since 2023/2/25 22:31 - */ -@Data -@Schema(description = "创建或修改岗位信息") -public class PostRequest extends BaseRequest { - - private static final long serialVersionUID = 1L; - - /** - * 岗位 ID - */ - @Schema(description = "岗位 ID") - @Null(message = "新增时,ID 必须为空", groups = Add.class) - @NotNull(message = "修改时,ID 不能为空", groups = Update.class) - private Long postId; - - /** - * 岗位名称 - */ - @Schema(description = "岗位名称") - @NotBlank(message = "岗位名称不能为空") - private String postName; - - /** - * 岗位排序 - */ - @Schema(description = "岗位排序") - @NotNull(message = "岗位排序不能为空") - private Integer postSort; - - /** - * 描述 - */ - @Schema(description = "描述") - @Length(max = 200, message = "描述长度不能超过 {max} 个字符") - private String description; - - /** - * 状态(1启用 2禁用) - */ - @Schema(description = "状态(1启用 2禁用)", type = "Integer", allowableValues = {"1", "2"}) - private DisEnableStatusEnum status; -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserRequest.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserRequest.java index 256b10f4..e321246d 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserRequest.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserRequest.java @@ -107,12 +107,6 @@ public class UserRequest extends BaseRequest { @NotNull(message = "所属部门不能为空") private Long deptId; - /** - * 岗位 ID 列表 - */ - @Schema(description = "所属岗位") - private List postIds; - /** * 角色 ID 列表 */ diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/PostDetailVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/PostDetailVO.java deleted file mode 100644 index f0b175a7..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/PostDetailVO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.model.vo; - -import lombok.Data; - -import io.swagger.v3.oas.annotations.media.Schema; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; - -import top.charles7c.cnadmin.common.base.BaseDetailVO; -import top.charles7c.cnadmin.common.config.easyexcel.ExcelBaseEnumConverter; -import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; - -/** - * 岗位详情信息 - * - * @author Charles7c - * @since 2023/2/25 22:35 - */ -@Data -@ExcelIgnoreUnannotated -@Schema(description = "岗位详情信息") -public class PostDetailVO extends BaseDetailVO { - - private static final long serialVersionUID = 1L; - - /** - * 岗位 ID - */ - @Schema(description = "岗位 ID") - @ExcelProperty(value = "岗位ID") - private Long postId; - - /** - * 岗位名称 - */ - @Schema(description = "岗位名称") - @ExcelProperty(value = "岗位名称") - private String postName; - - /** - * 岗位排序 - */ - @Schema(description = "岗位排序") - @ExcelProperty(value = "岗位排序") - private Integer postSort; - - /** - * 状态(1启用 2禁用) - */ - @Schema(description = "状态(1启用 2禁用)") - @ExcelProperty(value = "状态", converter = ExcelBaseEnumConverter.class) - private DisEnableStatusEnum status; - - /** - * 描述 - */ - @Schema(description = "描述") - @ExcelProperty(value = "描述") - private String description; -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/PostVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/PostVO.java deleted file mode 100644 index 9d1506b4..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/PostVO.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.model.vo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import io.swagger.v3.oas.annotations.media.Schema; - -import top.charles7c.cnadmin.common.base.BaseVO; -import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; - -/** - * 岗位信息 - * - * @author Charles7c - * @since 2023/2/25 22:34 - */ -@Data -@Accessors(chain = true) -@Schema(description = "岗位信息") -public class PostVO extends BaseVO { - - private static final long serialVersionUID = 1L; - - /** - * 岗位 ID - */ - @Schema(description = "岗位 ID") - private Long postId; - - /** - * 岗位名称 - */ - @Schema(description = "岗位名称") - private String postName; - - /** - * 岗位排序 - */ - @Schema(description = "岗位排序") - private Integer postSort; - - /** - * 状态(1启用 2禁用) - */ - @Schema(description = "状态(1启用 2禁用)") - private DisEnableStatusEnum status; - - /** - * 描述 - */ - @Schema(description = "描述") - private String description; -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/UserDetailVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/UserDetailVO.java index da52af81..88713d71 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/UserDetailVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/UserDetailVO.java @@ -126,19 +126,6 @@ public class UserDetailVO extends BaseDetailVO { @ExcelProperty(value = "所属部门") private String deptName; - /** - * 岗位 ID 列表 - */ - @Schema(description = "岗位 ID 列表") - private List postIds; - - /** - * 所属岗位 - */ - @Schema(description = "所属岗位") - @ExcelProperty(value = "所属岗位") - private String postNames; - /** * 角色 ID 列表 */ diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/PostService.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/PostService.java deleted file mode 100644 index b5e3548e..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/PostService.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.service; - -import java.util.List; - -import top.charles7c.cnadmin.common.base.BaseService; -import top.charles7c.cnadmin.common.model.vo.LabelValueVO; -import top.charles7c.cnadmin.system.model.query.PostQuery; -import top.charles7c.cnadmin.system.model.request.PostRequest; -import top.charles7c.cnadmin.system.model.vo.PostDetailVO; -import top.charles7c.cnadmin.system.model.vo.PostVO; - -/** - * 岗位业务接口 - * - * @author Charles7c - * @since 2023/2/25 22:38 - */ -public interface PostService extends BaseService { - - /** - * 构建字典 - * - * @param list - * 原始列表数据 - * @return 字典列表 - */ - List> buildDict(List list); - - /** - * 根据岗位 ID 列表查询 - * - * @param postIds - * 岗位 ID 列表 - * @return 岗位名称列表 - */ - List listPostNamesByPostIds(List postIds); -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/UserPostService.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/UserPostService.java deleted file mode 100644 index 1d6ce5f2..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/UserPostService.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.service; - -import java.util.List; - -/** - * 用户和岗位业务接口 - * - * @author Charles7c - * @since 2023/2/25 22:40 - */ -public interface UserPostService { - - /** - * 保存 - * - * @param postIds - * 岗位 ID 列表 - * @param userId - * 用户 ID - */ - void save(List postIds, Long userId); - - /** - * 根据岗位 ID 列表查询 - * - * @param postIds - * 岗位 ID 列表 - * @return 总记录数 - */ - Long countByPostIds(List postIds); - - /** - * 根据用户 ID 查询 - * - * @param userId - * 用户 ID - * @return 岗位 ID 列表 - */ - List listPostIdsByUserId(Long userId); -} \ No newline at end of file diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/PostServiceImpl.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/PostServiceImpl.java deleted file mode 100644 index bcf96f7c..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/PostServiceImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.service.impl; - -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import lombok.RequiredArgsConstructor; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import cn.hutool.core.collection.CollUtil; - -import top.charles7c.cnadmin.common.base.BaseServiceImpl; -import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; -import top.charles7c.cnadmin.common.model.vo.LabelValueVO; -import top.charles7c.cnadmin.common.util.validate.CheckUtils; -import top.charles7c.cnadmin.system.mapper.PostMapper; -import top.charles7c.cnadmin.system.model.entity.PostDO; -import top.charles7c.cnadmin.system.model.query.PostQuery; -import top.charles7c.cnadmin.system.model.request.PostRequest; -import top.charles7c.cnadmin.system.model.vo.*; -import top.charles7c.cnadmin.system.service.*; - -/** - * 岗位业务实现类 - * - * @author Charles7c - * @since 2023/2/25 22:38 - */ -@Service -@RequiredArgsConstructor -public class PostServiceImpl extends BaseServiceImpl - implements PostService { - - private final UserPostService userPostService; - - @Override - @Transactional(rollbackFor = Exception.class) - public Long add(PostRequest request) { - String postName = request.getPostName(); - boolean isExists = this.checkNameExists(postName, request.getPostId()); - CheckUtils.throwIf(() -> isExists, String.format("新增失败,'%s'已存在", postName)); - - // 新增岗位 - request.setStatus(DisEnableStatusEnum.ENABLE); - return super.add(request); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(PostRequest request) { - String postName = request.getPostName(); - boolean isExists = this.checkNameExists(postName, request.getPostId()); - CheckUtils.throwIf(() -> isExists, String.format("修改失败,'%s'已存在", postName)); - - // 更新岗位 - super.update(request); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(List ids) { - CheckUtils.throwIf(() -> userPostService.countByPostIds(ids) > 0, "所选岗位存在用户关联,请解除关联后重试"); - super.delete(ids); - } - - /** - * 检查名称是否存在 - * - * @param name - * 名称 - * @param id - * ID - * @return 是否存在 - */ - private boolean checkNameExists(String name, Long id) { - return super.lambdaQuery().eq(PostDO::getPostName, name).ne(id != null, PostDO::getPostId, id).exists(); - } - - @Override - public List> buildDict(List list) { - if (CollUtil.isEmpty(list)) { - return Collections.emptyList(); - } - return list.stream().map(p -> new LabelValueVO<>(p.getPostName(), p.getPostId())).collect(Collectors.toList()); - } - - @Override - public List listPostNamesByPostIds(List postIds) { - List postList = super.lambdaQuery().select(PostDO::getPostName).in(PostDO::getPostId, postIds).list(); - if (CollUtil.isEmpty(postList)) { - return Collections.emptyList(); - } - return postList.stream().map(PostDO::getPostName).collect(Collectors.toList()); - } -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserPostServiceImpl.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserPostServiceImpl.java deleted file mode 100644 index 53d15dd5..00000000 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserPostServiceImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.system.service.impl; - -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import lombok.RequiredArgsConstructor; - -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.core.toolkit.Wrappers; - -import cn.hutool.core.collection.CollUtil; - -import top.charles7c.cnadmin.system.mapper.UserPostMapper; -import top.charles7c.cnadmin.system.model.entity.UserPostDO; -import top.charles7c.cnadmin.system.service.UserPostService; - -/** - * 用户和岗位业务实现类 - * - * @author Charles7c - * @since 2023/2/25 22:40 - */ -@Service -@RequiredArgsConstructor -public class UserPostServiceImpl implements UserPostService { - - private final UserPostMapper userPostMapper; - - @Override - public void save(List postIds, Long userId) { - if (CollUtil.isEmpty(postIds)) { - return; - } - // 删除原有关联 - userPostMapper.delete(Wrappers.lambdaQuery().eq(UserPostDO::getUserId, userId)); - // 保存最新关联 - List userPostList = - postIds.stream().map(postId -> new UserPostDO(userId, postId)).collect(Collectors.toList()); - userPostMapper.insertBatch(userPostList); - } - - @Override - public Long countByPostIds(List postIds) { - return userPostMapper.selectCount(Wrappers.lambdaQuery().in(UserPostDO::getPostId, postIds)); - } - - @Override - public List listPostIdsByUserId(Long userId) { - List userPostList = userPostMapper.selectList( - Wrappers.lambdaQuery().select(UserPostDO::getPostId).eq(UserPostDO::getUserId, userId)); - if (CollUtil.isEmpty(userPostList)) { - return Collections.emptyList(); - } - return userPostList.stream().map(UserPostDO::getPostId).collect(Collectors.toList()); - } -} diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserServiceImpl.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserServiceImpl.java index 71cd2b7c..5dd4dfd9 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserServiceImpl.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserServiceImpl.java @@ -64,8 +64,6 @@ import top.charles7c.cnadmin.system.service.*; public class UserServiceImpl extends BaseServiceImpl implements UserService, CommonUserService { - private final UserPostService userPostService; - private final PostService postService; private final UserRoleService userRoleService; private final RoleService roleService; private final LocalStorageProperties localStorageProperties; @@ -85,8 +83,6 @@ public class UserServiceImpl extends BaseServiceImpl roleIds = userRoleService.listRoleIdsByUserId(detailVO.getUserId()); detailVO.setRoleIds(roleIds); detailVO.setRoleNames(String.join(",", roleService.listRoleNamesByRoleIds(roleIds))); - List postIds = userPostService.listPostIdsByUserId(detailVO.getUserId()); - detailVO.setPostIds(postIds); - detailVO.setPostNames(String.join(",", postService.listPostNamesByPostIds(postIds))); } } diff --git a/continew-admin-ui/src/api/common/index.ts b/continew-admin-ui/src/api/common/index.ts index bc344d70..bdadc8b5 100644 --- a/continew-admin-ui/src/api/common/index.ts +++ b/continew-admin-ui/src/api/common/index.ts @@ -3,7 +3,6 @@ import qs from 'query-string'; import { DeptParam } from '@/api/system/dept'; import { MenuParam } from '@/api/system/menu'; import { RoleParam } from '@/api/system/role'; -import { PostParam } from '@/api/system/post'; import { TreeNodeData } from '@arco-design/web-vue'; import { LabelValueState } from '@/store/modules/dict/types'; @@ -34,15 +33,6 @@ export function listRoleDict(params: RoleParam) { }); } -export function listPostDict(params: PostParam) { - return axios.get('/common/dict/post', { - params, - paramsSerializer: (obj) => { - return qs.stringify(obj); - }, - }); -} - export function listEnumDict(enumTypeName: string) { return axios.get(`/common/dict/enum/${enumTypeName}`); } diff --git a/continew-admin-ui/src/api/system/post.ts b/continew-admin-ui/src/api/system/post.ts deleted file mode 100644 index ff33ceb4..00000000 --- a/continew-admin-ui/src/api/system/post.ts +++ /dev/null @@ -1,54 +0,0 @@ -import axios from 'axios'; -import qs from 'query-string'; - -const BASE_URL = '/system/post'; - -export interface PostRecord { - postId?: number; - postName: string; - postSort?: number; - description?: string; - status?: number; - createUserString?: string; - createTime?: string; - updateUserString?: string; - updateTime?: string; -} - -export interface PostParam { - postName?: string; - status?: number; - page?: number; - size?: number; - sort?: Array; -} - -export interface PostListRes { - list: PostRecord[]; - total: number; -} - -export function listPost(params: PostParam) { - return axios.get(`${BASE_URL}`, { - params, - paramsSerializer: (obj) => { - return qs.stringify(obj); - }, - }); -} - -export function getPost(id: number) { - return axios.get(`${BASE_URL}/${id}`); -} - -export function addPost(req: PostRecord) { - return axios.post(BASE_URL, req); -} - -export function updatePost(req: PostRecord) { - return axios.put(BASE_URL, req); -} - -export function deletePost(ids: number | Array) { - return axios.delete(`${BASE_URL}/${ids}`); -} diff --git a/continew-admin-ui/src/api/system/user.ts b/continew-admin-ui/src/api/system/user.ts index a122dec9..e60945c9 100644 --- a/continew-admin-ui/src/api/system/user.ts +++ b/continew-admin-ui/src/api/system/user.ts @@ -19,8 +19,6 @@ export interface UserRecord { updateTime?: string; deptId?: number; deptName?: string; - postIds?: Array; - postNames?: Array; roleIds?: Array; roleNames?: Array; disabled?: boolean; diff --git a/continew-admin-ui/src/locale/en-US.ts b/continew-admin-ui/src/locale/en-US.ts index 3be651ac..10d1262e 100644 --- a/continew-admin-ui/src/locale/en-US.ts +++ b/continew-admin-ui/src/locale/en-US.ts @@ -4,7 +4,6 @@ import localeUser from '@/views/system/user/locale/en-US'; import localeRole from '@/views/system/role/locale/en-US'; import localeMenu from '@/views/system/menu/locale/en-US'; import localeDept from '@/views/system/dept/locale/en-US'; -import localePost from '@/views/system/post/locale/en-US'; import localeOnlineUser from '@/views/monitor/online/locale/en-US'; import localeLoginLog from '@/views/monitor/log/login/locale/en-US'; @@ -56,7 +55,6 @@ export default { ...localeRole, ...localeMenu, ...localeDept, - ...localePost, ...localeOnlineUser, ...localeLoginLog, diff --git a/continew-admin-ui/src/locale/zh-CN.ts b/continew-admin-ui/src/locale/zh-CN.ts index 81f81e5f..88774c06 100644 --- a/continew-admin-ui/src/locale/zh-CN.ts +++ b/continew-admin-ui/src/locale/zh-CN.ts @@ -4,7 +4,6 @@ import localeUser from '@/views/system/user/locale/zh-CN'; import localeRole from '@/views/system/role/locale/zh-CN'; import localeMenu from '@/views/system/menu/locale/zh-CN'; import localeDept from '@/views/system/dept/locale/zh-CN'; -import localePost from '@/views/system/post/locale/zh-CN'; import localeOnlineUser from '@/views/monitor/online/locale/zh-CN'; import localeLoginLog from '@/views/monitor/log/login/locale/zh-CN'; @@ -56,7 +55,6 @@ export default { ...localeRole, ...localeMenu, ...localeDept, - ...localePost, ...localeOnlineUser, ...localeLoginLog, diff --git a/continew-admin-ui/src/router/routes/modules/system.ts b/continew-admin-ui/src/router/routes/modules/system.ts index 8c82ce25..10405cba 100644 --- a/continew-admin-ui/src/router/routes/modules/system.ts +++ b/continew-admin-ui/src/router/routes/modules/system.ts @@ -52,16 +52,6 @@ const System: AppRouteRecordRaw = { roles: ['*'], }, }, - { - path: '/system/post', - name: 'Post', - component: () => import('@/views/system/post/index.vue'), - meta: { - locale: 'menu.system.post.list', - requiresAuth: true, - roles: ['*'], - }, - }, ], }; diff --git a/continew-admin-ui/src/views/system/dept/index.vue b/continew-admin-ui/src/views/system/dept/index.vue index eb7fc61a..e698f544 100644 --- a/continew-admin-ui/src/views/system/dept/index.vue +++ b/continew-admin-ui/src/views/system/dept/index.vue @@ -216,7 +216,7 @@ render-to-body @cancel="handleDetailCancel" > - + diff --git a/continew-admin-ui/src/views/system/post/index.vue b/continew-admin-ui/src/views/system/post/index.vue deleted file mode 100644 index a520abac..00000000 --- a/continew-admin-ui/src/views/system/post/index.vue +++ /dev/null @@ -1,548 +0,0 @@ - - - - - - - diff --git a/continew-admin-ui/src/views/system/post/locale/en-US.ts b/continew-admin-ui/src/views/system/post/locale/en-US.ts deleted file mode 100644 index d984aca1..00000000 --- a/continew-admin-ui/src/views/system/post/locale/en-US.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - 'menu.system.post.list': 'Post management', -}; diff --git a/continew-admin-ui/src/views/system/post/locale/zh-CN.ts b/continew-admin-ui/src/views/system/post/locale/zh-CN.ts deleted file mode 100644 index c5702f99..00000000 --- a/continew-admin-ui/src/views/system/post/locale/zh-CN.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - 'menu.system.post.list': '岗位管理', -}; diff --git a/continew-admin-ui/src/views/system/user/index.vue b/continew-admin-ui/src/views/system/user/index.vue index e1c97be7..178d906e 100644 --- a/continew-admin-ui/src/views/system/user/index.vue +++ b/continew-admin-ui/src/views/system/user/index.vue @@ -304,18 +304,6 @@ style="width: 416px" /> - - - - + @@ -428,24 +416,12 @@ {{ user.deptName }} - - - - - {{ user.postNames }} - {{ user.roleNames }} - - - - - {{ user.pwdResetTime }} - @@ -496,7 +472,7 @@ resetPassword, updateUserRole, } from '@/api/system/user'; - import { listDeptTree, listPostDict, listRoleDict } from '@/api/common'; + import { listDeptTree, listRoleDict } from '@/api/common'; import { LabelValueState } from '@/store/modules/dict/types'; import getAvatar from '@/utils/avatar'; @@ -533,10 +509,8 @@ const userRoleVisible = ref(false); const detailVisible = ref(false); const deptLoading = ref(false); - const postLoading = ref(false); const roleLoading = ref(false); const deptOptions = ref([]); - const postOptions = ref([]); const roleOptions = ref([]); const deptTree = ref([]); const deptName = ref(''); @@ -606,7 +580,6 @@ const toAdd = () => { reset(); getDeptOptions(); - getPostOptions(); getRoleOptions(); title.value = '新增用户'; visible.value = true; @@ -620,7 +593,6 @@ const toUpdate = (id: number) => { reset(); getDeptOptions(); - getPostOptions(); getRoleOptions(); getUser(id).then((res) => { form.value = res.data; @@ -657,20 +629,6 @@ }); }; - /** - * 查询岗位列表 - */ - const getPostOptions = () => { - postLoading.value = true; - listPostDict({}) - .then((res) => { - postOptions.value = res.data; - }) - .finally(() => { - postLoading.value = false; - }); - }; - /** * 查询角色列表 */ @@ -699,7 +657,6 @@ description: '', status: 1, deptId: undefined, - postIds: [] as Array, roleIds: [] as Array, }; proxy.$refs.formRef?.resetFields(); diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/common/CommonController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/common/CommonController.java index e099a820..9476e571 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/common/CommonController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/common/CommonController.java @@ -38,13 +38,10 @@ import top.charles7c.cnadmin.common.model.vo.R; import top.charles7c.cnadmin.monitor.annotation.Log; import top.charles7c.cnadmin.system.model.query.DeptQuery; import top.charles7c.cnadmin.system.model.query.MenuQuery; -import top.charles7c.cnadmin.system.model.query.PostQuery; import top.charles7c.cnadmin.system.model.query.RoleQuery; -import top.charles7c.cnadmin.system.model.vo.PostVO; import top.charles7c.cnadmin.system.model.vo.RoleVO; import top.charles7c.cnadmin.system.service.DeptService; import top.charles7c.cnadmin.system.service.MenuService; -import top.charles7c.cnadmin.system.service.PostService; import top.charles7c.cnadmin.system.service.RoleService; /** @@ -64,7 +61,6 @@ public class CommonController { private final DeptService deptService; private final MenuService menuService; private final RoleService roleService; - private final PostService postService; private final ContiNewAdminProperties properties; @Operation(summary = "查询部门树", description = "查询树结构的部门列表") @@ -89,14 +85,6 @@ public class CommonController { return R.ok(dictList); } - @Operation(summary = "查询岗位字典", description = "查询岗位字典列表") - @GetMapping("/dict/post") - public R>> listPostDict(@Validated PostQuery query, @Validated SortQuery sortQuery) { - List list = postService.list(query, sortQuery); - List> dictList = postService.buildDict(list); - return R.ok(dictList); - } - @Operation(summary = "查询枚举字典", description = "查询枚举字典列表") @GetMapping("/dict/enum/{enumTypeName}") public R> listEnumDict(@PathVariable String enumTypeName) { diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/PostController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/PostController.java deleted file mode 100644 index f984a66c..00000000 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/PostController.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package top.charles7c.cnadmin.webapi.controller.system; - -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.web.bind.annotation.RestController; - -import top.charles7c.cnadmin.common.annotation.CrudRequestMapping; -import top.charles7c.cnadmin.common.base.BaseController; -import top.charles7c.cnadmin.system.model.query.PostQuery; -import top.charles7c.cnadmin.system.model.request.PostRequest; -import top.charles7c.cnadmin.system.model.vo.PostDetailVO; -import top.charles7c.cnadmin.system.model.vo.PostVO; -import top.charles7c.cnadmin.system.service.PostService; - -/** - * 岗位管理 API - * - * @author Charles7c - * @since 2023/2/25 22:54 - */ -@Tag(name = "岗位管理 API") -@RestController -@CrudRequestMapping("/system/post") -public class PostController extends BaseController {} diff --git a/continew-admin-webapi/src/main/resources/db/changelog/v0.0.1/continew-admin_data.sql b/continew-admin-webapi/src/main/resources/db/changelog/v0.0.1/continew-admin_data.sql index 2525867e..e8590d81 100644 --- a/continew-admin-webapi/src/main/resources/db/changelog/v0.0.1/continew-admin_data.sql +++ b/continew-admin-webapi/src/main/resources/db/changelog/v0.0.1/continew-admin_data.sql @@ -25,11 +25,6 @@ INSERT IGNORE INTO `sys_menu` VALUES (1041, '部门新增', 1040, 3, NULL, NULL, INSERT IGNORE INTO `sys_menu` VALUES (1042, '部门修改', 1040, 3, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'system:dept:update', 2, 1, 1, NOW(), 1, NOW()); INSERT IGNORE INTO `sys_menu` VALUES (1043, '部门删除', 1040, 3, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'system:dept:delete', 3, 1, 1, NOW(), 1, NOW()); INSERT IGNORE INTO `sys_menu` VALUES (1044, '部门导出', 1040, 3, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'system:dept:export', 4, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_menu` VALUES (1050, '岗位管理', 1000, 2, '/system/post', 'Post', '/system/post/index', NULL, b'0', b'0', b'0', 'system:post:list', 5, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_menu` VALUES (1051, '岗位新增', 1050, 3, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'system:post:add', 1, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_menu` VALUES (1052, '岗位修改', 1050, 3, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'system:post:update', 2, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_menu` VALUES (1053, '岗位删除', 1050, 3, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'system:post:delete', 3, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_menu` VALUES (1054, '岗位导出', 1050, 3, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'system:post:export', 4, 1, 1, NOW(), 1, NOW()); INSERT IGNORE INTO `sys_menu` VALUES (2000, '系统监控', 0, 1, 'monitor', NULL, NULL, 'computer', b'0', b'0', b'0', NULL, 2, 1, 1, NOW(), 1, NOW()); INSERT IGNORE INTO `sys_menu` VALUES (2010, '在线用户', 2000, 2, '/monitor/online', 'OnlineUser', 'monitor/online/index', NULL, b'0', b'0', b'0', 'monitor:online:user:list', 1, 1, 1, NOW(), 1, NOW()); INSERT IGNORE INTO `sys_menu` VALUES (2011, '强退用户', 2010, 3, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'monitor:online:user:delete', 1, 1, 1, NOW(), 1, NOW()); @@ -49,18 +44,6 @@ INSERT IGNORE INTO `sys_dept` VALUES (6, '运维部', 2, '系统初始部门', 4 INSERT IGNORE INTO `sys_dept` VALUES (7, '研发一组', 3, '系统初始部门', 1, 1, 1, NOW(), 1, NOW()); INSERT IGNORE INTO `sys_dept` VALUES (8, '研发二组', 3, '系统初始部门', 2, 2, 1, NOW(), 1, NOW()); --- 初始化默认岗位 -INSERT IGNORE INTO `sys_post` VALUES (1, '项目总监', '系统初始岗位', 1, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (2, '技术总监', '系统初始岗位', 2, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (3, '销售经理', '系统初始岗位', 3, 2, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (4, '项目经理', '系统初始岗位', 4, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (5, '产品经理', '系统初始岗位', 5, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (6, '技术经理', '系统初始岗位', 6, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (7, '测试经理', '系统初始岗位', 7, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (8, '销售专员', '系统初始岗位', 8, 2, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (9, '软件开发', '系统初始岗位', 9, 1, 1, NOW(), 1, NOW()); -INSERT IGNORE INTO `sys_post` VALUES (10, '软件测试', '系统初始岗位', 10, 1, 1, NOW(), 1, NOW()); - -- 初始化默认角色 INSERT IGNORE INTO `sys_role` VALUES (1, '超级管理员', 'admin', 1, '系统初始角色', 1, 1, 1, NOW(), 1, NOW()); INSERT IGNORE INTO `sys_role` VALUES (2, '测试人员', 'test', 5, '系统初始角色', 2, 2, 1, NOW(), 1, NOW()); @@ -92,8 +75,4 @@ INSERT IGNORE INTO `sys_role_dept` VALUES (2, 5); -- 初始化默认用户和角色关联数据 INSERT IGNORE INTO `sys_user_role` VALUES (1, 1); -INSERT IGNORE INTO `sys_user_role` VALUES (2, 2); - --- 初始化默认用户和岗位关联数据 -INSERT IGNORE INTO `sys_user_post` VALUES (1, 1); -INSERT IGNORE INTO `sys_user_post` VALUES (2, 10); \ No newline at end of file +INSERT IGNORE INTO `sys_user_role` VALUES (2, 2); \ No newline at end of file diff --git a/continew-admin-webapi/src/main/resources/db/changelog/v0.0.1/continew-admin_table.sql b/continew-admin-webapi/src/main/resources/db/changelog/v0.0.1/continew-admin_table.sql index 6e091b44..5d71c74f 100644 --- a/continew-admin-webapi/src/main/resources/db/changelog/v0.0.1/continew-admin_table.sql +++ b/continew-admin-webapi/src/main/resources/db/changelog/v0.0.1/continew-admin_table.sql @@ -72,21 +72,6 @@ CREATE TABLE IF NOT EXISTS `sys_role_dept` ( PRIMARY KEY (`role_id`,`dept_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和部门关联表'; -CREATE TABLE IF NOT EXISTS `sys_post` ( - `post_id` bigint(20) unsigned AUTO_INCREMENT COMMENT '岗位ID', - `post_name` varchar(255) NOT NULL COMMENT '岗位名称', - `description` varchar(512) DEFAULT NULL COMMENT '描述', - `post_sort` int(11) unsigned DEFAULT 999 COMMENT '岗位排序', - `status` tinyint(1) unsigned DEFAULT 1 COMMENT '状态(1启用 2禁用)', - `create_user` bigint(20) unsigned NOT NULL COMMENT '创建人', - `create_time` datetime NOT NULL COMMENT '创建时间', - `update_user` bigint(20) unsigned NOT NULL COMMENT '修改人', - `update_time` datetime NOT NULL COMMENT '修改时间', - PRIMARY KEY (`post_id`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='岗位表'; - CREATE TABLE IF NOT EXISTS `sys_user` ( `user_id` bigint(20) unsigned AUTO_INCREMENT COMMENT '用户ID', `username` varchar(255) NOT NULL COMMENT '用户名', @@ -118,12 +103,6 @@ CREATE TABLE IF NOT EXISTS `sys_user_role` ( PRIMARY KEY (`user_id`,`role_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户和角色关联表'; -CREATE TABLE IF NOT EXISTS `sys_user_post` ( - `user_id` bigint(20) unsigned NOT NULL COMMENT '用户ID', - `post_id` bigint(20) unsigned NOT NULL COMMENT '岗位ID', - PRIMARY KEY (`user_id`,`post_id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户和岗位关联表'; - CREATE TABLE IF NOT EXISTS `sys_log` ( `log_id` bigint(20) unsigned AUTO_INCREMENT COMMENT '日志ID', `description` varchar(255) NOT NULL COMMENT '日志描述',