Forráskód Böngészése

【重构架构】 新增多个模块,代码已合入

linfutong 3 éve
szülő
commit
538bf2068f
100 módosított fájl, 10162 hozzáadás és 55 törlés
  1. 1 0
      pom.xml
  2. 12 0
      zd-api/pom.xml
  3. 17 0
      zd-api/zd-base-api/pom.xml
  4. 45 0
      zd-api/zd-base-api/src/main/java/com/zd/base/api/entity/SysFile.java
  5. 31 0
      zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/RemoteFileService.java
  6. 16 0
      zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/RemoteKkFileService.java
  7. 32 0
      zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/fallback/RemoteFileFallbackFactory.java
  8. 21 0
      zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/fallback/RemoteKkFileServiceFallbackFactory.java
  9. 20 0
      zd-api/zd-exam-api/pom.xml
  10. 59 0
      zd-api/zd-exam-api/src/main/java/com/zd/exam/api/entity/ElPaperQuAnswer.java
  11. 70 0
      zd-api/zd-exam-api/src/main/java/com/zd/exam/api/entity/ElPaperQuDTO.java
  12. 233 0
      zd-api/zd-exam-api/src/main/java/com/zd/exam/api/entity/ElResources.java
  13. 179 0
      zd-api/zd-exam-api/src/main/java/com/zd/exam/api/feign/RemoteExamService.java
  14. 170 0
      zd-api/zd-exam-api/src/main/java/com/zd/exam/api/feign/fallback/RemoteExamFallback.java
  15. 17 0
      zd-api/zd-laboratory-api/pom.xml
  16. 94 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/BasicFunctionStatus.java
  17. 56 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/CabinetLock.java
  18. 115 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/CabinetV2Lock.java
  19. 77 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/Control.java
  20. 81 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/FunctionStatus.java
  21. 372 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabGradeManageRecord.java
  22. 82 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabGradeManageRecordDetail.java
  23. 227 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabMessageContent.java
  24. 200 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabMessageUser.java
  25. 465 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubject.java
  26. 421 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java
  27. 71 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectVO.java
  28. 163 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/RemoteLabHardware.java
  29. 183 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/SensorFunctionStatus.java
  30. 84 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/SubAddrr.java
  31. 462 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteLaboratoryService.java
  32. 68 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteMessageContentService.java
  33. 67 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteSubQueryService.java
  34. 422 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteLaboratoryFallbackFactory.java
  35. 113 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteMessageContentFallbackFactory.java
  36. 76 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteSubQueryFallbackFactory.java
  37. 80 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/HardwareCVO.java
  38. 203 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabGradeManageWorkDetailVO.java
  39. 230 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabGradeManageWorkVO.java
  40. 29 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabMessageUserListVO.java
  41. 45 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabRiskPlanVO.java
  42. 98 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabSubClassVO.java
  43. 85 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/SenseValVO.java
  44. 38 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/SubFunction.java
  45. 17 0
      zd-api/zd-system-api/pom.xml
  46. 174 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysDictData.java
  47. 93 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysDictType.java
  48. 113 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysLogininfor.java
  49. 253 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysOperLog.java
  50. 387 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserStudent.java
  51. 210 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserStudentByExcel.java
  52. 202 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserStudentByExport.java
  53. 181 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserTeaCherByExcel.java
  54. 207 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserTeaCherByExport.java
  55. 40 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteLogService.java
  56. 47 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteStockService.java
  57. 198 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteUserService.java
  58. 37 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteLogFallback.java
  59. 62 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteStockFallback.java
  60. 195 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteUserFallback.java
  61. 80 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SelectUserVO.java
  62. 79 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SimpleUserVO.java
  63. 134 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysDeptListVO.java
  64. 68 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysDeptVO.java
  65. 152 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysLogoConfigVO.java
  66. 171 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/TeacherListVO.java
  67. 13 12
      zd-auth/pom.xml
  68. 5 2
      zd-auth/src/main/java/com/zd/auth/ZdAuthApplication.java
  69. 18 23
      zd-auth/src/main/java/com/zd/auth/controller/TokenController.java
  70. 17 17
      zd-auth/src/main/java/com/zd/auth/service/SysLoginService.java
  71. 1 1
      zd-auth/src/main/resources/bootstrap.yml
  72. 73 0
      zd-common/common-core/pom.xml
  73. 33 0
      zd-common/common-core/src/main/java/com/zd/common/core/annotation/DataScope.java
  74. 18 0
      zd-common/common-core/src/main/java/com/zd/common/core/annotation/DatasourceMaster.java
  75. 18 0
      zd-common/common-core/src/main/java/com/zd/common/core/annotation/DatasourceSlave.java
  76. 36 0
      zd-common/common-core/src/main/java/com/zd/common/core/annotation/EnableCustomConfig.java
  77. 26 0
      zd-common/common-core/src/main/java/com/zd/common/core/annotation/EnableRyFeignClients.java
  78. 18 0
      zd-common/common-core/src/main/java/com/zd/common/core/annotation/InnerAuth.java
  79. 36 0
      zd-common/common-core/src/main/java/com/zd/common/core/annotation/Log.java
  80. 45 0
      zd-common/common-core/src/main/java/com/zd/common/core/annotation/PreAuthorize.java
  81. 46 0
      zd-common/common-core/src/main/java/com/zd/common/core/aspect/InnerAuthAspect.java
  82. 195 0
      zd-common/common-core/src/main/java/com/zd/common/core/aspect/PreAuthorizeAspect.java
  83. 47 0
      zd-common/common-core/src/main/java/com/zd/common/core/aspect/ServiceAspect.java
  84. 21 0
      zd-common/common-core/src/main/java/com/zd/common/core/config/ApplicationConfig.java
  85. 18 0
      zd-common/common-core/src/main/java/com/zd/common/core/config/FeignAutoConfiguration.java
  86. 52 0
      zd-common/common-core/src/main/java/com/zd/common/core/config/FeignRequestInterceptor.java
  87. 247 0
      zd-common/common-core/src/main/java/com/zd/common/core/datascope/DataScopeAspect.java
  88. 15 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/CaptchaException.java
  89. 13 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/DemoModeException.java
  90. 151 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/GlobalExceptionHandler.java
  91. 14 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/InnerAuthException.java
  92. 10 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/NoRollException.java
  93. 13 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/PreAuthorizeException.java
  94. 82 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/ServiceException.java
  95. 29 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/TaskException.java
  96. 22 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/UtilException.java
  97. 69 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/base/BaseException.java
  98. 17 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/file/FileException.java
  99. 14 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/file/FileNameLengthLimitExceededException.java
  100. 0 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/file/FileSizeLimitExceededException.java

+ 1 - 0
pom.xml

@@ -19,6 +19,7 @@
         <module>zd-modules</module>
         <module>zd-api</module>
         <module>zd-common</module>
+        <module>zd-model</module>
     </modules>
 
     <properties>

+ 12 - 0
zd-api/pom.xml

@@ -13,5 +13,17 @@
 
     <modules>
         <module>zd-api-system</module>
+        <module>zd-system-api</module>
+        <module>zd-base-api</module>
+        <module>zd-laboratory-api</module>
+        <module>zd-exam-api</module>
     </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.zd.model</groupId>
+            <artifactId>zd-model</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+    </dependencies>
 </project>

+ 17 - 0
zd-api/zd-base-api/pom.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>zd-api</artifactId>
+        <groupId>com.zd</groupId>
+        <version>3.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.zd.base</groupId>
+    <artifactId>zd-base-api</artifactId>
+    <packaging>jar</packaging>
+    <description>base-api</description>
+
+</project>

+ 45 - 0
zd-api/zd-base-api/src/main/java/com/zd/base/api/entity/SysFile.java

@@ -0,0 +1,45 @@
+package com.zd.base.api.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 文件信息
+ *
+ * @author zd
+ */
+public class SysFile {
+    /**
+     * 文件名称
+     */
+    private String name;
+
+    /**
+     * 文件地址
+     */
+    private String url;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("name", getName())
+                .append("url", getUrl())
+                .toString();
+    }
+}

+ 31 - 0
zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/RemoteFileService.java

