ソースを参照

1.修改权限验证请求头
2.生成代码
3.子系统管理

sss 3 年 前
コミット
e13443e3ab
41 ファイル変更1603 行追加93 行削除
  1. 6 21
      eladmin-activity/eladmin-activity.iml
  2. 3 11
      eladmin-common/eladmin-common.iml
  3. 1 1
      eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java
  4. 3 11
      eladmin-generator/eladmin-generator.iml
  5. 3 11
      eladmin-logging/eladmin-logging.iml
  6. 5 20
      eladmin-system/eladmin-system.iml
  7. 87 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/domain/DmAnnounce.java
  8. 28 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/repository/DmAnnounceRepository.java
  9. 87 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/rest/DmAnnounceController.java
  10. 83 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/DmAnnounceService.java
  11. 63 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/dto/DmAnnounceDto.java
  12. 29 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/dto/DmAnnounceQueryCriteria.java
  13. 113 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/impl/DmAnnounceServiceImpl.java
  14. 32 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/mapstruct/DmAnnounceMapper.java
  15. 75 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/api/domain/DmApi.java
  16. 28 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/api/repository/DmApiRepository.java
  17. 87 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/api/rest/DmApiController.java
  18. 83 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/DmApiService.java
  19. 54 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/dto/DmApiDto.java
  20. 29 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/dto/DmApiQueryCriteria.java
  21. 110 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/impl/DmApiServiceImpl.java
  22. 32 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/mapstruct/DmApiMapper.java
  23. 68 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/system/domain/DmSystem.java
  24. 28 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/system/repository/DmSystemRepository.java
  25. 87 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/system/rest/DmSystemController.java
  26. 83 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/DmSystemService.java
  27. 48 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/dto/DmSystemDto.java
  28. 29 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/dto/DmSystemQueryCriteria.java
  29. 107 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/impl/DmSystemServiceImpl.java
  30. 32 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/mapstruct/DmSystemMapper.java
  31. 8 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/user/domain/DmUser.java
  32. 7 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/user/service/dto/DmUserDto.java
  33. 1 1
      eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ZkDataPushTask.java
  34. 4 0
      eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ZkDataSyncTask.java
  35. 8 0
      eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java
  36. 1 1
      eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java
  37. 4 0
      eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java
  38. 4 3
      eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java
  39. 38 2
      eladmin-system/src/main/java/me/zhengjie/modules/thirdparty/v1/UserApiController.java
  40. 3 11
      eladmin-tools/eladmin-tools.iml
  41. 2 0
      eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java

+ 6 - 21
eladmin-activity/eladmin-activity.iml

@@ -1,22 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
   <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
     <facet type="web" name="Web">
       <configuration>
         <webroots />
       </configuration>
     </facet>
-    <facet type="jpa" name="JPA">
-      <configuration>
-        <setting name="validation-enabled" value="true" />
-        <setting name="provider-name" value="Hibernate" />
-        <datasource-mapping />
-        <naming-strategy-map />
-      </configuration>
-    </facet>
-    <facet type="Spring" name="Spring">
-      <configuration />
-    </facet>
   </component>
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
     <output url="file://$MODULE_DIR$/target/classes" />
@@ -76,16 +68,6 @@
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-svg-dom:1.10" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-ext:1.10" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-svggen:1.10" level="project" />
-    <orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
-    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
-    <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
-    <orderEntry type="library" name="Maven: javax.xml.ws:jaxws-api:2.3.1" level="project" />
-    <orderEntry type="library" name="Maven: javax.xml.soap:javax.xml.soap-api:1.4.0" level="project" />
-    <orderEntry type="library" name="Maven: javax.jws:javax.jws-api:1.1" level="project" />
-    <orderEntry type="library" name="Maven: org.glassfish.corba:glassfish-corba-omgapi:4.1.0" level="project" />
-    <orderEntry type="library" name="Maven: org.mozilla:rhino:1.7.10" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-transcoder:1.8" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-anim:1.8" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-awt-util:1.8" level="project" />
@@ -109,6 +91,8 @@
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.1.0.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.2" level="project" />
     <orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.3" level="project" />
+    <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
+    <orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
     <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.3.7.Final" level="project" />
     <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
     <orderEntry type="library" name="Maven: javax.persistence:javax.persistence-api:2.2" level="project" />
@@ -130,6 +114,7 @@
     <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.1" level="project" />
     <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.1" level="project" />
     <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
+    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
     <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.0.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.7" level="project" />

+ 3 - 11
eladmin-common/eladmin-common.iml

@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
   <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
     <facet type="web" name="Web">
       <configuration>
         <webroots />
@@ -9,17 +12,6 @@
         </sourceRoots>
       </configuration>
     </facet>
-    <facet type="jpa" name="JPA">
-      <configuration>
-        <setting name="validation-enabled" value="true" />
-        <setting name="provider-name" value="Hibernate" />
-        <datasource-mapping />
-        <naming-strategy-map />
-      </configuration>
-    </facet>
-    <facet type="Spring" name="Spring">
-      <configuration />
-    </facet>
   </component>
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
     <output url="file://$MODULE_DIR$/target/classes" />

+ 1 - 1
eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java

@@ -109,7 +109,7 @@ public class SecurityUtils {
     public static void CheckApiAuth(QueryPageParams params) {
         HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
         if (request != null) {
-            String accesstoken = request.getHeader("X_YT_ACCESS_TOKEN");
+            String accesstoken = request.getHeader("XYTACCESSTOKEN");
             String token = "DMERPYT!@#$QWER2021+{:>";
 
             if (params == null || StringUtils.isBlank(params.getTimestamp()) || StringUtils.isBlank(params.getNonce()) || StringUtils.isBlank(accesstoken)) {

+ 3 - 11
eladmin-generator/eladmin-generator.iml

@@ -1,22 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
   <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
     <facet type="web" name="Web">
       <configuration>
         <webroots />
       </configuration>
     </facet>
-    <facet type="jpa" name="JPA">
-      <configuration>
-        <setting name="validation-enabled" value="true" />
-        <setting name="provider-name" value="Hibernate" />
-        <datasource-mapping />
-        <naming-strategy-map />
-      </configuration>
-    </facet>
-    <facet type="Spring" name="Spring">
-      <configuration />
-    </facet>
   </component>
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
     <output url="file://$MODULE_DIR$/target/classes" />

+ 3 - 11
eladmin-logging/eladmin-logging.iml

@@ -1,22 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
   <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
     <facet type="web" name="Web">
       <configuration>
         <webroots />
       </configuration>
     </facet>
-    <facet type="jpa" name="JPA">
-      <configuration>
-        <setting name="validation-enabled" value="true" />
-        <setting name="provider-name" value="Hibernate" />
-        <datasource-mapping />
-        <naming-strategy-map />
-      </configuration>
-    </facet>
-    <facet type="Spring" name="Spring">
-      <configuration />
-    </facet>
   </component>
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
     <output url="file://$MODULE_DIR$/target/classes" />

+ 5 - 20
eladmin-system/eladmin-system.iml

@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
   <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
     <facet type="web" name="Web">
       <configuration>
         <webroots />
@@ -10,17 +13,6 @@
         </sourceRoots>
       </configuration>
     </facet>
-    <facet type="jpa" name="JPA">
-      <configuration>
-        <setting name="validation-enabled" value="true" />
-        <setting name="provider-name" value="Hibernate" />
-        <datasource-mapping />
-        <naming-strategy-map />
-      </configuration>
-    </facet>
-    <facet type="Spring" name="Spring">
-      <configuration />
-    </facet>
   </component>
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
     <output url="file://$MODULE_DIR$/target/classes" />
@@ -83,15 +75,6 @@
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-svg-dom:1.10" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-ext:1.10" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-svggen:1.10" level="project" />
-    <orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
-    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
-    <orderEntry type="library" name="Maven: javax.xml.ws:jaxws-api:2.3.1" level="project" />
-    <orderEntry type="library" name="Maven: javax.xml.soap:javax.xml.soap-api:1.4.0" level="project" />
-    <orderEntry type="library" name="Maven: javax.jws:javax.jws-api:1.1" level="project" />
-    <orderEntry type="library" name="Maven: org.glassfish.corba:glassfish-corba-omgapi:4.1.0" level="project" />
-    <orderEntry type="library" name="Maven: org.mozilla:rhino:1.7.10" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-transcoder:1.8" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-anim:1.8" level="project" />
     <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-awt-util:1.8" level="project" />
@@ -132,6 +115,7 @@
     <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.2.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.3" level="project" />
     <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
+    <orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
     <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.3.7.Final" level="project" />
     <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
     <orderEntry type="library" name="Maven: javax.persistence:javax.persistence-api:2.2" level="project" />
@@ -154,6 +138,7 @@
     <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.1" level="project" />
     <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.1" level="project" />
     <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
+    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
     <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.0.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.7" level="project" />

+ 87 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/domain/DmAnnounce.java

@@ -0,0 +1,87 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.announce.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import javax.validation.constraints.*;
+import java.sql.Timestamp;
+import java.io.Serializable;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Entity
+@Data
+@Table(name="dm_announce")
+public class DmAnnounce implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    @ApiModelProperty(value = "id")
+    private Integer id;
+
+    @Column(name = "announce_title")
+    @ApiModelProperty(value = "公告标题")
+    private String announceTitle;
+
+    @Column(name = "announce_content")
+    @ApiModelProperty(value = "公告内容")
+    private String announceContent;
+
+    @Column(name = "send_type")
+    @ApiModelProperty(value = "发布方式(0.立刻发布 1.定时发布)")
+    private Long sendType;
+
+    @Column(name = "send_time")
+    @ApiModelProperty(value = "定时发布公告时间")
+    private Timestamp sendTime;
+
+    @Column(name = "is_cancel")
+    @ApiModelProperty(value = "是否取消定时发布(0.否 1.是)")
+    private Long isCancel;
+
+    @Column(name = "send_state")
+    @ApiModelProperty(value = "发布状态(0.未发布 1.已发布)")
+    private Long sendState;
+
+    @Column(name = "create_by")
+    @ApiModelProperty(value = "创建者")
+    private String createBy;
+
+    @Column(name = "update_by")
+    @ApiModelProperty(value = "更新者")
+    private String updateBy;
+
+    @Column(name = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Timestamp createTime;
+
+    @Column(name = "update_time")
+    @ApiModelProperty(value = "更新时间")
+    private Timestamp updateTime;
+
+    public void copy(DmAnnounce source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}

+ 28 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/repository/DmAnnounceRepository.java

@@ -0,0 +1,28 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.announce.repository;
+
+import me.zhengjie.modules.dm.announce.domain.DmAnnounce;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+public interface DmAnnounceRepository extends JpaRepository<DmAnnounce, Integer>, JpaSpecificationExecutor<DmAnnounce> {
+}

+ 87 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/rest/DmAnnounceController.java

@@ -0,0 +1,87 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.announce.rest;
+
+import me.zhengjie.annotation.Log;
+import me.zhengjie.modules.dm.announce.domain.DmAnnounce;
+import me.zhengjie.modules.dm.announce.service.DmAnnounceService;
+import me.zhengjie.modules.dm.announce.service.dto.DmAnnounceQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "系统公告管理")
+@RequestMapping("/api/dmAnnounce")
+public class DmAnnounceController {
+
+    private final DmAnnounceService dmAnnounceService;
+
+    @Log("导出数据")
+    @ApiOperation("导出数据")
+    @GetMapping(value = "/download")
+    @PreAuthorize("@el.check('dmAnnounce:list')")
+    public void download(HttpServletResponse response, DmAnnounceQueryCriteria criteria) throws IOException {
+        dmAnnounceService.download(dmAnnounceService.queryAll(criteria), response);
+    }
+
+    @GetMapping
+    @Log("查询系统公告")
+    @ApiOperation("查询系统公告")
+    @PreAuthorize("@el.check('dmAnnounce:list')")
+    public ResponseEntity<Object> query(DmAnnounceQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity<>(dmAnnounceService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @PostMapping
+    @Log("新增系统公告")
+    @ApiOperation("新增系统公告")
+    @PreAuthorize("@el.check('dmAnnounce:add')")
+    public ResponseEntity<Object> create(@Validated @RequestBody DmAnnounce resources){
+        return new ResponseEntity<>(dmAnnounceService.create(resources),HttpStatus.CREATED);
+    }
+
+    @PutMapping
+    @Log("修改系统公告")
+    @ApiOperation("修改系统公告")
+    @PreAuthorize("@el.check('dmAnnounce:edit')")
+    public ResponseEntity<Object> update(@Validated @RequestBody DmAnnounce resources){
+        dmAnnounceService.update(resources);
+        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除系统公告")
+    @ApiOperation("删除系统公告")
+    @PreAuthorize("@el.check('dmAnnounce:del')")
+    @DeleteMapping
+    public ResponseEntity<Object> delete(@RequestBody Integer[] ids) {
+        dmAnnounceService.deleteAll(ids);
+        return new ResponseEntity<>(HttpStatus.OK);
+    }
+}

+ 83 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/DmAnnounceService.java

@@ -0,0 +1,83 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.announce.service;
+
+import me.zhengjie.modules.dm.announce.domain.DmAnnounce;
+import me.zhengjie.modules.dm.announce.service.dto.DmAnnounceDto;
+import me.zhengjie.modules.dm.announce.service.dto.DmAnnounceQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @description 服务接口
+* @author Li Rui
+* @date 2021-11-30
+**/
+public interface DmAnnounceService {
+
+    /**
+    * 查询数据分页
+    * @param criteria 条件
+    * @param pageable 分页参数
+    * @return Map<String,Object>
+    */
+    Map<String,Object> queryAll(DmAnnounceQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria 条件参数
+    * @return List<DmAnnounceDto>
+    */
+    List<DmAnnounceDto> queryAll(DmAnnounceQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id ID
+     * @return DmAnnounceDto
+     */
+    DmAnnounceDto findById(Integer id);
+
+    /**
+    * 创建
+    * @param resources /
+    * @return DmAnnounceDto
+    */
+    DmAnnounceDto create(DmAnnounce resources);
+
+    /**
+    * 编辑
+    * @param resources /
+    */
+    void update(DmAnnounce resources);
+
+    /**
+    * 多选删除
+    * @param ids /
+    */
+    void deleteAll(Integer[] ids);
+
+    /**
+    * 导出数据
+    * @param all 待导出的数据
+    * @param response /
+    * @throws IOException /
+    */
+    void download(List<DmAnnounceDto> all, HttpServletResponse response) throws IOException;
+}

+ 63 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/dto/DmAnnounceDto.java

@@ -0,0 +1,63 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.announce.service.dto;
+
+import lombok.Data;
+import java.sql.Timestamp;
+import java.io.Serializable;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Data
+public class DmAnnounceDto implements Serializable {
+
+    /** id */
+    private Integer id;
+
+    /** 公告标题 */
+    private String announceTitle;
+
+    /** 公告内容 */
+    private String announceContent;
+
+    /** 发布方式(0.立刻发布 1.定时发布) */
+    private Long sendType;
+
+    /** 定时发布公告时间 */
+    private Timestamp sendTime;
+
+    /** 是否取消定时发布(0.否 1.是) */
+    private Long isCancel;
+
+    /** 发布状态(0.未发布 1.已发布) */
+    private Long sendState;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 创建时间 */
+    private Timestamp createTime;
+
+    /** 更新时间 */
+    private Timestamp updateTime;
+}

+ 29 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/dto/DmAnnounceQueryCriteria.java

@@ -0,0 +1,29 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.announce.service.dto;
+
+import lombok.Data;
+import java.util.List;
+import me.zhengjie.annotation.Query;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Data
+public class DmAnnounceQueryCriteria{
+}

+ 113 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/impl/DmAnnounceServiceImpl.java

@@ -0,0 +1,113 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.announce.service.impl;
+
+import me.zhengjie.modules.dm.announce.domain.DmAnnounce;
+import me.zhengjie.utils.ValidationUtil;
+import me.zhengjie.utils.FileUtil;
+import lombok.RequiredArgsConstructor;
+import me.zhengjie.modules.dm.announce.repository.DmAnnounceRepository;
+import me.zhengjie.modules.dm.announce.service.DmAnnounceService;
+import me.zhengjie.modules.dm.announce.service.dto.DmAnnounceDto;
+import me.zhengjie.modules.dm.announce.service.dto.DmAnnounceQueryCriteria;
+import me.zhengjie.modules.dm.announce.service.mapstruct.DmAnnounceMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import me.zhengjie.utils.PageUtil;
+import me.zhengjie.utils.QueryHelp;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+/**
+* @website https://el-admin.vip
+* @description 服务实现
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Service
+@RequiredArgsConstructor
+public class DmAnnounceServiceImpl implements DmAnnounceService {
+
+    private final DmAnnounceRepository dmAnnounceRepository;
+    private final DmAnnounceMapper dmAnnounceMapper;
+
+    @Override
+    public Map<String,Object> queryAll(DmAnnounceQueryCriteria criteria, Pageable pageable){
+        Page<DmAnnounce> page = dmAnnounceRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
+        return PageUtil.toPage(page.map(dmAnnounceMapper::toDto));
+    }
+
+    @Override
+    public List<DmAnnounceDto> queryAll(DmAnnounceQueryCriteria criteria){
+        return dmAnnounceMapper.toDto(dmAnnounceRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
+    }
+
+    @Override
+    @Transactional
+    public DmAnnounceDto findById(Integer id) {
+        DmAnnounce dmAnnounce = dmAnnounceRepository.findById(id).orElseGet(DmAnnounce::new);
+        ValidationUtil.isNull(dmAnnounce.getId(),"DmAnnounce","id",id);
+        return dmAnnounceMapper.toDto(dmAnnounce);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public DmAnnounceDto create(DmAnnounce resources) {
+        return dmAnnounceMapper.toDto(dmAnnounceRepository.save(resources));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(DmAnnounce resources) {
+        DmAnnounce dmAnnounce = dmAnnounceRepository.findById(resources.getId()).orElseGet(DmAnnounce::new);
+        ValidationUtil.isNull( dmAnnounce.getId(),"DmAnnounce","id",resources.getId());
+        dmAnnounce.copy(resources);
+        dmAnnounceRepository.save(dmAnnounce);
+    }
+
+    @Override
+    public void deleteAll(Integer[] ids) {
+        for (Integer id : ids) {
+            dmAnnounceRepository.deleteById(id);
+        }
+    }
+
+    @Override
+    public void download(List<DmAnnounceDto> all, HttpServletResponse response) throws IOException {
+        List<Map<String, Object>> list = new ArrayList<>();
+        for (DmAnnounceDto dmAnnounce : all) {
+            Map<String,Object> map = new LinkedHashMap<>();
+            map.put("公告标题", dmAnnounce.getAnnounceTitle());
+            map.put("公告内容", dmAnnounce.getAnnounceContent());
+            map.put("发布方式(0.立刻发布 1.定时发布)", dmAnnounce.getSendType());
+            map.put("定时发布公告时间", dmAnnounce.getSendTime());
+            map.put("是否取消定时发布(0.否 1.是)", dmAnnounce.getIsCancel());
+            map.put("发布状态(0.未发布 1.已发布)", dmAnnounce.getSendState());
+            map.put("创建者", dmAnnounce.getCreateBy());
+            map.put("更新者", dmAnnounce.getUpdateBy());
+            map.put("创建时间", dmAnnounce.getCreateTime());
+            map.put("更新时间", dmAnnounce.getUpdateTime());
+            list.add(map);
+        }
+        FileUtil.downloadExcel(list, response);
+    }
+}

+ 32 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/announce/service/mapstruct/DmAnnounceMapper.java

@@ -0,0 +1,32 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.announce.service.mapstruct;
+
+import me.zhengjie.base.BaseMapper;
+import me.zhengjie.modules.dm.announce.domain.DmAnnounce;
+import me.zhengjie.modules.dm.announce.service.dto.DmAnnounceDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface DmAnnounceMapper extends BaseMapper<DmAnnounceDto, DmAnnounce> {
+
+}

+ 75 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/api/domain/DmApi.java

@@ -0,0 +1,75 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.api.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import javax.validation.constraints.*;
+import java.sql.Timestamp;
+import java.io.Serializable;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Entity
+@Data
+@Table(name="dm_api")
+public class DmApi implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    @ApiModelProperty(value = "id")
+    private Integer id;
+
+    @Column(name = "api_name")
+    @ApiModelProperty(value = "接口名称")
+    private String apiName;
+
+    @Column(name = "api_url")
+    @ApiModelProperty(value = "接口地址")
+    private String apiUrl;
+
+    @Column(name = "storage_id")
+    @ApiModelProperty(value = "接口配置文件id")
+    private Long storageId;
+
+    @Column(name = "create_by")
+    @ApiModelProperty(value = "创建者")
+    private String createBy;
+
+    @Column(name = "update_by")
+    @ApiModelProperty(value = "更新者")
+    private String updateBy;
+
+    @Column(name = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Timestamp createTime;
+
+    @Column(name = "update_time")
+    @ApiModelProperty(value = "更新时间")
+    private Timestamp updateTime;
+
+    public void copy(DmApi source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}

+ 28 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/api/repository/DmApiRepository.java

@@ -0,0 +1,28 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.api.repository;
+
+import me.zhengjie.modules.dm.api.domain.DmApi;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+public interface DmApiRepository extends JpaRepository<DmApi, Integer>, JpaSpecificationExecutor<DmApi> {
+}

+ 87 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/api/rest/DmApiController.java

@@ -0,0 +1,87 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.api.rest;
+
+import me.zhengjie.annotation.Log;
+import me.zhengjie.modules.dm.api.domain.DmApi;
+import me.zhengjie.modules.dm.api.service.DmApiService;
+import me.zhengjie.modules.dm.api.service.dto.DmApiQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "接口管理")
+@RequestMapping("/api/dmApi")
+public class DmApiController {
+
+    private final DmApiService dmApiService;
+
+    @Log("导出数据")
+    @ApiOperation("导出数据")
+    @GetMapping(value = "/download")
+    @PreAuthorize("@el.check('dmApi:list')")
+    public void download(HttpServletResponse response, DmApiQueryCriteria criteria) throws IOException {
+        dmApiService.download(dmApiService.queryAll(criteria), response);
+    }
+
+    @GetMapping
+    @Log("查询接口")
+    @ApiOperation("查询接口")
+    @PreAuthorize("@el.check('dmApi:list')")
+    public ResponseEntity<Object> query(DmApiQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity<>(dmApiService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @PostMapping
+    @Log("新增接口")
+    @ApiOperation("新增接口")
+    @PreAuthorize("@el.check('dmApi:add')")
+    public ResponseEntity<Object> create(@Validated @RequestBody DmApi resources){
+        return new ResponseEntity<>(dmApiService.create(resources),HttpStatus.CREATED);
+    }
+
+    @PutMapping
+    @Log("修改接口")
+    @ApiOperation("修改接口")
+    @PreAuthorize("@el.check('dmApi:edit')")
+    public ResponseEntity<Object> update(@Validated @RequestBody DmApi resources){
+        dmApiService.update(resources);
+        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除接口")
+    @ApiOperation("删除接口")
+    @PreAuthorize("@el.check('dmApi:del')")
+    @DeleteMapping
+    public ResponseEntity<Object> delete(@RequestBody Integer[] ids) {
+        dmApiService.deleteAll(ids);
+        return new ResponseEntity<>(HttpStatus.OK);
+    }
+}

+ 83 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/DmApiService.java

@@ -0,0 +1,83 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.api.service;
+
+import me.zhengjie.modules.dm.api.domain.DmApi;
+import me.zhengjie.modules.dm.api.service.dto.DmApiDto;
+import me.zhengjie.modules.dm.api.service.dto.DmApiQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @description 服务接口
+* @author Li Rui
+* @date 2021-11-30
+**/
+public interface DmApiService {
+
+    /**
+    * 查询数据分页
+    * @param criteria 条件
+    * @param pageable 分页参数
+    * @return Map<String,Object>
+    */
+    Map<String,Object> queryAll(DmApiQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria 条件参数
+    * @return List<DmApiDto>
+    */
+    List<DmApiDto> queryAll(DmApiQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id ID
+     * @return DmApiDto
+     */
+    DmApiDto findById(Integer id);
+
+    /**
+    * 创建
+    * @param resources /
+    * @return DmApiDto
+    */
+    DmApiDto create(DmApi resources);
+
+    /**
+    * 编辑
+    * @param resources /
+    */
+    void update(DmApi resources);
+
+    /**
+    * 多选删除
+    * @param ids /
+    */
+    void deleteAll(Integer[] ids);
+
+    /**
+    * 导出数据
+    * @param all 待导出的数据
+    * @param response /
+    * @throws IOException /
+    */
+    void download(List<DmApiDto> all, HttpServletResponse response) throws IOException;
+}

+ 54 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/dto/DmApiDto.java

@@ -0,0 +1,54 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.api.service.dto;
+
+import lombok.Data;
+import java.sql.Timestamp;
+import java.io.Serializable;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Data
+public class DmApiDto implements Serializable {
+
+    /** id */
+    private Integer id;
+
+    /** 接口名称 */
+    private String apiName;
+
+    /** 接口地址 */
+    private String apiUrl;
+
+    /** 接口配置文件id */
+    private Long storageId;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 创建时间 */
+    private Timestamp createTime;
+
+    /** 更新时间 */
+    private Timestamp updateTime;
+}

+ 29 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/dto/DmApiQueryCriteria.java

@@ -0,0 +1,29 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.api.service.dto;
+
+import lombok.Data;
+import java.util.List;
+import me.zhengjie.annotation.Query;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Data
+public class DmApiQueryCriteria{
+}

+ 110 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/impl/DmApiServiceImpl.java

@@ -0,0 +1,110 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.api.service.impl;
+
+import me.zhengjie.modules.dm.api.domain.DmApi;
+import me.zhengjie.utils.ValidationUtil;
+import me.zhengjie.utils.FileUtil;
+import lombok.RequiredArgsConstructor;
+import me.zhengjie.modules.dm.api.repository.DmApiRepository;
+import me.zhengjie.modules.dm.api.service.DmApiService;
+import me.zhengjie.modules.dm.api.service.dto.DmApiDto;
+import me.zhengjie.modules.dm.api.service.dto.DmApiQueryCriteria;
+import me.zhengjie.modules.dm.api.service.mapstruct.DmApiMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import me.zhengjie.utils.PageUtil;
+import me.zhengjie.utils.QueryHelp;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+/**
+* @website https://el-admin.vip
+* @description 服务实现
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Service
+@RequiredArgsConstructor
+public class DmApiServiceImpl implements DmApiService {
+
+    private final DmApiRepository dmApiRepository;
+    private final DmApiMapper dmApiMapper;
+
+    @Override
+    public Map<String,Object> queryAll(DmApiQueryCriteria criteria, Pageable pageable){
+        Page<DmApi> page = dmApiRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
+        return PageUtil.toPage(page.map(dmApiMapper::toDto));
+    }
+
+    @Override
+    public List<DmApiDto> queryAll(DmApiQueryCriteria criteria){
+        return dmApiMapper.toDto(dmApiRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
+    }
+
+    @Override
+    @Transactional
+    public DmApiDto findById(Integer id) {
+        DmApi dmApi = dmApiRepository.findById(id).orElseGet(DmApi::new);
+        ValidationUtil.isNull(dmApi.getId(),"DmApi","id",id);
+        return dmApiMapper.toDto(dmApi);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public DmApiDto create(DmApi resources) {
+        return dmApiMapper.toDto(dmApiRepository.save(resources));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(DmApi resources) {
+        DmApi dmApi = dmApiRepository.findById(resources.getId()).orElseGet(DmApi::new);
+        ValidationUtil.isNull( dmApi.getId(),"DmApi","id",resources.getId());
+        dmApi.copy(resources);
+        dmApiRepository.save(dmApi);
+    }
+
+    @Override
+    public void deleteAll(Integer[] ids) {
+        for (Integer id : ids) {
+            dmApiRepository.deleteById(id);
+        }
+    }
+
+    @Override
+    public void download(List<DmApiDto> all, HttpServletResponse response) throws IOException {
+        List<Map<String, Object>> list = new ArrayList<>();
+        for (DmApiDto dmApi : all) {
+            Map<String,Object> map = new LinkedHashMap<>();
+            map.put("接口名称", dmApi.getApiName());
+            map.put("接口地址", dmApi.getApiUrl());
+            map.put("接口配置文件id", dmApi.getStorageId());
+            map.put("创建者", dmApi.getCreateBy());
+            map.put("更新者", dmApi.getUpdateBy());
+            map.put("创建时间", dmApi.getCreateTime());
+            map.put("更新时间", dmApi.getUpdateTime());
+            list.add(map);
+        }
+        FileUtil.downloadExcel(list, response);
+    }
+}

+ 32 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/api/service/mapstruct/DmApiMapper.java

@@ -0,0 +1,32 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.api.service.mapstruct;
+
+import me.zhengjie.base.BaseMapper;
+import me.zhengjie.modules.dm.api.domain.DmApi;
+import me.zhengjie.modules.dm.api.service.dto.DmApiDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface DmApiMapper extends BaseMapper<DmApiDto, DmApi> {
+
+}

+ 68 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/system/domain/DmSystem.java

@@ -0,0 +1,68 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.system.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import me.zhengjie.domain.LocalStorage;
+import me.zhengjie.modules.dm.user.domain.DmUser;
+
+import javax.persistence.*;
+import javax.validation.constraints.*;
+import java.sql.Timestamp;
+import java.io.Serializable;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Entity
+@Data
+@Table(name="dm_system")
+public class DmSystem implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    @ApiModelProperty(value = "id")
+    private Integer id;
+
+    @Column(name = "system_name")
+    @ApiModelProperty(value = "子系统名称")
+    private String systemName;
+
+    @Column(name = "system_url")
+    @ApiModelProperty(value = "子系统地址")
+    private String systemUrl;
+
+    @OneToOne
+    @JoinColumn(name = "storage_id")
+    @ApiModelProperty(value = "子系统图标")
+    private LocalStorage storage;
+
+    @OneToOne
+    @JoinColumn(name = "user_id")
+    @ApiModelProperty(value = "子系统管理员")
+    private DmUser dmUser;
+
+    public void copy(DmSystem source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}

+ 28 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/system/repository/DmSystemRepository.java

@@ -0,0 +1,28 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.system.repository;
+
+import me.zhengjie.modules.dm.system.domain.DmSystem;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+public interface DmSystemRepository extends JpaRepository<DmSystem, Integer>, JpaSpecificationExecutor<DmSystem> {
+}

+ 87 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/system/rest/DmSystemController.java

@@ -0,0 +1,87 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.system.rest;
+
+import me.zhengjie.annotation.Log;
+import me.zhengjie.modules.dm.system.domain.DmSystem;
+import me.zhengjie.modules.dm.system.service.DmSystemService;
+import me.zhengjie.modules.dm.system.service.dto.DmSystemQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "子系统管理")
+@RequestMapping("/api/dmSystem")
+public class DmSystemController {
+
+    private final DmSystemService dmSystemService;
+
+    @Log("导出数据")
+    @ApiOperation("导出数据")
+    @GetMapping(value = "/download")
+    @PreAuthorize("@el.check('dmSystem:list')")
+    public void download(HttpServletResponse response, DmSystemQueryCriteria criteria) throws IOException {
+        dmSystemService.download(dmSystemService.queryAll(criteria), response);
+    }
+
+    @GetMapping
+    @Log("查询子系统")
+    @ApiOperation("查询子系统")
+    @PreAuthorize("@el.check('dmSystem:list')")
+    public ResponseEntity<Object> query(DmSystemQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity<>(dmSystemService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @PostMapping
+    @Log("新增子系统")
+    @ApiOperation("新增子系统")
+    @PreAuthorize("@el.check('dmSystem:add')")
+    public ResponseEntity<Object> create(@Validated @RequestBody DmSystem resources){
+        return new ResponseEntity<>(dmSystemService.create(resources),HttpStatus.CREATED);
+    }
+
+    @PutMapping
+    @Log("修改子系统")
+    @ApiOperation("修改子系统")
+    @PreAuthorize("@el.check('dmSystem:edit')")
+    public ResponseEntity<Object> update(@Validated @RequestBody DmSystem resources){
+        dmSystemService.update(resources);
+        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除子系统")
+    @ApiOperation("删除子系统")
+    @PreAuthorize("@el.check('dmSystem:del')")
+    @DeleteMapping
+    public ResponseEntity<Object> delete(@RequestBody Integer[] ids) {
+        dmSystemService.deleteAll(ids);
+        return new ResponseEntity<>(HttpStatus.OK);
+    }
+}

+ 83 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/DmSystemService.java

@@ -0,0 +1,83 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.system.service;
+
+import me.zhengjie.modules.dm.system.domain.DmSystem;
+import me.zhengjie.modules.dm.system.service.dto.DmSystemDto;
+import me.zhengjie.modules.dm.system.service.dto.DmSystemQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @description 服务接口
+* @author Li Rui
+* @date 2021-11-30
+**/
+public interface DmSystemService {
+
+    /**
+    * 查询数据分页
+    * @param criteria 条件
+    * @param pageable 分页参数
+    * @return Map<String,Object>
+    */
+    Map<String,Object> queryAll(DmSystemQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria 条件参数
+    * @return List<DmSystemDto>
+    */
+    List<DmSystemDto> queryAll(DmSystemQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id ID
+     * @return DmSystemDto
+     */
+    DmSystemDto findById(Integer id);
+
+    /**
+    * 创建
+    * @param resources /
+    * @return DmSystemDto
+    */
+    DmSystemDto create(DmSystem resources);
+
+    /**
+    * 编辑
+    * @param resources /
+    */
+    void update(DmSystem resources);
+
+    /**
+    * 多选删除
+    * @param ids /
+    */
+    void deleteAll(Integer[] ids);
+
+    /**
+    * 导出数据
+    * @param all 待导出的数据
+    * @param response /
+    * @throws IOException /
+    */
+    void download(List<DmSystemDto> all, HttpServletResponse response) throws IOException;
+}

+ 48 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/dto/DmSystemDto.java

@@ -0,0 +1,48 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.system.service.dto;
+
+import lombok.Data;
+import me.zhengjie.domain.LocalStorage;
+import me.zhengjie.modules.dm.user.domain.DmUser;
+
+import java.sql.Timestamp;
+import java.io.Serializable;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Data
+public class DmSystemDto implements Serializable {
+
+    /** id */
+    private Integer id;
+
+    /** 子系统名称 */
+    private String systemName;
+
+    /** 子系统地址 */
+    private String systemUrl;
+
+    /** 子系统图标id */
+    private LocalStorage storage;
+
+    /** 子系统管理员 */
+    private DmUser dmUser;
+}

+ 29 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/dto/DmSystemQueryCriteria.java

@@ -0,0 +1,29 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.system.service.dto;
+
+import lombok.Data;
+import java.util.List;
+import me.zhengjie.annotation.Query;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Data
+public class DmSystemQueryCriteria{
+}

+ 107 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/impl/DmSystemServiceImpl.java

@@ -0,0 +1,107 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.system.service.impl;
+
+import me.zhengjie.modules.dm.system.domain.DmSystem;
+import me.zhengjie.utils.ValidationUtil;
+import me.zhengjie.utils.FileUtil;
+import lombok.RequiredArgsConstructor;
+import me.zhengjie.modules.dm.system.repository.DmSystemRepository;
+import me.zhengjie.modules.dm.system.service.DmSystemService;
+import me.zhengjie.modules.dm.system.service.dto.DmSystemDto;
+import me.zhengjie.modules.dm.system.service.dto.DmSystemQueryCriteria;
+import me.zhengjie.modules.dm.system.service.mapstruct.DmSystemMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import me.zhengjie.utils.PageUtil;
+import me.zhengjie.utils.QueryHelp;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+/**
+* @website https://el-admin.vip
+* @description 服务实现
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Service
+@RequiredArgsConstructor
+public class DmSystemServiceImpl implements DmSystemService {
+
+    private final DmSystemRepository dmSystemRepository;
+    private final DmSystemMapper dmSystemMapper;
+
+    @Override
+    public Map<String,Object> queryAll(DmSystemQueryCriteria criteria, Pageable pageable){
+        Page<DmSystem> page = dmSystemRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
+        return PageUtil.toPage(page.map(dmSystemMapper::toDto));
+    }
+
+    @Override
+    public List<DmSystemDto> queryAll(DmSystemQueryCriteria criteria){
+        return dmSystemMapper.toDto(dmSystemRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
+    }
+
+    @Override
+    @Transactional
+    public DmSystemDto findById(Integer id) {
+        DmSystem dmSystem = dmSystemRepository.findById(id).orElseGet(DmSystem::new);
+        ValidationUtil.isNull(dmSystem.getId(),"DmSystem","id",id);
+        return dmSystemMapper.toDto(dmSystem);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public DmSystemDto create(DmSystem resources) {
+        return dmSystemMapper.toDto(dmSystemRepository.save(resources));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(DmSystem resources) {
+        DmSystem dmSystem = dmSystemRepository.findById(resources.getId()).orElseGet(DmSystem::new);
+        ValidationUtil.isNull( dmSystem.getId(),"DmSystem","id",resources.getId());
+        dmSystem.copy(resources);
+        dmSystemRepository.save(dmSystem);
+    }
+
+    @Override
+    public void deleteAll(Integer[] ids) {
+        for (Integer id : ids) {
+            dmSystemRepository.deleteById(id);
+        }
+    }
+
+    @Override
+    public void download(List<DmSystemDto> all, HttpServletResponse response) throws IOException {
+        List<Map<String, Object>> list = new ArrayList<>();
+        for (DmSystemDto dmSystem : all) {
+            Map<String,Object> map = new LinkedHashMap<>();
+            map.put("子系统名称", dmSystem.getSystemName());
+            map.put("子系统地址", dmSystem.getSystemUrl());
+            map.put("子系统图标id", dmSystem.getStorage());
+            map.put("子系统管理员", dmSystem.getDmUser());
+            list.add(map);
+        }
+        FileUtil.downloadExcel(list, response);
+    }
+}

+ 32 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/system/service/mapstruct/DmSystemMapper.java

@@ -0,0 +1,32 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.system.service.mapstruct;
+
+import me.zhengjie.base.BaseMapper;
+import me.zhengjie.modules.dm.system.domain.DmSystem;
+import me.zhengjie.modules.dm.system.service.dto.DmSystemDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+/**
+* @website https://el-admin.vip
+* @author Li Rui
+* @date 2021-11-30
+**/
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface DmSystemMapper extends BaseMapper<DmSystemDto, DmSystem> {
+
+}

+ 8 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/user/domain/DmUser.java

@@ -109,6 +109,14 @@ public class DmUser extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "用户编号")
     private String usercode;
 
+    @Column(name = "user_root_group_id")
+    @ApiModelProperty(value = "根用户组id", hidden = true)
+    private String userRootGroupId;
+
+    @Column(name = "user_root_group_name")
+    @ApiModelProperty(value = "根用户组名称", hidden = true)
+    private String userRootGroupName;
+
     /*@Column(name = "create_by")
     @ApiModelProperty(value = "创建者")
     private String createBy;

+ 7 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/user/service/dto/DmUserDto.java

@@ -17,6 +17,7 @@ package me.zhengjie.modules.dm.user.service.dto;
 
 import lombok.Data;
 import me.zhengjie.base.BaseDTO;
+import me.zhengjie.modules.dm.plateNumber.domain.DmPlateNumber;
 import me.zhengjie.modules.system.service.dto.DeptSmallDto;
 import me.zhengjie.modules.system.service.dto.JobSmallDto;
 import me.zhengjie.modules.system.service.dto.RoleSmallDto;
@@ -65,4 +66,10 @@ public class DmUserDto extends BaseDTO implements Serializable {
 
     /** cardid */
     private String cardid;
+
+    private String userRootGroupId;
+
+    private String userRootGroupName;
+
+    private Set<DmPlateNumber> plateNumbers;
 }

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ZkDataPushTask.java

@@ -34,7 +34,7 @@ public class ZkDataPushTask {
         param.put("timestamp",newToken.get("timestamp"));
         param.put("nonce",newToken.get("nonce"));
         String res = HttpRequest.get(yktAttendanceApi)
-                .header("X_YT_ACCESS_TOKEN",newToken.get("token").toString() )
+                .header("XYTACCESSTOKEN",newToken.get("token").toString() )
                 .body(param.toJSONString()).execute().body();
         if(StringUtils.isNotEmpty(res)) {
             log.info("res:"+res);

+ 4 - 0
eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ZkDataSyncTask.java

@@ -203,6 +203,8 @@ public class ZkDataSyncTask {
                 user.setEnabled(item.getInteger("userStatus") == 1);
                 user.setIsAdmin(false);
                 user.setOrgPassword("12345678");
+                user.setUserRootGroupId(item.getString("userRootGroupId"));
+                user.setUserRootGroupName(item.getString("userRootGroupName"));
                 dept = new Dept();
                 dept.setId(item.getString("userGroupId"));
                 if (StringUtils.isBlank(dept.getId())) {
@@ -230,6 +232,8 @@ public class ZkDataSyncTask {
                 dmUser.setName(user.getNickName());
                 dmUser.setSex(user.getGender());
                 dmUser.setUsercode(user.getUsercode());
+                dmUser.setUserRootGroupId(user.getUserRootGroupId());
+                dmUser.setUserRootGroupName(user.getUserRootGroupName());
                 dmUser.setJobs(jobs);
                 dmUser.setRoles(roles);
 

+ 8 - 0
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java

@@ -135,6 +135,14 @@ public class User extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "用户编号")
     private String usercode;
 
+    @Column(name = "user_root_group_id")
+    @ApiModelProperty(value = "根用户组id", hidden = true)
+    private String userRootGroupId;
+
+    @Column(name = "user_root_group_name")
+    @ApiModelProperty(value = "根用户组名称", hidden = true)
+    private String userRootGroupName;
+
     @Override
     public boolean equals(Object o) {
         if (this == o) {

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java

@@ -37,5 +37,5 @@ public class MenuQueryCriteria {
     private Boolean pidIsNull;
 
     @Query
-    private Long pid;
+    private String pid;
 }

+ 4 - 0
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java

@@ -79,4 +79,8 @@ public class UserDto extends BaseDTO implements Serializable {
     private Integer errLimit;
 
     private String remark;
+
+    private String userRootGroupId;
+
+    private String userRootGroupName;
 }

+ 4 - 3
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java

@@ -114,7 +114,7 @@ public class MenuServiceImpl implements MenuService {
                 throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
             }
         }
-        if(resources.getPid().equals(0L)){
+        if(resources.getPid().equals("0")){
             resources.setPid(null);
         }
         if(resources.getIFrame()){
@@ -123,6 +123,7 @@ public class MenuServiceImpl implements MenuService {
                 throw new BadRequestException("外链必须以http://或者https://开头");
             }
         }
+        resources.setId(UUID.randomUUID().toString());
         menuRepository.save(resources);
         // 计算子节点数目
         resources.setSubCount(0);
@@ -151,7 +152,7 @@ public class MenuServiceImpl implements MenuService {
             throw new EntityExistException(Menu.class,"title",resources.getTitle());
         }
 
-        if(resources.getPid().equals(0L)){
+        if(resources.getPid().equals("0")){
             resources.setPid(null);
         }
 
@@ -212,7 +213,7 @@ public class MenuServiceImpl implements MenuService {
     @Override
     public List<MenuDto> getMenus(String pid) {
         List<Menu> menus;
-        if(pid != null && !pid.equals(0L)){
+        if(pid != null && !pid.equals("0")){
             menus = menuRepository.findByPid(pid);
         } else {
             menus = menuRepository.findByPidIsNull();

+ 38 - 2
eladmin-system/src/main/java/me/zhengjie/modules/thirdparty/v1/UserApiController.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import me.zhengjie.annotation.Log;
 import me.zhengjie.annotation.rest.AnonymousGetMapping;
 import me.zhengjie.annotation.rest.AnonymousPostMapping;
@@ -50,6 +51,7 @@ import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
+@Slf4j
 @RestController
 @RequiredArgsConstructor
 @Api(tags = "用户接口")
@@ -142,7 +144,7 @@ public class UserApiController {
     @Log("单点登录")
     @ApiOperation("单点登录")
     @AnonymousGetMapping(value = "/sso11")
-    public BaseResponse<Object> sso11(String token) {
+    public BaseResponse<Object> sso11(String token) throws Exception {
         Map<String,Object> newToken = SecurityUtils.getToken(key);
         UserDto userDto = userService.findByName("chaoshengqin");
         //组装返回值
@@ -150,6 +152,9 @@ public class UserApiController {
         returnData.put("nonce",newToken.get("nonce"));
         returnData.put("timestamp",newToken.get("timestamp"));
         returnData.put("token",newToken.get("token"));
+        returnData.put("userId",userDto.getId());
+        String cipher = EncryptUtils.desEncrypt(returnData.toJSONString());
+        returnData.put("cipher", cipher);
         returnData.put("user", userDto);
         Map<String, Object> authInfo = new HashMap<String, Object>(1) {{
             put("data", returnData);
@@ -160,7 +165,7 @@ public class UserApiController {
     @Log("单点登录")
     @ApiOperation("单点登录")
     @AnonymousGetMapping(value = "/sso")
-    public BaseResponse<Object> sso(String token) {
+    public BaseResponse<Object> sso(String token) throws Exception {
         if (StringUtils.isBlank(token)) {
             throw new BadRequestException("参数错误");
         }
@@ -177,6 +182,9 @@ public class UserApiController {
                     returnData.put("nonce",newToken.get("nonce"));
                     returnData.put("timestamp",newToken.get("timestamp"));
                     returnData.put("token",newToken.get("token"));
+                    returnData.put("userId",userDto.getId());
+                    String cipher = EncryptUtils.desEncrypt(returnData.toJSONString());
+                    returnData.put("cipher", cipher);
                     returnData.put("user", userDto);
                     Map<String, Object> authInfo = new HashMap<String, Object>(1) {{
                         put("data", returnData);
@@ -198,6 +206,34 @@ public class UserApiController {
         return new BaseResponse<>(list);
     }
 
+    @Log("根据密文获取用户信息")
+    @ApiOperation("根据密文获取用户信息")
+    @AnonymousGetMapping(value = "/getZkUserByCipher")
+    public BaseResponse<Object> getZkUserByCipher(String cipher) throws Exception {
+        String dataStr = EncryptUtils.desDecrypt(cipher);
+        JSONObject data = JSONObject.parseObject(dataStr);
+        String token = data.getString("token");
+        log.info("token:"+token);
+        String timestamp = data.getString("timestamp");
+        log.info("timestamp:"+timestamp);
+        String nonce = data.getString("nonce");
+        log.info("nonce:"+nonce);
+        String userId = data.getString("userId");
+        log.info("userId:"+userId);
+        String[] arr = {"DMERPYT!@#$QWER2021+{:>", timestamp,nonce};
+        Arrays.sort(arr);
+        String str = "";
+        for (int i = 0; i < arr.length; i++) {
+            str += arr[i];
+        }
+        String newtoken = EncryptUtils.sha1(str);
+        if (!token.equals(newtoken)) {
+            throw new BadRequestException(HttpStatus.UNAUTHORIZED, "认证失败");
+        }
+        DmUserDto dmUser = dmUserService.findById(userId);
+        return new BaseResponse<>(dmUser);
+    }
+
     @Log("获取部门数据")
     @ApiOperation("获取部门数据")
     @AnonymousPostMapping(value = "/getzkdeps")

+ 3 - 11
eladmin-tools/eladmin-tools.iml

@@ -1,22 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
   <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
     <facet type="web" name="Web">
       <configuration>
         <webroots />
       </configuration>
     </facet>
-    <facet type="jpa" name="JPA">
-      <configuration>
-        <setting name="validation-enabled" value="true" />
-        <setting name="provider-name" value="Hibernate" />
-        <datasource-mapping />
-        <naming-strategy-map />
-      </configuration>
-    </facet>
-    <facet type="Spring" name="Spring">
-      <configuration />
-    </facet>
   </component>
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
     <output url="file://$MODULE_DIR$/target/classes" />

+ 2 - 0
eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java

@@ -16,6 +16,7 @@
 package me.zhengjie.rest;
 
 import lombok.RequiredArgsConstructor;
+import me.zhengjie.annotation.AnonymousAccess;
 import me.zhengjie.annotation.Log;
 import me.zhengjie.domain.LocalStorage;
 import me.zhengjie.exception.BadRequestException;
@@ -69,6 +70,7 @@ public class LocalStorageController {
 
     @PostMapping("/pictures")
     @ApiOperation("上传图片")
+    @AnonymousAccess
     public ResponseEntity<Object> upload(@RequestParam MultipartFile file){
         // 判断文件是否为图片
         String suffix = FileUtil.getExtensionName(file.getOriginalFilename());