From bac17f1c836b91d0f7920b56b3cc3542bb75c3c6 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sat, 11 Feb 2023 17:19:34 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/enumeration/ProjectStatusEnum.java | 8 ++++---- .../ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java index 9631f37..dd2b85b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java @@ -56,10 +56,6 @@ public enum ProjectStatusEnum { */ ARCHIVED(30000, "已归档"); - public static void main(String[] args) { - System.out.println(Arrays.stream(ProjectStatusEnum.values()).filter(w -> w.getCode() >= 10010).collect(Collectors.toList())); - } - private Integer code; private String desc; @@ -87,4 +83,8 @@ public enum ProjectStatusEnum { return null; } + public boolean eq(int code) { + return this.getCode().equals(code); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index b5c2ec5..ebb0435 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -76,8 +76,7 @@ public class AnnualPlanLibManage { item.setDeclaredAmount(w.getDeclareAmount()); item.setBuildOrg(w.getBuildOrgName()); item.setCreateOn(w.getCreateOn()); - // TODO 是否开启项目申报 - item.setIsStartDeclaredProject(true); + item.setIsStartDeclaredProject(!IN_THE_ANNUAL_PLAN.eq(w.getStatus())); result.getRecords().add(item); }); return result; From d6e78e3f0a37cc673a95e9847d894406eed326ae Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sun, 12 Feb 2023 12:09:38 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=BC=80=E5=90=AF=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/common/config/BeanConfig.java | 1 - .../common/enumeration/ProjectProessStageEnum.java | 22 + .../pmapi/common/enums/ProjectProessStageEnum.java | 22 - .../com/ningdatech/pmapi/common/util/BizUtils.java | 53 +++ .../com/ningdatech/pmapi/common/util/TreeUtil.java | 442 +++++++++++++++++++++ .../ningdatech/pmapi/common/utils/BizUtils.java | 53 --- .../ningdatech/pmapi/common/utils/TreeUtil.java | 442 --------------------- .../manage/DeclaredProjectManage.java | 2 +- .../controller/AnnualPlanController.java | 13 +- .../projectlib/manage/AnnualPlanLibManage.java | 24 ++ .../model/req/StartProjectDeclareReq.java | 25 ++ .../pmapi/sys/controller/MenuController.java | 2 +- .../ningdatech/pmapi/sys/manage/MenuManage.java | 2 +- .../ningdatech/pmapi/sys/manage/NoticeManage.java | 2 +- .../controller/TodoCenterController.java | 2 - .../enumeration/IsAppendProjectEnum.java | 70 ++++ .../todocenter/enumeration/ProcessStatusEnum.java | 97 +++++ .../todocenter/enums/IsAppendProjectEnum.java | 70 ---- .../pmapi/todocenter/enums/ProcessStatusEnum.java | 97 ----- .../pmapi/todocenter/manage/TodoCenterManage.java | 4 +- 20 files changed, 749 insertions(+), 696 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/utils/BizUtils.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/utils/TreeUtil.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/StartProjectDeclareReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/IsAppendProjectEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/ProcessStatusEnum.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/IsAppendProjectEnum.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/ProcessStatusEnum.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java index 93bfd09..315f77a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java @@ -3,7 +3,6 @@ package com.ningdatech.pmapi.common.config; import com.alibaba.xxpt.gateway.shared.client.http.ExecutableClient; import com.ningdatech.pmapi.common.util.SpringContextHolder; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.DependsOn; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java new file mode 100644 index 0000000..99cc654 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java @@ -0,0 +1,22 @@ +package com.ningdatech.pmapi.common.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public enum ProjectProessStageEnum { + /** + * 项目流程配置 阶段枚举 + */ + ORG_INTERNAL_APPROVAL_PROCESS(1,"单位内部审批流程"), + PROJECT_PREQUALIFICATION_APPROVAL_PROCESS(2,"项目预审审批流程"), + DEPARTMENT_JOINT_APPROVAL_PROCESS(3,"部门联合审批流程"), + CONSTRUCTION_PROJECT_APPROVAL_PROCESS(4,"建设方案审批流程"), + ACCEPTANCE_DECLARATION_APPROVAL_PROCESS(5,"验收申报审批流程"); + + private Integer code; + private String desc; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java deleted file mode 100644 index 3b7ad16..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.ningdatech.pmapi.common.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; - -@Getter -@AllArgsConstructor -@NoArgsConstructor -public enum ProjectProessStageEnum { - /** - * 项目流程配置 阶段枚举 - */ - ORG_INTERNAL_APPROVAL_PROCESS(1,"单位内部审批流程"), - PROJECT_PREQUALIFICATION_APPROVAL_PROCESS(2,"项目预审审批流程"), - DEPARTMENT_JOINT_APPROVAL_PROCESS(3,"部门联合审批流程"), - CONSTRUCTION_PROJECT_APPROVAL_PROCESS(4,"建设方案审批流程"), - ACCEPTANCE_DECLARATION_APPROVAL_PROCESS(5,"验收申报审批流程"); - - private Integer code; - private String desc; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java new file mode 100644 index 0000000..136dfa8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java @@ -0,0 +1,53 @@ +package com.ningdatech.pmapi.common.util; + +import cn.hutool.core.util.StrUtil; +import com.ningdatech.basic.util.StrPool; +import org.springframework.util.NumberUtils; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +/** + *

+ * BizUtils + *

+ * + * @author WendyYang + * @since 17:32 2023/1/29 + */ +public class BizUtils { + + private BizUtils() { + + } + + public static List splitToNum(String str, Class aClass) { + if (StrUtil.isEmpty(str)) { + return Collections.emptyList(); + } + return Arrays.stream(str.split(StrPool.COMMA)) + .map(w -> NumberUtils.parseNumber(w, aClass)) + .collect(Collectors.toList()); + } + + public static List splitToLong(String str) { + return splitToNum(str, Long.class); + } + + + public static void notNull(T obj, Consumer consumer) { + if (obj != null) { + consumer.accept(obj); + } + } + + public static void notBlank(String str,Consumer consumer) { + if (StrUtil.isNotBlank(str)) { + consumer.accept(str); + } + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java new file mode 100644 index 0000000..e75eeb3 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java @@ -0,0 +1,442 @@ +package com.ningdatech.pmapi.common.util; + + +import cn.hutool.core.collection.CollUtil; +import com.google.common.collect.Maps; +import com.ningdatech.basic.util.StrPool; +import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; +import com.ningdatech.pmapi.sys.entity.RoleMenu; +import com.ningdatech.pmapi.sys.entity.vo.MenuRoleVO; +import org.apache.commons.lang3.StringUtils; + +import java.io.Serializable; +import java.util.*; +import java.util.stream.Collectors; + +/** + * list列表 转换成tree列表 + * + * @author PoffyZhang + */ +public final class TreeUtil { + private TreeUtil() { + } + + private static Map nodeMap = Maps.newConcurrentMap(); + + /** + * 判断id是否为根节点 + * + * @param id + * @return + */ + public static boolean isRoot(Long id) { + return id == null || StrPool.DEF_PARENT_ID.equals(id); + } + + + public static String getTreePath(String parentTreePath, Long parentId) { + return StrPool.COMMA + parentId + parentTreePath; + } + + /** + * 构建Tree结构 + * + * @param treeList 待转换的集合 + * @return 树结构 + */ + public static > List buildTree(List treeList) { + if (CollUtil.isEmpty(treeList)) { + return treeList; + } + //记录自己是自己的父节点的id集合 + List selfIdEqSelfParent = new ArrayList<>(); + + // 遍历两次 + foreachNodes(treeList, selfIdEqSelfParent); + foreachNodesWithTopMenu(treeList); + + // 找出根节点集合 + List trees = new ArrayList<>(); + + List allIds = treeList.stream().map(node -> node.getId()).collect(Collectors.toList()); + for (E baseNode : treeList) { + if (!allIds.contains(baseNode.getPid()) || selfIdEqSelfParent.contains(baseNode.getPid())) { + baseNode.setPid(null); + baseNode.setTopMenu(baseNode.getName()); + trees.add(baseNode); + } + } + return trees; + } + + /** + * 构建Tree结构 + * + * @param treeList 待转换的集合 + * @param title 菜单名 + * @return 树结构 + */ + public static > List buildTree(List treeList, String title) { + if (CollUtil.isEmpty(treeList)) { + return treeList; + } + //记录自己是自己的父节点的id集合 + List selfIdEqSelfParent = new ArrayList<>(); + + // 遍历两次 + foreachNodes(treeList, selfIdEqSelfParent); + foreachNodesWithTopMenu(treeList); + + // 找出根节点集合 + List trees = new ArrayList<>(); + + List allIds = treeList.stream().map(node -> node.getId()).collect(Collectors.toList()); + for (E baseNode : treeList) { + if (!allIds.contains(baseNode.getPid()) || selfIdEqSelfParent.contains(baseNode.getPid())) { + baseNode.setPid(null); + baseNode.setTopMenu(baseNode.getName()); + trees.add(baseNode); + } + } +// checkTitle(trees,title); + return trees; + } + + private static > + void foreachNodes(List treeList, List selfIdEqSelfParent) { + nodeMap = Maps.newConcurrentMap(); + for (E parent : treeList) { + Serializable id = parent.getId(); + nodeMap.put(parent.getId(), parent); + for (E children : treeList) { + if (parent != children) { + //parent != children 这个来判断自己的孩子不允许是自己,因为有时候,根节点的parent会被设置成为自己 + if (id.equals(children.getPid())) { + parent.initChildren(); + if (0L == parent.getPid()) { + children.setTopMenu(parent.getName()); + children.setLevel(2); + } else { + children.setTopMenu(parent.getTopMenu()); + children.setLevel(parent.getLevel() + 1); + } + parent.getChildren().add(children); + } + } else if (id.equals(parent.getPid())) { + selfIdEqSelfParent.add(id); + } + } + } + } + + private static > void foreachNodesWithTopMenu(List treeList) { + for (E parent : treeList) { + Serializable id = parent.getId(); + for (E children : treeList) { + if (parent != children) { + if (id.equals(children.getPid())) { + if (0L == parent.getPid()) { + children.setTopMenu(parent.getName()); + children.setLevel(2); + } else { + children.setTopMenu(parent.getTopMenu()); + children.setLevel(parent.getLevel() + 1); + } + } + } + } + } + } + + private static > + void checkTitle(List trees, String title) { + if (StringUtils.isBlank(title)) { + return; + } + for (E tree : trees) { + //筛选 从顶级往下查 + //递归筛选 + checkTitleNode(tree, title, trees, trees); + } + } + + private static > void checkTitleNode(MenuTreeEntity node, String title, List parents, List tops) { + if (!node.getTitle().contains(title)) { + if (CollUtil.isEmpty(node.getChildren())) { + removeNode(parents, node, tops); + } else { + Iterator iterator = node.getChildren().iterator(); + while (iterator.hasNext()) { + checkTitleNode(iterator.next(), title, node.getChildren(), tops); + } + } + } else { + //匹配到了 + return; + } + } + + private static > + void removeNode(List parents, MenuTreeEntity node, List tops) { + parents.remove(node); + //如果该层节点都被删了 要删除父级 + if (Objects.nonNull(node.getPid())) { + MenuTreeEntity parent = nodeMap.get(node.getPid()); + if (Objects.nonNull(parent)) { + if (Objects.nonNull(parent.getPid())) { + MenuTreeEntity parentN = nodeMap.get(parent.getPid()); + removeNode(parentN.getChildren(), parent, tops); + } else { + tops.remove(parent); + } + } + } else { + tops.remove(node); + } + } + + public static List buildTree(List treeList, List roleMenus) { + if (CollUtil.isEmpty(treeList)) { + return treeList; + } + //记录自己是自己的父节点的id集合 + List selfIdEqSelfParent = new ArrayList<>(); + + // 遍历两次 + foreachNodesCheckRoleWithoutParent(treeList, selfIdEqSelfParent, roleMenus); + foreachNodesWithTopMenu(treeList); + + // 找出根节点集合 + List trees = new ArrayList<>(); + + List allIds = treeList.stream().map(MenuRoleVO::getId).collect(Collectors.toList()); + for (MenuRoleVO baseNode : treeList) { + if (!allIds.contains(baseNode.getPid()) || selfIdEqSelfParent.contains(baseNode.getPid())) { + baseNode.setPid(null); + for (RoleMenu roleMenu : roleMenus) { + if (baseNode.getId().equals(roleMenu.getMenuId()) && + 2 != baseNode.getHasPermission()) { + baseNode.setTopMenu(baseNode.getName()); + trees.add(baseNode); + } + } + } + } + return trees; + } + + private static void foreachNodesWithRole(List treeList, + List selfIdEqSelfParent, List roleMenus) { + nodeMap = Maps.newConcurrentMap(); + for (MenuRoleVO parent : treeList) { + Serializable id = parent.getId(); + nodeMap.put(parent.getId(), parent); + for (MenuRoleVO children : treeList) { + if (parent != children) { + //parent != children 这个来判断自己的孩子不允许是自己,因为有时候,根节点的parent会被设置成为自己 + if (id.equals(children.getPid())) { + parent.initChildren(); + if (0L == parent.getPid()) { + children.setTopMenu(parent.getPath()); + children.setLevel(2); + } else { + children.setTopMenu(parent.getTopMenu()); + children.setLevel(parent.getLevel() + 1); + } + parent.getChildren().add(children); + } + } else if (id.equals(parent.getPid())) { + selfIdEqSelfParent.add(id); + } + + for (RoleMenu roleMenu : roleMenus) { + if (children.getId().equals(roleMenu.getMenuId())) { + children.setHasPermission(1); + } + } + } + } + } + + public static List buildUserTree(List treeList, List roleMenus) { + if (CollUtil.isEmpty(treeList)) { + return Collections.emptyList(); + } + //记录自己是自己的父节点的id集合 + List selfIdEqSelfParent = new ArrayList<>(); + + // 遍历两次 + foreachNodesCheckRole(treeList, selfIdEqSelfParent, roleMenus); + foreachNodesWithTopMenu(treeList); + + // 找出根节点集合 + List trees = new ArrayList<>(); + + List allIds = treeList.stream().map(node -> node.getId()).collect(Collectors.toList()); + for (MenuRoleVO baseNode : treeList) { + if (!allIds.contains(baseNode.getPid()) || selfIdEqSelfParent.contains(baseNode.getPid())) { + baseNode.setPid(null); + Boolean isUserMenu = checkPermisson(baseNode.getId(), roleMenus); + if (isUserMenu) { + baseNode.setTopMenu(baseNode.getName()); + checkRedirect(baseNode); + trees.add(baseNode); + } else { + if (baseNode.getSize() > 0) { + baseNode.setTopMenu(baseNode.getName()); + checkRedirect(baseNode); + trees.add(baseNode); + } + } + } + } + return trees; + } + + //判断角色权限用 不用父级 + private static void foreachNodesCheckRoleWithoutParent(List treeList, List selfIdEqSelfParent, List roleMenus) { + nodeMap = Maps.newConcurrentMap(); + for (MenuRoleVO parent : treeList) { + Serializable id = parent.getId(); + nodeMap.put(parent.getId(), parent); + for (MenuRoleVO children : treeList) { + if (parent != children) { + //parent != children 这个来判断自己的孩子不允许是自己,因为有时候,根节点的parent会被设置成为自己 + if (id.equals(children.getPid())) { + parent.initChildren(); + + if (!checkPermisson(children.getId(), roleMenus)) { + continue; + } + + if (0L == parent.getPid()) { + children.setTopMenu(parent.getName()); + children.setLevel(2); + } else { + children.setTopMenu(parent.getTopMenu()); + children.setLevel(parent.getLevel() + 1); + } + parent.getChildren().add(children); + } + } else if (id.equals(parent.getPid())) { + selfIdEqSelfParent.add(id); + } + + for (RoleMenu roleMenu : roleMenus) { + if (children.getId().equals(roleMenu.getMenuId())) { + children.setHasPermission(1); + } + } + } + } + } + + //判断当前登录权限用 + private static void foreachNodesCheckRole(List treeList, List selfIdEqSelfParent, List roleMenus) { + nodeMap = Maps.newConcurrentMap(); + for (MenuRoleVO parent : treeList) { + Serializable id = parent.getId(); + nodeMap.put(parent.getId(), parent); + for (MenuRoleVO children : treeList) { + if (parent != children) { + //parent != children 这个来判断自己的孩子不允许是自己,因为有时候,根节点的parent会被设置成为自己 + if (id.equals(children.getPid())) { + parent.initChildren(); + + if (!checkPermisson(children.getId(), roleMenus)) { + continue; + } + + if (0L == parent.getPid()) { + children.setTopMenu(parent.getName()); + children.setLevel(2); + } else { + children.setTopMenu(parent.getTopMenu()); + children.setLevel(parent.getLevel() + 1); + } + parent.getChildren().add(children); + } + } else if (id.equals(parent.getPid())) { + selfIdEqSelfParent.add(id); + } + } + + //1层 2层 再加一下 + for (MenuRoleVO children : treeList) { + if (parent != children) { + if (id.equals(children.getPid())) { + + if (parent.getChildren().contains(children) || + children.getSize() == 0) { + continue; + } + + if (0L == parent.getPid()) { + children.setTopMenu(parent.getName()); + children.setLevel(2); + } else { + children.setTopMenu(parent.getTopMenu()); + children.setLevel(parent.getLevel() + 1); + } + parent.getChildren().add(children); + } + } + } + } + } + + /** + * 判断角色是否有该菜单权限 + * + * @param roleId + * @param roleMenus + * @return + */ + private static Boolean checkPermisson(Long roleId, List roleMenus) { + Boolean isUserMenu = false; + for (RoleMenu roleMenu : roleMenus) { + if (roleId.equals(roleMenu.getMenuId())) { + isUserMenu = true; + break; + } + } + return isUserMenu; + } + + /** + * 动态判断redirect + * + * @param baseNode + */ + private static void checkRedirect(MenuRoleVO baseNode) { + checkMenuRedirect(baseNode, baseNode.getChildren()); + } + + private static Boolean checkMenuRedirect(MenuRoleVO baseNode, List menus) { + if (baseNode.getSize() > 0) { + for (MenuRoleVO menu : menus) { + if (menu.getPath().endsWith("Datav")) { + baseNode.setRedirect(menu.getComponent()); + return Boolean.TRUE; + } + + if (menu.getSize() == 0 && 0 == menu.getHidden()) { + baseNode.setRedirect(menu.getComponent()); + return Boolean.TRUE; + } + } + + //一轮没有合适的菜单 去三级菜单找 + for (MenuRoleVO menu : menus) { + if (menu.getSize() > 0) { + if (checkMenuRedirect(baseNode, menu.getChildren())) { + return Boolean.TRUE; + } + } + } + } + + return Boolean.FALSE; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/utils/BizUtils.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/utils/BizUtils.java deleted file mode 100644 index 20cf2f1..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/utils/BizUtils.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ningdatech.pmapi.common.utils; - -import cn.hutool.core.util.StrUtil; -import com.ningdatech.basic.util.StrPool; -import org.springframework.util.NumberUtils; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.function.Consumer; -import java.util.stream.Collectors; - -/** - *

- * BizUtils - *

- * - * @author WendyYang - * @since 17:32 2023/1/29 - */ -public class BizUtils { - - private BizUtils() { - - } - - public static List splitToNum(String str, Class aClass) { - if (StrUtil.isEmpty(str)) { - return Collections.emptyList(); - } - return Arrays.stream(str.split(StrPool.COMMA)) - .map(w -> NumberUtils.parseNumber(w, aClass)) - .collect(Collectors.toList()); - } - - public static List splitToLong(String str) { - return splitToNum(str, Long.class); - } - - - public static void notNull(T obj, Consumer consumer) { - if (obj != null) { - consumer.accept(obj); - } - } - - public static void notBlank(String str,Consumer consumer) { - if (StrUtil.isNotBlank(str)) { - consumer.accept(str); - } - } - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/utils/TreeUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/utils/TreeUtil.java deleted file mode 100644 index 1359135..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/utils/TreeUtil.java +++ /dev/null @@ -1,442 +0,0 @@ -package com.ningdatech.pmapi.common.utils; - - -import cn.hutool.core.collection.CollUtil; -import com.google.common.collect.Maps; -import com.ningdatech.basic.util.StrPool; -import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; -import com.ningdatech.pmapi.sys.entity.RoleMenu; -import com.ningdatech.pmapi.sys.entity.vo.MenuRoleVO; -import org.apache.commons.lang3.StringUtils; - -import java.io.Serializable; -import java.util.*; -import java.util.stream.Collectors; - -/** - * list列表 转换成tree列表 - * - * @author PoffyZhang - */ -public final class TreeUtil { - private TreeUtil() { - } - - private static Map nodeMap = Maps.newConcurrentMap(); - - /** - * 判断id是否为根节点 - * - * @param id - * @return - */ - public static boolean isRoot(Long id) { - return id == null || StrPool.DEF_PARENT_ID.equals(id); - } - - - public static String getTreePath(String parentTreePath, Long parentId) { - return StrPool.COMMA + parentId + parentTreePath; - } - - /** - * 构建Tree结构 - * - * @param treeList 待转换的集合 - * @return 树结构 - */ - public static > List buildTree(List treeList) { - if (CollUtil.isEmpty(treeList)) { - return treeList; - } - //记录自己是自己的父节点的id集合 - List selfIdEqSelfParent = new ArrayList<>(); - - // 遍历两次 - foreachNodes(treeList, selfIdEqSelfParent); - foreachNodesWithTopMenu(treeList); - - // 找出根节点集合 - List trees = new ArrayList<>(); - - List allIds = treeList.stream().map(node -> node.getId()).collect(Collectors.toList()); - for (E baseNode : treeList) { - if (!allIds.contains(baseNode.getPid()) || selfIdEqSelfParent.contains(baseNode.getPid())) { - baseNode.setPid(null); - baseNode.setTopMenu(baseNode.getName()); - trees.add(baseNode); - } - } - return trees; - } - - /** - * 构建Tree结构 - * - * @param treeList 待转换的集合 - * @param title 菜单名 - * @return 树结构 - */ - public static > List buildTree(List treeList, String title) { - if (CollUtil.isEmpty(treeList)) { - return treeList; - } - //记录自己是自己的父节点的id集合 - List selfIdEqSelfParent = new ArrayList<>(); - - // 遍历两次 - foreachNodes(treeList, selfIdEqSelfParent); - foreachNodesWithTopMenu(treeList); - - // 找出根节点集合 - List trees = new ArrayList<>(); - - List allIds = treeList.stream().map(node -> node.getId()).collect(Collectors.toList()); - for (E baseNode : treeList) { - if (!allIds.contains(baseNode.getPid()) || selfIdEqSelfParent.contains(baseNode.getPid())) { - baseNode.setPid(null); - baseNode.setTopMenu(baseNode.getName()); - trees.add(baseNode); - } - } -// checkTitle(trees,title); - return trees; - } - - private static > - void foreachNodes(List treeList, List selfIdEqSelfParent) { - nodeMap = Maps.newConcurrentMap(); - for (E parent : treeList) { - Serializable id = parent.getId(); - nodeMap.put(parent.getId(), parent); - for (E children : treeList) { - if (parent != children) { - //parent != children 这个来判断自己的孩子不允许是自己,因为有时候,根节点的parent会被设置成为自己 - if (id.equals(children.getPid())) { - parent.initChildren(); - if (0L == parent.getPid()) { - children.setTopMenu(parent.getName()); - children.setLevel(2); - } else { - children.setTopMenu(parent.getTopMenu()); - children.setLevel(parent.getLevel() + 1); - } - parent.getChildren().add(children); - } - } else if (id.equals(parent.getPid())) { - selfIdEqSelfParent.add(id); - } - } - } - } - - private static > void foreachNodesWithTopMenu(List treeList) { - for (E parent : treeList) { - Serializable id = parent.getId(); - for (E children : treeList) { - if (parent != children) { - if (id.equals(children.getPid())) { - if (0L == parent.getPid()) { - children.setTopMenu(parent.getName()); - children.setLevel(2); - } else { - children.setTopMenu(parent.getTopMenu()); - children.setLevel(parent.getLevel() + 1); - } - } - } - } - } - } - - private static > - void checkTitle(List trees, String title) { - if (StringUtils.isBlank(title)) { - return; - } - for (E tree : trees) { - //筛选 从顶级往下查 - //递归筛选 - checkTitleNode(tree, title, trees, trees); - } - } - - private static > void checkTitleNode(MenuTreeEntity node, String title, List parents, List tops) { - if (!node.getTitle().contains(title)) { - if (CollUtil.isEmpty(node.getChildren())) { - removeNode(parents, node, tops); - } else { - Iterator iterator = node.getChildren().iterator(); - while (iterator.hasNext()) { - checkTitleNode(iterator.next(), title, node.getChildren(), tops); - } - } - } else { - //匹配到了 - return; - } - } - - private static > - void removeNode(List parents, MenuTreeEntity node, List tops) { - parents.remove(node); - //如果该层节点都被删了 要删除父级 - if (Objects.nonNull(node.getPid())) { - MenuTreeEntity parent = nodeMap.get(node.getPid()); - if (Objects.nonNull(parent)) { - if (Objects.nonNull(parent.getPid())) { - MenuTreeEntity parentN = nodeMap.get(parent.getPid()); - removeNode(parentN.getChildren(), parent, tops); - } else { - tops.remove(parent); - } - } - } else { - tops.remove(node); - } - } - - public static List buildTree(List treeList, List roleMenus) { - if (CollUtil.isEmpty(treeList)) { - return treeList; - } - //记录自己是自己的父节点的id集合 - List selfIdEqSelfParent = new ArrayList<>(); - - // 遍历两次 - foreachNodesCheckRoleWithoutParent(treeList, selfIdEqSelfParent, roleMenus); - foreachNodesWithTopMenu(treeList); - - // 找出根节点集合 - List trees = new ArrayList<>(); - - List allIds = treeList.stream().map(MenuRoleVO::getId).collect(Collectors.toList()); - for (MenuRoleVO baseNode : treeList) { - if (!allIds.contains(baseNode.getPid()) || selfIdEqSelfParent.contains(baseNode.getPid())) { - baseNode.setPid(null); - for (RoleMenu roleMenu : roleMenus) { - if (baseNode.getId().equals(roleMenu.getMenuId()) && - 2 != baseNode.getHasPermission()) { - baseNode.setTopMenu(baseNode.getName()); - trees.add(baseNode); - } - } - } - } - return trees; - } - - private static void foreachNodesWithRole(List treeList, - List selfIdEqSelfParent, List roleMenus) { - nodeMap = Maps.newConcurrentMap(); - for (MenuRoleVO parent : treeList) { - Serializable id = parent.getId(); - nodeMap.put(parent.getId(), parent); - for (MenuRoleVO children : treeList) { - if (parent != children) { - //parent != children 这个来判断自己的孩子不允许是自己,因为有时候,根节点的parent会被设置成为自己 - if (id.equals(children.getPid())) { - parent.initChildren(); - if (0L == parent.getPid()) { - children.setTopMenu(parent.getPath()); - children.setLevel(2); - } else { - children.setTopMenu(parent.getTopMenu()); - children.setLevel(parent.getLevel() + 1); - } - parent.getChildren().add(children); - } - } else if (id.equals(parent.getPid())) { - selfIdEqSelfParent.add(id); - } - - for (RoleMenu roleMenu : roleMenus) { - if (children.getId().equals(roleMenu.getMenuId())) { - children.setHasPermission(1); - } - } - } - } - } - - public static List buildUserTree(List treeList, List roleMenus) { - if (CollUtil.isEmpty(treeList)) { - return Collections.emptyList(); - } - //记录自己是自己的父节点的id集合 - List selfIdEqSelfParent = new ArrayList<>(); - - // 遍历两次 - foreachNodesCheckRole(treeList, selfIdEqSelfParent, roleMenus); - foreachNodesWithTopMenu(treeList); - - // 找出根节点集合 - List trees = new ArrayList<>(); - - List allIds = treeList.stream().map(node -> node.getId()).collect(Collectors.toList()); - for (MenuRoleVO baseNode : treeList) { - if (!allIds.contains(baseNode.getPid()) || selfIdEqSelfParent.contains(baseNode.getPid())) { - baseNode.setPid(null); - Boolean isUserMenu = checkPermisson(baseNode.getId(), roleMenus); - if (isUserMenu) { - baseNode.setTopMenu(baseNode.getName()); - checkRedirect(baseNode); - trees.add(baseNode); - } else { - if (baseNode.getSize() > 0) { - baseNode.setTopMenu(baseNode.getName()); - checkRedirect(baseNode); - trees.add(baseNode); - } - } - } - } - return trees; - } - - //判断角色权限用 不用父级 - private static void foreachNodesCheckRoleWithoutParent(List treeList, List selfIdEqSelfParent, List roleMenus) { - nodeMap = Maps.newConcurrentMap(); - for (MenuRoleVO parent : treeList) { - Serializable id = parent.getId(); - nodeMap.put(parent.getId(), parent); - for (MenuRoleVO children : treeList) { - if (parent != children) { - //parent != children 这个来判断自己的孩子不允许是自己,因为有时候,根节点的parent会被设置成为自己 - if (id.equals(children.getPid())) { - parent.initChildren(); - - if (!checkPermisson(children.getId(), roleMenus)) { - continue; - } - - if (0L == parent.getPid()) { - children.setTopMenu(parent.getName()); - children.setLevel(2); - } else { - children.setTopMenu(parent.getTopMenu()); - children.setLevel(parent.getLevel() + 1); - } - parent.getChildren().add(children); - } - } else if (id.equals(parent.getPid())) { - selfIdEqSelfParent.add(id); - } - - for (RoleMenu roleMenu : roleMenus) { - if (children.getId().equals(roleMenu.getMenuId())) { - children.setHasPermission(1); - } - } - } - } - } - - //判断当前登录权限用 - private static void foreachNodesCheckRole(List treeList, List selfIdEqSelfParent, List roleMenus) { - nodeMap = Maps.newConcurrentMap(); - for (MenuRoleVO parent : treeList) { - Serializable id = parent.getId(); - nodeMap.put(parent.getId(), parent); - for (MenuRoleVO children : treeList) { - if (parent != children) { - //parent != children 这个来判断自己的孩子不允许是自己,因为有时候,根节点的parent会被设置成为自己 - if (id.equals(children.getPid())) { - parent.initChildren(); - - if (!checkPermisson(children.getId(), roleMenus)) { - continue; - } - - if (0L == parent.getPid()) { - children.setTopMenu(parent.getName()); - children.setLevel(2); - } else { - children.setTopMenu(parent.getTopMenu()); - children.setLevel(parent.getLevel() + 1); - } - parent.getChildren().add(children); - } - } else if (id.equals(parent.getPid())) { - selfIdEqSelfParent.add(id); - } - } - - //1层 2层 再加一下 - for (MenuRoleVO children : treeList) { - if (parent != children) { - if (id.equals(children.getPid())) { - - if (parent.getChildren().contains(children) || - children.getSize() == 0) { - continue; - } - - if (0L == parent.getPid()) { - children.setTopMenu(parent.getName()); - children.setLevel(2); - } else { - children.setTopMenu(parent.getTopMenu()); - children.setLevel(parent.getLevel() + 1); - } - parent.getChildren().add(children); - } - } - } - } - } - - /** - * 判断角色是否有该菜单权限 - * - * @param roleId - * @param roleMenus - * @return - */ - private static Boolean checkPermisson(Long roleId, List roleMenus) { - Boolean isUserMenu = false; - for (RoleMenu roleMenu : roleMenus) { - if (roleId.equals(roleMenu.getMenuId())) { - isUserMenu = true; - break; - } - } - return isUserMenu; - } - - /** - * 动态判断redirect - * - * @param baseNode - */ - private static void checkRedirect(MenuRoleVO baseNode) { - checkMenuRedirect(baseNode, baseNode.getChildren()); - } - - private static Boolean checkMenuRedirect(MenuRoleVO baseNode, List menus) { - if (baseNode.getSize() > 0) { - for (MenuRoleVO menu : menus) { - if (menu.getPath().endsWith("Datav")) { - baseNode.setRedirect(menu.getComponent()); - return Boolean.TRUE; - } - - if (menu.getSize() == 0 && 0 == menu.getHidden()) { - baseNode.setRedirect(menu.getComponent()); - return Boolean.TRUE; - } - } - - //一轮没有合适的菜单 去三级菜单找 - for (MenuRoleVO menu : menus) { - if (menu.getSize() > 0) { - if (checkMenuRedirect(baseNode, menu.getChildren())) { - return Boolean.TRUE; - } - } - } - } - - return Boolean.FALSE; - } -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index 7d7a76b..60358f1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.pmapi.common.enums.ProjectProessStageEnum; +import com.ningdatech.pmapi.common.enumeration.ProjectProessStageEnum; import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto; import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 171a79e..500f879 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -3,13 +3,14 @@ package com.ningdatech.pmapi.projectlib.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; /** *

@@ -33,4 +34,10 @@ public class AnnualPlanController { return annualPlanLibManage.annulPlanLibList(req); } + @PostMapping("/startProjectDeclared") + @ApiOperation("开启项目申报") + public void startProjectDeclared(@RequestBody @Valid StartProjectDeclareReq req) { + annualPlanLibManage.startProjectDeclared(req); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index ebb0435..1e3b004 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -2,16 +2,21 @@ package com.ningdatech.pmapi.projectlib.manage; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; +import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; import com.ningdatech.pmapi.projectlib.service.IProjectService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Arrays; @@ -32,6 +37,7 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; public class AnnualPlanLibManage { private final IProjectService projectService; + private final StateMachineUtils stateMachine; /** * 年度计划查询状态 @@ -57,6 +63,7 @@ public class AnnualPlanLibManage { public PageVo annulPlanLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); + query.eq(Project::getIsTemporaryAugment, 0); query.orderByDesc(Project::getAnnualPlanAddTime); query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatusEnum::getCode)); Page page = projectService.page(req.page(), query); @@ -82,4 +89,21 @@ public class AnnualPlanLibManage { return result; } + @Transactional(rollbackFor = Exception.class) + public void startProjectDeclared(StartProjectDeclareReq req) { + List projects = projectService.listByIds(req.getProjectIds()); + projects.forEach(w -> { + if (!IN_THE_ANNUAL_PLAN.eq(w.getStatus())) { + throw BizException.wrap("开启方案申报失败"); + } + }); + projects.forEach(project -> { + try { + stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE); + } catch (Exception e) { + throw new BizException("开启方案申报失败"); + } + }); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/StartProjectDeclareReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/StartProjectDeclareReq.java new file mode 100644 index 0000000..0bcb177 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/StartProjectDeclareReq.java @@ -0,0 +1,25 @@ +package com.ningdatech.pmapi.projectlib.model.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + *

+ * StartProjectDeclareReq + *

+ * + * @author WendyYang + * @since 17:47 2023/2/11 + */ +@Data +public class StartProjectDeclareReq { + + @ApiModelProperty("项目ID") + @NotEmpty(message = "项目ID不能为空") + private List projectIds; + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java index 0cdc8fc..a34a9c2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java @@ -7,7 +7,7 @@ import com.ningdatech.basic.auth.AbstractLoginUserUtil; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; -import com.ningdatech.pmapi.common.utils.TreeUtil; +import com.ningdatech.pmapi.common.util.TreeUtil; import com.ningdatech.pmapi.sys.entity.Menu; import com.ningdatech.pmapi.sys.entity.dto.MenuQueryDTO; import com.ningdatech.pmapi.sys.entity.dto.MenuSaveDTO; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java index 3307485..e6dabd7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java @@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.common.utils.TreeUtil; +import com.ningdatech.pmapi.common.util.TreeUtil; import com.ningdatech.pmapi.sys.entity.Menu; import com.ningdatech.pmapi.sys.entity.RoleMenu; import com.ningdatech.pmapi.sys.entity.vo.MenuRoleVO; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java index bf45d80..3c48244 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java @@ -10,7 +10,7 @@ import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.file.entity.vo.result.AttachFileVo; import com.ningdatech.file.service.FileService; -import com.ningdatech.pmapi.common.utils.BizUtils; +import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.sys.entity.Notice; import com.ningdatech.pmapi.sys.entity.req.NoticeListReq; import com.ningdatech.pmapi.sys.entity.req.NoticeSaveReq; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java index 2c3c2aa..2a8baab 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java @@ -7,8 +7,6 @@ import javax.validation.Valid; import com.ningdatech.pmapi.common.util.ExcelDownUtil; import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; import com.ningdatech.pmapi.todocenter.model.dto.req.ReqProcessHandlerDTO; -import com.wflow.utils.R; -import com.wflow.workflow.bean.vo.ProcessHandlerParamsVo; import org.springframework.web.bind.annotation.*; import com.ningdatech.basic.model.ApiResponse; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/IsAppendProjectEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/IsAppendProjectEnum.java new file mode 100644 index 0000000..d0d5ba1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/IsAppendProjectEnum.java @@ -0,0 +1,70 @@ +package com.ningdatech.pmapi.todocenter.enumeration; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; + +/** + * 是否增补项目枚举 + * + * @author CMM + */ +@Getter +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "IsAppendProjectEnum", description = "是否增补项目-枚举") +public enum IsAppendProjectEnum { + /** + * 非增补项目 + */ + NOT_APPEND_PROJECT(0, "非增补项目"), + + /** + * 增补项目 + */ + APPEND_PROJECT(1, "增补项目"); + + + private Integer code; + private String desc; + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static String getDescByCode(Integer code) { + if (Objects.isNull(code)) { + return StringUtils.EMPTY; + } + for (IsAppendProjectEnum t : IsAppendProjectEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } + + public static IsAppendProjectEnum getEnumByValue(Integer code) { + if (Objects.isNull(code)) { + return null; + } + for (IsAppendProjectEnum t : IsAppendProjectEnum.values()) { + if (code.equals(t.getCode())) { + return t; + } + } + return null; + } + + public boolean eq(String val) { + return this.name().equals(val); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/ProcessStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/ProcessStatusEnum.java new file mode 100644 index 0000000..fd07266 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/ProcessStatusEnum.java @@ -0,0 +1,97 @@ +package com.ningdatech.pmapi.todocenter.enumeration; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; + +/** + * 待办中心-流程状态枚举 + * + * @author CMM + */ +@Getter +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "ProcessStatusEnum", description = "流程状态-枚举") +public enum ProcessStatusEnum { + /** + * 审核中 + */ + + UNDER_REVIEW(1, "审核中"), + + /** + * 被退回 + */ + BE_BACKED(2, "被退回"), + + /** + * 被驳回 + */ + BE_REJECTED(3, "被驳回"), + + /** + * 审核通过 + */ + APPROVED(4, "审核通过"), + /** + * 被撤回 + */ + WITHDRAW(5, "被撤回"); + + + private Integer code; + private String desc; + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static String getDescByCode(Integer code) { + if (Objects.isNull(code)) { + return StringUtils.EMPTY; + } + for (ProcessStatusEnum t : ProcessStatusEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } + + public static Integer getCodeByDesc(String desc) { + if (Objects.isNull(desc)) { + return null; + } + for (ProcessStatusEnum t : ProcessStatusEnum.values()) { + if (desc.equals(t.getDesc())) { + return t.code; + } + } + return null; + } + + public static ProcessStatusEnum getEnumByValue(Integer code) { + if (Objects.isNull(code)) { + return null; + } + for (ProcessStatusEnum t : ProcessStatusEnum.values()) { + if (code.equals(t.getCode())) { + return t; + } + } + return null; + } + + public boolean eq(String val) { + return this.name().equals(val); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/IsAppendProjectEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/IsAppendProjectEnum.java deleted file mode 100644 index a744804..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/IsAppendProjectEnum.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.ningdatech.pmapi.todocenter.enums; - -import java.util.Objects; - -import org.apache.commons.lang3.StringUtils; - -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; - -/** - * 是否增补项目枚举 - * @author CMM - */ -@Getter -@AllArgsConstructor -@NoArgsConstructor -@ApiModel(value = "IsAppendProjectEnum", description = "是否增补项目-枚举") -public enum IsAppendProjectEnum { - /** - * 非增补项目 - */ - NOT_APPEND_PROJECT(0, "非增补项目"), - - /** - *增补项目 - */ - APPEND_PROJECT(1, "增补项目"); - - - private Integer code; - private String desc; - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public static String getDescByCode(Integer code) { - if(Objects.isNull(code)){ - return StringUtils.EMPTY; - } - for (IsAppendProjectEnum t : IsAppendProjectEnum.values()) { - if (code.equals(t.getCode())) { - return t.desc; - } - } - return StringUtils.EMPTY; - } - - public static IsAppendProjectEnum getEnumByValue(Integer code) { - if(Objects.isNull(code)){ - return null; - } - for (IsAppendProjectEnum t : IsAppendProjectEnum.values()) { - if (code.equals(t.getCode())) { - return t; - } - } - return null; - } - - public boolean eq(String val) { - return this.name().equals(val); - } -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/ProcessStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/ProcessStatusEnum.java deleted file mode 100644 index 91d311d..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/ProcessStatusEnum.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.ningdatech.pmapi.todocenter.enums; - -import java.util.Objects; - -import org.apache.commons.lang3.StringUtils; - -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; - -/** - * 待办中心-流程状态枚举 - * @author CMM - */ -@Getter -@AllArgsConstructor -@NoArgsConstructor -@ApiModel(value = "ProcessStatusEnum", description = "流程状态-枚举") -public enum ProcessStatusEnum { - /** - * 审核中 - */ - - UNDER_REVIEW(1, "审核中"), - - /** - * 被退回 - */ - BE_BACKED(2, "被退回"), - - /** - * 被驳回 - */ - BE_REJECTED(3,"被驳回"), - - /** - * 审核通过 - */ - APPROVED(4,"审核通过"), - /** - * 被撤回 - */ - WITHDRAW(5,"被撤回"); - - - private Integer code; - private String desc; - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public static String getDescByCode(Integer code) { - if(Objects.isNull(code)){ - return StringUtils.EMPTY; - } - for (ProcessStatusEnum t : ProcessStatusEnum.values()) { - if (code.equals(t.getCode())) { - return t.desc; - } - } - return StringUtils.EMPTY; - } - - public static Integer getCodeByDesc(String desc) { - if(Objects.isNull(desc)){ - return null; - } - for (ProcessStatusEnum t : ProcessStatusEnum.values()) { - if (desc.equals(t.getCode())) { - return t.code; - } - } - return null; - } - - public static ProcessStatusEnum getEnumByValue(Integer code) { - if(Objects.isNull(code)){ - return null; - } - for (ProcessStatusEnum t : ProcessStatusEnum.values()) { - if (code.equals(t.getCode())) { - return t; - } - } - return null; - } - - public boolean eq(String val) { - return this.name().equals(val); - } -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index c7b1627..a1b2ac6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -33,8 +33,8 @@ import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode; import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; import com.ningdatech.pmapi.todocenter.bean.vo.ProgressNodeAuditInfoVo; import com.ningdatech.pmapi.todocenter.constant.HisProInsEndActId; -import com.ningdatech.pmapi.todocenter.enums.IsAppendProjectEnum; -import com.ningdatech.pmapi.todocenter.enums.ProcessStatusEnum; +import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; +import com.ningdatech.pmapi.todocenter.enumeration.ProcessStatusEnum; import com.ningdatech.pmapi.todocenter.extension.cmd.BackToHisApprovalNodeCmd; import com.ningdatech.pmapi.todocenter.extension.cmd.SaveCommentCmd; import com.ningdatech.pmapi.todocenter.model.dto.req.ReqProcessHandlerDTO; From c8eae2a15c05a6a7a22fab685fdae851a35ed51b Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sun, 12 Feb 2023 12:18:02 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=BD=92=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/enumeration/ExportOptionEnum.java | 121 +++--- .../common/handler/GlobalResponseHandler.java | 2 +- .../com/ningdatech/pmapi/common/util/TreeUtil.java | 4 +- .../PrequalificationDeclaredProjectManage.java | 4 +- .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 16 +- .../pmapi/scheduler/task/InitProcessTask.java | 2 +- .../pmapi/sys/controller/MenuController.java | 12 +- .../pmapi/sys/controller/NoticeController.java | 10 +- .../pmapi/sys/controller/RoleController.java | 10 +- .../pmapi/sys/convert/RegionConverter.java | 11 +- .../ningdatech/pmapi/sys/entity/BaseEntity.java | 34 -- .../java/com/ningdatech/pmapi/sys/entity/Menu.java | 73 ---- .../com/ningdatech/pmapi/sys/entity/Notice.java | 68 ---- .../com/ningdatech/pmapi/sys/entity/Region.java | 46 --- .../com/ningdatech/pmapi/sys/entity/Resource.java | 94 ----- .../java/com/ningdatech/pmapi/sys/entity/Role.java | 54 --- .../ningdatech/pmapi/sys/entity/RoleAuthority.java | 74 ---- .../com/ningdatech/pmapi/sys/entity/RoleMenu.java | 40 -- .../pmapi/sys/entity/RoleMenuDatascope.java | 36 -- .../com/ningdatech/pmapi/sys/entity/UserRole.java | 62 --- .../pmapi/sys/entity/dto/MenuDataScopeDTO.java | 23 -- .../pmapi/sys/entity/dto/MenuQueryDTO.java | 97 ----- .../pmapi/sys/entity/dto/MenuSaveDTO.java | 92 ----- .../pmapi/sys/entity/dto/MenuUpdateDTO.java | 100 ----- .../ningdatech/pmapi/sys/entity/dto/RegionDTO.java | 56 --- .../pmapi/sys/entity/dto/RegionTreeDTO.java | 46 --- .../pmapi/sys/entity/dto/ResourceQueryDTO.java | 34 -- .../pmapi/sys/entity/dto/ResourceSaveDTO.java | 63 --- .../pmapi/sys/entity/dto/ResourceUpdateDTO.java | 68 ---- .../pmapi/sys/entity/dto/RoleAuthoritySaveDTO.java | 53 --- .../pmapi/sys/entity/dto/RolePageReq.java | 37 -- .../pmapi/sys/entity/dto/RoleQueryDTO.java | 48 --- .../pmapi/sys/entity/dto/RoleSaveDTO.java | 63 --- .../pmapi/sys/entity/dto/RoleUpdateDTO.java | 55 --- .../pmapi/sys/entity/dto/RoleUserSaveVO.java | 48 --- .../pmapi/sys/entity/dto/UserRoleSaveDTO.java | 47 --- .../sys/entity/enumeration/AuthorizeType.java | 60 --- .../sys/entity/enumeration/DataScopeEnum.java | 31 -- .../pmapi/sys/entity/enumeration/MenuTypeEnum.java | 57 --- .../pmapi/sys/entity/req/NoticeListReq.java | 31 -- .../pmapi/sys/entity/req/NoticeSaveReq.java | 44 --- .../sys/entity/req/NoticeStatusModifyReq.java | 29 -- .../pmapi/sys/entity/vo/MenuResourceTreeVO.java | 35 -- .../ningdatech/pmapi/sys/entity/vo/MenuRoleVO.java | 78 ---- .../com/ningdatech/pmapi/sys/entity/vo/MenuVO.java | 70 ---- .../pmapi/sys/entity/vo/NoticeDetailVO.java | 40 -- .../pmapi/sys/entity/vo/NoticeListItemVO.java | 44 --- .../pmapi/sys/entity/vo/RegionTreeVO.java | 53 --- .../com/ningdatech/pmapi/sys/entity/vo/RoleVO.java | 57 --- .../ningdatech/pmapi/sys/manage/MenuManage.java | 6 +- .../ningdatech/pmapi/sys/manage/NoticeManage.java | 12 +- .../ningdatech/pmapi/sys/manage/RegionManage.java | 4 +- .../ningdatech/pmapi/sys/manage/RoleManage.java | 12 +- .../ningdatech/pmapi/sys/mapper/MenuMapper.java | 2 +- .../ningdatech/pmapi/sys/mapper/NoticeMapper.java | 2 +- .../ningdatech/pmapi/sys/mapper/RegionMapper.java | 2 +- .../pmapi/sys/mapper/ResourceMapper.java | 4 +- .../ningdatech/pmapi/sys/mapper/ResourceMapper.xml | 4 +- .../ningdatech/pmapi/sys/mapper/RoleMapper.java | 2 +- .../com/ningdatech/pmapi/sys/mapper/RoleMapper.xml | 2 +- .../pmapi/sys/mapper/RoleMenuDatascopeMapper.java | 2 +- .../pmapi/sys/mapper/RoleMenuMapper.java | 2 +- .../pmapi/sys/mapper/UserRoleMapper.java | 2 +- .../pmapi/sys/model/dto/MenuDataScopeDTO.java | 23 ++ .../pmapi/sys/model/dto/MenuQueryDTO.java | 97 +++++ .../pmapi/sys/model/dto/MenuSaveDTO.java | 91 +++++ .../pmapi/sys/model/dto/MenuUpdateDTO.java | 100 +++++ .../ningdatech/pmapi/sys/model/dto/RegionDTO.java | 56 +++ .../pmapi/sys/model/dto/RegionTreeDTO.java | 46 +++ .../pmapi/sys/model/dto/ResourceQueryDTO.java | 34 ++ .../pmapi/sys/model/dto/ResourceSaveDTO.java | 63 +++ .../pmapi/sys/model/dto/ResourceUpdateDTO.java | 68 ++++ .../pmapi/sys/model/dto/RoleAuthoritySaveDTO.java | 53 +++ .../pmapi/sys/model/dto/RoleQueryDTO.java | 48 +++ .../pmapi/sys/model/dto/RoleSaveDTO.java | 63 +++ .../pmapi/sys/model/dto/RoleUpdateDTO.java | 55 +++ .../pmapi/sys/model/dto/UserRoleSaveDTO.java | 47 +++ .../pmapi/sys/model/entity/BaseEntity.java | 34 ++ .../ningdatech/pmapi/sys/model/entity/Menu.java | 73 ++++ .../ningdatech/pmapi/sys/model/entity/Notice.java | 68 ++++ .../ningdatech/pmapi/sys/model/entity/Region.java | 46 +++ .../pmapi/sys/model/entity/Resource.java | 94 +++++ .../ningdatech/pmapi/sys/model/entity/Role.java | 48 +++ .../pmapi/sys/model/entity/RoleAuthority.java | 74 ++++ .../pmapi/sys/model/entity/RoleMenu.java | 40 ++ .../pmapi/sys/model/entity/RoleMenuDatascope.java | 36 ++ .../pmapi/sys/model/entity/UserRole.java | 62 +++ .../sys/model/enumeration/AuthorizeTypeEnum.java | 60 +++ .../pmapi/sys/model/enumeration/DataScopeEnum.java | 31 ++ .../pmapi/sys/model/enumeration/MenuTypeEnum.java | 57 +++ .../pmapi/sys/model/req/NoticeListReq.java | 31 ++ .../pmapi/sys/model/req/NoticeSaveReq.java | 44 +++ .../pmapi/sys/model/req/NoticeStatusModifyReq.java | 29 ++ .../pmapi/sys/model/req/RolePageReq.java | 37 ++ .../pmapi/sys/model/vo/MenuResourceTreeVO.java | 35 ++ .../ningdatech/pmapi/sys/model/vo/MenuRoleVO.java | 78 ++++ .../com/ningdatech/pmapi/sys/model/vo/MenuVO.java | 70 ++++ .../pmapi/sys/model/vo/NoticeDetailVO.java | 40 ++ .../pmapi/sys/model/vo/NoticeListItemVO.java | 44 +++ .../pmapi/sys/model/vo/RegionTreeVO.java | 53 +++ .../pmapi/sys/model/vo/RoleUserSaveVO.java | 48 +++ .../com/ningdatech/pmapi/sys/model/vo/RoleVO.java | 57 +++ .../ningdatech/pmapi/sys/service/IMenuService.java | 6 +- .../pmapi/sys/service/INoticeService.java | 2 +- .../pmapi/sys/service/IRegionService.java | 4 +- .../sys/service/IRoleMenuDatascopeService.java | 2 +- .../pmapi/sys/service/IRoleMenuService.java | 2 +- .../ningdatech/pmapi/sys/service/IRoleService.java | 6 +- .../pmapi/sys/service/IUserRoleService.java | 2 +- .../pmapi/sys/service/impl/MenuServiceImpl.java | 8 +- .../pmapi/sys/service/impl/NoticeServiceImpl.java | 2 +- .../pmapi/sys/service/impl/RegionServiceImpl.java | 4 +- .../service/impl/RoleMenuDatascopeServiceImpl.java | 2 +- .../sys/service/impl/RoleMenuServiceImpl.java | 2 +- .../pmapi/sys/service/impl/RoleServiceImpl.java | 8 +- .../sys/service/impl/UserRoleServiceImpl.java | 4 +- .../pmapi/todocenter/manage/TodoCenterManage.java | 431 +++++++++++---------- .../model/dto/req/ReqToBeProcessedDTO.java | 2 +- .../pmapi/sys/service/IMenuServiceTest.java | 2 +- 119 files changed, 2512 insertions(+), 2500 deletions(-) delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/BaseEntity.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Menu.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Notice.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Region.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Resource.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Role.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleAuthority.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleMenu.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleMenuDatascope.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/UserRole.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuDataScopeDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuQueryDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuSaveDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuUpdateDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RegionDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RegionTreeDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceQueryDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceSaveDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceUpdateDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleAuthoritySaveDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RolePageReq.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleQueryDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleSaveDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleUpdateDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleUserSaveVO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/UserRoleSaveDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/AuthorizeType.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/DataScopeEnum.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/MenuTypeEnum.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeListReq.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeSaveReq.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeStatusModifyReq.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuResourceTreeVO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuRoleVO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuVO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/NoticeDetailVO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/NoticeListItemVO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/RegionTreeVO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/RoleVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuDataScopeDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuQueryDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuSaveDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuUpdateDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RegionDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RegionTreeDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceQueryDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceSaveDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceUpdateDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleAuthoritySaveDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleQueryDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleSaveDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleUpdateDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/UserRoleSaveDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/BaseEntity.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Notice.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Region.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Resource.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Role.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleAuthority.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleMenu.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleMenuDatascope.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/UserRole.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/AuthorizeTypeEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/DataScopeEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/MenuTypeEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeListReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeSaveReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeStatusModifyReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/RolePageReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuResourceTreeVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuRoleVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NoticeDetailVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NoticeListItemVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RegionTreeVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleUserSaveVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleVO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ExportOptionEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ExportOptionEnum.java index 406b18f..1067f97 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ExportOptionEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ExportOptionEnum.java @@ -1,11 +1,10 @@ -package com.ningdatech.pmapi.common.enums; +package com.ningdatech.pmapi.common.enumeration; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; - /** * 导出选项枚举 * @@ -19,129 +18,129 @@ public enum ExportOptionEnum { /** * 导出选项 */ - id(1,"项目ID"), + id(1, "项目ID"), - projectName(2,"项目名称"), + projectName(2, "项目名称"), - areaCode(3,"行政区划编码"), + areaCode(3, "行政区划编码"), - area(4,"行政区划名称"), + area(4, "行政区划名称"), - responsibleMan(5,"项目负责人"), + responsibleMan(5, "项目负责人"), - responsibleManMobile(6,"项目负责人手机号"), + responsibleManMobile(6, "项目负责人手机号"), - contactName(7,"项目联系人"), + contactName(7, "项目联系人"), - contactPhone(8,"项目联系人手机号"), + contactPhone(8, "项目联系人手机号"), - higherSuperOrg(9,"上级业务主管单位"), + higherSuperOrg(9, "上级业务主管单位"), - higherSuperOrgCode(10,"上级主管单位浙政钉ID"), + higherSuperOrgCode(10, "上级主管单位浙政钉ID"), - superOrg(11,"本级主管部门"), + superOrg(11, "本级主管部门"), - superOrgCode(12,"本级主管部门浙政钉ID"), + superOrgCode(12, "本级主管部门浙政钉ID"), - buildOrgName(13,"建设单位名称"), + buildOrgName(13, "建设单位名称"), - buildOrgZheJiangGovDingId(14,"建设单位浙政钉ID"), + buildOrgZheJiangGovDingId(14, "建设单位浙政钉ID"), - buildOrgCode(15,"建设单位统一信用代码"), + buildOrgCode(15, "建设单位统一信用代码"), - projectType(16,"项目类型"), + projectType(16, "项目类型"), - isFirst(17,"是否首次新建"), + isFirst(17, "是否首次新建"), - relatedExistsApplication(18,"关联应用"), + relatedExistsApplication(18, "关联应用"), - relatedExistsApplicationCode(19,"关联应用IRS编码"), + relatedExistsApplicationCode(19, "关联应用IRS编码"), - declareAmount(20,"申报金额(万元)"), + declareAmount(20, "申报金额(万元)"), - approvedTotalInvestmentIncrease(21,"批复金额"), + approvedTotalInvestmentIncrease(21, "批复金额"), /** * 表里没有 */ - budgetSource(22,"预算来源"), + budgetSource(22, "预算来源"), - projectYear(23,"预算年度"), + projectYear(23, "预算年度"), - projectIntroduction(24,"项目简介"), + projectIntroduction(24, "项目简介"), - buildBasis(25,"立项依据"), + buildBasis(25, "立项依据"), - buildLevel(26,"建设层级"), + buildLevel(26, "建设层级"), - developCode(27,"发改编码"), + developCode(27, "发改编码"), - financialCode(28,"财政编码"), + financialCode(28, "财政编码"), /** * 表里没有 */ - informationValidity(29,"信息是否有效"), + informationValidity(29, "信息是否有效"), - isDigitalReform(30,"是否数字化改革项目"), + isDigitalReform(30, "是否数字化改革项目"), - bizDomain(31,"综合应用领域"), + bizDomain(31, "综合应用领域"), - isCloud(32,"是否上云"), + isCloud(32, "是否上云"), - cloudType(33,"云类型"), + cloudType(33, "云类型"), - fourSystems(34,"四大体系"), - isTemporaryAugment(35,"是否临时增补"), + fourSystems(34, "四大体系"), + isTemporaryAugment(35, "是否临时增补"), - protectionLevel(36,"等保级别"), + protectionLevel(36, "等保级别"), - isSecretComments(37,"是否密评"), + isSecretComments(37, "是否密评"), - businessNumber(38,"业务编号"), + businessNumber(38, "业务编号"), - businessName(39,"业务名称"), + businessName(39, "业务名称"), - orgName(40,"单位名称"), + orgName(40, "单位名称"), - softwareDevelopmentAmount(41,"软件开发(万元)"), + softwareDevelopmentAmount(41, "软件开发(万元)"), - cloudHardwarePurchaseAmount(42,"云资源、硬件购置(万元)"), + cloudHardwarePurchaseAmount(42, "云资源、硬件购置(万元)"), - thirdPartyAmount(43,"第三方服务(万元)"), + thirdPartyAmount(43, "第三方服务(万元)"), - safetyInputTitle(44,"投入项"), + safetyInputTitle(44, "投入项"), - safetyInputDescribe(45,"内容描述"), + safetyInputDescribe(45, "内容描述"), - safetyInputAmount(46,"金额"), + safetyInputAmount(46, "金额"), - annualPlanAmount(47,"年度支付金额(万元)"), + annualPlanAmount(47, "年度支付金额(万元)"), - annualPlanHaveAmount(48,"自有资金(万元)"), + annualPlanHaveAmount(48, "自有资金(万元)"), - declareGovOwnFinanceAmount(49,"政府投资-本级财政资金(万元)"), + declareGovOwnFinanceAmount(49, "政府投资-本级财政资金(万元)"), - declareGovSuperiorFinanceAmount(50,"政府投资-上级补助资金(万元)"), + declareGovSuperiorFinanceAmount(50, "政府投资-上级补助资金(万元)"), - declareBankLendingAmount(51,"银行贷款(万元)"), + declareBankLendingAmount(51, "银行贷款(万元)"), - declareOtherAmount(52,"其它资金(万元)"), + declareOtherAmount(52, "其它资金(万元)"), - engineeringSpeedOne(53,"第一季度"), + engineeringSpeedOne(53, "第一季度"), - engineeringSpeedTwo(54,"第二季度"), + engineeringSpeedTwo(54, "第二季度"), - engineeringSpeedThree(55,"第三季度"), + engineeringSpeedThree(55, "第三季度"), - engineeringSpeedFour(56,"第四季度"), + engineeringSpeedFour(56, "第四季度"), - preliminaryPlanFile(57,"初步方案"), + preliminaryPlanFile(57, "初步方案"), - supportingMaterialsFile(58,"附件-佐证材料"), + supportingMaterialsFile(58, "附件-佐证材料"), - projectRemarks(59,"备注"); + projectRemarks(59, "备注"); private Integer code; private String desc; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index a895b8f..d3090ff 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -2,7 +2,7 @@ package com.ningdatech.pmapi.common.handler; import cn.hutool.json.JSONUtil; import com.ningdatech.basic.model.ApiResponse; -import com.ningdatech.pmapi.common.utils.BizUtils; +import com.ningdatech.pmapi.common.util.BizUtils; import org.springframework.core.MethodParameter; import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java index e75eeb3..ae70159 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java @@ -5,8 +5,8 @@ import cn.hutool.core.collection.CollUtil; import com.google.common.collect.Maps; import com.ningdatech.basic.util.StrPool; import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; -import com.ningdatech.pmapi.sys.entity.RoleMenu; -import com.ningdatech.pmapi.sys.entity.vo.MenuRoleVO; +import com.ningdatech.pmapi.sys.model.entity.RoleMenu; +import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; import org.apache.commons.lang3.StringUtils; import java.io.Serializable; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java index 1e04fba..e19f880 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.function.VUtils; -import com.ningdatech.pmapi.common.enums.ProjectProessStageEnum; +import com.ningdatech.pmapi.common.enumeration.ProjectProessStageEnum; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.projectdeclared.entity.dto.PreDeclaredProjectDto; import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDto; @@ -108,7 +108,7 @@ public class PrequalificationDeclaredProjectManage { project.setUpdateOn(LocalDateTime.now()); project.setInstCode(instanceId); //调用状态机 进入下一个通过状态 - stateMachineUtils.execute(project,stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); + stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); projectService.updateById(project); } catch (Exception e) { log.error("提交预审 项目信息修改 错误 ", e); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 9158556..231b312 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -1,9 +1,8 @@ package com.ningdatech.pmapi.projectlib.model.vo; import com.alibaba.fastjson.JSON; -import com.ningdatech.pmapi.common.utils.BizUtils; +import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; -import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -15,7 +14,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; -import java.util.concurrent.atomic.AtomicReference; /** *

@@ -274,21 +272,21 @@ public class ProjectDetailVO { private List projectApplications; @ApiModelProperty("动态form") - private Map dynamicForm; + private Map dynamicForm; private String projectTypeName; - public String getProjectTypeName(){ - if(Objects.nonNull(this.projectType)){ + public String getProjectTypeName() { + if (Objects.nonNull(this.projectType)) { Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) .ifPresent(desc -> this.projectTypeName = desc); } return this.projectTypeName; } - public void buildDynamicForm(String dynamicFormStr){ - if(StringUtils.isNotBlank(dynamicFormStr) && BizUtils.getJSONType(dynamicFormStr)){ - this.dynamicForm = JSON.parseObject(dynamicFormStr,Map.class); + public void buildDynamicForm(String dynamicFormStr) { + if (StringUtils.isNotBlank(dynamicFormStr) && BizUtils.getJSONType(dynamicFormStr)) { + this.dynamicForm = JSON.parseObject(dynamicFormStr, Map.class); } } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java index 7f27ebe..08b54d3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.exception.BizException; import com.ningdatech.pmapi.scheduler.contants.TaskContant; import com.ningdatech.pmapi.sys.contant.RegionConst; -import com.ningdatech.pmapi.sys.entity.Region; +import com.ningdatech.pmapi.sys.model.entity.Region; import com.ningdatech.pmapi.sys.service.IRegionService; import com.wflow.bean.dto.WflowModelHistorysDto; import com.wflow.bean.entity.WflowModels; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java index a34a9c2..3674466 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java @@ -8,12 +8,12 @@ import com.ningdatech.basic.util.CollUtils; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; import com.ningdatech.pmapi.common.util.TreeUtil; -import com.ningdatech.pmapi.sys.entity.Menu; -import com.ningdatech.pmapi.sys.entity.dto.MenuQueryDTO; -import com.ningdatech.pmapi.sys.entity.dto.MenuSaveDTO; -import com.ningdatech.pmapi.sys.entity.dto.MenuUpdateDTO; -import com.ningdatech.pmapi.sys.entity.vo.MenuRoleVO; -import com.ningdatech.pmapi.sys.entity.vo.MenuVO; +import com.ningdatech.pmapi.sys.model.entity.Menu; +import com.ningdatech.pmapi.sys.model.dto.MenuQueryDTO; +import com.ningdatech.pmapi.sys.model.dto.MenuSaveDTO; +import com.ningdatech.pmapi.sys.model.dto.MenuUpdateDTO; +import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; +import com.ningdatech.pmapi.sys.model.vo.MenuVO; import com.ningdatech.pmapi.sys.manage.MenuManage; import com.ningdatech.pmapi.sys.service.IMenuService; import com.ningdatech.pmapi.user.util.LoginUserUtil; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java index f986cfc..9837ad8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java @@ -3,11 +3,11 @@ package com.ningdatech.pmapi.sys.controller; import com.ningdatech.basic.model.IdVo; import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; -import com.ningdatech.pmapi.sys.entity.req.NoticeListReq; -import com.ningdatech.pmapi.sys.entity.req.NoticeSaveReq; -import com.ningdatech.pmapi.sys.entity.req.NoticeStatusModifyReq; -import com.ningdatech.pmapi.sys.entity.vo.NoticeDetailVO; -import com.ningdatech.pmapi.sys.entity.vo.NoticeListItemVO; +import com.ningdatech.pmapi.sys.model.req.NoticeListReq; +import com.ningdatech.pmapi.sys.model.req.NoticeSaveReq; +import com.ningdatech.pmapi.sys.model.req.NoticeStatusModifyReq; +import com.ningdatech.pmapi.sys.model.vo.NoticeDetailVO; +import com.ningdatech.pmapi.sys.model.vo.NoticeListItemVO; import com.ningdatech.pmapi.sys.manage.NoticeManage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/RoleController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/RoleController.java index 435c002..5115569 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/RoleController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/RoleController.java @@ -4,11 +4,11 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.lang.Assert; import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; -import com.ningdatech.pmapi.sys.entity.Role; -import com.ningdatech.pmapi.sys.entity.dto.RolePageReq; -import com.ningdatech.pmapi.sys.entity.dto.RoleSaveDTO; -import com.ningdatech.pmapi.sys.entity.dto.RoleUpdateDTO; -import com.ningdatech.pmapi.sys.entity.vo.RoleVO; +import com.ningdatech.pmapi.sys.model.entity.Role; +import com.ningdatech.pmapi.sys.model.req.RolePageReq; +import com.ningdatech.pmapi.sys.model.dto.RoleSaveDTO; +import com.ningdatech.pmapi.sys.model.dto.RoleUpdateDTO; +import com.ningdatech.pmapi.sys.model.vo.RoleVO; import com.ningdatech.pmapi.sys.manage.RoleManage; import com.ningdatech.pmapi.sys.service.IRoleService; import com.ningdatech.pmapi.user.util.LoginUserUtil; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/convert/RegionConverter.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/convert/RegionConverter.java index 57f0692..563b268 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/convert/RegionConverter.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/convert/RegionConverter.java @@ -1,13 +1,10 @@ package com.ningdatech.pmapi.sys.convert; -import cn.hutool.core.util.ObjectUtil; -import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.sys.entity.Region; -import com.ningdatech.pmapi.sys.entity.dto.RegionDTO; -import com.ningdatech.pmapi.sys.entity.dto.RegionTreeDTO; -import com.ningdatech.pmapi.sys.entity.vo.RegionTreeVO; +import com.ningdatech.pmapi.sys.model.entity.Region; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; +import com.ningdatech.pmapi.sys.model.dto.RegionTreeDTO; +import com.ningdatech.pmapi.sys.model.vo.RegionTreeVO; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.tuple.Pair; import java.util.ArrayList; import java.util.Collections; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/BaseEntity.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/BaseEntity.java deleted file mode 100644 index 00dd7c9..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/BaseEntity.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - *

- * 通用字段, is_del 根据需求自行添加 - *

- * - * @author WendyYang - * @since 11:01 2023/1/28 - */ -@Getter -@Setter -public class BaseEntity implements Serializable { - - @ApiModelProperty("创建人userId") - protected Long createBy; - - @ApiModelProperty("最后修改人userId") - protected Long updateBy; - - @ApiModelProperty("创建时间") - protected LocalDateTime createOn; - - @ApiModelProperty("修改时间") - protected LocalDateTime updateOn; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Menu.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Menu.java deleted file mode 100644 index 3db4378..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Menu.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.Size; -import java.time.LocalDateTime; - -import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; - -/** - *

- * 实体类 - * 菜单 - *

- * - * @author PoffyZhang - * @since 2022-9-30 - */ -@Data -@NoArgsConstructor -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -@TableName("nd_menu") -@ApiModel(value = "Menu", description = "菜单") -@AllArgsConstructor -public class Menu extends MenuTreeEntity { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "组件") - @Size(max = 255, message = "组件长度不能超过255") - @TableField(value = "component", condition = LIKE) - private String component; - - @ApiModelProperty(value = "菜单图标") - @Size(max = 255, message = "菜单图标长度不能超过255") - @TableField(value = "icon", condition = LIKE) - private String icon; - - @ApiModelProperty(value = "是否隐藏") - @TableField(value = "hidden") - private Boolean hidden; - - @ApiModelProperty(value = "activeMenu") - @TableField(value = "active_menu") - private String activeMenu; - - @ApiModelProperty(value = "跳转") - @TableField(value = "redirect") - private String redirect; - - @ApiModelProperty("是否有数据权限") - private Boolean hasDataScope; - - @ApiModelProperty("数据权限选项") - private String dataScopeOption; - - private Long updateBy; - - private Long createBy; - - private LocalDateTime updateOn; - - private LocalDateTime createOn; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Notice.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Notice.java deleted file mode 100644 index 97131be..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Notice.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - *

- * 系统通知 - *

- * - * @author WendyYang - * @since 2022-07-21 - */ -@Data -@TableName("nd_notice") -@ApiModel(value = "SysNotice对象", description = "系统通知") -public class Notice implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - @TableId(type = IdType.AUTO) - private Long id; - - @ApiModelProperty("消息类型") - private Integer type; - - @ApiModelProperty("标题") - private String title; - - @ApiModelProperty("内容") - private String content; - - @ApiModelProperty("启用禁用") - private Boolean enabled; - - @ApiModelProperty("附件ID") - private String attachment; - - @ApiModelProperty("创建时间") - @TableField(fill = FieldFill.INSERT) - private LocalDateTime createOn; - - @ApiModelProperty("创建人id") - @TableField(fill = FieldFill.INSERT) - private Long createBy; - - @ApiModelProperty("最后修改时间") - @TableField(fill = FieldFill.INSERT_UPDATE) - private LocalDateTime updateOn; - - @ApiModelProperty("最后修改人") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Long updateBy; - - @ApiModelProperty("是否删除") - @TableLogic - private Boolean deleted; - - @ApiModelProperty("置顶时间") - private LocalDateTime toppedTime; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Region.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Region.java deleted file mode 100644 index b9c55b1..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Region.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - *

- * Region - 地域实体 - *

- * - * @author WendyYang - * @since 10:33 2022/10/12 - */ -@Data -@TableName("nd_region") -public class Region implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - - private String regionCode; - - private String name; - - private Integer regionLevel; - - private String govUnit; - - private String parentCode; - - private Long parentId; - - private LocalDateTime createOn; - - private LocalDateTime updateOn; - - private Boolean deleted; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Resource.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Resource.java deleted file mode 100644 index 7d7a379..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Resource.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Size; -import java.time.LocalDateTime; - -import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; - -/** - *

- * 实体类 - * 资源 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -@TableName("c_resource") -@ApiModel(value = "Resource", description = "资源") -@AllArgsConstructor -public class Resource extends BaseEntity { - - private Long id; - - private static final long serialVersionUID = 1L; - - /** - * 编码 - */ - @ApiModelProperty(value = "编码") - @Size(max = 500, message = "编码长度不能超过500") - @TableField(value = "code", condition = LIKE) - private String code; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - @NotEmpty(message = "名称不能为空") - @Size(max = 255, message = "名称长度不能超过255") - @TableField(value = "name", condition = LIKE) - private String name; - - /** - * 菜单ID - * #c_menu - */ - @ApiModelProperty(value = "菜单ID") - @TableField("menu_id") - private Long menuId; - - /** - * 描述 - */ - @ApiModelProperty(value = "描述") - @Size(max = 255, message = "描述长度不能超过255") - @TableField(value = "describe_", condition = LIKE) - private String describe; - - /** - * 内置 - */ - @ApiModelProperty(value = "内置") - @TableField("readonly_") - private Boolean readonly; - - - @Builder - public Resource(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, - String code, String name, Long menuId, String describe, Boolean readonly) { - this.id = id; - this.createBy = createdBy; - this.createOn = createTime; - this.updateBy = updatedBy; - this.updateOn = updateTime; - this.code = code; - this.name = name; - this.menuId = menuId; - this.describe = describe; - this.readonly = readonly; - } - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Role.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Role.java deleted file mode 100644 index d69e997..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/Role.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Size; - -import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; - -/** - *

- * 实体类 - * 角色 - *

- * - * @author PoffyZhang - * @since 2022-09-30 - */ -@Data -@NoArgsConstructor -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -@TableName("nd_role") -@ApiModel(value = "Role", description = "角色") -@AllArgsConstructor -public class Role extends BaseEntity { - - private static final long serialVersionUID = 1L; - - @TableId(value = "id",type = IdType.AUTO) - private Long id; - - @ApiModelProperty(value = "名称") - private String name; - - @ApiModelProperty("角色编码") - private String code; - - - @ApiModelProperty(value = "描述") - private String describe; - - @ApiModelProperty(value = "管理角色ID") - private String manageRoleIds; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleAuthority.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleAuthority.java deleted file mode 100644 index dfb720c..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleAuthority.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.ningdatech.pmapi.sys.entity.enumeration.AuthorizeType; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.time.LocalDateTime; - -/** - *

- * 实体类 - * 角色的资源 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -@TableName("nd_role_authority") -@ApiModel(value = "RoleAuthority", description = "角色的资源") -@AllArgsConstructor -public class RoleAuthority extends BaseEntity { - - private static final long serialVersionUID = 1L; - - private Long id; - - /** - * 资源id - */ - @ApiModelProperty(value = "资源id") - @NotNull(message = "资源id不能为空") - @TableField("authority_id") - private Long authorityId; - - /** - * 权限类型 - * #AuthorizeType{MENU:菜单;RESOURCE:资源;} - */ - @ApiModelProperty(value = "权限类型") - @NotNull(message = "权限类型不能为空") - @TableField("authority_type") - private AuthorizeType authorityType; - - /** - * 角色id - * #c_role - */ - @ApiModelProperty(value = "角色id") - @NotNull(message = "角色id不能为空") - @TableField("role_id") - private Long roleId; - - - @Builder - public RoleAuthority(Long id, LocalDateTime createTime, Long createdBy, - Long authorityId, AuthorizeType authorityType, Long roleId) { - this.id = id; - this.createOn = createTime; - this.createBy = createdBy; - this.authorityId = authorityId; - this.authorityType = authorityType; - this.roleId = roleId; - } - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleMenu.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleMenu.java deleted file mode 100644 index 54f9875..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleMenu.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - *

- * - *

- * - * @author PoffyZhang - * @since 2022-11-11 - */ -@TableName("nd_role_menu") -@Data -@ApiModel(value = "RoleMenu对象", description = "") -@AllArgsConstructor -@NoArgsConstructor -public class RoleMenu implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty("id") - @TableId(value = "id", type = IdType.AUTO) - private Long id; - - @ApiModelProperty("menu_id") - private Long menuId; - - @ApiModelProperty("role_id") - private Long roleId; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleMenuDatascope.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleMenuDatascope.java deleted file mode 100644 index 83af92c..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/RoleMenuDatascope.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - *

- * 角色菜单数据权限关联表 - *

- * - * @author WendyYang - * @since 2023-01-28 - */ -@Data -@TableName("nd_role_menu_datascope") -@ApiModel(value = "NdRoleMenuDatascope对象", description = "角色菜单数据权限关联表") -public class RoleMenuDatascope extends BaseEntity { - - @ApiModelProperty("主键") - @TableId(type = IdType.AUTO) - private Long id; - - @ApiModelProperty("角色ID") - private Long roleId; - - @ApiModelProperty("菜单ID") - private Long menuId; - - @ApiModelProperty("数据权限") - private Integer datascope; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/UserRole.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/UserRole.java deleted file mode 100644 index b6dabc1..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/UserRole.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.ningdatech.pmapi.sys.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; - -/** - *

- * 实体类 - * 角色分配 - * 账号角色绑定 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@ToString(callSuper = true) -@Accessors(chain = true) -@TableName("nd_user_role") -@ApiModel(value = "UserRole", description = "角色分配") -public class UserRole { - - private static final long serialVersionUID = 1L; - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - - /** - * 角色ID - */ - @ApiModelProperty(value = "角色ID") - @NotNull(message = "角色ID不能为空") - @TableField("role_id") - private Long roleId; - - /** - * 用户ID - */ - @ApiModelProperty(value = "用户ID") - @NotNull(message = "用户ID不能为空") - @TableField("user_id") - private Long userId; - - - @Builder - public UserRole(Long roleId, Long userId) { - this.roleId = roleId; - this.userId = userId; - } - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuDataScopeDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuDataScopeDTO.java deleted file mode 100644 index 0f9ddd0..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuDataScopeDTO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - *

- * MenuDataScopeDTO - *

- * - * @author WendyYang - * @since 16:06 2023/1/28 - */ -@Data -public class MenuDataScopeDTO { - - @ApiModelProperty("菜单ID") - private Long menuId; - - @ApiModelProperty("数据权限") - private Integer dataScope; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuQueryDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuQueryDTO.java deleted file mode 100644 index 0571ff7..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuQueryDTO.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - *

- * 实体类 - * 菜单 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "MenuQueryDTO", description = "菜单") -public class MenuQueryDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - private Long id; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - private String name; - - /** - * 标题 - */ - @ApiModelProperty(value = "标题") - private String title; - - /** - * 类型 - */ - @ApiModelProperty(value = "类型") - private Integer type; - - /** - * 页面路径 - */ - @ApiModelProperty(value = "页面路径") - private String path; - - /** - * 图标 - */ - @ApiModelProperty(value = "图标") - private String icon; - - /** - * 组件 - */ - @ApiModelProperty(value = "组件") - private String component; - - /** - * 权限 - */ - @ApiModelProperty(value = "权限") - private String permission; - - /** - * 排序 - */ - @ApiModelProperty(value = "排序") - private Integer sort; - - /** - * 父菜单ID - */ - @ApiModelProperty(value = "父菜单ID") - private Long pid; - - /** - * activeMenu - */ - @ApiModelProperty(value = "activeMenu") - private String activeMenu; - - /** - * 跳转 - */ - @ApiModelProperty(value = "跳转") - private String redirect; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuSaveDTO.java deleted file mode 100644 index 7a5661b..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuSaveDTO.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - *

- * 实体类 - * 菜单 - *

- * - * @author WendyYang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "MenuSaveDTO", description = "菜单") -public class MenuSaveDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - private String name; - - /** - * 标题 - */ - @ApiModelProperty(value = "标题") - @NotEmpty(message = "请输入菜单标题") - private String title; - - /** - * 页面路径 - */ - @ApiModelProperty(value = "页面路径") - private String path; - - /** - * 图标 - */ - @ApiModelProperty(value = "图标") - private String icon; - - /** - * 组件 - */ - @ApiModelProperty(value = "组件") - private String component; - - /** - * 排序 - */ - @ApiModelProperty(value = "排序") - private Integer sort; - - /** - * 父菜单ID - */ - @ApiModelProperty(value = "父菜单ID") - private Long pid; - - /** - * 是否隐藏 0不隐藏 1隐藏 - */ - @ApiModelProperty(value = "是否隐藏") - private Integer hidden; - - /** - * activeMenu - */ - @ApiModelProperty(value = "activeMenu") - private String activeMenu; - - /** - * 跳转 - */ - @ApiModelProperty(value = "跳转") - private String redirect; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuUpdateDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuUpdateDTO.java deleted file mode 100644 index 03163c2..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/MenuUpdateDTO.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - *

- * 实体类 - * 菜单 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "MenuUpdateDTO", description = "菜单") -public class MenuUpdateDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "id") - @NotNull(message = "请传id") - private Long id; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - private String name; - - /** - * 标题 - */ - @ApiModelProperty(value = "标题") - private String title; - - /** - * 类型 - */ - @ApiModelProperty(value = "类型") - private Integer type; - - /** - * 页面路径 - */ - @ApiModelProperty(value = "页面路径") - private String path; - - /** - * 图标 - */ - @ApiModelProperty(value = "图标") - private String icon; - - /** - * 组件 - */ - @ApiModelProperty(value = "组件") - private String component; - - /** - * 排序 - */ - @ApiModelProperty(value = "排序") - private Integer sort; - - /** - * 父菜单ID - */ - @ApiModelProperty(value = "父菜单ID") - private Long pid; - - /** - * 是否隐藏 0不隐藏 1隐藏 - */ - @ApiModelProperty(value = "是否隐藏") - private Integer hidden; - - /** - * activeMenu - */ - @ApiModelProperty(value = "activeMenu") - private String activeMenu; - - /** - * 跳转 - */ - @ApiModelProperty(value = "跳转") - private String redirect; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RegionDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RegionDTO.java deleted file mode 100644 index e3f2db8..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RegionDTO.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import lombok.Builder; -import lombok.Data; -import lombok.experimental.Tolerate; - -/** - * @author liuxinxin - * @date 2022/7/22 上午9:12 - */ -@Data -@Builder -public class RegionDTO { - - @Tolerate - public RegionDTO() { - } - - /** - * 区域码 - */ - private String regionCode; - - /** - * 地区名 - */ - private String regionName; - - /** - * 地区级别 - */ - private Integer regionLevel; - - /** - * 地区父级code 当parent_code 为 -1 时为顶级区域 - */ - private String parentCode; - - /** - * 唯一编码:regionCode##regionName##regionLevel - */ - private String unionCode; - - private Long id; - - private Boolean deleted; - - private String govUnit; - - private Long parentId; - - public void unionCode() { - this.unionCode = String.format("%s##%s##%s", this.regionCode, this.regionName, this.regionLevel); - } - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RegionTreeDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RegionTreeDTO.java deleted file mode 100644 index c120ff8..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RegionTreeDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import lombok.Data; - -import java.util.List; - -/** - * @author liuxinxin - * @date 2022/7/22 上午9:08 - */ -@Data -public class RegionTreeDTO { - - /** - * 区域码 - */ - private String regionCode; - - /** - * 地区名 - */ - private String name; - - /** - * 地区级别 - */ - private Integer level; - - /** - * 地区父级code 当parent_code 为 -1 时为顶级区域 - */ - private String parentCode; - - private String unionCode; - - private List children; - - private Long id; - - private String mapData; - - private Boolean deleted; - - private String govUnit; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceQueryDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceQueryDTO.java deleted file mode 100644 index ff5f174..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceQueryDTO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 资源 查询DTO - * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -@ApiModel(value = "ResourceQueryDTO", description = "资源查询") -public class ResourceQueryDTO { - - /** - * 父资源id, 用于查询按钮 - */ - @ApiModelProperty(value = "菜单id", notes = "指定菜单id") - private Long menuId; - /** - * 登录人用户id - */ - @ApiModelProperty(value = "指定用户id", notes = "指定用户id,前端不传则自动获取") - private Long userId; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceSaveDTO.java deleted file mode 100644 index 008e733..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceSaveDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Size; -import java.io.Serializable; - -/** - *

- * 实体类 - * 资源 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "ResourceSaveDTO", description = "资源") -public class ResourceSaveDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 编码 - */ - @ApiModelProperty(value = "编码") - @Size(max = 500, message = "编码长度不能超过500") - private String code; - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - @NotEmpty(message = "名称不能为空") - @Size(max = 255, message = "名称长度不能超过255") - private String name; - /** - * 菜单ID - * #c_menu - */ - @ApiModelProperty(value = "菜单ID") - private Long menuId; - /** - * 描述 - */ - @ApiModelProperty(value = "描述") - @Size(max = 255, message = "描述长度不能超过255") - private String describe; - /** - * 内置 - */ - @ApiModelProperty(value = "内置") - private Boolean readonly; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceUpdateDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceUpdateDTO.java deleted file mode 100644 index 3394406..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/ResourceUpdateDTO.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import com.baomidou.mybatisplus.core.conditions.update.Update; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.io.Serializable; - -/** - *

- * 实体类 - * 资源 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "ResourceUpdateDTO", description = "资源") -public class ResourceUpdateDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @NotNull(message = "id不能为空", groups = Update.class) - private Long id; - - /** - * 编码 - */ - @ApiModelProperty(value = "编码") - @Size(max = 500, message = "编码长度不能超过500") - private String code; - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - @NotEmpty(message = "名称不能为空") - @Size(max = 255, message = "名称长度不能超过255") - private String name; - /** - * 菜单ID - * #c_menu - */ - @ApiModelProperty(value = "菜单ID") - private Long menuId; - /** - * 描述 - */ - @ApiModelProperty(value = "描述") - @Size(max = 255, message = "描述长度不能超过255") - private String describe; - /** - * 内置 - */ - @ApiModelProperty(value = "内置") - private Boolean readonly; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleAuthoritySaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleAuthoritySaveDTO.java deleted file mode 100644 index 0644697..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleAuthoritySaveDTO.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - *

- * 实体类 - * 角色的资源 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "RoleAuthoritySaveDTO", description = "角色的资源") -public class RoleAuthoritySaveDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 菜单ID - * #c_menu - */ - @ApiModelProperty(value = "资源ID") - private List menuIdList; - - /** - * 资源id - * #c_resource - */ - private List resourceIdList; - - /** - * 角色id - * #c_role - */ - @ApiModelProperty(value = "角色id") - @NotNull(message = "角色id不能为空") - private Long roleId; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RolePageReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RolePageReq.java deleted file mode 100644 index 95dda52..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RolePageReq.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import com.ningdatech.basic.model.PagePo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - *

- * 实体类 - * 角色 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "RolePageQuery", description = "角色") -public class RolePageReq extends PagePo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - private String name; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleQueryDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleQueryDTO.java deleted file mode 100644 index b4eb942..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleQueryDTO.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - *

- * 实体类 - * 角色 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "RoleQueryDTO", description = "角色") -public class RoleQueryDTO implements Serializable { - - private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "ID") - private Long id; - - /** - * 角色名称 - */ - @ApiModelProperty(value = "角色名称") - private String name; - /** - * 描述 - */ - @ApiModelProperty(value = "描述") - private String describe; - - /** - * 数据范围 - */ - @ApiModelProperty(value = "数据范围") - private Integer dataScope; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleSaveDTO.java deleted file mode 100644 index bf62cad..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleSaveDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Size; -import java.io.Serializable; -import java.util.List; - -/** - *

- * 实体类 - * 角色 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "RoleSaveDTO", description = "角色") -public class RoleSaveDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - @NotEmpty(message = "名称不能为空") - @Size(max = 50, message = "名称长度不能超过50") - private String name; - - /** - * 描述 - */ - @ApiModelProperty(value = "描述") - @Size(max = 200, message = "描述长度不能超过200") - private String describe; - - /** - * 数据范围 - */ - @ApiModelProperty(value = "管理角色ID") - private String manageRoleIds; - - /** - * 菜单id - */ - @ApiModelProperty(value = "菜单id") - private List menuIds; - - @ApiModelProperty("菜单数据权限") - private List menuDataScopeList; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleUpdateDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleUpdateDTO.java deleted file mode 100644 index 56a3a5b..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleUpdateDTO.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import com.baomidou.mybatisplus.core.conditions.update.Update; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.io.Serializable; -import java.util.List; - -/** - *

- * 实体类 - * 角色 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "RoleUpdateDTO", description = "角色") -public class RoleUpdateDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @NotNull(message = "id不能为空", groups = Update.class) - private Long id; - - @ApiModelProperty(value = "名称") - @Size(max = 50, message = "名称长度不能超过30") - private String name; - - @ApiModelProperty(value = "描述") - @Size(max = 200, message = "描述长度不能超过200") - private String describe; - - @ApiModelProperty(value = "菜单id") - private List menuIds; - - @ApiModelProperty(value = "管理角色ID") - private String manageRoleIds; - - @ApiModelProperty("菜单数据权限") - private List menuDataScopeList; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleUserSaveVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleUserSaveVO.java deleted file mode 100644 index 1e2549d..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/RoleUserSaveVO.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.io.Serializable; -import java.util.List; - -/** - *

- * 实体类 - * 角色下的员工 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "RoleUserSaveVO", description = "给角色分配员工") -public class RoleUserSaveVO implements Serializable { - - private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "绑定或取消") - @NotNull(message = "请填写绑定或取消参数") - private Boolean flag; - /** - * 角色;#c_role - */ - @ApiModelProperty(value = "角色") - @NotNull(message = "请选择角色") - private Long roleId; - /** - * 用户;#c_user - */ - @ApiModelProperty(value = "用户") - @Size(min = 1, message = "请选择用户") - private List userIdList; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/UserRoleSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/UserRoleSaveDTO.java deleted file mode 100644 index 799acd0..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/dto/UserRoleSaveDTO.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - *

- * 实体类 - * 角色分配 - * 账号角色绑定 - *

- * - * @author PoffyZhang - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Builder -@ApiModel(value = "UserRoleSaveDTO", description = "角色分配 账号角色绑定") -public class UserRoleSaveDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 角色ID - * #c_role - */ - @ApiModelProperty(value = "角色ID") - @NotNull(message = "请选择角色") - private Long roleId; - /** - * 用户ID - * #c_user - */ - @ApiModelProperty(value = "用户ID") - private List userIdList; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/AuthorizeType.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/AuthorizeType.java deleted file mode 100644 index 01da87e..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/AuthorizeType.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.enumeration; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; - -import java.util.stream.Stream; - -/** - *

- * 实体注释中生成的类型枚举 - * 角色的资源 - *

- * - * @author PoffyZhang - * @since 2022-09-30 - */ -@Getter -@AllArgsConstructor -@NoArgsConstructor -@ApiModel(value = "AuthorizeType", description = "权限类型-枚举") -public enum AuthorizeType { - - /** - * MENU="菜单" - */ - MENU("菜单"), - DATA("数据"), - /** - * RESOURCE="资源" - */ - RESOURCE("资源"); - - @ApiModelProperty(value = "描述") - private String desc; - - - /** - * 根据当前枚举的name匹配 - */ - public static AuthorizeType match(String val, AuthorizeType def) { - return Stream.of(values()).parallel().filter(item -> item.name().equalsIgnoreCase(val)).findAny().orElse(def); - } - - public static AuthorizeType get(String val) { - return match(val, null); - } - - public boolean eq(AuthorizeType val) { - return val != null && getCode().equals(val.name()); - } - - @ApiModelProperty(value = "编码", allowableValues = "MENU,RESOURCE", example = "MENU") - public String getCode() { - return this.name(); - } - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/DataScopeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/DataScopeEnum.java deleted file mode 100644 index 1843fce..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/DataScopeEnum.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.enumeration; - -import lombok.Getter; - -/** - *

- * DataScopeEnum - *

- * - * @author WendyYang - * @since 15:59 2023/1/28 - */ -@Getter -public enum DataScopeEnum { - - /** - * 数据权限可见范围 - */ - CURRENT_ORG("本单位", 1), - CURRENT_AND_SUB_ORG("本单位及下属单位", 2), - CURRENT_REGION("当前区域", 3), - CURRENT_CITY("全市", 4); - - private final String desc; - private final Integer code; - - DataScopeEnum(String desc, Integer code) { - this.code = code; - this.desc = desc; - } -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/MenuTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/MenuTypeEnum.java deleted file mode 100644 index 2e24913..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/enumeration/MenuTypeEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.enumeration; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; - -/** - * 资源类型 - * - * @author PoffyZhang - */ -@Getter -@AllArgsConstructor -@NoArgsConstructor -@ApiModel(value = "MenuTypeEnum", description = "资源类型-枚举") -public enum MenuTypeEnum { - /** - * 菜单 - */ - MENU(0, "菜单"), - - /** - * 按钮 - */ - BUTTON(1, "按钮"); - - /** - * 资源类型 - */ - private Integer code; - - /** - * 资源描述 - */ - private String desc; - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - @ApiModelProperty(value = "编码", allowableValues = "0,1", example = "0") - public Integer getCode() { - return this.code; - } - - - public boolean eq(String val) { - return this.name().equals(val); - } - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeListReq.java deleted file mode 100644 index 50e4a0e..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeListReq.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.req; - -import com.ningdatech.basic.model.PagePo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - *

- * NoticeListReq - *

- * - * @author WendyYang - * @since 00:32 2022/7/23 - */ -@Data -@ApiModel("公告查询参数类") -@EqualsAndHashCode(callSuper = true) -public class NoticeListReq extends PagePo { - - @ApiModelProperty("消息类型") - private Integer type; - - @ApiModelProperty("公告标题") - private String title; - - @ApiModelProperty("公告状态") - private Boolean enabled; - -} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeSaveReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeSaveReq.java deleted file mode 100644 index 778b7da..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeSaveReq.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - *

- * MsgUpdatePo - *

- * - * @author WendyYang - * @since 21:35 2022/7/21 - */ -@Data -@ApiModel("消息新增实体") -public class NoticeSaveReq { - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("通知标题") - @NotBlank(message = "通知标题不能为空") - private String title; - - @ApiModelProperty("通知类型") - @NotNull(message = "通知类型不能为空") - private Integer type; - - @ApiModelProperty("通知内容") - @NotBlank(message = "通知内容不能为空") - private String content; - - @ApiModelProperty("附件ID编码") - private String attachment; - - @ApiModelProperty("是否启用") - @NotNull(message = "是否启用不能为空") - private Boolean enabled; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeStatusModifyReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeStatusModifyReq.java deleted file mode 100644 index 76632fe..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/req/NoticeStatusModifyReq.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.req; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - *

- * NoticeStatusUpdatePo - *

- * - * @author WendyYang - * @since 22:32 2022/7/22 - */ -@Data -@ApiModel("消息状态修改") -public class NoticeStatusModifyReq { - - @ApiModelProperty("ID") - @NotNull(message = "ID不能为空") - private Long id; - - @ApiModelProperty("状态:true 启用、false 停用") - @NotNull(message = "状态不能为空") - private Boolean status; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuResourceTreeVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuResourceTreeVO.java deleted file mode 100644 index 0eb7b07..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuResourceTreeVO.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.vo; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.ningdatech.pmapi.sys.entity.enumeration.AuthorizeType; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.ToString; - -import javax.validation.constraints.Size; - -import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; - -/** - * menuList - * 菜单资源树 - * - * @author PoffyZhang - */ -@Data -@ToString(callSuper = true) -public class MenuResourceTreeVO { - - private AuthorizeType type; - private String code; - private String icon; - private Boolean isDef; - /** - * 描述 - */ - @ApiModelProperty(value = "描述") - @Size(max = 200, message = "描述长度不能超过200") - @TableField(value = "describe_", condition = LIKE) - private String describe; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuRoleVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuRoleVO.java deleted file mode 100644 index e7b4990..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuRoleVO.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.vo; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - *

- * 实体类 - * 菜单 - *

- * - * @author PoffyZhang - * @since 2022-9-30 - */ -@Data -@NoArgsConstructor -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -@ApiModel(value = "RoleMenuVO", description = "菜单") -@AllArgsConstructor -public class MenuRoleVO extends MenuTreeEntity { - - private static final long serialVersionUID = 1L; - - /** - * 权限" - */ - @ApiModelProperty(value = "权限") - private String permission; - /** - * 类型;[0-菜单 1-目录 2-按钮] - */ - @ApiModelProperty(value = "类型") - private Integer type; - - /** - * 组件 - */ - @ApiModelProperty(value = "组件") - private String component; - - /** - * 菜单图标 - */ - @ApiModelProperty(value = "菜单图标") - private String icon; - - /** - * 是否隐藏 - */ - @ApiModelProperty(value = "是否隐藏") - private Integer hidden; - - /** - * 是否有权限 - */ - @ApiModelProperty(value = "是否有权限 0没有 1有") - private Integer hasPermission = 0; - - /** - * activeMenu - */ - @ApiModelProperty(value = "activeMenu") - private String activeMenu; - - /** - * 跳转 - */ - @ApiModelProperty(value = "跳转") - @TableField(value = "redirect") - private String redirect; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuVO.java deleted file mode 100644 index 83ad8bd..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/MenuVO.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.vo; - -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - *

- * 实体类 - * 菜单 - *

- * - * @author PoffyZhang - * @since 2022-9-30 - */ -@Data -@NoArgsConstructor -@ToString(callSuper = true) -@Accessors(chain = true) -@ApiModel(value = "MenuVO", description = "菜单") -@AllArgsConstructor -@Builder -public class MenuVO { - - private static final long serialVersionUID = 1L; - - /** - * 权限" - */ - @ApiModelProperty(value = "权限") - private String permission; - /** - * 类型;[0-菜单 1按钮] - */ - @ApiModelProperty(value = "类型") - private Integer type; - - /** - * 组件 - */ - @ApiModelProperty(value = "组件") - private String component; - - /** - * 菜单图标 - */ - @ApiModelProperty(value = "菜单图标") - private String icon; - - /** - * 子菜单数目 - */ - @ApiModelProperty(value = "是否隐藏") - private Integer hidden; - - /** - * activeMenu - */ - @ApiModelProperty(value = "activeMenu") - private String activeMenu; - - /** - * 跳转 - */ - @ApiModelProperty(value = "跳转") - @TableField(value = "redirect") - private String redirect; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/NoticeDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/NoticeDetailVO.java deleted file mode 100644 index 2e94174..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/NoticeDetailVO.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.vo; - -import com.ningdatech.file.entity.vo.result.AttachFileVo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - *

- * NoticeDetailVo - *

- * - * @author WendyYang - * @since 16:56 2022/7/22 - */ -@Data -@ApiModel("公告详情") -public class NoticeDetailVO { - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("标题") - private String title; - - @ApiModelProperty("内容") - private String content; - - @ApiModelProperty("状态") - private Boolean enabled; - - @ApiModelProperty("公告类型") - private Integer type; - - @ApiModelProperty("附件信息") - private List attachments; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/NoticeListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/NoticeListItemVO.java deleted file mode 100644 index d3ef592..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/NoticeListItemVO.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; -import lombok.Data; -import lombok.experimental.Tolerate; - -import java.time.LocalDateTime; - -/** - *

- * ManageNoticeListItem - *

- * - * @author WendyYang - * @since 00:30 2022/7/23 - */ -@Data -@Builder -public class NoticeListItemVO { - - @Tolerate - public NoticeListItemVO() { - } - - @ApiModelProperty("公告ID") - private Long id; - - @ApiModelProperty("公告类型") - private Integer type; - - @ApiModelProperty("标题") - private String title; - - @ApiModelProperty("创建时间") - private LocalDateTime createOn; - - @ApiModelProperty("是否启用") - private Boolean enabled; - - @ApiModelProperty("是否置顶") - private Boolean topped; - -} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/RegionTreeVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/RegionTreeVO.java deleted file mode 100644 index cc06d5f..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/RegionTreeVO.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.ToString; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - *

- * RegionTreeVO - *

- * - * @author WendyYang - * @since 10:35 2022/10/12 - */ -@Data -@ToString(callSuper = true) -@ApiModel(value = "RegionTreeVO", description = "区域树状结构VO") -public class RegionTreeVO { - - private Long id; - - @ApiModelProperty("区域码") - @NotBlank(message = "地区编码不能为空") - private String regionCode; - - @ApiModelProperty("地区名") - @NotBlank(message = "地区名称不能为空") - private String name; - - @ApiModelProperty("级别") - @NotNull(message = "级别不能为空") - private Integer regionLevel; - - @ApiModelProperty("区域级别") - @NotBlank(message = "区域级别不能为空") - private String govUnit; - - @ApiModelProperty("地区父级编码:-1为顶级区域") - @NotBlank(message = "地区父级编码不能为空") - private String parentCode; - - @ApiModelProperty("子区域") - private List children; - - @ApiModelProperty("唯一编码:regionCode##name##level") - private String unionCode; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/RoleVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/RoleVO.java deleted file mode 100644 index 9945b7c..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/entity/vo/RoleVO.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.ningdatech.pmapi.sys.entity.vo; - -import com.ningdatech.pmapi.sys.entity.BaseEntity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - *

- * 实体类 - * 角色 - *

- * - * @author PoffyZhang - * @since 2022-09-30 - */ -@Data -@NoArgsConstructor -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -@ApiModel(value = "Role", description = "角色") -@AllArgsConstructor -@Builder -public class RoleVO extends BaseEntity { - - private Long id; - - private static final long serialVersionUID = 1L; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - private String name; - - /** - * 描述 - */ - @ApiModelProperty(value = "描述") - private String describe; - - /** - * 数据范围 - */ - @ApiModelProperty(value = "数据范围 1全部 2本区域 3本区域以及下区域 4本公司") - private Integer dataScope; - - /** - * 菜单 - */ - @ApiModelProperty(value = "菜单") - private List menu; -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java index e6dabd7..d5cb44f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java @@ -5,9 +5,9 @@ import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.util.TreeUtil; -import com.ningdatech.pmapi.sys.entity.Menu; -import com.ningdatech.pmapi.sys.entity.RoleMenu; -import com.ningdatech.pmapi.sys.entity.vo.MenuRoleVO; +import com.ningdatech.pmapi.sys.model.entity.Menu; +import com.ningdatech.pmapi.sys.model.entity.RoleMenu; +import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; import com.ningdatech.pmapi.sys.service.IRoleMenuService; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; import lombok.RequiredArgsConstructor; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java index 3c48244..ad11871 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java @@ -11,12 +11,12 @@ import com.ningdatech.basic.util.CollUtils; import com.ningdatech.file.entity.vo.result.AttachFileVo; import com.ningdatech.file.service.FileService; import com.ningdatech.pmapi.common.util.BizUtils; -import com.ningdatech.pmapi.sys.entity.Notice; -import com.ningdatech.pmapi.sys.entity.req.NoticeListReq; -import com.ningdatech.pmapi.sys.entity.req.NoticeSaveReq; -import com.ningdatech.pmapi.sys.entity.req.NoticeStatusModifyReq; -import com.ningdatech.pmapi.sys.entity.vo.NoticeDetailVO; -import com.ningdatech.pmapi.sys.entity.vo.NoticeListItemVO; +import com.ningdatech.pmapi.sys.model.entity.Notice; +import com.ningdatech.pmapi.sys.model.req.NoticeListReq; +import com.ningdatech.pmapi.sys.model.req.NoticeSaveReq; +import com.ningdatech.pmapi.sys.model.req.NoticeStatusModifyReq; +import com.ningdatech.pmapi.sys.model.vo.NoticeDetailVO; +import com.ningdatech.pmapi.sys.model.vo.NoticeListItemVO; import com.ningdatech.pmapi.sys.service.INoticeService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java index 3f5e946..61f36b8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java @@ -2,8 +2,8 @@ package com.ningdatech.pmapi.sys.manage; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.sys.convert.RegionConverter; -import com.ningdatech.pmapi.sys.entity.dto.RegionDTO; -import com.ningdatech.pmapi.sys.entity.vo.RegionTreeVO; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; +import com.ningdatech.pmapi.sys.model.vo.RegionTreeVO; import com.ningdatech.pmapi.sys.service.IRegionService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java index 102af3e..1f9e7b1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java @@ -6,12 +6,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.sys.entity.Menu; -import com.ningdatech.pmapi.sys.entity.Role; -import com.ningdatech.pmapi.sys.entity.RoleMenu; -import com.ningdatech.pmapi.sys.entity.dto.RolePageReq; -import com.ningdatech.pmapi.sys.entity.vo.MenuRoleVO; -import com.ningdatech.pmapi.sys.entity.vo.RoleVO; +import com.ningdatech.pmapi.sys.model.entity.Menu; +import com.ningdatech.pmapi.sys.model.entity.Role; +import com.ningdatech.pmapi.sys.model.entity.RoleMenu; +import com.ningdatech.pmapi.sys.model.req.RolePageReq; +import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; +import com.ningdatech.pmapi.sys.model.vo.RoleVO; import com.ningdatech.pmapi.sys.service.IRoleMenuService; import com.ningdatech.pmapi.sys.service.IMenuService; import com.ningdatech.pmapi.sys.service.IRoleService; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/MenuMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/MenuMapper.java index bb0224a..36034ee 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/MenuMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/MenuMapper.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ningdatech.pmapi.sys.entity.Menu; +import com.ningdatech.pmapi.sys.model.entity.Menu; import org.springframework.stereotype.Repository; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/NoticeMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/NoticeMapper.java index 048c439..943f9b6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/NoticeMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/NoticeMapper.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ningdatech.pmapi.sys.entity.Notice; +import com.ningdatech.pmapi.sys.model.entity.Notice; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RegionMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RegionMapper.java index ff3bc43..1dc0d26 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RegionMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RegionMapper.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ningdatech.pmapi.sys.entity.Region; +import com.ningdatech.pmapi.sys.model.entity.Region; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/ResourceMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/ResourceMapper.java index 32b995d..994941a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/ResourceMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/ResourceMapper.java @@ -1,8 +1,8 @@ package com.ningdatech.pmapi.sys.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ningdatech.pmapi.sys.entity.Resource; -import com.ningdatech.pmapi.sys.entity.dto.ResourceQueryDTO; +import com.ningdatech.pmapi.sys.model.entity.Resource; +import com.ningdatech.pmapi.sys.model.dto.ResourceQueryDTO; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/ResourceMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/ResourceMapper.xml index f07bbb5..5731ee5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/ResourceMapper.xml +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/ResourceMapper.xml @@ -3,7 +3,7 @@ - + @@ -35,7 +35,7 @@ ) - + insert into nd_resource ( id, created_by, create_time, updated_by, update_time, code, name, menu_id, describe_) values (#{id,jdbcType=BIGINT}, #{createUser,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},#{updateUser,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMapper.java index db19c23..c64ecfc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMapper.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ningdatech.pmapi.sys.entity.Role; +import com.ningdatech.pmapi.sys.model.entity.Role; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMapper.xml index 901186c..69bb2f7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMapper.xml +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMapper.xml @@ -3,7 +3,7 @@ - + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMenuDatascopeMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMenuDatascopeMapper.java index d46f5b2..ca57450 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMenuDatascopeMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMenuDatascopeMapper.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.sys.mapper; -import com.ningdatech.pmapi.sys.entity.RoleMenuDatascope; +import com.ningdatech.pmapi.sys.model.entity.RoleMenuDatascope; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMenuMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMenuMapper.java index be35845..26d30cf 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMenuMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/RoleMenuMapper.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ningdatech.pmapi.sys.entity.RoleMenu; +import com.ningdatech.pmapi.sys.model.entity.RoleMenu; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/UserRoleMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/UserRoleMapper.java index c975b26..bede1c0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/UserRoleMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/mapper/UserRoleMapper.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ningdatech.pmapi.sys.entity.UserRole; +import com.ningdatech.pmapi.sys.model.entity.UserRole; import org.springframework.stereotype.Repository; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuDataScopeDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuDataScopeDTO.java new file mode 100644 index 0000000..62bd211 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuDataScopeDTO.java @@ -0,0 +1,23 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + *

+ * MenuDataScopeDTO + *

+ * + * @author WendyYang + * @since 16:06 2023/1/28 + */ +@Data +public class MenuDataScopeDTO { + + @ApiModelProperty("菜单ID") + private Long menuId; + + @ApiModelProperty("数据权限") + private Integer dataScope; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuQueryDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuQueryDTO.java new file mode 100644 index 0000000..bb4a49b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuQueryDTO.java @@ -0,0 +1,97 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + *

+ * 实体类 + * 菜单 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "MenuQueryDTO", description = "菜单") +public class MenuQueryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long id; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + private String name; + + /** + * 标题 + */ + @ApiModelProperty(value = "标题") + private String title; + + /** + * 类型 + */ + @ApiModelProperty(value = "类型") + private Integer type; + + /** + * 页面路径 + */ + @ApiModelProperty(value = "页面路径") + private String path; + + /** + * 图标 + */ + @ApiModelProperty(value = "图标") + private String icon; + + /** + * 组件 + */ + @ApiModelProperty(value = "组件") + private String component; + + /** + * 权限 + */ + @ApiModelProperty(value = "权限") + private String permission; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + private Integer sort; + + /** + * 父菜单ID + */ + @ApiModelProperty(value = "父菜单ID") + private Long pid; + + /** + * activeMenu + */ + @ApiModelProperty(value = "activeMenu") + private String activeMenu; + + /** + * 跳转 + */ + @ApiModelProperty(value = "跳转") + private String redirect; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuSaveDTO.java new file mode 100644 index 0000000..e2c8f5e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuSaveDTO.java @@ -0,0 +1,91 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; + +/** + *

+ * 实体类 + * 菜单 + *

+ * + * @author WendyYang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "MenuSaveDTO", description = "菜单") +public class MenuSaveDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + private String name; + + /** + * 标题 + */ + @ApiModelProperty(value = "标题") + @NotEmpty(message = "请输入菜单标题") + private String title; + + /** + * 页面路径 + */ + @ApiModelProperty(value = "页面路径") + private String path; + + /** + * 图标 + */ + @ApiModelProperty(value = "图标") + private String icon; + + /** + * 组件 + */ + @ApiModelProperty(value = "组件") + private String component; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + private Integer sort; + + /** + * 父菜单ID + */ + @ApiModelProperty(value = "父菜单ID") + private Long pid; + + /** + * 是否隐藏 0不隐藏 1隐藏 + */ + @ApiModelProperty(value = "是否隐藏") + private Integer hidden; + + /** + * activeMenu + */ + @ApiModelProperty(value = "activeMenu") + private String activeMenu; + + /** + * 跳转 + */ + @ApiModelProperty(value = "跳转") + private String redirect; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuUpdateDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuUpdateDTO.java new file mode 100644 index 0000000..ee76257 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/MenuUpdateDTO.java @@ -0,0 +1,100 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + *

+ * 实体类 + * 菜单 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "MenuUpdateDTO", description = "菜单") +public class MenuUpdateDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @NotNull(message = "请传id") + private Long id; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + private String name; + + /** + * 标题 + */ + @ApiModelProperty(value = "标题") + private String title; + + /** + * 类型 + */ + @ApiModelProperty(value = "类型") + private Integer type; + + /** + * 页面路径 + */ + @ApiModelProperty(value = "页面路径") + private String path; + + /** + * 图标 + */ + @ApiModelProperty(value = "图标") + private String icon; + + /** + * 组件 + */ + @ApiModelProperty(value = "组件") + private String component; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + private Integer sort; + + /** + * 父菜单ID + */ + @ApiModelProperty(value = "父菜单ID") + private Long pid; + + /** + * 是否隐藏 0不隐藏 1隐藏 + */ + @ApiModelProperty(value = "是否隐藏") + private Integer hidden; + + /** + * activeMenu + */ + @ApiModelProperty(value = "activeMenu") + private String activeMenu; + + /** + * 跳转 + */ + @ApiModelProperty(value = "跳转") + private String redirect; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RegionDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RegionDTO.java new file mode 100644 index 0000000..b0d82dc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RegionDTO.java @@ -0,0 +1,56 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import lombok.Builder; +import lombok.Data; +import lombok.experimental.Tolerate; + +/** + * @author liuxinxin + * @date 2022/7/22 上午9:12 + */ +@Data +@Builder +public class RegionDTO { + + @Tolerate + public RegionDTO() { + } + + /** + * 区域码 + */ + private String regionCode; + + /** + * 地区名 + */ + private String regionName; + + /** + * 地区级别 + */ + private Integer regionLevel; + + /** + * 地区父级code 当parent_code 为 -1 时为顶级区域 + */ + private String parentCode; + + /** + * 唯一编码:regionCode##regionName##regionLevel + */ + private String unionCode; + + private Long id; + + private Boolean deleted; + + private String govUnit; + + private Long parentId; + + public void unionCode() { + this.unionCode = String.format("%s##%s##%s", this.regionCode, this.regionName, this.regionLevel); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RegionTreeDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RegionTreeDTO.java new file mode 100644 index 0000000..e4a63d8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RegionTreeDTO.java @@ -0,0 +1,46 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/22 上午9:08 + */ +@Data +public class RegionTreeDTO { + + /** + * 区域码 + */ + private String regionCode; + + /** + * 地区名 + */ + private String name; + + /** + * 地区级别 + */ + private Integer level; + + /** + * 地区父级code 当parent_code 为 -1 时为顶级区域 + */ + private String parentCode; + + private String unionCode; + + private List children; + + private Long id; + + private String mapData; + + private Boolean deleted; + + private String govUnit; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceQueryDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceQueryDTO.java new file mode 100644 index 0000000..19460f0 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceQueryDTO.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.sys.model.dto; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 资源 查询DTO + * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ApiModel(value = "ResourceQueryDTO", description = "资源查询") +public class ResourceQueryDTO { + + /** + * 父资源id, 用于查询按钮 + */ + @ApiModelProperty(value = "菜单id", notes = "指定菜单id") + private Long menuId; + /** + * 登录人用户id + */ + @ApiModelProperty(value = "指定用户id", notes = "指定用户id,前端不传则自动获取") + private Long userId; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceSaveDTO.java new file mode 100644 index 0000000..1f1e542 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceSaveDTO.java @@ -0,0 +1,63 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + *

+ * 实体类 + * 资源 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "ResourceSaveDTO", description = "资源") +public class ResourceSaveDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 编码 + */ + @ApiModelProperty(value = "编码") + @Size(max = 500, message = "编码长度不能超过500") + private String code; + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @NotEmpty(message = "名称不能为空") + @Size(max = 255, message = "名称长度不能超过255") + private String name; + /** + * 菜单ID + * #c_menu + */ + @ApiModelProperty(value = "菜单ID") + private Long menuId; + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + @Size(max = 255, message = "描述长度不能超过255") + private String describe; + /** + * 内置 + */ + @ApiModelProperty(value = "内置") + private Boolean readonly; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceUpdateDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceUpdateDTO.java new file mode 100644 index 0000000..d0b4a83 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/ResourceUpdateDTO.java @@ -0,0 +1,68 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import com.baomidou.mybatisplus.core.conditions.update.Update; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + *

+ * 实体类 + * 资源 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "ResourceUpdateDTO", description = "资源") +public class ResourceUpdateDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + @NotNull(message = "id不能为空", groups = Update.class) + private Long id; + + /** + * 编码 + */ + @ApiModelProperty(value = "编码") + @Size(max = 500, message = "编码长度不能超过500") + private String code; + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @NotEmpty(message = "名称不能为空") + @Size(max = 255, message = "名称长度不能超过255") + private String name; + /** + * 菜单ID + * #c_menu + */ + @ApiModelProperty(value = "菜单ID") + private Long menuId; + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + @Size(max = 255, message = "描述长度不能超过255") + private String describe; + /** + * 内置 + */ + @ApiModelProperty(value = "内置") + private Boolean readonly; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleAuthoritySaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleAuthoritySaveDTO.java new file mode 100644 index 0000000..0a31804 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleAuthoritySaveDTO.java @@ -0,0 +1,53 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 实体类 + * 角色的资源 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "RoleAuthoritySaveDTO", description = "角色的资源") +public class RoleAuthoritySaveDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 菜单ID + * #c_menu + */ + @ApiModelProperty(value = "资源ID") + private List menuIdList; + + /** + * 资源id + * #c_resource + */ + private List resourceIdList; + + /** + * 角色id + * #c_role + */ + @ApiModelProperty(value = "角色id") + @NotNull(message = "角色id不能为空") + private Long roleId; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleQueryDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleQueryDTO.java new file mode 100644 index 0000000..0e4aa72 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleQueryDTO.java @@ -0,0 +1,48 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + *

+ * 实体类 + * 角色 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "RoleQueryDTO", description = "角色") +public class RoleQueryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "ID") + private Long id; + + /** + * 角色名称 + */ + @ApiModelProperty(value = "角色名称") + private String name; + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + private String describe; + + /** + * 数据范围 + */ + @ApiModelProperty(value = "数据范围") + private Integer dataScope; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleSaveDTO.java new file mode 100644 index 0000000..1825893 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleSaveDTO.java @@ -0,0 +1,63 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 实体类 + * 角色 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "RoleSaveDTO", description = "角色") +public class RoleSaveDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @NotEmpty(message = "名称不能为空") + @Size(max = 50, message = "名称长度不能超过50") + private String name; + + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + @Size(max = 200, message = "描述长度不能超过200") + private String describe; + + /** + * 数据范围 + */ + @ApiModelProperty(value = "管理角色ID") + private String manageRoleIds; + + /** + * 菜单id + */ + @ApiModelProperty(value = "菜单id") + private List menuIds; + + @ApiModelProperty("菜单数据权限") + private List menuDataScopeList; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleUpdateDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleUpdateDTO.java new file mode 100644 index 0000000..ab3642b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/RoleUpdateDTO.java @@ -0,0 +1,55 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import com.baomidou.mybatisplus.core.conditions.update.Update; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 实体类 + * 角色 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "RoleUpdateDTO", description = "角色") +public class RoleUpdateDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + @NotNull(message = "id不能为空", groups = Update.class) + private Long id; + + @ApiModelProperty(value = "名称") + @Size(max = 50, message = "名称长度不能超过30") + private String name; + + @ApiModelProperty(value = "描述") + @Size(max = 200, message = "描述长度不能超过200") + private String describe; + + @ApiModelProperty(value = "菜单id") + private List menuIds; + + @ApiModelProperty(value = "管理角色ID") + private String manageRoleIds; + + @ApiModelProperty("菜单数据权限") + private List menuDataScopeList; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/UserRoleSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/UserRoleSaveDTO.java new file mode 100644 index 0000000..dddd7dc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/dto/UserRoleSaveDTO.java @@ -0,0 +1,47 @@ +package com.ningdatech.pmapi.sys.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 实体类 + * 角色分配 + * 账号角色绑定 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "UserRoleSaveDTO", description = "角色分配 账号角色绑定") +public class UserRoleSaveDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 角色ID + * #c_role + */ + @ApiModelProperty(value = "角色ID") + @NotNull(message = "请选择角色") + private Long roleId; + /** + * 用户ID + * #c_user + */ + @ApiModelProperty(value = "用户ID") + private List userIdList; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/BaseEntity.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/BaseEntity.java new file mode 100644 index 0000000..56c4cba --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/BaseEntity.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 通用字段, is_del 根据需求自行添加 + *

+ * + * @author WendyYang + * @since 11:01 2023/1/28 + */ +@Getter +@Setter +public class BaseEntity implements Serializable { + + @ApiModelProperty("创建人userId") + protected Long createBy; + + @ApiModelProperty("最后修改人userId") + protected Long updateBy; + + @ApiModelProperty("创建时间") + protected LocalDateTime createOn; + + @ApiModelProperty("修改时间") + protected LocalDateTime updateOn; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java new file mode 100644 index 0000000..a1ec156 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java @@ -0,0 +1,73 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.Size; +import java.time.LocalDateTime; + +import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; + +/** + *

+ * 实体类 + * 菜单 + *

+ * + * @author PoffyZhang + * @since 2022-9-30 + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@TableName("nd_menu") +@ApiModel(value = "Menu", description = "菜单") +@AllArgsConstructor +public class Menu extends MenuTreeEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "组件") + @Size(max = 255, message = "组件长度不能超过255") + @TableField(value = "component", condition = LIKE) + private String component; + + @ApiModelProperty(value = "菜单图标") + @Size(max = 255, message = "菜单图标长度不能超过255") + @TableField(value = "icon", condition = LIKE) + private String icon; + + @ApiModelProperty(value = "是否隐藏") + @TableField(value = "hidden") + private Boolean hidden; + + @ApiModelProperty(value = "activeMenu") + @TableField(value = "active_menu") + private String activeMenu; + + @ApiModelProperty(value = "跳转") + @TableField(value = "redirect") + private String redirect; + + @ApiModelProperty("是否有数据权限") + private Boolean hasDataScope; + + @ApiModelProperty("数据权限选项") + private String dataScopeOption; + + private Long updateBy; + + private Long createBy; + + private LocalDateTime updateOn; + + private LocalDateTime createOn; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Notice.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Notice.java new file mode 100644 index 0000000..9a84893 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Notice.java @@ -0,0 +1,68 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 系统通知 + *

+ * + * @author WendyYang + * @since 2022-07-21 + */ +@Data +@TableName("nd_notice") +@ApiModel(value = "SysNotice对象", description = "系统通知") +public class Notice implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("ID") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("消息类型") + private Integer type; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("内容") + private String content; + + @ApiModelProperty("启用禁用") + private Boolean enabled; + + @ApiModelProperty("附件ID") + private String attachment; + + @ApiModelProperty("创建时间") + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createOn; + + @ApiModelProperty("创建人id") + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + @ApiModelProperty("最后修改时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateOn; + + @ApiModelProperty("最后修改人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updateBy; + + @ApiModelProperty("是否删除") + @TableLogic + private Boolean deleted; + + @ApiModelProperty("置顶时间") + private LocalDateTime toppedTime; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Region.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Region.java new file mode 100644 index 0000000..9cd09d9 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Region.java @@ -0,0 +1,46 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * Region - 地域实体 + *

+ * + * @author WendyYang + * @since 10:33 2022/10/12 + */ +@Data +@TableName("nd_region") +public class Region implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String regionCode; + + private String name; + + private Integer regionLevel; + + private String govUnit; + + private String parentCode; + + private Long parentId; + + private LocalDateTime createOn; + + private LocalDateTime updateOn; + + private Boolean deleted; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Resource.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Resource.java new file mode 100644 index 0000000..90e147b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Resource.java @@ -0,0 +1,94 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.Size; +import java.time.LocalDateTime; + +import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; + +/** + *

+ * 实体类 + * 资源 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@TableName("c_resource") +@ApiModel(value = "Resource", description = "资源") +@AllArgsConstructor +public class Resource extends BaseEntity { + + private Long id; + + private static final long serialVersionUID = 1L; + + /** + * 编码 + */ + @ApiModelProperty(value = "编码") + @Size(max = 500, message = "编码长度不能超过500") + @TableField(value = "code", condition = LIKE) + private String code; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @NotEmpty(message = "名称不能为空") + @Size(max = 255, message = "名称长度不能超过255") + @TableField(value = "name", condition = LIKE) + private String name; + + /** + * 菜单ID + * #c_menu + */ + @ApiModelProperty(value = "菜单ID") + @TableField("menu_id") + private Long menuId; + + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + @Size(max = 255, message = "描述长度不能超过255") + @TableField(value = "describe_", condition = LIKE) + private String describe; + + /** + * 内置 + */ + @ApiModelProperty(value = "内置") + @TableField("readonly_") + private Boolean readonly; + + + @Builder + public Resource(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, + String code, String name, Long menuId, String describe, Boolean readonly) { + this.id = id; + this.createBy = createdBy; + this.createOn = createTime; + this.updateBy = updatedBy; + this.updateOn = updateTime; + this.code = code; + this.name = name; + this.menuId = menuId; + this.describe = describe; + this.readonly = readonly; + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Role.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Role.java new file mode 100644 index 0000000..c31889a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Role.java @@ -0,0 +1,48 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +/** + *

+ * 实体类 + * 角色 + *

+ * + * @author PoffyZhang + * @since 2022-09-30 + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@TableName("nd_role") +@ApiModel(value = "Role", description = "角色") +@AllArgsConstructor +public class Role extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id",type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty("角色编码") + private String code; + + + @ApiModelProperty(value = "描述") + private String describe; + + @ApiModelProperty(value = "管理角色ID") + private String manageRoleIds; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleAuthority.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleAuthority.java new file mode 100644 index 0000000..68c7567 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleAuthority.java @@ -0,0 +1,74 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ningdatech.pmapi.sys.model.enumeration.AuthorizeTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +/** + *

+ * 实体类 + * 角色的资源 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@TableName("nd_role_authority") +@ApiModel(value = "RoleAuthority", description = "角色的资源") +@AllArgsConstructor +public class RoleAuthority extends BaseEntity { + + private static final long serialVersionUID = 1L; + + private Long id; + + /** + * 资源id + */ + @ApiModelProperty(value = "资源id") + @NotNull(message = "资源id不能为空") + @TableField("authority_id") + private Long authorityId; + + /** + * 权限类型 + * #AuthorizeType{MENU:菜单;RESOURCE:资源;} + */ + @ApiModelProperty(value = "权限类型") + @NotNull(message = "权限类型不能为空") + @TableField("authority_type") + private AuthorizeTypeEnum authorityType; + + /** + * 角色id + * #c_role + */ + @ApiModelProperty(value = "角色id") + @NotNull(message = "角色id不能为空") + @TableField("role_id") + private Long roleId; + + + @Builder + public RoleAuthority(Long id, LocalDateTime createTime, Long createdBy, + Long authorityId, AuthorizeTypeEnum authorityType, Long roleId) { + this.id = id; + this.createOn = createTime; + this.createBy = createdBy; + this.authorityId = authorityId; + this.authorityType = authorityType; + this.roleId = roleId; + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleMenu.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleMenu.java new file mode 100644 index 0000000..c496ff5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleMenu.java @@ -0,0 +1,40 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + *

+ * + *

+ * + * @author PoffyZhang + * @since 2022-11-11 + */ +@TableName("nd_role_menu") +@Data +@ApiModel(value = "RoleMenu对象", description = "") +@AllArgsConstructor +@NoArgsConstructor +public class RoleMenu implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty("menu_id") + private Long menuId; + + @ApiModelProperty("role_id") + private Long roleId; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleMenuDatascope.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleMenuDatascope.java new file mode 100644 index 0000000..2516d8e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/RoleMenuDatascope.java @@ -0,0 +1,36 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + *

+ * 角色菜单数据权限关联表 + *

+ * + * @author WendyYang + * @since 2023-01-28 + */ +@Data +@TableName("nd_role_menu_datascope") +@ApiModel(value = "NdRoleMenuDatascope对象", description = "角色菜单数据权限关联表") +public class RoleMenuDatascope extends BaseEntity { + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("角色ID") + private Long roleId; + + @ApiModelProperty("菜单ID") + private Long menuId; + + @ApiModelProperty("数据权限") + private Integer datascope; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/UserRole.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/UserRole.java new file mode 100644 index 0000000..d646231 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/UserRole.java @@ -0,0 +1,62 @@ +package com.ningdatech.pmapi.sys.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; + +/** + *

+ * 实体类 + * 角色分配 + * 账号角色绑定 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@Accessors(chain = true) +@TableName("nd_user_role") +@ApiModel(value = "UserRole", description = "角色分配") +public class UserRole { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 角色ID + */ + @ApiModelProperty(value = "角色ID") + @NotNull(message = "角色ID不能为空") + @TableField("role_id") + private Long roleId; + + /** + * 用户ID + */ + @ApiModelProperty(value = "用户ID") + @NotNull(message = "用户ID不能为空") + @TableField("user_id") + private Long userId; + + + @Builder + public UserRole(Long roleId, Long userId) { + this.roleId = roleId; + this.userId = userId; + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/AuthorizeTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/AuthorizeTypeEnum.java new file mode 100644 index 0000000..936f3cc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/AuthorizeTypeEnum.java @@ -0,0 +1,60 @@ +package com.ningdatech.pmapi.sys.model.enumeration; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.stream.Stream; + +/** + *

+ * 实体注释中生成的类型枚举 + * 角色的资源 + *

+ * + * @author PoffyZhang + * @since 2022-09-30 + */ +@Getter +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "AuthorizeType", description = "权限类型-枚举") +public enum AuthorizeTypeEnum { + + /** + * MENU="菜单" + */ + MENU("菜单"), + DATA("数据"), + /** + * RESOURCE="资源" + */ + RESOURCE("资源"); + + @ApiModelProperty(value = "描述") + private String desc; + + + /** + * 根据当前枚举的name匹配 + */ + public static AuthorizeTypeEnum match(String val, AuthorizeTypeEnum def) { + return Stream.of(values()).parallel().filter(item -> item.name().equalsIgnoreCase(val)).findAny().orElse(def); + } + + public static AuthorizeTypeEnum get(String val) { + return match(val, null); + } + + public boolean eq(AuthorizeTypeEnum val) { + return val != null && getCode().equals(val.name()); + } + + @ApiModelProperty(value = "编码", allowableValues = "MENU,RESOURCE", example = "MENU") + public String getCode() { + return this.name(); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/DataScopeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/DataScopeEnum.java new file mode 100644 index 0000000..2180d53 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/DataScopeEnum.java @@ -0,0 +1,31 @@ +package com.ningdatech.pmapi.sys.model.enumeration; + +import lombok.Getter; + +/** + *

+ * DataScopeEnum + *

+ * + * @author WendyYang + * @since 15:59 2023/1/28 + */ +@Getter +public enum DataScopeEnum { + + /** + * 数据权限可见范围 + */ + CURRENT_ORG("本单位", 1), + CURRENT_AND_SUB_ORG("本单位及下属单位", 2), + CURRENT_REGION("当前区域", 3), + CURRENT_CITY("全市", 4); + + private final String desc; + private final Integer code; + + DataScopeEnum(String desc, Integer code) { + this.code = code; + this.desc = desc; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/MenuTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/MenuTypeEnum.java new file mode 100644 index 0000000..96dc4ba --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/MenuTypeEnum.java @@ -0,0 +1,57 @@ +package com.ningdatech.pmapi.sys.model.enumeration; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * 资源类型 + * + * @author PoffyZhang + */ +@Getter +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "MenuTypeEnum", description = "资源类型-枚举") +public enum MenuTypeEnum { + /** + * 菜单 + */ + MENU(0, "菜单"), + + /** + * 按钮 + */ + BUTTON(1, "按钮"); + + /** + * 资源类型 + */ + private Integer code; + + /** + * 资源描述 + */ + private String desc; + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + @ApiModelProperty(value = "编码", allowableValues = "0,1", example = "0") + public Integer getCode() { + return this.code; + } + + + public boolean eq(String val) { + return this.name().equals(val); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeListReq.java new file mode 100644 index 0000000..7bb3cf1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeListReq.java @@ -0,0 +1,31 @@ +package com.ningdatech.pmapi.sys.model.req; + +import com.ningdatech.basic.model.PagePo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * NoticeListReq + *

+ * + * @author WendyYang + * @since 00:32 2022/7/23 + */ +@Data +@ApiModel("公告查询参数类") +@EqualsAndHashCode(callSuper = true) +public class NoticeListReq extends PagePo { + + @ApiModelProperty("消息类型") + private Integer type; + + @ApiModelProperty("公告标题") + private String title; + + @ApiModelProperty("公告状态") + private Boolean enabled; + +} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeSaveReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeSaveReq.java new file mode 100644 index 0000000..35947d7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeSaveReq.java @@ -0,0 +1,44 @@ +package com.ningdatech.pmapi.sys.model.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + *

+ * MsgUpdatePo + *

+ * + * @author WendyYang + * @since 21:35 2022/7/21 + */ +@Data +@ApiModel("消息新增实体") +public class NoticeSaveReq { + + @ApiModelProperty("ID") + private Long id; + + @ApiModelProperty("通知标题") + @NotBlank(message = "通知标题不能为空") + private String title; + + @ApiModelProperty("通知类型") + @NotNull(message = "通知类型不能为空") + private Integer type; + + @ApiModelProperty("通知内容") + @NotBlank(message = "通知内容不能为空") + private String content; + + @ApiModelProperty("附件ID编码") + private String attachment; + + @ApiModelProperty("是否启用") + @NotNull(message = "是否启用不能为空") + private Boolean enabled; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeStatusModifyReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeStatusModifyReq.java new file mode 100644 index 0000000..21e5d17 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/NoticeStatusModifyReq.java @@ -0,0 +1,29 @@ +package com.ningdatech.pmapi.sys.model.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + *

+ * NoticeStatusUpdatePo + *

+ * + * @author WendyYang + * @since 22:32 2022/7/22 + */ +@Data +@ApiModel("消息状态修改") +public class NoticeStatusModifyReq { + + @ApiModelProperty("ID") + @NotNull(message = "ID不能为空") + private Long id; + + @ApiModelProperty("状态:true 启用、false 停用") + @NotNull(message = "状态不能为空") + private Boolean status; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/RolePageReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/RolePageReq.java new file mode 100644 index 0000000..e4a2997 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/RolePageReq.java @@ -0,0 +1,37 @@ +package com.ningdatech.pmapi.sys.model.req; + +import com.ningdatech.basic.model.PagePo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + *

+ * 实体类 + * 角色 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "RolePageQuery", description = "角色") +public class RolePageReq extends PagePo implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + private String name; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuResourceTreeVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuResourceTreeVO.java new file mode 100644 index 0000000..76436fc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuResourceTreeVO.java @@ -0,0 +1,35 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.ningdatech.pmapi.sys.model.enumeration.AuthorizeTypeEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import javax.validation.constraints.Size; + +import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; + +/** + * menuList + * 菜单资源树 + * + * @author PoffyZhang + */ +@Data +@ToString(callSuper = true) +public class MenuResourceTreeVO { + + private AuthorizeTypeEnum type; + private String code; + private String icon; + private Boolean isDef; + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + @Size(max = 200, message = "描述长度不能超过200") + @TableField(value = "describe_", condition = LIKE) + private String describe; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuRoleVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuRoleVO.java new file mode 100644 index 0000000..886b997 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuRoleVO.java @@ -0,0 +1,78 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +/** + *

+ * 实体类 + * 菜单 + *

+ * + * @author PoffyZhang + * @since 2022-9-30 + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@ApiModel(value = "RoleMenuVO", description = "菜单") +@AllArgsConstructor +public class MenuRoleVO extends MenuTreeEntity { + + private static final long serialVersionUID = 1L; + + /** + * 权限" + */ + @ApiModelProperty(value = "权限") + private String permission; + /** + * 类型;[0-菜单 1-目录 2-按钮] + */ + @ApiModelProperty(value = "类型") + private Integer type; + + /** + * 组件 + */ + @ApiModelProperty(value = "组件") + private String component; + + /** + * 菜单图标 + */ + @ApiModelProperty(value = "菜单图标") + private String icon; + + /** + * 是否隐藏 + */ + @ApiModelProperty(value = "是否隐藏") + private Integer hidden; + + /** + * 是否有权限 + */ + @ApiModelProperty(value = "是否有权限 0没有 1有") + private Integer hasPermission = 0; + + /** + * activeMenu + */ + @ApiModelProperty(value = "activeMenu") + private String activeMenu; + + /** + * 跳转 + */ + @ApiModelProperty(value = "跳转") + @TableField(value = "redirect") + private String redirect; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuVO.java new file mode 100644 index 0000000..f9c4532 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/MenuVO.java @@ -0,0 +1,70 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +/** + *

+ * 实体类 + * 菜单 + *

+ * + * @author PoffyZhang + * @since 2022-9-30 + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@Accessors(chain = true) +@ApiModel(value = "MenuVO", description = "菜单") +@AllArgsConstructor +@Builder +public class MenuVO { + + private static final long serialVersionUID = 1L; + + /** + * 权限" + */ + @ApiModelProperty(value = "权限") + private String permission; + /** + * 类型;[0-菜单 1按钮] + */ + @ApiModelProperty(value = "类型") + private Integer type; + + /** + * 组件 + */ + @ApiModelProperty(value = "组件") + private String component; + + /** + * 菜单图标 + */ + @ApiModelProperty(value = "菜单图标") + private String icon; + + /** + * 子菜单数目 + */ + @ApiModelProperty(value = "是否隐藏") + private Integer hidden; + + /** + * activeMenu + */ + @ApiModelProperty(value = "activeMenu") + private String activeMenu; + + /** + * 跳转 + */ + @ApiModelProperty(value = "跳转") + @TableField(value = "redirect") + private String redirect; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NoticeDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NoticeDetailVO.java new file mode 100644 index 0000000..78bf5cd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NoticeDetailVO.java @@ -0,0 +1,40 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import com.ningdatech.file.entity.vo.result.AttachFileVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + *

+ * NoticeDetailVo + *

+ * + * @author WendyYang + * @since 16:56 2022/7/22 + */ +@Data +@ApiModel("公告详情") +public class NoticeDetailVO { + + @ApiModelProperty("ID") + private Long id; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("内容") + private String content; + + @ApiModelProperty("状态") + private Boolean enabled; + + @ApiModelProperty("公告类型") + private Integer type; + + @ApiModelProperty("附件信息") + private List attachments; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NoticeListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NoticeListItemVO.java new file mode 100644 index 0000000..b5433d9 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NoticeListItemVO.java @@ -0,0 +1,44 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.experimental.Tolerate; + +import java.time.LocalDateTime; + +/** + *

+ * ManageNoticeListItem + *

+ * + * @author WendyYang + * @since 00:30 2022/7/23 + */ +@Data +@Builder +public class NoticeListItemVO { + + @Tolerate + public NoticeListItemVO() { + } + + @ApiModelProperty("公告ID") + private Long id; + + @ApiModelProperty("公告类型") + private Integer type; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("是否启用") + private Boolean enabled; + + @ApiModelProperty("是否置顶") + private Boolean topped; + +} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RegionTreeVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RegionTreeVO.java new file mode 100644 index 0000000..fb14771 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RegionTreeVO.java @@ -0,0 +1,53 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + *

+ * RegionTreeVO + *

+ * + * @author WendyYang + * @since 10:35 2022/10/12 + */ +@Data +@ToString(callSuper = true) +@ApiModel(value = "RegionTreeVO", description = "区域树状结构VO") +public class RegionTreeVO { + + private Long id; + + @ApiModelProperty("区域码") + @NotBlank(message = "地区编码不能为空") + private String regionCode; + + @ApiModelProperty("地区名") + @NotBlank(message = "地区名称不能为空") + private String name; + + @ApiModelProperty("级别") + @NotNull(message = "级别不能为空") + private Integer regionLevel; + + @ApiModelProperty("区域级别") + @NotBlank(message = "区域级别不能为空") + private String govUnit; + + @ApiModelProperty("地区父级编码:-1为顶级区域") + @NotBlank(message = "地区父级编码不能为空") + private String parentCode; + + @ApiModelProperty("子区域") + private List children; + + @ApiModelProperty("唯一编码:regionCode##name##level") + private String unionCode; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleUserSaveVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleUserSaveVO.java new file mode 100644 index 0000000..4843994 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleUserSaveVO.java @@ -0,0 +1,48 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 实体类 + * 角色下的员工 + *

+ * + * @author PoffyZhang + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "RoleUserSaveVO", description = "给角色分配员工") +public class RoleUserSaveVO implements Serializable { + + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "绑定或取消") + @NotNull(message = "请填写绑定或取消参数") + private Boolean flag; + /** + * 角色;#c_role + */ + @ApiModelProperty(value = "角色") + @NotNull(message = "请选择角色") + private Long roleId; + /** + * 用户;#c_user + */ + @ApiModelProperty(value = "用户") + @Size(min = 1, message = "请选择用户") + private List userIdList; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleVO.java new file mode 100644 index 0000000..34bc83c --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/RoleVO.java @@ -0,0 +1,57 @@ +package com.ningdatech.pmapi.sys.model.vo; + +import com.ningdatech.pmapi.sys.model.entity.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + *

+ * 实体类 + * 角色 + *

+ * + * @author PoffyZhang + * @since 2022-09-30 + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@ApiModel(value = "Role", description = "角色") +@AllArgsConstructor +@Builder +public class RoleVO extends BaseEntity { + + private Long id; + + private static final long serialVersionUID = 1L; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + private String name; + + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + private String describe; + + /** + * 数据范围 + */ + @ApiModelProperty(value = "数据范围 1全部 2本区域 3本区域以及下区域 4本公司") + private Integer dataScope; + + /** + * 菜单 + */ + @ApiModelProperty(value = "菜单") + private List menu; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IMenuService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IMenuService.java index 38bb1a5..7ca17db 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IMenuService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IMenuService.java @@ -1,9 +1,9 @@ package com.ningdatech.pmapi.sys.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.ningdatech.pmapi.sys.entity.Menu; -import com.ningdatech.pmapi.sys.entity.dto.MenuSaveDTO; -import com.ningdatech.pmapi.sys.entity.dto.MenuUpdateDTO; +import com.ningdatech.pmapi.sys.model.entity.Menu; +import com.ningdatech.pmapi.sys.model.dto.MenuSaveDTO; +import com.ningdatech.pmapi.sys.model.dto.MenuUpdateDTO; import java.util.List; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/INoticeService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/INoticeService.java index 9d56c34..1a79566 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/INoticeService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/INoticeService.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.ningdatech.pmapi.sys.entity.Notice; +import com.ningdatech.pmapi.sys.model.entity.Notice; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRegionService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRegionService.java index 62d493e..b5a0295 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRegionService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRegionService.java @@ -1,8 +1,8 @@ package com.ningdatech.pmapi.sys.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.ningdatech.pmapi.sys.entity.Region; -import com.ningdatech.pmapi.sys.entity.dto.RegionDTO; +import com.ningdatech.pmapi.sys.model.entity.Region; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; import java.util.List; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleMenuDatascopeService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleMenuDatascopeService.java index 5a39816..79ed6ca 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleMenuDatascopeService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleMenuDatascopeService.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.sys.service; -import com.ningdatech.pmapi.sys.entity.RoleMenuDatascope; +import com.ningdatech.pmapi.sys.model.entity.RoleMenuDatascope; import com.baomidou.mybatisplus.extension.service.IService; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleMenuService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleMenuService.java index 2f26fac..5b6ef02 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleMenuService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleMenuService.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.ningdatech.pmapi.sys.entity.RoleMenu; +import com.ningdatech.pmapi.sys.model.entity.RoleMenu; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleService.java index f26821a..42be6de 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleService.java @@ -1,9 +1,9 @@ package com.ningdatech.pmapi.sys.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.ningdatech.pmapi.sys.entity.Role; -import com.ningdatech.pmapi.sys.entity.dto.RoleSaveDTO; -import com.ningdatech.pmapi.sys.entity.dto.RoleUpdateDTO; +import com.ningdatech.pmapi.sys.model.entity.Role; +import com.ningdatech.pmapi.sys.model.dto.RoleSaveDTO; +import com.ningdatech.pmapi.sys.model.dto.RoleUpdateDTO; import java.util.List; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IUserRoleService.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IUserRoleService.java index 021f9f9..6d59c64 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IUserRoleService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IUserRoleService.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.ningdatech.pmapi.sys.entity.UserRole; +import com.ningdatech.pmapi.sys.model.entity.UserRole; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java index a11ba42..e0dc101 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java @@ -12,10 +12,10 @@ import com.google.common.collect.Lists; import com.ningdatech.basic.exception.BaseUncheckedException; import com.ningdatech.basic.util.ValidatorUtil; import com.ningdatech.pmapi.common.constant.DefValConstants; -import com.ningdatech.pmapi.sys.entity.Menu; -import com.ningdatech.pmapi.sys.entity.enumeration.MenuTypeEnum; -import com.ningdatech.pmapi.sys.entity.dto.MenuSaveDTO; -import com.ningdatech.pmapi.sys.entity.dto.MenuUpdateDTO; +import com.ningdatech.pmapi.sys.model.entity.Menu; +import com.ningdatech.pmapi.sys.model.enumeration.MenuTypeEnum; +import com.ningdatech.pmapi.sys.model.dto.MenuSaveDTO; +import com.ningdatech.pmapi.sys.model.dto.MenuUpdateDTO; import com.ningdatech.pmapi.sys.mapper.MenuMapper; import com.ningdatech.pmapi.sys.service.IMenuService; import lombok.RequiredArgsConstructor; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/NoticeServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/NoticeServiceImpl.java index 3c6fd6e..d514d1e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/NoticeServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/NoticeServiceImpl.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ningdatech.pmapi.sys.entity.Notice; +import com.ningdatech.pmapi.sys.model.entity.Notice; import com.ningdatech.pmapi.sys.mapper.NoticeMapper; import com.ningdatech.pmapi.sys.service.INoticeService; import org.springframework.stereotype.Service; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RegionServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RegionServiceImpl.java index 8b81fb5..709ed42 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RegionServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RegionServiceImpl.java @@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.sys.convert.RegionConverter; -import com.ningdatech.pmapi.sys.entity.Region; -import com.ningdatech.pmapi.sys.entity.dto.RegionDTO; +import com.ningdatech.pmapi.sys.model.entity.Region; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; import com.ningdatech.pmapi.sys.mapper.RegionMapper; import com.ningdatech.pmapi.sys.service.IRegionService; import org.springframework.stereotype.Service; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleMenuDatascopeServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleMenuDatascopeServiceImpl.java index 09cda45..74ca544 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleMenuDatascopeServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleMenuDatascopeServiceImpl.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.sys.service.impl; -import com.ningdatech.pmapi.sys.entity.RoleMenuDatascope; +import com.ningdatech.pmapi.sys.model.entity.RoleMenuDatascope; import com.ningdatech.pmapi.sys.mapper.RoleMenuDatascopeMapper; import com.ningdatech.pmapi.sys.service.IRoleMenuDatascopeService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleMenuServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleMenuServiceImpl.java index 27f1886..c58c643 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleMenuServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleMenuServiceImpl.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.sys.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ningdatech.pmapi.sys.entity.RoleMenu; +import com.ningdatech.pmapi.sys.model.entity.RoleMenu; import com.ningdatech.pmapi.sys.mapper.RoleMenuMapper; import com.ningdatech.pmapi.sys.service.IRoleMenuService; import org.springframework.stereotype.Service; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleServiceImpl.java index 4304fd2..0c6e452 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/RoleServiceImpl.java @@ -12,11 +12,11 @@ import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.exception.code.ExceptionCode; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.cache.repository.CachePlusOps; -import com.ningdatech.pmapi.sys.entity.*; -import com.ningdatech.pmapi.sys.entity.dto.MenuDataScopeDTO; -import com.ningdatech.pmapi.sys.entity.dto.RoleSaveDTO; -import com.ningdatech.pmapi.sys.entity.dto.RoleUpdateDTO; +import com.ningdatech.pmapi.sys.model.dto.MenuDataScopeDTO; +import com.ningdatech.pmapi.sys.model.dto.RoleSaveDTO; +import com.ningdatech.pmapi.sys.model.dto.RoleUpdateDTO; import com.ningdatech.pmapi.sys.mapper.RoleMapper; +import com.ningdatech.pmapi.sys.model.entity.*; import com.ningdatech.pmapi.sys.service.*; import com.ningdatech.pmapi.sys.utils.AuthCacheKeyUtils; import lombok.RequiredArgsConstructor; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/UserRoleServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/UserRoleServiceImpl.java index f2b85f8..184f164 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/UserRoleServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/UserRoleServiceImpl.java @@ -4,8 +4,8 @@ import cn.hutool.http.HttpStatus; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ningdatech.basic.exception.BaseUncheckedException; -import com.ningdatech.pmapi.sys.entity.Role; -import com.ningdatech.pmapi.sys.entity.UserRole; +import com.ningdatech.pmapi.sys.model.entity.Role; +import com.ningdatech.pmapi.sys.model.entity.UserRole; import com.ningdatech.pmapi.sys.mapper.RoleMapper; import com.ningdatech.pmapi.sys.mapper.UserRoleMapper; import com.ningdatech.pmapi.sys.service.IUserRoleService; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index d1848b5..1060fc6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -19,11 +19,11 @@ import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.constant.DingConstant; -import com.ningdatech.pmapi.common.enums.ExportOptionEnum; +import com.ningdatech.pmapi.common.enumeration.ExportOptionEnum; import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; +import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.util.ExcelDownUtil; -import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; @@ -37,7 +37,7 @@ import com.ningdatech.pmapi.todocenter.extension.cmd.BackToHisApprovalNodeCmd; import com.ningdatech.pmapi.todocenter.extension.cmd.SaveCommentCmd; import com.ningdatech.pmapi.todocenter.model.dto.req.ReqProcessHandlerDTO; import com.ningdatech.pmapi.todocenter.model.dto.req.ReqToBeProcessedDTO; -import com.ningdatech.pmapi.todocenter.model.dto.res.*; +import com.ningdatech.pmapi.todocenter.model.dto.res.ResToBeProcessedDTO; import com.ningdatech.pmapi.todocenter.zwdd.model.MessageContent; import com.ningdatech.pmapi.todocenter.zwdd.model.MessageText; import com.ningdatech.pmapi.user.entity.UserInfo; @@ -69,8 +69,8 @@ import com.wflow.workflow.utils.Executor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.assertj.core.util.Maps; -import org.flowable.bpmn.model.*; import org.flowable.bpmn.model.Process; +import org.flowable.bpmn.model.*; import org.flowable.engine.*; import org.flowable.engine.history.HistoricActivityInstance; import org.flowable.engine.history.HistoricProcessInstance; @@ -127,7 +127,7 @@ public class TodoCenterManage { /** * 待办中心待我处理项目列表查询 - * + * * @param param * @return com.ningdatech.basic.model.PageVo * @author CMM @@ -142,14 +142,14 @@ public class TodoCenterManage { TaskQuery taskQuery = taskService.createTaskQuery(); taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc(); List taskList = taskQuery.list(); - List results = getToBeProcessedProjects(param,taskList); - + List results = getToBeProcessedProjects(param, taskList); + Map taskMap = taskList.stream() .collect(Collectors.toMap(Task::getProcessInstanceId, t -> t)); Set processInsIds = results.stream() .map(Project::getInstCode) .collect(Collectors.toSet()); - + Set staterUsers = new HashSet<>(); // 将申报项目待登录用户处理的流程实例一次性取出来,减少查询次数 Map instanceMap = CollectionUtil.isNotEmpty(taskList) @@ -173,12 +173,12 @@ public class TodoCenterManage { // 从缓存取 staterUsers.add(String.valueOf(userId)); ProcessTaskVo processTaskVo = ProcessTaskVo.builder().taskId(task.getId()).taskName(task.getName()) - .taskDefKey(task.getTaskDefinitionKey()).processDefId(task.getProcessDefinitionId()) - .executionId(task.getExecutionId()).nodeId(task.getTaskDefinitionKey()) - .deployId(instance.getDeploymentId()).processDefName(instance.getProcessDefinitionName()) - .version(instance.getProcessDefinitionVersion()).instanceId(task.getProcessInstanceId()) - .ownerId(instance.getStartUserId()).createTime(instance.getStartTime()) - .taskCreateTime(task.getCreateTime()).build(); + .taskDefKey(task.getTaskDefinitionKey()).processDefId(task.getProcessDefinitionId()) + .executionId(task.getExecutionId()).nodeId(task.getTaskDefinitionKey()) + .deployId(instance.getDeploymentId()).processDefName(instance.getProcessDefinitionName()) + .version(instance.getProcessDefinitionVersion()).instanceId(task.getProcessInstanceId()) + .ownerId(instance.getStartUserId()).createTime(instance.getStartTime()) + .taskCreateTime(task.getCreateTime()).build(); res.setProcessTaskInfo(processTaskVo); return res; }).collect(Collectors.toList()); @@ -187,8 +187,8 @@ public class TodoCenterManage { if (CollectionUtil.isNotEmpty(staterUsers)) { Map userMap = userDeptOrLeaderService.getUserMapByIds(staterUsers); result = resVos.stream() - .peek(v -> v.getProcessTaskInfo().setOwner(userMap.get(v.getProcessTaskInfo().getOwnerId()))) - .collect(Collectors.toList()); + .peek(v -> v.getProcessTaskInfo().setOwner(userMap.get(v.getProcessTaskInfo().getOwnerId()))) + .collect(Collectors.toList()); // Map userMap = userInfoService.getUserMapByIds(staterUsers); // result = resVos.stream().peek(v -> v.setOwner(userMap.get(userId))) // .collect(Collectors.toList()); @@ -198,6 +198,7 @@ public class TodoCenterManage { /** * 待办中心列表导出 + * * @param response * @param param * @return void @@ -216,7 +217,7 @@ public class TodoCenterManage { taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc(); List taskList = taskQuery.list(); List records = getToBeProcessedProjects(param, taskList); - + ExcelExportWriter excelExportWriter = new ExcelExportWriter(); String fileName = null; @@ -258,6 +259,7 @@ public class TodoCenterManage { /** * 获取申报项目列表中待登录用户处理的项目列表 + * * @param param * @param taskList * @return java.util.List @@ -275,7 +277,7 @@ public class TodoCenterManage { param.getProcessLaunchStartTime()) .le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime()); projectService.page(page, wrapper); - + List taskProcessInsIds = taskList.stream().map(Task::getProcessInstanceId).collect(Collectors.toList()); // 过滤申报项目中待登录用户审核的项目 @@ -285,7 +287,7 @@ public class TodoCenterManage { /** * 流程处理相关操作 - * + * * @param param * @return void * @author CMM @@ -338,14 +340,15 @@ public class TodoCenterManage { /** * 审批任务:驳回 - * @param task 当前任务 + * + * @param task 当前任务 * @param userId - * @param param 参数 + * @param param 参数 */ private void doReject(Task task, Long userId, ReqProcessHandlerDTO param) { // 获取当前申报项目 Project declaredProject = projectService - .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); + .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); String projectName = declaredProject.getProjectName(); Map var = new HashMap<>(16); @@ -354,7 +357,7 @@ public class TodoCenterManage { // 获取流程定义 Process process = ProcessDefinitionUtil.getProcess(task.getProcessDefinitionId()); // 获取根节点即流程发起节点 - FlowNode rootNode = (FlowNode)process.getFlowElement("root", true); + FlowNode rootNode = (FlowNode) process.getFlowElement("root", true); // TODO 中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被驳回,请及时处理。 sendWorkNoticeToStartUser(task, projectName, rootNode); @@ -365,6 +368,7 @@ public class TodoCenterManage { /** * 当为驳回操作时,更新项目表中的项目状态 + * * @param task 当前任务 * @return void * @author CMM @@ -375,7 +379,7 @@ public class TodoCenterManage { Long userId = LoginUserUtil.getUserId(); // 获取当前申报项目 Project declaredProject = projectService - .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); + .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); // 获取当前流程项目状态 Integer projectStatusSecond = declaredProject.getStatus(); // 根据当前状态获取对应的通过事件 @@ -393,7 +397,7 @@ public class TodoCenterManage { /** * 获取最新版本的流程配置 - * + * * @param task 当前任务 * @return com.wflow.bean.entity.WflowModels * @author CMM @@ -401,7 +405,7 @@ public class TodoCenterManage { */ private WflowModels getLastWflowModels(Task task) { WflowModels wflowModels = processModelService.getOne( - Wrappers.lambdaQuery(WflowModels.class).eq(WflowModels::getProcessDefId, task.getProcessDefinitionId())); + Wrappers.lambdaQuery(WflowModels.class).eq(WflowModels::getProcessDefId, task.getProcessDefinitionId())); if (ObjectUtil.isNull(wflowModels)) { log.warn("流程{}不存在", wflowModels.getFormId()); throw new BusinessException("不存在该表单"); @@ -411,9 +415,10 @@ public class TodoCenterManage { /** * 审批任务:盖章并通过 - * @param task 当前任务 + * + * @param task 当前任务 * @param userId - * @param param 参数 + * @param param 参数 */ private void doSealPass(Task task, Long userId, ReqProcessHandlerDTO param) { Map var = new HashMap<>(16); @@ -424,7 +429,7 @@ public class TodoCenterManage { // TODO 市级单位:为大数据局;区县单位:为大数据中心(根据附件区分?) // 获取当前申报项目 Project declaredProject = projectService - .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); + .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); // 更新项目状态到下一个状态 updatePassProjectStatus(task, userId, declaredProject); taskService.complete(param.getTaskId(), var); @@ -432,15 +437,16 @@ public class TodoCenterManage { /** * 审批任务:通过 - * @param task 当前任务 + * + * @param task 当前任务 * @param userId - * @param param 参数 + * @param param 参数 */ private void doPass(Task task, Long userId, ReqProcessHandlerDTO param) { String processInstanceId = task.getProcessInstanceId(); // 获取当前申报项目 Project declaredProject = projectService - .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); + .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); String projectName = declaredProject.getProjectName(); Map var = new HashMap<>(16); @@ -449,7 +455,7 @@ public class TodoCenterManage { if (hasComment(param.getAuditInfo())) { // 执行自定义的保存评论的功能 managementService.executeCommand(new SaveCommentCmd(param.getTaskId(), param.getInstanceId(), - String.valueOf(userId), JSONObject.toJSONString(param.getAuditInfo()))); + String.valueOf(userId), JSONObject.toJSONString(param.getAuditInfo()))); } updatePassProjectStatus(task, userId, declaredProject); taskService.complete(param.getTaskId(), var); @@ -457,7 +463,7 @@ public class TodoCenterManage { // 获取bpm对象 BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId()); // 传节点定义key 获取当前节点 - FlowNode currentNode = (FlowNode)bpmnModel.getFlowElement(task.getTaskDefinitionKey()); + FlowNode currentNode = (FlowNode) bpmnModel.getFlowElement(task.getTaskDefinitionKey()); // 获取流程下一个节点的审核用户ID String nextUserId = getNextUserId(currentNode, processInstanceId); @@ -471,7 +477,7 @@ public class TodoCenterManage { // 若没有,向发起人发送浙政钉工作通知:【项目名称】已通过【流程名称】,请及时开始下一步操作。 // TODO 向其发送浙政钉工作通知 获取根节点的孩子节点(即发起人节点),向其发送浙政钉工作通知 // 获取根节点即流程发起节点 - FlowNode rootNode = (FlowNode)bpmnModel.getFlowElement("root"); + FlowNode rootNode = (FlowNode) bpmnModel.getFlowElement("root"); // sendWorkNoticeToStartUser(task, projectName, rootNode); } } @@ -479,7 +485,7 @@ public class TodoCenterManage { /** * 当为通过操作时,更新项目表中项目状态 * - * @param task 当前任务 + * @param task 当前任务 * @param userId * @param declaredProject * @return void @@ -504,9 +510,10 @@ public class TodoCenterManage { /** * 给流程发起人发送工作通知 - * @param task 当前任务 + * + * @param task 当前任务 * @param projectName 项目名称 - * @param rootNode 流程发起节点 + * @param rootNode 流程发起节点 * @return void * @author CMM * @since 2023/02/03 @@ -523,6 +530,7 @@ public class TodoCenterManage { /** * 获取流程发起节点的浙政钉用户ID + * * @param rootNode 根节点 * @return java.lang.String * @author CMM @@ -539,7 +547,7 @@ public class TodoCenterManage { // TODO 若要会签需判断候选人 // 发起事件 if (targetFlowElement instanceof StartEvent) { - UserTask userTask = (UserTask)targetFlowElement; + UserTask userTask = (UserTask) targetFlowElement; rootUserId = userTask.getAssignee(); break; } @@ -550,7 +558,8 @@ public class TodoCenterManage { /** * 获取当前节点的下一个节点的审核用户ID - * @param currentNode 当前节点 + * + * @param currentNode 当前节点 * @param processInstanceId * @return java.lang.String 下一个节点的浙政钉用户ID * @author CMM @@ -573,7 +582,7 @@ public class TodoCenterManage { if (targetFlowElement instanceof UserTask) { String actId = targetFlowElement.getId(); ActivityInstance activityInstance = runtimeService.createActivityInstanceQuery() - .processInstanceId(processInstanceId).activityId(actId).singleResult(); + .processInstanceId(processInstanceId).activityId(actId).singleResult(); String executionId = activityInstance.getExecutionId(); nextUserId = runtimeService.getVariable(executionId, "assignee", String.class); break; @@ -584,6 +593,7 @@ public class TodoCenterManage { /** * 判断处理操作是否含有审核意见 + * * @param comment 审核意见 * @return boolean * @author CMM @@ -591,13 +601,14 @@ public class TodoCenterManage { */ private boolean hasComment(ProcessComment comment) { return Objects.nonNull(comment) - && (StrUtil.isNotBlank(comment.getText()) || CollectionUtil.isNotEmpty(comment.getAttachments())); + && (StrUtil.isNotBlank(comment.getText()) || CollectionUtil.isNotEmpty(comment.getAttachments())); } /** * 发送浙政钉工作通知 + * * @param auditUserInfo 审核人信息 - * @param msg 要发送的工作通知 + * @param msg 要发送的工作通知 * @return void * @author CMM * @since 2023/02/01 @@ -633,33 +644,34 @@ public class TodoCenterManage { /** * 撤销流程处理 - * @param task 当前任务 + * + * @param task 当前任务 * @param userId */ private void doWithDrawProcess(Task task, Long userId) { // 获取流程定义 Process process = ProcessDefinitionUtil.getProcess(task.getProcessDefinitionId()); // 获取当前运行流程的发起人节点信息 - FlowNode rootNode = (FlowNode)process.getFlowElement("root", true); + FlowNode rootNode = (FlowNode) process.getFlowElement("root", true); // 获取当前节点 - FlowNode currentNode = (FlowNode)process.getFlowElement(task.getTaskDefinitionKey(), true); + FlowNode currentNode = (FlowNode) process.getFlowElement(task.getTaskDefinitionKey(), true); String rootUserId = getRootUserId(rootNode); // 判断当前登录用户是否是流程发起人 if (rootUserId.equals(String.valueOf(userId))) { // TODO 若是流程发起人点击撤回,项目回到上一个状态,并删除当前审核人对应的待办记录 updateWithdrawProjectStatus(task, userId); List executions = runtimeService.createExecutionQuery() - .processInstanceId(task.getProcessInstanceId()).onlyChildExecutions().list(); + .processInstanceId(task.getProcessInstanceId()).onlyChildExecutions().list(); // 强制流程指向撤回 runtimeService.createChangeActivityStateBuilder().processInstanceId(task.getProcessInstanceId()) - .moveActivityIdTo(task.getTaskDefinitionKey(), HisProInsEndActId.WITHDRAW) - .moveExecutionsToSingleActivityId( - executions.stream().map(Execution::getId).collect(Collectors.toList()), HisProInsEndActId.WITHDRAW) - .changeState(); + .moveActivityIdTo(task.getTaskDefinitionKey(), HisProInsEndActId.WITHDRAW) + .moveExecutionsToSingleActivityId( + executions.stream().map(Execution::getId).collect(Collectors.toList()), HisProInsEndActId.WITHDRAW) + .changeState(); } else { FlowElementsContainer parentContainer = currentNode.getParentContainer(); for (FlowElement flowElement : parentContainer.getFlowElements()) { - UserTask beforeUserTask = (UserTask)flowElement; + UserTask beforeUserTask = (UserTask) flowElement; if (beforeUserTask.getAssignee().equals(String.valueOf(userId))) { // TODO 若是前一个审核人点击撤回,在审核记录中移除自己提交过的审核意见、 // 待我处理中移除当前审核人的待办记录、 @@ -668,16 +680,16 @@ public class TodoCenterManage { // 更新项目状态 updateWithdrawProjectStatus(task, userId); HistoricTaskInstance beforeTaskInstance = - historyService.createHistoricTaskInstanceQuery().taskId(beforeUserTask.getId()).singleResult(); + historyService.createHistoricTaskInstanceQuery().taskId(beforeUserTask.getId()).singleResult(); List executions = runtimeService.createExecutionQuery() - .processInstanceId(beforeTaskInstance.getProcessInstanceId()).onlyChildExecutions().list(); + .processInstanceId(beforeTaskInstance.getProcessInstanceId()).onlyChildExecutions().list(); // 强制流程指向撤回 runtimeService.createChangeActivityStateBuilder().processInstanceId(task.getProcessInstanceId()) - .moveActivityIdTo(flowElement.getId(), HisProInsEndActId.WITHDRAW) - .moveExecutionsToSingleActivityId( - executions.stream().map(Execution::getId).collect(Collectors.toList()), - HisProInsEndActId.WITHDRAW) - .changeState(); + .moveActivityIdTo(flowElement.getId(), HisProInsEndActId.WITHDRAW) + .moveExecutionsToSingleActivityId( + executions.stream().map(Execution::getId).collect(Collectors.toList()), + HisProInsEndActId.WITHDRAW) + .changeState(); break; } } @@ -686,7 +698,8 @@ public class TodoCenterManage { /** * 当为撤回操作时,更新项目表中的项目状态为前一个状态 - * @param task 当前任务 + * + * @param task 当前任务 * @param userId * @return void * @author CMM @@ -695,7 +708,7 @@ public class TodoCenterManage { private void updateWithdrawProjectStatus(Task task, Long userId) { // 获取当前申报项目 Project declaredProject = projectService - .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); + .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); // 获取当前流程项目状态 Integer projectStatusSecond = declaredProject.getStatus(); // 根据当前状态获取对应的撤回事件 @@ -713,59 +726,61 @@ public class TodoCenterManage { /** * 退回流程处理 - * @param task 当前任务 + * + * @param task 当前任务 * @param userId 当前登录用户ID - * @param param 参数 + * @param param 参数 */ private void doBackTask(Task task, Long userId, ReqProcessHandlerDTO param) { // 获取当前申报项目 Project declaredProject = projectService - .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); + .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); String projectName = declaredProject.getProjectName(); // 获取流程定义 Process process = ProcessDefinitionUtil.getProcess(task.getProcessDefinitionId()); // 获取根节点即流程发起节点 - FlowNode rootNode = (FlowNode)process.getFlowElement("root", true); + FlowNode rootNode = (FlowNode) process.getFlowElement("root", true); // TODO 流程变成【被退回】状态,待我处理中,为流程发起人增加一条待办记录,给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。 sendWorkNoticeToStartUser(task, projectName, rootNode); // 执行自定义回退逻辑,回退到流程发起人 managementService - .executeCommand(new BackToHisApprovalNodeCmd(runtimeService, param.getTaskId(), rootNode.getId())); + .executeCommand(new BackToHisApprovalNodeCmd(runtimeService, param.getTaskId(), rootNode.getId())); runtimeService.setVariables(param.getInstanceId(), - Maps.newHashMap("approve_" + param.getTaskId(), param.getAction())); + Maps.newHashMap("approve_" + param.getTaskId(), param.getAction())); log.info("用户[{}] 退回流程[{}] [{} -> {}]", userId, param.getInstanceId(), task.getTaskDefinitionKey(), - param.getTargetNode()); + param.getTargetNode()); } /** * 查询流程表单数据及审批的进度步骤 - * @param nodeId 当前获取流程人员关联的流程节点ID + * + * @param nodeId 当前获取流程人员关联的流程节点ID * @param instanceId 流程实例ID * @return 流程进度及表单详情 */ public ProcessProgressDetailVo getProcessDetail(String nodeId, String instanceId) { HistoricProcessInstance instance = - historyService.createHistoricProcessInstanceQuery().processInstanceId(instanceId).singleResult(); + historyService.createHistoricProcessInstanceQuery().processInstanceId(instanceId).singleResult(); // 取表单及表单数据 HistoricVariableInstance forms = historyService.createHistoricVariableInstanceQuery() - .processInstanceId(instanceId).variableName(WflowGlobalVarDef.WFLOW_FORMS).singleResult(); + .processInstanceId(instanceId).variableName(WflowGlobalVarDef.WFLOW_FORMS).singleResult(); List formDatas = - historyService.createHistoricVariableInstanceQuery().processInstanceId(instanceId).list(); + historyService.createHistoricVariableInstanceQuery().processInstanceId(instanceId).list(); // 取节点设置 HistoricVariableInstance nodeProps = historyService.createHistoricVariableInstanceQuery() - .processInstanceId(instanceId).variableName(WflowGlobalVarDef.WFLOW_NODE_PROPS).singleResult(); - Map nodePropsValue = (Map)nodeProps.getValue(); + .processInstanceId(instanceId).variableName(WflowGlobalVarDef.WFLOW_NODE_PROPS).singleResult(); + Map nodePropsValue = (Map) nodeProps.getValue(); ProcessNode currentNode = null; if (StrUtil.isNotBlank(nodeId)) { // 搜索当前版本流程的配置 WflowModelHistorys modelHistory = modelHistorysMapper.selectOne( - new QueryWrapper<>(WflowModelHistorys.builder().processDefId(instance.getProcessDefinitionId()) - .version(instance.getProcessDefinitionVersion()).build())); + new QueryWrapper<>(WflowModelHistorys.builder().processDefId(instance.getProcessDefinitionId()) + .version(instance.getProcessDefinitionVersion()).build())); currentNode = nodeCatchService.reloadProcessByStr(modelHistory.getProcess()).get(nodeId); } UserDo users = orgRepositoryService.getUserById(instance.getStartUserId()); OrgUser startUser = - OrgUser.builder().id(users.getUserId()).name(users.getUserName()).avatar(users.getAvatar()).build(); + OrgUser.builder().id(users.getUserId()).name(users.getUserName()).avatar(users.getAvatar()).build(); List taskRecords = getHisTaskRecords(instanceId, nodePropsValue); // 获取添加抄送任务 @@ -775,24 +790,24 @@ public class TodoCenterManage { taskRecords.addAll(getFutureTask(instanceId)); } taskRecords = - taskRecords.stream().sorted(Comparator.comparing(ProgressNode::getStartTime)).collect(Collectors.toList()); + taskRecords.stream().sorted(Comparator.comparing(ProgressNode::getStartTime)).collect(Collectors.toList()); taskRecords.add(0, - ProgressNode.builder().nodeId("root").name("提交申请").user(startUser).nodeType(NodeTypeEnum.ROOT) - .startTime(instance.getStartTime()).finishTime(instance.getStartTime()).taskId("root") - .result(ProcessHandlerEnum.PASS).build()); + ProgressNode.builder().nodeId("root").name("提交申请").user(startUser).nodeType(NodeTypeEnum.ROOT) + .startTime(instance.getStartTime()).finishTime(instance.getStartTime()).taskId("root") + .result(ProcessHandlerEnum.PASS).build()); // 提取全量表单数据 Map formData = - formDatas.stream().filter(CodeUtil.distinctByKey(HistoricVariableInstance::getVariableName)).collect( - Collectors.toMap(HistoricVariableInstance::getVariableName, HistoricVariableInstance::getValue)); + formDatas.stream().filter(CodeUtil.distinctByKey(HistoricVariableInstance::getVariableName)).collect( + Collectors.toMap(HistoricVariableInstance::getVariableName, HistoricVariableInstance::getValue)); HistoricVariableInstance variableInstance = historyService.createHistoricVariableInstanceQuery() - .processInstanceId(instanceId).variableName("owner").singleResult(); - ProcessInstanceUserDto owner = (ProcessInstanceUserDto)variableInstance.getValue(); + .processInstanceId(instanceId).variableName("owner").singleResult(); + ProcessInstanceUserDto owner = (ProcessInstanceUserDto) variableInstance.getValue(); ProcessProgressDetailVo res = ProcessProgressDetailVo.builder().instanceId(instanceId) - .version(instance.getProcessDefinitionVersion()) - .formItems(formService.filterFormAndDataByPermConfig((List

)forms.getValue(), formData, currentNode)) - .formData(formData).processDefName(instance.getProcessDefinitionName()).startTempUser(startUser) - .startDept(null == owner ? null : owner.getOrgName()).result(instance.getEndActivityId()) - .startTime(instance.getStartTime()).progress(taskRecords).build(); + .version(instance.getProcessDefinitionVersion()) + .formItems(formService.filterFormAndDataByPermConfig((List) forms.getValue(), formData, currentNode)) + .formData(formData).processDefName(instance.getProcessDefinitionName()).startTempUser(startUser) + .startDept(null == owner ? null : owner.getOrgName()).result(instance.getEndActivityId()) + .startTime(instance.getStartTime()).progress(taskRecords).build(); // UserInfo userInfo = userInfoService.getById(Long.valueOf(instance.getStartUserId())); // res.setStartUser(userInfo); if (Objects.isNull(instance.getEndActivityId())) { @@ -810,18 +825,19 @@ public class TodoCenterManage { /** * 获取抄送的流程实例信息 + * * @param instanceId 实例ID * @return 抄送我的流程 */ private List getCcTaskRecords(String instanceId) { Set ccUsers = new HashSet<>(); List ccList = ccTasksMapper - .selectList(new QueryWrapper().eq("instance_id", instanceId)).stream().map(task -> { - ccUsers.add(task.getUserId()); - return ProgressNode.builder().nodeId(task.getNodeId()).nodeType(NodeTypeEnum.CC) - .name(task.getNodeName()).user(OrgUser.builder().id(task.getUserId()).build()) - .startTime(task.getCreateTime()).finishTime(task.getCreateTime()).build(); - }).collect(Collectors.toList()); + .selectList(new QueryWrapper().eq("instance_id", instanceId)).stream().map(task -> { + ccUsers.add(task.getUserId()); + return ProgressNode.builder().nodeId(task.getNodeId()).nodeType(NodeTypeEnum.CC) + .name(task.getNodeName()).user(OrgUser.builder().id(task.getUserId()).build()) + .startTime(task.getCreateTime()).finishTime(task.getCreateTime()).build(); + }).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(ccUsers)) { Map userMap = userDeptOrLeaderService.getUserMapByIds(ccUsers); ccList.stream().peek(v -> v.setUser(userMap.get(v.getUser().getId()))).collect(Collectors.toList()); @@ -831,34 +847,35 @@ public class TodoCenterManage { /** * 获取流程的审批历史记录 + * * @param instanceId 审批实例ID - * @param nodeProps 节点设置 + * @param nodeProps 节点设置 * @return 历史记录列表 */ private List getHisTaskRecords(String instanceId, Map nodeProps) { List list = historyService.createHistoricActivityInstanceQuery() - .processInstanceId(instanceId).orderByHistoricActivityInstanceStartTime().asc().list(); + .processInstanceId(instanceId).orderByHistoricActivityInstanceStartTime().asc().list(); Set userSet = new HashSet<>(); // 获取节点处理结果 Map varMap = historyService.createHistoricVariableInstanceQuery() + ProcessHandlerEnum> varMap = historyService.createHistoricVariableInstanceQuery() .processInstanceId(instanceId).variableNameLike("approve_%").list().stream().collect( - Collectors.toMap(HistoricVariableInstance::getVariableName, v -> (ProcessHandlerEnum)v.getValue())); + Collectors.toMap(HistoricVariableInstance::getVariableName, v -> (ProcessHandlerEnum) v.getValue())); Map> commentMap = new HashMap<>(); // 统一处理所有评论数据,省的多次查询 List cmvos = - taskService.getProcessInstanceComments(instanceId).stream().map(comment -> { - userSet.add(comment.getUserId()); - ProgressNodeAuditInfoVo progressNodeAuditInfoVo = - ProgressNodeAuditInfoVo.builder().id(comment.getId()).taskId(comment.getTaskId()) - .commentType(comment.getType()).type("COMMENT").createTime(comment.getTime()) - .user(UserInfo.builder().id(Long.valueOf(comment.getUserId())).build()).build(); - ProcessComment processComment = JSONObject.parseObject(comment.getFullMessage(), ProcessComment.class); - progressNodeAuditInfoVo.setText(processComment.getText()); - progressNodeAuditInfoVo.setAttachments(processComment.getAttachments()); - return progressNodeAuditInfoVo; - }).collect(Collectors.toList()); + taskService.getProcessInstanceComments(instanceId).stream().map(comment -> { + userSet.add(comment.getUserId()); + ProgressNodeAuditInfoVo progressNodeAuditInfoVo = + ProgressNodeAuditInfoVo.builder().id(comment.getId()).taskId(comment.getTaskId()) + .commentType(comment.getType()).type("COMMENT").createTime(comment.getTime()) + .user(UserInfo.builder().id(Long.valueOf(comment.getUserId())).build()).build(); + ProcessComment processComment = JSONObject.parseObject(comment.getFullMessage(), ProcessComment.class); + progressNodeAuditInfoVo.setText(processComment.getText()); + progressNodeAuditInfoVo.setAttachments(processComment.getAttachments()); + return progressNodeAuditInfoVo; + }).collect(Collectors.toList()); cmvos.forEach(cm -> { // 把评论数据按照task进行归类 String taskId = Optional.ofNullable(cm.getTaskId()).orElse(instanceId); @@ -867,21 +884,21 @@ public class TodoCenterManage { }); // 再将评论按照任务一次构建,方便取出 Map commentsMap = - cmvos.stream().collect(Collectors.toMap(ProgressNodeAuditInfoVo::getTaskId, c -> c)); + cmvos.stream().collect(Collectors.toMap(ProgressNodeAuditInfoVo::getTaskId, c -> c)); List progressNodes = - list.stream().filter(his -> ObjectUtil.isNotNull(his.getTaskId())).map(his -> { - Object props = nodeProps.get(his.getActivityId()); - ApprovalModeEnum approvalMode = null; - if (props instanceof ApprovalProps) { - approvalMode = ((ApprovalProps)props).getMode(); - } - userSet.add(his.getAssignee()); - return ProgressNode.builder().nodeId(his.getActivityId()).name(his.getActivityName()) - .nodeType(NodeTypeEnum.APPROVAL).user(OrgUser.builder().id(his.getAssignee()).build()) - .startTime(his.getStartTime()).finishTime(his.getEndTime()).taskId(his.getTaskId()) - .approvalMode(approvalMode).auditInfo(commentsMap.get(his.getTaskId())) - .result(varMap.get("approve_" + his.getTaskId())).build(); - }).collect(Collectors.toList()); + list.stream().filter(his -> ObjectUtil.isNotNull(his.getTaskId())).map(his -> { + Object props = nodeProps.get(his.getActivityId()); + ApprovalModeEnum approvalMode = null; + if (props instanceof ApprovalProps) { + approvalMode = ((ApprovalProps) props).getMode(); + } + userSet.add(his.getAssignee()); + return ProgressNode.builder().nodeId(his.getActivityId()).name(his.getActivityName()) + .nodeType(NodeTypeEnum.APPROVAL).user(OrgUser.builder().id(his.getAssignee()).build()) + .startTime(his.getStartTime()).finishTime(his.getEndTime()).taskId(his.getTaskId()) + .approvalMode(approvalMode).auditInfo(commentsMap.get(his.getTaskId())) + .result(varMap.get("approve_" + his.getTaskId())).build(); + }).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(userSet)) { Map map = userDeptOrLeaderService.getUserMapByIds(userSet); progressNodes.forEach(n -> n.setUser(map.get(n.getUser().getId()))); @@ -896,7 +913,7 @@ public class TodoCenterManage { /** * 待办中心我已处理项目列表查询 - * + * * @param param * @return com.ningdatech.basic.model.PageVo * @author CMM @@ -909,10 +926,10 @@ public class TodoCenterManage { // 自定义sql查询所有已办的任务实例 String nativeSql = "SELECT aht.* FROM ACT_HI_TASKINST AS aht \n" - + "LEFT JOIN ACT_HI_VARINST AS ahv ON SUBSTRING(ahv.NAME_, 9) = aht.ID_ AND ahv.NAME_ LIKE 'approve_%'\n" - + "WHERE aht.ASSIGNEE_ = " + userId + " AND ahv.NAME_ IS NOT NULL \n" + "ORDER BY aht.END_TIME_ DESC"; + + "LEFT JOIN ACT_HI_VARINST AS ahv ON SUBSTRING(ahv.NAME_, 9) = aht.ID_ AND ahv.NAME_ LIKE 'approve_%'\n" + + "WHERE aht.ASSIGNEE_ = " + userId + " AND ahv.NAME_ IS NOT NULL \n" + "ORDER BY aht.END_TIME_ DESC"; NativeHistoricTaskInstanceQuery taskInstanceQuery = - historyService.createNativeHistoricTaskInstanceQuery().sql(nativeSql); + historyService.createNativeHistoricTaskInstanceQuery().sql(nativeSql); List taskInstances = taskInstanceQuery.list(); Set taskProcessInsIds = taskInstances.stream() @@ -939,12 +956,12 @@ public class TodoCenterManage { LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); LocalDateTime launchTime = - LocalDateTime.parse(launchTimeFormat, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); + LocalDateTime.parse(launchTimeFormat, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); res.setProcessLaunchTime(launchTime); LocalDateTime processHandleTime = d.getUpdateOn(); String handleTimeFormat = NdDateUtils.format(processHandleTime, "yyyy-MM-dd HH:mm"); LocalDateTime handleTime = - LocalDateTime.parse(handleTimeFormat, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); + LocalDateTime.parse(handleTimeFormat, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); res.setProcessHandleTime(handleTime); // 从已处理任务实例列表中取出当前登录用户及项目实例对应的任务实例 @@ -953,12 +970,12 @@ public class TodoCenterManage { // 从缓存取 staterUsers.add(instance.getStartUserId()); ProcessTaskVo processTaskVo = ProcessTaskVo.builder().taskId(task.getId()).taskName(task.getName()) - .taskDefKey(task.getTaskDefinitionKey()).processDefId(task.getProcessDefinitionId()) - .executionId(task.getExecutionId()).nodeId(task.getTaskDefinitionKey()) - .deployId(instance.getDeploymentId()).processDefName(instance.getProcessDefinitionName()) - .version(instance.getProcessDefinitionVersion()).instanceId(task.getProcessInstanceId()) - .ownerId(instance.getStartUserId()).createTime(instance.getStartTime()) - .taskCreateTime(task.getCreateTime()).build(); + .taskDefKey(task.getTaskDefinitionKey()).processDefId(task.getProcessDefinitionId()) + .executionId(task.getExecutionId()).nodeId(task.getTaskDefinitionKey()) + .deployId(instance.getDeploymentId()).processDefName(instance.getProcessDefinitionName()) + .version(instance.getProcessDefinitionVersion()).instanceId(task.getProcessInstanceId()) + .ownerId(instance.getStartUserId()).createTime(instance.getStartTime()) + .taskCreateTime(task.getCreateTime()).build(); res.setProcessTaskInfo(processTaskVo); return res; }).collect(Collectors.toList()); @@ -967,8 +984,8 @@ public class TodoCenterManage { if (CollectionUtil.isNotEmpty(staterUsers)) { Map userMap = userDeptOrLeaderService.getUserMapByIds(staterUsers); result = resVos.stream() - .peek(v -> v.getProcessTaskInfo().setOwner(userMap.get(v.getProcessTaskInfo().getOwnerId()))) - .collect(Collectors.toList()); + .peek(v -> v.getProcessTaskInfo().setOwner(userMap.get(v.getProcessTaskInfo().getOwnerId()))) + .collect(Collectors.toList()); // Map userMap = userInfoService.getUserMapByIds(staterUsers); // result = resVos.stream().peek(v -> v.setOwner(userMap.get(userId))) // .collect(Collectors.toList()); @@ -979,8 +996,9 @@ public class TodoCenterManage { /** * 获取申报项目列表中登录用户已处理项目列表 - * @param param - * @param taskProcessInsIds + * + * @param param + * @param taskProcessInsIds * @return java.util.List * @author CMM * @since 2023/02/11 @@ -990,12 +1008,12 @@ public class TodoCenterManage { Page page = param.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(Project.class); wrapper.like(StrUtil.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName()) - .like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName()) - .eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear()) - .eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement()) - .ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime, - param.getProcessLaunchStartTime()) - .le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime()); + .like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName()) + .eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear()) + .eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement()) + .ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime, + param.getProcessLaunchStartTime()) + .le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime()); projectService.page(page, wrapper); // 过滤申报项目中登录用户已审核的项目 @@ -1006,8 +1024,9 @@ public class TodoCenterManage { /** * 导出我已处理项目列表 + * * @param response 返回数据流 - * @param param 请求参数 + * @param param 请求参数 * @return void * @author CMM * @since 2023/02/06 @@ -1074,22 +1093,22 @@ public class TodoCenterManage { /** * 查询我提交的项目列表 - * + * * @param param * @return com.ningdatech.basic.model.PageVo * @author CMM * @since 2023/02/06 */ public PageVo queryMySubmittedProjectList(ReqToBeProcessedDTO param) { - + // Long startUserId = LoginUserUtil.getUserId(); Long startUserId = 381496L; HistoricProcessInstanceQuery instanceQuery = historyService.createHistoricProcessInstanceQuery(); Executor.builder().ifNotBlankNext(String.valueOf(startUserId), instanceQuery::startedBy); List historicProcessInstances = - instanceQuery.orderByProcessInstanceStartTime().desc().orderByProcessInstanceEndTime().desc().list(); + instanceQuery.orderByProcessInstanceStartTime().desc().orderByProcessInstanceEndTime().desc().list(); Set historicProcessInstanceIds = - historicProcessInstances.stream().map(h -> h.getId()).collect(Collectors.toSet()); + historicProcessInstances.stream().map(h -> h.getId()).collect(Collectors.toSet()); List results = getMySubmittedProjects(param, historicProcessInstanceIds); @@ -1100,23 +1119,23 @@ public class TodoCenterManage { .list().stream().collect(Collectors.toMap(HistoricProcessInstance::getId, v -> v)) : new HashMap<>(); Set staterUsers = new HashSet<>(); - + List resVos = results.stream().map(d -> { - ResToBeProcessedDTO res = new ResToBeProcessedDTO(); - BeanUtils.copyProperties(d, res); - res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); - LocalDateTime processLaunchTime = d.getCreateOn(); - String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); - LocalDateTime launchTime = - LocalDateTime.parse(launchTimeFormat, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); - res.setProcessLaunchTime(launchTime); - HistoricProcessInstance ist = instanceMap.get(d.getInstCode()); - staterUsers.add(ist.getStartUserId()); - ProcessInstanceVo processInstanceVo = getProcessInstanceVos(ist); - res.setProcessInstanceInfo(processInstanceVo); - return res; - }).collect(Collectors.toList()); + ResToBeProcessedDTO res = new ResToBeProcessedDTO(); + BeanUtils.copyProperties(d, res); + res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); + LocalDateTime processLaunchTime = d.getCreateOn(); + String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); + LocalDateTime launchTime = + LocalDateTime.parse(launchTimeFormat, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); + res.setProcessLaunchTime(launchTime); + HistoricProcessInstance ist = instanceMap.get(d.getInstCode()); + staterUsers.add(ist.getStartUserId()); + ProcessInstanceVo processInstanceVo = getProcessInstanceVos(ist); + res.setProcessInstanceInfo(processInstanceVo); + return res; + }).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(staterUsers)) { Map userMap = userDeptOrLeaderService.getUserMapByIds(staterUsers); @@ -1136,8 +1155,9 @@ public class TodoCenterManage { /** * 获取申报项目列表中当前登录用户发起的项目列表 - * @param param - * @param historicProcessInstanceIds + * + * @param param + * @param historicProcessInstanceIds * @return java.util.List * @author CMM * @since 2023/02/11 @@ -1146,12 +1166,12 @@ public class TodoCenterManage { Page page = param.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(Project.class); wrapper.like(StrUtil.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName()) - .like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName()) - .eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear()) - .eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement()) - .ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime, - param.getProcessLaunchStartTime()) - .le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime()); + .like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName()) + .eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear()) + .eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement()) + .ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime, + param.getProcessLaunchStartTime()) + .le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime()); projectService.page(page, wrapper); // 筛选出申报项目中我发起的项目 @@ -1163,6 +1183,7 @@ public class TodoCenterManage { /** * 获取流程实例信息 + * * @param ist 流程实例 * @return java.util.List * @author CMM @@ -1171,10 +1192,10 @@ public class TodoCenterManage { private ProcessInstanceVo getProcessInstanceVos(HistoricProcessInstance ist) { Map instanceNodeMap = new HashMap<>(); ProcessInstanceVo instanceVo = ProcessInstanceVo.builder().processDefId(ist.getProcessDefinitionId()) - .instanceId(ist.getId()).nodeId(instanceNodeMap.get(ist.getId())).formId(ist.getProcessDefinitionKey()) - .staterUserId(ist.getStartUserId()).startTime(ist.getStartTime()).finishTime(ist.getEndTime()) - .processDefName(ist.getProcessDefinitionName()).result(ist.getEndActivityId()) - .version(ist.getProcessDefinitionVersion()).build(); + .instanceId(ist.getId()).nodeId(instanceNodeMap.get(ist.getId())).formId(ist.getProcessDefinitionKey()) + .staterUserId(ist.getStartUserId()).startTime(ist.getStartTime()).finishTime(ist.getEndTime()) + .processDefName(ist.getProcessDefinitionName()).result(ist.getEndActivityId()) + .version(ist.getProcessDefinitionVersion()).build(); if (Objects.isNull(ist.getEndActivityId())) { instanceVo.setStatus(ProcessStatusEnum.UNDER_REVIEW.name()); @@ -1190,7 +1211,7 @@ public class TodoCenterManage { if (ObjectUtil.isNull(ist.getEndActivityId())) { // 没有结束,还在走流程,获取任务 List list = - taskService.createTaskQuery().processInstanceId(ist.getId()).includeIdentityLinks().active().list(); + taskService.createTaskQuery().processInstanceId(ist.getId()).includeIdentityLinks().active().list(); instanceVo.setNodeId(Optional.ofNullable(instanceVo.getNodeId()).orElseGet(() -> { if (CollectionUtil.isNotEmpty(list)) { return list.get(0).getTaskDefinitionKey(); @@ -1213,6 +1234,7 @@ public class TodoCenterManage { /** * 待办中心-我发起的项目列表导出 + * * @param response * @param param * @return void @@ -1278,6 +1300,7 @@ public class TodoCenterManage { /** * 待办中心-抄送我的项目列表查询 + * * @param param * @return com.ningdatech.basic.model.PageVo * @author CMM @@ -1289,7 +1312,7 @@ public class TodoCenterManage { Long userId = 381496L; List ccTasks = ccTasksMapper.selectList(Wrappers.lambdaQuery(WflowCcTasks.class) - .eq(WflowCcTasks::getUserId, String.valueOf(userId)).orderByDesc(WflowCcTasks::getCreateTime)); + .eq(WflowCcTasks::getUserId, String.valueOf(userId)).orderByDesc(WflowCcTasks::getCreateTime)); List processInsIds = ccTasks.stream() .map(WflowCcTasks::getInstanceId) .collect(Collectors.toList()); @@ -1305,20 +1328,20 @@ public class TodoCenterManage { : new HashMap<>(); List resVos = results.stream().map(d -> { - ResToBeProcessedDTO res = new ResToBeProcessedDTO(); - BeanUtils.copyProperties(d, res); - res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); - LocalDateTime processLaunchTime = d.getCreateOn(); - String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); - LocalDateTime launchTime = - LocalDateTime.parse(launchTimeFormat, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); - res.setProcessLaunchTime(launchTime); - HistoricProcessInstance ist = instanceMap.get(d.getInstCode()); - staterUsers.add(ist.getStartUserId()); - ProcessInstanceVo processInstanceVo = getProcessInstanceVos(ist); - res.setProcessInstanceInfo(processInstanceVo); - return res; - }).collect(Collectors.toList()); + ResToBeProcessedDTO res = new ResToBeProcessedDTO(); + BeanUtils.copyProperties(d, res); + res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); + LocalDateTime processLaunchTime = d.getCreateOn(); + String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); + LocalDateTime launchTime = + LocalDateTime.parse(launchTimeFormat, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); + res.setProcessLaunchTime(launchTime); + HistoricProcessInstance ist = instanceMap.get(d.getInstCode()); + staterUsers.add(ist.getStartUserId()); + ProcessInstanceVo processInstanceVo = getProcessInstanceVos(ist); + res.setProcessInstanceInfo(processInstanceVo); + return res; + }).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(staterUsers)) { Map userMap = userDeptOrLeaderService.getUserMapByIds(staterUsers); @@ -1338,6 +1361,7 @@ public class TodoCenterManage { /** * 获取申报项目表中抄送当前登录用户的项目列表 + * * @param param * @param processInsIds * @return java.util.List @@ -1348,12 +1372,12 @@ public class TodoCenterManage { Page page = param.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(Project.class); wrapper.like(StrUtil.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName()) - .like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName()) - .eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear()) - .eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement()) - .ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime, - param.getProcessLaunchStartTime()) - .le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime()); + .like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName()) + .eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear()) + .eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement()) + .ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime, + param.getProcessLaunchStartTime()) + .le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime()); projectService.page(page, wrapper); return page.getRecords().stream() @@ -1363,6 +1387,7 @@ public class TodoCenterManage { /** * 待办中心-抄送我的项目列表导出 + * * @param response * @param param * @return void @@ -1370,7 +1395,7 @@ public class TodoCenterManage { * @since 2023/02/11 */ public void exportCcMeProjectList(HttpServletResponse response, ReqToBeProcessedDTO param) { - + param.setPageNumber(1); param.setPageSize(10000); // 获取当前登录用户ID @@ -1422,6 +1447,6 @@ public class TodoCenterManage { excelExportWriter.setHeadPropertyClass(List.class); excelExportWriter.setHeadPropertyFlag(Boolean.FALSE); ExcelDownUtil.excelExportFile(response, excelExportWriter); - + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java index 395d38b..244cf10 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java @@ -6,7 +6,7 @@ import java.util.List; import com.ningdatech.basic.model.PagePo; -import com.ningdatech.pmapi.common.enums.ExportOptionEnum; +import com.ningdatech.pmapi.common.enumeration.ExportOptionEnum; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java index c91ee0a..4ed9825 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java @@ -3,7 +3,7 @@ package com.ningdatech.pmapi.sys.service; import cn.hutool.db.Db; import cn.hutool.db.Entity; import com.ningdatech.pmapi.AppTests; -import com.ningdatech.pmapi.sys.entity.Menu; +import com.ningdatech.pmapi.sys.model.entity.Menu; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; From f16ef9474ad0ad7b99ba31e9753189fc6cce29a7 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sun, 12 Feb 2023 20:32:11 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AB=8B=E9=A1=B9?= =?UTF-8?q?=E6=89=B9=E5=A4=8D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualPlanController.java | 10 ++++ .../projectlib/manage/AnnualPlanLibManage.java | 17 +++++++ .../pmapi/projectlib/model/entity/Project.java | 4 ++ .../projectlib/model/req/ProjectApprovedReq.java | 53 ++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 500f879..43a252a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -1,7 +1,9 @@ package com.ningdatech.pmapi.projectlib.controller; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; +import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; @@ -36,8 +38,16 @@ public class AnnualPlanController { @PostMapping("/startProjectDeclared") @ApiOperation("开启项目申报") + @WebLog("开启项目申报") public void startProjectDeclared(@RequestBody @Valid StartProjectDeclareReq req) { annualPlanLibManage.startProjectDeclared(req); } + @PostMapping("/projectApproved") + @ApiOperation("立项批复") + @WebLog("立项批复") + public void projectApproved(@RequestBody @Valid ProjectApprovedReq req) throws Exception { + annualPlanLibManage.projectApproved(req); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index 1e3b004..fe3c113 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -1,6 +1,8 @@ package com.ningdatech.pmapi.projectlib.manage; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.PageVo; @@ -10,6 +12,7 @@ import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; @@ -106,4 +109,18 @@ public class AnnualPlanLibManage { }); } + @Transactional(rollbackFor = Exception.class) + public void projectApproved(ProjectApprovedReq req) throws Exception { + Project project = projectService.getById(req.getProjectId()); + stateMachine.execute(project, ProjectStatusChangeEvent.PROJECT_APPROVAL); + LambdaUpdateWrapper update = Wrappers.lambdaUpdate(Project.class) + .set(Project::getApprovalAmount, req.getApprovedAmount()) + .set(Project::getApprovedFile, req.getApprovedFileId()) + .set(Project::getBuildCycle, req.getBuildCycle()) + .set(Project::getConstructionPlanFile, req.getBuildPlanFileId()) + .set(Project::getApprovalDate, req.getApprovedDate()) + .eq(Project::getId, req.getProjectId()); + projectService.update(update); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index e607751..4ba35f9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -9,6 +9,7 @@ import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; +import java.time.LocalDate; import java.time.LocalDateTime; /** @@ -257,6 +258,9 @@ public class Project implements Serializable { @ApiModelProperty("立项批复文件") private String approvedFile; + @ApiModelProperty("立项批复时间") + private LocalDate approvalDate; + @ApiModelProperty("批复金额") private BigDecimal approvedTotalInvestmentIncrease; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java new file mode 100644 index 0000000..d98645f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java @@ -0,0 +1,53 @@ +package com.ningdatech.pmapi.projectlib.model.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Range; + +import javax.validation.constraints.DecimalMax; +import javax.validation.constraints.DecimalMin; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + *

+ * 立项批复参数类 + *

+ * + * @author WendyYang + * @since 20:04 2023/2/12 + */ +@Data +@ApiModel("立项批复参数类") +public class ProjectApprovedReq { + + @ApiModelProperty("项目ID") + @NotNull(message = "项目ID不能为空") + private Long projectId; + + @ApiModelProperty("批复金额") + @NotNull(message = "批复金额不能为空") + @DecimalMax(value = "999999999.99", message = "批复金额无效") + @DecimalMin(value = "0.01", message = "批复金额无效") + private BigDecimal approvedAmount; + + @NotNull(message = "批复时间不能为空") + @ApiModelProperty("批复时间") + private LocalDate approvedDate; + + @ApiModelProperty("建设周期") + @NotNull(message = "建设周期不能为空") + @Range(min = 1, max = 99999, message = "建设周期无效") + private LocalDate buildCycle; + + @ApiModelProperty("批复文件ID") + @NotNull(message = "批复文件不能为空") + private Long approvedFileId; + + @ApiModelProperty("建设方案文件ID") + @NotNull(message = "建设方案不能为空") + private Long buildPlanFileId; + +} From 99b3994968ef1e719c9a675b0307efc14b597439 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 09:38:32 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=9A=82=E7=BC=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualPlanController.java | 8 ++++++++ .../projectlib/manage/AnnualPlanLibManage.java | 8 +++++++- .../projectlib/model/req/ProjectApprovedReq.java | 2 +- .../pmapi/projectlib/model/req/ProjectIdReq.java | 23 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 43a252a..2d1bc26 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -4,6 +4,7 @@ import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; +import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; @@ -50,4 +51,11 @@ public class AnnualPlanController { annualPlanLibManage.projectApproved(req); } + @PostMapping("/suspendAnnualPlan") + @ApiOperation("暂缓年度计划") + @WebLog("暂缓年度计划") + public void suspendAnnualPlan(@RequestBody @Valid ProjectIdReq req) throws Exception { + annualPlanLibManage.suspendAnnualPlan(req); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index fe3c113..9da7bd6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -13,6 +13,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; +import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; @@ -47,7 +48,6 @@ public class AnnualPlanLibManage { */ private static final List ANNUAL_PLAN_LIST_STATUS = Arrays.asList( IN_THE_ANNUAL_PLAN, - BE_SUSPENDED, SCHEME_UNDER_REVIEW, SCHEME_REVIEW_FAILED, TO_BE_APPROVED, @@ -123,4 +123,10 @@ public class AnnualPlanLibManage { projectService.update(update); } + @Transactional(rollbackFor = Exception.class) + public void suspendAnnualPlan(ProjectIdReq req) throws Exception { + Project project = projectService.getById(req.getProjectId()); + stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java index d98645f..64708c3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java @@ -40,7 +40,7 @@ public class ProjectApprovedReq { @ApiModelProperty("建设周期") @NotNull(message = "建设周期不能为空") @Range(min = 1, max = 99999, message = "建设周期无效") - private LocalDate buildCycle; + private Integer buildCycle; @ApiModelProperty("批复文件ID") @NotNull(message = "批复文件不能为空") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java new file mode 100644 index 0000000..82278b1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java @@ -0,0 +1,23 @@ +package com.ningdatech.pmapi.projectlib.model.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + *

+ * ProjectIdReq + *

+ * + * @author WendyYang + * @since 09:32 2023/2/13 + */ +@Data +public class ProjectIdReq { + + @ApiModelProperty("项目ID") + @NotNull(message = "项目ID不能为空") + private Long projectId; + +} From 5a122b10f23196276ab1e116715d42c7a7c08370 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 10:15:33 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E8=A1=A8=E9=80=86=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/GeneratorCodeKingbaseConfig.java | 2 +- .../pmapi/projectlib/mapper/ProjectInstMapper.java | 16 +++++ .../pmapi/projectlib/mapper/ProjectInstMapper.xml | 5 ++ .../pmapi/projectlib/model/entity/ProjectInst.java | 78 ++++++++++++++++++++++ .../projectlib/service/IProjectInstService.java | 16 +++++ .../service/impl/ProjectInstServiceImpl.java | 20 ++++++ 6 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectInstService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java index e326099..c4453af 100644 --- a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java @@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig { } public static void main(String[] args) { - generate("Lierbao", "organization", PATH_LXX, "ding_employee_info"); + generate("Poffy", "projectlib", PATH_YYD, "nd_project_inst"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java new file mode 100644 index 0000000..3af978f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectlib.mapper; + +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Poffy + * @since 2023-02-13 + */ +public interface ProjectInstMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml new file mode 100644 index 0000000..96bb279 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java new file mode 100644 index 0000000..4266829 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java @@ -0,0 +1,78 @@ +package com.ningdatech.pmapi.projectlib.model.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; + +/** + *

+ * + *

+ * + * @author Poffy + * @since 2023-02-13 + */ +@TableName("nd_project_inst") +@ApiModel(value = "NdProjectInst对象", description = "") +public class ProjectInst implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long id; + + private Long projectId; + + private String instCode; + + private LocalDateTime creatOn; + + private LocalDateTime updateOn; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + public String getInstCode() { + return instCode; + } + + public void setInstCode(String instCode) { + this.instCode = instCode; + } + public LocalDateTime getCreatOn() { + return creatOn; + } + + public void setCreatOn(LocalDateTime creatOn) { + this.creatOn = creatOn; + } + public LocalDateTime getUpdateOn() { + return updateOn; + } + + public void setUpdateOn(LocalDateTime updateOn) { + this.updateOn = updateOn; + } + + @Override + public String toString() { + return "NdProjectInst{" + + "id=" + id + + ", projectId=" + projectId + + ", instCode=" + instCode + + ", creatOn=" + creatOn + + ", updateOn=" + updateOn + + "}"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectInstService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectInstService.java new file mode 100644 index 0000000..8f80015 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectInstService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectlib.service; + +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author Poffy + * @since 2023-02-13 + */ +public interface IProjectInstService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java new file mode 100644 index 0000000..58650e9 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.projectlib.service.impl; + +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.ningdatech.pmapi.projectlib.mapper.ProjectInstMapper; +import com.ningdatech.pmapi.projectlib.service.IProjectInstService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author Poffy + * @since 2023-02-13 + */ +@Service +public class ProjectInstServiceImpl extends ServiceImpl implements IProjectInstService { + +} From d20d78afe592f6228d1c7a64bf58e9feb44ca769 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 13 Feb 2023 10:23:18 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=BA=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=88=86=E6=94=AF=E5=88=A4=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../builder/ProjectDeclareStateMachineBuilder.java | 6 +++--- .../pmapi/projectlib/controller/ProjectLibController.java | 6 ------ .../pmapi/projectlib/manage/ProjectLibManage.java | 13 ------------- .../pmapi/todocenter/manage/TodoCenterManage.java | 4 ++++ .../pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java | 3 +++ .../com/ningdatech/pmapi/statemachine/StateMachineTest.java | 8 ++++++-- 6 files changed, 16 insertions(+), 24 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java index 4283c0c..117c2af 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java @@ -91,7 +91,7 @@ public class ProjectDeclareStateMachineBuilder { .withChoice() .source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),projectDeclareAction.new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PRE_APPLYING).and() + .last(ProjectStatusEnum.PRE_APPLYING,projectDeclareAction.new ProjectDeclareChoiceAction()).and() // 待预审撤回,从待预审到单位内部审核中 .withExternal() .source(ProjectStatusEnum.PENDING_PREQUALIFICATION) @@ -127,11 +127,11 @@ public class ProjectDeclareStateMachineBuilder { .source(ProjectStatusEnum.PRE_APPLYING) .target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) .event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and() - // 预审中撤回,从待预审选择->省级部门联审中,预审中,完成其中一种状态 + // 预审中撤回,从待预审选择->省级部门联审中,待预审,完成其中一种状态 .withChoice() .source(ProjectStatusEnum.PRE_APPLYING) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PRE_APPLYING).and() + .last(ProjectStatusEnum.PENDING_PREQUALIFICATION,projectDeclareAction.new ProjectDeclareChoiceAction()).and() // 部门联审通过,从部门联审中到年度计划中 .withExternal() .source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java index a929f2e..0f9a893 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java @@ -40,10 +40,4 @@ public class ProjectLibController { return projectLibManage.getProjectDetail(id); } - @GetMapping("/getProjectInfo") - @ApiOperation("获取申报项目信息") - private Project getProjectInfo (@RequestParam String processInstanceId){ - return projectLibManage.getProjectInfo(processInstanceId); - } - } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 2e809cd..c3cbd08 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -95,17 +95,4 @@ public class ProjectLibManage { return vo; } - /** - * - * @param instanceCode 申报项目流程实例编号 - * @return com.ningdatech.pmapi.projectlib.model.entity.Project - * @author CMM - * @since 2023/02/11 11:15 - */ - public Project getProjectInfo(String instanceCode) { - // 查询项目申报信息 - Project projectInfo = projectService.getOne(Wrappers.lambdaQuery(Project.class) - .eq(Project::getInstCode, instanceCode)); - return projectInfo; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 1060fc6..cbb2d69 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -161,6 +161,7 @@ public class TodoCenterManage { List resVos = results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String format = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); @@ -952,6 +953,7 @@ public class TodoCenterManage { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); @@ -1124,6 +1126,7 @@ public class TodoCenterManage { results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); @@ -1330,6 +1333,7 @@ public class TodoCenterManage { results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java index 88725c1..f03e734 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java @@ -29,6 +29,9 @@ import org.springframework.format.annotation.DateTimeFormat; public class ResToBeProcessedDTO implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty("项目ID") + private Long projectId; + @ApiModelProperty("流程实例编号") private String instanceCode; diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java index d9ed6e6..1819a47 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java @@ -8,6 +8,8 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import java.math.BigDecimal; + /** * 状态机测试 * @@ -22,7 +24,9 @@ public class StateMachineTest extends AppTests { @Test public void stateMachineTest() throws Exception { Project project = new Project(); - project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); - stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS); + project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + project.setDeclareAmount(BigDecimal.valueOf(2000)); + // stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS); + stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); } } From 6def1d850b70922ee6fd41f0760102ba5aafbfd0 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 14:35:34 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualPlanController.java | 8 ++ .../projectlib/manage/AnnualPlanLibManage.java | 16 +++ .../projectlib/model/dto/AnnualLibImportDTO.java | 108 +++++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 2d1bc26..d50be49 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -12,6 +12,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; @@ -58,4 +59,11 @@ public class AnnualPlanController { annualPlanLibManage.suspendAnnualPlan(req); } + @PostMapping("/importAnnualPlan") + @ApiOperation("导入年度计划") + @WebLog("导入年度计划") + public void importAnnualPlan(MultipartFile file) { + annualPlanLibManage.importAnnualPlan(file); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index 9da7bd6..fb83502 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -1,5 +1,8 @@ package com.ningdatech.pmapi.projectlib.manage; +import cn.hutool.poi.excel.ExcelUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -21,10 +24,14 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; @@ -129,4 +136,13 @@ public class AnnualPlanLibManage { stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND); } + @Transactional(rollbackFor = Exception.class) + public void importAnnualPlan(MultipartFile file) { + try (InputStream inputStream = file.getInputStream()) { + EasyExcel.read(inputStream).sheet(0); + } catch (IOException e) { + throw BizException.wrap("导入年度计划失败"); + } + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java new file mode 100644 index 0000000..6b40bed --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java @@ -0,0 +1,108 @@ +package com.ningdatech.pmapi.projectlib.model.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +/** + *

+ * AnnualLibImportDTO + *

+ * + * @author WendyYang + * @since 13:46 2023/2/13 + */ +@Data +public class AnnualLibImportDTO { + + @ExcelProperty("序号") + @NotNull(message = "序号不能为空") + private Integer serialNumber; + + @ExcelProperty("项目id") + @NotNull(message = "项目ID不能为空") + private Long projectId; + + @ExcelProperty("项目名称") + @NotBlank(message = "项目名称不能为空") + private String projectName; + + @NotBlank(message = "建设内容不能为空") + @ExcelProperty("建设内容") + private String projectIntroduction; + + @NotBlank(message = "建设依据不能为空") + @ExcelProperty("建设依据") + private String buildBasis; + + @ExcelProperty("建设性质") + @NotBlank(message = "建设性质不能为空") + private String isFirst; + + @ExcelProperty("建设起止年限") + @NotBlank(message = "建设起止年限不能为空") + private String buildCycle; + + @NotBlank(message = "总投资不能为空") + @ExcelProperty("总投资") + private BigDecimal declaredAmount; + + @NotNull(message = "年度投资额不能为空") + @ExcelProperty("年度投资额") + private BigDecimal annualPlanAMount; + + @ExcelProperty("自有资金") + @NotNull(message = "自由资金不能为空") + private BigDecimal declareHaveAmount; + + @ExcelProperty("政府投资-本级财政") + @NotNull(message = "政府投资-本级财政不能为空") + private BigDecimal declareGovOwnFinanceAmount; + + @ExcelProperty("政府投资-上级补") + @NotNull(message = "政府投资-上级补不能为空") + private BigDecimal declareGovSuperiorFinanceAmount; + + @ExcelProperty("银行贷款") + @NotNull(message = "银行贷款不能为空") + private BigDecimal declareBankLendingAmount; + + @ExcelProperty("其他") + @NotNull(message = "其他不能为空") + private BigDecimal declareOtherAmount; + + @ExcelProperty("一季度") + @NotBlank(message = "一季度不能为空") + private String engineeringSpeedOne; + + @ExcelProperty("二季度") + @NotBlank(message = "二季度不能为空") + private String engineeringSpeedTwo; + + @ExcelProperty("三季度") + @NotBlank(message = "三季度不能为空") + private String engineeringSpeedThree; + + @ExcelProperty("四季度") + @NotBlank(message = "四季度不能为空") + private String engineeringSpeedFour; + + @ExcelProperty("建设单位") + @NotBlank(message = "建设单位不能为空") + private String buildUnitName; + + @ExcelProperty("项目联系人") + @NotBlank(message = "项目联系人不能为空") + private String contactName; + + @ExcelProperty("项目分管领导") + @NotBlank(message = "项目分管领导不能为空") + private String responsibleMan; + + @ExcelProperty("备注") + private String projectRemarks; + +}