@@ -0,0 +1,31 @@
+package com.zd.base.api.feign;
+
+
+import com.zd.base.api.entity.SysFile;
+import com.zd.base.api.feign.fallback.RemoteFileFallbackFactory;
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.domain.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 文件服务
+ *
+ * @author zd
+ */
+@FeignClient(contextId = "remoteFileService", value = ApplicationConstants.BASE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
+public interface RemoteFileService {
+    /**
+     * 上传文件
+     *
+     * @param file 文件信息
+     * @return 结果
+     */
+    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public R<SysFile> upload(@RequestPart(value = "file") MultipartFile file);
+
+
+}

+ 16 - 0
zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/RemoteKkFileService.java

@@ -0,0 +1,16 @@
+package com.zd.base.api.feign;
+
+import com.zd.base.api.feign.fallback.RemoteKkFileServiceFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import java.net.URI;
+
+/**
+ * 文件远程调用
+ */
+@FeignClient(name = "remoteKkFileService",url = "http://127.0.0.1:8012", fallbackFactory = RemoteKkFileServiceFallbackFactory.class)
+public interface RemoteKkFileService {
+    @GetMapping("/onlinePreview")
+    String getKkFilePath(URI uri,@RequestParam("url") String url);
+}

+ 32 - 0
zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/fallback/RemoteFileFallbackFactory.java

@@ -0,0 +1,32 @@
+package com.zd.base.api.feign.fallback;
+
+import com.zd.base.api.entity.SysFile;
+import com.zd.base.api.feign.RemoteFileService;
+import com.zd.model.domain.R;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 文件服务降级处理
+ *
+ * @author zd
+ */
+@Component
+public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService> {
+    private static final Logger log = LoggerFactory.getLogger(RemoteFileFallbackFactory.class);
+
+    @Override
+    public RemoteFileService create(Throwable throwable) {
+        log.error("文件服务调用失败:{}", throwable.getMessage());
+        return new RemoteFileService() {
+            @Override
+            public R<SysFile> upload(MultipartFile file) {
+                throwable.printStackTrace();
+                return R.fail("上传文件失败:" + throwable.getMessage());
+            }
+        };
+    }
+}

+ 21 - 0
zd-api/zd-base-api/src/main/java/com/zd/base/api/feign/fallback/RemoteKkFileServiceFallbackFactory.java

@@ -0,0 +1,21 @@
+package com.zd.base.api.feign.fallback;
+
+
+import com.zd.base.api.feign.RemoteKkFileService;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestParam;
+import java.net.URI;
+
+@Component
+public class RemoteKkFileServiceFallbackFactory implements FallbackFactory<RemoteKkFileService> {
+    @Override
+    public RemoteKkFileService create(Throwable throwable) {
+        return new RemoteKkFileService(){
+            @Override
+            public String getKkFilePath(URI uri,@RequestParam("url") String url) {
+                return throwable.getMessage();
+            }
+        };
+    }
+}

+ 20 - 0
zd-api/zd-exam-api/pom.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>zd-api</artifactId>
+        <groupId>com.zd</groupId>
+        <version>3.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.zd.exam</groupId>
+    <artifactId>zd-exam-api</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+</project>

+ 59 - 0
zd-api/zd-exam-api/src/main/java/com/zd/exam/api/entity/ElPaperQuAnswer.java

@@ -0,0 +1,59 @@
+package com.zd.exam.api.entity;
+
+
+import com.zd.model.annotation.Excel;
+
+/**
+ * @Author: zhoupan
+ * @Date: 2021/09/03/17:25
+ * @Description:
+ */
+public class ElPaperQuAnswer {
+    /**
+     * 自增ID
+     */
+    private Long id;
+
+    /**
+     * 试卷ID
+     */
+    @Excel(name = "试卷ID")
+    private Long paperId;
+
+    /**
+     * 回答项ID
+     */
+    @Excel(name = "回答项ID")
+    private Long answerId;
+
+    /**
+     * 题目ID
+     */
+    @Excel(name = "题目ID")
+    private Long quId;
+
+    /**
+     * 是否正确项
+     */
+    @Excel(name = "是否正确项")
+    private Integer isRight;
+
+    /**
+     * 是否选中 0 否,1 是
+     */
+    @Excel(name = "是否选中")
+    private Integer checked;
+
+    /**
+     * 排序
+     */
+    @Excel(name = "排序")
+    private Integer sort;
+
+    /**
+     * 选项标签
+     */
+    @Excel(name = "选项标签")
+    private String abc;
+
+}

+ 70 - 0
zd-api/zd-exam-api/src/main/java/com/zd/exam/api/entity/ElPaperQuDTO.java

@@ -0,0 +1,70 @@
+package com.zd.exam.api.entity;
+
+import com.zd.model.annotation.Excel;
+
+import java.util.List;
+
+/**
+ * 试卷考题对象 el_paper_qu
+ *
+ * @author zd
+ * @date 2021-08-31
+ */
+public class ElPaperQuDTO {
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 试卷ID
+     */
+    @Excel(name = "试卷ID")
+    private Long paperId;
+
+    /**
+     * 题目ID
+     */
+    @Excel(name = "题目ID")
+    private Long quId;
+
+
+    /**
+     * 主观答案
+     */
+    @Excel(name = "主观答案")
+    private String answer;
+
+
+    List<ElPaperQuAnswer> elPaperQuAnswerList;
+
+    public Long getPaperId() {
+        return paperId;
+    }
+
+    public void setPaperId(Long paperId) {
+        this.paperId = paperId;
+    }
+
+    public Long getQuId() {
+        return quId;
+    }
+
+    public void setQuId(Long quId) {
+        this.quId = quId;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    public List<ElPaperQuAnswer> getElPaperQuAnswerList() {
+        return elPaperQuAnswerList;
+    }
+
+    public void setElPaperQuAnswerList(List<ElPaperQuAnswer> elPaperQuAnswerList) {
+        this.elPaperQuAnswerList = elPaperQuAnswerList;
+    }
+}

+ 233 - 0
zd-api/zd-exam-api/src/main/java/com/zd/exam/api/entity/ElResources.java

@@ -0,0 +1,233 @@
+package com.zd.exam.api.entity;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import com.zd.model.valid.ValidGroup;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.util.List;
+
+/**
+ * 课件资源对象 el_resources
+ *
+ * @author liubo
+ * @date 2021-12-07
+ */
+@ApiModel("课件资源")
+public class ElResources extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @ApiModelProperty(value = "${comment}")
+    private Long id;
+    /**
+     * 分类id
+     */
+    @Excel(name = "分类id")
+    @NotNull(groups = ValidGroup.Crud.Create.class, message = "分类id不能为空")
+    @ApiModelProperty(value = "分类id")
+    private Long cateId;
+
+    @ApiModelProperty(value = "分类标题")
+    private String cateTitle;
+
+    /**
+     * 标题
+     */
+    @Excel(name = "标题")
+    @NotBlank(groups = ValidGroup.Crud.Create.class, message = "标题不能为空")
+    @Size(message = "标题长度不能超过128")
+    @ApiModelProperty(value = "标题")
+    private String title;
+    /**
+     * 文件类型 1 文件,2 视频,3 图片,4 音频
+     */
+    @ApiModelProperty(value = "文件类型 1 文件,2 视频,3 图片,4 音频,5 富文本")
+    private Integer type;
+    /**
+     * 文件后缀
+     */
+    @Excel(name = "文件后缀")
+    @ApiModelProperty(value = "文件后缀")
+    private String postfix;
+    /**
+     * 文件大小
+     */
+    @Excel(name = "文件大小")
+    @ApiModelProperty(value = "文件大小")
+    private Long size;
+
+    private String sizeStr;
+    /**
+     * 文件时长
+     */
+    @Excel(name = "文件时长")
+    @ApiModelProperty(value = "文件时长")
+    private Long duration;
+
+    private String durationStr;
+    /**
+     * 文件路径
+     */
+    @Excel(name = "文件路径")
+    @ApiModelProperty(value = "文件路径")
+    private String path;
+
+    @ApiModelProperty(value = "富文本内容")
+    private String content;
+
+    private String beginTime;
+
+    private String endTime;
+
+    private List<Long> cateIds;
+
+    private String fileName;
+
+    private Long fileSize;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setCateId(Long cateId) {
+        this.cateId = cateId;
+    }
+
+    public Long getCateId() {
+        return cateId;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setPostfix(String postfix) {
+        this.postfix = postfix;
+    }
+
+    public String getPostfix() {
+        return postfix;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public void setDuration(Long duration) {
+        this.duration = duration;
+        if(duration != null){
+            this.setDurationStr(duration);
+        }
+    }
+
+    public Long getDuration() {
+        return duration;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getCateTitle() {
+        return cateTitle;
+    }
+
+    public void setCateTitle(String cateTitle) {
+        this.cateTitle = cateTitle;
+    }
+
+    public String getSizeStr() {
+         return sizeStr;
+    }
+
+    public void setSizeStr(String sizeStr) {
+        this.sizeStr = sizeStr;
+    }
+
+    public String getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(String beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getDurationStr() {
+        return durationStr;
+    }
+
+    public void setDurationStr(Long duration) {
+        this.duration = duration;
+    }
+
+    public List<Long> getCateIds() {
+        return cateIds;
+    }
+
+    public void setCateIds(List<Long> cateIds) {
+        this.cateIds = cateIds;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getFileSize() {
+        return fileSize;
+    }
+
+    public void setFileSize(Long fileSize) {
+        this.fileSize = fileSize;
+    }
+}

+ 179 - 0
zd-api/zd-exam-api/src/main/java/com/zd/exam/api/feign/RemoteExamService.java

@@ -0,0 +1,179 @@
+package com.zd.exam.api.feign;
+
+import com.zd.exam.api.feign.fallback.RemoteExamFallback;
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.domain.R;
+import com.zd.exam.api.entity.ElResources;
+import com.zd.model.page.TableDataInfo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 考试服务Feign调用接口
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/03/14:29
+ * @Description:
+ */
+@FeignClient(contextId = "remoteExamService", value = ApplicationConstants.EXAM_SERVICE, fallbackFactory = RemoteExamFallback.class)
+public interface RemoteExamService {
+
+    /**
+     * 查询在线考试列表(用户相关,区分列表接口)
+     */
+    @GetMapping(value = "/exam/onlineExamList")
+    @ApiOperation(value = "分页查询当前用户考试列表")
+    public TableDataInfo list(@RequestParam Map exam);
+
+    /**
+     * 去考试自动创建试卷
+     */
+    @ApiOperation(value = "去考试自动创建试卷")
+    @PostMapping(value = "/paper/create-paper")
+    public R<Object> createPaper(@RequestBody Map elPaper);
+
+    /**
+     * 交卷操作
+     */
+    @ApiOperation(value = "交卷操作")
+    @PostMapping(value = "/paper/handPaper")
+    public R<Object> handPaper(@RequestBody Map id);
+
+    /**
+     * 答题过程根据 paperId 和 quId 查询问题和选项
+     */
+    @ApiOperation(value = "查询问题和选项")
+    @PostMapping(value = "/paper/paperDetail")
+    public R<Object> queryQuDetail(@RequestBody Map paperQu);
+
+    /**
+     * 填充答案 下一题实时保存上题答案
+     *
+     * @param paperQuMap
+     */
+    @ApiOperation(value = "保存用户答案")
+    @PostMapping(value = "/paper/fillAnswer")
+    public R<Object> fillAnswer(@RequestBody Map<String,Object> paperQuMap);
+
+    /**
+     * 获取试卷管理详细信息(答题卡信息)
+     */
+    @GetMapping(value = "/paper/{id}")
+    public R<Object> getInfo(@PathVariable("id") Long id);
+
+
+    /**
+     * 根据用户id,修改积分内容
+     */
+    @PostMapping(value = "/points/record/recoveryPoints")
+    public R<Object> recoveryPoints(@RequestBody Map<String,Object> recovery);
+
+    /**
+     * 根据积分类型,扣除积分相关内容
+     */
+    @PostMapping(value = "/points/record/deductionPoints")
+    public R<Object> deductionPoints(@RequestBody Map<String,Object> deductionPoint);
+
+    /**
+     * 获取积分配置表信息
+     */
+    @PostMapping(value = "/markconfig/getPointsConfig")
+    public R<Object> getPointsConfig(@RequestBody Map<String,Object> markconfig);
+
+
+    /**
+     * 初始化奖励积分
+     */
+    @PostMapping(value = "/points/record/initCreditPoints")
+    public R<Object> initCreditPoints(@RequestBody Map<String,Object> initMap);
+
+
+    /**
+     * 获取奖励分接口
+     */
+    @PostMapping(value = "/points/record/obtainBonusPoints")
+    public R<Object> obtainBonusPoints(@RequestBody Map<String,Object> obtainMap);
+
+
+    /**
+     * 获取上月未违规记录接口
+     */
+    @PostMapping(value = "/points/record/getLastMonthViolation")
+    public R<Object> getLastMonthViolation(@RequestBody Map<String,Object> obtainMap);
+
+
+    /**
+     * 交卷查询考试结果
+     */
+    @ApiOperation(value = "查询考试结果")
+    @PostMapping(value = "/paper/paperResult")
+    public R<Map> paperResult(Map elPaper);
+
+    /**
+     * 查询当前用户考试记录列表
+     */
+    @GetMapping("/paper/appListAll")
+    public TableDataInfo myExamResultList(Map elUserExam);
+
+    /**
+     * 根据登录用户查询 我的证书列表
+     */
+    @PostMapping("/exam/queryMyCert")
+    public TableDataInfo queryMyCert(Map<String, Object> userCert);
+
+    /**
+     * 考试过程 查询当前考题的正确和错误数量
+     */
+    @GetMapping(value = "/paper/paperStatistics/{id}")
+    public R<Object> getPaperStatistics(@PathVariable("id") Long id);
+
+    /**
+     * 超时弃考
+     */
+    @ApiOperation(value = "超时弃考")
+    @PostMapping(value = "/paper/abandon")
+    public void abandonPaper();
+
+
+    /**
+     * 根据登录用户查询 我的积分列表
+     */
+    @PostMapping("/points/record/list/myApp")
+    public TableDataInfo recordMyApp(@RequestBody Map<String, Object> myApp);
+
+    /**
+     * 根据登录用户查询 我的积分统计
+     */
+    @PostMapping("/points/record/count/myApp")
+    public R<Object> recordMyAppCount();
+
+    @PostMapping("/points/record/exits")
+    public R<Object> findByUserId(@RequestBody Map<String, Object> map);
+
+    /**
+     * 进入/出加奖励分
+     * @param map
+     * @return
+     */
+    @PostMapping("/rewardconfig/addloginfo")
+    public R addLoginfo(@RequestBody Map map);
+
+    /**
+     * 获取奖励分配置表信息
+     * @param map
+     * @return
+     */
+    @PostMapping("/rewardconfig/getBonusPointsConfig")
+    public R getBonusPointsConfig(@RequestBody Map map);
+
+    /**
+     * 获取所有的学习资源
+     * @return
+     */
+    @RequestMapping("/el_resources/listAll")
+    public R<List<ElResources>> listAll();
+
+}

+ 170 - 0
zd-api/zd-exam-api/src/main/java/com/zd/exam/api/feign/fallback/RemoteExamFallback.java

@@ -0,0 +1,170 @@
+package com.zd.exam.api.feign.fallback;
+
+import com.zd.exam.api.feign.RemoteExamService;
+import com.zd.model.domain.R;
+import com.zd.exam.api.entity.ElResources;
+import com.zd.model.page.TableDataInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 考试服务降级处理
+ *
+ * @author zhoupan
+ */
+@Component
+public class RemoteExamFallback implements FallbackFactory<RemoteExamService> {
+    private static final Logger log = LoggerFactory.getLogger(RemoteExamFallback.class);
+
+    @Override
+    public RemoteExamService create(Throwable throwable) {
+        log.error("考试服务调用失败:{}", throwable.getMessage());
+        return new RemoteExamService() {
+            @Override
+            public TableDataInfo list(Map exam) {
+                TableDataInfo dataInfo = new TableDataInfo<>();
+                dataInfo.setCode(R.FAIL);
+                return dataInfo;
+            }
+
+            @Override
+            public R<Object> createPaper(Map elPaper) {
+                return R.fail("开始考试失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> handPaper(Map elPaper) {
+                return R.fail("交卷失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> queryQuDetail(Map paperQu) {
+                return R.fail("调用答题过程失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> fillAnswer(Map<String,Object> paperQuMap) {
+                return R.fail("提交答案失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> getInfo(Long id) {
+                return R.fail("获取试卷管理详细信息失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> recoveryPoints(Map<String,Object> recovery) {
+                if(recovery.get("pointsType")!=null && recovery.get("pointsType").equals("2")){
+                    return R.fail("移除黑名单失败:" + throwable.getMessage());
+                }else if(recovery.get("pointsType")!=null && recovery.get("pointsType").equals("1")){
+                    return R.fail("移除负面清单失败:" + throwable.getMessage());
+                }
+                return R.fail("移除失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> deductionPoints(Map<String,Object> deductionPoint) {
+                return R.fail("扣除积分失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> getPointsConfig(Map<String,Object> markconfig) {
+                return R.fail("获取积分列表失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> initCreditPoints(Map<String,Object> initMap) {
+                return R.fail("初始化积分失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> obtainBonusPoints(Map<String,Object> obtainMap) {
+                return R.fail("获取奖励积分失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> getLastMonthViolation(Map<String,Object> obtainMap) {
+                return R.fail("获取上月的违规记录列表失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Map> paperResult(Map elPaper) {
+                return R.fail("查询考试结果失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public TableDataInfo myExamResultList(Map elUserExam) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setMsg("查询当前用户考试记录列表失败:" + throwable.getMessage());
+                tableDataInfo.setCode(500);
+                return tableDataInfo;
+            }
+
+            @Override
+            public TableDataInfo queryMyCert(Map<String, Object> userCert) {
+                TableDataInfo dataInfo = new TableDataInfo<>();
+                dataInfo.setCode(R.FAIL);
+                return dataInfo;
+            }
+
+            @Override
+            public R<Object> getPaperStatistics(Long id) {
+                return R.fail("查询当前考题的正确和错误数量失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public void abandonPaper() {
+                log.error("考试定时检查交卷超时失败!");
+            }
+
+            @Override
+            public TableDataInfo recordMyApp(Map<String, Object> myApp) {
+                TableDataInfo dataInfo = new TableDataInfo<>();
+                dataInfo.setCode(R.FAIL);
+                return dataInfo;
+            }
+
+            @Override
+            public R<Object> recordMyAppCount() {
+                return R.fail("查询我的积分统计失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> findByUserId(Map<String, Object> map) {
+               return R.fail("查询用户是否存在积分表失败:" + throwable.getMessage());
+            }
+
+            /**
+             * 进入/出加奖励分
+             *
+             * @param map
+             * @return
+             */
+            @Override
+            public R addLoginfo(Map map) {
+                return R.fail("用户本次加奖励分失败:" + throwable.getMessage());
+            }
+
+            /**
+             * 获取奖励分配置表信息
+             *
+             * @param map
+             * @return
+             */
+            @Override
+            public R getBonusPointsConfig(Map map) {
+                return R.fail("获取奖励分配置失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<List<ElResources>> listAll() {
+                return R.fail("获取学习资源列表失败:" + throwable.getMessage());
+            }
+        };
+    }
+}

+ 17 - 0
zd-api/zd-laboratory-api/pom.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>zd-api</artifactId>
+        <groupId>com.zd</groupId>
+        <version>3.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.zd.laboratory</groupId>
+    <artifactId>zd-laboratory-api</artifactId>
+    <packaging>jar</packaging>
+    <description>laboratory-api</description>
+
+</project>

+ 94 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/BasicFunctionStatus.java

@@ -0,0 +1,94 @@
+package com.zd.laboratory.api.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: zhoupan
+ * @Date: 2021/09/27/15:36
+ * @Description:
+ */
+@ApiModel("功能基类")
+public class BasicFunctionStatus {
+    /**
+     * 硬件编码
+     */
+    @ApiModelProperty("硬件编码")
+    private String hardwareNum;
+
+    /**
+     * 功能编码
+     */
+    @ApiModelProperty("功能编码")
+    private String funNum;
+
+    /**
+     * 功能描述 现在实际值变成了 传感器名字 ( ̄▽ ̄)"
+     */
+    @ApiModelProperty("功能描述")
+    private String describe;
+
+
+    /**
+     * 功能名
+     */
+    @ApiModelProperty("功能名")
+    private String funcName;
+
+    public String getFuncName() {
+        return funcName;
+    }
+
+    public void setFuncName(String funcName) {
+        this.funcName = funcName;
+    }
+
+    /**
+     * 功能图标
+     */
+    @ApiModelProperty("功能图标")
+    private String icon;
+
+    @ApiModelProperty("排序")
+    private int order ;
+
+    public String getHardwareNum() {
+        return hardwareNum;
+    }
+
+    public void setHardwareNum(String hardwareNum) {
+        this.hardwareNum = hardwareNum;
+    }
+
+    public int getOrder() {
+        return order;
+    }
+
+    public void setOrder(int order) {
+        this.order = order;
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon;
+    }
+
+    public String getFunNum() {
+        return funNum;
+    }
+
+    public void setFunNum(String funNum) {
+        this.funNum = funNum;
+    }
+
+    public String getDescribe() {
+        return describe;
+    }
+
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+}

+ 56 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/CabinetLock.java

@@ -0,0 +1,56 @@
+package com.zd.laboratory.api.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+
+public class CabinetLock {
+
+    @NotNull(message = "柜锁ID 不能为空!")
+    @ApiModelProperty("柜锁标记位0-253")
+    private String lockId;
+
+    @NotNull(message = "参数异常!")
+    @ApiModelProperty("转动角度 0-4095 开锁 940  关锁 2340")
+    private String position;
+
+    @NotNull(message = "参数异常!")
+    @ApiModelProperty("延时执行 》= 0")
+    private String time;
+
+    @NotNull(message = "参数异常!")
+    @ApiModelProperty("转动速度 0-3400")
+    private String speed;
+
+    public String getLockId() {
+        return lockId;
+    }
+
+    public void setLockId(String lockId) {
+        this.lockId = lockId;
+    }
+
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public String getSpeed() {
+        return speed;
+    }
+
+    public void setSpeed(String speed) {
+        this.speed = speed;
+    }
+}

+ 115 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/CabinetV2Lock.java

@@ -0,0 +1,115 @@
+package com.zd.laboratory.api.entity;
+
+public class CabinetV2Lock {
+
+    /**
+     * 柜锁记录Id
+     */
+    private Long lockLogId;
+
+    /**
+     * 硬件ID
+     */
+    private String hardwareId;
+
+    /**
+     * 摄像头IP 地址
+     */
+    private String ipAddress;
+
+    /**
+     * 柜锁bit ID
+     */
+    private String lockId;
+
+    /**
+     * 柜锁名称
+     */
+    private String lockName;
+
+    /**
+     * 机柜名称
+     */
+    private String cabinetName;
+
+    /**
+     * 采集器编号
+     */
+    private String relayCode;
+
+    private boolean success = false;
+
+    private String msg;
+
+    public String getIpAddress() {
+        return ipAddress;
+    }
+
+    public void setIpAddress(String ipAddress) {
+        this.ipAddress = ipAddress;
+    }
+
+    public String getLockName() {
+        return lockName;
+    }
+
+    public void setLockName(String lockName) {
+        this.lockName = lockName;
+    }
+
+    public String getCabinetName() {
+        return cabinetName;
+    }
+
+    public void setCabinetName(String cabinetName) {
+        this.cabinetName = cabinetName;
+    }
+
+    public String getHardwareId() {
+        return hardwareId;
+    }
+
+    public void setHardwareId(String hardwareId) {
+        this.hardwareId = hardwareId;
+    }
+
+    public String getLockId() {
+        return lockId;
+    }
+
+    public void setLockId(String lockId) {
+        this.lockId = lockId;
+    }
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public String getRelayCode() {
+        return relayCode;
+    }
+
+    public void setRelayCode(String relayCode) {
+        this.relayCode = relayCode;
+    }
+
+    public Long getLockLogId() {
+        return lockLogId;
+    }
+
+    public void setLockLogId(Long lockLogId) {
+        this.lockLogId = lockLogId;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 77 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/Control.java

@@ -0,0 +1,77 @@
+package com.zd.laboratory.api.entity;
+
+/**
+ * @Author: zhoupan
+ * @Date: 2021/09/27/16:09
+ * @Description:
+ */
+public class Control {
+
+    /**
+     * 命令
+     */
+    String command;
+
+    /**
+     * 设备编号
+     */
+    String num;
+
+    /**
+     * 参数
+     */
+    Object param;
+
+
+    public static enum SwitchEnums{
+        /**
+         * 不在线
+         */
+        NO_ONLINE,
+        ON,
+        OFF;
+
+        SwitchEnums() {
+        }
+    }
+
+    public static enum CommTypeEnums {
+        /**
+         * 继电器
+         */
+        Relay,
+        /**
+         * 自身
+         */
+        SELF,
+        /**
+         * 其他
+         */
+        OTHER,
+    }
+
+
+    public String getCommand() {
+        return command;
+    }
+
+    public void setCommand(String command) {
+        this.command = command;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+    public Object getParam() {
+        return param;
+    }
+
+    public void setParam(Object param) {
+        this.param = param;
+    }
+}

+ 81 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/FunctionStatus.java

@@ -0,0 +1,81 @@
+package com.zd.laboratory.api.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 设备功能
+ * @Author: zhoupan
+ * @Date: 2021/09/27/15:36
+ * @Description:
+ */
+@ApiModel("硬件设备功能")
+public class FunctionStatus extends BasicFunctionStatus {
+
+
+    /**
+     * 功能状态值
+     */
+    @ApiModelProperty("功能状态值")
+    private String code;
+
+    /**
+     * 命令
+     */
+    @ApiModelProperty("命令")
+    private String cmd;
+
+    /**
+     * 是否时默认状态
+     */
+    private Boolean defaultStatus = false;
+
+    @ApiModelProperty("命令类型")
+    private Control.CommTypeEnums commTypeEnums;
+
+//    @ApiModelProperty("继电器编码")
+//    private String relayCode;
+//
+//    public String getRelayCode() {
+//        return relayCode;
+//    }
+//
+//    public void setRelayCode(String relayCode) {
+//        this.relayCode = relayCode;
+//    }
+
+    public Control.CommTypeEnums getCommTypeEnums() {
+        return commTypeEnums;
+    }
+
+    public void setCommTypeEnums(Control.CommTypeEnums commTypeEnums) {
+        this.commTypeEnums = commTypeEnums;
+    }
+
+    @JsonIgnore
+    public Boolean getDefaultStatus() {
+        return defaultStatus;
+    }
+
+    public String getCmd() {
+        return cmd;
+    }
+
+    public void setCmd(String cmd) {
+        this.cmd = cmd;
+    }
+
+    public void setDefaultStatus(Boolean defaultStatus) {
+        this.defaultStatus = defaultStatus;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+}

+ 372 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabGradeManageRecord.java

@@ -0,0 +1,372 @@
+package com.zd.laboratory.api.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.Size;
+import java.util.Date;
+
+/**
+ * 管控执行记录对象 lab_grade_manage_record
+ *
+ * @author liubo
+ * @date 2022-02-10
+ */
+@ApiModel("管控执行记录")
+public class LabGradeManageRecord extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(value = "${comment}")
+    private Long id;
+    /**
+     * 规则ID
+     */
+    @Excel(name = "规则ID")
+    @ApiModelProperty(value = "规则ID")
+    private Long ruleId;
+    private Long ruleUserId;
+    /**
+     * 规则名称
+     */
+    @Excel(name = "规则名称")
+    @Size(message = "规则名称长度不能超过255")
+    @ApiModelProperty(value = "规则名称")
+    private String ruleName;
+    /**
+     * 实验室ID
+     */
+    @Excel(name = "实验室ID")
+    @ApiModelProperty(value = "实验室ID")
+    private Long subId;
+    /**
+     * 实验室名称
+     */
+    @ApiModelProperty(value = "实验室名称")
+    private String subName;
+    /**
+     * 执行用户ID
+     */
+    @Excel(name = "执行用户ID")
+    @ApiModelProperty(value = "执行用户ID")
+    private Long joinUserId;
+    /**
+     * 执行用户姓名
+     */
+    @ApiModelProperty(value = "执行用户姓名")
+    private String nickName;
+    /**
+     * 执行人身份
+     */
+    @Excel(name = "执行人身份")
+    @Size(message = "执行人身份长度不能超过255")
+    @ApiModelProperty(value = "执行人身份")
+    private String userPosition;
+    /**
+     * 执行状态(0 已过期,2 已执行)
+     */
+    @ApiModelProperty(value = "0 已过期,2 已执行")
+    private Integer status;
+    /**
+     * 执行时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "执行时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "执行时间")
+    private Date carryTime;
+
+    private Date startTime;
+    private Date endTime;
+
+    private Long manageUserId;
+
+    @JsonFormat(pattern = "yyyy年MM月dd日")
+    private Date endDate;
+
+    @ApiModelProperty("规则类型:日管控,月管控..")
+    private String ruleType;
+
+    @ApiModelProperty("执行周期")
+    private String cycle;
+
+    @ApiModelProperty("是否多人执行")
+    private Integer isAll;
+
+    @ApiModelProperty("执行次数")
+    private Integer cycleCount;
+
+    private Long level;
+    @ApiModelProperty("分级名称")
+    private String levelName;
+
+    @ApiModelProperty("分级颜色")
+    private String fiedColor;
+
+    private Long typeId;
+    @ApiModelProperty("分类名称")
+    private String typeName;
+
+    private Long moldId;
+    @ApiModelProperty("实验室类型名称")
+    private String moldName;
+
+    @ApiModelProperty("规则描述")
+    private String ruleRemark;
+
+    private LabGradeManageRecordDetail detail;
+
+    /**
+     * 展示 分级管控指定的所有人名
+     */
+    private String allUserName;
+
+    /**
+     * 执行消息通知ID(用作处理消息已读功能)
+     */
+    private Long messageUserId;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setRuleId(Long ruleId) {
+        this.ruleId = ruleId;
+    }
+
+    public Long getRuleId() {
+        return ruleId;
+    }
+
+    public void setRuleName(String ruleName) {
+        this.ruleName = ruleName;
+    }
+
+    public String getRuleName() {
+        return ruleName;
+    }
+
+    public void setSubId(Long subId) {
+        this.subId = subId;
+    }
+
+    public Long getSubId() {
+        return subId;
+    }
+
+    public void setJoinUserId(Long joinUserId) {
+        this.joinUserId = joinUserId;
+    }
+
+    public Long getJoinUserId() {
+        return joinUserId;
+    }
+
+    public void setUserPosition(String userPosition) {
+        this.userPosition = userPosition;
+    }
+
+    public String getUserPosition() {
+        return userPosition;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setCarryTime(Date carryTime) {
+        this.carryTime = carryTime;
+    }
+
+    public Date getCarryTime() {
+        return carryTime;
+    }
+
+    public LabGradeManageRecordDetail getDetail() {
+        return detail;
+    }
+
+    public void setDetail(LabGradeManageRecordDetail detail) {
+        this.detail = detail;
+    }
+
+    public Long getRuleUserId() {
+        return ruleUserId;
+    }
+
+    public void setRuleUserId(Long ruleUserId) {
+        this.ruleUserId = ruleUserId;
+    }
+
+    public String getSubName() {
+        return subName;
+    }
+
+    public void setSubName(String subName) {
+        this.subName = subName;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Integer getCycleCount() {
+        return cycleCount;
+    }
+
+    public void setCycleCount(Integer cycleCount) {
+        this.cycleCount = cycleCount;
+    }
+
+    public String getRuleType() {
+        return ruleType;
+    }
+
+    public void setRuleType(String ruleType) {
+        this.ruleType = ruleType;
+    }
+
+    public String getLevelName() {
+        return levelName;
+    }
+
+    public void setLevelName(String levelName) {
+        this.levelName = levelName;
+    }
+
+    public String getFiedColor() {
+        return fiedColor;
+    }
+
+    public void setFiedColor(String fiedColor) {
+        this.fiedColor = fiedColor;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public String getRuleRemark() {
+        return ruleRemark;
+    }
+
+    public void setRuleRemark(String ruleRemark) {
+        this.ruleRemark = ruleRemark;
+    }
+
+    public Long getLevel() {
+        return level;
+    }
+
+    public void setLevel(Long level) {
+        this.level = level;
+    }
+
+    public Long getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Long typeId) {
+        this.typeId = typeId;
+    }
+
+    public Long getMoldId() {
+        return moldId;
+    }
+
+    public void setMoldId(Long moldId) {
+        this.moldId = moldId;
+    }
+
+    public String getMoldName() {
+        return moldName;
+    }
+
+    public void setMoldName(String moldName) {
+        this.moldName = moldName;
+    }
+
+    public Long getManageUserId() {
+        return manageUserId;
+    }
+
+    public void setManageUserId(Long manageUserId) {
+        this.manageUserId = manageUserId;
+    }
+
+    public String getCycle() {
+        return cycle;
+    }
+
+    public void setCycle(String cycle) {
+        this.cycle = cycle;
+    }
+
+    public String getAllUserName() {
+        return allUserName;
+    }
+
+    public void setAllUserName(String allUserName) {
+        this.allUserName = allUserName;
+    }
+
+    public Integer getIsAll() {
+        return isAll;
+    }
+
+    public void setIsAll(Integer isAll) {
+        this.isAll = isAll;
+    }
+
+    public Long getMessageUserId() {
+        return messageUserId;
+    }
+
+    public void setMessageUserId(Long messageUserId) {
+        this.messageUserId = messageUserId;
+    }
+}

+ 82 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabGradeManageRecordDetail.java

@@ -0,0 +1,82 @@
+package com.zd.laboratory.api.entity;
+
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 管控执行记录详情对象 lab_grade_manage_record_detail
+ *
+ * @author liubo
+ * @date 2022-02-10
+ */
+@ApiModel("管控执行记录详情")
+public class LabGradeManageRecordDetail extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(value = "${comment}")
+    private Long id;
+    /**
+     * 执行记录ID
+     */
+    @Excel(name = "执行记录ID")
+    @ApiModelProperty(value = "执行记录ID")
+    private Long manageRecordId;
+    /**
+     * 执行上传材料(多个逗号分隔)
+     */
+    @Excel(name = "执行上传材料", readConverterExp = "多=个逗号分隔")
+    @ApiModelProperty(value = "执行上传材料")
+    private String imgUrl;
+
+    @ApiModelProperty(value = "材料名称")
+    private String imgName;
+
+    @ApiModelProperty(value = "材料类型")
+    private String imgType;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setManageRecordId(Long manageRecordId) {
+        this.manageRecordId = manageRecordId;
+    }
+
+    public Long getManageRecordId() {
+        return manageRecordId;
+    }
+
+    public void setImgUrl(String imgUrl) {
+        this.imgUrl = imgUrl;
+    }
+
+    public String getImgUrl() {
+        return imgUrl;
+    }
+
+    public String getImgName() {
+        return imgName;
+    }
+
+    public void setImgName(String imgName) {
+        this.imgName = imgName;
+    }
+
+    public String getImgType() {
+        return imgType;
+    }
+
+    public void setImgType(String imgType) {
+        this.imgType = imgType;
+    }
+}

+ 227 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabMessageContent.java

@@ -0,0 +1,227 @@
+package com.zd.laboratory.api.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import com.zd.model.enums.MessTypeEnum;
+import com.zd.model.enums.MessageSendRangeEnum;
+import com.zd.model.enums.UserMessageSendModeEnum;
+import com.zd.model.valid.ValidGroup;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * 消息发布对象 lab_message_content
+ *
+ * @author zd
+ * @date 2021-09-02
+ */
+@ApiModel("消息内容实体")
+public class LabMessageContent extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 消息类型(参考字典表 如:文字,富文本)
+     */
+    @ApiModelProperty("消息类型")
+    @Excel(name = "消息类型", readConverterExp = "参=考字典表,如=:文字,富文本")
+    private Integer messType;
+
+
+
+    /**
+     * 消息类别
+     */
+    @ApiModelProperty("消息类别,1:管理消息,2:预警")
+    private Integer messClass;
+
+
+
+    /**
+     * 发送方式(参考字典表)
+     */
+    @ApiModelProperty("发送方式")
+    @Excel(name = "发送方式", readConverterExp = "参=考字典表")
+    private Integer sendMode;
+
+    /**
+     * 发送范围(1是全校,2是院系,3是个人,参考MessageSendRangeEnum)
+     */
+    @ApiModelProperty("发送范围")
+    @Excel(name = "发送范围", readConverterExp = "1=是全校,2是院系,3是个人,参考字典表")
+    private Integer sendRange = 3;
+
+    /**
+     * 发送内容
+     */
+    @ApiModelProperty("发送内容")
+    @NotBlank(groups = ValidGroup.Crud.Create.class, message = "发送内容不能为空")
+    @Excel(name = "发送内容")
+    private String content;
+
+    /**
+     * 部门ids
+     */
+    @Excel(name = "部门ids")
+    @ApiModelProperty("部门ids")
+    private String deptIds;
+
+    @ApiModelProperty("实验室ids")
+    private String subIds;
+
+    @ApiModelProperty("实验室名称")
+    private String subName;
+
+    /**
+     * 待发送用户ids,关联用户表id(多个用户id)
+     */
+    @Excel(name = "待发送用户ids,关联用户表id(多个用户id)")
+    @ApiModelProperty("待发送用户ids")
+    private String userIds;
+
+    private String userNames;
+
+    @ApiModelProperty("职位ID")
+    private String postIds;
+
+    @ApiModelProperty("职位名称")
+    private String postName;
+
+    @ApiModelProperty("过期日期(实验室消息专用)")
+    private Date expirationDate;
+
+    public Integer getMessClass() {
+        return messClass;
+    }
+
+    public void setMessClass(Integer messClass) {
+        this.messClass = messClass;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setMessType(Integer messType) {
+        this.messType = messType;
+    }
+
+    @JsonIgnore
+    public Integer getMessType() {
+        return messType;
+    }
+
+    public MessTypeEnum getMessTypeEnum() {
+        return MessTypeEnum.getByCode(messType);
+    }
+
+    public void setSendMode(Integer sendMode) {
+        this.sendMode = sendMode;
+    }
+
+    @JsonIgnore
+    public Integer getSendMode() {
+        return sendMode;
+    }
+
+    public UserMessageSendModeEnum getSendModeEnum() {
+        return UserMessageSendModeEnum.getByCode(sendMode);
+    }
+
+    public void setSendRange(Integer sendRange) {
+        this.sendRange = sendRange;
+    }
+
+    @JsonIgnore
+    public Integer getSendRange() {
+        return sendRange;
+    }
+
+    public MessageSendRangeEnum getSendRangeEnum() {
+        return MessageSendRangeEnum.getByCode(sendRange);
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setDeptIds(String deptIds) {
+        this.deptIds = deptIds;
+    }
+
+    public String getDeptIds() {
+        return deptIds;
+    }
+
+    public void setUserIds(String userIds) {
+        this.userIds = userIds;
+    }
+
+    public String getUserIds() {
+        return userIds;
+    }
+
+    public String getPostName() {
+        return postName;
+    }
+
+    public void setPostName(String postName) {
+        this.postName = postName;
+    }
+
+    public String getUserNames() {
+        return userNames;
+    }
+
+    public void setUserNames(String userNames) {
+        this.userNames = userNames;
+    }
+
+    public String getSubIds() {
+        return subIds;
+    }
+
+    public void setSubIds(String subIds) {
+        this.subIds = subIds;
+    }
+
+    public Date getExpirationDate() {
+        return expirationDate;
+    }
+
+    public void setExpirationDate(Date expirationDate) {
+        this.expirationDate = expirationDate;
+    }
+
+    public String getPostIds() {
+        return postIds;
+    }
+
+    public void setPostIds(String postIds) {
+        this.postIds = postIds;
+    }
+
+    public String getSubName() {
+        return subName;
+    }
+
+    public void setSubName(String subName) {
+        this.subName = subName;
+    }
+}

+ 200 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabMessageUser.java

@@ -0,0 +1,200 @@
+package com.zd.laboratory.api.entity;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import com.zd.model.enums.UserMessageType;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 用户消息对象 lab_message_user
+ *
+ * @author zhoupan
+ * @date 2021-09-02
+ */
+public class LabMessageUser extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 自增主键
+     */
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    @Excel(name = "用户id")
+    private Long joinUserId;
+
+    /**
+     * 消息id
+     */
+    @Excel(name = "消息id")
+    @Deprecated
+    private Long messageId;
+    @Excel(name = "消息内容")
+    private String content;
+
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /**
+     * 是否已读(0 未读,1 已读)
+     */
+    @Excel(name = "是否已读", readConverterExp = "0=,未=读,1,已=读")
+    private Boolean isRead;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /**
+     * 创建人(用于数据权限)
+     */
+    @Excel(name = "创建人", readConverterExp = "用=于数据权限")
+    private Long userId;
+
+    /**
+     * 用户消息类型
+     */
+    private UserMessageType messageType;
+
+    /**
+     * 消息内容
+     */
+    private String meaasgeContext;
+
+    public Boolean getRead() {
+        return isRead;
+    }
+
+    public void setRead(Boolean read) {
+        isRead = read;
+    }
+
+    public UserMessageType getMessageType() {
+        return messageType;
+    }
+
+    public void setMessageType(UserMessageType messageType) {
+        this.messageType = messageType;
+    }
+
+    public String getMeaasgeContext() {
+        return meaasgeContext;
+    }
+
+    public void setMeaasgeContext(String meaasgeContext) {
+        this.meaasgeContext = meaasgeContext;
+    }
+
+    public LabMessageUser() {
+
+    }
+
+//    /**
+//     * 消息详细内容
+//     */
+//    private LabMessageContent messageContent;
+
+    public LabMessageUser(LabMessageContent labMessageContent, Long id) {
+
+        this.setMessageId(labMessageContent.getId());
+        this.setJoinUserId(id);
+        this.setIsRead(Boolean.FALSE);
+        this.setMessageType(UserMessageType.ADMIN);
+        this.setMeaasgeContext(labMessageContent.getContent());
+        this.setUserId(labMessageContent.getUserId());
+        this.setCreateBy(labMessageContent.getCreateBy());
+        this.setCreateTime(labMessageContent.getCreateTime());
+        this.setDeptId(labMessageContent.getDeptId());
+        this.setDeptName(labMessageContent.getDeptName());
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setJoinUserId(Long joinUserId) {
+        this.joinUserId = joinUserId;
+    }
+
+    public Long getJoinUserId() {
+        return joinUserId;
+    }
+
+    public void setMessageId(Long messageId) {
+        this.messageId = messageId;
+    }
+
+    public Long getMessageId() {
+        return messageId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setIsRead(Boolean isRead) {
+        this.isRead = isRead;
+    }
+
+    public Boolean getIsRead() {
+        return isRead;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+//    public LabMessageContent getMessageContent() {
+//        return messageContent;
+//    }
+//
+//    public void setMessageContent(LabMessageContent messageContent) {
+//        this.messageContent = messageContent;
+//    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("joinUserId", getJoinUserId())
+                .append("messageId", getMessageId())
+                .append("createTime", getCreateTime())
+                .append("deptId", getDeptId())
+                .append("isRead", getIsRead())
+                .append("deptName", getDeptName())
+                .append("userId", getUserId())
+                .append("createBy", getCreateBy())
+                .append("updateTime", getUpdateTime())
+                .append("updateBy", getUpdateBy())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 465 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubject.java

@@ -0,0 +1,465 @@
+package com.zd.laboratory.api.entity;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.zd.laboratory.api.vo.LabSubClassVO;
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 实验室对象 lab_subject
+ *
+ * @author zd
+ * @date 2021-08-30
+ */
+public class LabSubject extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 实验室名称
+     */
+    @Excel(name = "实验室名称")
+    private String name;
+
+    /**
+     * 实验室楼层
+     */
+    @Excel(name = "实验室楼层")
+    private Long floorId;
+
+    /**
+     * 实验室房间号
+     */
+    @Excel(name = "实验室房间号")
+    private String room;
+
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /**
+     * 管理员id
+     */
+    @Excel(name = "管理员id")
+    private Long adminId;
+
+    /**
+     * 是否删除(1是未删除,0是删除)
+     */
+    @Excel(name = "是否删除", readConverterExp = "1=是未删除,0是删除")
+    private Boolean isDel;
+
+    /**
+     * 创建人(用于数据权限)
+     */
+    @Excel(name = "创建人", readConverterExp = "用=于数据权限")
+    private Long userId;
+
+    /**
+     * 是否是实验室
+     */
+    private Long isSubject;
+
+    /**
+     * 实验室顺序
+     */
+    @ApiModelProperty("实验室顺序")
+    private Long subOrder;
+    /**
+     * 仅仅为了回显, 后面考虑移除
+     */
+    @ApiModelProperty("楼栋ID")
+    private Long buildId;
+
+    /**
+     * 安全分类
+     */
+    private Long typeId;
+
+    @ApiModelProperty("布局ID")
+    private Long layoutId;
+
+    @ApiModelProperty("检查项")
+    private String checkOut;
+
+    /**
+     * 在线人数
+     */
+    @JsonInclude
+    private Long online;
+
+
+    @ApiModelProperty("离开检查项")
+    private String checkIn;
+
+    @ApiModelProperty("安全负责人")
+    private String safeUserId;
+
+    @ApiModelProperty("安全警示标示--字典")
+    private String safeSigns;
+
+    @ApiModelProperty("主要危险类别--字典")
+    private String hazardCategory;
+
+    @ApiModelProperty("安全防控措施--字典")
+    private String riskMeasure;
+
+    @ApiModelProperty("灭火要点--字典")
+    private String outfire;
+
+    @ApiModelProperty("二维码")
+    private String qrCode;
+
+    @ApiModelProperty("安全负责人名称")
+    private String safeUserName;
+
+    @ApiModelProperty("安全负责人手机号")
+    private String safeUserPhone;
+
+    @ApiModelProperty("负责人手机号")
+    private String adminPhone;
+
+    @ApiModelProperty("详细地址")
+    private String address;
+
+    @ApiModelProperty("实验室危险等级信息")
+    private LabSubClassVO subClassVO;
+
+    @ApiModelProperty("级别")
+    private Long level;
+
+    /**
+     * 展示排序
+     */
+    @ApiModelProperty("展示排序")
+    private Integer diyOrder;
+
+    @ApiModelProperty(value = "二维码地址")
+    private String qrCodeUrl;
+
+    @ApiModelProperty("穿戴检查可跳过(0 否,1 是)")
+    private Integer skipped;
+
+    @ApiModelProperty("检测上限")
+    private Integer checkCount;
+
+    public Long getLevel() {
+        return level;
+    }
+
+    public void setLevel(Long level) {
+        this.level = level;
+    }
+
+    public String getCheckIn() {
+        return checkIn;
+    }
+
+    public void setCheckIn(String checkIn) {
+        this.checkIn = checkIn;
+    }
+
+    public Long getOnline() {
+        return online;
+    }
+
+    public void setOnline(Long online) {
+        this.online = online;
+    }
+
+    public Boolean getDel() {
+        return isDel;
+    }
+
+    public void setDel(Boolean del) {
+        isDel = del;
+    }
+
+    public Long getBuildId() {
+        return buildId;
+    }
+
+    public void setBuildId(Long buildId) {
+        this.buildId = buildId;
+    }
+
+    public Long getLayoutId() {
+        return layoutId;
+    }
+
+    public void setLayoutId(Long layoutId) {
+        this.layoutId = layoutId;
+    }
+
+    public String getCheckOut() {
+        return checkOut;
+    }
+
+    public void setCheckOut(String checkOut) {
+        this.checkOut = checkOut;
+    }
+
+    public String getSubDept() {
+        return subDept;
+    }
+
+    public void setSubDept(String subDept) {
+        this.subDept = subDept;
+    }
+
+    @ApiModelProperty("学科")
+    private String subDept;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getAdminPhone() {
+        return adminPhone;
+    }
+
+    public void setAdminPhone(String adminPhone) {
+        this.adminPhone = adminPhone;
+    }
+
+    public void setFloorId(Long floorId) {
+        this.floorId = floorId;
+    }
+
+    public Long getFloorId() {
+        return floorId;
+    }
+
+    public void setRoom(String room) {
+        this.room = room;
+    }
+
+    public String getRoom() {
+        return room;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setAdminId(Long adminId) {
+        this.adminId = adminId;
+    }
+
+    public Long getAdminId() {
+        return adminId;
+    }
+
+    public void setIsDel(Boolean isDel) {
+        this.isDel = isDel;
+    }
+
+    public Boolean getIsDel() {
+        return isDel;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public LabSubClassVO getSubClassVO() {
+        return subClassVO;
+    }
+
+    public void setSubClassVO(LabSubClassVO subClassVO) {
+        this.subClassVO = subClassVO;
+    }
+
+    public Long getIsSubject() {
+        return isSubject;
+    }
+
+    public void setIsSubject(Long isSubject) {
+        this.isSubject = isSubject;
+    }
+
+    public Long getSubOrder() {
+        return subOrder;
+    }
+
+    public void setSubOrder(Long subOrder) {
+        this.subOrder = subOrder;
+    }
+
+    public String getSafeUserId() {
+        return safeUserId;
+    }
+
+    public void setSafeUserId(String safeUserId) {
+        this.safeUserId = safeUserId;
+    }
+
+    public String getSafeSigns() {
+        return safeSigns;
+    }
+
+    public void setSafeSigns(String safeSigns) {
+        this.safeSigns = safeSigns;
+    }
+
+    public String getHazardCategory() {
+        return hazardCategory;
+    }
+
+    public void setHazardCategory(String hazardCategory) {
+        this.hazardCategory = hazardCategory;
+    }
+
+    public String getRiskMeasure() {
+        return riskMeasure;
+    }
+
+    public void setRiskMeasure(String riskMeasure) {
+        this.riskMeasure = riskMeasure;
+    }
+
+    public String getOutfire() {
+        return outfire;
+    }
+
+    public void setOutfire(String outfire) {
+        this.outfire = outfire;
+    }
+
+    public String getQrCode() {
+        return qrCode;
+    }
+
+    public void setQrCode(String qrCode) {
+        this.qrCode = qrCode;
+    }
+
+    public String getSafeUserName() {
+        return safeUserName;
+    }
+
+    public void setSafeUserName(String safeUserName) {
+        this.safeUserName = safeUserName;
+    }
+
+    public String getSafeUserPhone() {
+        return safeUserPhone;
+    }
+
+    public void setSafeUserPhone(String safeUserPhone) {
+        this.safeUserPhone = safeUserPhone;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("name", getName())
+                .append("floor", getFloorId())
+                .append("room", getRoom())
+                .append("deptId", getDeptId())
+                .append("deptName", getDeptName())
+                .append("adminId", getAdminId())
+                .append("isDel", getIsDel())
+                .append("createTime", getCreateTime())
+                .append("userId", getUserId())
+                .append("createBy", getCreateBy())
+                .append("updateTime", getUpdateTime())
+                .append("updateBy", getUpdateBy())
+                .append("remark", getRemark())
+                .append("remark", getIsSubject())
+                .append("remark", getSubOrder())
+                .toString();
+    }
+
+    public Long getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Long typeId) {
+        this.typeId = typeId;
+    }
+
+    public Integer getDiyOrder() {
+        return diyOrder;
+    }
+
+    public void setDiyOrder(Integer diyOrder) {
+        this.diyOrder = diyOrder;
+    }
+
+    public String getQrCodeUrl() {
+        return qrCodeUrl;
+    }
+
+    public void setQrCodeUrl(String qrCodeUrl) {
+        this.qrCodeUrl = qrCodeUrl;
+    }
+
+    public Integer getSkipped() {
+        return skipped;
+    }
+
+    public void setSkipped(Integer skipped) {
+        this.skipped = skipped;
+    }
+
+    public Integer getCheckCount() {
+        return checkCount;
+    }
+
+    public void setCheckCount(Integer checkCount) {
+        this.checkCount = checkCount;
+    }
+}

+ 421 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java

@@ -0,0 +1,421 @@
+package com.zd.laboratory.api.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.zd.laboratory.api.vo.HardwareCVO;
+import com.zd.laboratory.api.vo.LabRiskPlanVO;
+import com.zd.laboratory.api.vo.SenseValVO;
+import com.zd.model.enums.HazardTypeEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.List;
+
+/**
+ * 实验室VO
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/07/15:17
+ * @Description:
+ */
+@ApiModel("实验室管理vo")
+public class LabSubjectControllerVO extends LabSubject {
+
+    @ApiModelProperty("所属部门名称")
+    private String subordinateDeptName;
+
+    @ApiModelProperty("危险级别名称")
+    private String dangerName;
+
+    @ApiModelProperty("负责人名称")
+    private String adminName;
+
+    @ApiModelProperty("所属传感器列表")
+    @Deprecated
+    private List<SenseValVO> senseVOList;
+
+    @ApiModelProperty("所属测点")
+    private List<SensorFunctionStatus> sensorFunctionStatusList;
+
+    @ApiModelProperty("所属设备列表")
+    private List<HardwareCVO> labHardwareVOList;
+
+    @ApiModelProperty("实验室地址对象")
+    private SubAddrr subAddrr;
+    @ApiModelProperty("是否拥有完全管理权限")
+    @JsonInclude(value = JsonInclude.Include.NON_NULL)
+    private Boolean admin;
+
+
+    @ApiModelProperty("安全分级名称")
+    private String levelName;
+
+    @ApiModelProperty("安全分级颜色编码")
+    private String fiedColor;
+
+    @ApiModelProperty("安全分类名称")
+    private String typeName;
+
+    @ApiModelProperty("信息牌数据")
+    private SafeInfo safeInfo;
+
+    @ApiModelProperty("危险源信息")
+    private List<LabHazardSubVO> hazardList;
+
+    @ApiModelProperty("预案数据")
+    private List<LabRiskPlanVO> riskPlanList;
+
+    /**
+     * 实验室类型ID
+     */
+    @ApiModelProperty(value = "实验室类型ID")
+    private Long moldId;
+
+    private String adminNameAndPhone;
+
+    private String safeUserNameAdminPhone;
+
+    @ApiModel("安全信息")
+    public static class SafeInfo {
+        @ApiModelProperty("安全警示标示--字典")
+        private List<String> safeSigns;
+
+        @ApiModelProperty("主要危险类别--字典")
+        private List<String> hazardCategory;
+
+        @ApiModelProperty("安全防控措施--字典")
+        private List<String> riskMeasure;
+
+        @ApiModelProperty("灭火要点--字典")
+        private List<String> outfire;
+
+        @ApiModelProperty("离开检测项")
+        private List<String> checkOutData;
+
+        @ApiModelProperty("进入检查项")
+        private List<String> checkInData;
+
+        public List<String> getSafeSigns() {
+            return safeSigns;
+        }
+
+        public void setSafeSigns(List<String> safeSigns) {
+            this.safeSigns = safeSigns;
+        }
+
+        public List<String> getHazardCategory() {
+            return hazardCategory;
+        }
+
+        public void setHazardCategory(List<String> hazardCategory) {
+            this.hazardCategory = hazardCategory;
+        }
+
+        public List<String> getRiskMeasure() {
+            return riskMeasure;
+        }
+
+        public void setRiskMeasure(List<String> riskMeasure) {
+            this.riskMeasure = riskMeasure;
+        }
+
+        public List<String> getOutfire() {
+            return outfire;
+        }
+
+        public void setOutfire(List<String> outfire) {
+            this.outfire = outfire;
+        }
+
+        public List<String> getCheckOutData() {
+            return checkOutData;
+        }
+
+        public void setCheckOutData(List<String> checkOutData) {
+            this.checkOutData = checkOutData;
+        }
+
+        public List<String> getCheckInData() {
+            return checkInData;
+        }
+
+        public void setCheckInData(List<String> checkInData) {
+            this.checkInData = checkInData;
+        }
+    }
+
+    @ApiModel("危险源信息")
+    public static class LabHazardSubVO {
+        /**
+         * 危险源ID
+         */
+        @ApiModelProperty(value = "危险源ID")
+        private Long id;
+
+        /**
+         * 危险源名称
+         */
+        @ApiModelProperty("危险源名称")
+        private String label;
+
+        /**
+         * 危险源类型
+         */
+        @ApiModelProperty("危险源类型")
+        private HazardTypeEnum hazardType;
+
+        /**
+         * 实验室id
+         */
+        @ApiModelProperty("实验室id")
+        private Long subjectId;
+
+
+        /**
+         * X坐标点
+         */
+        @ApiModelProperty("X坐标点")
+        private Long xPoint;
+
+        /**
+         * Y坐标点
+         */
+        @ApiModelProperty("Y坐标点")
+        private Long yPoint;
+        /**
+         * 坐标ID
+         */
+        @ApiModelProperty(value = "坐标ID")
+        private Long xyId;
+
+        /**
+         * 危险源别名
+         */
+        private String anotherName;
+
+        /**
+         * 编号别名
+         */
+        private String anotherCode;
+
+
+        public Long getXyId() {
+            return xyId;
+        }
+
+        public void setXyId(Long xyId) {
+            this.xyId = xyId;
+        }
+
+
+        public LabHazardSubVO() {
+
+        }
+
+        public Long getId() {
+            return id;
+        }
+
+        public void setId(Long id) {
+            this.id = id;
+        }
+
+        public String getLabel() {
+            return label;
+        }
+
+        public void setLabel(String label) {
+            this.label = label;
+        }
+
+        public HazardTypeEnum getHazardType() {
+            return hazardType;
+        }
+
+        public void setHazardType(HazardTypeEnum hazardType) {
+            this.hazardType = hazardType;
+        }
+
+        public Long getSubjectId() {
+            return subjectId;
+        }
+
+        public void setSubjectId(Long subjectId) {
+            this.subjectId = subjectId;
+        }
+
+        public Long getxPoint() {
+            return xPoint;
+        }
+
+        public void setxPoint(Long xPoint) {
+            this.xPoint = xPoint;
+        }
+
+        public Long getyPoint() {
+            return yPoint;
+        }
+
+        public void setyPoint(Long yPoint) {
+            this.yPoint = yPoint;
+        }
+
+        public String getAnotherName() {
+            return anotherName;
+        }
+
+        public void setAnotherName(String anotherName) {
+            this.anotherName = anotherName;
+        }
+
+        public String getAnotherCode() {
+            return anotherCode;
+        }
+
+        public void setAnotherCode(String anotherCode) {
+            this.anotherCode = anotherCode;
+        }
+    }
+
+    @Override
+    public Long getAdminId() {
+        return super.getAdminId() == -1L ? null : super.getAdminId();
+    }
+
+    public List<SensorFunctionStatus> getSensorFunctionStatusList() {
+        return sensorFunctionStatusList;
+    }
+
+    public void setSensorFunctionStatusList(List<SensorFunctionStatus> sensorFunctionStatusList) {
+        this.sensorFunctionStatusList = sensorFunctionStatusList;
+    }
+
+    public Boolean getAdmin() {
+        return admin;
+    }
+
+    public void setAdmin(Boolean admin) {
+        this.admin = admin;
+    }
+
+    public String getDangerName() {
+        return dangerName;
+    }
+
+    public void setDangerName(String dangerName) {
+        this.dangerName = dangerName;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getSubordinateDeptName() {
+        return subordinateDeptName;
+    }
+
+    public void setSubordinateDeptName(String subordinateDeptName) {
+        this.subordinateDeptName = subordinateDeptName;
+    }
+
+    public SubAddrr getSubAddrr() {
+        return subAddrr;
+    }
+
+    public void setSubAddrr(SubAddrr subAddrr) {
+        this.subAddrr = subAddrr;
+    }
+
+
+    public List<SenseValVO> getSenseVOList() {
+        return senseVOList;
+    }
+
+    public void setSenseVOList(List<SenseValVO> senseVOList) {
+        this.senseVOList = senseVOList;
+    }
+
+    public List<HardwareCVO> getLabHardwareVOList() {
+        return labHardwareVOList;
+    }
+
+    public void setLabHardwareVOList(List<HardwareCVO> labHardwareVOList) {
+        this.labHardwareVOList = labHardwareVOList;
+    }
+
+
+    public String getLevelName() {
+        return levelName;
+    }
+
+    public void setLevelName(String levelName) {
+        this.levelName = levelName;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public String getFiedColor() {
+        return fiedColor;
+    }
+
+    public void setFiedColor(String fiedColor) {
+        this.fiedColor = fiedColor;
+    }
+
+    public SafeInfo getSafeInfo() {
+        return safeInfo;
+    }
+
+    public void setSafeInfo(SafeInfo safeInfo) {
+        this.safeInfo = safeInfo;
+    }
+
+    public List<LabHazardSubVO> getHazardList() {
+        return hazardList;
+    }
+
+    public void setHazardList(List<LabHazardSubVO> hazardList) {
+        this.hazardList = hazardList;
+    }
+
+    public List<LabRiskPlanVO> getRiskPlanList() {
+        return riskPlanList;
+    }
+
+    public void setRiskPlanList(List<LabRiskPlanVO> riskPlanList) {
+        this.riskPlanList = riskPlanList;
+    }
+
+    public Long getMoldId() {
+        return moldId;
+    }
+
+    public void setMoldId(Long moldId) {
+        this.moldId = moldId;
+    }
+
+    public String getAdminNameAndPhone() {
+        return adminNameAndPhone;
+    }
+
+    public void setAdminNameAndPhone(String adminNameAndPhone) {
+        this.adminNameAndPhone = adminNameAndPhone;
+    }
+
+    public String getSafeUserNameAdminPhone() {
+        return safeUserNameAdminPhone;
+    }
+
+    public void setSafeUserNameAdminPhone(String safeUserNameAdminPhone) {
+        this.safeUserNameAdminPhone = safeUserNameAdminPhone;
+    }
+}

+ 71 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectVO.java

@@ -0,0 +1,71 @@
+package com.zd.laboratory.api.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实验室VO
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/07/15:17
+ * @Description:
+ */
+@ApiModel("实验室管理类")
+public class LabSubjectVO extends LabSubject {
+
+    @ApiModelProperty("楼层名称")
+    private String buildName;
+
+    @ApiModelProperty("实验室科室")
+    private String subDept;
+
+    @ApiModelProperty("危险级别名称")
+    private String dangerName;
+
+    @ApiModelProperty("负责人名称")
+    private String adminName;
+
+    @ApiModelProperty("是否申请")
+    private Boolean isApply;
+
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getBuildName() {
+        return buildName;
+    }
+
+    public void setBuildName(String buildName) {
+        this.buildName = buildName;
+    }
+
+    public String getSubDept() {
+        return subDept;
+    }
+
+    public void setSubDept(String subDept) {
+        this.subDept = subDept;
+    }
+
+    public String getDangerName() {
+        return dangerName;
+    }
+
+    public void setDangerName(String dangerName) {
+        this.dangerName = dangerName;
+    }
+
+    public Boolean getIsApply() {
+        return isApply;
+    }
+
+    public void setIsApply(Boolean isApply) {
+        this.isApply = isApply;
+    }
+}

+ 163 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/RemoteLabHardware.java

@@ -0,0 +1,163 @@
+package com.zd.laboratory.api.entity;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.zd.model.annotation.Excel;
+import com.zd.model.enums.HardwareOperate;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.Size;
+
+/**
+ * 硬件对象 lab_hardware
+ *
+ * @author zd
+ */
+@ApiModel("硬件表")
+@Data
+public class RemoteLabHardware{
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(value = "${comment}")
+    private Long id;
+
+    /**
+     * 设备名称
+     */
+    @ApiModelProperty("设备名称")
+    @Excel(name = "设备名称")
+    private String name;
+
+    /**
+     * 设备厂家
+     */
+    @ApiModelProperty("设备厂家")
+    @Excel(name = "设备厂家")
+    private String factory;
+
+    /**
+     * 设备类型
+     */
+    @ApiModelProperty("设备类型")
+    @Excel(name = "设备类型")
+    private Integer type;
+
+    /**
+     * 一体机类型,管控一体机0  学习考试一体机1
+     */
+    @ApiModelProperty("一体机类型")
+    @Excel(name = "一体机类型")
+    private Integer pcType;
+
+    /**
+     * mac地址
+     */
+    @ApiModelProperty("mac地址")
+    @Excel(name = "mac地址")
+    private String macAdd;
+
+    /**
+     * 所属实验室id
+     */
+    @ApiModelProperty("所属实验室id")
+    @Excel(name = "所属实验室id")
+    private Long subjectId;
+
+    /**
+     * 部门id
+     */
+    @ApiModelProperty("部门id")
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @ApiModelProperty("部门名称")
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /**
+     * 设备状态
+     */
+    @ApiModelProperty("设备状态")
+    @Excel(name = "设备状态")
+    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
+    private HardwareOperate operate;
+
+    /**
+     * 创建人(用于数据权限)
+     */
+    @ApiModelProperty("创建人(用于数据权限)")
+    @Excel(name = "创建人", readConverterExp = "用=于数据权限")
+    private Long userId;
+
+    @ApiModelProperty("设备编码")
+    private String hardwareNum;
+
+    /**
+     * 配置名称
+     */
+    private String configName;
+
+    /**
+     * 配置状态
+     */
+    private String configStatus;
+
+    /**
+     * 老继电器,新继电器
+     */
+    private int hardwareType;
+
+    @ApiModelProperty(value = "供应厂商")
+    private Integer manufacturerType;
+
+    /** ip地址 */
+    @Size(message = "ip地址长度不能超过100")
+    @ApiModelProperty(value = "ip地址")
+    private String ipAddress;
+    /** 设备端口号 */
+    @ApiModelProperty(value = "设备端口号")
+    private Integer port;
+    /** 设备输出频率 33最大 */
+    @ApiModelProperty(value = "设备输出频率 33最大")
+    private String uniformPower;
+    /** 设备推送频率,0最大,2最小 */
+    @ApiModelProperty(value = "设备推送频率,0最大,2最小")
+    private Byte sessionIndex;
+    /** 支持1通道、4通道、8通道、16通道 */
+    @ApiModelProperty(value = "支持1通道、4通道、8通道、16通道")
+    private Integer channels;
+
+    /**
+     * 功能状态: 不同设备的功能状态都是不一样的
+     */
+    private String functionStatus;
+
+    /**
+     * 横轴坐标
+     */
+    private String horizontalAxis;
+
+    /**
+     * 竖轴坐标
+     */
+    private String verticalAxis;
+
+    /**
+     * 关联继电器编码
+     */
+    private String relayCode;
+
+    /**
+     * 继电器位数
+     */
+    private Integer bit;
+
+    @ApiModelProperty(value = "报警器响铃时长")
+    private Integer ringTime;
+}

+ 183 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/SensorFunctionStatus.java

@@ -0,0 +1,183 @@
+package com.zd.laboratory.api.entity;
+
+import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.StrUtil;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.zd.model.enums.SenseType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Optional;
+
+/**
+ * 传感器功能
+ * @Author: zhoupan
+ * @Date: 2021/09/27/15:36
+ * @Description:
+ */
+@ApiModel("传感器功能")
+public class SensorFunctionStatus extends BasicFunctionStatus {
+    public static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+    private static final String format_val ="{}{}";
+    /**
+     * 传感器id,用于区分多个一样的设备。
+     */
+    @ApiModelProperty("传感器id")
+    private Long id;
+
+    /**
+     * 传感器功能值
+     */
+    @ApiModelProperty("传感器功能值")
+    private String val;
+    /**
+     * 传感器功能值
+     */
+    @ApiModelProperty("格式化值")
+    private String formatVal;
+
+
+    private String defaultVal="--";
+
+    /**
+     * 保留小数点位数
+     */
+    @JsonIgnore
+    private Integer numberDecimal;
+
+    /**
+     * 传感器功能值
+     */
+    @ApiModelProperty("功能值单位")
+    private String unit;
+
+    @ApiModelProperty("路由位数")
+    @JsonIgnore
+    private Integer routeNum;
+
+
+    @ApiModelProperty("是否存在预警")
+    private Boolean hasWarn = false;
+
+    private String sendDate;
+
+    private SenseType type;
+
+    private String  configName;
+
+    public SensorFunctionStatus() {
+        //获取当前时间
+        LocalDateTime newTime = LocalDateTime.now();
+        String format = formatter.format(newTime);
+        this.sendDate = format;
+    }
+
+    public Boolean getHasWarn() {
+        return hasWarn;
+    }
+
+    public void setHasWarn(Boolean hasWarn) {
+        this.hasWarn = hasWarn;
+    }
+
+    public Integer getRouteNum() {
+        return routeNum;
+    }
+
+    public void setRouteNum(Integer routeNum) {
+        this.routeNum = routeNum;
+    }
+
+    public String getRoundVlue() {
+        if(val==null) return defaultVal;
+
+        if(numberDecimal!=null&&!val.equals(defaultVal))
+        {
+            String s = NumberUtil.roundStr(val, numberDecimal);
+            return s;
+        }
+        return val;
+    }
+
+    public Integer getNumberDecimal() {
+        return numberDecimal;
+    }
+
+    public void setNumberDecimal(Integer numberDecimal) {
+        this.numberDecimal = numberDecimal;
+    }
+
+
+    /**
+     * 命令
+     */
+    @ApiModelProperty("命令")
+    private String cmd;
+
+    public String getFormatVal() {
+
+        return StrUtil.format(format_val,getRoundVlue(),Optional.ofNullable(unit).orElse(StrUtil.EMPTY));
+    }
+
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getCmd() {
+        return cmd;
+    }
+
+    public void setCmd(String cmd) {
+        this.cmd = cmd;
+    }
+
+
+    public String getVal() {
+        if(val==null) return defaultVal;
+        return val;
+    }
+
+    public void setVal(String val) {
+        this.val = val;
+    }
+
+    public String getSendDate() {
+        return sendDate;
+    }
+
+    public void setSendDate(String sendDate) {
+        this.sendDate = sendDate;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public SenseType getType() {
+        return type;
+    }
+
+    public void setType(SenseType type) {
+        this.type = type;
+    }
+
+    public String getConfigName() {
+        return configName;
+    }
+
+    public void setConfigName(String configName) {
+        this.configName = configName;
+    }
+}

+ 84 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/SubAddrr.java

@@ -0,0 +1,84 @@
+package com.zd.laboratory.api.entity;
+
+import cn.hutool.core.util.StrUtil;
+
+import java.util.Optional;
+
+/**
+ * @Author: zhoupan
+ * @Date: 2021/09/27/18:46
+ * @Description:
+ */
+public class SubAddrr {
+    /**
+     * 布局ID
+     */
+    Long id;
+
+    Long floorId;
+    /**
+     * 层
+     */
+    String floorName;
+    /**
+     * 楼
+     */
+    String buildName;
+    /**
+     * 房间号
+     */
+    String room;
+
+
+    private static String addrrFormat = "{} {} {}";
+
+    public static String addrrPlus(SubAddrr subAddrr) {
+
+        if (subAddrr == null) return StrUtil.EMPTY;
+
+        return StrUtil.format(addrrFormat,
+                Optional.ofNullable(subAddrr.getBuildName()).orElse(StrUtil.EMPTY),
+                Optional.ofNullable(subAddrr.getFloorName()).orElse(StrUtil.EMPTY),
+                Optional.ofNullable(subAddrr.getRoom()).orElse(StrUtil.EMPTY));
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getFloorName() {
+        return floorName;
+    }
+
+    public void setFloorName(String floorName) {
+        this.floorName = floorName;
+    }
+
+    public String getBuildName() {
+        return buildName;
+    }
+
+    public void setBuildName(String buildName) {
+        this.buildName = buildName;
+    }
+
+    public String getRoom() {
+        return room;
+    }
+
+    public void setRoom(String room) {
+        this.room = room;
+    }
+
+    public Long getFloorId() {
+        return floorId;
+    }
+
+    public void setFloorId(Long floorId) {
+        this.floorId = floorId;
+    }
+}

+ 462 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteLaboratoryService.java

@@ -0,0 +1,462 @@
+package com.zd.laboratory.api.feign;
+
+import com.zd.laboratory.api.entity.*;
+import com.zd.laboratory.api.feign.fallback.RemoteLaboratoryFallbackFactory;
+import com.zd.laboratory.api.vo.LabGradeManageWorkVO;
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.domain.AjaxResult;
+import com.zd.model.domain.R;
+import com.zd.model.entity.Algorithm;
+import com.zd.model.entity.TotalByID;
+import com.zd.model.enums.HardwareOperate;
+import com.zd.model.page.TableDataInfo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletResponse;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 实验室feign调用服务
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/06/11:28
+ * @Description:
+ */
+@FeignClient(contextId = "remoteLaboratoryService", value = ApplicationConstants.LABORATORY_SERVICE, fallbackFactory = RemoteLaboratoryFallbackFactory.class)
+public interface RemoteLaboratoryService {
+
+    @ApiOperation(value = "批量获取管理实验室数量-根据用户IDS")
+    @GetMapping(value = "/subject/count/{ids}")
+    public R<List<LabSubjectVO>> getInfoByUserIds(@PathVariable("ids") String ids);
+
+    @ApiOperation(value = "新增随手拍记录")
+    @PostMapping("/photonote")
+    public R<Object> addPhotoNote(@RequestBody Map<String, Object> labPhotoNote);
+
+
+    @ApiOperation(value = "小程序查询登录人接收随手拍统计")
+    @GetMapping("/photonote/appReceivePhotoNote")
+    public R<Object> appReceivePhotoNote(@RequestBody Map<String, Object> photoNote);
+
+    @ApiOperation(value = "获取随手拍记录列表信息(管理端)")
+    @GetMapping("/photonote/getAppList")
+    public TableDataInfo getAppList(@RequestBody Map appInfo);
+
+    @ApiOperation(value = "查询登录用户是否是实验室管理员(数据权限)")
+    @GetMapping("/subject/my/isadmin")
+    public R<Object> isadmin(@RequestBody Map<String, Object> map);
+
+    /**
+     * 获取随手拍记录详细信息
+     */
+    @ApiOperation(value = "获取随手拍记录详细信息")
+    @GetMapping(value = "/photonote/getPhotonote/{id}")
+    public R<Object> getPhotonoteInfo(@PathVariable("id") Long id);
+
+    @ApiOperation(value = "处理随手拍记录")
+    @PostMapping("/photonote/appHandle")
+    public R<Object> editPhotoNote(@RequestBody Map appInfo);
+
+
+    @ApiOperation(value = "离开实验室拍照附件列表")
+    @GetMapping("/inspection")
+    public R<Object> outSubjectPhoto();
+
+    @ApiOperation(value = "获取签到离开的实验室列表")
+    @GetMapping("/inspection/outSubjectList")
+    public R<Object> outSubjectList();
+
+
+    @ApiOperation(value = "新增拍照检查附件")
+    @PostMapping("/inspection/savaPhotoFj")
+    public R<Object> addPhotoInspection(@RequestBody Map<String,Object> labPhotoInspection);
+
+
+    @ApiOperation(value = "统计安全准入审批不同信息")
+    @GetMapping("/approval/getApprovalCount")
+    public R<Object> getApprovalCount(@RequestBody Map<String, Object> approval);
+
+
+    @ApiOperation(value = "查询安全准入审批记录列表")
+    @GetMapping("/approval/getApprovalList")
+    public TableDataInfo getApprovalList(@RequestBody Map approval);
+
+    @ApiOperation(value = "查询违规记录列表")
+    @GetMapping("/violation/mylist")
+    public TableDataInfo getViolationList(Map violation);
+
+    @ApiOperation(value = "查询我的违规记录统计")
+    @GetMapping("/workbench/myViolationCount")
+    public R<Object> myViolationCount(@RequestBody Map violation);
+
+    @ApiOperation(value = "修改违规记录")
+    @PutMapping("/violation")
+    public R<Object> editViolation(@RequestBody Map<String, Object> params);
+
+    @ApiOperation(value = "查询我的实验室列表")
+    @GetMapping("/workbench/mySubjectList")
+    public R<Object> mySubjectList(@RequestBody Map subjectMap);
+
+    /**
+     * 获取当前用户学生卡和人脸信息
+     */
+    @ApiOperation(value = "获取当前用户学生卡和人脸信息")
+    @GetMapping(value = "/studentinfo/my")
+    public R getMyCardInfo();
+
+
+    /**
+     * 查询实验室下的安全准入资格材料列表
+     */
+    @ApiOperation(value = "查询实验室下的安全准入资格材料列表")
+    @GetMapping(value = "/material/subjectMaterialList")
+    public R<Object> subjectMaterialList(@RequestBody Map material);
+
+    /**
+     * 小程序查询实验室列表(用户端,管理端)
+     */
+    @ApiOperation(value = "小程序查询实验室列表(用户端,管理端)")
+    @GetMapping(value = "/subject/getSubjectDict")
+    public R<Object> getSubjectDict();
+
+
+    /**
+     * 黑名单完成学习规则
+     */
+    @PostMapping(value = "/blacklist/blacklistLearningRules")
+    public R<Object> blacklistLearningRules(@RequestBody Map<String,Object> blackdetailMap);
+//
+//    /**
+//     * 负面清单更改状态
+//     */
+//
+//    @GetMapping("/negativeListRecords/LearningRules")
+//    public R negativelistLearningRules(@RequestParam Long violationId,
+//                                       @RequestParam int status);
+
+    /**
+      * 负面清单更改状态
+    */
+    @GetMapping("/negativeListRecords/LearningRules/{violationId}/{status}")
+    public R negativelistLearningRules(@PathVariable("violationId") Long violationId,
+                                       @PathVariable("status") int status);
+
+
+    /**
+     * 获取黑名单惩罚时间区间
+     */
+    @PostMapping(value = "/blacklist/getBlackTimeArea")
+    public R<Object> getBlackTimeArea(@RequestBody Map<String,Object> blackdetailMap);
+
+
+    /**
+     * 查询实验室控制数据列表(小程序使用)
+     * 按意见修改为 数据权限&负责人权限
+     *
+     * @return
+     */
+    @ApiOperation("查询实验室控制数据列表")
+    @GetMapping("/subject/manger/list")
+    public R queryMyAadminSubCListVO();
+
+    /**
+     * 获取安全准入审批记录详细信息
+     */
+    @ApiOperation(value = "获取安全准入审批记录详细信息")
+    @GetMapping(value = "/approval/{ids}")
+    public R<Object> approvalDetail(@PathVariable("ids") String ids);
+
+    /**
+     * 小程序安全准入资格提交
+     */
+    @ApiOperation(value = "小程序安全准入资格提交")
+    @PostMapping(value = "/approval/accessReview")
+    public R<Object> accessReview(@RequestBody Map<String, Object> labApprovalMap);
+
+    /**
+     * 安全准入资格审批(管理端)
+     */
+    @ApiOperation(value = "安全准入资格审批(管理端)")
+    @PutMapping(value = "/approval/appOperation")
+    public R<Object> appOperation(@RequestBody Map<String, Object> labApprovalMap);
+
+    /**
+     * 小程序安全准入资格拒绝审批(管理端)
+     */
+    @ApiOperation(value = "小程序安全准入资格拒绝审批(管理端)")
+    @PutMapping(value = "/approval/failedOperation")
+    public R<Object> failedOperation(@RequestBody Map<String, Object> labApprovalMap);
+
+    /**
+     * 小程序人脸识别接口
+     */
+    @ApiOperation(value = "小程序人脸识别接口")
+    @PostMapping(value = "/studentinfo/commit/face" , consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public R<Object> uploadFace(@RequestPart(value = "file") MultipartFile file);
+
+
+    @GetMapping("/subject/manger/{ids}/SubTotal/")
+    public R<List<TotalByID>> queryBuildingSubTotal(@PathVariable("ids") Long[] ids);
+
+    /**
+     * 根据用户查询黑名单列表
+     */
+    @PostMapping("/blacklist/info/{userId}")
+    public R<Object> userBlacklist(@PathVariable("userId") Long userId);
+
+    @RequestMapping("/service/mqtt/send/{num}/{hardwareOperate}")
+    public R sends(@PathVariable("num") String num, @PathVariable("hardwareOperate") HardwareOperate hardwareOperate);
+
+
+    /**
+     * 定时器定时查询离开时间超过24小时,记违规
+     */
+    @PutMapping("/record/outTimeRecord")
+    public AjaxResult outTimeRecord();
+
+
+    /**
+     * 定时器定时查询预案向一体机推送的消息,如果超过两小时,需要清理
+     */
+    @PutMapping("/content/outTimeClearMessage")
+    public AjaxResult outTimeClearMessage();
+
+
+    /**
+     * 新增消息发布
+     */
+    @PostMapping("/content")
+    public AjaxResult publishMess(@RequestBody LabMessageContent labMessageContent);
+
+
+    @ApiOperation(value = "查询安全预警列表 (管理端)")
+    @GetMapping("/plan/log/app/subBySensorList")
+    public TableDataInfo getSafeWarnList(Map riskPlanAbnormalLog);
+
+
+    /**
+     * 查询违规记录统计
+     */
+    @ApiOperation(value = "查询安全预警统计 (管理端)")
+    @GetMapping("/plan/log/app/subBySensorCount")
+    public R<Object> getSafeWarnCount();
+
+
+    @ApiOperation(value = "查询实验室下的预案列表 (管理端)")
+    @GetMapping("/plan/log/app/adminSubByRiskPlan")
+    public TableDataInfo getSubByRiskPlan(Map riskPlanAbnormalLog);
+
+
+    @PostMapping("/algorithm/save")
+    public R saveData(Algorithm algorithm);
+
+    /**
+     * 小程序查询实验室列表(用户端,管理端)
+     */
+    @ApiOperation(value = "小程序查询实验室列表(用户端,管理端)")
+    @RequestMapping(value = "/subject/check/{id}")
+    R<Map<Object, Object>> getCheckInfo(@PathVariable("id") Long id);
+
+    @PostMapping("/violation/userexist/{userId}")
+    public R userexist(@PathVariable("userId") Long userId);
+
+    @GetMapping("/violation/userInfo")
+    public R getPersonInfo();
+
+
+    /**
+     * 获取违规时间段
+     * @param violationId
+     * @return
+     */
+    @GetMapping("/negativeListRecords/getViolationTime")
+    public R getViolationTime(Long violationId);
+
+//    /**
+//     * 获取做题数量和准确率
+//     * @param violationId
+//     * @return
+//     */
+//    @GetMapping("/negativeListRecords/getpracticenum")
+//    public R getPracticeNum(@RequestParam Long violationId);
+
+
+    /**
+     * 获取做题数量和准确率
+     * @param violationId
+     * @return
+     */
+    @GetMapping("/negativeListRecords/getpracticenum/{violationId}")
+    public R getPracticeNum(@PathVariable("violationId") Long violationId);
+
+    /*@GetMapping("/violation/historyList")
+    @ApiOperation(value = "查询违规记录列表")
+    public TableDataInfo violationhistoryList(@RequestParam(defaultValue = "-1") String overStatus,
+                                              @RequestParam(defaultValue = "") String statTime,
+                                              @RequestParam(defaultValue = "") String endTime);*/
+
+
+
+    @ApiOperation(value = "小程序安全检查记录-按时间分组")
+    @GetMapping("/checkRecord/listGroupBy")
+    public R<Object> listGroupBy(@RequestBody Map<String, Object> map);
+
+    @ApiOperation(value = "小程序安全检查(根据房间号查询实验室信息)")
+    @GetMapping("/checkRecord/selectInfoByRoom")
+    public R<Object> selectInfoByRoom(@RequestBody Map<String, Object> map);
+
+    @ApiOperation(value = "小程序安全检查 草稿保存")
+    @PostMapping("/checkRecord/addCg")
+    public R<Object> addCg(@RequestBody Map<String, Object> map);
+
+    @ApiOperation(value = "小程序安全检查保存")
+    @PostMapping("/checkRecord/addTj")
+    public R<Object> addTj(@RequestBody Map<String, Object> map);
+
+    @ApiOperation(value = "根据检查项获取 隐患整改集合")
+    @GetMapping("/checkRecord/recordDettailsList")
+    public R<Object> recordDettailsList(@PathVariable("id") Integer id);
+
+    @ApiOperation(value = "小程序安全检查修改")
+    @PostMapping("/checkRecord/edit")
+    public R<Object> editCheckRecord(@RequestBody Map<String, Object> map);
+
+    @ApiOperation(value = "修改安全检查隐患列表")
+    @PostMapping("/checkRecordDetails/editList")
+    public R<Object> editCheckRecordDetailsList(@RequestBody Map<String, Object> map);
+
+    @ApiOperation(value = "根据用户id查询用户信息")
+    @GetMapping("/user/info/id/{id}")
+    public R<Object> selectUserInfoById(@PathVariable("id") Long id);
+
+    /**
+     * 小程序单个 生成整改通知书
+     */
+    @ApiOperation(value = "生成整改通知书")
+    @GetMapping("/checkOption/genNotice/{id}")
+    public void genNotice(@PathVariable("id") Long id, HttpServletResponse response);
+
+    /**
+     * 小程序单个 生成整改报告
+     */
+    @ApiOperation(value = "生成整改报告")
+    @GetMapping("/checkOption/genReport/{id}")
+    public void genReport(@PathVariable("id") Long id, HttpServletResponse response);
+
+    /**
+     * 根据楼层获取喇叭列表
+     */
+    @ApiOperation(value = "根据楼层获取喇叭列表")
+    @RequestMapping("/sparseHardware/getSpeakerByFloor/{floorId}")
+    public R<Object> getSpeakerByFloor(@PathVariable("floorId") Long floorId);
+
+    /**
+     * 根据楼层获取喇叭列表
+     */
+    @ApiOperation(value = "根据楼层获取喇叭列表")
+    @RequestMapping("/sparseHardware/getSpeaker/{floorId}/{subId}")
+    public R<Object> getSpeakerBySub(@PathVariable("floorId") Long floorId, @PathVariable("subId") Long subId);
+
+    /**
+     * 定时任务分级管控工作过期记录 - 并排列下次工作计划
+     */
+    @ApiOperation(value = "定时任务分级管控工作过期记录 - 并排列下次工作计划")
+    @GetMapping(value = "/gradeManageRecord/workArrange")
+    public void workArrange();
+
+    /**
+     * 定时任务 早8点 管控工作逾期通知
+     */
+    @ApiOperation(value = "定时任务 早8点管控工作逾期通知")
+    @GetMapping(value = "/gradeManageRecord/workOverdue")
+    public void workOverdue();
+
+    /**
+     * 定时任务 下午7点 天管控工作执行通知
+     */
+    @ApiOperation(value = "定时任务 下午7点 管控工作执行通知")
+    @GetMapping(value = "/gradeManageRecord/workExecuteByDay")
+    public void workExecuteByDay();
+
+    /**
+     * 定时任务 早8点 其他管控工作执行通知
+     */
+    @ApiOperation(value = "定时任务 早8点 管控工作执行通知")
+    @GetMapping(value = "/gradeManageRecord/workExecute")
+    public void workExecute();
+
+    /**
+     * 查询分级管控未完成工作列表
+     */
+    @PostMapping("/gradeManageWork/havingList")
+    @ApiOperation(value = "查询分级管控未完成工作列表")
+    public R<List<LabGradeManageWorkVO>> havingList(@RequestBody LabGradeManageRecord labGradeManageRecord);
+
+    /**
+     * 查询分级管控已完成工作列表
+     */
+    @PostMapping("/gradeManageWork/finishList")
+    @ApiOperation(value = "查询分级管控已完成工作列表")
+    public R<List<LabGradeManageWorkVO>> finishList(@RequestBody LabGradeManageRecord labGradeManageRecord);
+
+    @ApiOperation(value = "完成分级管控工作")
+    @PostMapping(value = "/gradeManageWork/finish")
+    public R<LabGradeManageRecord> finish(@RequestBody LabGradeManageRecord labGradeManageRecord);
+
+    /**
+     * 获取分级管控工作详细信息
+     */
+    @ApiOperation(value = "获取分级管控工作详细信息")
+    @GetMapping(value = "/gradeManageWork/{id}")
+    public R<LabGradeManageRecord> getInfo(@PathVariable("id") Long id);
+
+    @PostMapping(value = "/gradeManageWork/queryByMessage")
+    public R<LabGradeManageWorkVO> queryByMessage(@RequestBody LabGradeManageRecord labGradeManageRecord);
+
+    /**
+     * 安全检查隐患项未整改逾期通知
+     */
+    @ApiOperation(value = "安全检查隐患项未整改逾期通知")
+    @GetMapping(value = "/checkRecord/checkSendMsgBeOverdue")
+    public void checkSendMsgBeOverdue();
+
+    /**
+     * 一体机logo修改通知
+     */
+    @ApiOperation(value = "一体机logo修改通知")
+    @GetMapping(value = "/onemachine/logoNotice")
+    public void logoNotice();
+
+    @PostMapping("/subject/manger/controlByInside")
+    public Object controlByInside(@RequestParam("id") Long id ,@RequestParam("type") String type);
+
+
+    /**
+     * 查询机柜绑定柜锁列表
+     */
+    @ApiOperation(value = "查询机柜绑定柜锁列表")
+    @PostMapping("/hardware/getHardwareByLockList")
+    R<List <LinkedHashMap <String,String>>> getHardwareByLockList(@RequestBody Map allMap);
+
+    /**
+     * 查询识别器管理列表
+     */
+    @GetMapping("/hardware/list/start")
+    @ApiOperation(value = "查询识别器管理列表")
+    R<List<RemoteLabHardware>> listStart();
+
+    @PostMapping("/hardware/remote/list")
+    R<List<RemoteLabHardware>> remoteList(@RequestBody RemoteLabHardware remoteLabHardware);
+
+    /**
+     * 修改识别器状态
+     */
+    @ApiOperation(value = "修改识别器状态")
+    @PutMapping("/hardware/update")
+    R<Integer> update(@RequestParam("operate") HardwareOperate operate, @RequestParam("ipAddress") String ipAddress);
+}

+ 68 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteMessageContentService.java

@@ -0,0 +1,68 @@
+package com.zd.laboratory.api.feign;
+
+import com.zd.laboratory.api.entity.LabMessageUser;
+import com.zd.laboratory.api.feign.fallback.RemoteMessageContentFallbackFactory;
+import com.zd.laboratory.api.vo.LabMessageUserListVO;
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.domain.R;
+import com.zd.model.page.TableDataInfo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 消息内容feign调用服务
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/06/11:28
+ * @Description:
+ */
+@FeignClient(contextId = "remoteMessageContentService", value = ApplicationConstants.LABORATORY_SERVICE, fallbackFactory = RemoteMessageContentFallbackFactory.class)
+public interface RemoteMessageContentService {
+
+
+    /**
+     * 查询我的消息
+     */
+    @RequestMapping("/content/my/list")
+    public TableDataInfo<LabMessageUserListVO> mylist(@RequestParam("pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize);
+
+    /**
+     * 查询我的消息-发送人分组-(只查询管理员消息)
+     */
+    @RequestMapping("/content/my/group/list")
+    public TableDataInfo myGrouplist(@RequestParam("pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize);
+
+    /**
+     * 查询我的消息统计数量
+     */
+    @RequestMapping("/content/my/group/totalCount")
+    public R<Object> myGroupTotalCount();
+
+
+    /**
+     * 查询安全准入消息信息
+     */
+    @RequestMapping("/content/my/group/read/{messageId}")
+    public R<Object> myRead(@PathVariable("messageId") Long messageId);
+
+    /**
+     * 查询我的消息-发送人分组-分组内消息
+     */
+    @RequestMapping("/content/my/{id}/group/list")
+    public TableDataInfo myGrouplistById(@RequestParam("pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize,@PathVariable("id") Long id);
+
+    /**
+     * 查询消息内容
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/content/my/{id}")
+    public R<LabMessageUser> message(@PathVariable("id") Long id);
+
+    @PostMapping("/content/readByLoginUser")
+    public void readByLoginUser(@RequestBody LabMessageUser labMessageUser);
+
+    @PostMapping("/dynamic/addMessage")
+    public R addDynamicMessage( @RequestBody Object obj);
+}

+ 67 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteSubQueryService.java

@@ -0,0 +1,67 @@
+package com.zd.laboratory.api.feign;
+
+
+import com.zd.laboratory.api.entity.CabinetLock;
+import com.zd.laboratory.api.entity.CabinetV2Lock;
+import com.zd.laboratory.api.entity.LabSubject;
+import com.zd.laboratory.api.feign.fallback.RemoteSubQueryFallbackFactory;
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.domain.R;
+import com.zd.model.entity.SubQueryConfig;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 实验室feign调用服务
+ */
+@FeignClient(contextId = "remoteSubQueryService", value = ApplicationConstants.LABORATORY_SERVICE, fallbackFactory = RemoteSubQueryFallbackFactory.class)
+public interface RemoteSubQueryService {
+
+    /**
+     * 查询实验室详情
+     */
+    @ApiOperation(value = "查询实验室详情")
+    @PostMapping("/subject/manger/V2/diy/{id}/common")
+    R<Object> getSafeWarnCount(@PathVariable("id") Long id,@RequestBody SubQueryConfig subQueryConfig);
+
+
+
+    /**
+     * 查询实验室控制数据列表- 数据权限(包括负责人)
+     */
+    @ApiOperation("查询实验室控制数据列表- 数据权限(包括负责人)")
+    @PostMapping("/subject/manger/V2/list")
+    R<Object> querySubCListVO(@RequestBody Map<String,Object> appSubQuery);
+
+    /**
+     * 查询实验室控制数据列表- 数据权限(包括负责人)
+     */
+    @ApiOperation("查询实验室控制数据列表- 数据权限(包括负责人)")
+    @GetMapping("/subject/manger/V2/admin/subandwran/count")
+    R<Map<String,Object>> querySubCListVO();
+
+    @PostMapping("/subject/manger/V2/list/ids")
+    R<List<LabSubject>> listByIds(@RequestBody List<Long> ids);
+
+    @GetMapping("/subject/manger/V2/list/name")
+    R<List<LabSubject>> listByName(@RequestParam("name") String name);
+
+    @PostMapping("/device/remote/cabinetLock")
+    R cabinetLock(@RequestBody @Valid CabinetLock cabinetLock);
+
+    /**
+     * 柜锁开锁 V2
+     */
+    @PostMapping("/device/remote/V2/openLock")
+    R cabinetV2OpenLock(@RequestBody @Valid CabinetV2Lock cabinetV2Lock);
+
+    /**
+     * 柜锁关锁锁 V2
+     */
+    @PostMapping("/device/remote/V2/closeLock")
+    R cabinetV2CloseLock(@RequestBody @Valid CabinetV2Lock cabinetV2Lock);
+}

+ 422 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteLaboratoryFallbackFactory.java

@@ -0,0 +1,422 @@
+package com.zd.laboratory.api.feign.fallback;
+
+import com.zd.laboratory.api.entity.*;
+import com.zd.laboratory.api.feign.RemoteLaboratoryService;
+import com.zd.laboratory.api.vo.LabGradeManageWorkVO;
+import com.zd.model.domain.AjaxResult;
+import com.zd.model.domain.R;
+import com.zd.model.entity.Algorithm;
+import com.zd.model.entity.TotalByID;
+import com.zd.model.enums.HardwareOperate;
+import com.zd.model.page.TableDataInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletResponse;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class RemoteLaboratoryFallbackFactory implements FallbackFactory<RemoteLaboratoryService> {
+    private static final Logger log = LoggerFactory.getLogger(RemoteLaboratoryFallbackFactory.class);
+
+    @Override
+    public RemoteLaboratoryService create(Throwable cause) {
+        log.error("实验室服务调用失败:{}", cause.getMessage());
+        return new RemoteLaboratoryService() {
+            @Override
+            public R<List<LabSubjectVO>> getInfoByUserIds(String ids) {
+                return R.fail("获取负责人实验室数据失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> appReceivePhotoNote(Map<String, Object> photoNote) {
+                return R.fail("登录人接收随手拍统计失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> addPhotoNote(Map<String, Object> labPhotoNote) {
+                return R.fail("随手拍提交失败:" + cause.getMessage());
+            }
+
+            @Override
+            public TableDataInfo getAppList(Map appInfo) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setMsg("查询随手拍记录列表信息列表失败:" + cause.getMessage());
+                tableDataInfo.setCode(500);
+                return tableDataInfo;
+            }
+
+            @Override
+            public R<Object> isadmin(Map<String, Object> map) {
+                return R.fail("查询是否管理员失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> getPhotonoteInfo(Long id) {
+                return R.fail("获取随手拍详情失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> editPhotoNote(Map appInfo) {
+                return R.fail("随手拍审批失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> outSubjectPhoto() {
+                return R.fail("离开实验室拍照附件列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> outSubjectList() {
+                return R.fail("获取签到离开的实验室列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> addPhotoInspection(Map<String,Object> labPhotoInspection) {
+                return R.fail("拍照检查附件提交失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> getApprovalCount(@RequestParam Map<String, Object> approval) {
+                return R.fail("统计安全准入审批不同信息:" + cause.getMessage());
+            }
+
+            @Override
+            public TableDataInfo getApprovalList(Map approval) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setMsg("查询安全准入审批记录列表失败:" + cause.getMessage());
+                tableDataInfo.setCode(500);
+                return tableDataInfo;
+            }
+
+            @Override
+            public TableDataInfo getViolationList(Map violation) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setMsg("查询查询违规记录列表失败:" + cause.getMessage());
+                tableDataInfo.setCode(500);
+                return tableDataInfo;
+            }
+
+            @Override
+            public R<Object> myViolationCount(Map violation) {
+                return R.fail("查询违规记录列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> editViolation(Map<String, Object> params) {
+                return R.fail("修改违规记录失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> mySubjectList(Map violation) {
+                return R.fail("查询我的实验室列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R getMyCardInfo() {
+                return R.fail("获取学生卡和人脸信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> subjectMaterialList(Map material) {
+                return R.fail("获取实验室下的安全准入资格材料列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> getSubjectDict() {
+                return R.fail("小程序查询实验室列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> blacklistLearningRules(Map<String,Object> blackdetailMap) {
+                return R.fail("黑名单完成学习规则执行失败:" + cause.getMessage());
+            }
+
+
+
+
+            /**
+             * 负面清单完成学习规则
+             *
+             * @param violationId
+             * @param status
+             */
+            @Override
+            public R negativelistLearningRules(Long violationId, int status) {
+                return R.fail("负面清单完成学习规则执行失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> getBlackTimeArea(Map<String,Object> blackdetailMap) {
+                return R.fail("获取黑名单惩罚时间区间失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> approvalDetail(String ids) {
+                return R.fail("获取安全准入审批记录详细信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> accessReview(Map<String, Object> labApprovalMap) {
+                return R.fail("提交安全准入资格信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> appOperation(Map<String, Object> labApprovalMap) {
+                return R.fail("安全准入审批失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> failedOperation(Map<String, Object> labApprovalMap) {
+                return R.fail("安全准入审批拒绝失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> uploadFace(MultipartFile file) {
+                return R.fail("获取小程序人脸识别接口失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> userBlacklist(Long userId) {
+                return R.fail("获取用户黑名单信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R sends(String num, HardwareOperate hardwareOperate) {
+                return R.fail("摄像头在线离线调用失败:" + cause.getMessage());
+            }
+
+            @Override
+            public AjaxResult outTimeRecord() {
+                return AjaxResult.error("定时查询离开时间超过24小时,记违规任务失败:" + cause.getMessage());
+            }
+
+            @Override
+            public AjaxResult outTimeClearMessage() {
+                return AjaxResult.error("清理消息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public AjaxResult publishMess(LabMessageContent labMessageContent) {
+                return AjaxResult.error("发送消息失败:" + cause.getMessage());
+            }
+
+            /**
+             * 查询实验室控制数据列表- 仅负责人权限(小程序使用)
+             *
+             * @return
+             */
+            @Override
+            public R queryMyAadminSubCListVO() {
+                return R.fail("查询我的实验室列表失败:" + cause.getMessage());
+
+            }
+
+            @Override
+            public R<List<TotalByID>> queryBuildingSubTotal(Long[] ids) {
+                return R.fail("获取实验室数量信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public TableDataInfo getSafeWarnList(Map riskPlanAbnormalLog) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setMsg("查询安全报警记录列表失败:" + cause.getMessage());
+                tableDataInfo.setCode(500);
+                return tableDataInfo;
+            }
+
+            @Override
+            public R getSafeWarnCount() {
+                return R.fail("查询安全报警记录统计失败:" + cause.getMessage());
+
+            }
+
+            @Override
+            public TableDataInfo getSubByRiskPlan(Map riskPlanAbnormalLog) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setMsg("查询预案列表失败:" + cause.getMessage());
+                tableDataInfo.setCode(500);
+                return tableDataInfo;
+            }
+
+            @Override
+            public R saveData(Algorithm algorithm) {
+                return R.fail("保存算法失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R getCheckInfo(Long id) {
+                return R.fail("获取实验室检查项失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R userexist(Long userId) {
+                return R.fail("查询用户违规项失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R getPersonInfo() {
+                 return R.fail("查询用户及违规信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R getViolationTime(Long violationId) {
+                return R.fail("查询违规起始时间失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R getPracticeNum(Long violationId) {
+                return R.fail("查询做题数量失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> listGroupBy(Map<String, Object> map) {
+                return R.fail("安全检查项按时间分组查询失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> selectInfoByRoom(Map<String, Object> map) {
+                return R.fail("根据参数查询实验室信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> addCg(Map<String, Object> map) {
+                return R.fail("安全检查草稿保存失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> addTj(Map<String, Object> map) {
+                return R.fail("安全检查保存失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> recordDettailsList(Integer id) {
+                return R.fail("根据检查项获取 隐患整改集合失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> editCheckRecord(Map<String, Object> map) {
+                return R.fail("安全检查修改失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> editCheckRecordDetailsList(Map<String, Object> map) {
+                return R.fail("安全检查详情列表添加失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> selectUserInfoById(Long id) {
+                return R.fail("根据用户id查询用户信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public void genNotice(Long id, HttpServletResponse response) {
+                throw new RuntimeException("生成整改通知书失败" + cause.getMessage());
+            }
+
+            @Override
+            public void genReport(Long id, HttpServletResponse response) {
+                throw new RuntimeException("生成整改报告" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> getSpeakerByFloor(Long floorId) {
+                throw new RuntimeException("根据楼层获取喇叭列表" + cause.getMessage());
+            }
+
+            @Override
+            public R<Object> getSpeakerBySub(Long floorId, Long subId) {
+                throw new RuntimeException("根据楼层获取喇叭列表" + cause.getMessage());
+            }
+
+            @Override
+            public void workArrange() {
+                throw new RuntimeException("定时任务分级管控工作过期记录 - 并排列下次工作计划失败:" + cause.getMessage());
+            }
+
+            @Override
+            public void workOverdue() {
+                throw new RuntimeException("定时任务分级管控早8点管控工作逾期通知:" + cause.getMessage());
+            }
+
+            @Override
+            public void workExecuteByDay() {
+                throw new RuntimeException("定时任务分级管控工作下午7点 管控工作执行通知:" + cause.getMessage());
+            }
+
+            @Override
+            public void workExecute() {
+                throw new RuntimeException("定时任务分级管控早8点 其他管控工作执行通知:" + cause.getMessage());
+            }
+
+            @Override
+            public R<List<LabGradeManageWorkVO>> havingList(LabGradeManageRecord labGradeManageRecord) {
+                throw new RuntimeException("查询分级管控未完成工作列表" + cause.getMessage());
+            }
+
+            @Override
+            public R<List<LabGradeManageWorkVO>> finishList(LabGradeManageRecord labGradeManageRecord) {
+                throw new RuntimeException("查询分级管控已完成工作列表" + cause.getMessage());
+            }
+
+            @Override
+            public R<LabGradeManageRecord> finish(LabGradeManageRecord labGradeManageRecord) {
+                throw new RuntimeException("完成分级管控工作" + cause.getMessage());
+            }
+
+            @Override
+            public R<LabGradeManageRecord> getInfo(Long id) {
+                throw new RuntimeException("获取分级管控工作详细信息" + cause.getMessage());
+            }
+
+            @Override
+            public R<LabGradeManageWorkVO> queryByMessage(LabGradeManageRecord labGradeManageRecord) {
+                throw new RuntimeException("获取分级管控工作详细信息" + cause.getMessage());
+            }
+
+            /**
+             * 安全检查隐患项未整改逾期通知
+             */
+            @Override
+            public void checkSendMsgBeOverdue() {
+                throw new RuntimeException("安全检查隐患项未整改逾期通知" + cause.getMessage());
+            }
+
+            @Override
+            public void logoNotice() {
+                throw new RuntimeException("logo通知失败" + cause.getMessage());
+            }
+
+            @Override
+            public Object controlByInside(Long id, String type) {
+                throw new RuntimeException("继电器远程控制失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R <List <LinkedHashMap <String, String>>> getHardwareByLockList(Map cabinetSetId) {
+                throw new RuntimeException("获取柜锁列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<List<RemoteLabHardware>> listStart() {
+                return R.fail("查询FRID设备失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<List<RemoteLabHardware>> remoteList(RemoteLabHardware remoteLabHardware) {
+                return R.fail("查询设备失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<Integer> update(@RequestParam("operate") HardwareOperate operate, String ipAddress) {
+                return R.fail("FRID设备状态修改失败:" + cause.getMessage());
+            }
+
+        };
+    }
+}

+ 113 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteMessageContentFallbackFactory.java

@@ -0,0 +1,113 @@
+package com.zd.laboratory.api.feign.fallback;
+
+import com.zd.laboratory.api.entity.LabMessageUser;
+import com.zd.laboratory.api.feign.RemoteMessageContentService;
+import com.zd.laboratory.api.vo.LabMessageUserListVO;
+import com.zd.model.domain.R;
+import com.zd.model.page.TableDataInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Author: zhoupan
+ * @Date: 2021/09/07/8:30
+ * @Description:
+ */
+@Component
+public class RemoteMessageContentFallbackFactory implements FallbackFactory<RemoteMessageContentService> {
+    private static final Logger log = LoggerFactory.getLogger(RemoteMessageContentFallbackFactory.class);
+
+
+    @Override
+    public RemoteMessageContentService create(Throwable cause) {
+        log.error("实验室服务调用失败:{}", cause.getMessage());
+        return new RemoteMessageContentService() {
+            /**
+             * 查询我的消息
+             *
+             * @param pagNum
+             * @param PageSize
+             */
+            @Override
+            public TableDataInfo<LabMessageUserListVO> mylist(Long pagNum, Long PageSize) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setCode(500);
+                tableDataInfo.setMsg("查询消息列表错误失败:" + cause.getMessage());
+                return tableDataInfo;
+            }
+
+            /**
+             * 查询我的消息-发送人分组-(只查询管理员消息)
+             *
+             * @param pageNum
+             * @param pageSize
+             */
+            @Override
+            public TableDataInfo myGrouplist(Long pageNum, Long pageSize) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setCode(500);
+                tableDataInfo.setMsg("查询我的消息-发送人分组失败:" + cause.getMessage());
+                return tableDataInfo;
+            }
+
+            /**
+             * 查询我的消息统计数量
+             *
+             * @return
+             */
+            @Override
+            public R<Object> myGroupTotalCount() {
+                return R.fail("查询我的消息统计数量失败:" + cause.getMessage());
+            }
+
+            /**
+             * 查询安全准入消息信息
+             *
+             * @param messageId
+             * @return
+             */
+            @Override
+            public R<Object> myRead(Long messageId) {
+                return R.fail("查询安全准入消息信息失败:" + cause.getMessage());
+            }
+
+            /**
+             * 查询我的消息-发送人分组-分组内消息
+             *
+             * @param pageNum
+             * @param pageSize
+             * @param id
+             */
+            @Override
+            public TableDataInfo myGrouplistById(Long pageNum, Long pageSize, Long id) {
+                TableDataInfo tableDataInfo = new TableDataInfo();
+                tableDataInfo.setCode(500);
+                tableDataInfo.setMsg("查询我的消息-发送人分组失败:" + cause.getMessage());
+                return tableDataInfo;
+            }
+
+            /**
+             * 查询消息内容
+             *
+             * @param id
+             * @return
+             */
+            @Override
+            public R<LabMessageUser> message(Long id) {
+                return R.fail("查询消息内容失败:" + cause.getMessage());
+            }
+
+            @Override
+            public void readByLoginUser(LabMessageUser labMessageUser) {
+
+            }
+
+            @Override
+            public R addDynamicMessage(Object obj) {
+                return null;
+            }
+        };
+    }
+}

+ 76 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteSubQueryFallbackFactory.java

@@ -0,0 +1,76 @@
+package com.zd.laboratory.api.feign.fallback;
+
+import com.zd.laboratory.api.entity.CabinetLock;
+import com.zd.laboratory.api.entity.CabinetV2Lock;
+import com.zd.laboratory.api.entity.LabSubject;
+import com.zd.laboratory.api.feign.RemoteSubQueryService;
+import com.zd.model.domain.R;
+import com.zd.model.entity.SubQueryConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class RemoteSubQueryFallbackFactory implements FallbackFactory<RemoteSubQueryService> {
+    private static final Logger log = LoggerFactory.getLogger(RemoteSubQueryFallbackFactory.class);
+
+
+    @Override
+    public RemoteSubQueryService create(Throwable cause) {
+        log.error("实验室服务调用失败:{}", cause.getMessage());
+        return new RemoteSubQueryService() {
+
+            /**
+             * 查询实验室详情
+             */
+            @Override
+            public R<Object> getSafeWarnCount(Long id, SubQueryConfig subQueryConfig) {
+                return R.fail("查询实验室详情失败:" + cause.getMessage());
+            }
+
+            /**
+             * 查询实验室数据列表- 数据权限(包括负责人)
+             */
+            @Override
+            public R<Object> querySubCListVO(Map<String,Object> appSubQuery) {
+                return R.fail("查询实验室数据列表失败:" + cause.getMessage());
+            }
+
+            /**
+             * 查询管理实验室和预案执行数量
+             */
+            @Override
+            public R<Map<String,Object>> querySubCListVO() {
+                return R.fail("查询管理实验室和预案执行数量失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<List<LabSubject>> listByIds(List<Long> ids) {
+                return R.fail("查询管理实验室失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R<List<LabSubject>> listByName(String name) {
+                return R.fail("查询管理实验室失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R cabinetLock(CabinetLock cabinetLock) {
+                return R.fail("柜锁操作失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R cabinetV2OpenLock(CabinetV2Lock cabinetV2Lock) {
+                return R.fail("柜锁开锁失败:" + cause.getMessage());
+            }
+
+            @Override
+            public R cabinetV2CloseLock(CabinetV2Lock cabinetV2Lock) {
+                return R.fail("柜锁关锁失败:" + cause.getMessage());
+            }
+        };
+    }
+}

+ 80 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/HardwareCVO.java

@@ -0,0 +1,80 @@
+package com.zd.laboratory.api.vo;
+
+import com.zd.laboratory.api.entity.Control;
+import com.zd.laboratory.api.entity.FunctionStatus;
+import com.zd.model.entity.BaseHardware;
+import com.zd.model.entity.HardwareType;
+import com.zd.model.enums.HardwareTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.List;
+
+/**
+ * 硬件设备
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/17/14:31
+ * @Description:
+ */
+public class HardwareCVO extends BaseHardware {
+
+    @ApiModelProperty("硬件类型")
+    HardwareTypeEnum hardwareTypeEnum;
+
+    @ApiModelProperty("开关状态")
+    Control.SwitchEnums switchEnums;
+
+    /**
+     * 设备功能状态-当前状态
+     */
+    @Deprecated
+    FunctionStatus functionStatus;
+
+    /**
+     * 设备功能状态-所有状态
+     */
+    @Deprecated
+    List<FunctionStatus> functionStatusList;
+
+    /**
+     * 设备类型
+     *
+     * @return
+     */
+    @Override
+    protected HardwareType hardwareType() {
+        return hardwareTypeEnum;
+    }
+
+
+    public Control.SwitchEnums getSwitchEnums() {
+        return switchEnums;
+    }
+
+    public void setSwitchEnums(Control.SwitchEnums switchEnums) {
+        this.switchEnums = switchEnums;
+    }
+
+    public List<FunctionStatus> getFunctionStatusList() {
+        return functionStatusList;
+    }
+
+    public void setFunctionStatusList(List<FunctionStatus> functionStatusList) {
+        this.functionStatusList = functionStatusList;
+    }
+
+    public FunctionStatus getFunctionStatus() {
+        return functionStatus;
+    }
+
+    public void setFunctionStatus(FunctionStatus functionStatus) {
+        this.functionStatus = functionStatus;
+    }
+
+    public HardwareTypeEnum getHardwareTypeEnum() {
+        return hardwareTypeEnum;
+    }
+
+    public void setHardwareTypeEnum(HardwareTypeEnum hardwareTypeEnum) {
+        this.hardwareTypeEnum = hardwareTypeEnum;
+    }
+}

+ 203 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabGradeManageWorkDetailVO.java

@@ -0,0 +1,203 @@
+package com.zd.laboratory.api.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+@ApiModel("管控工作明细表")
+public class LabGradeManageWorkDetailVO {
+
+    /**
+     * 管控记录ID
+     */
+    @ApiModelProperty(value = "管控记录ID")
+    private Long recordId;
+    @ApiModelProperty(value = "是否过期,0 否,1 是")
+    private Integer isExpired = 0;
+
+    /**
+     * 实验室id
+     */
+    @ApiModelProperty(value = "实验室id")
+    private Long subId;
+    /**
+     * 规则ID
+     */
+    @ApiModelProperty("规则ID")
+    private Long ruleId;
+    /**
+     * 用户规则明细ID
+     */
+    @ApiModelProperty("用户规则明细ID")
+    private Long ruleUserId;
+    /**
+     * 规则名称
+     */
+    @ApiModelProperty("规则名称")
+    private String ruleName;
+    /**
+     * 规则描述
+     */
+    @ApiModelProperty("规则描述")
+    private String ruleRemark;
+
+    @ApiModelProperty("规则类型:日管控,月管控..")
+    private String ruleType;
+    @ApiModelProperty("执行周期")
+    private String cycle;
+    /**
+     * 截止执行时间- 通过创建时间 + cycle 周期计算
+     */
+    @JsonFormat(pattern = "yyyy年MM月dd日")
+    @ApiModelProperty("截止执行时间")
+    private Date endDate;
+    /**
+     * 执行状态(1 未执行,2 已执行)
+     */
+    @ApiModelProperty("执行状态(1 未执行,2 已执行)")
+    private Integer status;
+    /**
+     * 实际执行时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "执行时间")
+    private Date carryTime;
+    /**
+     * 需要上传材料(0 否,1 是)
+     */
+    @ApiModelProperty("需要上传材料(0 否,1 是)")
+    private Integer isUpload;
+    /**
+     * 是否全部执行(0 否,1 是)
+     */
+    @ApiModelProperty(value = "是否全部执行(0 否,1 是)")
+    private Integer isAll;
+
+    /**
+     * 1是文档,2是视频,3是图片
+     */
+    @ApiModelProperty(value = "1是文档,2是视频,3是图片")
+    private String fileFormat;
+
+    public Long getRuleId() {
+        return ruleId;
+    }
+
+    public void setRuleId(Long ruleId) {
+        this.ruleId = ruleId;
+    }
+
+    public String getRuleName() {
+        return ruleName;
+    }
+
+    public void setRuleName(String ruleName) {
+        this.ruleName = ruleName;
+    }
+
+    public String getRuleRemark() {
+        return ruleRemark;
+    }
+
+    public void setRuleRemark(String ruleRemark) {
+        this.ruleRemark = ruleRemark;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getCarryTime() {
+        return carryTime;
+    }
+
+    public void setCarryTime(Date carryTime) {
+        this.carryTime = carryTime;
+    }
+
+    public Integer getIsUpload() {
+        return isUpload;
+    }
+
+    public void setIsUpload(Integer isUpload) {
+        this.isUpload = isUpload;
+    }
+
+    public Long getRuleUserId() {
+        return ruleUserId;
+    }
+
+    public void setRuleUserId(Long ruleUserId) {
+        this.ruleUserId = ruleUserId;
+    }
+
+    public Long getRecordId() {
+        return recordId;
+    }
+
+    public void setRecordId(Long recordId) {
+        this.recordId = recordId;
+    }
+
+    public Long getSubId() {
+        return subId;
+    }
+
+    public void setSubId(Long subId) {
+        this.subId = subId;
+    }
+
+    public String getRuleType() {
+        return ruleType;
+    }
+
+    public void setRuleType(String ruleType) {
+        this.ruleType = ruleType;
+    }
+
+    public Integer getIsExpired() {
+        return isExpired;
+    }
+
+    public void setIsExpired(Integer isExpired) {
+        this.isExpired = isExpired;
+    }
+
+    public Integer getIsAll() {
+        return isAll;
+    }
+
+    public void setIsAll(Integer isAll) {
+        this.isAll = isAll;
+    }
+
+    public String getCycle() {
+        return cycle;
+    }
+
+    public void setCycle(String cycle) {
+        this.cycle = cycle;
+    }
+
+    public String getFileFormat() {
+        return fileFormat;
+    }
+
+    public void setFileFormat(String fileFormat) {
+        this.fileFormat = fileFormat;
+    }
+}

+ 230 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabGradeManageWorkVO.java

@@ -0,0 +1,230 @@
+package com.zd.laboratory.api.vo;
+
+import cn.hutool.core.collection.ListUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+import java.util.List;
+
+@ApiModel("管控工作表")
+public class LabGradeManageWorkVO {
+    /**
+     * 实验室id
+     */
+    @ApiModelProperty(value = "实验室id")
+    private Long subId;
+    /**
+     * 实验室名称
+     */
+    @ApiModelProperty("实验室名称")
+    private String subName;
+    /**
+     * 实验室分类ID
+     */
+    @ApiModelProperty("实验室分类ID")
+    private Long typeId;
+    /**
+     * 实验室分类名称
+     */
+    @ApiModelProperty("实验室分类名称")
+    private String typeName;
+    /**
+     * 实验室分级ID
+     */
+    @ApiModelProperty("实验室分级ID")
+    private Long level;
+    /**
+     * 实验室分级名称
+     */
+    @ApiModelProperty("实验室分级名称")
+    private String levelName;
+    /**
+     * 实验室分级名称颜色
+     */
+    @ApiModelProperty("实验室分级名称颜色")
+    private String levelColor;
+
+    /**
+     * 实验室类型ID
+     */
+    @ApiModelProperty(value = "实验室类型ID")
+    private Long moldId;
+    /**
+     * 实验室类型ID
+     */
+    @ApiModelProperty(value = "实验室类型名称")
+    private String moldName;
+
+    /**
+     * 实验室部门id
+     */
+    @ApiModelProperty(value = "实验室部门id")
+    private Long deptId;
+
+    /**
+     * 实验室部门名称
+     */
+    @ApiModelProperty(value = "实验室部门名称")
+    private String deptName;
+
+    private Long userId;
+
+    private List<ManageId> manageIds;
+
+    private String cycle;
+
+    /**
+     * 排序字段
+     */
+    private Date endDate;
+
+    @ApiModelProperty(value = "明细数据")
+    private List<LabGradeManageWorkDetailVO> detailList;
+
+    public static class ManageId{
+        public ManageId() {
+        }
+
+        private Long manageId;
+
+        public Long getManageId() {
+            return manageId;
+        }
+
+        public void setManageId(Long manageId) {
+            this.manageId = manageId;
+        }
+    }
+
+    public Long getSubId() {
+        return subId;
+    }
+
+    public void setSubId(Long subId) {
+        this.subId = subId;
+    }
+
+    public String getSubName() {
+        return subName;
+    }
+
+    public void setSubName(String subName) {
+        this.subName = subName;
+    }
+
+    public Long getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Long typeId) {
+        this.typeId = typeId;
+    }
+
+    public Long getLevel() {
+        return level;
+    }
+
+    public void setLevel(Long level) {
+        this.level = level;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public List<LabGradeManageWorkDetailVO> getDetailList() {
+        return detailList;
+    }
+
+    public void setDetailList(List<LabGradeManageWorkDetailVO> detailList) {
+        if(detailList == null){
+            detailList = ListUtil.empty();
+        }
+        this.detailList = detailList;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public String getLevelName() {
+        return levelName;
+    }
+
+    public void setLevelName(String levelName) {
+        this.levelName = levelName;
+    }
+
+    public String getLevelColor() {
+        return levelColor;
+    }
+
+    public void setLevelColor(String levelColor) {
+        this.levelColor = levelColor;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getMoldId() {
+        return moldId;
+    }
+
+    public void setMoldId(Long moldId) {
+        this.moldId = moldId;
+    }
+
+    public String getMoldName() {
+        return moldName;
+    }
+
+    public void setMoldName(String moldName) {
+        this.moldName = moldName;
+    }
+
+    public String getCycle() {
+        return cycle;
+    }
+
+    public void setCycle(String cycle) {
+        this.cycle = cycle;
+    }
+
+    public List<ManageId> getManageIds() {
+        return manageIds;
+    }
+
+    public void setManageIds(List<ManageId> manageIds) {
+        this.manageIds = manageIds;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+}

+ 29 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabMessageUserListVO.java

@@ -0,0 +1,29 @@
+package com.zd.laboratory.api.vo;
+
+
+import com.zd.laboratory.api.entity.LabMessageUser;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 用户消息对象 lab_message_user
+ *
+ * @author zhoupan
+ * @date 2021-09-02
+ */
+@ApiModel("用户消息对象列表VO")
+public class LabMessageUserListVO extends LabMessageUser {
+
+    @ApiModelProperty("发送人名称")
+    public String sendName;
+
+
+    public String getSendName() {
+        return sendName;
+    }
+
+    public void setSendName(String sendName) {
+        this.sendName = sendName;
+    }
+
+}

+ 45 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabRiskPlanVO.java

@@ -0,0 +1,45 @@
+package com.zd.laboratory.api.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+public class LabRiskPlanVO {
+
+
+    @ApiModelProperty(value = "预案名称")
+    private String planName;
+
+    @ApiModelProperty(value = "预案执行次数")
+    private String planCount;
+
+    @ApiModelProperty(value = "最近执行时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date lastTime;
+
+    public String getPlanName() {
+        return planName;
+    }
+
+    public void setPlanName(String planName) {
+        this.planName = planName;
+    }
+
+    public String getPlanCount() {
+        return planCount;
+    }
+
+    public void setPlanCount(String planCount) {
+        this.planCount = planCount;
+    }
+
+    public Date getLastTime() {
+        return lastTime;
+    }
+
+    public void setLastTime(Date lastTime) {
+        this.lastTime = lastTime;
+    }
+
+}

+ 98 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabSubClassVO.java

@@ -0,0 +1,98 @@
+package com.zd.laboratory.api.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 实验室危险等级
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/23/14:52
+ * @Description:
+ */
+@ApiModel("实验室危险等级")
+public class LabSubClassVO {
+    private static final String ss= "{}级";
+    private static final Map<Long,String> temp= new HashMap<>();
+
+//    static {
+//        temp = new HashMap<>();
+//
+//        temp.put(Long.valueOf(1l),"一级");
+//        temp.put(Long.valueOf(2l),"二级");
+//        temp.put(Long.valueOf(3l),"三级");
+//        temp.put(Long.valueOf(4l),"四级");
+//        temp.put(Long.valueOf(5l),"五级");
+//        temp.put(null,"四级");
+//    }
+
+    @ApiModelProperty("实验室ID")
+    private Long subjectId;
+
+    @ApiModelProperty("危险等级ID")
+    private Long classtypeId;
+
+    @ApiModelProperty("危险等级名称")
+    private String typeName;
+
+    @ApiModelProperty("危险级别1高危险级,2较高危险级,3中危险级,4一般危险级")
+    private Long dangerLevel;
+
+    @ApiModelProperty("级别名称")
+    private String levelName;
+
+    @ApiModelProperty("级别颜色")
+    private String levelColor;
+
+    public String getLevelName() {
+        return levelName;
+    }
+
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Long getClasstypeId() {
+//        if(dangerLevel==null) return 4l;
+        return classtypeId;
+    }
+
+    public void setClasstypeId(Long classtypeId) {
+        this.classtypeId = classtypeId;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public Long getDangerLevel() {
+        return dangerLevel;
+    }
+
+    public void setDangerLevel(Long dangerLevel) {
+        this.dangerLevel = dangerLevel;
+    }
+
+    public void setLevelName(String levelName) {
+        this.levelName = levelName;
+    }
+
+    public String getLevelColor() {
+        return levelColor;
+    }
+
+    public void setLevelColor(String levelColor) {
+        this.levelColor = levelColor;
+    }
+}

+ 85 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/SenseValVO.java

@@ -0,0 +1,85 @@
+package com.zd.laboratory.api.vo;
+
+import cn.hutool.core.collection.CollUtil;
+import com.zd.laboratory.api.entity.SensorFunctionStatus;
+import com.zd.model.entity.BaseHardware;
+import com.zd.model.entity.HardwareType;
+import com.zd.model.enums.SenseType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * @Author: zhoupan
+ * @Date: 2021/09/16/14:51
+ * @Description:
+ */
+@ApiModel("传感器VO")
+public class SenseValVO extends BaseHardware {
+
+
+    @ApiModelProperty("传感器类型")
+    SenseType senseType;
+    @Deprecated
+    @ApiModelProperty("值")
+    String val;
+
+    /**
+     * 解决传感器多功能问题
+     */
+    @ApiModelProperty("传感器功能列表")
+    List<SensorFunctionStatus> sensorFunctionStatusesList;
+
+
+    /**
+     * 如果是单功能则有值
+     * @return
+     */
+    public SensorFunctionStatus getSensorFunctionStatuses() {
+
+        if(CollUtil.isNotEmpty(sensorFunctionStatusesList)&&sensorFunctionStatusesList.size()==1) return sensorFunctionStatusesList.get(0);
+        return null;
+    }
+
+
+    public List<SensorFunctionStatus> getSensorFunctionStatusesList() {
+        return sensorFunctionStatusesList;
+    }
+
+    public void setSensorFunctionStatusesList(List<SensorFunctionStatus> sensorFunctionStatusesList) {
+        this.sensorFunctionStatusesList = sensorFunctionStatusesList;
+    }
+
+    /**
+     * 单功能
+     */
+    public SenseType getSenseType() {
+        return senseType;
+    }
+
+    public void setSenseType(SenseType senseType) {
+        this.senseType = senseType;
+    }
+
+    /*public String getVal() {
+        if (SpringUtils.getActiveProfile().equals("dev")) {
+            return StrUtil.format("{}{}", RandomUtil.randomInt(10, 100),Optional.ofNullable(senseType).map(a->a.getUnit()).orElse("") );
+        }
+        return val;
+    }*/
+
+    public void setVal(String val) {
+        this.val = val;
+    }
+
+    /**
+     * 设备类型
+     *
+     * @return
+     */
+    @Override
+    protected HardwareType hardwareType() {
+        return senseType;
+    }
+}

+ 38 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/SubFunction.java

@@ -0,0 +1,38 @@
+package com.zd.laboratory.api.vo;
+
+
+import com.zd.laboratory.api.entity.BasicFunctionStatus;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.List;
+
+/**
+ * @Author: zhoupan
+ * @Date: 2021/10/09/10:21
+ * @Description:
+ */
+@ApiModel("实验室功能点")
+public class SubFunction<T extends BasicFunctionStatus> {
+    @ApiModelProperty("实验室ID")
+    private Long subId;
+
+    private List< T > functionStatuses;
+
+
+    public Long getSubId() {
+        return subId;
+    }
+
+    public SubFunction setSubId(Long subId) {
+        this.subId = subId;
+        return this;
+    }
+
+    public List<T> getFunctionStatuses() {
+        return functionStatuses;
+    }
+
+    public void setFunctionStatuses(List<T> functionStatuses) {
+        this.functionStatuses = functionStatuses;
+    }
+}

+ 17 - 0
zd-api/zd-system-api/pom.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>zd-api</artifactId>
+        <groupId>com.zd</groupId>
+        <version>3.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.zd.system</groupId>
+    <artifactId>zd-system-api</artifactId>
+    <packaging>jar</packaging>
+    <description>system-api</description>
+
+</project>

+ 174 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysDictData.java

@@ -0,0 +1,174 @@
+package com.zd.system.api.entity;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.annotation.Excel.ColumnType;
+import com.zd.model.entity.BaseEntity;
+import com.zd.model.constant.UserConstants;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
+/**
+ * 字典数据表 sys_dict_data
+ *
+ * @author zd
+ */
+public class SysDictData extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 字典编码
+     */
+    @Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
+    private Long dictCode;
+
+    /**
+     * 字典排序
+     */
+    @Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
+    private Long dictSort;
+
+    /**
+     * 字典标签
+     */
+    @Excel(name = "字典标签")
+    private String dictLabel;
+
+    /**
+     * 字典键值
+     */
+    @Excel(name = "字典键值")
+    private String dictValue;
+
+    /**
+     * 字典类型
+     */
+    @Excel(name = "字典类型")
+    private String dictType;
+
+    /**
+     * 样式属性(其他样式扩展)
+     */
+    private String cssClass;
+
+    /**
+     * 表格字典样式
+     */
+    private String listClass;
+
+    /**
+     * 是否默认(Y是 N否)
+     */
+    @Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
+    private String isDefault;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    public Long getDictCode() {
+        return dictCode;
+    }
+
+    public void setDictCode(Long dictCode) {
+        this.dictCode = dictCode;
+    }
+
+    public Long getDictSort() {
+        return dictSort;
+    }
+
+    public void setDictSort(Long dictSort) {
+        this.dictSort = dictSort;
+    }
+
+    @NotBlank(message = "字典标签不能为空")
+    @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
+    public String getDictLabel() {
+        return dictLabel;
+    }
+
+    public void setDictLabel(String dictLabel) {
+        this.dictLabel = dictLabel;
+    }
+
+    @NotBlank(message = "字典键值不能为空")
+    @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
+    public String getDictValue() {
+        return dictValue;
+    }
+
+    public void setDictValue(String dictValue) {
+        this.dictValue = dictValue;
+    }
+
+    @NotBlank(message = "字典类型不能为空")
+    @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
+    public String getDictType() {
+        return dictType;
+    }
+
+    public void setDictType(String dictType) {
+        this.dictType = dictType;
+    }
+
+    @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
+    public String getCssClass() {
+        return cssClass;
+    }
+
+    public void setCssClass(String cssClass) {
+        this.cssClass = cssClass;
+    }
+
+    public String getListClass() {
+        return listClass;
+    }
+
+    public void setListClass(String listClass) {
+        this.listClass = listClass;
+    }
+
+    public boolean getDefault() {
+        return UserConstants.YES.equals(this.isDefault) ? true : false;
+    }
+
+    public String getIsDefault() {
+        return isDefault;
+    }
+
+    public void setIsDefault(String isDefault) {
+        this.isDefault = isDefault;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("dictCode", getDictCode())
+                .append("dictSort", getDictSort())
+                .append("dictLabel", getDictLabel())
+                .append("dictValue", getDictValue())
+                .append("dictType", getDictType())
+                .append("cssClass", getCssClass())
+                .append("listClass", getListClass())
+                .append("isDefault", getIsDefault())
+                .append("status", getStatus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 93 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysDictType.java

@@ -0,0 +1,93 @@
+package com.zd.system.api.entity;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.annotation.Excel.ColumnType;
+import com.zd.model.entity.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
+/**
+ * 字典类型表 sys_dict_type
+ *
+ * @author zd
+ */
+public class SysDictType extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 字典主键
+     */
+    @Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
+    private Long dictId;
+
+    /**
+     * 字典名称
+     */
+    @Excel(name = "字典名称")
+    private String dictName;
+
+    /**
+     * 字典类型
+     */
+    @Excel(name = "字典类型")
+    private String dictType;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    public Long getDictId() {
+        return dictId;
+    }
+
+    public void setDictId(Long dictId) {
+        this.dictId = dictId;
+    }
+
+    @NotBlank(message = "字典名称不能为空")
+    @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
+    public String getDictName() {
+        return dictName;
+    }
+
+    public void setDictName(String dictName) {
+        this.dictName = dictName;
+    }
+
+    @NotBlank(message = "字典类型不能为空")
+    @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
+    public String getDictType() {
+        return dictType;
+    }
+
+    public void setDictType(String dictType) {
+        this.dictType = dictType;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("dictId", getDictId())
+                .append("dictName", getDictName())
+                .append("dictType", getDictType())
+                .append("status", getStatus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 113 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysLogininfor.java

@@ -0,0 +1,113 @@
+package com.zd.system.api.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.model.annotation.Excel;
+import com.zd.model.annotation.Excel.ColumnType;
+import com.zd.model.entity.BaseEntity;
+import java.util.Date;
+
+/**
+ * 系统访问记录表 sys_logininfor
+ *
+ * @author zd
+ */
+public class SysLogininfor extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Excel(name = "序号", cellType = ColumnType.NUMERIC)
+    private Long infoId;
+
+    /**
+     * 用户账号
+     */
+    @Excel(name = "用户账号")
+    private String userName;
+
+    /**
+     * 状态 0成功 1失败
+     */
+    @Excel(name = "状态", readConverterExp = "0=成功,1=失败")
+    private String status;
+
+    /**
+     * 地址
+     */
+    @Excel(name = "地址")
+    private String ipaddr;
+
+    /**
+     * 描述
+     */
+    @Excel(name = "描述")
+    private String msg;
+
+    /**
+     * 访问时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date accessTime;
+
+    private Long userId;
+
+    @Override
+    public Long getUserId() {
+        return userId;
+    }
+
+    @Override
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getInfoId() {
+        return infoId;
+    }
+
+    public void setInfoId(Long infoId) {
+        this.infoId = infoId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getIpaddr() {
+        return ipaddr;
+    }
+
+    public void setIpaddr(String ipaddr) {
+        this.ipaddr = ipaddr;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Date getAccessTime() {
+        return accessTime;
+    }
+
+    public void setAccessTime(Date accessTime) {
+        this.accessTime = accessTime;
+    }
+}

+ 253 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysOperLog.java

@@ -0,0 +1,253 @@
+package com.zd.system.api.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.model.annotation.Excel;
+import com.zd.model.annotation.Excel.ColumnType;
+import com.zd.model.entity.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * 操作日志记录表 oper_log
+ *
+ * @author zd
+ */
+public class SysOperLog extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 日志主键
+     */
+    @Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
+    private Long operId;
+
+    /**
+     * 操作模块
+     */
+    @Excel(name = "操作模块")
+    private String title;
+
+    /**
+     * 业务类型(0其它 1新增 2修改 3删除)
+     */
+    @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
+    private Integer businessType;
+
+    /**
+     * 业务类型数组
+     */
+    private Integer[] businessTypes;
+
+    /**
+     * 请求方法
+     */
+    @Excel(name = "请求方法")
+    private String method;
+
+    /**
+     * 请求方式
+     */
+    @Excel(name = "请求方式")
+    private String requestMethod;
+
+    /**
+     * 操作类别(0其它 1后台用户 2手机端用户)
+     */
+    @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
+    private Integer operatorType;
+
+    /**
+     * 操作人员
+     */
+    @Excel(name = "操作人员")
+    private String operName;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /**
+     * 请求url
+     */
+    @Excel(name = "请求地址")
+    private String operUrl;
+
+    /**
+     * 操作地址
+     */
+    @Excel(name = "操作地址")
+    private String operIp;
+
+    /**
+     * 请求参数
+     */
+    @Excel(name = "请求参数")
+    private String operParam;
+
+    /**
+     * 返回参数
+     */
+    @Excel(name = "返回参数")
+    private String jsonResult;
+
+    /**
+     * 操作状态(0正常 1异常)
+     */
+    @Excel(name = "状态", readConverterExp = "0=正常,1=异常")
+    private Integer status;
+
+    /**
+     * 错误消息
+     */
+    @Excel(name = "错误消息")
+    private String errorMsg;
+
+    /**
+     * 操作时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date operTime;
+
+    private Long userId;
+
+    @Override
+    public Long getUserId() {
+        return userId;
+    }
+
+    @Override
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getOperId() {
+        return operId;
+    }
+
+    public void setOperId(Long operId) {
+        this.operId = operId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Integer getBusinessType() {
+        return businessType;
+    }
+
+    public void setBusinessType(Integer businessType) {
+        this.businessType = businessType;
+    }
+
+    public Integer[] getBusinessTypes() {
+        return businessTypes;
+    }
+
+    public void setBusinessTypes(Integer[] businessTypes) {
+        this.businessTypes = businessTypes;
+    }
+
+    public String getMethod() {
+        return method;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    public String getRequestMethod() {
+        return requestMethod;
+    }
+
+    public void setRequestMethod(String requestMethod) {
+        this.requestMethod = requestMethod;
+    }
+
+    public Integer getOperatorType() {
+        return operatorType;
+    }
+
+    public void setOperatorType(Integer operatorType) {
+        this.operatorType = operatorType;
+    }
+
+    public String getOperName() {
+        return operName;
+    }
+
+    public void setOperName(String operName) {
+        this.operName = operName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getOperUrl() {
+        return operUrl;
+    }
+
+    public void setOperUrl(String operUrl) {
+        this.operUrl = operUrl;
+    }
+
+    public String getOperIp() {
+        return operIp;
+    }
+
+    public void setOperIp(String operIp) {
+        this.operIp = operIp;
+    }
+
+    public String getOperParam() {
+        return operParam;
+    }
+
+    public void setOperParam(String operParam) {
+        this.operParam = operParam;
+    }
+
+    public String getJsonResult() {
+        return jsonResult;
+    }
+
+    public void setJsonResult(String jsonResult) {
+        this.jsonResult = jsonResult;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getErrorMsg() {
+        return errorMsg;
+    }
+
+    public void setErrorMsg(String errorMsg) {
+        this.errorMsg = errorMsg;
+    }
+
+    public Date getOperTime() {
+        return operTime;
+    }
+
+    public void setOperTime(Date operTime) {
+        this.operTime = operTime;
+    }
+}

+ 387 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserStudent.java

@@ -0,0 +1,387 @@
+package com.zd.system.api.entity;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import com.zd.model.entity.SysDept;
+import com.zd.model.entity.SysRole;
+
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 用户对象 sys_user
+ *
+ * @author zd
+ */
+public class SysUserStudent extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    private Long userId;
+
+    private Long deptId;
+
+    private String userType;
+
+    /**
+     * 用户昵称
+     */
+    @Excel(name = "姓名")
+    private String nickName;
+    /**
+     * 用户账号
+     */
+    @Excel(name = "学号")
+    private String userName;
+    /**
+     * 手机号码
+     */
+    @Excel(name = "联系方式")
+    private String phonenumber;
+    @Excel(name = "所属院系")
+    private String deptName;
+    /**
+     * 专业
+     */
+    @Excel(name = "专业")
+    private String major;
+    /**
+     * 年级
+     */
+    @Excel(name = "年级")
+    private String grade;
+    /**
+     * 类别(1 博士,2 硕士)
+     */
+    @Excel(name = "类别")
+    private String category;
+    /**
+     * 导师名称
+     */
+    @Excel(name = "导师")
+    private String tutorUserName;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+
+    /**
+     * 用户性别
+     */
+    private String sex;
+
+    /**
+     * 用户头像
+     */
+    private String avatar;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 帐号状态(0正常 1停用)
+     */
+    private String status;
+
+    /**
+     * 删除标志(0代表存在 2代表删除)
+     */
+    private String delFlag;
+
+    /**
+     * 最后登录IP
+     */
+    private String loginIp;
+
+    /**
+     * 最后登录时间
+     */
+    private Date loginDate;
+
+    /**
+     * 部门对象
+     */
+    private SysDept dept;
+
+    /**
+     * 角色对象
+     */
+    private List<SysRole> roles;
+
+    /**
+     * 角色组
+     */
+    private Long[] roleIds;
+
+    /**
+     * 岗位组
+     */
+    private Long[] postIds;
+
+    /**
+     * 角色ID
+     */
+    private Long roleId;
+
+    /**
+     * 关联导师id
+     */
+    private Integer tutorUserId;
+
+    /**
+     * 职称(教授,助教)
+     */
+    private String position;
+    /**
+     * 工作性质(0,非在编  1,在编)
+     */
+    private String nature;
+
+
+    public SysUserStudent() {
+
+    }
+
+    public SysUserStudent(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public boolean isAdmin() {
+        return isAdmin(this.userId);
+    }
+
+    public static boolean isAdmin(Long userId) {
+        return userId != null && 1L == userId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    @NotBlank(message = "用户账号不能为空")
+    @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    @Email(message = "邮箱格式不正确")
+    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    @JsonProperty
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getLoginIp() {
+        return loginIp;
+    }
+
+    public void setLoginIp(String loginIp) {
+        this.loginIp = loginIp;
+    }
+
+    public Date getLoginDate() {
+        return loginDate;
+    }
+
+    public void setLoginDate(Date loginDate) {
+        this.loginDate = loginDate;
+    }
+
+    public SysDept getDept() {
+        return dept;
+    }
+
+    public void setDept(SysDept dept) {
+        this.dept = dept;
+    }
+
+    public List<SysRole> getRoles() {
+        return roles;
+    }
+
+    public void setRoles(List<SysRole> roles) {
+        this.roles = roles;
+    }
+
+    public Long[] getRoleIds() {
+        return roleIds;
+    }
+
+    public void setRoleIds(Long[] roleIds) {
+        this.roleIds = roleIds;
+    }
+
+    public Long[] getPostIds() {
+        return postIds;
+    }
+
+    public void setPostIds(Long[] postIds) {
+        this.postIds = postIds;
+    }
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
+    public String getMajor() {
+        return major;
+    }
+
+    public void setMajor(String major) {
+        this.major = major;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public Integer getTutorUserId() {
+        return tutorUserId;
+    }
+
+    public void setTutorUserId(Integer tutorUserId) {
+        this.tutorUserId = tutorUserId;
+    }
+
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    public String getNature() {
+        return nature;
+    }
+
+    public void setNature(String nature) {
+        this.nature = nature;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    public String getTutorUserName() {
+        return tutorUserName;
+    }
+
+    public void setTutorUserName(String tutorUserName) {
+        this.tutorUserName = tutorUserName;
+    }
+
+    @Override
+    public String getDeptName() {
+        return deptName;
+    }
+
+    @Override
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+}

+ 210 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserStudentByExcel.java

@@ -0,0 +1,210 @@
+package com.zd.system.api.entity;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.annotation.Excel.Type;
+import java.util.Date;
+
+/**
+ * 用户对象 sys_user
+ *
+ * @author zd
+ */
+public class SysUserStudentByExcel {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 姓名
+     */
+    @Excel(name = "姓名" ,type = Type.ALL, isRequired=true)
+    private String nickName;
+
+    /**
+     * 工号
+     */
+    @Excel(name = "学号" ,type = Type.ALL, isRequired=true)
+    private String userName;
+
+    /**
+     * 所属学院
+     */
+    @Excel(name = "所属学院" ,type = Type.ALL, isRequired=true)
+    private String deptName;
+
+    /**
+     * 专业
+     */
+    @Excel(name = "专业",type = Type.ALL, isRequired=true)
+    private String major;
+
+    /**
+     * 手机号码
+     */
+    @Excel(name = "手机号码" ,type = Type.ALL, isRequired=true)
+    private String phonenumber;
+
+    /**
+     * 邮箱
+     */
+    @Excel(name = "邮箱" ,type = Type.ALL)
+    private String email;
+
+    /**
+     * 性别
+     */
+    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知" ,type = Type.ALL)
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    @Excel(name = "出生日期" ,type = Type.ALL,dateFormat = "yyyy-MM-dd")
+    private Date dateBirth;
+
+
+    /**
+     * 校园卡号
+     */
+    @Excel(name = "校园卡号" ,type = Type.ALL)
+    private String cardNum;
+
+    /**
+     * 导师名称
+     */
+    @Excel(name = "导师",type = Type.ALL)
+    private String tutorUserName;
+
+    /**
+     * 导师用户id
+     */
+    private Long tutorUserId;
+
+    /**
+     * 备注,用于记录错误的原因
+     */
+    @Excel(name = "备注" ,type = Type.EXPORT)
+    private StringBuffer failRemark = new StringBuffer();
+
+    /**
+     * 是否启用账户
+     */
+    private Boolean sysUserEnable;
+
+    /**
+     * 是否更新数据
+     */
+    private Boolean upDate;
+
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public Date getDateBirth() {
+        return dateBirth;
+    }
+
+    public void setDateBirth(Date dateBirth) {
+        this.dateBirth = dateBirth;
+    }
+
+    public String getCardNum() {
+        return cardNum;
+    }
+
+    public void setCardNum(String cardNum) {
+        this.cardNum = cardNum;
+    }
+
+    public StringBuffer getFailRemark() {
+        return failRemark;
+    }
+
+    public void setFailRemark(StringBuffer failRemark) {
+        this.failRemark = failRemark;
+    }
+
+    public Boolean getSysUserEnable() {
+        return sysUserEnable;
+    }
+
+    public void setSysUserEnable(Boolean sysUserEnable) {
+        this.sysUserEnable = sysUserEnable;
+    }
+
+    public Boolean getUpDate() {
+        return upDate;
+    }
+
+    public void setUpDate(Boolean upDate) {
+        this.upDate = upDate;
+    }
+
+    public String getMajor() {
+        return major;
+    }
+
+    public void setMajor(String major) {
+        this.major = major;
+    }
+
+    public String getTutorUserName() {
+        return tutorUserName;
+    }
+
+    public void setTutorUserName(String tutorUserName) {
+        this.tutorUserName = tutorUserName;
+    }
+
+    public Long getTutorUserId() {
+        return tutorUserId;
+    }
+
+    public void setTutorUserId(Long tutorUserId) {
+        this.tutorUserId = tutorUserId;
+    }
+
+}

+ 202 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserStudentByExport.java

@@ -0,0 +1,202 @@
+package com.zd.system.api.entity;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.annotation.Excel.Type;
+import com.zd.model.entity.SysUser;
+import org.springframework.beans.BeanUtils;
+import java.text.SimpleDateFormat;
+
+/**
+ * 用户对象 sys_user
+ *
+ * @author zd
+ */
+public class SysUserStudentByExport {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 姓名
+     */
+    @Excel(name = "姓名" ,type = Type.EXPORT)
+    private String nickName;
+
+    /**
+     * 学号
+     */
+    @Excel(name = "学号" ,type = Type.EXPORT)
+    private String userName;
+
+    /**
+     * 所属学院
+     */
+    @Excel(name = "所属学院" ,type = Type.EXPORT)
+    private String deptName;
+
+    /**
+     * 专业
+     */
+    @Excel(name = "专业",type = Type.EXPORT)
+    private String major;
+
+    /**
+     * 手机号码
+     */
+    @Excel(name = "手机号码" ,type = Type.EXPORT)
+    private String phonenumber;
+
+    /**
+     * 邮箱
+     */
+    @Excel(name = "邮箱" ,type = Type.EXPORT)
+    private String email;
+
+    /**
+     * 班级
+     */
+    @Excel(name = "班级" ,type = Type.EXPORT)
+    private String grade;
+
+
+    /**
+     * 性别
+     */
+    @Excel(name = "性别" ,type = Type.EXPORT)
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    @Excel(name = "出生日期" ,type = Type.EXPORT)
+    private String dateBirth;
+
+    /**
+     * 校园卡号
+     */
+    @Excel(name = "校园卡号" ,type = Type.EXPORT)
+    private String cardNum;
+
+    /**
+     * 导师名称
+     */
+    @Excel(name = "导师",type = Type.EXPORT)
+    private String tutorUserName;
+
+    /**
+     * 学籍状态
+     */
+    @Excel(name = "状态" ,type = Type.EXPORT)
+    private String workStatus;
+
+    public SysUserStudentByExport(SysUser sysUser) {
+        BeanUtils.copyProperties(sysUser, this);
+        if(sysUser.getSex() != null && sysUser.getSex().equals("0")){
+            this.sex = "男";
+        }else if(sysUser.getSex() != null && sysUser.getSex().equals("1")){
+            this.sex = "女";
+        }else{
+            this.sex = "未知";
+        }
+        if(sysUser.getDateBirth() != null){
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            this.setDateBirth(sdf.format(sysUser.getDateBirth()));
+        }
+        this.grade = sysUser.getGradeName();
+        this.deptName = sysUser.getDept() == null ? null : sysUser.getDept().getDeptName();
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getMajor() {
+        return major;
+    }
+
+    public void setMajor(String major) {
+        this.major = major;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getDateBirth() {
+        return dateBirth;
+    }
+
+    public void setDateBirth(String dateBirth) {
+        this.dateBirth = dateBirth;
+    }
+
+    public String getCardNum() {
+        return cardNum;
+    }
+
+    public void setCardNum(String cardNum) {
+        this.cardNum = cardNum;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getTutorUserName() {
+        return tutorUserName;
+    }
+
+    public void setTutorUserName(String tutorUserName) {
+        this.tutorUserName = tutorUserName;
+    }
+
+    public String getWorkStatus() {
+        return workStatus;
+    }
+
+    public void setWorkStatus(String workStatus) {
+        this.workStatus = workStatus;
+    }
+}

+ 181 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserTeaCherByExcel.java

@@ -0,0 +1,181 @@
+package com.zd.system.api.entity;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.annotation.Excel.Type;
+import java.util.Date;
+
+/**
+ * 用户对象 sys_user
+ *
+ * @author zd
+ */
+public class SysUserTeaCherByExcel {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 姓名
+     */
+    @Excel(name = "姓名" ,type = Excel.Type.ALL, isRequired=true)
+    private String nickName;
+
+    /**
+     * 工号
+     */
+    @Excel(name = "工号" ,type = Excel.Type.ALL, isRequired=true)
+    private String userName;
+
+    /**
+     * 所在部门
+     */
+    @Excel(name = "所在部门" ,type = Excel.Type.ALL, isRequired=true)
+    private String deptName;
+
+    /**
+     * 身份
+     */
+    @Excel(name = "身份" ,type = Excel.Type.ALL, isRequired=true)
+    private String pistionName;
+
+    /**
+     * 手机号码
+     */
+    @Excel(name = "手机号码" ,type = Excel.Type.ALL, isRequired=true)
+    private String phonenumber;
+
+    /**
+     * 邮箱
+     */
+    @Excel(name = "邮箱" ,type = Excel.Type.ALL)
+    private String email;
+
+    /**
+     * 性别
+     */
+    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知" ,type = Excel.Type.ALL)
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    @Excel(name = "出生日期" ,type = Excel.Type.ALL ,dateFormat = "yyyy-MM-dd")
+    private Date dateBirth;
+
+    /**
+     * 校园卡号
+     */
+    @Excel(name = "校园卡号" ,type = Excel.Type.ALL)
+    private String cardNum;
+
+    /**
+     * 备注,用于记录错误的原因
+     */
+    @Excel(name = "备注" ,type = Excel.Type.EXPORT)
+    private StringBuffer failRemark = new StringBuffer();
+
+    /**
+     * 是否启用账户
+     */
+    private Boolean sysUserEnable;
+
+    /**
+     * 是否更新数据
+     */
+    private Boolean upDate;
+
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getPistionName() {
+        return pistionName;
+    }
+
+    public void setPistionName(String pistionName) {
+        this.pistionName = pistionName;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public Date getDateBirth() {
+        return dateBirth;
+    }
+
+    public void setDateBirth(Date dateBirth) {
+        this.dateBirth = dateBirth;
+    }
+
+    public String getCardNum() {
+        return cardNum;
+    }
+
+    public void setCardNum(String cardNum) {
+        this.cardNum = cardNum;
+    }
+
+    public StringBuffer getFailRemark() {
+        return failRemark;
+    }
+
+    public void setFailRemark(StringBuffer failRemark) {
+        this.failRemark = failRemark;
+    }
+
+    public Boolean getSysUserEnable() {
+        return sysUserEnable;
+    }
+
+    public void setSysUserEnable(Boolean sysUserEnable) {
+        this.sysUserEnable = sysUserEnable;
+    }
+
+    public Boolean getUpDate() {
+        return upDate;
+    }
+
+    public void setUpDate(Boolean upDate) {
+        this.upDate = upDate;
+    }
+}

+ 207 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/entity/SysUserTeaCherByExport.java

@@ -0,0 +1,207 @@
+package com.zd.system.api.entity;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.annotation.Excel.Type;
+import com.zd.model.entity.SysUser;
+import org.springframework.beans.BeanUtils;
+import java.text.SimpleDateFormat;
+
+/**
+ * 用户对象 sys_user
+ *
+ * @author zd
+ */
+public class SysUserTeaCherByExport {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 姓名
+     */
+    @Excel(name = "姓名" ,type = Type.EXPORT, isRequired=true)
+    private String nickName;
+
+    /**
+     * 工号
+     */
+    @Excel(name = "工号" ,type = Type.EXPORT, isRequired=true)
+    private String userName;
+
+    /**
+     * 所在部门
+     */
+    @Excel(name = "所在部门" ,type = Type.EXPORT, isRequired=true)
+    private String deptName;
+
+    /**
+     * 身份
+     */
+    @Excel(name = "身份" ,type = Type.EXPORT, isRequired=true)
+    private String positionName;
+
+    /**
+     * 手机号码
+     */
+    @Excel(name = "手机号码" ,type = Type.EXPORT)
+    private String phonenumber;
+
+    /**
+     * 邮箱
+     */
+    @Excel(name = "邮箱" ,type = Type.EXPORT)
+    private String email;
+
+    /**
+     * 职称
+     */
+    @Excel(name = "职称" ,type = Type.EXPORT)
+    private String category;
+
+    /**
+     * 文化程度
+     */
+    @Excel(name = "文化程度" ,type = Type.EXPORT)
+    private String education;
+
+    /**
+     * 性别
+     */
+    @Excel(name = "性别" ,type = Type.EXPORT)
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    @Excel(name = "出生日期" ,type = Type.EXPORT)
+    private String dateBirth;
+
+    /**
+     * 校园卡号
+     */
+    @Excel(name = "校园卡号" ,type = Type.EXPORT)
+    private String cardNum;
+
+    /**
+     * 在职状态
+     */
+    @Excel(name = "在职状态" ,type = Type.EXPORT)
+    private String nature;
+
+
+    public SysUserTeaCherByExport(SysUser sysUser) {
+        BeanUtils.copyProperties(sysUser, this);
+        if(sysUser.getSex() != null && sysUser.getSex().equals("0")){
+            this.sex = "男";
+        }else if(sysUser.getSex() != null && sysUser.getSex().equals("1")){
+            this.sex = "女";
+        }else{
+            this.sex = "未知";
+        }
+        if(sysUser.getDateBirth() != null){
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            this.setDateBirth(sdf.format(sysUser.getDateBirth()));
+        }
+        if(sysUser.getNature() != null && sysUser.getNature().equals("0")){
+            this.nature = "在职";
+        }else{
+            this.nature = "离职";
+        }
+
+        this.deptName = sysUser.getDept() == null ? null : sysUser.getDept().getDeptName();
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getPositionName() {
+        return positionName;
+    }
+
+    public void setPositionName(String positionName) {
+        this.positionName = positionName;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getDateBirth() {
+        return dateBirth;
+    }
+
+    public void setDateBirth(String dateBirth) {
+        this.dateBirth = dateBirth;
+    }
+
+    public String getCardNum() {
+        return cardNum;
+    }
+
+    public void setCardNum(String cardNum) {
+        this.cardNum = cardNum;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getEducation() {
+        return education;
+    }
+
+    public void setEducation(String education) {
+        this.education = education;
+    }
+
+    public String getNature() {
+        return nature;
+    }
+
+    public void setNature(String nature) {
+        this.nature = nature;
+    }
+}

+ 40 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteLogService.java

@@ -0,0 +1,40 @@
+package com.zd.system.api.feign;
+
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.constant.SecurityConstants;
+import com.zd.model.domain.R;
+import com.zd.system.api.entity.SysLogininfor;
+import com.zd.system.api.entity.SysOperLog;
+import com.zd.system.api.feign.factory.RemoteLogFallback;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+
+/**
+ * 日志服务
+ *
+ * @author zd
+ */
+@FeignClient(contextId = "remoteLogService", value = ApplicationConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallback.class)
+public interface RemoteLogService {
+    /**
+     * 保存系统日志
+     *
+     * @param sysOperLog 日志实体
+     * @param source     请求来源
+     * @return 结果
+     */
+    @PostMapping("/operlog")
+    public R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+    /**
+     * 保存访问记录
+     *
+     * @param sysLogininfor 访问实体
+     * @param source        请求来源
+     * @return 结果
+     */
+    @PostMapping("/logininfor")
+    public R<Boolean> saveLogininfor(@RequestBody SysLogininfor sysLogininfor, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+}

+ 47 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteStockService.java

@@ -0,0 +1,47 @@
+package com.zd.system.api.feign;
+
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.domain.R;
+import com.zd.model.entity.InventoryTag;
+import com.zd.system.api.feign.factory.RemoteStockFallback;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+import javax.validation.constraints.NotNull;
+
+/**
+ * 化学品库存
+ */
+@FeignClient(contextId = "remoteStockService", value = ApplicationConstants.CHEMICAL_SERVICE, fallbackFactory = RemoteStockFallback.class)
+public interface RemoteStockService {
+
+
+    @PostMapping(value = "/hxpStock/RFIDCheck")
+    public R<Boolean> rfidCheck(@RequestBody InventoryTag tag);
+
+    @GetMapping(value = "/hxpStock/expireCheck")
+    public void expireCheck();
+
+    @GetMapping(value = "/hxpUserecord/checkOvertime")
+    public void checkOvertime();
+
+    @PostMapping("/hxpChemical/indicatorMonitoring")
+    public void indicatorMonitoring();
+
+    @GetMapping(value = "/hxpUserecord/queryUplink")
+    public void queryUplinkResult();
+
+    @GetMapping(value = "/hxpStock/sendSydSms")
+    public R sendSydSms(@RequestParam(value = "content") String content,
+                        @RequestParam(value = "purpose") Integer purpose,
+                        @RequestParam(value = "lockApplyId", required = false) Long lockApplyId,
+                        @RequestParam(value = "phones") @NotNull String... phones);
+
+    /**
+     * 四医大短信告警方案阶梯式通知流程
+     */
+    @GetMapping("/hxpAlarmRecord/sendPhoneBySyd")
+    public void sendPhoneBySyd();
+}

+ 198 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteUserService.java

@@ -0,0 +1,198 @@
+package com.zd.system.api.feign;
+
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.constant.SecurityConstants;
+import com.zd.model.domain.AjaxResult;
+import com.zd.model.domain.R;
+import com.zd.model.entity.LoginUser;
+import com.zd.model.entity.SysUser;
+import com.zd.system.api.feign.factory.RemoteUserFallback;
+import com.zd.system.api.vo.SimpleUserVO;
+import com.zd.system.api.vo.SysLogoConfigVO;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import java.util.List;
+
+/**
+ * 用户服务
+ *
+ * @author zd
+ */
+@FeignClient(contextId = "remoteUserService", value = ApplicationConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallback.class)
+public interface RemoteUserService {
+    /**
+     * 通过用户名查询用户信息
+     *
+     * @param username 用户名
+     * @param source   请求来源
+     * @return 结果
+     */
+    @GetMapping("/user/info/{username}")
+    R<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+    /**
+     * 通过用户名查询用户信息
+     *
+     * @param username 用户名
+     * @param source   请求来源
+     * @return 结果
+     */
+    @GetMapping("/user/info/{username}/{loginType}")
+     R<LoginUser> getUserInfo(@PathVariable("username") String username, @PathVariable("loginType") Integer loginType,
+                                    @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+    /**
+     * 通过用户ID查询用户信息
+     *
+     * @param id     用户id
+     * @param source 请求来源
+     * @return 结果
+     */
+    @GetMapping("/user/info/id/{id}")
+     R<SysUser> getUserInfoByUserId(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+
+    /**
+     * 通过用户账户查询用户信息
+     *
+     * @param userName 用户账户
+     * @param source   请求来源
+     * @return 结果
+     */
+    @GetMapping("/user/info/username/{username}")
+     R<SysUser> getUserInfoByUserName(@PathVariable("username") String userName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+    /**
+     * 通过用户卡号查询用户信息
+     *
+     * @param cardnum 用户账户
+     * @param source   请求来源
+     * @return 结果
+     */
+    @GetMapping("/user/info/cardnum/{cardnum}")
+     R<SysUser> getUserInfoByCardNum(@PathVariable("cardnum")String cardnum, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+    /**
+     * 注册用户信息
+     *
+     * @param sysUser 用户信息
+     * @param source  请求来源
+     * @return 结果
+     */
+    @PostMapping("/user/register")
+     R<Boolean> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+
+    @GetMapping("/user/my/info/Simple")
+     R<SimpleUserVO> myInfoSimple(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+    /**
+     * 获取所有可用户IDS
+     *
+     * @return 结果
+     */
+    @GetMapping("/user/all")
+     R<List<Long>> userALLIDS(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+
+    /**
+     * 根据用户ids获取电话
+     *
+     * @return 结果
+     */
+    @GetMapping("/user/phone/{ids}")
+     R<List<String>> getPhoneByUserIDS(@PathVariable("ids") String ids);
+    /**
+     * 获取指定院系用户IDS
+     *
+     * @param deptId
+     * @return 结果
+     */
+    @GetMapping("/user/dept/{deptIds}")
+     R<List<Long>> userDeptIDS(@PathVariable("deptIds") String deptId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+
+    /**
+     * 小程序查询院系列表(用户端,管理端)
+     */
+    @ApiOperation(value = "小程序查询院系列表(用户端,管理端)")
+    @GetMapping(value = "/dept/departments/list")
+     R<Object> departmentsList();
+
+
+    /**
+     * 小程序查询院系下楼栋列表(用户端,管理端)
+     */
+    @ApiOperation(value = "小程序查询院系下楼栋列表(用户端,管理端)")
+    @GetMapping(value = "/dept/{deptId}/building/list")
+     R<Object> building(@PathVariable("deptId") Long deptId);
+
+    /**
+     * 登录查询大屏用户的路由菜单
+     */
+    @GetMapping("/menu/getRouterById/{userId}")
+    AjaxResult getRouters(@PathVariable("userId") Long userId);
+
+    /**
+     * 大屏用户权限判断
+     */
+    @GetMapping("/role/authUser/power")
+     AjaxResult selectAuthUserPower(@RequestParam("userId") Long userId);
+
+    /**
+     * 修改学生信息
+     */
+    @PutMapping("/user/student")
+     AjaxResult editUser(@RequestBody SysUser user);
+
+    /**
+     * 修改学生信息
+     */
+    @PutMapping("/user/student/editStudent")
+     AjaxResult editStudent(@RequestBody SysUser user);
+
+    @PostMapping(value = "/user/updateSignature", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+     R updateSignature(@RequestPart("file") MultipartFile file);
+
+
+    /**
+     * 获取用户默认密码
+     */
+    @GetMapping("/config/configKey/{configKey}")
+     AjaxResult getConfigKey(@PathVariable("configKey") String configKey);
+
+    @PostMapping("/user/querySignature")
+    R querySignature();
+
+
+    /**
+     * 获取用户默认密码
+     */
+    @GetMapping("/logo/config/getLogoInfo")
+     R<SysLogoConfigVO> getConfigLogo();
+
+    @DeleteMapping("/user/{userIds}")
+    AjaxResult remove(@PathVariable("userIds") Long[] userIds);
+
+    /**
+     * 获取当前登录用户所属学校以及院系id集合
+     * @return
+     */
+    @GetMapping("/user/getLogingUserDeptids")
+    R<List<Long>> getLogingUserDeptids();
+
+    /**
+     * 获取当前登录用户所属学校的deptid
+     * @return
+     */
+    @GetMapping("/user/getLoginUserSchoolDeptid")
+    R<Long> getLoginUserSchoolDeptid();
+
+    /***
+     * 根据电话查询用户信息
+     * @param phone
+     * @return
+     */
+    @RequestMapping("/user/getUserByPhone/{phone}")
+    R<SysUser> getUserByPhone(@PathVariable("phone") String phone);
+}

+ 37 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteLogFallback.java

@@ -0,0 +1,37 @@
+package com.zd.system.api.feign.factory;
+
+import com.zd.model.domain.R;
+import com.zd.system.api.entity.SysLogininfor;
+import com.zd.system.api.entity.SysOperLog;
+import com.zd.system.api.feign.RemoteLogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * 日志服务降级处理
+ *
+ * @author zd
+ */
+@Component
+public class RemoteLogFallback implements FallbackFactory<RemoteLogService> {
+    private static final Logger log = LoggerFactory.getLogger(RemoteLogFallback.class);
+
+    @Override
+    public RemoteLogService create(Throwable throwable) {
+        log.error("日志服务调用失败:{}", throwable.getMessage());
+        return new RemoteLogService() {
+            @Override
+            public R<Boolean> saveLog(SysOperLog sysOperLog, String source) {
+                return R.fail("日志存储失败:"+throwable.getMessage());
+            }
+
+            @Override
+            public R<Boolean> saveLogininfor(SysLogininfor sysLogininfor, String source) {
+                return null;
+            }
+        };
+
+    }
+}

+ 62 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteStockFallback.java

@@ -0,0 +1,62 @@
+package com.zd.system.api.feign.factory;
+
+
+import com.zd.model.domain.R;
+import com.zd.model.entity.InventoryTag;
+import com.zd.system.api.feign.RemoteStockService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author Administrator
+ */
+@Component
+public class RemoteStockFallback implements FallbackFactory<RemoteStockService> {
+    private static final Logger logger = LoggerFactory.getLogger(RemoteStockFallback.class);
+
+    @Override
+    public RemoteStockService create(Throwable throwable) {
+        logger.error("化学品服务调用失败:{}", throwable.getMessage());
+        return new RemoteStockService() {
+            @Override
+            public R<Boolean> rfidCheck(InventoryTag tag) {
+                logger.error("保存调用失败:{}" ,throwable.getMessage());
+                return R.fail("保存调用失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public void expireCheck() {
+                logger.error("化学品库存过期调度失败:{}" ,throwable.getMessage());
+            }
+
+            @Override
+            public void checkOvertime() {
+                logger.error("化学品领用超时调度失败:{}" ,throwable.getMessage());
+            }
+
+            @Override
+            public void indicatorMonitoring() {
+                logger.error("定时监测实验室化学品存放风险指标:{}" , throwable.getMessage());
+            }
+
+            @Override
+            public void queryUplinkResult() {
+                logger.error("定时监测四医大短信上行结果异常:{}" , throwable.getMessage());
+            }
+
+            @Override
+            public R sendSydSms(String content, Integer purpose, Long lockApplyId, @NotNull String... phones) {
+                logger.error("四医大短信调用失败:{}" ,throwable.getMessage());
+                return R.fail("四医大短信调用失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public void sendPhoneBySyd() {
+                logger.error("四医大短信告警方案阶梯式通知流程调用失败:{}" ,throwable.getMessage());
+            }
+        };
+    }
+}

+ 195 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteUserFallback.java

@@ -0,0 +1,195 @@
+package com.zd.system.api.feign.factory;
+
+import com.zd.model.domain.AjaxResult;
+import com.zd.model.domain.R;
+import com.zd.model.entity.LoginUser;
+import com.zd.model.entity.SysUser;
+import com.zd.system.api.feign.RemoteUserService;
+import com.zd.system.api.vo.SimpleUserVO;
+import com.zd.system.api.vo.SysLogoConfigVO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * 用户服务降级处理
+ *
+ * @author zd
+ */
+@Component
+public class RemoteUserFallback implements FallbackFactory<RemoteUserService> {
+    private static final Logger log = LoggerFactory.getLogger(RemoteUserFallback.class);
+
+    @Override
+    public RemoteUserService create(Throwable throwable) {
+        log.error("用户服务调用失败:{}", throwable.getMessage());
+        return new RemoteUserService() {
+
+            private static final String MESSAGE_HEAD="获取用户失败:";
+            @Override
+            public R<LoginUser> getUserInfo(String username, String source) {
+                return R.fail(MESSAGE_HEAD + throwable.getMessage());
+            }
+
+            @Override
+            public R<LoginUser> getUserInfo(String username, Integer loginType, String source) {
+                return R.fail(MESSAGE_HEAD + throwable.getMessage());
+            }
+
+            /**
+             * 通过用户ID查询用户信息
+             *
+             * @param id     用户id
+             * @param source 请求来源
+             * @return 结果
+             */
+            @Override
+            public R<SysUser> getUserInfoByUserId(Long id, String source) {
+                return R.fail(MESSAGE_HEAD + throwable.getMessage());
+            }
+
+            /**
+             * 通过用户账户查询用户信息
+             *
+             * @param userName 用户账户
+             * @param source   请求来源
+             * @return 结果
+             */
+            @Override
+            public R<SysUser> getUserInfoByUserName(String userName, String source) {
+                return R.fail(MESSAGE_HEAD + throwable.getMessage());
+            }
+            /**
+             * 通过用户卡号查询用户信息
+             *
+             * @param userName 用户账户
+             * @param source   请求来源
+             * @return 结果
+             */
+            @Override
+            public R<SysUser> getUserInfoByCardNum(String userName, String source) {
+                return R.fail("通过用户卡号查询用户信息失败:" + throwable.getMessage());
+            }
+
+
+
+            @Override
+            public R<Boolean> registerUserInfo(SysUser sysUser, String source) {
+                return R.fail("注册用户失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<SimpleUserVO> myInfoSimple(String source) {
+                return R.fail("查询当前用户简略信息失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<List<Long>> userALLIDS(String source) {
+                return R.fail("获取所有用户ID失败:" + throwable.getMessage());
+            }
+
+            /**
+             * 根据用户ids获取电话
+             *
+             * @param ids
+             * @return 结果
+             */
+            @Override
+            public R<List<String>> getPhoneByUserIDS(String ids) {
+                return R.fail("获取所有用户手机号失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<List<Long>> userDeptIDS(String deptId, String source) {
+                return R.fail("获取院系下用户ID失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> departmentsList() {
+                return R.fail("获取小程序查询院系列表失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R<Object> building(Long deptId) {
+                return R.fail("获取小程序查询院系下楼栋列表失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public AjaxResult getRouters(Long userId) {
+                return AjaxResult.error("登录获取菜单失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public AjaxResult selectAuthUserPower(Long userId) {
+                return AjaxResult.error("大屏用户权限失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public AjaxResult editUser(SysUser user) { return AjaxResult.error("学生信息更新失败:" + throwable.getMessage()); }
+
+            @Override
+            public AjaxResult editStudent(SysUser user) { return AjaxResult.error("安全准入学生信息更新失败:" + throwable.getMessage()); }
+
+            @Override
+            public R updateSignature(MultipartFile file) {
+                return R.fail("修改签名信息失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public AjaxResult getConfigKey(String configKey) {
+                return AjaxResult.error("获取默认密码数据失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R querySignature() {
+                return R.fail("查询签名信息失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public R <SysLogoConfigVO> getConfigLogo() {
+                return R.fail("查询一体机logo信息失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public AjaxResult remove(Long[] userIds) {
+                return AjaxResult.error("用户账号信息删除失败:"+throwable.getMessage());
+            }
+
+            /**
+             * 获取当前登录用户所属学校以及院系id集合
+             *
+             * @return
+             */
+            @Override
+            public R<List<Long>> getLogingUserDeptids() {
+                return R.fail("获取登录用户所属学校及院系失败:" + throwable.getMessage());
+            }
+
+            /**
+             * 获取当前登录用户所属学校的deptid
+             *
+             * @return
+             */
+            @Override
+            public R<Long> getLoginUserSchoolDeptid() {
+                return R.fail("获取当前登录用户所属学校的deptid失败:" + throwable.getMessage());
+            }
+
+            /***
+             * 根据电话查询用户信息
+             * @param phone
+             * @return
+             */
+            @Override
+            public R<SysUser> getUserByPhone(String phone) {
+                return R.fail("根据电话查询用户信息失败:" + throwable.getMessage());
+            }
+
+
+        };
+    }
+}

+ 80 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SelectUserVO.java

@@ -0,0 +1,80 @@
+package com.zd.system.api.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+/**
+ * 用户对象 sys_user
+ *
+ * @author zd
+ */
+@ApiModel("下拉列表用户")
+public class SelectUserVO {
+
+    /**
+     * 用户ID
+     */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
+    /**
+     * 部门ID
+     */
+    @ApiModelProperty("部门ID")
+    private Long deptId;
+
+    /**
+     * 用户账号
+     */
+    @ApiModelProperty("用户账号")
+    private String userName;
+
+    /**
+     * 用户昵称
+     */
+    @ApiModelProperty("用户名称")
+    private String nickName;
+
+
+    @ApiModelProperty("部门名称")
+    private String deptName;
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+}

+ 79 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SimpleUserVO.java

@@ -0,0 +1,79 @@
+package com.zd.system.api.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Map;
+
+/**
+ * 简略用户信息
+ */
+@ApiModel("简略用户信息")
+public class SimpleUserVO {
+
+    /**
+     * 用户姓名
+     */
+    @ApiModelProperty("用户姓名")
+    String userName;
+
+
+    /**
+     * 用户职称 学生时,返回学生 ,系统用户 返回系统用户
+     */
+    @ApiModelProperty("用户职称|说明")
+    String professional;
+
+
+    /**
+     * 部门名称
+     */
+    @ApiModelProperty("部门名称")
+    String deptName;
+
+
+    @ApiModelProperty("头像")
+    String avatar;
+
+    Map<String,Object> count;
+
+    public Map<String,Object> getCount() {
+        return count;
+    }
+
+    public void setCount(Map<String,Object> count) {
+        this.count = count;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getProfessional() {
+        return professional;
+    }
+
+    public void setProfessional(String professional) {
+        this.professional = professional;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+}

+ 134 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysDeptListVO.java

@@ -0,0 +1,134 @@
+package com.zd.system.api.vo;
+
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 部门列表树vo对象
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/29/9:46
+ * @Description:
+ */
+@ApiModel("部门列表树VO")
+public class SysDeptListVO {
+
+
+    /**
+     * 部门ID
+     */
+    private Long deptId;
+
+    /**
+     * 父部门ID
+     */
+    private Long parentId;
+
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+    /**
+     * 显示顺序
+     */
+    private String orderNum;
+
+    /**
+     * 部门状态:0正常,1停用
+     */
+    private String status;
+
+    /**
+     * 删除标志(0代表存在 2代表删除)
+     */
+    private String delFlag;
+
+    /**
+     * 总人数
+     */
+    private Long totalPeople;
+
+    /**
+     * 总实验室
+     */
+    private Long totalSub;
+
+
+    /**
+     * 部门照片
+     */
+    private String deptImg;
+
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public Long getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Long parentId) {
+        this.parentId = parentId;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getOrderNum() {
+        return orderNum;
+    }
+
+    public void setOrderNum(String orderNum) {
+        this.orderNum = orderNum;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Long getTotalPeople() {
+        return totalPeople;
+    }
+
+    public void setTotalPeople(Long totalPeople) {
+        this.totalPeople = totalPeople;
+    }
+
+    public Long getTotalSub() {
+        return totalSub;
+    }
+
+    public void setTotalSub(Long totalSub) {
+        this.totalSub = totalSub;
+    }
+
+    public String getDeptImg() {
+        return deptImg;
+    }
+
+    public void setDeptImg(String deptImg) {
+        this.deptImg = deptImg;
+    }
+}

+ 68 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysDeptVO.java

@@ -0,0 +1,68 @@
+package com.zd.system.api.vo;
+
+
+import com.zd.model.entity.SysDept;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 部门表 sys_dept
+ *
+ * @author zd
+ */
+public class SysDeptVO{
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 部门id
+     */
+    private Long deptId;
+
+    /**
+     * 父部门ID
+     */
+    private Long parentId;
+
+    /**
+     * 向上,向下操作 : 1是向上,2是向下
+     */
+    private Long upDownOper;
+
+    /**
+     * 教职工页面操作部门
+     */
+    private List<SysDept> teaCherDpetList = new ArrayList<>();
+
+    public List <SysDept> getTeaCherDpetList() {
+        return teaCherDpetList;
+    }
+
+    public void setTeaCherDpetList(List <SysDept> teaCherDpetList) {
+        this.teaCherDpetList = teaCherDpetList;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public Long getUpDownOper() {
+        return upDownOper;
+    }
+
+    public void setUpDownOper(Long upDownOper) {
+        this.upDownOper = upDownOper;
+    }
+
+    public Long getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Long parentId) {
+        this.parentId = parentId;
+    }
+}

+ 152 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysLogoConfigVO.java

@@ -0,0 +1,152 @@
+package com.zd.system.api.vo;
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * logo配置对象 sys_logo_config
+ *
+ * @author zd
+ * @date 2022-05-06
+ */
+@ApiModel("logo配置")
+public class SysLogoConfigVO extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键id */
+    @ApiModelProperty(value = "${comment}")
+    private Long id;
+    /** 学校名称 */
+    @Excel(name = "学校名称")
+    @ApiModelProperty(value = "学校名称")
+    private String schoolName;
+    /** 圆形logo */
+    @Excel(name = "圆形logo")
+    @ApiModelProperty(value = "圆形logo")
+    private String circularLogo;
+    /** 长方形logo */
+    @Excel(name = "长方形logo")
+    @ApiModelProperty(value = "长方形logo")
+    private String rectangleLogo;
+    /** 签到签出示意图 */
+    @Excel(name = "签到签出示意图")
+    @ApiModelProperty(value = "签到签出示意图")
+    private String signMap;
+    /** 视屏封面 */
+    @Excel(name = "视屏封面")
+    @ApiModelProperty(value = "视屏封面")
+    private String videoCover;
+    /** 操作指南 */
+    @Excel(name = "操作指南")
+    @ApiModelProperty(value = "操作指南")
+    private String operationGuide;
+    /** 登录页banner */
+    @Excel(name = "登录页banner")
+    @ApiModelProperty(value = "登录页banner")
+    private String loginBanner;
+    /** 首页banner */
+    @Excel(name = "首页banner")
+    @ApiModelProperty(value = "首页banner")
+    private String homepageBanner;
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setSchoolName(String schoolName)
+    {
+        this.schoolName = schoolName;
+    }
+
+    public String getSchoolName()
+    {
+        return schoolName;
+    }
+    public void setCircularLogo(String circularLogo)
+    {
+        this.circularLogo = circularLogo;
+    }
+
+    public String getCircularLogo()
+    {
+        return circularLogo;
+    }
+    public void setRectangleLogo(String rectangleLogo)
+    {
+        this.rectangleLogo = rectangleLogo;
+    }
+
+    public String getRectangleLogo()
+    {
+        return rectangleLogo;
+    }
+    public void setSignMap(String signMap)
+    {
+        this.signMap = signMap;
+    }
+
+    public String getSignMap()
+    {
+        return signMap;
+    }
+    public void setVideoCover(String videoCover)
+    {
+        this.videoCover = videoCover;
+    }
+
+    public String getVideoCover()
+    {
+        return videoCover;
+    }
+    public void setOperationGuide(String operationGuide)
+    {
+        this.operationGuide = operationGuide;
+    }
+
+    public String getOperationGuide()
+    {
+        return operationGuide;
+    }
+    public void setLoginBanner(String loginBanner)
+    {
+        this.loginBanner = loginBanner;
+    }
+
+    public String getLoginBanner()
+    {
+        return loginBanner;
+    }
+    public void setHomepageBanner(String homepageBanner)
+    {
+        this.homepageBanner = homepageBanner;
+    }
+
+    public String getHomepageBanner()
+    {
+        return homepageBanner;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("schoolName", getSchoolName())
+            .append("circularLogo", getCircularLogo())
+            .append("rectangleLogo", getRectangleLogo())
+            .append("signMap", getSignMap())
+            .append("videoCover", getVideoCover())
+            .append("operationGuide", getOperationGuide())
+            .append("loginBanner", getLoginBanner())
+            .append("homepageBanner", getHomepageBanner())
+            .toString();
+    }
+}

+ 171 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/TeacherListVO.java

@@ -0,0 +1,171 @@
+package com.zd.system.api.vo;
+
+
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.SysUser;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.BeanUtils;
+
+/**
+ * 教职工列表VO
+ *
+ * @Author: zhoupan
+ * @Date: 2021/09/11/11:14
+ * @Description:
+ */
+@ApiModel("教职工列表VO")
+public class TeacherListVO {
+
+    /**
+     * 用户ID
+     */
+    @ApiModelProperty(value = "用户ID")
+    private Long userId;
+
+    /**
+     * 部门ID
+     */
+    @ApiModelProperty(value = "部门ID")
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @ApiModelProperty(value = "所属院系")
+    @Excel(name = "所属院系", type = Excel.Type.EXPORT, isRequired = true)
+    private String deptName;
+    /**
+     * 工号
+     */
+    @ApiModelProperty(value = "工号")
+    @Excel(name = "工号", type = Excel.Type.EXPORT)
+    private String userName;
+    /**
+     * 用户名称
+     */
+    @ApiModelProperty(value = "用户姓名")
+    @Excel(name = "姓名", type = Excel.Type.EXPORT)
+    private String nickName;
+
+    /**
+     * 手机号码
+     */
+    @ApiModelProperty(value = "手机号码")
+    @Excel(name = "联系方式", type = Excel.Type.EXPORT)
+    private String phonenumber;
+
+    /**
+     * 用户性别
+     */
+    @ApiModelProperty(value = "用户性别")
+    private String sex;
+
+    /**
+     * 职称(教授,助教)
+     */
+    @ApiModelProperty(value = "职称(教授,助教)")
+    @Excel(name = "职称", type = Excel.Type.EXPORT,dictLable="professional")
+    private String position;
+    /**
+     * 工作性质(0,非在编  1,在编)
+     */
+    @Excel(name = "工作性质", type = Excel.Type.EXPORT,dictLable="work_class")
+    @ApiModelProperty(value = "工作性质")
+    private String nature;
+
+
+    /**
+     * 管理实验室数量
+     */
+    @Excel(name = "管理实验室数量", type = Excel.Type.EXPORT)
+    @ApiModelProperty(value = "管理实验室数量")
+    private Integer manageSubCount;
+
+
+    public TeacherListVO(SysUser sysUser) {
+        BeanUtils.copyProperties(sysUser, this);
+        this.deptName = sysUser.getDept() == null ? null : sysUser.getDept().getDeptName();
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    public String getNature() {
+        return nature;
+    }
+
+    public void setNature(String nature) {
+        this.nature = nature;
+    }
+
+    public Integer getManageSubCount() {
+        return manageSubCount;
+    }
+
+    public void setManageSubCount(Integer manageSubCount) {
+        this.manageSubCount = manageSubCount;
+    }
+}

+ 13 - 12
zd-auth/pom.xml

@@ -24,22 +24,16 @@
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
         </dependency>
         <!-- zd Common Swagger -->
-        <dependency>
+       <!-- <dependency>
             <groupId>com.zd</groupId>
             <artifactId>zd-common-swagger</artifactId>
-        </dependency>
+        </dependency>-->
         <!-- SpringCloud Alibaba Sentinel -->
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
         </dependency>
 
-        <!-- SpringBoot Web -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
         <!-- SpringBoot Actuator -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -48,16 +42,23 @@
 
         <!-- zd Common Security-->
         <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-security</artifactId>
+            <groupId>com.zd.core</groupId>
+            <artifactId>common-core</artifactId>
+            <version>3.1.0</version>
             <exclusions>
                 <exclusion>
-                    <groupId>com.zd</groupId>
-                    <artifactId>zd-common-datasource</artifactId>
+                    <groupId>com.baomidou</groupId>
+                    <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
 
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>6.0.8.Final</version>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 5 - 2
zd-auth/src/main/java/com/zd/auth/ZdAuthApplication.java

@@ -1,10 +1,12 @@
 package com.zd.auth;
 
+import com.zd.common.core.annotation.EnableRyFeignClients;
+import com.zd.common.core.redis.RedisConfig;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import com.zd.common.security.annotation.EnableRyFeignClients;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Import;
 
 /**
  * 认证授权中心
@@ -12,6 +14,7 @@ import org.springframework.cloud.context.config.annotation.RefreshScope;
  * @author zd
  */
 @EnableRyFeignClients
+@ComponentScan(basePackages = {"com.zd"})
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
 public class ZdAuthApplication {
     public static void main(String[] args) {

+ 18 - 23
zd-auth/src/main/java/com/zd/auth/controller/TokenController.java

@@ -4,19 +4,18 @@ import cn.hutool.core.util.RandomUtil;
 import com.zd.auth.form.LoginBody;
 import com.zd.auth.form.RegisterBody;
 import com.zd.auth.service.SysLoginService;
-import com.zd.common.core.constant.*;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.exception.CaptchaException;
 import com.zd.common.core.exception.ServiceException;
+import com.zd.common.core.redis.RedisService;
+import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.IdUtils;
 import com.zd.common.core.utils.StringUtils;
-import com.zd.common.core.web.domain.AjaxResult;
-import com.zd.common.redis.service.RedisService;
-import com.zd.common.security.service.TokenService;
-import com.zd.system.api.RemoteUserService;
-import com.zd.system.api.chemical.RemoteStockService;
-import com.zd.system.api.domain.SysUser;
-import com.zd.system.api.model.LoginUser;
+import com.zd.model.constant.*;
+import com.zd.model.domain.AjaxResult;
+import com.zd.model.domain.R;
+import com.zd.model.entity.LoginUser;
+import com.zd.model.entity.SysUser;
+import com.zd.system.api.feign.RemoteStockService;
+import com.zd.system.api.feign.RemoteUserService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -26,7 +25,6 @@ import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
-
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -34,7 +32,7 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 
-import static com.zd.common.core.constant.Constants.CODE_EXPIRATION;
+import static com.zd.model.constant.BaseConstants.CODE_EXPIRATION;
 
 /**
  * token 控制
@@ -45,19 +43,16 @@ import static com.zd.common.core.constant.Constants.CODE_EXPIRATION;
 public class TokenController {
 
     private final Logger logger = LoggerFactory.getLogger(TokenController.class);
+
     @Autowired
     private TokenService tokenService;
-
     @Autowired
     private SysLoginService sysLoginService;
-
     @Autowired
     private RemoteUserService remoteUserService;
-
     @Autowired
     private RedisService redisService;
-
-    @Resource
+    @Autowired
     private RemoteStockService stockService;
     @Resource
     private RedisTemplate<String,String> redisTemplate;
@@ -65,10 +60,10 @@ public class TokenController {
     @PostMapping("login")
     public R<?> login(@RequestBody LoginBody form) {
         // 用户登录
-        String authType = form.getAuthType() == null ? Constants.GRANT_TYPE_PASSWORD : form.getAuthType();
+        String authType = form.getAuthType() == null ? BaseConstants.GRANT_TYPE_PASSWORD : form.getAuthType();
         LoginUser userInfo;
-        if (Objects.equals(authType, Constants.GRANT_TYPE_MOBILE)) {
-            String key = Constants.DEFAULT_CODE_KEY +  Constants.GRANT_TYPE_MOBILE + "@" + form.getUsername();
+        if (Objects.equals(authType, BaseConstants.GRANT_TYPE_MOBILE)) {
+            String key = BaseConstants.DEFAULT_CODE_KEY +  BaseConstants.GRANT_TYPE_MOBILE + "@" + form.getUsername();
             String code = redisTemplate.opsForValue().get(key);
             if (form.getPassword().equals(code)){
                 R<LoginUser> userR = remoteUserService.getUserInfo(form.getUsername(), SecurityConstants.INNER);
@@ -179,11 +174,11 @@ public class TokenController {
         if (userR.getCode()!=HttpStatus.SUCCESS || userR.getData()==null){
             throw new ServiceException("登录用户:" + username + " 不存在",530);
         }
-        String key = Constants.DEFAULT_CODE_KEY +  Constants.GRANT_TYPE_MOBILE + "@" + username;
+        String key = BaseConstants.DEFAULT_CODE_KEY +  BaseConstants.GRANT_TYPE_MOBILE + "@" + username;
         String code = RandomUtil.randomNumbers(6);
         redisTemplate.opsForValue().set(key,code,CODE_EXPIRATION,TimeUnit.MINUTES);
         logger.info("========================>{}<=========================",code);
-        String countKey=Constants.DEFAULT_CODE_KEY + "@" + username+"_COUNT";
+        String countKey = BaseConstants.DEFAULT_CODE_KEY + "@" + username+"_COUNT";
         String count = redisTemplate.opsForValue().get(countKey);
         if (StringUtils.isEmpty(count)){
             redisTemplate.opsForValue().set(countKey,"1",60,TimeUnit.MINUTES);
@@ -286,7 +281,7 @@ public class TokenController {
                         }
                     }
                     // 记录学习一体机用户登录状态
-                    redisService.setCacheObject(CacheConstants.LEARN_USER_KEY + userInfo.getSysUser().getUserId(), userInfo, Constants.TOKEN_EXPIRE * 60, TimeUnit.SECONDS);
+                    redisService.setCacheObject(CacheConstants.LEARN_USER_KEY + userInfo.getSysUser().getUserId(), userInfo, BaseConstants.TOKEN_EXPIRE * 60, TimeUnit.SECONDS);
                 }
             }
 

+ 17 - 17
zd-auth/src/main/java/com/zd/auth/service/SysLoginService.java

@@ -1,25 +1,24 @@
 package com.zd.auth.service;
 
-import com.zd.common.core.constant.HttpStatus;
 import com.zd.common.core.exception.PreAuthorizeException;
-import com.zd.common.security.utils.SaveUtil;
+import com.zd.common.core.utils.IpUtils;
+import com.zd.model.constant.BaseConstants;
+import com.zd.model.constant.HttpStatus;
+import com.zd.model.constant.SecurityConstants;
+import com.zd.model.constant.UserConstants;
+import com.zd.model.domain.R;
+import com.zd.model.enums.UserStatus;
+import com.zd.model.entity.LoginUser;
+import com.zd.system.api.entity.SysLogininfor;
+import com.zd.model.entity.SysUser;
+import com.zd.system.api.feign.RemoteLogService;
+import com.zd.system.api.feign.RemoteUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import com.zd.common.core.constant.Constants;
-import com.zd.common.core.constant.SecurityConstants;
-import com.zd.common.core.constant.UserConstants;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.enums.UserStatus;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.utils.SecurityUtils;
 import com.zd.common.core.utils.ServletUtils;
 import com.zd.common.core.utils.StringUtils;
-import com.zd.common.core.utils.ip.IpUtils;
-import com.zd.system.api.RemoteLogService;
-import com.zd.system.api.RemoteUserService;
-import com.zd.system.api.domain.SysLogininfor;
-import com.zd.system.api.domain.SysUser;
-import com.zd.system.api.model.LoginUser;
 
 /**
  * 登录校验方法
@@ -28,6 +27,7 @@ import com.zd.system.api.model.LoginUser;
  */
 @Component
 public class SysLoginService {
+
     @Autowired
     private RemoteLogService remoteLogService;
 
@@ -84,12 +84,12 @@ public class SysLoginService {
 //            recordLogininfor(username, Constants.LOGIN_FAIL, "用户密码错误");
             throw new ServiceException("用户不存在/密码错误",530);
         }
-        recordLogininfor(user, Constants.LOGIN_SUCCESS, "登录成功");
+        recordLogininfor(user, BaseConstants.LOGIN_SUCCESS, "登录成功");
         return userInfo;
     }
 
     public void logout(SysUser user) {
-        recordLogininfor(user, Constants.LOGOUT, "退出成功");
+        recordLogininfor(user, BaseConstants.LOGOUT, "退出成功");
     }
 
     /**
@@ -136,9 +136,9 @@ public class SysLoginService {
         logininfor.setIpaddr(IpUtils.getIpAddr(ServletUtils.getRequest()));
         logininfor.setMsg(message);
         // 日志状态
-        if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) {
+        if (StringUtils.equalsAny(status, BaseConstants.LOGIN_SUCCESS, BaseConstants.LOGOUT, BaseConstants.REGISTER)) {
             logininfor.setStatus("0");
-        } else if (Constants.LOGIN_FAIL.equals(status)) {
+        } else if (BaseConstants.LOGIN_FAIL.equals(status)) {
             logininfor.setStatus("1");
         }
         logininfor.setUserId(user.getUserId());

+ 1 - 1
zd-auth/src/main/resources/bootstrap.yml

@@ -1,6 +1,6 @@
 # Tomcat
 server:
-  port: 9200
+  port: ${service.port.auth}
 
 # Spring
 spring:

+ 73 - 0
zd-common/common-core/pom.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>zd-common</artifactId>
+        <groupId>com.zd</groupId>
+        <version>3.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.zd.core</groupId>
+    <artifactId>common-core</artifactId>
+    <packaging>jar</packaging>
+    <description>公共包</description>
+
+    <dependencies>
+        <!-- SpringCloud Loadbalancer -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-loadbalancer</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.lettuce</groupId>
+                    <artifactId>lettuce-core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+        </dependency>
+
+        <!-- Druid -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>${druid.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.5.2</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.zd.system</groupId>
+            <artifactId>zd-system-api</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+
+
+        <!-- excel工具 -->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 33 - 0
zd-common/common-core/src/main/java/com/zd/common/core/annotation/DataScope.java

@@ -0,0 +1,33 @@
+package com.zd.common.core.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 数据权限过滤注解
+ *
+ * @author zd
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface DataScope {
+    /**
+     * 部门表的别名
+     */
+    public String deptAlias() default "";
+
+    /**
+     * 用户表的别名
+     */
+    public String userAlias() default "";
+
+    /**
+     * 是否应用实验室负责人
+     */
+    public boolean subAdmin() default false;
+
+    /**
+     * 权限模块
+     */
+    public String permi() default "";
+}

+ 18 - 0
zd-common/common-core/src/main/java/com/zd/common/core/annotation/DatasourceMaster.java

@@ -0,0 +1,18 @@
+package com.zd.common.core.annotation;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+
+import java.lang.annotation.*;
+
+/**
+ * 主库数据源
+ *
+ * @author zd
+ */
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@DS("master")
+public @interface DatasourceMaster {
+
+}

+ 18 - 0
zd-common/common-core/src/main/java/com/zd/common/core/annotation/DatasourceSlave.java

@@ -0,0 +1,18 @@
+package com.zd.common.core.annotation;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+
+import java.lang.annotation.*;
+
+/**
+ * 从库数据源
+ *
+ * @author zd
+ */
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@DS("slave")
+public @interface DatasourceSlave {
+
+}

+ 36 - 0
zd-common/common-core/src/main/java/com/zd/common/core/annotation/EnableCustomConfig.java

@@ -0,0 +1,36 @@
+package com.zd.common.core.annotation;
+
+
+import com.zd.common.core.config.ApplicationConfig;
+import com.zd.common.core.config.FeignAutoConfiguration;
+import com.zd.common.core.properties.SnowflakeProperties;
+import org.mybatis.spring.annotation.MapperScan;
+import org.mybatis.spring.annotation.MapperScans;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.context.annotation.Import;
+import org.springframework.scheduling.annotation.EnableAsync;
+import java.lang.annotation.*;
+
+/**
+ * @author Administrator
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@Inherited
+// 表示通过aop框架暴露该代理对象,AopContext能够访问
+@EnableAspectJAutoProxy(exposeProxy = true)
+// 指定要扫描的Mapper类的包的路径
+@MapperScans({
+        @MapperScan("com.zd.**.mapper"),
+        @MapperScan("com.zd.**.dao")
+})
+// 开启线程异步执行
+@EnableAsync
+// 自动加载类
+@Import({ApplicationConfig.class, FeignAutoConfiguration.class})
+@EnableConfigurationProperties(SnowflakeProperties.class)
+public @interface EnableCustomConfig {
+
+}

+ 26 - 0
zd-common/common-core/src/main/java/com/zd/common/core/annotation/EnableRyFeignClients.java

@@ -0,0 +1,26 @@
+package com.zd.common.core.annotation;
+
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import java.lang.annotation.*;
+
+/**
+ * 自定义feign注解
+ * 添加basePackages路径
+ *
+ * @author zd
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@EnableFeignClients
+public @interface EnableRyFeignClients {
+    String[] value() default {};
+
+    String[] basePackages() default {"com.zd"};
+
+    Class<?>[] basePackageClasses() default {};
+
+    Class<?>[] defaultConfiguration() default {};
+
+    Class<?>[] clients() default {};
+}

+ 18 - 0
zd-common/common-core/src/main/java/com/zd/common/core/annotation/InnerAuth.java

@@ -0,0 +1,18 @@
+package com.zd.common.core.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 内部认证注解
+ *
+ * @author zd
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface InnerAuth {
+    /**
+     * 是否校验用户信息
+     */
+    boolean isUser() default false;
+}

+ 36 - 0
zd-common/common-core/src/main/java/com/zd/common/core/annotation/Log.java

@@ -0,0 +1,36 @@
+package com.zd.common.core.annotation;
+
+import com.zd.common.core.log.BusinessType;
+import com.zd.common.core.log.OperatorType;
+
+import java.lang.annotation.*;
+
+/**
+ * 自定义操作日志记录注解
+ *
+ * @author zd
+ */
+@Target({ElementType.PARAMETER, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Log {
+    /**
+     * 模块
+     */
+    public String title() default "";
+
+    /**
+     * 功能
+     */
+    public BusinessType businessType() default BusinessType.OTHER;
+
+    /**
+     * 操作人类别
+     */
+    public OperatorType operatorType() default OperatorType.MANAGE;
+
+    /**
+     * 是否保存请求的参数
+     */
+    public boolean isSaveRequestData() default true;
+}

+ 45 - 0
zd-common/common-core/src/main/java/com/zd/common/core/annotation/PreAuthorize.java

@@ -0,0 +1,45 @@
+package com.zd.common.core.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 权限注解
+ *
+ * @author zd
+ */
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PreAuthorize {
+    /**
+     * 验证用户是否具备某权限
+     */
+    public String hasPermi() default "";
+
+    /**
+     * 验证用户是否不具备某权限,与 hasPermi逻辑相反
+     */
+    public String lacksPermi() default "";
+
+    /**
+     * 验证用户是否具有以下任意一个权限
+     */
+    public String[] hasAnyPermi() default {};
+
+    /**
+     * 判断用户是否拥有某个角色
+     */
+    public String hasRole() default "";
+
+    /**
+     * 验证用户是否不具备某角色,与 isRole逻辑相反
+     */
+    public String lacksRole() default "";
+
+    /**
+     * 验证用户是否具有以下任意一个角色
+     */
+    public String[] hasAnyRoles() default {};
+}

+ 46 - 0
zd-common/common-core/src/main/java/com/zd/common/core/aspect/InnerAuthAspect.java

@@ -0,0 +1,46 @@
+package com.zd.common.core.aspect;
+
+import com.zd.common.core.annotation.InnerAuth;
+import com.zd.common.core.exception.InnerAuthException;
+import com.zd.common.core.utils.ServletUtils;
+import com.zd.common.core.utils.StringUtils;
+import com.zd.model.constant.SecurityConstants;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.springframework.core.Ordered;
+import org.springframework.stereotype.Component;
+
+/**
+ * 内部服务调用验证处理
+ *
+ * @author zd
+ */
+@Aspect
+@Component
+public class InnerAuthAspect implements Ordered {
+    @Around("@annotation(innerAuth)")
+    public Object innerAround(ProceedingJoinPoint point, InnerAuth innerAuth) throws Throwable {
+        String source = ServletUtils.getRequest().getHeader(SecurityConstants.FROM_SOURCE);
+        // 内部请求验证
+        if (!StringUtils.equals(SecurityConstants.INNER, source)) {
+            throw new InnerAuthException("没有内部访问权限,不允许访问");
+        }
+
+        String userid = ServletUtils.getRequest().getHeader(SecurityConstants.DETAILS_USER_ID);
+        String username = ServletUtils.getRequest().getHeader(SecurityConstants.DETAILS_USERNAME);
+        // 用户信息验证
+        if (innerAuth.isUser() && (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username))) {
+            throw new InnerAuthException("没有设置用户信息,不允许访问 ");
+        }
+        return point.proceed();
+    }
+
+    /**
+     * 确保在权限认证aop执行前执行
+     */
+    @Override
+    public int getOrder() {
+        return Ordered.HIGHEST_PRECEDENCE + 1;
+    }
+}

+ 195 - 0
zd-common/common-core/src/main/java/com/zd/common/core/aspect/PreAuthorizeAspect.java

@@ -0,0 +1,195 @@
+package com.zd.common.core.aspect;
+
+import com.zd.common.core.annotation.PreAuthorize;
+import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.StringUtils;
+import com.zd.model.entity.LoginUser;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.PatternMatchUtils;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+
+/**
+ * 自定义权限实现
+ *
+ * @author zd
+ */
+@Aspect
+@Component
+public class PreAuthorizeAspect {
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 所有权限标识
+     */
+    private static final String ALL_PERMISSION = "*:*:*";
+
+    /**
+     * 管理员角色权限标识
+     */
+    private static final String SUPER_ADMIN = "superAdmin";
+
+    /**
+     * 数组为0时
+     */
+    private static final Integer ARRAY_EMPTY = 0;
+
+    @Around("@annotation(com.zd.common.core.annotation.PreAuthorize)")
+    public Object around(ProceedingJoinPoint point) throws Throwable {
+        Signature signature = point.getSignature();
+        MethodSignature methodSignature = (MethodSignature) signature;
+        Method method = methodSignature.getMethod();
+        PreAuthorize annotation = method.getAnnotation(PreAuthorize.class);
+        if (annotation == null) {
+            return point.proceed();
+        }
+
+
+        if (StringUtils.isNotEmpty(annotation.hasPermi())) {
+            if (hasPermi(annotation.hasPermi())) {
+                return point.proceed();
+            }
+            throw new RuntimeException();
+        } else if (StringUtils.isNotEmpty(annotation.lacksPermi())) {
+            if (lacksPermi(annotation.lacksPermi())) {
+                return point.proceed();
+            }
+            throw new RuntimeException();
+        } else if (ARRAY_EMPTY < annotation.hasAnyPermi().length) {
+            if (hasAnyPermi(annotation.hasAnyPermi())) {
+                return point.proceed();
+            }
+            throw new RuntimeException();
+        } else if (StringUtils.isNotEmpty(annotation.hasRole())) {
+            if (hasRole(annotation.hasRole())) {
+                return point.proceed();
+            }
+            throw new RuntimeException();
+        } else if (StringUtils.isNotEmpty(annotation.lacksRole())) {
+            if (lacksRole(annotation.lacksRole())) {
+                return point.proceed();
+            }
+            throw new RuntimeException();
+        } else if (ARRAY_EMPTY < annotation.hasAnyRoles().length) {
+            if (hasAnyRoles(annotation.hasAnyRoles())) {
+                return point.proceed();
+            }
+            throw new RuntimeException();
+        }
+
+        return point.proceed();
+    }
+
+    /**
+     * 验证用户是否具备某权限
+     *
+     * @param permission 权限字符串
+     * @return 用户是否具备某权限
+     */
+    public boolean hasPermi(String permission) {
+        LoginUser userInfo = tokenService.getLoginUser();
+        if (StringUtils.isNull(userInfo) || CollectionUtils.isEmpty(userInfo.getPermissions())) {
+            return false;
+        }
+        return hasPermissions(userInfo.getPermissions(), permission);
+    }
+
+    /**
+     * 验证用户是否不具备某权限,与 hasPermi逻辑相反
+     *
+     * @param permission 权限字符串
+     * @return 用户是否不具备某权限
+     */
+    public boolean lacksPermi(String permission) {
+        return hasPermi(permission) != true;
+    }
+
+    /**
+     * 验证用户是否具有以下任意一个权限
+     *
+     * @param permissions 权限列表
+     * @return 用户是否具有以下任意一个权限
+     */
+    public boolean hasAnyPermi(String[] permissions) {
+        LoginUser userInfo = tokenService.getLoginUser();
+        if (StringUtils.isNull(userInfo) || CollectionUtils.isEmpty(userInfo.getPermissions())) {
+            return false;
+        }
+        Collection<String> authorities = userInfo.getPermissions();
+        for (String permission : permissions) {
+            if (permission != null && hasPermissions(authorities, permission)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 判断用户是否拥有某个角色
+     *
+     * @param role 角色字符串
+     * @return 用户是否具备某角色
+     */
+    public boolean hasRole(String role) {
+        LoginUser userInfo = tokenService.getLoginUser();
+        if (StringUtils.isNull(userInfo) || CollectionUtils.isEmpty(userInfo.getRoles())) {
+            return false;
+        }
+        for (String roleKey : userInfo.getRoles()) {
+            if (SUPER_ADMIN.equals(roleKey) || roleKey.equals(role)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 验证用户是否不具备某角色,与 isRole逻辑相反。
+     *
+     * @param role 角色名称
+     * @return 用户是否不具备某角色
+     */
+    public boolean lacksRole(String role) {
+        return hasRole(role) != true;
+    }
+
+    /**
+     * 验证用户是否具有以下任意一个角色
+     *
+     * @param roles 角色列表
+     * @return 用户是否具有以下任意一个角色
+     */
+    public boolean hasAnyRoles(String[] roles) {
+        LoginUser userInfo = tokenService.getLoginUser();
+        if (StringUtils.isNull(userInfo) || CollectionUtils.isEmpty(userInfo.getRoles())) {
+            return false;
+        }
+        for (String role : roles) {
+            if (hasRole(role)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 判断是否包含权限
+     *
+     * @param authorities 权限列表
+     * @param permission  权限字符串
+     * @return 用户是否具备某权限
+     */
+    private boolean hasPermissions(Collection<String> authorities, String permission) {
+        return authorities.stream().filter(StringUtils::hasText)
+                .anyMatch(x -> ALL_PERMISSION.contains(x) || PatternMatchUtils.simpleMatch(x, permission));
+    }
+}

+ 47 - 0
zd-common/common-core/src/main/java/com/zd/common/core/aspect/ServiceAspect.java

@@ -0,0 +1,47 @@
+package com.zd.common.core.aspect;
+
+
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.annotation.After;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+import static com.zd.model.constant.SecurityConstants.DB;
+
+/**
+ * @author hanson
+ */
+@Aspect
+@Component
+@Slf4j
+public class ServiceAspect {
+
+    @Pointcut("execution(* com.zd.*.service.impl..*.*(..))")
+    public void pointcut() {}
+
+    @Before("pointcut()")
+    public void before(){
+        // 请求开始时间
+        ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if (sra != null) {
+            HttpServletRequest request = sra.getRequest();
+            String db = request.getHeader(DB);
+            if (StringUtils.hasLength(db)) {
+                DynamicDataSourceContextHolder.push(db);
+            }
+        }
+    }
+
+    @After("pointcut()")
+    public void after() {
+        DynamicDataSourceContextHolder.poll();
+    }
+}

+ 21 - 0
zd-common/common-core/src/main/java/com/zd/common/core/config/ApplicationConfig.java

@@ -0,0 +1,21 @@
+package com.zd.common.core.config;
+
+import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
+import org.springframework.context.annotation.Bean;
+
+import java.util.TimeZone;
+
+/**
+ * 系统配置
+ *
+ * @author zd
+ */
+public class ApplicationConfig {
+    /**
+     * 时区配置
+     */
+    @Bean
+    public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() {
+        return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
+    }
+}

+ 18 - 0
zd-common/common-core/src/main/java/com/zd/common/core/config/FeignAutoConfiguration.java

@@ -0,0 +1,18 @@
+package com.zd.common.core.config;
+
+import feign.RequestInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Feign 配置注册
+ *
+ * @author zd
+ **/
+@Configuration
+public class FeignAutoConfiguration {
+    @Bean
+    public RequestInterceptor requestInterceptor() {
+        return new FeignRequestInterceptor();
+    }
+}

+ 52 - 0
zd-common/common-core/src/main/java/com/zd/common/core/config/FeignRequestInterceptor.java

@@ -0,0 +1,52 @@
+package com.zd.common.core.config;
+
+import com.zd.common.core.utils.IpUtils;
+import com.zd.common.core.utils.ServletUtils;
+import com.zd.common.core.utils.StringUtils;
+import com.zd.model.constant.SecurityConstants;
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+import static com.zd.model.constant.SecurityConstants.DB;
+
+/**
+ * feign 请求拦截器
+ *
+ * @author zd
+ */
+@Component
+public class FeignRequestInterceptor implements RequestInterceptor {
+    @Override
+    public void apply(RequestTemplate requestTemplate) {
+        HttpServletRequest httpServletRequest = ServletUtils.getRequest();
+        if (StringUtils.isNotNull(httpServletRequest)) {
+            Map<String, String> headers = ServletUtils.getHeaders(httpServletRequest);
+            // 传递用户信息请求头,防止丢失
+            String userId = headers.get(SecurityConstants.DETAILS_USER_ID);
+            if (StringUtils.isNotEmpty(userId)) {
+                requestTemplate.header(SecurityConstants.DETAILS_USER_ID, userId);
+            }
+            //配置多数据源情况下对feign请求的兼容
+            String dbName = headers.get(DB);
+            if (StringUtils.isNotEmpty(dbName)) {
+                requestTemplate.header(DB, dbName);
+            }
+
+            String userName = headers.get(SecurityConstants.DETAILS_USERNAME);
+            if (StringUtils.isNotEmpty(userName)) {
+                requestTemplate.header(SecurityConstants.DETAILS_USERNAME, userName);
+            }
+            String authentication = headers.get(SecurityConstants.AUTHORIZATION_HEADER);
+            if (StringUtils.isNotEmpty(authentication)) {
+                requestTemplate.header(SecurityConstants.AUTHORIZATION_HEADER, authentication);
+            }
+
+            // 配置客户端IP
+            requestTemplate.header("X-Forwarded-For", IpUtils.getIpAddr(ServletUtils.getRequest()));
+        }
+    }
+}

+ 247 - 0
zd-common/common-core/src/main/java/com/zd/common/core/datascope/DataScopeAspect.java

@@ -0,0 +1,247 @@
+package com.zd.common.core.datascope;
+
+
+import com.zd.common.core.annotation.DataScope;
+import com.zd.common.core.exception.PreAuthorizeException;
+import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.StringUtils;
+import com.zd.model.constant.UserConstants;
+import com.zd.model.domain.per.PerFun;
+import com.zd.model.entity.*;
+import com.zd.model.entity.SysPermitInfo;
+import com.zd.model.entity.SysRole;
+import com.zd.model.entity.SysUser;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.function.Predicate;
+
+/**
+ * 数据过滤处理
+ *
+ * @author zd
+ */
+@Aspect
+@Component
+public class DataScopeAspect {
+    /**
+     * 全部数据权限
+     */
+    public static final String DATA_SCOPE_ALL = "1";
+
+    /**
+     * 自定数据权限
+     */
+    public static final String DATA_SCOPE_CUSTOM = "2";
+
+    /**
+     * 部门数据权限
+     */
+    public static final String DATA_SCOPE_DEPT = "3";
+
+    /**
+     * 部门及以下数据权限
+     */
+    public static final String DATA_SCOPE_DEPT_AND_CHILD = "4";
+
+    /**
+     * 仅本人数据权限
+     */
+    public static final String DATA_SCOPE_SELF = "5";
+
+    /**
+     * 数据权限过滤关键字
+     */
+    public static final String DATA_SCOPE = "dataScope";
+
+    @Autowired
+    private TokenService tokenService;
+
+    // 配置织入点
+    @Pointcut("@annotation(com.zd.common.core.annotation.DataScope)")
+    public void dataScopePointCut() {
+    }
+
+    @Before("dataScopePointCut()")
+    public void doBefore(JoinPoint point) throws Throwable {
+        clearDataScope(point);
+        handleDataScope(point);
+    }
+
+    protected void handleDataScope(final JoinPoint joinPoint) {
+        // 获得注解
+        DataScope controllerDataScope = getAnnotationLog(joinPoint);
+        if (controllerDataScope == null) {
+            return;
+        }
+        // 获取当前的用户
+        LoginUser loginUser = tokenService.getLoginUser();
+        if (StringUtils.isNotNull(loginUser)) {
+            SysUser currentUser = loginUser.getSysUser();
+            // 如果是超级管理员,则不过滤数据
+            if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin() && UserConstants.USER_LOGIN_PC == loginUser.getLoginType()) {
+                dataScopeNewFilter(joinPoint, currentUser, controllerDataScope);
+            }
+        }
+    }
+
+    @Deprecated
+    public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias, boolean isSubAdmin) {
+        StringBuilder sqlString = new StringBuilder();
+        Boolean f = true;
+        for (SysRole role : user.getRoles()) {
+            String dataScope = role.getDataScope();
+            if (DATA_SCOPE_ALL.equals(dataScope)) {
+                sqlString = new StringBuilder();
+                f = false;
+                break;
+            } else if (DATA_SCOPE_CUSTOM.equals(dataScope)) {
+                sqlString.append(StringUtils.format(
+                        " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias,
+                        role.getRoleId()));
+            } else if (DATA_SCOPE_DEPT.equals(dataScope)) {
+                sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
+            } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) {
+                sqlString.append(StringUtils.format(
+                        " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
+                        deptAlias, user.getDeptId(), user.getDeptId()));
+            } else if (DATA_SCOPE_SELF.equals(dataScope)) {
+                if (StringUtils.isNotBlank(userAlias)) {
+                    sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
+                } else {
+                    // 数据权限为仅本人且没有userAlias别名不查询任何数据
+                    sqlString.append(" OR 1=0 ");
+                }
+            }
+        }
+        if (f && isSubAdmin) {
+            sqlString.append(StringUtils.format(" OR {}.admin_id = {} ", userAlias, user.getUserId()));
+        }
+        if (StringUtils.isNotBlank(sqlString.toString())) {
+            Object params = joinPoint.getArgs()[0];
+            if (StringUtils.isNotNull(params) && params instanceof BaseEntity) {
+                BaseEntity baseEntity = (BaseEntity) params;
+                baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
+            }
+        }
+    }
+
+    /**
+     * 2.6需求变动数据范围过滤
+     *
+     * @param joinPoint  切点
+     * @param user       用户
+     * @param controllerDataScope  权限注解
+     */
+    public static void dataScopeNewFilter(JoinPoint joinPoint, SysUser user, DataScope controllerDataScope) {
+        StringBuilder sqlString = new StringBuilder();
+        Boolean f = true;
+
+        String deptAlias = controllerDataScope.deptAlias();
+        String userAlias = controllerDataScope.userAlias();
+        if(org.apache.commons.lang3.StringUtils.isBlank(controllerDataScope.permi())){
+            System.err.println("\r\n" + joinPoint.getSignature().getName() + "()方法: 未添加模块注解,请尽快补充!!!" + "\r\n");
+            return;
+        }
+
+        List<SysPermitInfo> permits = user.getPermits();
+        if(CollectionUtils.isEmpty(permits)){
+            throw new PreAuthorizeException();
+        }
+
+        String finalPermi = controllerDataScope.permi() + PerFun.LIST;
+        SysPermitInfo permitInfo = permits.stream().filter(a -> finalPermi.equals(a.getMenuPerms())).findFirst().orElse(null);
+        if(permitInfo == null){
+            return;
+        }
+
+        // 1:全部数据权限
+        String dataScope = permitInfo.getDataScope() + "";
+        if (DATA_SCOPE_ALL.equals(dataScope)) {
+            sqlString = new StringBuilder();
+            f = false;
+        } else if (DATA_SCOPE_CUSTOM.equals(dataScope)) {
+            // 2:本部门以及下级部门
+            sqlString.append(StringUtils.format(
+                    " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
+                    deptAlias, user.getDeptId(), user.getDeptId()));
+        } else if (DATA_SCOPE_DEPT.equals(dataScope)) {
+            // 3:本部门以及指定部门(指定部门关联表中查询)
+            List<Long> deptIds = permitInfo.getDeptIds();
+            if(CollectionUtils.isEmpty(deptIds)){
+                // TODO 数据问题暂这样处理
+                throw new PreAuthorizeException();
+            }else {
+
+                StringBuffer sb = new StringBuffer();
+                for (Long deptId : deptIds) {
+                    sb.append("\'").append(deptId).append("\'").append(",");
+                }
+                sqlString.append(StringUtils.format(
+                        " OR {}.dept_id IN ( {} ) ", deptAlias, sb.substring(0, sb.length()-1)));
+            }
+
+        } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) {
+            // 4:仅本人
+            if (StringUtils.isNotBlank(userAlias)) {
+                sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
+            } else {
+                // 数据权限为仅本人且没有userAlias别名不查询任何数据
+                sqlString.append(" OR 1=0 ");
+            }
+        }
+
+        /*if (f && controllerDataScope.subAdmin()) {
+            sqlString.append(StringUtils.format(" OR {}.admin_id = {} ", userAlias, user.getUserId()));
+        }*/
+
+        if (StringUtils.isNotBlank(sqlString.toString())) {
+            Predicate<JoinPoint> predicate = x-> x.getArgs().length>0;
+            if(predicate.test(joinPoint)) {
+                Object params = joinPoint.getArgs()[0];
+                if (StringUtils.isNotNull(params) && params instanceof BaseEntity) {
+                    BaseEntity baseEntity = (BaseEntity) params;
+                    baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
+                }
+            }
+        }
+    }
+
+    /**
+     * 是否存在注解,如果存在就获取
+     */
+    private DataScope getAnnotationLog(JoinPoint joinPoint) {
+        Signature signature = joinPoint.getSignature();
+        MethodSignature methodSignature = (MethodSignature) signature;
+        Method method = methodSignature.getMethod();
+
+        if (method != null) {
+            return method.getAnnotation(DataScope.class);
+        }
+        return null;
+    }
+
+    /**
+     * 拼接权限sql前先清空params.dataScope参数防止注入
+     */
+    private void clearDataScope(final JoinPoint joinPoint) {
+        Predicate<JoinPoint> predicate = x-> x.getArgs().length>0;
+        if(predicate.test(joinPoint)){
+            Object params = joinPoint.getArgs()[0];
+            if (StringUtils.isNotNull(params) && params instanceof BaseEntity) {
+                BaseEntity baseEntity = (BaseEntity) params;
+                baseEntity.getParams().put(DATA_SCOPE, "");
+            }
+        }
+
+    }
+}

+ 15 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/CaptchaException.java

@@ -0,0 +1,15 @@
+package com.zd.common.core.exception;
+
+/**
+ * 验证码错误异常类
+ *
+ * @author zd
+ */
+public class CaptchaException extends Throwable {
+
+    private static final long serialVersionUID = 1L;
+
+    public CaptchaException(String msg) {
+        super(msg);
+    }
+}

+ 13 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/DemoModeException.java

@@ -0,0 +1,13 @@
+package com.zd.common.core.exception;
+
+/**
+ * 演示模式异常
+ *
+ * @author zd
+ */
+public class DemoModeException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    public DemoModeException() {
+    }
+}

+ 151 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/GlobalExceptionHandler.java

@@ -0,0 +1,151 @@
+package com.zd.common.core.exception;
+
+import com.zd.common.core.utils.StringUtils;
+import com.zd.model.constant.HttpStatus;
+import com.zd.model.domain.AjaxResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.data.redis.RedisSystemException;
+import org.springframework.validation.BindException;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.multipart.MaxUploadSizeExceededException;
+import org.yaml.snakeyaml.constructor.DuplicateKeyException;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * 全局异常处理器
+ *
+ * @author zd
+ */
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+    private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
+
+    /**
+     * 权限异常
+     */
+    @ExceptionHandler(PreAuthorizeException.class)
+    public AjaxResult handlePreAuthorizeException(PreAuthorizeException e, HttpServletRequest request) {
+        String requestURI = request.getRequestURI();
+        log.error("请求地址'{}',权限校验失败'{}'", requestURI, e.getMessage());
+        return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
+    }
+
+    /**
+     * 请求方式不支持
+     */
+    @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
+    public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e,
+                                                          HttpServletRequest request) {
+        String requestURI = request.getRequestURI();
+        log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod());
+        return AjaxResult.error(e.getMessage());
+    }
+
+    /**
+     * 业务异常
+     */
+    @ExceptionHandler(ServiceException.class)
+    public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) {
+        log.error(e.getMessage(), e);
+        Integer code = e.getCode();
+        return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage(), e.getData()) : AjaxResult.error(e.getMessage());
+    }
+
+    /**
+     * 主键重复异常
+     */
+    @ExceptionHandler(DuplicateKeyException.class)
+    public AjaxResult handleDuplicateKeyException(DuplicateKeyException e, HttpServletRequest request) {
+        String requestURI = request.getRequestURI();
+        log.error("请求地址'{}',发生主键重复异常.", requestURI, e);
+        return AjaxResult.error("存在重复数据,操作失败!");
+    }
+
+    /**
+     * 拦截未知的运行时异常
+     */
+    @ExceptionHandler(RuntimeException.class)
+    public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) {
+        String requestURI = request.getRequestURI();
+        log.error("请求地址'{}',发生未知异常.", requestURI, e);
+        return AjaxResult.error(e.getMessage());
+    }
+
+    /**
+     * 系统异常
+     */
+    @ExceptionHandler(Exception.class)
+    public AjaxResult handleException(Exception e, HttpServletRequest request) {
+        String requestURI = request.getRequestURI();
+        log.error("请求地址'{}',发生系统异常.", requestURI, e);
+        return AjaxResult.error(e.getMessage());
+    }
+
+    /**
+     * 自定义验证异常
+     */
+    @ExceptionHandler(BindException.class)
+    public AjaxResult handleBindException(BindException e) {
+        log.error(e.getMessage(), e);
+        String message = e.getAllErrors().get(0).getDefaultMessage();
+        return AjaxResult.error(message);
+    }
+
+    /**
+     * 自定义验证异常
+     */
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
+        log.error(e.getMessage(), e);
+        String message = e.getBindingResult().getFieldError().getDefaultMessage();
+        return AjaxResult.error(message);
+    }
+
+    /**
+     * Reids 异常
+     */
+    @ExceptionHandler(RedisSystemException.class)
+    public Object handleRedisSystemException(RedisSystemException e) {
+        log.error(e.getMessage(), e);
+        return AjaxResult.error("正在重新连接...请重试!");
+    }
+
+    /**
+     * 数据上传过大
+     */
+    @ExceptionHandler(MaxUploadSizeExceededException.class)
+    public Object MaxUploadSizeExceededExceptionHandler(MaxUploadSizeExceededException e) {
+        log.error("MaxUploadSizeExceededException: "+ e);
+        e.printStackTrace();
+        return AjaxResult.error("上传文件太大!");
+    }
+
+    /**
+     * 内部认证异常
+     */
+    @ExceptionHandler(InnerAuthException.class)
+    public AjaxResult handleInnerAuthException(InnerAuthException e) {
+        return AjaxResult.error(e.getMessage());
+    }
+
+    /**
+     * 演示模式异常
+     */
+    @ExceptionHandler(DemoModeException.class)
+    public AjaxResult handleDemoModeException(DemoModeException e) {
+        return AjaxResult.error("演示模式,不允许操作");
+    }
+
+    /**
+     * 不会滚异常
+     */
+    @ExceptionHandler(NoRollException.class)
+    public AjaxResult handleNoRollException(NoRollException e) {
+        return AjaxResult.error(e.getMessage());
+    }
+}

+ 14 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/InnerAuthException.java

@@ -0,0 +1,14 @@
+package com.zd.common.core.exception;
+
+/**
+ * 内部认证异常
+ *
+ * @author zd
+ */
+public class InnerAuthException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    public InnerAuthException(String message) {
+        super(message);
+    }
+}

+ 10 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/NoRollException.java

@@ -0,0 +1,10 @@
+package com.zd.common.core.exception;
+
+public class NoRollException extends RuntimeException{
+
+    private static final long serialVersionUID = 1L;
+
+    public NoRollException(String msg) {
+        super(msg);
+    }
+}

+ 13 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/PreAuthorizeException.java

@@ -0,0 +1,13 @@
+package com.zd.common.core.exception;
+
+/**
+ * 权限异常
+ *
+ * @author zd
+ */
+public class PreAuthorizeException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    public PreAuthorizeException() {
+    }
+}

+ 82 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/ServiceException.java

@@ -0,0 +1,82 @@
+package com.zd.common.core.exception;
+
+/**
+ * 业务异常
+ *
+ * @author zd
+ */
+public final class ServiceException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 错误码
+     */
+    private Integer code;
+
+    /**
+     * 错误提示
+     */
+    private String message;
+
+    /**
+     * 错误明细,内部调试错误
+     * <p>
+     * 一致的设计
+     */
+    private String detailMessage;
+    /**
+     * 异常需要返回的数据
+     */
+    private Object data;
+
+    /**
+     * 空构造方法,避免反序列化问题
+     */
+    public ServiceException() {
+    }
+
+    public ServiceException(String message) {
+        this.message = message;
+    }
+
+    public ServiceException(String message, Integer code) {
+        this.message = message;
+        this.code = code;
+    }
+
+    public ServiceException(String message, Integer code, Object data) {
+        this.message = message;
+        this.code = code;
+        this.data = data;
+    }
+
+    public String getDetailMessage() {
+        return detailMessage;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public ServiceException setMessage(String message) {
+        this.message = message;
+        return this;
+    }
+
+    public ServiceException setDetailMessage(String detailMessage) {
+        this.detailMessage = detailMessage;
+        return this;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+}

+ 29 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/TaskException.java

@@ -0,0 +1,29 @@
+package com.zd.common.core.exception;
+
+/**
+ * 计划策略异常
+ *
+ * @author zd
+ */
+public class TaskException extends Exception {
+    private static final long serialVersionUID = 1L;
+
+    private Code code;
+
+    public TaskException(String msg, Code code) {
+        this(msg, code, null);
+    }
+
+    public TaskException(String msg, Code code, Exception nestedEx) {
+        super(msg, nestedEx);
+        this.code = code;
+    }
+
+    public Code getCode() {
+        return code;
+    }
+
+    public enum Code {
+        TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
+    }
+}

+ 22 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/UtilException.java

@@ -0,0 +1,22 @@
+package com.zd.common.core.exception;
+
+/**
+ * 工具类异常
+ *
+ * @author zd
+ */
+public class UtilException extends RuntimeException {
+    private static final long serialVersionUID = 8247610319171014183L;
+
+    public UtilException(Throwable e) {
+        super(e.getMessage(), e);
+    }
+
+    public UtilException(String message) {
+        super(message);
+    }
+
+    public UtilException(String message, Throwable throwable) {
+        super(message, throwable);
+    }
+}

+ 69 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/base/BaseException.java

@@ -0,0 +1,69 @@
+package com.zd.common.core.exception.base;
+
+/**
+ * 基础异常
+ *
+ * @author zd
+ */
+public class BaseException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 所属模块
+     */
+    private String module;
+
+    /**
+     * 错误码
+     */
+    private String code;
+
+    /**
+     * 错误码对应的参数
+     */
+    private Object[] args;
+
+    /**
+     * 错误消息
+     */
+    private String defaultMessage;
+
+    public BaseException(String module, String code, Object[] args, String defaultMessage) {
+        this.module = module;
+        this.code = code;
+        this.args = args;
+        this.defaultMessage = defaultMessage;
+    }
+
+    public BaseException(String module, String code, Object[] args) {
+        this(module, code, args, null);
+    }
+
+    public BaseException(String module, String defaultMessage) {
+        this(module, null, null, defaultMessage);
+    }
+
+    public BaseException(String code, Object[] args) {
+        this(null, code, args, null);
+    }
+
+    public BaseException(String defaultMessage) {
+        this(null, null, null, defaultMessage);
+    }
+
+    public String getModule() {
+        return module;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public Object[] getArgs() {
+        return args;
+    }
+
+    public String getDefaultMessage() {
+        return defaultMessage;
+    }
+}

+ 17 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/file/FileException.java

@@ -0,0 +1,17 @@
+package com.zd.common.core.exception.file;
+
+import com.zd.common.core.exception.base.BaseException;
+
+/**
+ * 文件信息异常类
+ *
+ * @author zd
+ */
+public class FileException extends BaseException {
+    private static final long serialVersionUID = 1L;
+
+    public FileException(String code, Object[] args) {
+        super("file", code, args, null);
+    }
+
+}

+ 14 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/file/FileNameLengthLimitExceededException.java

@@ -0,0 +1,14 @@
+package com.zd.common.core.exception.file;
+
+/**
+ * 文件名称超长限制异常类
+ *
+ * @author zd
+ */
+public class FileNameLengthLimitExceededException extends FileException {
+    private static final long serialVersionUID = 1L;
+
+    public FileNameLengthLimitExceededException(int defaultFileNameLength) {
+        super("upload.filename.exceed.length", new Object[]{defaultFileNameLength});
+    }
+}

+ 0 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/file/FileSizeLimitExceededException.java


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott