Explorar o código

【移除】 已合并如算法的module

linfutong %!s(int64=3) %!d(string=hai) anos
pai
achega
60c6e40bc1
Modificáronse 100 ficheiros con 0 adicións e 8796 borrados
  1. 0 10
      zd-auth/src/main/resources/banner.txt
  2. 0 5
      zd-modules/pom.xml
  3. 0 10
      zd-modules/zd-alarm/Dockerfile
  4. 0 102
      zd-modules/zd-alarm/pom.xml
  5. 0 23
      zd-modules/zd-alarm/src/main/java/com/zd/alarm/ZdAlarmApplication.java
  6. 0 73
      zd-modules/zd-alarm/src/main/java/com/zd/alarm/controller/AlarmController.java
  7. 0 109
      zd-modules/zd-alarm/src/main/java/com/zd/alarm/domain/AlarmLog.java
  8. 0 64
      zd-modules/zd-alarm/src/main/java/com/zd/alarm/mapper/AlarmLogMapper.java
  9. 0 233
      zd-modules/zd-alarm/src/main/java/com/zd/alarm/mqtt/MqttConfig.java
  10. 0 64
      zd-modules/zd-alarm/src/main/java/com/zd/alarm/service/IAlarmLogService.java
  11. 0 94
      zd-modules/zd-alarm/src/main/java/com/zd/alarm/service/impl/AlarmLogServiceImpl.java
  12. 0 126
      zd-modules/zd-alarm/src/main/java/com/zd/alarm/utils/AlarmUtil.java
  13. 0 10
      zd-modules/zd-alarm/src/main/resources/banner.txt
  14. 0 27
      zd-modules/zd-alarm/src/main/resources/bootstrap.yml
  15. 0 74
      zd-modules/zd-alarm/src/main/resources/logback.xml
  16. 0 100
      zd-modules/zd-alarm/src/main/resources/mapper/alarm/AlarmLogMapper.xml
  17. 0 182
      zd-modules/zd-alarm/wait-for-it.sh
  18. 0 10
      zd-modules/zd-base/src/main/resources/banner.txt
  19. 0 10
      zd-modules/zd-common-face/Dockerfile
  20. 0 94
      zd-modules/zd-common-face/pom.xml
  21. 0 22
      zd-modules/zd-common-face/src/main/java/com/zd/face/AppFace.java
  22. 0 139
      zd-modules/zd-common-face/src/main/java/com/zd/face/config/FaceProperties.java
  23. 0 105
      zd-modules/zd-common-face/src/main/java/com/zd/face/controller/FaceApi.java
  24. 0 142
      zd-modules/zd-common-face/src/main/java/com/zd/face/controller/FaceManagerApi.java
  25. 0 174
      zd-modules/zd-common-face/src/main/java/com/zd/face/handle/FaceEngineFactory.java
  26. 0 27
      zd-modules/zd-common-face/src/main/java/com/zd/face/handle/SDKRegister.java
  27. 0 102
      zd-modules/zd-common-face/src/main/java/com/zd/face/service/FaceService.java
  28. 0 29
      zd-modules/zd-common-face/src/main/java/com/zd/face/utils/FileUtil.java
  29. 0 26
      zd-modules/zd-common-face/src/main/java/com/zd/face/valid/KeyNotNull.java
  30. 0 26
      zd-modules/zd-common-face/src/main/java/com/zd/face/valid/KeyValidator.java
  31. 0 10
      zd-modules/zd-common-face/src/main/resources/banner.txt
  32. 0 27
      zd-modules/zd-common-face/src/main/resources/bootstrap.yml
  33. BIN=BIN
      zd-modules/zd-common-face/src/main/resources/libs/arcsoft-sdk-face-3.0.0.0.jar
  34. 0 74
      zd-modules/zd-common-face/src/main/resources/logback.xml
  35. 0 182
      zd-modules/zd-common-face/wait-for-it.sh
  36. 0 10
      zd-modules/zd-forward/Dockerfile
  37. 0 118
      zd-modules/zd-forward/pom.xml
  38. 0 35
      zd-modules/zd-forward/src/main/java/com/zd/forward/ForwardApp.java
  39. 0 105
      zd-modules/zd-forward/src/main/java/com/zd/forward/component/AppStartedListener.java
  40. 0 293
      zd-modules/zd-forward/src/main/java/com/zd/forward/config/AlgorithmYml.java
  41. 0 110
      zd-modules/zd-forward/src/main/java/com/zd/forward/config/WebConfig.java
  42. 0 45
      zd-modules/zd-forward/src/main/java/com/zd/forward/controller/AlarmController.java
  43. 0 164
      zd-modules/zd-forward/src/main/java/com/zd/forward/controller/SignInCheckController.java
  44. 0 13
      zd-modules/zd-forward/src/main/java/com/zd/forward/domain/AnalysisData.java
  45. 0 30
      zd-modules/zd-forward/src/main/java/com/zd/forward/domain/BaseRequestData.java
  46. 0 14
      zd-modules/zd-forward/src/main/java/com/zd/forward/domain/DataPostAnalysisRespDto.java
  47. 0 62
      zd-modules/zd-forward/src/main/java/com/zd/forward/domain/ImageRequestData.java
  48. 0 18
      zd-modules/zd-forward/src/main/java/com/zd/forward/domain/ImgPostResponse.java
  49. 0 103
      zd-modules/zd-forward/src/main/java/com/zd/forward/domain/RequestData.java
  50. 0 96
      zd-modules/zd-forward/src/main/java/com/zd/forward/domain/VideoRequestData.java
  51. 0 49
      zd-modules/zd-forward/src/main/java/com/zd/forward/listener/StartListener.java
  52. 0 51
      zd-modules/zd-forward/src/main/java/com/zd/forward/properties/FireProperties.java
  53. 0 17
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/CheckResultValid.java
  54. 0 546
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/CheckService.java
  55. 0 132
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/FireImageService.java
  56. 0 31
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/ImageCheckResultValidImpl.java
  57. 0 81
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/ImageService.java
  58. 0 104
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/LoginService.java
  59. 0 58
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/PeopleCheckResultValidImpl.java
  60. 0 263
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/SendSginAccessLogService.java
  61. 0 18
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/ShiYanFuCheckResultValidImpl.java
  62. 0 17
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/VideoCheckResultValid.java
  63. 0 31
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/VideoCheckResultValidImpl.java
  64. 0 46
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/mqtt/CommonSend.java
  65. 0 28
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/mqtt/MqttOutListener.java
  66. 0 39
      zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/mqtt/MqttProducer.java
  67. 0 78
      zd-modules/zd-forward/src/main/java/com/zd/forward/thread/ThreadPoolTaskConfig.java
  68. 0 93
      zd-modules/zd-forward/src/main/java/com/zd/forward/util/Base64DecodedMultipartFile.java
  69. 0 76
      zd-modules/zd-forward/src/main/java/com/zd/forward/util/Base64ToMultipartFile.java
  70. 0 201
      zd-modules/zd-forward/src/main/java/com/zd/forward/util/FileUploadUtils.java
  71. 0 93
      zd-modules/zd-forward/src/main/java/com/zd/forward/utils/Base64DecodedMultipartFile.java
  72. 0 76
      zd-modules/zd-forward/src/main/java/com/zd/forward/utils/Base64ToMultipartFile.java
  73. 0 201
      zd-modules/zd-forward/src/main/java/com/zd/forward/utils/FileUploadUtils.java
  74. 0 115
      zd-modules/zd-forward/src/main/java/com/zd/forward/utils/HttpUtils.java
  75. 0 51
      zd-modules/zd-forward/src/main/java/com/zd/forward/utils/VideoUtils.java
  76. 0 10
      zd-modules/zd-forward/src/main/resources/banner.txt
  77. 0 25
      zd-modules/zd-forward/src/main/resources/bootstrap.yml
  78. 0 74
      zd-modules/zd-forward/src/main/resources/logback.xml
  79. 0 182
      zd-modules/zd-forward/wait-for-it.sh
  80. 0 97
      zd-modules/zd-smartlock/pom.xml
  81. 0 23
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/ZdSmartlockApplication.java
  82. 0 125
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SlApplyApprovalController.java
  83. 0 198
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SlOpendoorApplyController.java
  84. 0 190
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SlSubjectRelationController.java
  85. 0 128
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SlUserRelationController.java
  86. 0 52
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SmartlockController.java
  87. 0 70
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/BaseDomain.java
  88. 0 99
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/SlApplyApproval.java
  89. 0 300
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/SlOpendoorApply.java
  90. 0 188
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/SlSubjectRelation.java
  91. 0 89
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/SlUserRelation.java
  92. 0 104
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlBuild.java
  93. 0 84
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlDoorLock.java
  94. 0 58
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlGroup.java
  95. 0 42
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlLockOnline.java
  96. 0 80
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlOpenAndClosLog.java
  97. 0 82
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlOpenDoorSearch.java
  98. 0 123
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlPostUser.java
  99. 0 157
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlRoom.java
  100. 0 0
      zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlUser.java

+ 0 - 10
zd-auth/src/main/resources/banner.txt

@@ -1,10 +0,0 @@
-Spring Boot Version: ${spring-boot.version}
-Spring Application Name: ${spring.application.name}
-                            _                        _    _     
-                           (_)                      | |  | |    
- _ __  _   _   ___   _   _  _  ______   __ _  _   _ | |_ | |__  
-| '__|| | | | / _ \ | | | || ||______| / _` || | | || __|| '_ \ 
-| |   | |_| || (_) || |_| || |        | (_| || |_| || |_ | | | |
-|_|    \__,_| \___/  \__, ||_|         \__,_| \__,_| \__||_| |_|
-                      __/ |                                     
-                     |___/                                      

+ 0 - 5
zd-modules/pom.xml

@@ -17,14 +17,9 @@
         <module>zd-modules-laboratory</module>
         <module>zd-modules-app</module>
         <module>zd-camera</module>
-        <module>zd-common-face</module>
-        <module>zd-alarm</module>
-        <module>zd-forward</module>
         <module>zd-airbottle</module>
         <module>zd-chemical</module>
-        <module>zd-speaker</module>
         <module>zd-netty</module>
-        <module>zd-smartlock</module>
         <module>zd-bottle-parent</module>
         <module>zd-algorithm</module>
         <module>zd-base</module>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 10
zd-modules/zd-alarm/Dockerfile


+ 0 - 102
zd-modules/zd-alarm/pom.xml

@@ -1,102 +0,0 @@
-<?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-modules</artifactId>
-        <groupId>com.zd</groupId>
-        <version>3.1.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>zd-alarm</artifactId>
-    <packaging>jar</packaging>
-    <description>报警服务</description>
-
-    <dependencies>
-        <!-- SpringCloud Alibaba Nacos -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-        </dependency>
-
-        <!-- SpringCloud Alibaba Nacos Config -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
-        <!-- SpringBoot Actuator -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-actuator</artifactId>
-        </dependency>
-
-        <!-- Mysql Connector -->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
-
-        <!-- zd Common DataSource -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-datasource</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
-        <!-- zd Common Log -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-log</artifactId>
-        </dependency>
-
-        <!-- zd Common Swagger -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-swagger</artifactId>
-        </dependency>
-
-        <!--mqtt客户端链接服务-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-integration</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.integration</groupId>
-            <artifactId>spring-integration-stream</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.integration</groupId>
-            <artifactId>spring-integration-mqtt</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <finalName>${project.artifactId}</finalName>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <!-- 打包时跳过test插件,不运行test测试用例 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>${maven-surefire-plugin.version}</version>
-                <configuration>
-                    <skipTests>true</skipTests>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 23
zd-modules/zd-alarm/src/main/java/com/zd/alarm/ZdAlarmApplication.java

@@ -1,23 +0,0 @@
-package com.zd.alarm;
-
-import com.zd.common.security.annotation.EnableCustomConfig;
-import com.zd.common.security.annotation.EnableRyFeignClients;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.ConfigurableApplicationContext;
-
-/**
- * 报警系统启动类
- */
-@EnableCustomConfig
-@EnableRyFeignClients
-@SpringBootApplication
-public class ZdAlarmApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(ZdAlarmApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  报警系统启动成功   ლ(´ڡ`ლ)゙");
-    }
-}

+ 0 - 73
zd-modules/zd-alarm/src/main/java/com/zd/alarm/controller/AlarmController.java

@@ -1,73 +0,0 @@
-package com.zd.alarm.controller;
-
-import com.zd.alarm.domain.AlarmLog;
-import com.zd.alarm.service.IAlarmLogService;
-import com.zd.alarm.utils.AlarmUtil;
-import com.zd.common.core.utils.DateUtils;
-import com.zd.common.core.web.domain.AjaxResult;
-import com.zd.system.api.alarm.domain.AlarmEntrty;
-import com.zd.system.api.alarm.domain.SendTypes;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Map;
-
-@RestController
-@RequestMapping("/alarm")
-public class AlarmController {
-
-    @Autowired
-    private AlarmUtil alarmUtil;
-
-    @Autowired
-    private IAlarmLogService alarmLogService;
-
-    @PostMapping("/send")
-    public AjaxResult queryOption(@RequestBody AlarmEntrty alarmEntrty) {
-        Map<String, String> map = alarmUtil.sendPost(alarmEntrty);
-
-        String data = map.get("Reply");
-        if((SendTypes.Call + "").equals(alarmEntrty.getType()) || (SendTypes.All + "").equals(alarmEntrty.getType())){
-            if("OK".equals(data)) {
-                String[] phones = alarmEntrty.getTo();
-                for (String phone : phones) {
-                    AlarmLog alarmLog = new AlarmLog();
-                    alarmLog.setIsBack(1);
-                    alarmLog.setPhone(phone);
-                    alarmLog.setNotice(alarmEntrty.getText());
-                    alarmLog.setMethod("电话");
-                    alarmLog.setStatus("成功");
-                    alarmLog.setCreateTime(DateUtils.getNowDate());
-                    alarmLog.setUpdateTime(DateUtils.getNowDate());
-
-                    alarmLogService.insertAlarmLog(alarmLog);
-                }
-                return AjaxResult.success();
-            }else {
-                String[] phones = alarmEntrty.getTo();
-                for (String phone : phones) {
-                    AlarmLog alarmLog = new AlarmLog();
-                    alarmLog.setIsBack(1);
-                    alarmLog.setPhone(phone);
-                    alarmLog.setNotice(alarmEntrty.getText());
-                    alarmLog.setMethod("电话");
-                    alarmLog.setStatus("失败");
-                    alarmLog.setRemark(data);
-                    alarmLog.setCreateTime(DateUtils.getNowDate());
-                    alarmLog.setUpdateTime(DateUtils.getNowDate());
-
-                    alarmLogService.insertAlarmLog(alarmLog);
-                }
-                return AjaxResult.error(data);
-            }
-        }else if((SendTypes.SMS + "").equals(alarmEntrty.getType())) {
-            if ("OK".equals(data)) {
-                return AjaxResult.success();
-            }
-        }
-        return AjaxResult.error("报警发送错误:" + data);
-    }
-}

+ 0 - 109
zd-modules/zd-alarm/src/main/java/com/zd/alarm/domain/AlarmLog.java

@@ -1,109 +0,0 @@
-package com.zd.alarm.domain;
-
-import cn.hutool.json.JSONUtil;
-import com.zd.common.core.annotation.Excel;
-import com.zd.common.core.web.domain.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;
-
-/**
- * 电话报警推送日志对象 alarm_log
- *
- * @author liubo
- * @date 2021-11-11
- */
-@ApiModel("电话报警推送日志")
-public class AlarmLog extends BaseEntity {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * $column.columnComment
-     */
-    @ApiModelProperty(value = "${comment}")
-    private Long id;
-    /**
-     * 电话号码
-     */
-    @Excel(name = "电话号码")
-    @ApiModelProperty(value = "电话号码")
-    private String phone;
-    /**
-     * 报警状态(字符串)
-     */
-    @Excel(name = "报警状态", readConverterExp = "字=符串")
-    @ApiModelProperty(value = "报警状态")
-    private String status;
-    /**
-     * 报警内容
-     */
-    @Excel(name = "报警内容")
-    @ApiModelProperty(value = "报警内容")
-    private String notice;
-    /**
-     * 报警方式
-     */
-    @Excel(name = "报警方式")
-    @ApiModelProperty(value = "报警方式")
-    private String method;
-    /**
-     * 是否回写(0 默认,1 已回写)
-     */
-    @Excel(name = "是否回写", readConverterExp = "0=默认,1=已回写")
-    @ApiModelProperty(value = "是否回写")
-    private Integer isBack;
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setNotice(String notice) {
-        this.notice = notice;
-    }
-
-    public String getNotice() {
-        return notice;
-    }
-
-    public void setMethod(String method) {
-        this.method = method;
-    }
-
-    public String getMethod() {
-        return method;
-    }
-
-    public void setIsBack(Integer isBack) {
-        this.isBack = isBack;
-    }
-
-    public Integer getIsBack() {
-        return isBack;
-    }
-
-    @Override
-    public String toString() {
-        return JSONUtil.toJsonStr(this);
-    }
-}

+ 0 - 64
zd-modules/zd-alarm/src/main/java/com/zd/alarm/mapper/AlarmLogMapper.java

@@ -1,64 +0,0 @@
-package com.zd.alarm.mapper;
-
-import com.zd.alarm.domain.AlarmLog;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 电话报警推送日志Mapper接口
- *
- * @author liubo
- * @date 2021-11-11
- */
-public interface AlarmLogMapper {
-    /**
-     * 查询电话报警推送日志
-     *
-     * @param id 电话报警推送日志主键
-     * @return 电话报警推送日志
-     */
-    public AlarmLog selectAlarmLogById(Long id);
-
-    /**
-     * 查询电话报警推送日志列表
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 电话报警推送日志集合
-     */
-    public List<AlarmLog> selectAlarmLogList(AlarmLog alarmLog);
-
-    /**
-     * 新增电话报警推送日志
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 结果
-     */
-    public int insertAlarmLog(AlarmLog alarmLog);
-
-    /**
-     * 修改电话报警推送日志
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 结果
-     */
-    public int updateAlarmLog(AlarmLog alarmLog);
-
-    /**
-     * 删除电话报警推送日志
-     *
-     * @param id 电话报警推送日志主键
-     * @return 结果
-     */
-    public int deleteAlarmLogById(Long id);
-
-    /**
-     * 批量删除电话报警推送日志
-     *
-     * @param ids 需要删除的数据主键集合
-     * @return 结果
-     */
-    public int deleteAlarmLogByIds(Long[] ids);
-
-    List<AlarmLog> selectNoBackAlarmLogList(Map<String, Object> params);
-}

+ 0 - 233
zd-modules/zd-alarm/src/main/java/com/zd/alarm/mqtt/MqttConfig.java

@@ -1,233 +0,0 @@
-package com.zd.alarm.mqtt;
-
-import com.alibaba.druid.support.json.JSONUtils;
-import com.alibaba.fastjson.JSON;
-import com.zd.alarm.domain.AlarmLog;
-import com.zd.alarm.service.IAlarmLogService;
-import com.zd.alarm.utils.AlarmUtil;
-import com.zd.common.core.utils.DateUtils;
-import com.zd.system.api.alarm.domain.AlarmEntrty;
-import com.zd.system.api.alarm.domain.Routes;
-import com.zd.system.api.alarm.domain.SendTypes;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang.StringUtils;
-import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.integration.annotation.ServiceActivator;
-import org.springframework.integration.channel.DirectChannel;
-import org.springframework.integration.core.MessageProducer;
-import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory;
-import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
-import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
-import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;
-import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter;
-import org.springframework.integration.mqtt.support.MqttHeaders;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.messaging.MessageHandler;
-import org.springframework.messaging.MessagingException;
-
-import java.util.*;
-
-/**
- * mqtt配置
- */
-@Configuration
-public class MqttConfig {
-
-    @Autowired
-    private AlarmUtil alarmUtil;
-    @Autowired
-    private IAlarmLogService alarmLogService;
-
-    static Logger logger = LoggerFactory.getLogger(MqttConfig.class);
-
-    private static final byte[] WILL_DATA;
-
-    static {
-        WILL_DATA = "offline".getBytes();
-    }
-
-    public static final String MQTT_INBOUND_CHANNEL = "mqttInboundChannel";
-
-
-    public static final String MQTT_OUTBOUND_CHANNEL = "mqttOutboundChannel";
-
-    @Value("${mqtt.username:}")
-    private String username;
-
-    @Value("${mqtt.password:}")
-    private String password;
-
-    @Value("${mqtt.url}")
-    private String url;
-
-    @Value("${mqtt.defaultTopic}")
-    private String defaultTopic;
-
-    @Value("${mqtt.producer.clientId}")
-    private String producerClientId;
-
-    @Value("${mqtt.consumer.clientId}")
-    private String consumerClientId;
-
-    @Value("${mqtt.consumer.maxInflight}")
-    private Integer maxInflight;
-
-    private MqttPahoMessageDrivenChannelAdapter adapter;
-
-    /**
-     * 连接mqtt配置
-     */
-    @Bean
-    public MqttConnectOptions mqttConnectOptions() {
-        MqttConnectOptions options = new MqttConnectOptions();
-        // false,服务器会保留客户端的连接记录
-        // true,表示每次连接到服务器都以新的身份连接
-        options.setCleanSession(false);
-        options.setUserName(username);
-        options.setPassword(password.toCharArray());
-//        options.setMaxInflight(maxInflight);
-        options.setServerURIs(StringUtils.split(url, ","));
-        //超时时间 单位为秒
-        options.setConnectionTimeout(10);
-        //会话心跳时间 单位: s, 间隔时间:1.5*20秒向客户端发送心跳判断客户端是否在线
-        options.setKeepAliveInterval(60);
-        //设置“遗嘱”消息的话题,若客户端与服务器之间的连接意外中断,服务器将发布客户端的“遗嘱”消息。
-//        options.setWill("willTopic", WILL_DATA, 2, false);
-        return options;
-    }
-
-
-    /**
-     * MQTT客户端
-     */
-    @Bean
-    public MqttPahoClientFactory mqttClientFactory() {
-        DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory();
-        factory.setConnectionOptions(mqttConnectOptions());
-        return factory;
-    }
-
-    /**
-     * 发送者消息通道
-     */
-    @Bean(name = MQTT_OUTBOUND_CHANNEL)
-    public MessageChannel mqttOutboundChannel() {
-        return new DirectChannel();
-    }
-
-    /**
-     * 发送者消息处理
-     */
-    @Bean
-    @ServiceActivator(inputChannel = MQTT_OUTBOUND_CHANNEL)
-    public MessageHandler mqttOutbound() {
-        MqttPahoMessageHandler messageHandler = new MqttPahoMessageHandler(
-                producerClientId,
-                mqttClientFactory());
-        messageHandler.setAsync(true);
-        messageHandler.setDefaultTopic(defaultTopic);
-        return messageHandler;
-    }
-
-    /**
-     * 消息订阅
-     */
-    @Bean
-    public MessageProducer inbound() {
-        // 可同时消费(订阅)多个Topic
-        adapter = new MqttPahoMessageDrivenChannelAdapter(consumerClientId, mqttClientFactory(), StringUtils.split(defaultTopic, ","));
-        adapter.setCompletionTimeout(5000);
-        adapter.setConverter(new DefaultPahoMessageConverter());
-        adapter.setQos(2);
-        // 设置订阅通道
-        adapter.setOutputChannel(mqttInboundChannel());
-        return adapter;
-    }
-
-
-    /**
-     * 消费者消息通道
-     */
-    @Bean(name = MQTT_INBOUND_CHANNEL)
-    public MessageChannel mqttInboundChannel() {
-        return new DirectChannel();
-    }
-
-    /**
-     * 消费者消息处理
-     *设备心跳
-     */
-    @Bean
-    @ServiceActivator(inputChannel = MQTT_INBOUND_CHANNEL)
-    public MessageHandler mqttInbound() {
-
-        return new MessageHandler() {
-            @Override
-            public void handleMessage(Message<?> message) throws MessagingException {
-                String receivedTopic = (String) message.getHeaders().get(MqttHeaders.RECEIVED_TOPIC);
-
-                logger.info("MQTT 接收 topic:  {}",receivedTopic);
-
-                String msg = (String) message.getPayload();
-                logger.info("MQTT 接收 消息体:  {}",msg);
-
-                try {
-                    String type = SendTypes.All+"";
-                    Map<String,Object> map = JSON.parseObject(msg, Map.class);
-
-                    map = JSON.parseObject(map.get("data")+"", Map.class);
-
-                    String text = (String) map.get("text");
-                    List<String> list = JSON.parseArray(map.get("to")+"", String.class);
-                    if(CollectionUtils.isEmpty(list)){
-                        logger.error("接收告警消息手机号为空!");
-                        return;
-                    }
-
-                    Set<String> set = new HashSet<>(list);
-                    String[] to = new String[set.size()];
-                    set.toArray(to);
-
-                    String dataType = (String) map.get("type");
-                    if(map.get("type") != null && ((SendTypes.All+"").equals(dataType)
-                            || (SendTypes.Call+"").equals(dataType) || (SendTypes.SMS+"").equals(dataType))){
-                        type = dataType;
-                    }
-
-                    AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, to, type, text);
-
-                    map = alarmUtil.sendPost(alarmEntrty);
-
-                    String data = (String) map.get("Reply");
-                    if("OK".equals(data)){
-                        String[] phones = alarmEntrty.getTo();
-                        for (String phone : phones) {
-                            AlarmLog alarmLog = new AlarmLog();
-                            alarmLog.setRemark("预案ID/实验室ID: " + receivedTopic.replace(defaultTopic, ""));
-                            alarmLog.setIsBack(0);
-                            alarmLog.setStatus("失败");
-                            alarmLog.setPhone(phone);
-                            alarmLog.setNotice(alarmEntrty.getText());
-                            alarmLog.setCreateTime(DateUtils.getNowDate());
-
-                            alarmLogService.insertAlarmLog(alarmLog);
-                        }
-                    }else {
-                        logger.error("报警电话推送错误:" + JSONUtils.toJSONString(map));
-                    }
-                }catch (Exception e){
-                    e.printStackTrace();
-                    logger.error("报警处理数据异常:" + e.getMessage());
-                }
-
-            }
-        };
-    }
-}

+ 0 - 64
zd-modules/zd-alarm/src/main/java/com/zd/alarm/service/IAlarmLogService.java

@@ -1,64 +0,0 @@
-package com.zd.alarm.service;
-
-import com.zd.alarm.domain.AlarmLog;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 电话报警推送日志Service接口
- *
- * @author liubo
- * @date 2021-11-11
- */
-public interface IAlarmLogService {
-    /**
-     * 查询电话报警推送日志
-     *
-     * @param id 电话报警推送日志主键
-     * @return 电话报警推送日志
-     */
-    public AlarmLog selectAlarmLogById(Long id);
-
-    /**
-     * 查询电话报警推送日志列表
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 电话报警推送日志集合
-     */
-    public List<AlarmLog> selectAlarmLogList(AlarmLog alarmLog);
-
-    /**
-     * 新增电话报警推送日志
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 结果
-     */
-    public int insertAlarmLog(AlarmLog alarmLog);
-
-    /**
-     * 修改电话报警推送日志
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 结果
-     */
-    public int updateAlarmLog(AlarmLog alarmLog);
-
-    /**
-     * 批量删除电话报警推送日志
-     *
-     * @param ids 需要删除的电话报警推送日志主键集合
-     * @return 结果
-     */
-    public int deleteAlarmLogByIds(Long[] ids);
-
-    /**
-     * 删除电话报警推送日志信息
-     *
-     * @param id 电话报警推送日志主键
-     * @return 结果
-     */
-    public int deleteAlarmLogById(Long id);
-
-    List<AlarmLog> selectNoBackAlarmLogList(Map<String, Object> params);
-}

+ 0 - 94
zd-modules/zd-alarm/src/main/java/com/zd/alarm/service/impl/AlarmLogServiceImpl.java

@@ -1,94 +0,0 @@
-package com.zd.alarm.service.impl;
-
-import com.zd.alarm.domain.AlarmLog;
-import com.zd.alarm.mapper.AlarmLogMapper;
-import com.zd.alarm.service.IAlarmLogService;
-import com.zd.common.security.utils.SaveUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 电话报警推送日志Service业务层处理
- *
- * @author liubo
- * @date 2021-11-11
- */
-@Service
-public class AlarmLogServiceImpl implements IAlarmLogService {
-    @Autowired
-    private AlarmLogMapper alarmLogMapper;
-
-    /**
-     * 查询电话报警推送日志
-     *
-     * @param id 电话报警推送日志主键
-     * @return 电话报警推送日志
-     */
-    @Override
-    public AlarmLog selectAlarmLogById(Long id) {
-        return alarmLogMapper.selectAlarmLogById(id);
-    }
-
-    /**
-     * 查询电话报警推送日志列表
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 电话报警推送日志
-     */
-    @Override
-    public List<AlarmLog> selectAlarmLogList(AlarmLog alarmLog) {
-        return alarmLogMapper.selectAlarmLogList(alarmLog);
-    }
-
-    /**
-     * 新增电话报警推送日志
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 结果
-     */
-    @Override
-    public int insertAlarmLog(AlarmLog alarmLog) {
-        return alarmLogMapper.insertAlarmLog(alarmLog);
-    }
-
-    /**
-     * 修改电话报警推送日志
-     *
-     * @param alarmLog 电话报警推送日志
-     * @return 结果
-     */
-    @Override
-    public int updateAlarmLog(AlarmLog alarmLog) {
-        return alarmLogMapper.updateAlarmLog(alarmLog);
-    }
-
-    /**
-     * 批量删除电话报警推送日志
-     *
-     * @param ids 需要删除的电话报警推送日志主键
-     * @return 结果
-     */
-    @Override
-    public int deleteAlarmLogByIds(Long[] ids) {
-        return alarmLogMapper.deleteAlarmLogByIds(ids);
-    }
-
-    /**
-     * 删除电话报警推送日志信息
-     *
-     * @param id 电话报警推送日志主键
-     * @return 结果
-     */
-    @Override
-    public int deleteAlarmLogById(Long id) {
-        return alarmLogMapper.deleteAlarmLogById(id);
-    }
-
-    @Override
-    public List<AlarmLog> selectNoBackAlarmLogList(Map<String, Object> params) {
-        return alarmLogMapper.selectNoBackAlarmLogList(params);
-    }
-}

+ 0 - 126
zd-modules/zd-alarm/src/main/java/com/zd/alarm/utils/AlarmUtil.java

@@ -1,126 +0,0 @@
-package com.zd.alarm.utils;
-
-import cn.hutool.core.date.DateUnit;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.http.HttpUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.zd.alarm.domain.AlarmLog;
-import com.zd.alarm.service.IAlarmLogService;
-import com.zd.common.core.utils.DateUtils;
-import com.zd.system.api.alarm.domain.AlarmEntrty;
-import com.zd.system.api.alarm.domain.Routes;
-import com.zd.system.api.alarm.domain.SendTypes;
-import org.apache.commons.collections4.CollectionUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-import javax.validation.constraints.NotNull;
-import java.util.*;
-
-/**
- * 报警工具类
- * @author liubo
- */
-@Component
-@EnableScheduling
-public class AlarmUtil {
-    private static final Logger logger = LoggerFactory.getLogger(AlarmUtil.class);
-
-    @Value("${alarm.host}")
-    private String alarmUrl ;
-
-    @Value("${alarm.retry}")
-    private Integer retryCount ;
-
-    @Autowired
-    private IAlarmLogService alarmLogService;
-
-
-    /**
-     * 链接超时 项目启动会失败
-     */
-    @PostConstruct
-    private void alarmInint(){
-        sendGet(Routes.SystemStatusSnapshot);
-        sendPost(new AlarmEntrty(Routes.NoticePush, new String[]{"18681887295"}, SendTypes.Call+"","启动项目电话报警服务测试!"));
-    }
-
-    /**
-     * 发送语音报警对接功能
-     */
-    public Map sendPost(AlarmEntrty alarmEntrty) {
-        logger.info("语音报警发送内容:" + alarmEntrty.toString());
-
-        String url = alarmUrl + alarmEntrty.getRoute().getUrl();
-
-        String result = HttpUtil.post(url, alarmEntrty.toString());
-
-        logger.info("语音报警发送结果:" + result);
-        Map<String, String> map = JSONObject.parseObject(result, Map.class);
-        return map;
-    }
-
-    /**
-     * 发送除语音报警 的其他功能
-     */
-    public String sendGet(@NotNull Routes route){
-        return HttpUtil.get(alarmUrl + route.getUrl(), 3000);
-    }
-
-
-
-    /**
-     * 定时检测 重试
-     */
-    @Scheduled(fixedRate=60 * 1000)
-    public void timerCount(){
-
-        Map<String, Object> params = new HashMap<>();
-        params.put("retryCount", retryCount);
-        params.put("date", DateUtils.getNowDate());
-        List<AlarmLog> alarmLogs = alarmLogService.selectNoBackAlarmLogList(params);
-        if(CollectionUtils.isNotEmpty(alarmLogs)){
-            String data = sendGet(Routes.NoticeResult);
-            List<Map> datas = JSONObject.parseArray(data, Map.class);
-            if(CollectionUtils.isNotEmpty(datas)){
-
-                Date date;
-                List<String> failPhones = new ArrayList<>();
-                for (AlarmLog alarmLog : alarmLogs) {
-                    for (Map map : datas) {
-
-                        if("电话".equals(map.get("method")) && alarmLog.getPhone().equals(map.get("to")) && alarmLog.getNotice().equals(map.get("notice"))){
-                            date = DateUtil.parse(map.get("time")+ "");
-                            Long timer = DateUtil.between(date, alarmLog.getCreateTime(), DateUnit.MINUTE, false);
-
-                            // 此处 > 0 校验 电话报警发送在日志记录之前
-                            // < 30 报警在 30 分钟只能完成,超过则不发
-                            if(timer <= 0 && timer > -30){
-                                alarmLog.setIsBack(alarmLog.getIsBack() + 1);
-                                alarmLog.setStatus(map.get("status")+ "");
-                                alarmLog.setMethod(map.get("method")+"");
-                                alarmLog.setUpdateTime(DateUtils.getNowDate());
-                                alarmLogService.updateAlarmLog(alarmLog);
-
-                                if("失败".equals(map.get("status"))){
-                                    System.out.println("重发数据: "+  alarmLog.toString());
-                                    // TODO 运行异常 需记录 重拨ID或手机号 避免一次运行多次拨号
-                                    if(!failPhones.contains(alarmLog.getPhone())){
-                                        failPhones.add(alarmLog.getPhone());
-                                        sendPost(new AlarmEntrty(Routes.NoticePush, new String[]{alarmLog.getPhone()}, SendTypes.Call+"", alarmLog.getNotice()));
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-}

+ 0 - 10
zd-modules/zd-alarm/src/main/resources/banner.txt

@@ -1,10 +0,0 @@
-Spring Boot Version: ${spring-boot.version}
-Spring Application Name: ${spring.application.name}
-                            _                           _                    
-                           (_)                         | |                   
- _ __  _   _   ___   _   _  _  ______  ___  _   _  ___ | |_   ___  _ __ ___  
-| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ 
-| |   | |_| || (_) || |_| || |        \__ \| |_| |\__ \| |_ |  __/| | | | | |
-|_|    \__,_| \___/  \__, ||_|        |___/ \__, ||___/ \__| \___||_| |_| |_|
-                      __/ |                  __/ |                           
-                     |___/                  |___/                            

+ 0 - 27
zd-modules/zd-alarm/src/main/resources/bootstrap.yml

@@ -1,27 +0,0 @@
-# Tomcat
-server:
-  port: 9901
-
-# Spring
-spring:
-  application:
-    # 应用名称
-    name: zd-alarm
-  profiles:
-    # 环境配置
-    active: dev
-  cloud:
-    nacos:
-      discovery:
-        # 服务注册地址
-      # server-addr: 180.76.134.43:8848
-        server-addr: ${NACOS_HOST:127.0.0.1}:${NACOS_PORT:8848}
-      config:
-        # 配置中心地址
-        # server-addr: 180.76.134.43:8848
-        server-addr: ${NACOS_HOST:127.0.0.1}:${NACOS_PORT:8848}
-        # 配置文件格式
-        file-extension: yml
-        # 共享配置
-        shared-configs:
-          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

+ 0 - 74
zd-modules/zd-alarm/src/main/resources/logback.xml

@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="60 seconds" debug="false">
-    <!-- 日志存放路径 -->
-    <property name="log.path" value="logs/zd-alarm"/>
-    <!-- 日志输出格式 -->
-    <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
-
-    <!-- 控制台输出 -->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- 系统日志输出 -->
-    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.path}/info.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-            <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <!-- 日志最大的历史 60天 -->
-            <maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>INFO</level>
-            <!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-            <!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.path}/error.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-            <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <!-- 日志最大的历史 60天 -->
-            <maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>ERROR</level>
-            <!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-            <!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <!-- 系统模块日志级别控制  -->
-    <logger name="com.zd" level="debug"/>
-    <!-- Spring日志级别控制  -->
-    <logger name="org.springframework" level="info"/>
-
-    <root level="debug">
-        <appender-ref ref="console"/>
-    </root>
-
-    <!--系统操作日志-->
-    <root level="info">
-        <appender-ref ref="file_info"/>
-        <appender-ref ref="file_error"/>
-    </root>
-</configuration>

+ 0 - 100
zd-modules/zd-alarm/src/main/resources/mapper/alarm/AlarmLogMapper.xml

@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.zd.alarm.mapper.AlarmLogMapper">
-
-    <resultMap type="com.zd.alarm.domain.AlarmLog" id="AlarmLogResult">
-        <result property="id"    column="id"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="phone"    column="phone"    />
-        <result property="status"    column="status"    />
-        <result property="notice"    column="notice"    />
-        <result property="method"    column="method"    />
-        <result property="isBack"    column="is_back"    />
-    </resultMap>
-
-    <sql id="selectAlarmLogVo">
-        select id, create_time, update_time, phone, status, notice, method, is_back from alarm_log
-    </sql>
-    <sql id="selectAlarmLogListVo">
-        select t.id, t.create_time, t.update_time, t.phone, t.status, t.notice, t.method, t.is_back from alarm_log as t
-    </sql>
-    <select id="selectAlarmLogList" parameterType="com.zd.alarm.domain.AlarmLog" resultMap="AlarmLogResult">
-        <include refid="selectAlarmLogVo"/>
-        <where>
-            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
-            <if test="notice != null  and notice != ''"> and notice = #{notice}</if>
-            <if test="method != null  and method != ''"> and method = #{method}</if>
-            <if test="isBack != null "> and is_back = #{isBack}</if>
-        </where>
-    </select>
-
-    <select id="selectAlarmLogById"  resultMap="AlarmLogResult">
-        <include refid="selectAlarmLogVo"/>
-        where id = #{id}
-    </select>
-
-
-    <select id="selectNoBackAlarmLogList" resultType="com.zd.alarm.domain.AlarmLog">
-        <include refid="selectAlarmLogVo"/>
-        where is_back &lt; #{retryCount} and status = "失败"
-        having TIMESTAMPDIFF(minute,create_time,#{date}) &lt; 30
-    </select>
-
-    <insert id="insertAlarmLog" parameterType="com.zd.alarm.domain.AlarmLog" useGeneratedKeys="true" keyProperty="id">
-        insert into alarm_log
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-        <if test="createTime != null">create_time,</if>
-        <if test="updateTime != null">update_time,</if>
-        <if test="phone != null">phone,</if>
-
-        <if test="status != null">status,</if>
-
-        <if test="notice != null">notice,</if>
-
-        <if test="method != null">method,</if>
-
-        <if test="isBack != null">is_back,</if>
-
-        <if test="remark != null">remark,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-        <if test="createTime != null">#{createTime},</if>
-        <if test="updateTime != null">#{updateTime},</if>
-        <if test="phone != null">#{phone},</if>
-        <if test="status != null">#{status},</if>
-        <if test="notice != null">#{notice},</if>
-        <if test="method != null">#{method},</if>
-        <if test="isBack != null">#{isBack},</if>
-        <if test="remark != null">#{remark},</if>
-         </trim>
-    </insert>
-
-    <update id="updateAlarmLog" parameterType="com.zd.alarm.domain.AlarmLog">
-        update alarm_log
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="phone != null">phone = #{phone},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="notice != null">notice = #{notice},</if>
-            <if test="method != null">method = #{method},</if>
-            <if test="isBack != null">is_back = #{isBack},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteAlarmLogById" >
-        delete from alarm_log where id = #{id}
-    </delete>
-
-    <delete id="deleteAlarmLogByIds">
-        delete from alarm_log where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 182
zd-modules/zd-alarm/wait-for-it.sh

@@ -1,182 +0,0 @@
-#!/usr/bin/env bash
-# Use this script to test if a given TCP host/port are available
-
-WAITFORIT_cmdname=${0##*/}
-
-echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
-
-usage()
-{
-    cat << USAGE >&2
-Usage:
-    $WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args]
-    -h HOST | --host=HOST       Host or IP under test
-    -p PORT | --port=PORT       TCP port under test
-                                Alternatively, you specify the host and port as host:port
-    -s | --strict               Only execute subcommand if the test succeeds
-    -q | --quiet                Don't output any status messages
-    -t TIMEOUT | --timeout=TIMEOUT
-                                Timeout in seconds, zero for no timeout
-    -- COMMAND ARGS             Execute command with args after the test finishes
-USAGE
-    exit 1
-}
-
-wait_for()
-{
-    if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
-        echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
-    else
-        echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout"
-    fi
-    WAITFORIT_start_ts=$(date +%s)
-    while :
-    do
-        if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then
-            nc -z $WAITFORIT_HOST $WAITFORIT_PORT
-            WAITFORIT_result=$?
-        else
-            (echo -n > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1
-            WAITFORIT_result=$?
-        fi
-        if [[ $WAITFORIT_result -eq 0 ]]; then
-            WAITFORIT_end_ts=$(date +%s)
-            echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds"
-            break
-        fi
-        sleep 1
-    done
-    return $WAITFORIT_result
-}
-
-wait_for_wrapper()
-{
-    # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
-    if [[ $WAITFORIT_QUIET -eq 1 ]]; then
-        timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
-    else
-        timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
-    fi
-    WAITFORIT_PID=$!
-    trap "kill -INT -$WAITFORIT_PID" INT
-    wait $WAITFORIT_PID
-    WAITFORIT_RESULT=$?
-    if [[ $WAITFORIT_RESULT -ne 0 ]]; then
-        echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
-    fi
-    return $WAITFORIT_RESULT
-}
-
-# process arguments
-while [[ $# -gt 0 ]]
-do
-    case "$1" in
-        *:* )
-        WAITFORIT_hostport=(${1//:/ })
-        WAITFORIT_HOST=${WAITFORIT_hostport[0]}
-        WAITFORIT_PORT=${WAITFORIT_hostport[1]}
-        shift 1
-        ;;
-        --child)
-        WAITFORIT_CHILD=1
-        shift 1
-        ;;
-        -q | --quiet)
-        WAITFORIT_QUIET=1
-        shift 1
-        ;;
-        -s | --strict)
-        WAITFORIT_STRICT=1
-        shift 1
-        ;;
-        -h)
-        WAITFORIT_HOST="$2"
-        if [[ $WAITFORIT_HOST == "" ]]; then break; fi
-        shift 2
-        ;;
-        --host=*)
-        WAITFORIT_HOST="${1#*=}"
-        shift 1
-        ;;
-        -p)
-        WAITFORIT_PORT="$2"
-        if [[ $WAITFORIT_PORT == "" ]]; then break; fi
-        shift 2
-        ;;
-        --port=*)
-        WAITFORIT_PORT="${1#*=}"
-        shift 1
-        ;;
-        -t)
-        WAITFORIT_TIMEOUT="$2"
-        if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi
-        shift 2
-        ;;
-        --timeout=*)
-        WAITFORIT_TIMEOUT="${1#*=}"
-        shift 1
-        ;;
-        --)
-        shift
-        WAITFORIT_CLI=("$@")
-        break
-        ;;
-        --help)
-        usage
-        ;;
-        *)
-        echoerr "Unknown argument: $1"
-        usage
-        ;;
-    esac
-done
-
-if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then
-    echoerr "Error: you need to provide a host and port to test."
-    usage
-fi
-
-WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15}
-WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
-WAITFORIT_CHILD=${WAITFORIT_CHILD:-0}
-WAITFORIT_QUIET=${WAITFORIT_QUIET:-0}
-
-# Check to see if timeout is from busybox?
-WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
-WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
-
-WAITFORIT_BUSYTIMEFLAG=""
-if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
-    WAITFORIT_ISBUSY=1
-    # Check if busybox timeout uses -t flag
-    # (recent Alpine versions don't support -t anymore)
-    if timeout &>/dev/stdout | grep -q -e '-t '; then
-        WAITFORIT_BUSYTIMEFLAG="-t"
-    fi
-else
-    WAITFORIT_ISBUSY=0
-fi
-
-if [[ $WAITFORIT_CHILD -gt 0 ]]; then
-    wait_for
-    WAITFORIT_RESULT=$?
-    exit $WAITFORIT_RESULT
-else
-    if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
-        wait_for_wrapper
-        WAITFORIT_RESULT=$?
-    else
-        wait_for
-        WAITFORIT_RESULT=$?
-    fi
-fi
-
-if [[ $WAITFORIT_CLI != "" ]]; then
-    if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then
-        echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess"
-        exit $WAITFORIT_RESULT
-    fi
-    exec "${WAITFORIT_CLI[@]}"
-else
-    exit $WAITFORIT_RESULT
-fi

+ 0 - 10
zd-modules/zd-base/src/main/resources/banner.txt

@@ -1,10 +0,0 @@
-Spring Boot Version: ${spring-boot.version}
-Spring Application Name: ${spring.application.name}
-                            _                           _                    
-                           (_)                         | |                   
- _ __  _   _   ___   _   _  _  ______  ___  _   _  ___ | |_   ___  _ __ ___  
-| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ 
-| |   | |_| || (_) || |_| || |        \__ \| |_| |\__ \| |_ |  __/| | | | | |
-|_|    \__,_| \___/  \__, ||_|        |___/ \__, ||___/ \__| \___||_| |_| |_|
-                      __/ |                  __/ |                           
-                     |___/                  |___/                            

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 10
zd-modules/zd-common-face/Dockerfile


+ 0 - 94
zd-modules/zd-common-face/pom.xml

@@ -1,94 +0,0 @@
-<?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>
-        <groupId>com.zd</groupId>
-        <artifactId>zd-modules</artifactId>
-        <version>3.1.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>zd-common-face</artifactId>
-    <packaging>jar</packaging>
-    <description>人脸对接</description>
-
-    <properties>
-        <maven.compiler.source>8</maven.compiler.source>
-        <maven.compiler.target>8</maven.compiler.target>
-    </properties>
-
-    <dependencies>
-<!--         SpringCloud Alibaba Nacos-->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-        </dependency>
-
-        <!-- SpringCloud Alibaba Nacos Config -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
-
-        <!-- SpringCloud Alibaba Sentinel -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
-        </dependency>
-
-        <!-- SpringBoot Actuator -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-actuator</artifactId>
-        </dependency>
-
-        <!-- zd Common Log -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-log</artifactId>
-        </dependency>
-
-        <!-- zd Common Swagger -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-swagger</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>arcsoft</groupId>
-            <artifactId>arcsoft-sdk-face</artifactId>
-            <version>3.0.0.0</version>
-            <scope>system</scope>
-            <systemPath>${pom.basedir}/src/main/resources/libs/arcsoft-sdk-face-3.0.0.0.jar</systemPath>
-        </dependency>
-    </dependencies>
-    <build>
-        <finalName>${project.artifactId}</finalName>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <configuration>
-                    <includeSystemScope>true</includeSystemScope>
-                    <fork>true</fork>
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <!-- 打包时跳过test插件,不运行test测试用例 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>${maven-surefire-plugin.version}</version>
-                <configuration>
-                    <skipTests>true</skipTests>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 22
zd-modules/zd-common-face/src/main/java/com/zd/face/AppFace.java

@@ -1,22 +0,0 @@
-package com.zd.face;
-
-import com.zd.common.security.annotation.EnableRyFeignClients;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/10/12/10:02
- * @Description:
- */
-@EnableRyFeignClients
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
-public class AppFace {
-    public static void main(String[] args) {
-
-        SpringApplication.run(AppFace.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  人脸识别模块启动成功   ლ(´ڡ`ლ)゙");
-    }
-}

+ 0 - 139
zd-modules/zd-common-face/src/main/java/com/zd/face/config/FaceProperties.java

@@ -1,139 +0,0 @@
-package com.zd.face.config;
-
-import com.zd.face.valid.KeyNotNull;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
-import org.springframework.validation.annotation.Validated;
-
-import javax.validation.constraints.NotBlank;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/10/12/10:39
- * @Description:
- */
-@ConfigurationProperties(prefix = "face" ,ignoreUnknownFields=true,ignoreInvalidFields=true)
-@Validated
-public class FaceProperties {
-
-    boolean isInit;
-
-    @NotBlank(message = "应用ID不能为空,请配置!")
-    String appId;
-
-
-//    @NotBlank(message = "sdk key 不能为空,请配置!")
-    /**
-     * 已放弃使用改为linuxKey和winKey
-     */
-    @Deprecated
-    String sdkKey;
-
-    String linuxKey;
-
-    String winKey;
-
-    public String getLinuxKey() {
-        return linuxKey;
-    }
-
-    public void setLinuxKey(String linuxKey) {
-        this.linuxKey = linuxKey;
-    }
-
-    public String getWinKey() {
-        return winKey;
-    }
-
-    public void setWinKey(String winKey) {
-        this.winKey = winKey;
-    }
-
-    /**
-     * 是否激活
-     */
-    Boolean isActivation =false;
-    /**
-     * lib路径 暂时没有业务
-     */
-    String libPath;
-
-    /**
-     * 人脸对比匹配度阈值
-     */
-    float score = 0.8f;
-
-    /**
-     * 是否打开视频引擎
-     */
-    Boolean video=false;
-
-    /**
-     * 默认 arcsoft_lib
-     */
-    String lib_folder="arcsoft_lib";
-
-    public boolean isInit() {
-        return isInit;
-    }
-
-    public void setInit(boolean init) {
-        isInit = init;
-    }
-
-    public Boolean getActivation() {
-        return isActivation;
-    }
-
-    public void setActivation(Boolean activation) {
-        isActivation = activation;
-    }
-
-    public String getLib_folder() {
-        return lib_folder;
-    }
-
-    public void setLib_folder(String lib_folder) {
-        this.lib_folder = lib_folder;
-    }
-
-    public Boolean getVideo() {
-        return video;
-    }
-
-    public void setVideo(Boolean video) {
-        this.video = video;
-    }
-
-    public float getScore() {
-        return score;
-    }
-
-    public void setScore(float score) {
-        this.score = score;
-    }
-
-    public String getLibPath() {
-        return libPath;
-    }
-
-    public void setLibPath(String libPath) {
-        this.libPath = libPath;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public void setAppId(String appId) {
-        this.appId = appId;
-    }
-
-    public String getSdkKey() {
-        return sdkKey;
-    }
-
-    public void setSdkKey(String sdkKey) {
-        this.sdkKey = sdkKey;
-    }
-}

+ 0 - 105
zd-modules/zd-common-face/src/main/java/com/zd/face/controller/FaceApi.java

@@ -1,105 +0,0 @@
-package com.zd.face.controller;
-
-import com.arcsoft.face.FaceFeature;
-import com.arcsoft.face.FaceInfo;
-import com.arcsoft.face.toolkit.ImageInfo;
-import com.github.xiaoymin.knife4j.annotations.ApiSupport;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.web.domain.ResultData;
-import com.zd.common.swagger.config.Knife4jConfiguration;
-import com.zd.face.utils.FileUtil;
-import com.zd.system.api.face.FaceCompare;
-import com.zd.face.service.FaceService;
-import com.zd.system.api.domain.LabStudentsInfo;
-import com.zd.system.api.students.RemoteStudentsService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import java.io.*;
-import java.util.List;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/10/12/13:36
- * @Description:
- */
-
-@Api(tags = "【人脸识别】")
-@ApiSupport(author = Knife4jConfiguration.Author.ZP)
-@RestController
-@RequestMapping("/faceApi")
-public class FaceApi {
-
-    @Autowired
-    FaceService faceService;
-
-    @Autowired
-    RemoteStudentsService remoteStudentsService;
-
-
-    @ApiOperation("根据照片文件获取特征码")
-    @PostMapping("faceFeature")
-    public ResultData faceFeature(@RequestParam("file") MultipartFile file) throws IOException {
-        ImageInfo imageInfo;
-        File file1=null;
-        try {
-            file1= FileUtil.multipartFileToFile(file);
-            imageInfo = faceService.getImageInfo(file1);
-        } finally {
-            if(file1!=null)
-            {
-                file1.delete();
-            }
-        }
-        List<FaceInfo> faceInfos = faceService.faceDetect(imageInfo);
-        FaceFeature faceFeature = faceService.faceFeature(imageInfo, faceInfos);
-        return ResultData.success(faceFeature.getFeatureData());
-    }
-    /**
-     * 人脸比较
-     * @return
-     */
-    @ApiOperation("人脸比较")
-    @PostMapping("/compare")
-    public ResultData faceDetection(@RequestBody  FaceCompare faceCompare)
-    {
-
-        R<LabStudentsInfo> info = remoteStudentsService.getInfo(faceCompare.getUserId());
-        if(info.getCode()==200&&info.getData()!=null)
-        {
-            FaceFeature target = new FaceFeature(info.getData().getFaceFeature());
-            FaceFeature source = new FaceFeature(faceCompare.getData());
-            Boolean compore = faceService.compore(target, source);
-
-            return ResultData.result(compore,()->"人脸对比不符!");
-        }else
-        {
-            return ResultData.fail("未获取到对比数据!:"+info.getMsg());
-        }
-    }
-
-
-
-    //获取流文件
-    private static void inputStreamToFile(InputStream ins, File file) {
-        try {
-            OutputStream os = new FileOutputStream(file);
-            int bytesRead = 0;
-            byte[] buffer = new byte[8192];
-            while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) {
-                os.write(buffer, 0, bytesRead);
-            }
-            os.close();
-            ins.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-
-
-
-
-}

+ 0 - 142
zd-modules/zd-common-face/src/main/java/com/zd/face/controller/FaceManagerApi.java

@@ -1,142 +0,0 @@
-package com.zd.face.controller;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.io.FileUtil;
-import com.github.xiaoymin.knife4j.annotations.ApiSupport;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.exception.ServiceException;
-import com.zd.common.core.utils.IdUtils;
-import com.zd.common.swagger.config.Knife4jConfiguration;
-import com.zd.face.config.FaceProperties;
-import com.zd.face.handle.FaceEngineFactory;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.util.ResourceUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/10/13/13:21
- * @Description:
- */
-@Api(tags = "【人脸识别服务管理】")
-@ApiSupport(author = Knife4jConfiguration.Author.ZP)
-@RestController
-@RequestMapping("faceManagerApi")
-public class FaceManagerApi {
-    @Autowired
-    FaceEngineFactory faceEngineFactory;
-
-    @Autowired
-    FaceProperties faceProperties;
-
-
-    final static Set<String> libSet = new HashSet<>();
-    static {
-        libSet.add("libarcsoft_face.dll");
-        libSet.add("libarcsoft_face_engine.dll");
-        libSet.add("libarcsoft_face_engine_jni.dll");
-        libSet.add("libarcsoft_face.so");
-        libSet.add("libarcsoft_face_engine.so");
-        libSet.add("libarcsoft_face_engine_jni.so");
-
-    }
-
-
-    @PostMapping()
-    @ApiOperation("上传sdk-lib")
-    public R uploadLib(@RequestParam("files") MultipartFile [] multipartFiles) throws IOException {
-
-        String path =faceEngineFactory.getPath();
-
-//        final String path = absolutePath+ File.separator+faceProperties.getLib_folder();
-
-        //先删除原来的文件。。如果直接删除,但又没有保存成功还会导致之前的功能异常,所以这里要先保存再删除
-        //生成操作ID
-        String id= IdUtils.simpleUUID();
-
-        Map<String,MultipartFile> temp = new HashMap<>(multipartFiles.length);
-
-        for (int i = 0; i < multipartFiles.length; i++) {
-
-            String originalFilename = multipartFiles[i].getOriginalFilename();
-            if(!libSet.contains(originalFilename))
-            {
-                return R.fail("上传文件名错误,请确认为:"+libSet.stream().collect(Collectors.joining(",")));
-            }
-            temp.put( originalFilename,multipartFiles[i]);
-        }
-
-        if(CollUtil.isNotEmpty(temp))
-        {
-            try {
-                Map<String,File> tempFile = new HashMap<>(temp.size());
-                temp.forEach((k,v)->{
-                    //创建文件
-                    File touch = FileUtil.touch(path + File.separator + k+id);
-                    try {
-                        v.transferTo(touch);
-                        tempFile.put(k,touch);
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                        throw new ServiceException("创建lib文件出错:"+e.getMessage());
-                    }
-                });
-                //todo 这里应该先备份一次
-                temp.forEach((a,b)->{
-                    FileUtil.copy(path + File.separator +a,path + File.separator +a+"_copy",true);
-                });
-                try {
-                    tempFile.forEach((a,b)->{
-                        FileUtil.rename(b,path+ File.separator,true);
-                    });
-                } catch (Exception e) {
-                    //出现异常后还原文件
-                    tempFile.forEach((a,b)->{
-                        FileUtil.copy(path + File.separator +a+"_copy",path + File.separator +a,true);
-                    });
-                    throw new ServiceException("替换lib文件出错:"+e.getMessage());
-                }
-                //如果是三个lib文件都上传了,则调用激活
-                faceEngineFactory.activeOnline();
-            } finally {
-                //是否成功都要删除
-                temp.forEach((k,v)->{
-                    FileUtil.del(path + File.separator + k + id);
-                    FileUtil.del(path + File.separator + k + "_copy");
-                });
-
-            }
-        }
-        else
-        {
-            R.fail("没有找到符合的lib文件!");
-        }
-        return R.ok();
-
-    }
-
-
-    @PostMapping("activation")
-    @ApiOperation("激活")
-    public R activation() throws IOException {
-        faceEngineFactory.activeOnline();
-        return R.ok("激活成功!");
-    }
-
-}

+ 0 - 174
zd-modules/zd-common-face/src/main/java/com/zd/face/handle/FaceEngineFactory.java

@@ -1,174 +0,0 @@
-package com.zd.face.handle;
-
-import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSON;
-import com.arcsoft.face.ActiveFileInfo;
-import com.arcsoft.face.EngineConfiguration;
-import com.arcsoft.face.FaceEngine;
-import com.arcsoft.face.FunctionConfiguration;
-import com.arcsoft.face.enums.DetectMode;
-import com.arcsoft.face.enums.DetectOrient;
-import com.arcsoft.face.enums.ErrorInfo;
-import com.zd.common.core.exception.ServiceException;
-import com.zd.face.config.FaceProperties;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.core.io.Resource;
-import org.springframework.stereotype.Service;
-import org.springframework.util.ResourceUtils;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/10/12/11:14
- * @Description:
- */
-@Service
-@EnableConfigurationProperties(FaceProperties.class)
-public class FaceEngineFactory {
-    Logger logger = LoggerFactory.getLogger(FaceEngineFactory.class);
-
-    @Autowired
-    FaceProperties faceProperties;
-
-    @Autowired
-    EngineConfiguration getEngineConfiguration;
-
-    //初始化一个图片模式引擎
-    public FaceEngine initFaceEngineImage() {
-        //初始化IMAGE模式
-        return init();
-    }
-
-    private FaceEngine init() {
-        FaceEngine faceEngine = getFaceEngine();
-        int errorCode;
-        //初始化引擎
-        errorCode = faceEngine.init(getEngineConfiguration);
-        if (errorCode != ErrorInfo.MOK.getValue()) {
-            logger.error("初始化引擎失败:errorCode:{},", errorCode);
-            throw new ServiceException("初始化引擎失败!");
-        }
-        return faceEngine;
-    }
-
-    /**
-     * 获取激活信息
-     * @param faceEngine
-     * @return
-     */
-    private void getActiveInfo(FaceEngine faceEngine) {
-        int errorCode;
-        ActiveFileInfo activeFileInfo = new ActiveFileInfo();
-        errorCode = faceEngine.getActiveFileInfo(activeFileInfo);
-        if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {
-            logger.error("获取激活文件信息失败:errorCode:{},", errorCode);
-            throw new ServiceException("获取激活文件信息失败");
-        }
-    }
-
-    public String getPath() throws IOException {
-        FileSystemResource resource = new FileSystemResource("../");
-        String canonicalPath  = resource.getFile().getCanonicalPath();
-        if(StrUtil.isNotBlank(faceProperties.getLib_folder()))
-        {
-            canonicalPath =canonicalPath+File.separator+faceProperties.getLib_folder();
-        }
-        return canonicalPath;
-    }
-
-    public void activation(FaceEngine faceEngine) {
-
-        //
-        String key ="";
-        String os =  System.getProperty("os.name");
-        if (os.toLowerCase().startsWith("win")) {
-            key=faceProperties.getWinKey();
-        }else
-        {
-            key=faceProperties.getLinuxKey();
-
-        }
-        logger.info("配置信息打印:" + faceProperties.getAppId() + ", " + key);
-        int errorCode = faceEngine.activeOnline(faceProperties.getAppId(), key);
-        if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {
-            logger.error("引擎激活失败:errorCode:{},", errorCode);
-            throw new ServiceException("引擎激活失败");
-        }
-    }
-
-    /**
-     * 在线激活
-     */
-    public void activeOnline()
-    {
-        FaceEngine faceEngine = getFaceEngine();
-        if (faceEngine == null) return;
-        activation(faceEngine);
-        getActiveInfo(faceEngine);
-    }
-
-    private FaceEngine getFaceEngine() {
-        FaceEngine faceEngine =null;
-        //默认放在资源文件下
-
-        String canonicalPath = null;
-        try {
-            //FaceEngine 里加载sdk的方法已经写死了,没办法从打的jar文件中正确获取文件,
-            // 里面用的System.load方法,没办法通过路径加载jar文件中的文件
-            //所以这里只能把lib文件放在jar文件外部
-            canonicalPath = getPath();
-            logger.info("获取lib文件路径!:{}",canonicalPath);
-            faceEngine =new FaceEngine(canonicalPath);
-        } catch (IOException e) {
-            logger.error("lib文件路径获取失败,引擎初始化中断,请正确配置后激活!当前读取路径:{}",canonicalPath);
-            throw new ServiceException("lib文件加载失败!");
-        }
-        return faceEngine;
-    }
-
-
-    /**
-     * 注入IMAGE 模式配置
-     * @return
-     */
-    @Bean
-    public EngineConfiguration getEngineConfiguration() {
-        //引擎配置
-        EngineConfiguration engineConfiguration = new EngineConfiguration();
-        //检测模式
-        engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);
-        //人脸检测角度,根据官网说明按当前一体机使用情况 0角度检测 最佳
-        engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_0_ONLY);
-        engineConfiguration.setDetectFaceMaxNum(10);
-        engineConfiguration.setDetectFaceScaleVal(32);
-        //人脸识别时一般都需要supportFaceDetect和supportFaceRecognition这两个属性。
-        //需要防止纸张、屏幕等攻击可以传入supportLiveness和supportIRLiveness,RGB和IR活体检测根据用户的摄像头类型及实际的业务需求来决定如何选择。
-        //功能配置
-        FunctionConfiguration functionConfiguration = new FunctionConfiguration();
-        //是否支持年龄检测功能
-        functionConfiguration.setSupportAge(false);
-        //是否支持3D检测功能
-        functionConfiguration.setSupportFace3dAngle(false);
-        //是否支持人脸检测功能
-        functionConfiguration.setSupportFaceDetect(true);
-        //是否支持人脸识别功能
-        functionConfiguration.setSupportFaceRecognition(true);
-        //是否支持性别检测功能
-        functionConfiguration.setSupportGender(false);
-        //是否支持RGB活体检测功能
-        functionConfiguration.setSupportLiveness(true);
-        //是否支持IR活体检测功能
-        functionConfiguration.setSupportIRLiveness(true);
-        engineConfiguration.setFunctionConfiguration(functionConfiguration);
-        return engineConfiguration;
-    }
-
-}

+ 0 - 27
zd-modules/zd-common-face/src/main/java/com/zd/face/handle/SDKRegister.java

@@ -1,27 +0,0 @@
-package com.zd.face.handle;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.event.ApplicationStartedEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.stereotype.Component;
-
-/**
- * 初始化SDK
- * @Author: zhoupan
- * @Date: 2021/10/12/10:17
- * @Description:
- */
-@Component
-@ConditionalOnProperty(prefix = "face",name = "init",havingValue = "true",matchIfMissing = true)
-public class SDKRegister implements ApplicationListener<ApplicationStartedEvent> {
-
-    @Autowired
-    FaceEngineFactory faceEngineFactory;
-
-    @Override
-    public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) {
-        //在线激活
-        faceEngineFactory.activeOnline();
-    }
-}

+ 0 - 102
zd-modules/zd-common-face/src/main/java/com/zd/face/service/FaceService.java

@@ -1,102 +0,0 @@
-package com.zd.face.service;
-
-import com.arcsoft.face.FaceEngine;
-import com.arcsoft.face.FaceFeature;
-import com.arcsoft.face.FaceInfo;
-import com.arcsoft.face.FaceSimilar;
-import com.arcsoft.face.enums.ErrorInfo;
-import com.arcsoft.face.toolkit.ImageInfo;
-import com.zd.common.core.utils.Assert;
-import com.zd.face.config.FaceProperties;
-import com.zd.face.handle.FaceEngineFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/10/12/14:30
- * @Description:
- */
-@Service
-public class FaceService {
-
-    @Autowired
-    FaceEngineFactory faceEngineFactory;
-
-    @Autowired
-    FaceProperties faceProperties;
-
-
-    /**
-     * 人脸检测
-     * @param imageInfo 待检测的图片信息
-     * @return
-     */
-    public List<FaceInfo>  faceDetect(ImageInfo imageInfo)
-    {
-        List<FaceInfo> faceInfoList = new ArrayList<FaceInfo>();
-        int errorCode = faceEngineFactory.initFaceEngineImage().detectFaces(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList);
-        Assert.isTrue(errorCode==ErrorInfo.MOK.getValue(),"人脸检测失败!");
-        return faceInfoList;
-    }
-
-
-
-    /**
-     * 人脸特征提取
-     * @return
-     */
-    public FaceFeature faceFeature(ImageInfo imageInfo,List<FaceInfo> faceInfoList)
-    {
-        FaceFeature faceFeature = new FaceFeature();
-        FaceEngine imageFaceEngine = null;
-        int errorCode;
-        try {
-            imageFaceEngine = faceEngineFactory.initFaceEngineImage();
-            errorCode = imageFaceEngine.extractFaceFeature(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList.get(0), faceFeature);
-        } finally {
-            if(imageFaceEngine!=null)
-            {
-                imageFaceEngine.unInit();
-            }
-
-        }
-
-        Assert.isTrue(errorCode==ErrorInfo.MOK.getValue(),"人脸特征提取失败!");
-
-        return faceFeature;
-    }
-    /**
-     * 人脸对比
-     * @return
-     */
-    public Boolean compore(FaceFeature targetFaceFeature,FaceFeature sourceFaceFeature)
-    {
-
-        FaceSimilar faceSimilar = new FaceSimilar();
-        FaceEngine faceEngine = null;
-        int errorCode = 0;
-        try {
-            faceEngine = faceEngineFactory.initFaceEngineImage();
-            errorCode = faceEngine.compareFaceFeature(targetFaceFeature, sourceFaceFeature, faceSimilar);
-        } finally {
-            if(faceEngine!=null)
-            {
-                faceEngine.unInit();
-            }
-        }
-        Assert.isTrue(errorCode==ErrorInfo.MOK.getValue(),"人脸对比失败!");
-        return faceSimilar.getScore()>=faceProperties.getScore();
-    }
-
-    public ImageInfo getImageInfo(File file) {
-        ImageInfo imageInfo = getRGBData(file);
-        return imageInfo;
-    }
-}

+ 0 - 29
zd-modules/zd-common-face/src/main/java/com/zd/face/utils/FileUtil.java

@@ -1,29 +0,0 @@
-package com.zd.face.utils;
-
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/10/14/9:38
- * @Description:
- */
-public class FileUtil {
-
-    public static File multipartFileToFile(MultipartFile file) throws IOException {
-        File toFile = null;
-
-
-        String originalFilename = file.getOriginalFilename();
-        String[] filename = originalFilename.split("\\.");
-        toFile=File.createTempFile(filename[0], filename[1]);
-        file.transferTo(toFile);
-//        toFile.deleteOnExit();//在jvm 退出时删除
-        return toFile;
-    }
-
-
-
-}

+ 0 - 26
zd-modules/zd-common-face/src/main/java/com/zd/face/valid/KeyNotNull.java

@@ -1,26 +0,0 @@
-package com.zd.face.valid;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-import java.lang.annotation.*;
-
-/**
- * 枚舉自定義驗證
- *
- * @Author: zhoupan
- * @Date: 2021/10/28/9:00
- * @Description:
- */
-@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Constraint(validatedBy = KeyValidator.class)//标明由哪个类执行校验逻辑
-public @interface KeyNotNull {
-
-    String message() default "值错误!";
-
-    Class<?>[] groups() default {};
-
-    Class<? extends Payload>[] payload() default {};
-
-}

+ 0 - 26
zd-modules/zd-common-face/src/main/java/com/zd/face/valid/KeyValidator.java

@@ -1,26 +0,0 @@
-package com.zd.face.valid;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * 暂未使用,还未完成
- * @Author: zhoupan
- * @Date: 2021/10/28/9:07
- * @Description:
- */
-public class KeyValidator implements ConstraintValidator<KeyNotNull, Object> {
-
-
-    @Override
-    public boolean isValid(Object s, ConstraintValidatorContext constraintValidatorContext) {
-
-        if (s == null) return true;
-        return false;
-    }
-
-    @Override
-    public void initialize(KeyNotNull constraintAnnotation) {
-        ConstraintValidator.super.initialize(constraintAnnotation);
-    }
-}

+ 0 - 10
zd-modules/zd-common-face/src/main/resources/banner.txt

@@ -1,10 +0,0 @@
-Spring Boot Version: ${spring-boot.version}
-Spring Application Name: ${spring.application.name}
-                            _                           _                    
-                           (_)                         | |                   
- _ __  _   _   ___   _   _  _  ______  ___  _   _  ___ | |_   ___  _ __ ___  
-| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ 
-| |   | |_| || (_) || |_| || |        \__ \| |_| |\__ \| |_ |  __/| | | | | |
-|_|    \__,_| \___/  \__, ||_|        |___/ \__, ||___/ \__| \___||_| |_| |_|
-                      __/ |                  __/ |                           
-                     |___/                  |___/                            

+ 0 - 27
zd-modules/zd-common-face/src/main/resources/bootstrap.yml

@@ -1,27 +0,0 @@
-# Tomcat
-server:
-  port: 9220
-# Spring
-#logging:
-#  level:
-#    root: debug
-spring:
-  application:
-    # 应用名称
-    name: zd-face
-  profiles:
-    # 环境配置
-    active: dev
-  cloud:
-    nacos:
-      discovery:
-        # 服务注册地址
-        server-addr: ${NACOS_HOST:127.0.0.1}:${NACOS_PORT:8848}
-      config:
-        # 配置中心地址
-        server-addr: ${NACOS_HOST:127.0.0.1}:${NACOS_PORT:8848}
-        # 配置文件格式
-        file-extension: yml
-        # 共享配置
-        shared-configs:
-          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

BIN=BIN
zd-modules/zd-common-face/src/main/resources/libs/arcsoft-sdk-face-3.0.0.0.jar


+ 0 - 74
zd-modules/zd-common-face/src/main/resources/logback.xml

@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="60 seconds" debug="false">
-    <!-- 日志存放路径 -->
-    <property name="log.path" value="logs/zd-face"/>
-    <!-- 日志输出格式 -->
-    <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
-
-    <!-- 控制台输出 -->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- 系统日志输出 -->
-    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.path}/info.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-            <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <!-- 日志最大的历史 60天 -->
-            <maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>INFO</level>
-            <!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-            <!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.path}/error.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-            <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <!-- 日志最大的历史 60天 -->
-            <maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>ERROR</level>
-            <!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-            <!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <!-- 系统模块日志级别控制  -->
-    <logger name="com.zd" level="info"/>
-    <!-- Spring日志级别控制  -->
-    <logger name="org.springframework" level="info"/>
-
-    <root level="info">
-        <appender-ref ref="console"/>
-    </root>
-
-    <!--系统操作日志-->
-    <root level="info">
-        <appender-ref ref="file_info"/>
-        <appender-ref ref="file_error"/>
-    </root>
-</configuration>

+ 0 - 182
zd-modules/zd-common-face/wait-for-it.sh

@@ -1,182 +0,0 @@
-#!/usr/bin/env bash
-# Use this script to test if a given TCP host/port are available
-
-WAITFORIT_cmdname=${0##*/}
-
-echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
-
-usage()
-{
-    cat << USAGE >&2
-Usage:
-    $WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args]
-    -h HOST | --host=HOST       Host or IP under test
-    -p PORT | --port=PORT       TCP port under test
-                                Alternatively, you specify the host and port as host:port
-    -s | --strict               Only execute subcommand if the test succeeds
-    -q | --quiet                Don't output any status messages
-    -t TIMEOUT | --timeout=TIMEOUT
-                                Timeout in seconds, zero for no timeout
-    -- COMMAND ARGS             Execute command with args after the test finishes
-USAGE
-    exit 1
-}
-
-wait_for()
-{
-    if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
-        echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
-    else
-        echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout"
-    fi
-    WAITFORIT_start_ts=$(date +%s)
-    while :
-    do
-        if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then
-            nc -z $WAITFORIT_HOST $WAITFORIT_PORT
-            WAITFORIT_result=$?
-        else
-            (echo -n > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1
-            WAITFORIT_result=$?
-        fi
-        if [[ $WAITFORIT_result -eq 0 ]]; then
-            WAITFORIT_end_ts=$(date +%s)
-            echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds"
-            break
-        fi
-        sleep 1
-    done
-    return $WAITFORIT_result
-}
-
-wait_for_wrapper()
-{
-    # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
-    if [[ $WAITFORIT_QUIET -eq 1 ]]; then
-        timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
-    else
-        timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
-    fi
-    WAITFORIT_PID=$!
-    trap "kill -INT -$WAITFORIT_PID" INT
-    wait $WAITFORIT_PID
-    WAITFORIT_RESULT=$?
-    if [[ $WAITFORIT_RESULT -ne 0 ]]; then
-        echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
-    fi
-    return $WAITFORIT_RESULT
-}
-
-# process arguments
-while [[ $# -gt 0 ]]
-do
-    case "$1" in
-        *:* )
-        WAITFORIT_hostport=(${1//:/ })
-        WAITFORIT_HOST=${WAITFORIT_hostport[0]}
-        WAITFORIT_PORT=${WAITFORIT_hostport[1]}
-        shift 1
-        ;;
-        --child)
-        WAITFORIT_CHILD=1
-        shift 1
-        ;;
-        -q | --quiet)
-        WAITFORIT_QUIET=1
-        shift 1
-        ;;
-        -s | --strict)
-        WAITFORIT_STRICT=1
-        shift 1
-        ;;
-        -h)
-        WAITFORIT_HOST="$2"
-        if [[ $WAITFORIT_HOST == "" ]]; then break; fi
-        shift 2
-        ;;
-        --host=*)
-        WAITFORIT_HOST="${1#*=}"
-        shift 1
-        ;;
-        -p)
-        WAITFORIT_PORT="$2"
-        if [[ $WAITFORIT_PORT == "" ]]; then break; fi
-        shift 2
-        ;;
-        --port=*)
-        WAITFORIT_PORT="${1#*=}"
-        shift 1
-        ;;
-        -t)
-        WAITFORIT_TIMEOUT="$2"
-        if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi
-        shift 2
-        ;;
-        --timeout=*)
-        WAITFORIT_TIMEOUT="${1#*=}"
-        shift 1
-        ;;
-        --)
-        shift
-        WAITFORIT_CLI=("$@")
-        break
-        ;;
-        --help)
-        usage
-        ;;
-        *)
-        echoerr "Unknown argument: $1"
-        usage
-        ;;
-    esac
-done
-
-if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then
-    echoerr "Error: you need to provide a host and port to test."
-    usage
-fi
-
-WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15}
-WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
-WAITFORIT_CHILD=${WAITFORIT_CHILD:-0}
-WAITFORIT_QUIET=${WAITFORIT_QUIET:-0}
-
-# Check to see if timeout is from busybox?
-WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
-WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
-
-WAITFORIT_BUSYTIMEFLAG=""
-if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
-    WAITFORIT_ISBUSY=1
-    # Check if busybox timeout uses -t flag
-    # (recent Alpine versions don't support -t anymore)
-    if timeout &>/dev/stdout | grep -q -e '-t '; then
-        WAITFORIT_BUSYTIMEFLAG="-t"
-    fi
-else
-    WAITFORIT_ISBUSY=0
-fi
-
-if [[ $WAITFORIT_CHILD -gt 0 ]]; then
-    wait_for
-    WAITFORIT_RESULT=$?
-    exit $WAITFORIT_RESULT
-else
-    if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
-        wait_for_wrapper
-        WAITFORIT_RESULT=$?
-    else
-        wait_for
-        WAITFORIT_RESULT=$?
-    fi
-fi
-
-if [[ $WAITFORIT_CLI != "" ]]; then
-    if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then
-        echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess"
-        exit $WAITFORIT_RESULT
-    fi
-    exec "${WAITFORIT_CLI[@]}"
-else
-    exit $WAITFORIT_RESULT
-fi

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 10
zd-modules/zd-forward/Dockerfile


+ 0 - 118
zd-modules/zd-forward/pom.xml

@@ -1,118 +0,0 @@
-<?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-modules</artifactId>
-        <groupId>com.zd</groupId>
-        <version>3.1.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>zd-forward</artifactId>
-    <packaging>jar</packaging>
-    <description>AI算法</description>
-
-    <properties>
-        <maven.compiler.source>8</maven.compiler.source>
-        <maven.compiler.target>8</maven.compiler.target>
-    </properties>
-    <dependencies>
-        <!-- SpringCloud Alibaba Nacos -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-        </dependency>
-
-        <!-- SpringCloud Alibaba Nacos Config -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
-
-        <!-- SpringCloud Alibaba Sentinel -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
-        </dependency>
-
-        <!-- SpringBoot Actuator -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-actuator</artifactId>
-        </dependency>
-
-        <!-- zd Common Swagger -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-swagger</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-security</artifactId>
-        </dependency>
-        <dependency>
-
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.junit.vintage</groupId>
-                    <artifactId>junit-vintage-engine</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-configuration-processor</artifactId>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-mqtt</artifactId>
-        </dependency>
-        <!-- https://mvnrepository.com/artifact/org.bytedeco/ffmpeg-platform -->
-        <dependency>
-            <groupId>org.bytedeco</groupId>
-            <artifactId>ffmpeg-platform</artifactId>
-            <version>5.0-1.5.7</version>
-        </dependency>
-        <!-- https://mvnrepository.com/artifact/org.bytedeco/javacv -->
-        <dependency>
-            <groupId>org.bytedeco</groupId>
-            <artifactId>javacv</artifactId>
-            <version>1.5.7</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-mock</artifactId>
-            <version>2.0.8</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <finalName>${project.artifactId}</finalName>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <!-- 打包时跳过test插件,不运行test测试用例 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>${maven-surefire-plugin.version}</version>
-                <configuration>
-                    <skipTests>true</skipTests>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 35
zd-modules/zd-forward/src/main/java/com/zd/forward/ForwardApp.java

@@ -1,35 +0,0 @@
-package com.zd.forward;
-
-import com.zd.common.core.constant.Constants;
-import com.zd.common.core.properties.SnowflakeProperties;
-import com.zd.common.security.annotation.EnableCustomConfig;
-import com.zd.common.security.annotation.EnableRyFeignClients;
-import com.zd.forward.config.AlgorithmYml;
-import com.zd.forward.properties.FireProperties;
-import com.zd.forward.serivce.LoginService;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.ConfigurableApplicationContext;
-import springfox.documentation.oas.annotations.EnableOpenApi;
-import zd.common.mqtt.config.MqttProperties;
-
-/**
- * @author Administrator
- */
-@EnableCustomConfig
-@EnableRyFeignClients
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class},scanBasePackages = {Constants.BASE_PACKAGE})
-@EnableConfigurationProperties({MqttProperties.class, FireProperties.class, SnowflakeProperties.class, AlgorithmYml.class})
-@EnableOpenApi
-public class ForwardApp {
-
-    public static void main(String[] args) {
-        ConfigurableApplicationContext run = SpringApplication.run(ForwardApp.class, args);
-        //获取token
-        LoginService bean = run.getBeanFactory().getBean(LoginService.class);
-        bean.loginLab();
-        System.out.println("(♥◠‿◠)ノ゙ 转发服务启动! ლ(´ڡ`ლ)゙");
-    }
-}

+ 0 - 105
zd-modules/zd-forward/src/main/java/com/zd/forward/component/AppStartedListener.java

@@ -1,105 +0,0 @@
-package com.zd.forward.component;
-
-import com.zd.common.core.utils.Assert;
-import com.zd.forward.config.AlgorithmYml;
-import com.zd.forward.serivce.CheckResultValid;
-import com.zd.forward.serivce.VideoCheckResultValid;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.event.ApplicationStartedEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.lang.NonNull;
-import org.springframework.stereotype.Component;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-@Component
-public class AppStartedListener implements ApplicationListener<ApplicationStartedEvent> {
-    Logger logger = LoggerFactory.getLogger(AppStartedListener.class);
-    @Autowired
-    AlgorithmYml algorithmYml;
-
-
-    @Override
-    public void onApplicationEvent(@NonNull ApplicationStartedEvent applicationStartedEvent) {
-        //日志地址验证
-        URL url;
-        InputStream in = null;
-        try {
-            url = new URL(algorithmYml.getLoginUri() + algorithmYml.getCheckLogUrl());
-            //联通性测试
-            in = url.openStream();
-            logger.info("检查日志地址连通性测试通过!");
-        } catch (MalformedURLException e) {
-            logger.error("关闭项目!!!!!!检查日志地址配置错误url:{}", algorithmYml.getCheckLogUrl());
-            //关闭服务
-            applicationStartedEvent.getApplicationContext().close();
-        } catch (IOException e) {
-            e.printStackTrace();
-            logger.error("检查日志地址连通性测试失败!url:{},请检查实验室项目是否正常,或url配置是否正确!", algorithmYml.getCheckLogUrl());
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-        //算法解析类配置
-        logger.info("开始注入算法结果解析");
-        //注入
-        algorithmYml.getAlgorithmMap().forEach((key, value) -> {
-            try {
-                Class<?> classPath = value.getClassPath();
-                boolean assignableFrom = CheckResultValid.class.isAssignableFrom(value.getClassPath());
-                Assert.isTrue(assignableFrom, "算法解析实现类错误!必须是CheckResultValid的实现类");
-                boolean b = applicationStartedEvent.getApplicationContext().getBeanFactory().containsBean(classPath.getName());
-                logger.info("bean:{},是否存在:{}", classPath.getName(), b);
-                if (b) {
-                    Object bean = applicationStartedEvent.getApplicationContext().getBeanFactory().getBean(classPath.getName());
-                    value.setCheckResultValid((CheckResultValid) bean);
-                    return;
-                }
-                Object o = value.getClassPath().newInstance();
-                //注入IOC容器
-                applicationStartedEvent.getApplicationContext().getBeanFactory().registerSingleton(classPath.getName(), o);
-                //设置
-                value.setCheckResultValid((CheckResultValid) o);
-            } catch (Exception e) {
-                logger.error("算法结果解析注入失败!");
-                e.printStackTrace();
-                logger.error("关闭项目!!!!请检查算法结果解析配置!!");
-                //关闭服务
-                applicationStartedEvent.getApplicationContext().close();
-            }
-
-
-        });
-        algorithmYml.getVideoAidMap().forEach((key, value) -> {
-            try {
-                String name = value.getName();
-
-                boolean b = applicationStartedEvent.getApplicationContext().getBeanFactory().containsBean(name);
-                logger.info("bean:{},是否存在:{}", name, b);
-                if (!b) {
-                    logger.error("bean:{},未被注入", name);
-                }
-                Object bean = applicationStartedEvent.getApplicationContext().getBeanFactory().getBean(name);
-                value.setVideoCheckResultValid((VideoCheckResultValid) bean);
-
-            } catch (Exception e) {
-                logger.error("视频算法结果解析注入失败!");
-                e.printStackTrace();
-                logger.error("关闭项目!!!!请检查算法结果解析配置!!");
-                //关闭服务
-                applicationStartedEvent.getApplicationContext().close();
-            }
-        });
-    }
-}

+ 0 - 293
zd-modules/zd-forward/src/main/java/com/zd/forward/config/AlgorithmYml.java

@@ -1,293 +0,0 @@
-package com.zd.forward.config;
-
-
-import com.zd.common.core.exception.ServiceException;
-import com.zd.forward.serivce.CheckResultValid;
-import com.zd.forward.serivce.ImageCheckResultValidImpl;
-import com.zd.forward.serivce.VideoCheckResultValid;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
-import org.springframework.validation.annotation.Validated;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Optional;
-
-@ConfigurationProperties("sys.config")
-@RefreshScope
-@Validated
-public class AlgorithmYml {
-
-    /**
-     * 视频算法
-     */
-    Map<Integer,VideoCheckValid> videoAidMap = Collections.emptyMap();
-
-    /**
-     * 算法集合
-     */
-    Map<Integer,CheckValid> algorithmMap = Collections.emptyMap();
-
-    /**
-     * 警报配置
-     */
-    Map<Integer,AlarmConfig> alarmConfigMap = Collections.emptyMap();
-
-    /**
-     * 中转服务图片提交地址
-     */
-    @NotBlank(message = "中转服务图片提交地址")
-    String imgPostUrl;
-
-
-    String imgTemp;
-
-    /**
-     * save log  Url
-     */
-    @NotBlank(message = "检查日志提交url地址不能为空")
-    String checkLogUrl;
-
-    /**
-    * 跳过次数 -1 为不开启跳过 默认为3
-     */
-    Integer jumpThreshold=2;
-
-
-    @NotBlank(message = "项目地址不能为空")
-    String loginUri;
-
-    /**
-     * 转发目标地址
-     */
-    String targetUrl;
-
-    /**
-     * 1号喇叭IP
-     */
-    String loudspeakerIp1;
-    /**
-     * 2号喇叭IP
-     */
-    String loudspeakerIp2;
-
-    /**
-     * 喇叭开关
-     */
-    boolean loudspeakerSwitch=false;
-
-    public boolean isLoudspeakerSwitch() {
-        return loudspeakerSwitch;
-    }
-
-    public void setLoudspeakerSwitch(boolean loudspeakerSwitch) {
-        this.loudspeakerSwitch = loudspeakerSwitch;
-    }
-
-    public String getLoudspeakerIp1() {
-        return loudspeakerIp1;
-    }
-
-    public void setLoudspeakerIp1(String loudspeakerIp1) {
-        this.loudspeakerIp1 = loudspeakerIp1;
-    }
-
-    public String getLoudspeakerIp2() {
-        return loudspeakerIp2;
-    }
-
-    public void setLoudspeakerIp2(String loudspeakerIp2) {
-        this.loudspeakerIp2 = loudspeakerIp2;
-    }
-
-    public String getImgTemp() {
-        return imgTemp;
-    }
-
-    public void setImgTemp(String imgTemp) {
-        this.imgTemp = imgTemp;
-    }
-
-    public Integer getJumpThreshold() {
-        return jumpThreshold;
-    }
-
-    public void setJumpThreshold(Integer jumpThreshold) {
-        this.jumpThreshold = jumpThreshold;
-    }
-
-    public Map<Integer, VideoCheckValid> getVideoAidMap() {
-        return Collections.unmodifiableMap(videoAidMap);
-    }
-
-    public void setVideoAidMap(Map<Integer, VideoCheckValid> videoAidMap) {
-        this.videoAidMap = videoAidMap;
-    }
-
-    public Map<Integer, AlarmConfig> getAlarmConfigMap() {
-        return alarmConfigMap;
-    }
-
-    public void setAlarmConfigMap(Map<Integer, AlarmConfig> alarmConfigMap) {
-        this.alarmConfigMap = alarmConfigMap;
-    }
-
-    public String getLoginUri() {
-        return loginUri;
-    }
-
-    public void setLoginUri(String loginUri) {
-        this.loginUri = loginUri;
-    }
-
-    public String getTargetUrl() {
-        return targetUrl;
-    }
-
-    public void setTargetUrl(String targetUrl) {
-        this.targetUrl = targetUrl;
-    }
-
-    public String getCheckLogUrl() {
-        return checkLogUrl;
-    }
-
-    public void setCheckLogUrl(String checkLogUrl) {
-        this.checkLogUrl = checkLogUrl;
-    }
-
-    public static class VideoCheckValid{
-        @NotNull (message = "描述不能为空")
-        String tips;
-
-        @NotBlank (message = "算法结构解析实现类不能为空")
-        private String name = "videoCheckResultValidImpl";
-
-        private VideoCheckResultValid videoCheckResultValid;
-
-        public String getTips() {
-            return tips;
-        }
-
-        public void setTips(String tips) {
-            this.tips = tips;
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public VideoCheckResultValid getVideoCheckResultValid() {
-            return videoCheckResultValid;
-        }
-
-        public void setVideoCheckResultValid(VideoCheckResultValid videoCheckResultValid) {
-            this.videoCheckResultValid = videoCheckResultValid;
-        }
-    }
-
-    public static class AlarmConfig{
-        private String funNum;
-        private String describe;
-
-        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;
-        }
-    }
-
-    public static class CheckValid {
-        //算法ID
-        @NotNull (message = "算法ID不能为空")
-        private Integer algoId;
-        //cid
-        @NotNull (message = "数据ID不能为空")
-        private String did;
-
-        private String algorithmName;
-
-        //默认使用图片post 推送结果解析类
-        @NotNull (message = "算法结构解析实现类不能为空")
-        private Class<?> classPath = ImageCheckResultValidImpl.class;
-        //检查结果检查实现类
-        private CheckResultValid checkResultValid;
-
-        public String getAlgorithmName() {
-            return algorithmName;
-        }
-
-        public void setAlgorithmName(String algorithmName) {
-            this.algorithmName = algorithmName;
-        }
-
-        public Integer getAlgoId() {
-            return algoId;
-        }
-
-        public void setAlgoId(Integer algoId) {
-            this.algoId = algoId;
-        }
-
-        public String getDid() {
-            return did;
-        }
-
-        public void setDid(String did) {
-            this.did = did;
-        }
-
-        public CheckResultValid getCheckResultValid() {
-            return checkResultValid;
-        }
-
-        public void setCheckResultValid(CheckResultValid checkResultValid) {
-            this.checkResultValid = checkResultValid;
-        }
-
-        public Class<?> getClassPath() {
-            return classPath;
-        }
-
-        public void setClassPath(Class<?> classPath) {
-            this.classPath = classPath;
-        }
-    }
-
-    public String getImgPostUrl() {
-        return imgPostUrl;
-    }
-
-    public void setImgPostUrl(String imgPostUrl) {
-        this.imgPostUrl = imgPostUrl;
-    }
-
-    public Map<Integer, CheckValid> getAlgorithmMap() {
-        return Collections.unmodifiableMap(algorithmMap);
-    }
-
-    public void setAlgorithmMap(Map<Integer,CheckValid> algorithmMap) {
-        this.algorithmMap = algorithmMap;
-    }
-
-    public CheckValid getCheckValid(Integer code) {
-        return Optional.ofNullable(getAlgorithmMap().get(code))
-                .orElseThrow(() -> new ServiceException("未配置对应算法code:" + code));
-    }
-}

+ 0 - 110
zd-modules/zd-forward/src/main/java/com/zd/forward/config/WebConfig.java

@@ -1,110 +0,0 @@
-package com.zd.forward.config;
-
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.conn.ConnectionKeepAliveStrategy;
-import org.apache.http.conn.HttpClientConnectionManager;
-import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
-import org.springframework.boot.web.client.RestTemplateBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.client.ClientHttpRequestFactory;
-import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
-import org.springframework.http.client.SimpleClientHttpRequestFactory;
-import org.springframework.web.client.RestTemplate;
-
-import javax.annotation.Resource;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author Administrator
- */
-@Configuration
-public class WebConfig {
-
-    @Resource
-    private RestTemplateBuilder restTemplateBuilder;
-    /**
-     * 自创建RestTemplate
-     * 这里需要重命名, 因为会导致原来的负载均衡冲突失效 导致项目起不来
-     * @return restTemplateLocal
-     */
-    @Bean
-    public static RestTemplate restTemplateLocal() {
-        SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
-        // 设置连接超时,单位毫秒
-        requestFactory.setConnectTimeout(10000);
-        //设置读取超时
-        requestFactory.setReadTimeout(10000);
-        RestTemplate restTemplate = new RestTemplate();
-        restTemplate.setRequestFactory(requestFactory);
-        return restTemplate;
-    }
-
-    /**
-     * 让spring管理RestTemplate,参数相关配置
-     *
-     * @return restTemplate
-     */
-    @Bean
-    public RestTemplate restTemplate() {
-        RestTemplate restTemplate = restTemplateBuilder.build();
-        restTemplate.setRequestFactory(clientHttpRequestFactory());
-        return restTemplate;
-    }
-
-    /**
-     * 客户端请求链接策略
-     *
-     * @return clientHttpRequestFactory
-     */
-    private ClientHttpRequestFactory clientHttpRequestFactory() {
-        HttpComponentsClientHttpRequestFactory clientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory();
-        clientHttpRequestFactory.setHttpClient(httpClientBuilder().build());
-        // 连接超时时间/毫秒
-        clientHttpRequestFactory.setConnectTimeout(60000);
-        // 读写超时时间/毫秒
-        clientHttpRequestFactory.setReadTimeout(60000);
-        // 请求超时时间/毫秒
-        clientHttpRequestFactory.setConnectionRequestTimeout(50000);
-        return clientHttpRequestFactory;
-    }
-
-    /**
-     * 设置HTTP连接管理器,连接池相关配置管理
-     *
-     * @return 客户端链接管理器
-     */
-    private HttpClientBuilder httpClientBuilder() {
-        HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
-        httpClientBuilder.setConnectionManager(poolingConnectionManager());
-        ConnectionKeepAliveStrategy connectionKeepAliveStrategy = (httpResponse, httpContext) -> 20 * 1000;
-        httpClientBuilder.setKeepAliveStrategy(connectionKeepAliveStrategy);
-        httpClientBuilder.setRetryHandler(new DefaultHttpRequestRetryHandler());
-        RequestConfig requestConfig = RequestConfig.custom()
-                .setConnectTimeout(10 * 1000)
-                .setSocketTimeout(10 * 1000)
-                .setConnectionRequestTimeout(10 * 1000)
-                .build();
-        httpClientBuilder.setDefaultRequestConfig(requestConfig);
-        return httpClientBuilder;
-    }
-
-    /**
-     * 链接线程池管理,可以keep-alive不断开链接请求,这样速度会更快 MaxTotal 连接池最大连接数 DefaultMaxPerRoute
-     * 每个主机的并发 ValidateAfterInactivity
-     * 可用空闲连接过期时间,重用空闲连接时会先检查是否空闲时间超过这个时间,如果超过,释放socket重新建立
-     *
-     * @return poolingConnectionManager
-     */
-    private HttpClientConnectionManager poolingConnectionManager() {
-        PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
-        poolingConnectionManager.setMaxTotal(1000);
-        poolingConnectionManager.setDefaultMaxPerRoute(5000);
-        poolingConnectionManager.setValidateAfterInactivity(30000);
-        poolingConnectionManager.closeIdleConnections(30, TimeUnit.SECONDS);
-        poolingConnectionManager.closeExpiredConnections();
-        return poolingConnectionManager;
-    }
-}

+ 0 - 45
zd-modules/zd-forward/src/main/java/com/zd/forward/controller/AlarmController.java

@@ -1,45 +0,0 @@
-package com.zd.forward.controller;
-
-
-import com.github.xiaoymin.knife4j.annotations.ApiSupport;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.exception.ServiceException;
-import com.zd.common.swagger.config.Knife4jConfiguration;
-import com.zd.forward.serivce.ImageService;
-import com.zd.system.api.domain.SysFile;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.io.IOException;
-
-/**
- * 报警拍照服务
- */
-@Api(tags = {"报警拍照服务"})
-@ApiSupport(author = Knife4jConfiguration.Author.ZP)
-@RestController
-@RequestMapping("/alarm")
-public class AlarmController {
-
-    @Resource
-    private ImageService imageService;
-
-    @ApiOperation(value = "拍照")
-    @GetMapping("/photograph")
-    public R<SysFile> photograph(@RequestParam("streamUrl") String streamUrl) {
-        try {
-            SysFile sysFile = imageService.photograph(streamUrl);
-            if (sysFile!=null){
-                return R.ok(sysFile);
-            }
-            return R.fail("图片抓拍失败");
-        } catch (IOException|ServiceException e) {
-            throw new ServiceException(e.getMessage());
-        }
-    }
-}

+ 0 - 164
zd-modules/zd-forward/src/main/java/com/zd/forward/controller/SignInCheckController.java

@@ -1,164 +0,0 @@
-package com.zd.forward.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.github.xiaoymin.knife4j.annotations.ApiSupport;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.domain.Result;
-import com.zd.common.core.exception.ServiceException;
-import com.zd.common.core.utils.Assert;
-import com.zd.common.redis.service.RedisService;
-import com.zd.common.swagger.config.Knife4jConfiguration;
-import com.zd.forward.config.AlgorithmYml;
-import com.zd.forward.domain.VideoRequestData;
-import com.zd.forward.serivce.*;
-import com.zd.system.api.domain.Algorithm;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import java.util.Map;
-import java.util.Optional;
-
-
-/**
- * 签到验证
- */
-@Api(tags = {"签到验证:算法转发服务"})
-@ApiSupport(author = Knife4jConfiguration.Author.ZP)
-@RestController
-@RequestMapping("/signIn/check")
-public class SignInCheckController {
-
-    Logger logger = LoggerFactory.getLogger(SignInCheckController.class);
-
-    @Autowired
-    CheckService checkService;
-
-    @Autowired
-    VideoCheckResultValidImpl videoCheckResultValid;
-
-    @Autowired
-    RedisService redisService;
-
-    @Autowired
-    SendSginAccessLogService sendSginAccessLogService;
-
-    @Autowired
-    AlgorithmYml algorithmYml;
-
-    @Resource
-    private FireImageService fireImageService;
-
-    /**
-     * 进入项验证
-     *
-     * @param id   进出记录ID
-     * @param code 字典sub_check_in类型下的的值
-     * @param file 带验证图片
-     */
-    @ApiOperation(value = "进入项验证")
-    @PostMapping("/{code}/{id}")
-    public R checkIn(@ApiParam("进出记录ID") @PathVariable("id") Long id, @ApiParam("验证类型编码") @PathVariable("code") String code, @RequestParam("file") MultipartFile file) {
-        return checkService.checkAndCommit(code, file, id);
-    }
-
-    /**
-     * 进入项验证:合并
-     *
-     * @param id   进出记录ID
-     * @param file 带验证图片
-     */
-    @ApiOperation(value = "进入项验证:合并,codes格式:1,2,3")
-    @PostMapping("/checkInAll")
-    public R checkInAll(@ApiParam("进出记录ID") @RequestParam("id") Long id,
-                        @ApiParam("图片文件") @RequestParam("file") MultipartFile file,
-                        @ApiParam("实验室ID") @RequestParam("subId") Long subId) {
-        return checkService.checkAndCommit(id, file, subId);
-    }
-
-
-    /**
-     * 进入项验证:mock方法
-     *
-     * @param code 字典sub_check_in类型下的的值
-     * @param file 带验证图片
-     */
-    @ApiOperation(value = "进入项验证:mock方法")
-    @PostMapping("/mock/{code}/{id}")
-    public R checkInMock(@ApiParam("进出记录ID") @PathVariable("id") Long id, @ApiParam("验证类型编码") @PathVariable("code") String code, @RequestParam("file") MultipartFile file) {
-        return checkService.mockTest(code, file, id);
-    }
-
-
-    @ApiOperation(value = "进入项验证(测试):必须登录权限后面加!!")
-    @PostMapping("/test1")
-    public R test1() {
-        checkService.send("1", 100L, true, "");
-        return R.ok();
-    }
-
-
-    @ApiOperation(value = "视频回调,code 来自字典:检查项")
-    @PostMapping("/callback")
-    public R callBack(@ApiParam("验证类型编码") @RequestBody VideoRequestData videoRequestData) {
-        Map<Integer, AlgorithmYml.VideoCheckValid> videoAidMap = algorithmYml.getVideoAidMap();
-        AlgorithmYml.VideoCheckValid algorithmCheck = Optional.ofNullable(videoAidMap.get(videoRequestData.getAid()))
-                .orElseThrow(() -> new ServiceException("未配置的算法类型"));
-        Assert.isTrue(videoRequestData.getStatus() == 1, "算法服务检测失败!。");
-        redisService.setCacheObject("VIDEO_CID:" + videoRequestData.getCid(), Long.valueOf(videoRequestData.getCid()));
-        Long subId = redisService.getCacheObject("VIDEO_CID:" + videoRequestData.getCid());
-        if (subId == null) {
-            logger.info("未找到CID对应的实验室");
-            return R.fail("未找到CID对应的实验室");
-        }
-        checkService.checkVideo(algorithmCheck, videoRequestData, subId);
-        return R.ok();
-    }
-
-    @ApiOperation(value = "警报回调")
-    @PostMapping("/alarmCallBack")
-    public Result fireCallBack(@RequestBody VideoRequestData videoRequestData) {
-        Integer aid = videoRequestData.getAid();
-        if (aid!=null){
-            if (aid.equals(9610)){
-                logger.info("=====================>测试回调了。。。{}",videoRequestData.getAlgo_name());
-                checkService.sendAlarm(videoRequestData);
-            }else if (aid.equals(9690)){
-                checkService.playMp3();
-            }
-        }
-        return Result.ok();
-    }
-
-    @ApiOperation(value = "语音播报")
-    @PostMapping("/playMp3")
-    public Result playMp3() {
-        checkService.playMp3();
-        return Result.ok();
-    }
-
-    @ApiOperation(value = "测试算法保存")
-    @PostMapping("/algorithm/test/save")
-    public R saveAlgorithmTest(@RequestBody JSONObject aa) {
-        Algorithm algorithm = new Algorithm();
-        algorithm.setAlgorithmResult(aa.toJSONString());
-        sendSginAccessLogService.saveAlgorithmResult(algorithm);
-        return R.ok(aa);
-    }
-
-    /**
-     * 火焰算法验证
-     * @param file 带验证图片
-     */
-    @ApiOperation(value = "进入项验证:合并,codes格式:1,2,3")
-    @PostMapping("/checkFire")
-    public R checkFire(@ApiParam("图片文件") @RequestParam("file") MultipartFile file) {
-        return R.ok(fireImageService.catchImage(file));
-    }
-}

+ 0 - 13
zd-modules/zd-forward/src/main/java/com/zd/forward/domain/AnalysisData.java

@@ -1,13 +0,0 @@
-package com.zd.forward.domain;
-
-import lombok.Data;
-
-@Data
-public class AnalysisData {
-
-    private int code;
-    private String msg;
-    private Object result;
-    private String ret_image;
-    private String src_image;
-}

+ 0 - 30
zd-modules/zd-forward/src/main/java/com/zd/forward/domain/BaseRequestData.java

@@ -1,30 +0,0 @@
-package com.zd.forward.domain;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/11/13/10:58
- * @Description:
- */
-public class BaseRequestData {
-
-    //算法ID,由极视角定义的算法ID,只读
-    private Long aid;
-    //摄像头ID,存在两种情况:
-    private String cid;
-
-    public Long getAid() {
-        return aid;
-    }
-
-    public void setAid(Long aid) {
-        this.aid = aid;
-    }
-
-    public String getCid() {
-        return cid;
-    }
-
-    public void setCid(String cid) {
-        this.cid = cid;
-    }
-}

+ 0 - 14
zd-modules/zd-forward/src/main/java/com/zd/forward/domain/DataPostAnalysisRespDto.java

@@ -1,14 +0,0 @@
-package com.zd.forward.domain;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class DataPostAnalysisRespDto {
-
-    private Integer aid;
-    private String did;
-    private String extension;
-    private List<AnalysisData> analysisDatas;
-}

+ 0 - 62
zd-modules/zd-forward/src/main/java/com/zd/forward/domain/ImageRequestData.java

@@ -1,62 +0,0 @@
-package com.zd.forward.domain;
-
-import org.springframework.web.multipart.MultipartFile;
-
-/**
- * 图片输入源参数
- * @Author: zhoupan
- * @Date: 2021/11/13/10:59
- * @Description:
- */
-public class ImageRequestData extends BaseRequestData{
-    //分析图片:form-data
-    MultipartFile image;
-    //时间戳(单位秒)
-    Long timestamp;
-    //是否同步:1-同步(默认),0-异步
-    int sync;
-    //回调地址,设置异步时必传
-    String callback;
-    //扩展字段,响应时会返回该扩展字段
-    String extension;
-
-    public MultipartFile getImage() {
-        return image;
-    }
-
-    public void setImage(MultipartFile image) {
-        this.image = image;
-    }
-
-    public Long getTimestamp() {
-        return timestamp;
-    }
-
-    public void setTimestamp(Long timestamp) {
-        this.timestamp = timestamp;
-    }
-
-    public int getSync() {
-        return sync;
-    }
-
-    public void setSync(int sync) {
-        this.sync = sync;
-    }
-
-    public String getCallback() {
-        return callback;
-    }
-
-    public void setCallback(String callback) {
-        this.callback = callback;
-    }
-
-    public String getExtension() {
-        return extension;
-    }
-
-    public void setExtension(String extension) {
-        this.extension = extension;
-    }
-}

+ 0 - 18
zd-modules/zd-forward/src/main/java/com/zd/forward/domain/ImgPostResponse.java

@@ -1,18 +0,0 @@
-package com.zd.forward.domain;
-
-import lombok.Data;
-
-import java.util.Map;
-
-/**
- * 图片算法返回值
- */
-@Data
-public class ImgPostResponse<T> {
-    //1000 成功
-    private long status_code;
-
-    private String message;
-
-    private T data;
-}

+ 0 - 103
zd-modules/zd-forward/src/main/java/com/zd/forward/domain/RequestData.java

@@ -1,103 +0,0 @@
-package com.zd.forward.domain;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/11/13/10:10
- * @Description:
- */
-public class RequestData {
-
-    //算法ID,由极视角定义的算法ID,只读
-    private String aid;
-    //摄像头ID,存在两种情况:
-    private String cid;
-    //摄像头对应拉流地址/rtsp
-    private Long cid_ur;
-    //算法服务器时间戳,unix标准时间戳格式
-    private Long time_stamp;
-    //状态值
-    private int status;
-    //srcpic_name 报警输出图片关联的原始分析图片
-    private String srcpic_name;
-    //原始分析图片,base64格式编码
-    private String srcpic_data;
-    /**
-     * 报警图片命名,格式为 “时间(精确到秒)_us(微秒)_cid(摄像头ID)_fix(输入或输 出).jpg”,
-     * 例:20180719121005_266236_3_out.jpg
-     */
-    private String pic_name;
-    //报警结果图片,base64格式编码 不带换行
-    private String pic_data;
-
-    public String getAid() {
-        return aid;
-    }
-
-    public void setAid(String aid) {
-        this.aid = aid;
-    }
-
-    public String getCid() {
-        return cid;
-    }
-
-    public void setCid(String cid) {
-        this.cid = cid;
-    }
-
-    public Long getCid_ur() {
-        return cid_ur;
-    }
-
-    public void setCid_ur(Long cid_ur) {
-        this.cid_ur = cid_ur;
-    }
-
-    public Long getTime_stamp() {
-        return time_stamp;
-    }
-
-    public void setTime_stamp(Long time_stamp) {
-        this.time_stamp = time_stamp;
-    }
-
-    public int getStatus() {
-        return status;
-    }
-
-    public void setStatus(int status) {
-        this.status = status;
-    }
-
-    public String getSrcpic_name() {
-        return srcpic_name;
-    }
-
-    public void setSrcpic_name(String srcpic_name) {
-        this.srcpic_name = srcpic_name;
-    }
-
-    public String getSrcpic_data() {
-        return srcpic_data;
-    }
-
-    public void setSrcpic_data(String srcpic_data) {
-        this.srcpic_data = srcpic_data;
-    }
-
-    public String getPic_name() {
-        return pic_name;
-    }
-
-    public void setPic_name(String pic_name) {
-        this.pic_name = pic_name;
-    }
-
-    public String getPic_data() {
-        return pic_data;
-    }
-
-    public void setPic_data(String pic_data) {
-        this.pic_data = pic_data;
-    }
-}

+ 0 - 96
zd-modules/zd-forward/src/main/java/com/zd/forward/domain/VideoRequestData.java

@@ -1,96 +0,0 @@
-package com.zd.forward.domain;
-
-import lombok.Data;
-import lombok.ToString;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 视频算法回调 返回值
- */
-@ToString
-@Data
-public class VideoRequestData {
-
-    /**
-     * 算法分析前图片数据,Base64,具体看平台是否勾选需要
-     */
-    private String srcpic_data;
-
-    /**
-     * 报警帧原始图片文件名
-     */
-    private String srcpic_name;
-
-    /**
-     * 算法分析前图片地址,具体请看示例
-     */
-    private String srcpic_url;
-
-    /**
-     * 算法分析的时间,1970‑01‑01 00:00:00至今的秒数
-     */
-    private Long time_stamp;
-
-    /**
-     * 算法分析后图片数据,Base64,具体看平台是否勾选需要
-     */
-    private String pic_data;
-
-    /**
-     * 算法分析后图片地址(非人脸算法必有),具体请看示例
-     */
-    private String pic_url;
-
-    private Map<String,Object> data;
-
-    private String did;
-    private String extension;
-    private List<AnalysisData> analysisDatas;
-
-    /**
-     * 算法id
-     */
-    private Integer aid;
-
-    /**
-     * 摄像头拉流地址,对应运行参数cid_url
-     */
-    private String cid_url;
-
-    /**
-     * 相机id
-     */
-    private String cid;
-
-    /**
-     * 报警状态,1为报警,其它为非报警
-     */
-    private int status;
-
-    /**
-     * 算法分析后的报警图片文件名
-     */
-    private String pic_name;
-
-    /**
-     * 算法名称
-     */
-    private String algo_name;
-
-    /**
-     * 告警摄像头名称
-     */
-    private String device_name;
-
-    /**
-     * 经度
-     */
-    private Double location_lng;
-    /**
-     * 纬度
-     */
-    private Double location_lat;
-
-}

+ 0 - 49
zd-modules/zd-forward/src/main/java/com/zd/forward/listener/StartListener.java

@@ -1,49 +0,0 @@
-package com.zd.forward.listener;
-
-import com.zd.common.core.exception.ServiceException;
-import com.zd.forward.properties.FireProperties;
-import com.zd.forward.serivce.FireImageService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.io.IOException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 监听Spring容器启动完成,完成后启动Netty服务器
- *
- * @author dgs
- **/
-@Component
-@Slf4j
-public class StartListener implements CommandLineRunner {
-    @Resource
-    private FireImageService fireImageService;
-    @Resource
-    private FireProperties fireProperties;
-
-    @Resource
-    private ScheduledExecutorService scheduledExecutorService;
-
-    @Override
-    public void run(String... args) {
-        scheduledExecutorService.scheduleWithFixedDelay(() -> {
-            try {
-                String streamUrl = fireProperties.getStreamUrl();
-                if (streamUrl == null) {
-                    log.error("=========调用产生异常:未配置流媒体地址============");
-                    return;
-                }
-                fireImageService.catchImage();
-            } catch (ServiceException | IOException e) {
-                //异常回调,防止系统因异常问题被杀死
-                log.error("=========调用产生异常:{}============", e.getMessage());
-                run();
-            }
-        },0,fireProperties.getWaitTime(), TimeUnit.SECONDS);
-    }
-
-}

+ 0 - 51
zd-modules/zd-forward/src/main/java/com/zd/forward/properties/FireProperties.java

@@ -1,51 +0,0 @@
-package com.zd.forward.properties;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
-import org.springframework.validation.annotation.Validated;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * @author Administrator
- */
-@ConfigurationProperties("fire")
-@RefreshScope
-@Validated
-@Data
-public class FireProperties {
-
-    @NotNull(message = "算法ID不能为空")
-    private Integer algoId;
-    /**
-     * did 数据ID
-     */
-    @NotNull (message = "数据ID不能为空")
-    private String did;
-
-    /**
-     * 实验室ID,和设备编号二选一即可
-     */
-    private Integer labId;
-
-    /**
-     * 设备编号,和实验室ID二选一即可
-     */
-    private String hardwareNum;
-    /**
-     * 算法名称
-     */
-    private String algorithmName;
-
-    /**
-     * 视频流地址
-     */
-    private String streamUrl;
-
-    /**
-     * 间隔时间
-     */
-    private Integer waitTime=1;
-
-}

+ 0 - 17
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/CheckResultValid.java

@@ -1,17 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.zd.common.core.domain.R;
-
-import java.util.Map;
-
-/**
- * 检查结果验证
- * @Author: zhoupan
- * @Date: 2021/11/14/10:26
- * @Description:
- */
-@FunctionalInterface
-public interface CheckResultValid {
-
-    R apply(Map<String,Object>  map);
-}

+ 0 - 546
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/CheckService.java

@@ -1,546 +0,0 @@
-package com.zd.forward.serivce;
-
-import cn.hutool.core.text.CharSequenceUtil;
-import cn.hutool.core.util.RandomUtil;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.zd.common.core.constant.Constants;
-import com.zd.common.core.constant.SecurityConstants;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.exception.ServiceException;
-import com.zd.common.core.utils.ServletUtils;
-import com.zd.common.core.utils.StringUtils;
-import com.zd.common.redis.service.RedisService;
-import com.zd.forward.config.AlgorithmYml;
-import com.zd.forward.domain.AnalysisData;
-import com.zd.forward.domain.DataPostAnalysisRespDto;
-import com.zd.forward.domain.ImgPostResponse;
-import com.zd.forward.domain.VideoRequestData;
-import com.zd.forward.serivce.mqtt.CommonSend;
-import com.zd.forward.utils.Base64DecodedMultipartFile;
-import com.zd.forward.utils.FileUploadUtils;
-import com.zd.forward.utils.HttpUtils;
-import com.zd.system.api.RemoteFileService;
-import com.zd.system.api.alarm.RemoteAlarmService;
-import com.zd.system.api.alarm.domain.AlarmEntrty;
-import com.zd.system.api.alarm.domain.Routes;
-import com.zd.system.api.alarm.domain.SendTypes;
-import com.zd.system.api.domain.Algorithm;
-import com.zd.system.api.domain.SysFile;
-import com.zd.system.api.laboratory.RemoteLaboratoryService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.stereotype.Service;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.multipart.MultipartFile;
-import sun.misc.BASE64Decoder;
-import zd.common.mqtt.config.MessageBody;
-
-import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.*;
-
-import static com.zd.forward.utils.HttpUtils.*;
-
-@Service
-@RefreshScope
-public class CheckService {
-    Logger logger = LoggerFactory.getLogger(CheckService.class);
-    @Resource(name = "restTemplateLocal")
-    private RestTemplate restTemplateLocal;
-    /**
-     * 上传文件存储在本地的根路径
-     */
-    @Value("${file.path:/home/AIPIC}")
-    private String localFilePath;
-
-    @Autowired
-    private AlgorithmYml algorithmYml;
-
-    @Autowired
-    private RedisService redisService;
-
-    @Autowired
-    private RemoteAlarmService remoteAlarmService;
-
-    @Autowired
-    private CommonSend commonSend;
-
-    @Autowired
-    private SendSginAccessLogService sendSginAccessLogService;
-
-    @Autowired
-    private RemoteFileService remoteFileService;
-
-    @Autowired
-    private RemoteLaboratoryService laboratoryService;
-
-
-    private static final String warn = "违规操作告警:请{},离开实验室!";
-
-    /**
-     * 合并检查 三合一套餐
-     */
-    public R checkAndCommit(Long id, MultipartFile file, Long subId) {
-        try {
-            int alarmNum = 0;
-            //========= 请求超时验证部分开始 ===========
-            //600 则代表退出验证流程 需要重新刷卡
-//            R<Long> fail = getObjectR(id);
-//            if (fail.getCode() != 200) {
-//                return fail;
-//            }
-            //根据实验室id查询检查项
-            R<Map<Object, Object>> subject = laboratoryService.getCheckInfo(subId);
-            if (subject.getCode() != 200) {
-                return subject;
-            }
-            Map<Object, Object> map = subject.getData();
-            Object labCheckInObj = map.get("checkIn");
-            if (StringUtils.isNull(labCheckInObj)) {
-                return R.fail(700, "未配置检查项");
-            }
-            String labSkipped = "0";
-            String labCheckCount = "2";
-            Object labSkippedObj = map.get("skipped");
-            if (StringUtils.isNotNull(labSkippedObj)) {
-                labSkipped = String.valueOf(labSkippedObj);
-            }
-            Object labCheckCountObj = map.get("checkCount");
-            if (StringUtils.isNotNull(labCheckCountObj)) {
-                labCheckCount = String.valueOf(labCheckCountObj);
-            }
-            String labCheckIn = String.valueOf(labCheckInObj);
-            String[] checkItem = labCheckIn.split(",");
-            File toFile = multipartFileToFile(file);
-            for (String code : checkItem) {
-                //========= 获取算法INFO ===========
-                AlgorithmYml.CheckValid checkValid = algorithmYml.getCheckValid(Integer.valueOf(code));
-                MultiValueMap<String, Object> params = getStringObjectMultiValueMap(checkValid, String.valueOf(id));
-                HttpEntity<MultiValueMap<String, Object>> files = getHttpEntityMap(toFile, params);
-                logger.info("===============4=================");
-                ImgPostResponse<DataPostAnalysisRespDto> send = HttpUtils.send(restTemplateLocal, files, algorithmYml);
-                if (send == null || send.getStatus_code() != 1000) {
-                    assert send != null;
-                    logger.error(send.getMessage());
-                    return R.fail("算法服务错误,请重试!");
-                }
-                logger.info("===============5=================");
-                R algorithm = saveAlgorithm(send, checkValid);
-                if (algorithm.getCode() != 200) return algorithm;
-                DataPostAnalysisRespDto data = send.getData();
-
-                Map<String, Object> result = (Map<String, Object>) data.getAnalysisDatas().get(0).getResult();
-                Map<String, Object> algorithmData = (Map<String, Object>) result.get("algorithm_data");
-                Map<String, Object> modelResult = (Map<String, Object>) result.get("model_data");
-                List<Map<String, Object>> objects = (List<Map<String, Object>>) modelResult.get("objects");
-                logger.info("============算法请求日志打印:算法ID:{},请求结果:{}", code, algorithmData.getOrDefault("is_alert", ""));
-                //通过的
-                if (algorithmData.getOrDefault("is_alert", "").toString().equals("false") && !objects.isEmpty()) {
-                    alarmNum++;
-                } else {
-                    //不跳过
-                    if (StringUtils.isNotEmpty(labSkipped) && labSkipped.equals("1")) {
-                        //如果没有通过则次数加一
-                        //键为前缀+签到id +下划线+验证类型
-                        String key = Constants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
-                        Long increment = redisService.redisTemplate.opsForValue().increment(key);
-                        redisService.expire(key, Constants.SINGIN_OUT_TIME);
-                        if (increment != null && increment >= Integer.parseInt(labCheckCount)) {
-                            //黎晨这里让把跳过时状态码改为700,所以700的含义为检查失败并且跳过
-                            return R.fail(700, "符合跳过条件执行跳过");
-                        }
-                    }
-                    return R.fail(300, "算法识别未通过", code);
-                }
-                Boolean f = send.getStatus_code() == 1000;
-                String msg = f ? "解析成功!" : "解析失败!";
-                send(code, id, f, msg);
-            }
-            if (alarmNum == checkItem.length) {
-                return R.ok();
-            }
-        } catch (Exception e) {
-            logger.error(e.getMessage());
-            e.printStackTrace();
-        }
-        return R.fail();
-    }
-
-    /**
-     * @param id 进出记录ID
-     */
-    public R checkAndCommit(String code, MultipartFile file, Long id) {
-        //========= 请求超时验证部分开始 ===========
-        //600 则代表退出验证流程 需要重新刷卡
-        R<Long> fail = getObjectR(id);
-        if (fail.getCode() != 200) {
-            return fail;
-        }
-        //========= 请求超时验证部分结束 ===========
-        //========= 获取算法INFO ===========
-        AlgorithmYml.CheckValid checkValid = algorithmYml.getCheckValid(Integer.valueOf(code));
-        //=========发送验证信息到算法服务开始
-        JSONObject send = null;
-        try {
-            send = send(file, checkValid, id);
-        } catch (Exception e) {
-            logger.error(e.getMessage());
-            e.printStackTrace();
-        }
-        //=========发送验证信息到算法服务结束
-        //=========算法服务返回结果验证开始
-        R apply = R.fail("算法服务错误,请重试!");
-        Boolean f = false;
-        try {
-            if (send == null || send.getInteger("status_code") != 1000L) {
-                apply = R.fail("算法服务错误,请重试!");
-                return apply;
-            }
-            Map<String, Object> result = null;
-            try {
-                result = send.getJSONObject("data").getJSONObject("result").getInnerMap();
-            } catch (Exception e) {
-                e.printStackTrace();
-                apply = R.fail("算法服务返回数据错误,请联系管理员!");
-                return apply;
-            }
-            //todo  获取 检测结果
-            apply = checkValid.getCheckResultValid().apply(result);
-            f = apply.getCode() == 200;
-            if (!f && algorithmYml.getJumpThreshold() != -1) {
-                //如果没有通过则次数加一
-                //键为前缀+签到id +下划线+验证类型
-                String key = Constants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
-                Long increment = redisService.redisTemplate.opsForValue().increment(key);
-                redisService.expire(key, Constants.SINGIN_OUT_TIME);
-                if (increment >= algorithmYml.getJumpThreshold()) {
-                    //黎晨这里让把跳过时状态码改为700,所以700的含义为检查失败并且跳过
-                    apply.setCode(700);
-                }
-            }
-        } catch (Exception ex) {
-            ex.printStackTrace();
-            apply = R.fail("算法服务返回数据错误,请联系管理员!");
-            return apply;
-        } finally {
-//            //无论成功失败,插入记录数据,异步请求远程接口
-            send(code, id, f, apply.getMsg());
-//            //保存识别记录
-//            String r = send == null ? null : send.toJSONString();
-//           sendSginAccessLogService.saveAlgorithmResult(cereataAlgorithm(r, "image", f, apply.getMsg(), id, fail.getData()));
-//            //持久化
-//            Map<String, Object> data = (Map<String, Object>) send.get("data");
-//           /* Object srcImage =  data.get("src_image");
-//            String srcImg = this.generateImage(srcImage.toString(),algorithmYml.getImgTemp());*/
-//            data.put("src_img", fileR.getData().getUrl());
-//            data.put("type", "image");
-//            data.put("algorithmName", checkValid.getAlgorithmName());
-////            restTemplateLocal.postForEntity("http://192.168.1.17:9218/algorithm/save",data,String.class).getBody();
-//            laboratoryService.saveData(Covert(data));
-        }
-        //=========算法服务返回结果验证结束
-        logger.info(apply.toString());
-        if (apply.getCode() == 200) {
-            //加奖励分
-            // laboratoryService.addRecord();
-        }
-        return apply;
-    }
-
-
-    /**
-     * 三合一
-     *
-     * @param ids
-     * @param file
-     * @param codes
-     * @return
-     */
-    public R checkInAll(Long[] ids, MultipartFile file[], String codes) {
-        Map result = new HashMap();
-        String[] codesArrs = codes.split(",");
-        for (int i = 0; i < codesArrs.length; i++) {
-            R r = checkAndCommit(codesArrs[i], file[i], ids[i]);
-            AlgorithmYml.CheckValid checkValid = algorithmYml.getCheckValid(Integer.valueOf(codesArrs[i]));
-            result.put(checkValid.getAlgoId(), r.getMsg() == null ? "通过" : r.getMsg());
-
-        }
-        return R.ok(result);
-    }
-
-
-    public Algorithm Covert(Map data) {
-        Algorithm algorithm = new Algorithm();
-        algorithm.setAlgorithmType(data.get("type").toString());
-        algorithm.setAlgorithmResult(data.get("src_img").toString());
-        algorithm.setSubId(Long.valueOf(data.get("aid").toString()));
-        algorithm.setSignId(Long.valueOf(data.get("did").toString()));
-        algorithm.setAlgorithmName(data.get("algorithmName").toString());
-        algorithm.setIsAlarm(Integer.parseInt(data.get("isAlarm").toString()));
-        algorithm.setStatus(0);
-        return algorithm;
-    }
-
-    /**
-     * @param algorithmResult
-     * @param type
-     * @param result
-     * @param msg
-     * @param signId          签到ID
-     * @param subId           实验室ID
-     * @return
-     */
-    public Algorithm cereataAlgorithm(String algorithmResult, String type, Boolean result, String msg, Long signId, Long subId) {
-        Algorithm algorithm = new Algorithm();
-        algorithm.setAlgorithmResult(algorithmResult);
-        algorithm.setAlgorithmType(type);
-        algorithm.setParseResult(result);
-        algorithm.setParseResultMsg(msg);
-        algorithm.setSignId(signId);
-        algorithm.setSubId(subId);
-        return algorithm;
-
-    }
-
-    /**
-     * 视频检查
-     *
-     * @param checkValid
-     * @param videoRequestData
-     * @param subId
-     */
-    public void checkVideo(AlgorithmYml.VideoCheckValid checkValid, VideoRequestData videoRequestData, Long subId) {
-        boolean f = false;
-        R apply = R.fail("结果解析错误");
-        try {
-            apply = checkValid.getVideoCheckResultValid().apply(videoRequestData.getData(), subId);
-            if (f = (apply.getCode() == 300)) {
-                //发送预警
-                MessageBody<String> messageBody = new MessageBody<>();
-                messageBody.setData(CharSequenceUtil.format(warn, checkValid.getTips()));
-                //给一体机发送mqtt消息
-                commonSend.send("lab/news" + subId, messageBody, 0);
-                //获取实验室负责人电话 需要远程获取,因为在内网,没有和实验室服务在一起, 不能用feign,需要手动通过网关请求
-                String adminPhoneBySubId = sendSginAccessLogService.getAdminPhoneBySubId(subId, algorithmYml.getLoginUri());
-                if (CharSequenceUtil.isNotBlank(adminPhoneBySubId)) {
-                    AlarmEntrty alarmEntrty = new AlarmEntrty(Routes.NoticePush, new String[]{SendTypes.SMS.toString()}, adminPhoneBySubId);
-                    //发送短信 通过feign 调用
-                    remoteAlarmService.send(alarmEntrty);
-                }
-            }
-        } finally {
-            String json = JSON.toJSONString(videoRequestData);
-            sendSginAccessLogService.saveAlgorithmResult(cereataAlgorithm(json, "vidoe", f, apply.getMsg(), null, subId));
-            Map<String, Object> data = (Map<String, Object>) JSONObject.parse(json);
-            Object srcImage = data.get("pic_data");
-            String srcImg = this.generateImage(srcImage.toString(), algorithmYml.getImgTemp());
-            data.put("src_img", srcImg);
-            data.put("type", "video");
-            laboratoryService.saveData(Covert(data));
-        }
-    }
-
-    /**
-     * 发送警报
-     */
-    public void sendAlarm(VideoRequestData videoRequestData) {
-        sendSginAccessLogService.saveAlarm(videoRequestData);
-    }
-
-    /**
-     * 发送警报
-     */
-    public void playMp3() {
-        sendSginAccessLogService.playMp3();
-    }
-
-
-    private R<Long> getObjectR(Long id) {
-        Long subId = redisService.getCacheObject(Constants.SINGIN_id_KEY + id);
-        if (subId == null) {
-            return R.fail(600, "签到&签出已超时,请重新刷卡重试!");
-        }
-        //刷新key
-        boolean expire = redisService.expire(Constants.SINGIN_id_KEY + id, 120);
-        if (!expire) {
-            return R.fail(600, "签到&签出已超时,请重新刷卡重试!");
-        }
-        return R.ok(subId);
-    }
-
-    //给黎晨用的模拟方法 他让给他mock个方法测试
-    public R mockTest(String code, MultipartFile file, Long id) {
-        R<Long> objectR = getObjectR(id);
-        if (objectR.getCode() != 200) {
-            return objectR;
-        }
-        //随机成功或失败
-        Boolean f = RandomUtil.randomInt(0, 2) == 0;
-        //无论成功失败,插入记录数据,异步请求远程接口
-        send(code, id, f, "");
-        if (f) {
-            return R.ok();
-        }
-        //如果没有通过则次数加一
-        Map<String, Boolean> map = new HashMap(1);
-        //键为前缀+签到id +下划线+验证类型
-        String key = Constants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
-        Long increment = redisService.redisTemplate.opsForValue().increment(key);
-        redisService.expire(key, Constants.SINGIN_OUT_TIME);
-        Boolean isJump = increment >= algorithmYml.getJumpThreshold();
-        map.put("jump", isJump);
-        R<Object> fail = R.fail();
-        fail.setData(map);
-        return fail;
-
-    }
-
-
-    public void send(String code, Long id, Boolean f, String msg) {
-        String token = Objects.requireNonNull(ServletUtils.getRequest()).getHeader(SecurityConstants.TOKEN_AUTHENTICATION);
-        if (CharSequenceUtil.isBlank(token)) {
-            throw new ServiceException("无权限!");
-        }
-        sendSginAccessLogService.sendAddLogRest(code, id, f, msg, token, algorithmYml.getLoginUri() + algorithmYml.getCheckLogUrl());
-    }
-
-    /**
-     * 获取算法请求地址
-     *
-     * @param checkValid
-     * @param id
-     * @return
-     */
-    private String getPostUrl(AlgorithmYml.CheckValid checkValid, Long id) {
-        //设置请求体,注意是LinkedMultiValueMap
-        MultiValueMap<String, Object> params = getStringObjectMultiValueMap(checkValid, String.valueOf(id));
-        Set<String> keySet = params.keySet();
-        StringBuffer stb = new StringBuffer();
-        for (String key : keySet) {
-            stb.append("&" + key + "=" + params.get(key).get(0).toString());
-        }
-        String paramUrl = algorithmYml.getImgPostUrl() + String.valueOf(stb).replaceFirst("&", "?");
-        logger.info(paramUrl);
-        return paramUrl;
-    }
-
-    /**
-     * 图片算法请求参数
-     *
-     * @param file
-     * @param checkValid
-     * @return
-     * @throws IOException
-     */
-
-    public JSONObject send(MultipartFile file, AlgorithmYml.CheckValid checkValid, Long id) throws IOException {
-        //设置请求头
-        HttpHeaders headers = new HttpHeaders();
-        headers.setContentType(MediaType.MULTIPART_FORM_DATA);
-        File uploadFile = null;
-        try {
-            // 文件本地存储收集
-            FileUploadUtils.upload(localFilePath, file);
-            //MultipartFile 转为临时文件
-            uploadFile = multipartFileToFile(file);
-            //文件转为文件系统资源
-            FileSystemResource fileSystemResource = new FileSystemResource(uploadFile);
-            //设置请求体,注意是LinkedMultiValueMap
-            MultiValueMap<String, Object> params = getStringObjectMultiValueMap(checkValid, String.valueOf(id));
-
-            MultiValueMap<String, Object> form = getStringObjectMultiValueMap(fileSystemResource);
-            params.addAll(form);
-            //用HttpEntity封装整个请求报文
-            HttpEntity<MultiValueMap<String, Object>> files = new HttpEntity<>(params, headers);
-            String paramUrl = algorithmYml.getImgPostUrl();
-            logger.info(paramUrl);
-            JSONObject body = restTemplateLocal.postForObject(paramUrl, files, JSONObject.class);
-            logger.info(body.toJSONString());
-            return body;
-        } finally {
-            //删除临时文件
-//            if (uploadFile != null) {
-//                uploadFile.delete();
-//            }
-        }
-    }
-
-    /**
-     * base64转图片/视频
-     *
-     * @param imgStr      base64位图片
-     * @param imgFilePath 路径
-     * @return
-     */
-    public String generateImage(String imgStr, String imgFilePath) {// 对字节数组字符串进行Base64解码并生成图片
-        BASE64Decoder decoder = new BASE64Decoder();
-        try {
-            // Base64解码
-            byte[] bytes = decoder.decodeBuffer(imgStr);
-            for (int i = 0; i < bytes.length; ++i) {
-                if (bytes[i] < 0) {// 调整异常数据
-                    bytes[i] += 256;
-                }
-            }
-            // 生成jpeg图片
-            imgFilePath += "/" + UUID.randomUUID() + ".jpeg";
-            OutputStream out = new FileOutputStream(imgFilePath);
-            out.write(bytes);
-            out.flush();
-            out.close();
-            return imgFilePath;
-        } catch (Exception e) {
-            return null;
-        }
-    }
-
-    /**
-     * 存储数据
-     *
-     * @param send
-     * @param checkValid
-     */
-    private R saveAlgorithm(ImgPostResponse<DataPostAnalysisRespDto> send, AlgorithmYml.CheckValid checkValid) {
-        DataPostAnalysisRespDto analysisRespDto = send.getData();
-        List<AnalysisData> analysisDatas = analysisRespDto.getAnalysisDatas();
-        if (!analysisDatas.isEmpty()) {
-            for (AnalysisData data : analysisDatas) {
-                String picture = data.getRet_image();
-                String header = "data:image/jpeg;base64," + picture;
-                MultipartFile multipartFile = Base64DecodedMultipartFile.base64ToMultipart(header);
-                R<SysFile> sysFileR = remoteFileService.upload(multipartFile);
-                String imageUrl = sysFileR.getData().getUrl();
-                Map<String, Object> result = (Map<String, Object>) data.getResult();
-                Map<String, Object> map = new HashMap<>();
-                Map<String, Object> algorithmData = (Map<String, Object>) result.get("algorithm_data");
-                Map<String, Object> modelResult = (Map<String, Object>) result.get("model_data");
-                List<Map<String, Object>> objects = (List<Map<String, Object>>) modelResult.get("objects");
-                if (algorithmData.getOrDefault("is_alert", "").toString().equals("false") && objects.size() > 0) {
-                    map.put("isAlarm", 0);
-                } else {
-                    map.put("isAlarm", 1);
-                }
-                map.put("did", checkValid.getDid());
-                map.put("aid", checkValid.getAlgoId());
-                map.put("src_img", imageUrl);
-                map.put("type", "image");
-                map.put("algorithmName", checkValid.getAlgorithmName());
-                return laboratoryService.saveData(Covert(map));
-            }
-        }
-        logger.error("接口数据返回异常");
-        throw new ServiceException("接口数据返回异常");
-    }
-}

+ 0 - 132
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/FireImageService.java

@@ -1,132 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.zd.common.core.exception.ServiceException;
-import com.zd.forward.config.AlgorithmYml;
-import com.zd.forward.domain.AnalysisData;
-import com.zd.forward.domain.DataPostAnalysisRespDto;
-import com.zd.forward.domain.ImgPostResponse;
-import com.zd.forward.properties.FireProperties;
-import com.zd.forward.utils.HttpUtils;
-import com.zd.forward.utils.VideoUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.bytedeco.javacv.FFmpegFrameGrabber;
-import org.bytedeco.javacv.Frame;
-import org.bytedeco.javacv.Java2DFrameConverter;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-import static com.zd.forward.utils.HttpUtils.getHttpEntityMap;
-import static com.zd.forward.utils.HttpUtils.multipartFileToFile;
-import static com.zd.forward.utils.VideoUtils.frameToBufferedImage;
-
-/**
- * 火焰图片抓拍处理
- *
- * @author Administrator
- */
-@Service
-@Slf4j
-public class FireImageService {
-
-    @Resource
-    private FireProperties fireProperties;
-    @Resource
-    private AlgorithmYml algorithmYml;
-
-    @Resource
-    private RestTemplate restTemplate;
-    @Resource
-    private SendSginAccessLogService sendSginAccessLogService;
-
-    /**
-     * 算法接口返回值
-     */
-    private static final Integer SUCCESS_CODE = 1000;
-
-    /**
-     * 生成的图片的类型
-     */
-    private static final String IMAGE_FORMAT = "jpg";
-
-    public void catchImage() throws IOException {
-        String streamUrl = fireProperties.getStreamUrl();
-        if (streamUrl == null) {
-            throw new ServiceException("未配置流媒体地址");
-        }
-
-        try (FFmpegFrameGrabber grabber = VideoUtils.createGrabber(streamUrl)) {
-            grabber.start();
-            String fileName = "test";
-            //文件储存对象
-            File file=new File(fileName+"." + IMAGE_FORMAT);
-            //获取第一帧
-            Frame frame = grabber.grabFrame();
-            if (frame != null) {
-                //视频快照
-                frame = grabber.grabImage();
-                BufferedImage bufferedImage = frameToBufferedImage(frame);
-                if (bufferedImage != null) {
-                    ImageIO.write(bufferedImage, IMAGE_FORMAT, file);
-                }
-                log.info("图片地址为[{}]", file.getAbsoluteFile());
-                grabber.stop();
-                send(file);
-            }
-        }
-    }
-
-    public boolean catchImage(MultipartFile file) {
-        try {
-            File toFile = multipartFileToFile(file);
-            send(toFile);
-            return true;
-        } catch (IOException e) {
-            throw new ServiceException(e.getMessage());
-        }
-    }
-
-    private void send(File file) {
-        if (fireProperties.getAlgoId() == null) {
-            throw new ServiceException("未配置火焰算法ID");
-        }
-        MultiValueMap<String, Object> params = HttpUtils.getMultiValueMap(fireProperties, null);
-        HttpEntity<MultiValueMap<String, Object>> files = getHttpEntityMap(file, params);
-        ImgPostResponse<DataPostAnalysisRespDto> send = HttpUtils.send(restTemplate, files, algorithmYml);
-        if (send == null || send.getStatus_code() != SUCCESS_CODE) {
-            assert send != null;
-            log.error(send.getMessage());
-            return;
-        }
-        DataPostAnalysisRespDto data = send.getData();
-
-        List<AnalysisData> analysisDatas = data.getAnalysisDatas();
-        AnalysisData analysisData = analysisDatas.get(0);
-        int code = analysisData.getCode();
-        if (code==-1){
-            log.error("==============请求失败:{}=================",analysisData.getMsg());
-        }else {
-            log.info("===============向算法服务发送数据完成====================");
-            Map<String, Object> result = (Map<String, Object>) Optional.ofNullable(analysisData.getResult()).orElse(Collections.emptyMap());
-            Map<String, Object> algorithmData = (Map<String, Object>) Optional.ofNullable(result.get("algorithm_data")).orElse(Collections.emptyMap());
-            boolean alert = "false".equals(algorithmData.getOrDefault("is_alert", "").toString());
-            if (!alert) {
-                log.info("===============返回告警信息====================");
-                sendSginAccessLogService.saveAlarm(fireProperties);
-            }
-        }
-    }
-}

+ 0 - 31
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/ImageCheckResultValidImpl.java

@@ -1,31 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.zd.common.core.domain.R;
-
-import java.util.Map;
-
-/**
- * 图片源POST:算法结果解析
- * @Author: zhoupan
- * @Date: 2021/11/14/12:54
- * @Description:
- */
-public class ImageCheckResultValidImpl implements CheckResultValid{
-    @Override
-    public R apply(Map<String, Object> map) {
-
-        try {
-            Map<String, Object>  algorithm_data = (Map<String, Object>)map.get("algorithm_data");
-            Boolean is_alert = (Boolean)algorithm_data.get("is_alert");
-
-
-            //是不是先要判断人数??????target_count
-            if(is_alert) return R.fail("检查不通过!");
-            //判断是否是多个目标等 返回详细失败结果
-
-            return R.ok();
-        } catch (Exception e) {
-            return R.fail("结果解析错误!");
-        }
-    }
-}

+ 0 - 81
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/ImageService.java

@@ -1,81 +0,0 @@
-package com.zd.forward.serivce;
-
-
-import com.zd.common.core.constant.HttpStatus;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.exception.ServiceException;
-import com.zd.forward.utils.VideoUtils;
-import com.zd.system.api.RemoteFileService;
-import com.zd.system.api.domain.SysFile;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.entity.ContentType;
-import org.bytedeco.javacv.FFmpegFrameGrabber;
-import org.bytedeco.javacv.Frame;
-import org.springframework.mock.web.MockMultipartFile;
-import org.springframework.stereotype.Service;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.rmi.ServerException;
-
-import static com.zd.forward.utils.VideoUtils.frameToBufferedImage;
-
-/**
- * @author hanson
- */
-@Service
-@Slf4j
-public class ImageService {
-
-    @Resource
-    private RemoteFileService remoteFileService;
-
-    /**
-     * 生成的图片的类型
-     */
-    private static final String IMAGE_FORMAT = "jpg";
-
-    public SysFile photograph(String streamUrl) throws IOException {
-        try (FFmpegFrameGrabber grabber = VideoUtils.createGrabber(streamUrl)) {
-            grabber.start();
-            String fileName = "test";
-            //文件储存对象
-            File file = new File(fileName + "." + IMAGE_FORMAT);
-            //获取第一帧
-            Frame frame = grabber.grabFrame();
-            if (frame != null) {
-                //视频快照
-                frame = grabber.grabImage();
-                BufferedImage bufferedImage = frameToBufferedImage(frame);
-                if (bufferedImage != null) {
-                    ImageIO.write(bufferedImage, IMAGE_FORMAT, file);
-                }
-                log.info("图片地址为[{}]", file.getAbsoluteFile());
-                grabber.stop();
-                MultipartFile multipartFile = getMultipartFile(file);
-                R<SysFile> upload = remoteFileService.upload(multipartFile);
-                if (upload.getCode() == HttpStatus.SUCCESS && upload.getData() != null) {
-                    return upload.getData();
-                }else {
-                    throw new ServerException(upload.getMsg());
-                }
-            }
-        }
-        return null;
-    }
-
-    private MultipartFile getMultipartFile(File file) {
-        try(FileInputStream fileInputStream = new FileInputStream(file)) {
-            return new MockMultipartFile(file.getName(),file.getName(),
-                    ContentType.APPLICATION_OCTET_STREAM.toString(),fileInputStream);
-        } catch (Exception e) {
-            throw new ServiceException(e.getMessage());
-        }
-    }
-}

+ 0 - 104
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/LoginService.java

@@ -1,104 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.alibaba.fastjson.JSON;
-import com.zd.common.core.constant.SecurityConstants;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.exception.ServiceException;
-import com.zd.common.security.service.TokenService;
-import com.zd.forward.config.AlgorithmYml;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Service;
-import org.springframework.util.Assert;
-import org.springframework.web.client.RestClientException;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@Service
-@EnableScheduling
-@Slf4j
-public class LoginService {
-
-
-    @Autowired
-    AlgorithmYml algorithmYml;
-    @Autowired
-    TokenService tokenService;
-
-    private String token;
-
-    public String getToken() {
-        return token;
-    }
-
-    public void setToken(String token) {
-        this.token = token;
-    }
-
-    /**
-     * 登录获取token
-     * 优化建议, 不要每次请求都登录, 需要本地维护, 定时刷新token,只有访问过期时再重试登录请求
-     */
-    public void loginLab() {
-        //不再重复登录
-        RestTemplate restTemplate = new RestTemplate();
-        //创建请求头
-        String url = algorithmYml.getLoginUri() + "auth/one/login";
-        Map<String, String> map = new HashMap<>(2);
-        map.put("username", "admin");
-        map.put("password", "zd123456..");
-        ParameterizedTypeReference<R<Map<String, Object>>> reference = new ParameterizedTypeReference<R<Map<String, Object>>>(){};
-        try {
-            ResponseEntity<R<Map<String, Object>>> response = restTemplate.exchange(url, HttpMethod.POST, new HttpEntity<>(map), reference);
-            R<Map<String, Object>> parse = response.getBody();
-            if (parse != null) {
-                Assert.isTrue(parse.getCode() == R.SUCCESS, "登录失败:" + parse.getMsg());
-                //拿到token
-                Map<String, Object> data = parse.getData();
-                setToken("Bearer " + data.get("access_token"));
-            }
-        } catch (RestClientException e) {
-            throw new ServiceException(e.getMessage());
-        }
-    }
-
-
-    public String getCacheToken() {
-        //换取缓存的token
-        return getToken();
-    }
-
-    /**
-     * 刷新key
-     */
-    public void refreshToken() {
-        try {
-            String tokenValue = token.replace(SecurityConstants.TOKEN_PREFIX, "");
-            tokenService.refreshToken(tokenValue);
-        } catch (Exception e) {
-            loginLab();
-        }
-    }
-
-    /**
-     * 每隔30分钟刷新次token
-     */
-    @Scheduled(cron = "0 */30 * * * ?")
-    //或直接指定时间间隔,例如:5秒
-    //@Scheduled(fixedRate=5000)
-    private void configureTasks() {
-        log.info("第一次执行!!");
-        if (token != null) {
-            refreshToken();
-        }
-    }
-
-}

+ 0 - 58
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/PeopleCheckResultValidImpl.java

@@ -1,58 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.zd.common.core.domain.R;
-import com.zd.forward.config.AlgorithmYml;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.Map;
-
-/**
- * 视频源:人数结果解析
- * @Author: zhoupan
- * @Date: 2021/11/14/12:54
- * @Description:
- */
-@Service
-public class PeopleCheckResultValidImpl implements VideoCheckResultValid{
-
-    @Autowired
-    SendSginAccessLogService sendSginAccessLogService;
-
-    @Autowired
-    AlgorithmYml algorithmYml;
-
-//    private void initAttr()
-//    {
-//        sendSginAccessLogService= SpringUtils.getBean(SendSginAccessLogService.class);
-//        algorithmYml = SpringUtils.getBean(AlgorithmYml.class);
-//    }
-
-    public PeopleCheckResultValidImpl() {
-    }
-
-    @Override
-    public R apply(Map<String, Object> map, Long subId) {
-        try {
-            Map<String, Object>  algorithm_data = (Map<String, Object>)map.get("algorithm_data");
-            Boolean is_alert = (Boolean)algorithm_data.get("is_alert");
-            //是不是先要判断人数??????target_count
-            if(is_alert)
-            {
-                int target_count = (int)algorithm_data.get("target_count");
-                if(target_count>0)
-                {
-                    Integer count = sendSginAccessLogService.getSubAccessCountBySubId(subId,algorithmYml.getLoginUri());
-                    if(target_count>count)
-                    {
-                        return R.fail(300,"算法识别人数大于实验室人数!");
-                    }
-                }
-            }
-            //判断是否是多个目标等 返回详细失败结果
-            return R.ok();
-        } catch (Exception e) {
-            return R.fail("结果解析错误!");
-        }
-    }
-}

+ 0 - 263
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/SendSginAccessLogService.java

@@ -1,263 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.alibaba.fastjson.JSONObject;
-import com.zd.common.core.constant.HttpStatus;
-import com.zd.common.core.constant.SecurityConstants;
-import com.zd.common.core.domain.R;
-import com.zd.common.core.utils.StringUtils;
-import com.zd.common.core.web.domain.AjaxResult;
-import com.zd.forward.config.AlgorithmYml;
-import com.zd.forward.domain.VideoRequestData;
-import com.zd.forward.properties.FireProperties;
-import com.zd.system.api.domain.Algorithm;
-import com.zd.system.api.domain.PlayVo;
-import com.zd.system.api.speak.RemoteSpeakService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.data.redis.core.ListOperations;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.http.*;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
-
-import static com.zd.common.core.constant.Constants.MAP_INIT_SIZE;
-
-@Service
-public class SendSginAccessLogService {
-
-    Logger logger = LoggerFactory.getLogger(SendSginAccessLogService.class);
-
-    private final RestTemplate restTemplateLocal;
-    public final RedisTemplate<Object, Object> redisTemplate;
-    private final LoginService loginLab;
-    private final AlgorithmYml algorithmYml;
-
-    private final RemoteSpeakService remoteSpeakService;
-
-    /**
-     * 报警次数记录
-     */
-    static Map<String, Integer> alarmMap = new ConcurrentHashMap<>();
-    /**
-     * 超时时间设置MAP
-     */
-    static Map<String, Long> expiryMap = new ConcurrentHashMap<>();
-
-    @Autowired
-    public SendSginAccessLogService(RestTemplate restTemplateLocal, RedisTemplate<Object, Object> redisTemplate, LoginService loginLab, AlgorithmYml algorithmYml, RemoteSpeakService remoteSpeakService) {
-        this.restTemplateLocal = restTemplateLocal;
-        this.redisTemplate = redisTemplate;
-        this.loginLab = loginLab;
-        this.algorithmYml = algorithmYml;
-        this.remoteSpeakService = remoteSpeakService;
-    }
-
-    @Async
-    public void sendAddLogRest(String code, Long id, Boolean f, String msg, String token, String url) {
-        JSONObject json = new JSONObject();
-        json.put("signId", id);
-        json.put("code", code);
-        json.put("result", f);
-        json.put("msg", msg);
-        HttpHeaders headers = new HttpHeaders();
-        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
-        headers.setContentType(type);
-        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
-        headers.add(SecurityConstants.TOKEN_AUTHENTICATION, token);
-        HttpEntity<String> formEntity = new HttpEntity<>(json.toString(), headers);
-        logger.info("保存检查日志记录,地址:{}", url);
-        String s = restTemplateLocal.postForEntity(url, formEntity, String.class).getBody();
-        logger.info("保存检查日志记录结果:{}", s);
-
-    }
-
-    /**
-     * 通过实验室ID获取实验室负责人电话
-     */
-    public String getAdminPhoneBySubId(Long subId, String url) {
-        ParameterizedTypeReference<R<String>> reference = new ParameterizedTypeReference<R<String>>() {
-        };
-        R<String> send = send(null, url + "laboratory/subject/" + subId + "/admin/phone", HttpMethod.GET, reference);
-        return send != null ? send.getData() : "";
-    }
-
-    public void saveAlarm(VideoRequestData videoRequestData) {
-        String cid = videoRequestData.getCid();
-        if (Boolean.TRUE.equals(redisTemplate.hasKey(cid))) {
-            Integer count = (Integer) redisTemplate.opsForValue().get(cid);
-            if (count == null) {
-                count = 0;
-            }
-            redisTemplate.opsForValue().set(cid, count + 1, 30, TimeUnit.SECONDS);
-            R<Object> r = sendAlarm(videoRequestData);
-            if (r.getCode() != HttpStatus.SUCCESS) {
-                logger.error("警报发送失败,警报类型;{},失败原因:{}", videoRequestData.getAlgo_name(), r.getMsg());
-            }
-        } else {
-            redisTemplate.opsForValue().set(cid, 1, 30, TimeUnit.SECONDS);
-        }
-
-    }
-
-    public void saveAlarm(FireProperties properties) {
-        String hardwareNum = properties.getHardwareNum();
-        long currentTimeMillis = System.currentTimeMillis();
-        if (expiryMap.containsKey(hardwareNum)) {
-            Long expiryTime = expiryMap.get(hardwareNum);
-            if (currentTimeMillis > expiryTime) {
-                expiryMap.remove(hardwareNum);
-                alarmMap.remove(hardwareNum);
-            }else {
-                send(properties, hardwareNum);
-            }
-            int count = alarmMap.get(hardwareNum) == null ? 0 : alarmMap.get(hardwareNum);
-            ++count;
-            alarmMap.put(hardwareNum, count);
-            expiryMap.put(hardwareNum, currentTimeMillis + 30 * 1000);
-            logger.info("已触发火焰警报:{}次",alarmMap.get(hardwareNum));
-        } else {
-            alarmMap.put(hardwareNum, 1);
-            expiryMap.put(hardwareNum, currentTimeMillis + 30 * 1000);
-        }
-    }
-
-    private void send(FireProperties properties, String hardwareNum) {
-        R<Object> r = send(properties);
-        if (r.getCode() != HttpStatus.SUCCESS) {
-            logger.error("火焰警报失败原因:{}", r.getMsg());
-        }
-    }
-
-    public void playMp3() {
-        if (!algorithmYml.isLoudspeakerSwitch()) {
-            return;
-        }
-        String loudspeakerIp1 = algorithmYml.getLoudspeakerIp1();
-        String loudspeakerIp2 = algorithmYml.getLoudspeakerIp2();
-        R deviceList = remoteSpeakService.getDeviceList(1, 10, 5L);
-        if (deviceList.getCode() == HttpStatus.SUCCESS) {
-            List<Map<String, Object>> mapList = (List<Map<String, Object>>) deviceList.getData();
-            for (Map<String, Object> map : mapList) {
-                if (StringUtils.isNotNull(map.get("deviceSn")) && StringUtils.isNotNull(map.get("port"))) {
-                    PlayVo playVo = new PlayVo();
-                    playVo.setSn(map.get("deviceSn") + "");
-                    playVo.setPort(Integer.parseInt(map.get("port") + ""));
-                    sendText(loudspeakerIp1, playVo);
-                    sendText(loudspeakerIp2, playVo);
-                }
-            }
-        }
-    }
-
-    private void sendText(String ip, PlayVo playVo) {
-        String url = algorithmYml.getTargetUrl() + "/zd-speaker/speaker/textPlayMusic?ip={ip}&texts={texts}";
-        HttpEntity<PlayVo> requestEntity = getMapHttpEntity(playVo);
-        if (StringUtils.isNotEmpty(ip)) {
-            List<String> texts = new ArrayList<>();
-            texts.add("当前环境监测到无人值守");
-            ResponseEntity<AjaxResult> response = restTemplateLocal.postForEntity(url, requestEntity, AjaxResult.class, ip, texts);
-            logger.info("响应码:{},响应结果:{}", response.getStatusCode(), response.getBody());
-        }
-    }
-
-    /**
-     * 发送火焰警报
-     */
-    public R<Object> sendAlarm(VideoRequestData videoRequestData) {
-        Map<String, Object> requestMap = new HashMap<>(MAP_INIT_SIZE);
-        List<Map<String, Object>> maps = new ArrayList<>();
-        Integer aid = videoRequestData.getAid();
-        Map<Integer, AlgorithmYml.AlarmConfig> alarmConfigMap = algorithmYml.getAlarmConfigMap();
-        if (alarmConfigMap.containsKey(aid)) {
-            AlgorithmYml.AlarmConfig alarmConfig = alarmConfigMap.get(aid);
-            Map<String, Object> params = new HashMap<>(MAP_INIT_SIZE);
-            params.put("hardwareNum", videoRequestData.getCid());
-            params.put("val", videoRequestData.getStatus());
-            return getParams(requestMap, maps, alarmConfig, params);
-        }
-        return R.fail("未找到算法");
-    }
-
-    /**
-     * 发送火焰警报
-     */
-    public R<Object> send(FireProperties properties) {
-        Map<String, Object> requestMap = new HashMap<>(MAP_INIT_SIZE);
-        List<Map<String, Object>> maps = new ArrayList<>();
-        Integer aid = properties.getAlgoId();
-        Map<Integer, AlgorithmYml.AlarmConfig> alarmConfigMap = algorithmYml.getAlarmConfigMap();
-        AlgorithmYml.AlarmConfig alarmConfig = alarmConfigMap.get(aid);
-        Map<String, Object> params = new HashMap<>(MAP_INIT_SIZE);
-        params.put("hardwareNum", properties.getHardwareNum());
-        params.put("subId", properties.getLabId());
-        params.put("val", 1);
-        return getParams(requestMap, maps, alarmConfig, params);
-    }
-
-    private R<Object> getParams(Map<String, Object> requestMap, List<Map<String, Object>> maps, AlgorithmYml.AlarmConfig alarmConfig, Map<String, Object> params) {
-        params.put("funNum", alarmConfig.getFunNum());
-        params.put("describe", alarmConfig.getDescribe());
-        maps.add(params);
-        requestMap.put("functionStatuses", maps);
-        ParameterizedTypeReference<R<Object>> reference = new ParameterizedTypeReference<R<Object>>() {
-        };
-        return send(requestMap, algorithmYml.getTargetUrl() + "laboratory/plan/triggerRiskPlan", HttpMethod.POST, reference);
-    }
-
-    private <T> R<T> send(Map<String, Object> params, String url, HttpMethod method, ParameterizedTypeReference<R<T>> reference) {
-        HttpEntity<Map<String, Object>> requestEntity = getMapHttpEntity(params);
-        ResponseEntity<R<T>> exchange = restTemplateLocal.exchange(url, method, requestEntity, reference);
-        R<T> body = exchange.getBody();
-        if (body != null && body.getCode() == HttpStatus.UNAUTHORIZED) {
-            requestEntity = getMapHttpEntityLogin(params);
-            exchange = restTemplateLocal.exchange(url, method, requestEntity, reference);
-
-        }
-        body = exchange.getBody();
-        return body;
-    }
-
-    /**
-     * 保存算法结果
-     */
-    public void saveAlgorithmResult(Algorithm algorithm) {
-        ListOperations<Object, Object> listOperations = redisTemplate.opsForList();
-        listOperations.leftPush("AlgorithmResult:", algorithm);
-    }
-
-
-    /**
-     * 通过实验室ID获取实验室正常打卡人数
-     */
-    public Integer getSubAccessCountBySubId(Long subId, String url) {
-        ParameterizedTypeReference<R<Integer>> reference = new ParameterizedTypeReference<R<Integer>>() {
-        };
-        R<Integer> send = send(null, url + "laboratory/subject/manger/records/" + subId + "/count", HttpMethod.GET, reference);
-        return send == null ? 0 : send.getData();
-    }
-
-    private <T> HttpEntity<T> getMapHttpEntity(T params) {
-        String token = loginLab.getToken();
-        HttpHeaders headers = new HttpHeaders();
-        headers.add(SecurityConstants.TOKEN_AUTHENTICATION, token);
-        return new HttpEntity<>(params, headers);
-    }
-
-    private <T> HttpEntity<T> getMapHttpEntityLogin(T params) {
-        loginLab.loginLab();
-        String token = loginLab.getToken();
-        HttpHeaders headers = new HttpHeaders();
-        headers.add(SecurityConstants.TOKEN_AUTHENTICATION, token);
-        return new HttpEntity<>(params, headers);
-    }
-}

+ 0 - 18
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/ShiYanFuCheckResultValidImpl.java

@@ -1,18 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.zd.common.core.domain.R;
-
-import java.util.Map;
-
-/**
- * 实验服结果解析 没用!!!!!!!
- * @Author: zhoupan
- * @Date: 2021/11/14/12:54
- * @Description:
- */
-public class ShiYanFuCheckResultValidImpl implements CheckResultValid{
-    @Override
-    public R apply(Map<String, Object> map) {
-        return R.ok();
-    }
-}

+ 0 - 17
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/VideoCheckResultValid.java

@@ -1,17 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.zd.common.core.domain.R;
-
-import java.util.Map;
-
-/**
- * 检查结果验证
- * @Author: zhoupan
- * @Date: 2021/11/14/10:26
- * @Description:
- */
-@FunctionalInterface
-public interface VideoCheckResultValid {
-
-    R apply(Map<String,Object>  map,Long subId);
-}

+ 0 - 31
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/VideoCheckResultValidImpl.java

@@ -1,31 +0,0 @@
-package com.zd.forward.serivce;
-
-import com.zd.common.core.domain.R;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-/**
- * 视频源:算法结果解析 发现视频和图片的判断一样 嘿嘿 那就不用这玩意了
- * 算了还是用吧 ,不然还得处理注入的问题
- * @Author: zhoupan
- * @Date: 2021/11/14/12:54
- * @Description:
- */
-@Component
-public class VideoCheckResultValidImpl implements VideoCheckResultValid{
-
-    @Override
-    public R apply(Map<String, Object> map, Long subId) {
-        try {
-            Map<String, Object>  algorithm_data = (Map<String, Object>)map.get("algorithm_data");
-            Boolean is_alert = (Boolean)algorithm_data.get("is_alert");
-            //是不是先要判断人数??????target_count
-            if(is_alert) return R.fail(300,"检查不通过!");
-            //判断是否是多个目标等 返回详细失败结果
-            return R.ok();
-        } catch (Exception e) {
-            return R.fail("结果解析错误!");
-        }
-    }
-}

+ 0 - 46
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/mqtt/CommonSend.java

@@ -1,46 +0,0 @@
-package com.zd.forward.serivce.mqtt;
-
-import com.alibaba.fastjson.JSON;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.stereotype.Service;
-import zd.common.mqtt.config.MessageBody;
-
-/**
- * 公用发送类
- * @Author: zhoupan
- * @Date: 2021/10/08/10:42
- * @Description:
- */
-@Service
-@ConditionalOnProperty(prefix = "sys.mqtt" ,name = "outbound",havingValue = "true",matchIfMissing = true)
-public class CommonSend {
-
-    @Autowired
-    MqttProducer mqttProducer;
-
-
-    /**
-     * 发送消息:去重模式
-     * @param topic
-     * @param messageBody
-     */
-    public  void  send(String topic, MessageBody messageBody)
-    {
-        mqttProducer.sendToMqtt(topic, 2, JSON.toJSONString(messageBody));
-    }
-
-    /**
-     * 发送消息
-     * @param topic
-     * @param messageBody
-     * @param QOS
-     */
-    public  void  send(String topic,MessageBody messageBody,int QOS)
-    {
-        mqttProducer.sendToMqtt(topic, QOS, JSON.toJSONString(messageBody));
-    }
-
-
-
-}

+ 0 - 28
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/mqtt/MqttOutListener.java

@@ -1,28 +0,0 @@
-package com.zd.forward.serivce.mqtt;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.integration.annotation.ServiceActivator;
-import org.springframework.messaging.MessageHandler;
-import org.springframework.stereotype.Component;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/11/15/19:01
- * @Description:
- */
-@Component
-@ConditionalOnProperty(prefix = "sys.mqtt" ,name = "inbound",havingValue = "true",matchIfMissing = true)
-public class MqttOutListener {
-    Logger logger = LoggerFactory.getLogger(MqttOutListener.class);
-
-    @Bean
-    @ServiceActivator(inputChannel = "mqttInputChannel")
-    public MessageHandler handler() {
-
-        return message -> logger.info("收到消息:"+ message.getPayload());
-    }
-
-}

+ 0 - 39
zd-modules/zd-forward/src/main/java/com/zd/forward/serivce/mqtt/MqttProducer.java

@@ -1,39 +0,0 @@
-package com.zd.forward.serivce.mqtt;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.integration.annotation.MessagingGateway;
-import org.springframework.integration.mqtt.support.MqttHeaders;
-import org.springframework.messaging.handler.annotation.Header;
-import org.springframework.stereotype.Component;
-
-/**
- * 消息发送者
- *
- * @author zpp
- */
-@Component
-@ConditionalOnProperty(prefix = "sys.mqtt" ,name = "outbound",havingValue = "true",matchIfMissing = true)
-@MessagingGateway(defaultRequestChannel = "mqttOutboundChannel")
-public interface MqttProducer {
-
-    /**
-     * 发送信息
-     * @param data
-     */
-    void sendToMqtt(String data);
-
-    /**
-     * 指定主题发送信息
-     * @param topic
-     * @param payload
-     */
-    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, String payload);
-
-    /**
-     * 指定主题和qos发送信息
-     * @param topic
-     * @param qos
-     * @param payload
-     */
-    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) int qos, String payload);
-}

+ 0 - 78
zd-modules/zd-forward/src/main/java/com/zd/forward/thread/ThreadPoolTaskConfig.java

@@ -1,78 +0,0 @@
-package com.zd.forward.thread;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.concurrent.BasicThreadFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.util.concurrent.*;
-
-/**
- * @author Administrator
- */
-@Configuration
-@Slf4j
-public class ThreadPoolTaskConfig {
-
-    private static final int CORE_POOL_SIZE = 10;
-    private static final int MAX_POOL_SIZE = 100;
-    private static final int KEEP_ALIVE_TIME = 10;
-    private static final int QUEUE_CAPACITY = 200;
-    private static final String THREAD_NAME_PREFIX = "Async-Service-";
-
-    @Bean("taskExecutor")
-    public ThreadPoolTaskExecutor threadPoolTaskExecutor(){
-        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
-        executor.setCorePoolSize(CORE_POOL_SIZE);
-        executor.setMaxPoolSize(MAX_POOL_SIZE);
-        executor.setQueueCapacity(QUEUE_CAPACITY);
-        executor.setKeepAliveSeconds(KEEP_ALIVE_TIME);
-        executor.setThreadNamePrefix(THREAD_NAME_PREFIX);
-
-        // 线程池对拒绝任务的处理策略
-        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
-        // 初始化
-        executor.initialize();
-        return executor;
-    }
-
-    /**
-     * 执行定时任务
-     */
-    @Bean(name = "scheduledExecutorService")
-    public ScheduledExecutorService scheduledExecutorService() {
-        return new ScheduledThreadPoolExecutor(CORE_POOL_SIZE,
-                new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) {
-            @Override
-            protected void afterExecute(Runnable r, Throwable t) {
-                super.afterExecute(r, t);
-                printException(r, t);
-            }
-        };
-    }
-
-
-    /**
-     * 打印线程异常信息
-     */
-    public static void printException(Runnable r, Throwable t) {
-        if (t == null && r instanceof Future<?>) {
-            try {
-                Future<?> future = (Future<?>) r;
-                if (future.isDone()) {
-                    future.get();
-                }
-            } catch (CancellationException ce) {
-                t = ce;
-            } catch (ExecutionException ee) {
-                t = ee.getCause();
-            } catch (InterruptedException ie) {
-                Thread.currentThread().interrupt();
-            }
-        }
-        if (t != null) {
-            log.error(t.getMessage(), t);
-        }
-    }
-}

+ 0 - 93
zd-modules/zd-forward/src/main/java/com/zd/forward/util/Base64DecodedMultipartFile.java

@@ -1,93 +0,0 @@
-package com.zd.forward.util;
-
-import org.springframework.web.multipart.MultipartFile;
-import sun.misc.BASE64Decoder;
-
-import java.io.*;
-
-public class Base64DecodedMultipartFile implements MultipartFile {
-    private final byte[] imgContent;
-    private final String header;
-
-    private Base64DecodedMultipartFile(byte[] imgContent, String header) {
-        this.imgContent = imgContent;
-        this.header = header.split(";")[0];
-    }
-
-    @Override
-    public String getName() {
-        return System.currentTimeMillis() + Math.random() + "." + header.split("/")[1];
-    }
-
-    @Override
-    public String getOriginalFilename() {
-        return header;
-    }
-
-    @Override
-    public String getContentType() {
-        String splitComm[]=header.split(":");
-        if(splitComm.length>1){
-            return header.split(":")[1];
-        }
-        return header.split(":")[0];
-    }
-
-    @Override
-    public boolean isEmpty() {
-        return imgContent == null || imgContent.length == 0;
-    }
-
-    @Override
-    public long getSize() {
-        return imgContent.length;
-    }
-
-    @Override
-    public byte[] getBytes() throws IOException {
-        return imgContent;
-    }
-
-    @Override
-    public InputStream getInputStream() throws IOException {
-        return new ByteArrayInputStream(imgContent);
-    }
-
-    @Override
-    public void transferTo(File dest) throws IOException, IllegalStateException {
-        new FileOutputStream(dest).write(imgContent);
-    }
-
-    /**
-     * base64转MultipartFile文件
-     *
-     * @param base64
-     * @return org.springframework.web.multipart.MultipartFile
-     * @author xianghl
-     * @date 2021/4/25/025 16:33
-     */
-    public static MultipartFile base64ToMultipart(String base64) {
-        try {
-            String[] baseStrs = base64.split(",");
-            BASE64Decoder decoder = new BASE64Decoder();
-            byte[] b;
-            if (baseStrs.length > 1) {
-                b = decoder.decodeBuffer(baseStrs[1]);
-            } else {
-                b = decoder.decodeBuffer(baseStrs[0]);
-            }
-            for (int i = 0; i < b.length; ++i) {
-                if (b[i] < 0) {
-                    b[i] += 256;
-                }
-            }
-            if (baseStrs.length > 1) {
-                return new Base64DecodedMultipartFile(b, "data:image/jpeg;base64");
-            }
-            return new Base64DecodedMultipartFile(b, baseStrs[0]);
-        } catch (IOException e) {
-            e.printStackTrace();
-            return null;
-        }
-    }
-}

+ 0 - 76
zd-modules/zd-forward/src/main/java/com/zd/forward/util/Base64ToMultipartFile.java

@@ -1,76 +0,0 @@
-package com.zd.forward.util;
-
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.Base64;
-
-public class Base64ToMultipartFile implements MultipartFile{
-    private final byte[] fileContent;
-
-    private final String extension;
-    private final String contentType;
-
-
-    /**
-     * @param base64
-     * @param dataUri     格式类似于: data:image/png;base64
-     */
-    public Base64ToMultipartFile(String base64, String dataUri) {
-        this.fileContent = Base64.getDecoder().decode(base64.getBytes(StandardCharsets.UTF_8));
-        this.extension = dataUri.split(";")[0].split("/")[1];
-        this.contentType = dataUri.split(";")[0].split(":")[1];
-    }
-
-    public Base64ToMultipartFile(String base64, String extension, String contentType) {
-        this.fileContent = Base64.getDecoder().decode(base64.getBytes(StandardCharsets.UTF_8));
-        this.extension = extension;
-        this.contentType = contentType;
-    }
-
-    @Override
-    public String getName() {
-        return "param_" + System.currentTimeMillis();
-    }
-
-    @Override
-    public String getOriginalFilename() {
-        return "file_" + System.currentTimeMillis() + "." + extension;
-    }
-
-    @Override
-    public String getContentType() {
-        return contentType;
-    }
-
-    @Override
-    public boolean isEmpty() {
-        return fileContent == null || fileContent.length == 0;
-    }
-
-    @Override
-    public long getSize() {
-        return fileContent.length;
-    }
-
-    @Override
-    public byte[] getBytes() throws IOException {
-        return fileContent;
-    }
-
-    @Override
-    public ByteArrayInputStream getInputStream() throws IOException {
-        return new ByteArrayInputStream(fileContent);
-    }
-
-    @Override
-    public void transferTo(File file) throws IOException, IllegalStateException {
-        try (FileOutputStream fos = new FileOutputStream(file)) {
-            fos.write(fileContent);
-        }
-    }
-}

+ 0 - 201
zd-modules/zd-forward/src/main/java/com/zd/forward/util/FileUploadUtils.java

@@ -1,201 +0,0 @@
-package com.zd.forward.util;
-
-import com.zd.common.core.exception.ServiceException;
-import com.zd.common.core.exception.file.FileNameLengthLimitExceededException;
-import com.zd.common.core.exception.file.FileSizeLimitExceededException;
-import com.zd.common.core.exception.file.InvalidExtensionException;
-import com.zd.common.core.utils.DateUtils;
-import com.zd.common.core.utils.IdUtils;
-import com.zd.common.core.utils.StringUtils;
-import com.zd.common.core.utils.file.MimeTypeUtils;
-import org.apache.commons.io.FilenameUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * 文件上传工具类
- *
- * @author zd
- */
-public class FileUploadUtils {
-    /**
-     * 默认大小 50M
-     */
-    public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
-
-    /**
-     * 默认的文件名最大长度 100
-     */
-    public static final int DEFAULT_FILE_NAME_LENGTH = 100;
-
-    /**
-     * 根据文件路径上传
-     *
-     * @param baseDir 相对应用的基目录
-     * @param file    上传的文件
-     * @return 文件名称
-     * @throws IOException
-     */
-    public static final String upload(String baseDir, MultipartFile file) throws IOException {
-        try {
-            return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
-        } catch (Exception e) {
-            throw new IOException(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * 文件上传
-     *
-     * @param baseDir          相对应用的基目录
-     * @param file             上传的文件
-     * @param allowedExtension 上传文件类型
-     * @return 返回上传成功的文件名
-     * @throws FileSizeLimitExceededException       如果超出最大大小
-     * @throws FileNameLengthLimitExceededException 文件名太长
-     * @throws IOException                          比如读写文件出错时
-     * @throws InvalidExtensionException            文件校验异常
-     */
-    public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
-            throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
-            InvalidExtensionException {
-        int fileNamelength = file.getOriginalFilename().length();
-        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
-//            throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
-            throw new ServiceException("图片名字太长,请修改名字后,从新上传!");
-        }
-
-        assertAllowed(file, allowedExtension);
-
-        String fileName = extractFilename(file);
-
-        File desc = getAbsoluteFile(baseDir, fileName);
-        file.transferTo(desc);
-        String pathFileName = getPathFileName(fileName);
-        return pathFileName;
-    }
-//
-//    /**
-//     * 文件上传 -不修改文件名
-//     *
-//     * @param baseDir          相对应用的基目录
-//     * @param file             上传的文件
-//     * @param allowedExtension 上传文件类型
-//     * @return 返回上传成功的文件名
-//     * @throws FileSizeLimitExceededException       如果超出最大大小
-//     * @throws FileNameLengthLimitExceededException 文件名太长
-//     * @throws IOException                          比如读写文件出错时
-//     * @throws InvalidExtensionException            文件校验异常
-//     */
-//    public static final String uploadNoUpdateName(String baseDir, MultipartFile file, String[] allowedExtension)
-//            throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
-//            InvalidExtensionException {
-//        int fileNamelength = file.getOriginalFilename().length();
-//        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
-//            throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
-//        }
-//
-//        assertAllowed(file, allowedExtension);
-//
-////        String fileName = extractFilename(file);
-//
-//        String originalFilename = file.getOriginalFilename();
-//        File desc = getAbsoluteFile(baseDir, originalFilename);
-//        file.transferTo(desc);
-//        String pathFileName = getPathFileName(originalFilename);
-//        return pathFileName;
-//    }
-
-    /**
-     * 编码文件名
-     */
-    public static final String extractFilename(MultipartFile file) {
-        String fileName = file.getOriginalFilename();
-        String extension = getExtension(file);
-        fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
-        return fileName;
-    }
-
-    private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException {
-        File desc = new File(uploadDir + File.separator + fileName);
-
-        if (!desc.exists()) {
-            if (!desc.getParentFile().exists()) {
-                desc.getParentFile().mkdirs();
-            }
-        }
-        return desc.isAbsolute() ? desc : desc.getAbsoluteFile();
-    }
-
-    private static final String getPathFileName(String fileName) throws IOException {
-        String pathFileName = "/" + fileName;
-        return pathFileName;
-    }
-
-    /**
-     * 文件大小校验
-     *
-     * @param file 上传的文件
-     * @throws FileSizeLimitExceededException 如果超出最大大小
-     * @throws InvalidExtensionException      文件校验异常
-     */
-    public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
-            throws FileSizeLimitExceededException, InvalidExtensionException {
-        long size = file.getSize();
-        if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE) {
-            throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
-        }
-
-        String fileName = file.getOriginalFilename();
-        String extension = getExtension(file);
-        if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) {
-            if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) {
-                throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
-                        fileName);
-            } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) {
-                throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
-                        fileName);
-            } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) {
-                throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
-                        fileName);
-            } else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) {
-                throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
-                        fileName);
-            } else {
-                throw new InvalidExtensionException(allowedExtension, extension, fileName);
-            }
-        }
-    }
-
-    /**
-     * 判断MIME类型是否是允许的MIME类型
-     *
-     * @param extension        上传文件类型
-     * @param allowedExtension 允许上传文件类型
-     * @return true/false
-     */
-    public static final boolean isAllowedExtension(String extension, String[] allowedExtension) {
-        for (String str : allowedExtension) {
-            if (str.equalsIgnoreCase(extension)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 获取文件名的后缀
-     *
-     * @param file 表单文件
-     * @return 后缀名
-     */
-    public static final String getExtension(MultipartFile file) {
-        String extension = FilenameUtils.getExtension(file.getOriginalFilename());
-        if (StringUtils.isEmpty(extension)) {
-            extension = MimeTypeUtils.getExtension(file.getContentType());
-        }
-        return extension;
-    }
-}

+ 0 - 93
zd-modules/zd-forward/src/main/java/com/zd/forward/utils/Base64DecodedMultipartFile.java

@@ -1,93 +0,0 @@
-package com.zd.forward.utils;
-
-import org.springframework.web.multipart.MultipartFile;
-import sun.misc.BASE64Decoder;
-
-import java.io.*;
-
-public class Base64DecodedMultipartFile implements MultipartFile {
-    private final byte[] imgContent;
-    private final String header;
-
-    private Base64DecodedMultipartFile(byte[] imgContent, String header) {
-        this.imgContent = imgContent;
-        this.header = header.split(";")[0];
-    }
-
-    @Override
-    public String getName() {
-        return System.currentTimeMillis() + Math.random() + "." + header.split("/")[1];
-    }
-
-    @Override
-    public String getOriginalFilename() {
-        return header;
-    }
-
-    @Override
-    public String getContentType() {
-        String splitComm[]=header.split(":");
-        if(splitComm.length>1){
-            return header.split(":")[1];
-        }
-        return header.split(":")[0];
-    }
-
-    @Override
-    public boolean isEmpty() {
-        return imgContent == null || imgContent.length == 0;
-    }
-
-    @Override
-    public long getSize() {
-        return imgContent.length;
-    }
-
-    @Override
-    public byte[] getBytes() throws IOException {
-        return imgContent;
-    }
-
-    @Override
-    public InputStream getInputStream() throws IOException {
-        return new ByteArrayInputStream(imgContent);
-    }
-
-    @Override
-    public void transferTo(File dest) throws IOException, IllegalStateException {
-        new FileOutputStream(dest).write(imgContent);
-    }
-
-    /**
-     * base64转MultipartFile文件
-     *
-     * @param base64
-     * @return org.springframework.web.multipart.MultipartFile
-     * @author xianghl
-     * @date 2021/4/25/025 16:33
-     */
-    public static MultipartFile base64ToMultipart(String base64) {
-        try {
-            String[] baseStrs = base64.split(",");
-            BASE64Decoder decoder = new BASE64Decoder();
-            byte[] b;
-            if (baseStrs.length > 1) {
-                b = decoder.decodeBuffer(baseStrs[1]);
-            } else {
-                b = decoder.decodeBuffer(baseStrs[0]);
-            }
-            for (int i = 0; i < b.length; ++i) {
-                if (b[i] < 0) {
-                    b[i] += 256;
-                }
-            }
-            if (baseStrs.length > 1) {
-                return new Base64DecodedMultipartFile(b, "data:image/jpeg;base64");
-            }
-            return new Base64DecodedMultipartFile(b, baseStrs[0]);
-        } catch (IOException e) {
-            e.printStackTrace();
-            return null;
-        }
-    }
-}

+ 0 - 76
zd-modules/zd-forward/src/main/java/com/zd/forward/utils/Base64ToMultipartFile.java

@@ -1,76 +0,0 @@
-package com.zd.forward.utils;
-
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.Base64;
-
-public class Base64ToMultipartFile implements MultipartFile{
-    private final byte[] fileContent;
-
-    private final String extension;
-    private final String contentType;
-
-
-    /**
-     * @param base64
-     * @param dataUri     格式类似于: data:image/png;base64
-     */
-    public Base64ToMultipartFile(String base64, String dataUri) {
-        this.fileContent = Base64.getDecoder().decode(base64.getBytes(StandardCharsets.UTF_8));
-        this.extension = dataUri.split(";")[0].split("/")[1];
-        this.contentType = dataUri.split(";")[0].split(":")[1];
-    }
-
-    public Base64ToMultipartFile(String base64, String extension, String contentType) {
-        this.fileContent = Base64.getDecoder().decode(base64.getBytes(StandardCharsets.UTF_8));
-        this.extension = extension;
-        this.contentType = contentType;
-    }
-
-    @Override
-    public String getName() {
-        return "param_" + System.currentTimeMillis();
-    }
-
-    @Override
-    public String getOriginalFilename() {
-        return "file_" + System.currentTimeMillis() + "." + extension;
-    }
-
-    @Override
-    public String getContentType() {
-        return contentType;
-    }
-
-    @Override
-    public boolean isEmpty() {
-        return fileContent == null || fileContent.length == 0;
-    }
-
-    @Override
-    public long getSize() {
-        return fileContent.length;
-    }
-
-    @Override
-    public byte[] getBytes() throws IOException {
-        return fileContent;
-    }
-
-    @Override
-    public ByteArrayInputStream getInputStream() throws IOException {
-        return new ByteArrayInputStream(fileContent);
-    }
-
-    @Override
-    public void transferTo(File file) throws IOException, IllegalStateException {
-        try (FileOutputStream fos = new FileOutputStream(file)) {
-            fos.write(fileContent);
-        }
-    }
-}

+ 0 - 201
zd-modules/zd-forward/src/main/java/com/zd/forward/utils/FileUploadUtils.java

@@ -1,201 +0,0 @@
-package com.zd.forward.utils;
-
-import com.zd.common.core.exception.ServiceException;
-import com.zd.common.core.exception.file.FileNameLengthLimitExceededException;
-import com.zd.common.core.exception.file.FileSizeLimitExceededException;
-import com.zd.common.core.exception.file.InvalidExtensionException;
-import com.zd.common.core.utils.DateUtils;
-import com.zd.common.core.utils.IdUtils;
-import com.zd.common.core.utils.StringUtils;
-import com.zd.common.core.utils.file.MimeTypeUtils;
-import org.apache.commons.io.FilenameUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * 文件上传工具类
- *
- * @author zd
- */
-public class FileUploadUtils {
-    /**
-     * 默认大小 50M
-     */
-    public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
-
-    /**
-     * 默认的文件名最大长度 100
-     */
-    public static final int DEFAULT_FILE_NAME_LENGTH = 100;
-
-    /**
-     * 根据文件路径上传
-     *
-     * @param baseDir 相对应用的基目录
-     * @param file    上传的文件
-     * @return 文件名称
-     * @throws IOException
-     */
-    public static final String upload(String baseDir, MultipartFile file) throws IOException {
-        try {
-            return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
-        } catch (Exception e) {
-            throw new IOException(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * 文件上传
-     *
-     * @param baseDir          相对应用的基目录
-     * @param file             上传的文件
-     * @param allowedExtension 上传文件类型
-     * @return 返回上传成功的文件名
-     * @throws FileSizeLimitExceededException       如果超出最大大小
-     * @throws FileNameLengthLimitExceededException 文件名太长
-     * @throws IOException                          比如读写文件出错时
-     * @throws InvalidExtensionException            文件校验异常
-     */
-    public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
-            throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
-            InvalidExtensionException {
-        int fileNamelength = file.getOriginalFilename().length();
-        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
-//            throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
-            throw new ServiceException("图片名字太长,请修改名字后,从新上传!");
-        }
-
-        assertAllowed(file, allowedExtension);
-
-        String fileName = extractFilename(file);
-
-        File desc = getAbsoluteFile(baseDir, fileName);
-        file.transferTo(desc);
-        String pathFileName = getPathFileName(fileName);
-        return pathFileName;
-    }
-//
-//    /**
-//     * 文件上传 -不修改文件名
-//     *
-//     * @param baseDir          相对应用的基目录
-//     * @param file             上传的文件
-//     * @param allowedExtension 上传文件类型
-//     * @return 返回上传成功的文件名
-//     * @throws FileSizeLimitExceededException       如果超出最大大小
-//     * @throws FileNameLengthLimitExceededException 文件名太长
-//     * @throws IOException                          比如读写文件出错时
-//     * @throws InvalidExtensionException            文件校验异常
-//     */
-//    public static final String uploadNoUpdateName(String baseDir, MultipartFile file, String[] allowedExtension)
-//            throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
-//            InvalidExtensionException {
-//        int fileNamelength = file.getOriginalFilename().length();
-//        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
-//            throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
-//        }
-//
-//        assertAllowed(file, allowedExtension);
-//
-////        String fileName = extractFilename(file);
-//
-//        String originalFilename = file.getOriginalFilename();
-//        File desc = getAbsoluteFile(baseDir, originalFilename);
-//        file.transferTo(desc);
-//        String pathFileName = getPathFileName(originalFilename);
-//        return pathFileName;
-//    }
-
-    /**
-     * 编码文件名
-     */
-    public static final String extractFilename(MultipartFile file) {
-        String fileName = file.getOriginalFilename();
-        String extension = getExtension(file);
-        fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
-        return fileName;
-    }
-
-    private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException {
-        File desc = new File(uploadDir + File.separator + fileName);
-
-        if (!desc.exists()) {
-            if (!desc.getParentFile().exists()) {
-                desc.getParentFile().mkdirs();
-            }
-        }
-        return desc.isAbsolute() ? desc : desc.getAbsoluteFile();
-    }
-
-    private static final String getPathFileName(String fileName) throws IOException {
-        String pathFileName = "/" + fileName;
-        return pathFileName;
-    }
-
-    /**
-     * 文件大小校验
-     *
-     * @param file 上传的文件
-     * @throws FileSizeLimitExceededException 如果超出最大大小
-     * @throws InvalidExtensionException      文件校验异常
-     */
-    public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
-            throws FileSizeLimitExceededException, InvalidExtensionException {
-        long size = file.getSize();
-        if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE) {
-            throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
-        }
-
-        String fileName = file.getOriginalFilename();
-        String extension = getExtension(file);
-        if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) {
-            if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) {
-                throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
-                        fileName);
-            } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) {
-                throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
-                        fileName);
-            } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) {
-                throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
-                        fileName);
-            } else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) {
-                throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
-                        fileName);
-            } else {
-                throw new InvalidExtensionException(allowedExtension, extension, fileName);
-            }
-        }
-    }
-
-    /**
-     * 判断MIME类型是否是允许的MIME类型
-     *
-     * @param extension        上传文件类型
-     * @param allowedExtension 允许上传文件类型
-     * @return true/false
-     */
-    public static final boolean isAllowedExtension(String extension, String[] allowedExtension) {
-        for (String str : allowedExtension) {
-            if (str.equalsIgnoreCase(extension)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 获取文件名的后缀
-     *
-     * @param file 表单文件
-     * @return 后缀名
-     */
-    public static final String getExtension(MultipartFile file) {
-        String extension = FilenameUtils.getExtension(file.getOriginalFilename());
-        if (StringUtils.isEmpty(extension)) {
-            extension = MimeTypeUtils.getExtension(file.getContentType());
-        }
-        return extension;
-    }
-}

+ 0 - 115
zd-modules/zd-forward/src/main/java/com/zd/forward/utils/HttpUtils.java

@@ -1,115 +0,0 @@
-package com.zd.forward.utils;
-
-import com.zd.common.core.exception.ServiceException;
-import com.zd.forward.config.AlgorithmYml;
-import com.zd.forward.domain.DataPostAnalysisRespDto;
-import com.zd.forward.domain.ImgPostResponse;
-import com.zd.forward.properties.FireProperties;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.http.*;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.RestClientException;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.File;
-import java.io.IOException;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-
-/**
- * @author Administrator
- */
-@Slf4j
-public class HttpUtils {
-
-    private HttpUtils() {
-        throw new IllegalStateException("HttpUtils class");
-    }
-
-    /**
-     * 构造算法文件逆流
-     */
-    public static HttpEntity<MultiValueMap<String, Object>> getHttpEntityMap(File file, MultiValueMap<String, Object> params) {
-        //设置请求头
-        HttpHeaders headers = new HttpHeaders();
-        headers.setContentType(MediaType.MULTIPART_FORM_DATA);
-        //文件转为文件系统资源
-        return getHttpEntity(file, params, headers);
-    }
-
-    private static HttpEntity<MultiValueMap<String, Object>> getHttpEntity(File file, MultiValueMap<String, Object> params, HttpHeaders headers) {
-        //文件转为文件系统资源
-        FileSystemResource fileSystemResource = new FileSystemResource(file);
-        //设置请求体,注意是LinkedMultiValueMap
-        MultiValueMap<String, Object> form = getStringObjectMultiValueMap(fileSystemResource);
-        form.addAll(params);
-        //用HttpEntity封装整个请求报文
-        return new HttpEntity<>(form, headers);
-    }
-
-    public static File multipartFileToFile(MultipartFile file) throws IOException {
-        String originalFilename = file.getOriginalFilename() == null ? "" : file.getOriginalFilename();
-        assert originalFilename!=null;
-        String[] filename = originalFilename.split("\\.");
-        File toFile = File.createTempFile(filename[0], "." + filename[1]);
-        file.transferTo(toFile);
-        log.info("================>{}",toFile.getAbsoluteFile());
-        //toFile.deleteOnExit();//在jvm 退出时删除
-        return toFile;
-    }
-
-    /**
-     * 构建算法图片post请求 参数:只构建文件
-     */
-    public static MultiValueMap<String, Object> getStringObjectMultiValueMap(FileSystemResource fileSystemResource) {
-        MultiValueMap<String, Object> form = new LinkedMultiValueMap<>();
-        form.add("file", fileSystemResource);
-        return form;
-    }
-
-    private static MultiValueMap<String, Object> getStringObjectMultiValueMap(String extension) {
-        MultiValueMap<String, Object> form = new LinkedMultiValueMap<>();
-        //1-同步(默认),0-异步
-        form.add("sync", 1);
-        form.add("timeStamp", LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli() / 1000);
-        form.add("extension", extension);
-        return form;
-    }
-
-    /**
-     * 构建算法图片post请求 参数
-     */
-    public static MultiValueMap<String, Object> getStringObjectMultiValueMap(AlgorithmYml.CheckValid checkValid, String extension) {
-        MultiValueMap<String, Object> form = getStringObjectMultiValueMap(extension);
-        form.add("algoId", checkValid.getAlgoId());
-        form.add("did", checkValid.getDid());
-        return form;
-    }
-
-    /**
-     * 构建算法图片post请求 参数
-     */
-    public static MultiValueMap<String, Object> getMultiValueMap(FireProperties properties, String extension) {
-        MultiValueMap<String, Object> form = getStringObjectMultiValueMap(extension);
-        form.add("algoId", properties.getAlgoId());
-        form.add("did", properties.getDid());
-        return form;
-    }
-
-    public static ImgPostResponse<DataPostAnalysisRespDto> send(RestTemplate restTemplate, HttpEntity<MultiValueMap<String, Object>> files, AlgorithmYml algorithmYml) {
-        ParameterizedTypeReference<ImgPostResponse<DataPostAnalysisRespDto>> reference = new ParameterizedTypeReference<ImgPostResponse<DataPostAnalysisRespDto>>() {
-        };
-        ResponseEntity<ImgPostResponse<DataPostAnalysisRespDto>> response = restTemplate.exchange(algorithmYml.getImgPostUrl(), HttpMethod.POST, files, reference);
-        if (response.getStatusCode() != HttpStatus.OK) {
-            log.error("算法服务请求异常,请查看算服务器");
-        }
-        if (response.getBody() == null) {
-            log.error("算法服务接口返回异常");
-        }
-        return response.getBody();
-    }
-}

+ 0 - 51
zd-modules/zd-forward/src/main/java/com/zd/forward/utils/VideoUtils.java

@@ -1,51 +0,0 @@
-package com.zd.forward.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.bytedeco.javacv.FFmpegFrameGrabber;
-import org.bytedeco.javacv.Frame;
-import org.bytedeco.javacv.Java2DFrameConverter;
-
-import java.awt.image.BufferedImage;
-
-/**
- * @author Administrator
- */
-@Slf4j
-public class VideoUtils {
-
-    private VideoUtils() {
-        throw new IllegalStateException("VideoUtils class");
-    }
-    /**
-     * 帧率
-     */
-    private static final int FRAME_RATE = 25;
-
-    /**
-     * 视频宽度
-     */
-    private static final int FRAME_WIDTH = 1920;
-    /**
-     * 视频高度
-     */
-    private static final int FRAME_HEIGHT = 1080;
-
-    public static FFmpegFrameGrabber createGrabber(String rtsp) throws FFmpegFrameGrabber.Exception {
-        FFmpegFrameGrabber grabber = FFmpegFrameGrabber.createDefault(rtsp);
-        grabber.setOption("rtsp_transport", "tcp");
-        grabber.setImageHeight(FRAME_HEIGHT);
-        grabber.setImageWidth(FRAME_WIDTH);
-        grabber.setFrameRate(FRAME_RATE);
-        return grabber;
-    }
-
-    /**
-     * frame 转图片流
-     */
-    public static BufferedImage frameToBufferedImage(Frame frame) {
-        //创建BufferedImage对象
-        try (Java2DFrameConverter converter = new Java2DFrameConverter()) {
-            return converter.getBufferedImage(frame);
-        }
-    }
-}

+ 0 - 10
zd-modules/zd-forward/src/main/resources/banner.txt

@@ -1,10 +0,0 @@
-Spring Boot Version: ${spring-boot.version}
-Spring Application Name: ${spring.application.name}
-                            _                           _                    
-                           (_)                         | |                   
- _ __  _   _   ___   _   _  _  ______  ___  _   _  ___ | |_   ___  _ __ ___  
-| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ 
-| |   | |_| || (_) || |_| || |        \__ \| |_| |\__ \| |_ |  __/| | | | | |
-|_|    \__,_| \___/  \__, ||_|        |___/ \__, ||___/ \__| \___||_| |_| |_|
-                      __/ |                  __/ |                           
-                     |___/                  |___/                            

+ 0 - 25
zd-modules/zd-forward/src/main/resources/bootstrap.yml

@@ -1,25 +0,0 @@
-# Tomcat
-server:
-  port: 9319
-
-# Spring
-spring:
-  application:
-    # 应用名称
-    name: zd-forward
-  profiles:
-    # 环境配置
-    active: ${SPRING_PROFILES_ACTIVE:dev}
-  cloud:
-    nacos:
-      discovery:
-        # 服务注册地址
-        server-addr: ${NACOS_HOST:127.0.0.1}:${NACOS_PORT:8848}
-      config:
-        # 配置中心地址
-        server-addr: ${NACOS_HOST:127.0.0.1}:${NACOS_PORT:8848}
-        # 配置文件格式
-        file-extension: yml
-        # 共享配置
-        shared-configs:
-          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

+ 0 - 74
zd-modules/zd-forward/src/main/resources/logback.xml

@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="60 seconds" debug="false">
-    <!-- 日志存放路径 -->
-    <property name="log.path" value="logs/zd-forword"/>
-    <!-- 日志输出格式 -->
-    <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
-
-    <!-- 控制台输出 -->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- 系统日志输出 -->
-    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.path}/info.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-            <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <!-- 日志最大的历史 60天 -->
-            <maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>INFO</level>
-            <!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-            <!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.path}/error.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-            <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <!-- 日志最大的历史 60天 -->
-            <maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>ERROR</level>
-            <!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-            <!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <!-- 系统模块日志级别控制  -->
-    <logger name="com.zd" level="info"/>
-    <!-- Spring日志级别控制  -->
-    <logger name="org.springframework" level="error"/>
-
-    <root level="info">
-        <appender-ref ref="console"/>
-    </root>
-
-    <!--系统操作日志-->
-    <root level="info">
-        <appender-ref ref="file_info"/>
-        <appender-ref ref="file_error"/>
-    </root>
-</configuration>

+ 0 - 182
zd-modules/zd-forward/wait-for-it.sh

@@ -1,182 +0,0 @@
-#!/usr/bin/env bash
-# Use this script to test if a given TCP host/port are available
-
-WAITFORIT_cmdname=${0##*/}
-
-echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
-
-usage()
-{
-    cat << USAGE >&2
-Usage:
-    $WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args]
-    -h HOST | --host=HOST       Host or IP under test
-    -p PORT | --port=PORT       TCP port under test
-                                Alternatively, you specify the host and port as host:port
-    -s | --strict               Only execute subcommand if the test succeeds
-    -q | --quiet                Don't output any status messages
-    -t TIMEOUT | --timeout=TIMEOUT
-                                Timeout in seconds, zero for no timeout
-    -- COMMAND ARGS             Execute command with args after the test finishes
-USAGE
-    exit 1
-}
-
-wait_for()
-{
-    if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
-        echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
-    else
-        echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout"
-    fi
-    WAITFORIT_start_ts=$(date +%s)
-    while :
-    do
-        if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then
-            nc -z $WAITFORIT_HOST $WAITFORIT_PORT
-            WAITFORIT_result=$?
-        else
-            (echo -n > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1
-            WAITFORIT_result=$?
-        fi
-        if [[ $WAITFORIT_result -eq 0 ]]; then
-            WAITFORIT_end_ts=$(date +%s)
-            echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds"
-            break
-        fi
-        sleep 1
-    done
-    return $WAITFORIT_result
-}
-
-wait_for_wrapper()
-{
-    # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
-    if [[ $WAITFORIT_QUIET -eq 1 ]]; then
-        timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
-    else
-        timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
-    fi
-    WAITFORIT_PID=$!
-    trap "kill -INT -$WAITFORIT_PID" INT
-    wait $WAITFORIT_PID
-    WAITFORIT_RESULT=$?
-    if [[ $WAITFORIT_RESULT -ne 0 ]]; then
-        echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
-    fi
-    return $WAITFORIT_RESULT
-}
-
-# process arguments
-while [[ $# -gt 0 ]]
-do
-    case "$1" in
-        *:* )
-        WAITFORIT_hostport=(${1//:/ })
-        WAITFORIT_HOST=${WAITFORIT_hostport[0]}
-        WAITFORIT_PORT=${WAITFORIT_hostport[1]}
-        shift 1
-        ;;
-        --child)
-        WAITFORIT_CHILD=1
-        shift 1
-        ;;
-        -q | --quiet)
-        WAITFORIT_QUIET=1
-        shift 1
-        ;;
-        -s | --strict)
-        WAITFORIT_STRICT=1
-        shift 1
-        ;;
-        -h)
-        WAITFORIT_HOST="$2"
-        if [[ $WAITFORIT_HOST == "" ]]; then break; fi
-        shift 2
-        ;;
-        --host=*)
-        WAITFORIT_HOST="${1#*=}"
-        shift 1
-        ;;
-        -p)
-        WAITFORIT_PORT="$2"
-        if [[ $WAITFORIT_PORT == "" ]]; then break; fi
-        shift 2
-        ;;
-        --port=*)
-        WAITFORIT_PORT="${1#*=}"
-        shift 1
-        ;;
-        -t)
-        WAITFORIT_TIMEOUT="$2"
-        if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi
-        shift 2
-        ;;
-        --timeout=*)
-        WAITFORIT_TIMEOUT="${1#*=}"
-        shift 1
-        ;;
-        --)
-        shift
-        WAITFORIT_CLI=("$@")
-        break
-        ;;
-        --help)
-        usage
-        ;;
-        *)
-        echoerr "Unknown argument: $1"
-        usage
-        ;;
-    esac
-done
-
-if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then
-    echoerr "Error: you need to provide a host and port to test."
-    usage
-fi
-
-WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15}
-WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
-WAITFORIT_CHILD=${WAITFORIT_CHILD:-0}
-WAITFORIT_QUIET=${WAITFORIT_QUIET:-0}
-
-# Check to see if timeout is from busybox?
-WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
-WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
-
-WAITFORIT_BUSYTIMEFLAG=""
-if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
-    WAITFORIT_ISBUSY=1
-    # Check if busybox timeout uses -t flag
-    # (recent Alpine versions don't support -t anymore)
-    if timeout &>/dev/stdout | grep -q -e '-t '; then
-        WAITFORIT_BUSYTIMEFLAG="-t"
-    fi
-else
-    WAITFORIT_ISBUSY=0
-fi
-
-if [[ $WAITFORIT_CHILD -gt 0 ]]; then
-    wait_for
-    WAITFORIT_RESULT=$?
-    exit $WAITFORIT_RESULT
-else
-    if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
-        wait_for_wrapper
-        WAITFORIT_RESULT=$?
-    else
-        wait_for
-        WAITFORIT_RESULT=$?
-    fi
-fi
-
-if [[ $WAITFORIT_CLI != "" ]]; then
-    if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then
-        echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess"
-        exit $WAITFORIT_RESULT
-    fi
-    exec "${WAITFORIT_CLI[@]}"
-else
-    exit $WAITFORIT_RESULT
-fi

+ 0 - 97
zd-modules/zd-smartlock/pom.xml

@@ -1,97 +0,0 @@
-<?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-modules</artifactId>
-        <groupId>com.zd</groupId>
-        <version>3.1.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>zd-smartlock</artifactId>
-    <packaging>jar</packaging>
-    <description>智能门锁</description>
-
-    <dependencies>
-        <!-- SpringCloud Alibaba Nacos -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-        </dependency>
-
-        <!-- SpringCloud Alibaba Nacos Config -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
-        <!-- SpringBoot Actuator -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-actuator</artifactId>
-        </dependency>
-
-        <!-- Mysql Connector -->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
-
-        <!-- zd Common DataSource -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-datasource</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
-        <!-- zd Common Log -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-log</artifactId>
-        </dependency>
-
-        <!-- zd Common Swagger -->
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-swagger</artifactId>
-        </dependency>
-
-        <!--mqtt客户端链接服务-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-integration</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.integration</groupId>
-            <artifactId>spring-integration-stream</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.integration</groupId>
-            <artifactId>spring-integration-mqtt</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-datascope</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <finalName>${project.artifactId}</finalName>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 23
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/ZdSmartlockApplication.java

@@ -1,23 +0,0 @@
-package com.zd.smartlock;
-
-import com.zd.common.security.annotation.EnableCustomConfig;
-import com.zd.common.security.annotation.EnableRyFeignClients;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-/**
- * 智能锁启动类
- * @author zp
- */
-@EnableCustomConfig
-@EnableRyFeignClients
-@SpringBootApplication
-@Slf4j
-public class ZdSmartlockApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(ZdSmartlockApplication.class, args);
-        log.info("(♥◠‿◠)ノ゙  智能锁模块启动成功   ლ(´ڡ`ლ)゙");
-    }
-}

+ 0 - 125
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SlApplyApprovalController.java

@@ -1,125 +0,0 @@
-package com.zd.smartlock.controller;
-
-import com.zd.common.core.utils.poi.ExcelUtil;
-import com.zd.common.core.web.controller.BaseController;
-import com.zd.common.core.web.domain.AjaxResult;
-import com.zd.common.core.web.domain.ResultData;
-import com.zd.common.core.web.page.TableDataInfo;
-import com.zd.common.log.annotation.Log;
-import com.zd.common.log.enums.BusinessType;
-import com.zd.smartlock.domain.SlApplyApproval;
-import com.zd.smartlock.service.ISlApplyApprovalService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 门锁申请审核Controller
- *
- * @author xxf
- * @date 2022-09-02
- */
-@RestController
-@Api(tags = "【申请审核】")
-@RequestMapping("/approval")
-public class SlApplyApprovalController extends BaseController
-{
-    @Autowired
-    private ISlApplyApprovalService slApplyApprovalService;
-
-
-    /**
-     * 查询申请审核列表
-     */
-    //@PreAuthorize(hasPermi = "laboratory:approval:list")
-    @GetMapping("/list")
-    @ApiOperation(value = "查询申请审核列表")
-    public TableDataInfo<SlApplyApproval> list(SlApplyApproval slApplyApproval)
-    {
-        startPage();
-        List<SlApplyApproval> list = slApplyApprovalService.selectSlApplyApprovalList(slApplyApproval);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出申请审核列表
-     */
-    @ApiOperation(value = "导出申请审核列表")
-    //@PreAuthorize(hasPermi = "laboratory:approval:export")
-    @Log(title = "申请审核", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, SlApplyApproval slApplyApproval) throws IOException
-    {
-        List<SlApplyApproval> list = slApplyApprovalService.selectSlApplyApprovalList(slApplyApproval);
-        ExcelUtil<SlApplyApproval> util = new ExcelUtil<SlApplyApproval>(SlApplyApproval.class);
-        util.exportExcel(response, list, "申请审核数据");
-    }
-
-    /**
-     * 获取申请审核详细信息
-     */
-    @ApiOperation(value = "获取申请审核详细信息")
-    //@PreAuthorize(hasPermi = "laboratory:approval:query")
-    @GetMapping(value = "/{id}")
-    public ResultData<SlApplyApproval> getInfo(@PathVariable("id") Long id)
-    {
-        return ResultData.success(slApplyApprovalService.selectSlApplyApprovalById(id));
-    }
-
-    /**
-     * 新增申请审核
-     */
-    @ApiOperation(value = "新增申请审核")
-    //@PreAuthorize(hasPermi = "laboratory:approval:add")
-    @Log(title = "申请审核", businessType = BusinessType.INSERT)
-    @PostMapping
-    public ResultData add(@RequestBody SlApplyApproval slApplyApproval)
-    {
-        return ResultData.result(slApplyApprovalService.insertSlApplyApproval(slApplyApproval));
-    }
-
-    /**
-     * 修改申请审核
-     */
-    @ApiOperation(value = "修改申请审核")
-    //@PreAuthorize(hasPermi = "laboratory:approval:edit")
-    @Log(title = "申请审核", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public ResultData edit(@RequestBody SlApplyApproval slApplyApproval)
-    {
-        return  ResultData.result(slApplyApprovalService.updateSlApplyApproval(slApplyApproval));
-    }
-
-    /**
-     * 删除申请审核
-     */
-    @ApiOperation(value = "删除申请审核")
-    //@PreAuthorize(hasPermi = "laboratory:approval:remove")
-    @Log(title = "申请审核", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public ResultData remove(@PathVariable Long[] ids)
-    {
-        return ResultData.result(slApplyApprovalService.deleteSlApplyApprovalByIds(ids));
-    }
-
-    /***
-     * 短信审核
-     * @param phone 电话
-     * @param content 1通过 0拒绝
-     * @param lockApplyId
-     * @return
-     */
-    @ApiOperation(value = "门锁短信审核")
-    @GetMapping("/sysMsgApprova")
-    public AjaxResult sysMsgApprova(String phone, String content, Long lockApplyId)
-    {   // msg:异常说明  status:处理状态(ok-成功  error-失败)
-        Map<String,Object> map = slApplyApprovalService.sysMsgApprova(phone,content,lockApplyId);
-        return AjaxResult.success(map);
-    }
-
-}

+ 0 - 198
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SlOpendoorApplyController.java

@@ -1,198 +0,0 @@
-package com.zd.smartlock.controller;
-
-import com.zd.common.core.domain.per.PerFun;
-import com.zd.common.core.domain.per.PerPrefix;
-import com.zd.common.core.utils.poi.ExcelUtil;
-import com.zd.common.core.web.controller.BaseController;
-import com.zd.common.core.web.domain.AjaxResult;
-import com.zd.common.core.web.domain.ResultData;
-import com.zd.common.core.web.page.TableDataInfo;
-import com.zd.common.log.annotation.Log;
-import com.zd.common.log.enums.BusinessType;
-import com.zd.common.security.annotation.PreAuthorize;
-import com.zd.common.security.service.TokenService;
-import com.zd.smartlock.domain.SlOpendoorApply;
-import com.zd.smartlock.domain.vo.SlOpendoorApplyVo;
-import com.zd.smartlock.service.ISlOpendoorApplyService;
-import com.zd.system.api.domain.SysUser;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Date;
-import java.util.List;
-
-/**
- * 申请开门Controller
- *
- * @author xxf
- * @date 2022-09-03
- */
-@RestController
-@Api(tags = "【申请开门】")
-@RequestMapping("/openDoorApply")
-public class SlOpendoorApplyController extends BaseController
-{
-    @Autowired
-    private ISlOpendoorApplyService slOpendoorApplyService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询申请开门列表
-     */
-    @PreAuthorize(hasPermi = PerPrefix.SMARTLOCK_OPENDOORAPPLY+ PerFun.LIST)
-    @GetMapping("/list")
-    @ApiOperation(value = "查询申请开门列表")
-    public TableDataInfo<SlOpendoorApplyVo> list(SlOpendoorApplyVo slOpendoorApply)
-    {
-        //获取登录用户
-        SysUser sysUser = tokenService.getLoginUser().getSysUser();
-        startPage();
-        List<SlOpendoorApplyVo> list = slOpendoorApplyService.selectSlOpendoorApplyList(slOpendoorApply);
-        for (SlOpendoorApplyVo vo:list) {
-                if(vo.getLoseTime().getTime()<System.currentTimeMillis()){
-                    vo.setApplyStatus(2L);
-                }
-        }
-        return getDataTable(list);
-    }
-
-    /**
-     * 授权申请
-     */
-    //@PreAuthorize(hasPermi = PerPrefix.SMARTLOCK_OPENDOORAPPLY+ "applyList")
-    @GetMapping("/applyList")
-    @ApiOperation(value = "查询申请开门列表")
-    public TableDataInfo<SlOpendoorApplyVo> applylist(SlOpendoorApplyVo slOpendoorApply)
-    {
-        //获取登录用户
-        SysUser sysUser = tokenService.getLoginUser().getSysUser();
-        slOpendoorApply.setUserId(sysUser.getUserId());
-        startPage();
-        List<SlOpendoorApplyVo> list = slOpendoorApplyService.selectSlOpendoorApplyList(slOpendoorApply);
-        for (SlOpendoorApplyVo vo:list) {
-            if(vo.getLoseTime().getTime()<System.currentTimeMillis()){
-                vo.setApplyStatus(2L);
-            }
-        }
-        return getDataTable(list);
-    }
-
-    /**
-     * 查询申请开门列表(学生端)
-     */
-    @GetMapping("/listStudent")
-    @ApiOperation(value = "查询申请开门列表(学生端)")
-    public TableDataInfo<SlOpendoorApplyVo> listStudent(SlOpendoorApplyVo slOpendoorApply)
-    {
-        //获取登录用户
-        SysUser sysUser = tokenService.getLoginUser().getSysUser();
-        slOpendoorApply.setUserId(sysUser.getUserId());
-
-        startPage();
-        List<SlOpendoorApplyVo> list = slOpendoorApplyService.selectSlOpendoorApplyListStudent(slOpendoorApply);
-        for (SlOpendoorApplyVo vo:list) {
-            if(vo.getLoseTime().getTime()<System.currentTimeMillis()){
-                vo.setApplyStatus(2L);
-            }
-        }
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出申请开门列表
-     */
-    @ApiOperation(value = "导出申请开门列表")
-    @PreAuthorize(hasPermi = PerPrefix.SMARTLOCK_OPENDOORAPPLY+ PerFun.EXPORT)
-    @Log(title = "申请开门", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, SlOpendoorApplyVo slOpendoorApply) throws IOException
-    {
-        List<SlOpendoorApplyVo> list = slOpendoorApplyService.selectSlOpendoorApplyList(slOpendoorApply);
-        ExcelUtil<SlOpendoorApplyVo> util = new ExcelUtil<SlOpendoorApplyVo>(SlOpendoorApplyVo.class);
-        util.exportExcel(response, list, "申请开门数据");
-    }
-
-    /**
-     * 获取申请开门详细信息
-     */
-    @ApiOperation(value = "获取申请开门详细信息")
-    @PreAuthorize(hasPermi = PerPrefix.SMARTLOCK_OPENDOORAPPLY+ PerFun.QUERY)
-    @GetMapping(value = "/{id}")
-    public ResultData<SlOpendoorApply> getInfo(@PathVariable("id") Long id)
-    {
-        return ResultData.success(slOpendoorApplyService.selectSlOpendoorApplyById(id));
-    }
-
-    /**
-     * 新增申请开门
-     */
-    @ApiOperation(value = "新增申请开门")
-    @PreAuthorize(hasPermi = PerPrefix.SMARTLOCK_OPENDOORAPPLY+ PerFun.ADD)
-    @Log(title = "申请开门", businessType = BusinessType.INSERT)
-    @PostMapping
-    public ResultData add(@RequestBody SlOpendoorApply slOpendoorApply)
-    {
-        /*user_id 申请人id
-        user_id2 人员2 id
-        subject_id 实验室id
-        subject_name 实验室名称
-        position
-        */
-
-        return ResultData.result(slOpendoorApplyService.insertSlOpendoorApply(slOpendoorApply));
-    }
-
-    /**
-     * 新增申请开门
-     */
-    @ApiOperation(value = "新增申请开门")
-    @Log(title = "申请开门", businessType = BusinessType.INSERT)
-    @PostMapping("/addStudent")
-    public ResultData addStudent(@RequestBody SlOpendoorApply slOpendoorApply)
-    {
-        return ResultData.result(slOpendoorApplyService.insertSlOpendoorApply(slOpendoorApply));
-    }
-
-
-    /**
-     * 修改申请开门
-     */
-    @ApiOperation(value = "修改申请开门")
-    @PreAuthorize(hasPermi = PerPrefix.SMARTLOCK_OPENDOORAPPLY+ PerFun.EDIT)
-    @Log(title = "申请开门", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public ResultData edit(@RequestBody SlOpendoorApply slOpendoorApply)
-    {
-        return  ResultData.result(slOpendoorApplyService.updateSlOpendoorApply(slOpendoorApply));
-    }
-
-    /**
-     * 删除申请开门
-     */
-    @ApiOperation(value = "删除申请开门")
-    @PreAuthorize(hasPermi = PerPrefix.SMARTLOCK_OPENDOORAPPLY+ PerFun.REMOVE)
-    @Log(title = "申请开门", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public ResultData remove(@PathVariable Long[] ids)
-    {
-        return ResultData.result(slOpendoorApplyService.deleteSlOpendoorApplyByIds(ids));
-    }
-
-    /***
-     * 重新授权
-     * @param id 申请主键
-     * @return
-     */
-    @ApiOperation(value = "重新授权")
-    @GetMapping("/auth/{id}")
-    public AjaxResult againAuth(@PathVariable Long id)
-    {
-        return AjaxResult.success(slOpendoorApplyService.againAuth(id));
-    }
-}

+ 0 - 190
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SlSubjectRelationController.java

@@ -1,190 +0,0 @@
-package com.zd.smartlock.controller;
-
-import com.zd.common.core.utils.poi.ExcelUtil;
-import com.zd.common.core.web.controller.BaseController;
-import com.zd.common.core.web.domain.ResultData;
-import com.zd.common.core.web.page.TableDataInfo;
-import com.zd.common.log.annotation.Log;
-import com.zd.common.log.enums.BusinessType;
-import com.zd.common.security.annotation.PreAuthorize;
-import com.zd.smartlock.domain.SlSubjectRelation;
-import com.zd.smartlock.domain.api.SlLockOnline;
-import com.zd.smartlock.domain.api.SlRoom;
-import com.zd.smartlock.domain.vo.SlSubjectRelationVo;
-import com.zd.smartlock.service.ISlSubjectRelationService;
-import com.zd.smartlock.utils.SmartlockUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 实验室关联Controller
- *
- * @author xxf
- * @date 2022-09-03
- */
-@RestController
-@Api(tags = "【实验室关联】")
-@RequestMapping("/subjectRelation")
-public class SlSubjectRelationController extends BaseController {
-    @Autowired
-    private ISlSubjectRelationService slSubjectRelationService;
-
-    /**
-     * 查询实验室关联列表
-     */
-    @PreAuthorize(hasPermi = "laboratory:subjectRelation:list")
-    @GetMapping("/list")
-    @ApiOperation(value = "查询实验室关联列表")
-    public TableDataInfo<SlSubjectRelationVo> list(SlSubjectRelationVo slSubjectRelation) {
-        startPage();
-        List<SlSubjectRelationVo> list = slSubjectRelationService.selectSlSubjectRelationList(slSubjectRelation);
-        return getDataTable(list);
-    }
-
-    /**
-     * 查询实验室关联列表-无权限
-     */
-    @GetMapping("/listSub")
-    @ApiOperation(value = "查询实验室关联列表")
-    public TableDataInfo<SlSubjectRelationVo> listSub(SlSubjectRelationVo slSubjectRelation) {
-        startPage();
-        List<SlSubjectRelationVo> list = slSubjectRelationService.selectSlSubjectRelationList(slSubjectRelation);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出实验室关联列表
-     */
-    @ApiOperation(value = "导出实验室关联列表")
-    @PreAuthorize(hasPermi = "laboratory:subjectRelation:export")
-    @Log(title = "实验室关联", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, SlSubjectRelationVo slSubjectRelation) throws IOException {
-        List<SlSubjectRelationVo> list = slSubjectRelationService.selectSlSubjectRelationList(slSubjectRelation);
-        ExcelUtil<SlSubjectRelationVo> util = new ExcelUtil<SlSubjectRelationVo>(SlSubjectRelationVo.class);
-        util.exportExcel(response, list, "实验室关联数据");
-    }
-
-    /**
-     * 获取实验室关联详细信息
-     */
-    @ApiOperation(value = "获取实验室关联详细信息")
-    @PreAuthorize(hasPermi = "laboratory:subjectRelation:query")
-    @GetMapping(value = "/{id}")
-    public ResultData<SlSubjectRelation> getInfo(@PathVariable("id") Long id) {
-        return ResultData.success(slSubjectRelationService.selectSlSubjectRelationById(id));
-    }
-
-    /**
-     * 新增实验室关联
-     */
-    @ApiOperation(value = "新增实验室关联")
-    @PreAuthorize(hasPermi = "laboratory:subjectRelation:add")
-    @Log(title = "实验室关联", businessType = BusinessType.INSERT)
-    @PostMapping
-    public ResultData add(@RequestBody SlSubjectRelationVo vo) {
-        /*`subjectId`  '实验室id',
-        `subjectName` '实验室名称',
-        `lockRoomId` '房间id', =roomid
-        `lockCode`  '门锁编号', = roomcode2
-        `roomLocation`  '房间位置 =roomlocation',
-        `roomName`   '房间名称' =roomname,
-        */
-        return ResultData.result(slSubjectRelationService.insertSlSubjectRelation(vo));
-    }
-
-    /**
-     * 新增实验室关联-无权限
-     */
-    @ApiOperation(value = "新增实验室关联")
-    @Log(title = "实验室关联", businessType = BusinessType.INSERT)
-    @PostMapping("/addSub")
-    public ResultData addSub(@RequestBody SlSubjectRelationVo vo) {
-
-        return ResultData.result(slSubjectRelationService.insertSlSubjectRelation(vo));
-    }
-
-    /**
-     * 修改实验室关联
-     */
-    @ApiOperation(value = "修改实验室关联")
-    @PreAuthorize(hasPermi = "laboratory:subjectRelation:edit")
-    @Log(title = "实验室关联", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public ResultData edit(@RequestBody SlSubjectRelation slSubjectRelation) {
-        return ResultData.result(slSubjectRelationService.updateSlSubjectRelation(slSubjectRelation));
-    }
-
-    /**
-     * 删除实验室关联
-     */
-    @ApiOperation(value = "删除实验室关联")
-    @Log(title = "实验室关联", businessType = BusinessType.DELETE)
-    @DeleteMapping("/removeSub/{ids}")
-    public ResultData removeSub(@PathVariable Long[] ids) {
-        return ResultData.result(slSubjectRelationService.deleteSlSubjectRelationByIds(ids));
-    }
-
-    /**
-     * 删除实验室关联
-     */
-    @ApiOperation(value = "删除实验室关联")
-    @PreAuthorize(hasPermi = "laboratory:subjectRelation:remove")
-    @Log(title = "实验室关联", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public ResultData remove(@PathVariable Long[] ids) {
-        return ResultData.result(slSubjectRelationService.deleteSlSubjectRelationByIds(ids));
-    }
-
-    /**
-     * 查询智能锁房间列表
-     */
-    @GetMapping("/listLockRoom")
-    @ApiOperation(value = "查询实验室关联列表")
-    public TableDataInfo<SlRoom> listLockRoom(SlRoom slRoom) {
-        List<SlRoom> list = SmartlockUtil.getRoom( slRoom);
-
-        /*List<SlRoom> list = new ArrayList<>();
-        slRoom.setRoomname("房间1");
-        slRoom.setRoomcode2("MS001");
-        slRoom.setRoomlocation("1-1-110");
-        slRoom.setRoomid(220);
-        list.add(slRoom);
-
-        SlRoom slRoom1 = new SlRoom();
-        slRoom1.setRoomname("房间2");
-        slRoom1.setRoomcode2("MS002");
-        slRoom1.setRoomlocation("1-1-112");
-        slRoom1.setRoomid(330);
-        list.add(slRoom1);*/
-        return getDataTable(list);
-    }
-
-    /**
-     * 查询实验室门锁状态
-     */
-    @GetMapping("/lockListDetails")
-    @ApiOperation(value = "查询实验室门锁状态")
-    public TableDataInfo<SlLockOnline> lockListDetails(Long subjectId) {
-        //List<SlRoom> list = SmartlockUtil.getRoom( slRoom);
-        //查询实验室下绑定的门锁
-        SlSubjectRelationVo subjectRelation = new SlSubjectRelationVo();
-        subjectRelation.setSubjectId(subjectId);
-        List<SlSubjectRelationVo> listrelation = slSubjectRelationService.selectSlSubjectRelationList(subjectRelation);
-
-        List<SlLockOnline> onlineList = new ArrayList<>();
-        for (SlSubjectRelation rl:listrelation) {
-            SlLockOnline lockOnline = SmartlockUtil.getRoomDetails(rl.getLockRoomId());
-            if(lockOnline!=null){
-                onlineList.add(lockOnline);
-            }
-        }
-        return getDataTable(onlineList);
-    }
-}

+ 0 - 128
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SlUserRelationController.java

@@ -1,128 +0,0 @@
-package com.zd.smartlock.controller;
-
-import java.util.List;
-import java.io.IOException;
-import javax.servlet.http.HttpServletResponse;
-
-import com.zd.common.core.web.domain.ResultData;
-import com.zd.smartlock.domain.SlUserRelation;
-import com.zd.smartlock.domain.api.SlUser;
-import com.zd.smartlock.utils.SmartlockUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.zd.common.log.annotation.Log;
-import com.zd.common.log.enums.BusinessType;
-import com.zd.common.security.annotation.PreAuthorize;
-import com.zd.smartlock.service.ISlUserRelationService;
-import com.zd.common.core.web.controller.BaseController;
-import com.zd.common.core.utils.poi.ExcelUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import com.zd.common.core.web.page.TableDataInfo;
-
-/**
- * 人员关联Controller
- *
- * @author xxf
- * @date 2022-09-02
- */
-@RestController
-@Api(tags = "【人员关联】")
-@RequestMapping("/userRelation")
-public class SlUserRelationController extends BaseController
-{
-    @Autowired
-    private ISlUserRelationService slUserRelationService;
-
-    /**
-     * 查询人员关联列表
-     */
-    @PreAuthorize(hasPermi = "laboratory:relation:list")
-    @GetMapping("/list")
-    @ApiOperation(value = "查询人员关联列表")
-    public TableDataInfo<SlUserRelation> list(SlUserRelation slUserRelation)
-    {
-        startPage();
-        List<SlUserRelation> list = slUserRelationService.selectSlUserRelationList(slUserRelation);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出人员关联列表
-     */
-    @ApiOperation(value = "导出人员关联列表")
-    @PreAuthorize(hasPermi = "laboratory:relation:export")
-    @Log(title = "人员关联", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, SlUserRelation slUserRelation) throws IOException
-    {
-        List<SlUserRelation> list = slUserRelationService.selectSlUserRelationList(slUserRelation);
-        ExcelUtil<SlUserRelation> util = new ExcelUtil<SlUserRelation>(SlUserRelation.class);
-        util.exportExcel(response, list, "人员关联数据");
-    }
-
-    /**
-     * 获取人员关联详细信息
-     */
-    @ApiOperation(value = "获取人员关联详细信息")
-    @PreAuthorize(hasPermi = "laboratory:relation:query")
-    @GetMapping(value = "/{id}")
-    public ResultData<SlUserRelation> getInfo(@PathVariable("id") Long id)
-    {
-        return ResultData.success(slUserRelationService.selectSlUserRelationById(id));
-    }
-
-    /**
-     * 新增人员关联
-     */
-    @ApiOperation(value = "新增人员关联")
-    @PreAuthorize(hasPermi = "laboratory:relation:add")
-    @Log(title = "人员关联", businessType = BusinessType.INSERT)
-    @PostMapping
-    public ResultData add(@RequestBody SlUserRelation slUserRelation)
-    {
-        return ResultData.result(slUserRelationService.insertSlUserRelation(slUserRelation));
-    }
-
-    /**
-     * 修改人员关联
-     */
-    @ApiOperation(value = "修改人员关联")
-    @PreAuthorize(hasPermi = "laboratory:relation:edit")
-    @Log(title = "人员关联", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public ResultData edit(@RequestBody SlUserRelation slUserRelation)
-    {
-        return  ResultData.result(slUserRelationService.updateSlUserRelation(slUserRelation));
-    }
-
-    /**
-     * 删除人员关联
-     */
-    @ApiOperation(value = "删除人员关联")
-    @PreAuthorize(hasPermi = "laboratory:relation:remove")
-    @Log(title = "人员关联", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public ResultData remove(@PathVariable Long[] ids)
-    {
-        return ResultData.result(slUserRelationService.deleteSlUserRelationByIds(ids));
-    }
-
-    /**
-     * 查询智能锁人员列表
-     */
-    @GetMapping("/listLockUser")
-    @ApiOperation(value = "查询智能锁人员列表")
-    public TableDataInfo<SlUser> listLockUser(SlUser sluser)
-    {
-        List<SlUser> list = SmartlockUtil.getUser(sluser);
-        return getDataTable(list);
-    }
-}

+ 0 - 52
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/controller/SmartlockController.java

@@ -1,52 +0,0 @@
-package com.zd.smartlock.controller;
-
-import com.zd.common.core.web.controller.BaseController;
-import com.zd.common.core.web.page.TableDataInfo;
-import com.zd.smartlock.domain.api.SlLockOnline;
-import com.zd.smartlock.domain.vo.SlSubjectRelationVo;
-import com.zd.smartlock.service.ISlSubjectRelationService;
-import com.zd.smartlock.utils.SmartlockUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @Author: xxf
- * @Date: 2022/09/07/9:43
- * @Description:
- */
-
-@RestController
-@Api(tags = "门锁相关信息查询")
-@RequestMapping("/lockinfo")
-public class SmartlockController extends BaseController {
-
-    @Autowired
-    private ISlSubjectRelationService slSubjectRelationService;
-
-    /**
-     * 查询实验室门锁信息
-     */
-    @GetMapping("/detalis")
-    @ApiOperation(value = "查询实验室门锁信息")
-    public TableDataInfo<SlLockOnline> list(Long subjectId)
-    {
-        List<SlLockOnline> lockOnlineslist = new ArrayList<>();
-
-        //查询实验室绑定的门锁集合
-        SlSubjectRelationVo subjectRelation = new SlSubjectRelationVo();
-        subjectRelation.setSubjectId(subjectId);
-        List<SlSubjectRelationVo> list = slSubjectRelationService.selectSlSubjectRelationList(subjectRelation);
-        for (SlSubjectRelationVo sub: list ) {
-            //查询门锁状态
-            SlLockOnline lockOnline = SmartlockUtil.getRoomDetails(sub.getLockRoomId());
-            lockOnlineslist.add(lockOnline);
-        }
-        return getDataTable(lockOnlineslist);
-    }
-}

+ 0 - 70
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/BaseDomain.java

@@ -1,70 +0,0 @@
-package com.zd.smartlock.domain;
-
-import java.io.Serializable;
-
-/**
- * @Author: liujh
- * @Date: 2022/08/30/16:33
- * @Description:
- */
-public class BaseDomain implements Serializable {
-
-    /**
-     * 每一页显示数量
-     */
-    public  String  pageSize;
-
-    /**
-     * 页码
-     */
-    public  String  pageNumber;
-
-    /**
-     * 总数
-     */
-    public Integer total;
-
-    /**
-     * token
-     */
-    public String token;
-
-    /**
-     * 搜索条件
-     */
-    public  String  search;
-
-    public String getPageSize() {
-        return pageSize= pageSize==null || "".equals(pageSize)?"20":pageSize;
-    }
-
-    public void setPageSize(String pageSize) {
-        this.pageSize = pageSize;
-    }
-
-    public String getPageNumber() {
-        return pageNumber =  "".equals(pageNumber) || pageNumber==null?"1":pageNumber;
-    }
-
-    public void setPageNumber(String pageNumber) {
-        this.pageNumber = pageNumber;
-    }
-
-    public String getToken() {
-        return token;
-    }
-
-    public void setToken(String token) {
-        this.token = token;
-    }
-
-    public Integer getTotal() {        return total;    }
-
-    public void setTotal(Integer total) {
-        this.total = total;
-    }
-
-    public String getSearch() {        return search;    }
-
-    public void setSearch(String search) {        this.search = search;    }
-}

+ 0 - 99
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/SlApplyApproval.java

@@ -1,99 +0,0 @@
-package com.zd.smartlock.domain;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.zd.common.core.annotation.Excel;
-import com.zd.common.core.web.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.hibernate.validator.constraints.Length;
-
-import java.util.Date;
-
-/**
- * 人员关联对象 sl_user_relation
- *
- * @author zd
- * @date 2022-09-02
- */
-@ApiModel("人员关联")
-public class SlApplyApproval extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** $column.columnComment */
-    @ApiModelProperty(value = "${comment}")
-    private Long id;
-    /** 申请表主键 */
-    @Excel(name = "申请表主键")
-    @ApiModelProperty(value = "申请表主键")
-    private Long applyId;
-    /** 审核人id */
-    @Excel(name = "审核人id")
-    @ApiModelProperty(value = "审核人id")
-    private Long approvaId;
-    /** 审核人姓名 */
-    @Excel(name = "审核人姓名")
-    @Length(message = "审核人姓名长度不能超过50")
-    @ApiModelProperty(value = "审核人姓名")
-    private String approvaName;
-    /** 1通过 2驳回 */
-    @Excel(name = "1通过 2驳回")
-    @ApiModelProperty(value = "1通过 2驳回")
-    private Long approvaStatus;
-    /** $column.columnComment */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "1通过 2驳回", width = 30, dateFormat = "yyyy-MM-dd")
-    @ApiModelProperty(value = "1通过 2驳回")
-    private Date cretaTime;
-
-
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getApplyId() {
-        return applyId;
-    }
-
-    public void setApplyId(Long applyId) {
-        this.applyId = applyId;
-    }
-
-    public Long getApprovaId() {
-        return approvaId;
-    }
-
-    public void setApprovaId(Long approvaId) {
-        this.approvaId = approvaId;
-    }
-
-    public String getApprovaName() {
-        return approvaName;
-    }
-
-    public void setApprovaName(String approvaName) {
-        this.approvaName = approvaName;
-    }
-
-    public Long getApprovaStatus() {
-        return approvaStatus;
-    }
-
-    public void setApprovaStatus(Long approvaStatus) {
-        this.approvaStatus = approvaStatus;
-    }
-
-    public Date getCretaTime() {
-        return cretaTime;
-    }
-
-    public void setCretaTime(Date cretaTime) {
-        this.cretaTime = cretaTime;
-    }
-
-}

+ 0 - 300
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/SlOpendoorApply.java

@@ -1,300 +0,0 @@
-package com.zd.smartlock.domain;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.zd.common.core.annotation.Excel;
-import com.zd.common.core.web.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.hibernate.validator.constraints.Length;
-
-import java.util.Date;
-
-/**
- * 申请开门对象 sl_opendoor_apply
- *
- * @author zd
- * @date 2022-09-03
- */
-@ApiModel("申请开门")
-public class SlOpendoorApply extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** $column.columnComment */
-    @ApiModelProperty(value = "${comment}")
-    private Long id;
-    /** 申请姓名 */
-    @Excel(name = "申请姓名")
-    @Length(message = "申请姓名长度不能超过50")
-    @ApiModelProperty(value = "申请姓名")
-    private String userName;
-    /** 人员2 id */
-    @Excel(name = "人员2 id")
-    @ApiModelProperty(value = "人员2 id")
-    private Long userId2;
-    /** $column.columnComment */
-    @Excel(name = "人员2 id")
-    @Length(message = "人员2 id长度不能超过50")
-    @ApiModelProperty(value = "人员2 id")
-    private String userName2;
-    /** 实验室id  */
-    @Excel(name = "实验室id ")
-    @ApiModelProperty(value = "实验室id ")
-    private Long subjectId;
-    /** 实验室名称  */
-    @Excel(name = "实验室名称 ")
-    @Length(message = "实验室名称 长度不能超过50")
-    @ApiModelProperty(value = "实验室名称 ")
-    private String subjectName;
-    /** 位置 */
-    @Excel(name = "位置")
-    @Length(message = "位置长度不能超过255")
-    @ApiModelProperty(value = "位置")
-    private String position;
-    /** 学院 */
-    @Excel(name = "学院")
-    @Length(message = "学院长度不能超过255")
-    @ApiModelProperty(value = "学院")
-    private String college;
-    /** 1审核中 2 通过 3驳回 */
-    @Excel(name = "1审核中 2 通过 3驳回")
-    @ApiModelProperty(value = "1审核中 2 通过 3驳回")
-    private Long applyStatus;
-
-    /** 审核次数 */
-    @Excel(name = "审核次数")
-    @ApiModelProperty(value = "审核次数")
-    private Long applyNumber;
-
-    /** 创建时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
-    @ApiModelProperty(value = "创建时间")
-    private Date creatTime;
-
-
-    /** 人员1编号*/
-    @Excel(name = "人员1编号")
-    @ApiModelProperty(value = "人员1编号")
-    private String userCode;
-
-    /** 人员2编号*/
-    @Excel(name = "人员2编号")
-    @ApiModelProperty(value = "人员2编号")
-    private String userCode2;
-
-    /** 人员1性别*/
-    @Excel(name = "人员1性别")
-    @ApiModelProperty(value = "人员1性别")
-    private Integer userSex;
-
-    /** 人员2性别*/
-    @Excel(name = "人员2性别")
-    @ApiModelProperty(value = "人员2性别")
-    private Integer userSex2;
-
-    /** 人员1电话*/
-    @Excel(name = "人员1电话")
-    @ApiModelProperty(value = "人员1电话")
-    private String phonenumber;
-
-    /** 人员2电话*/
-    @Excel(name = "人员2电话")
-    @ApiModelProperty(value = "人员2电话")
-    private String phonenumber2;
-
-    /** 说明*/
-    @Excel(name = "说明")
-    @ApiModelProperty(value = "说明")
-    private String illustrate;
-
-    /** 审核完成时间 */
-    @Excel(name = "审核完成时间 ")
-    @ApiModelProperty(value = "审核完成时间 ")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date approvalTime;
-
-    /** 审核人*/
-    @Excel(name = "审核人 ")
-    @ApiModelProperty(value = "审核人 ")
-    private String approvalUser;
-
-    /** 安全负责人*/
-    @Excel(name = "安全负责人 ")
-    @ApiModelProperty(value = "安全负责人 ")
-    private String safeUserName;
-
-    @ApiModelProperty(value = "实验室安全负责人ID集合")
-    private String safeUserId;
-
-    @ApiModelProperty(value = "实验室安全负责人电话集合")
-    private String safeUserPhone;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public Long getUserId2() {
-        return userId2;
-    }
-
-    public void setUserId2(Long userId2) {
-        this.userId2 = userId2;
-    }
-
-    public String getUserName2() {
-        return userName2;
-    }
-
-    public void setUserName2(String userName2) {
-        this.userName2 = userName2;
-    }
-
-    public Long getSubjectId() {
-        return subjectId;
-    }
-
-    public void setSubjectId(Long subjectId) {
-        this.subjectId = subjectId;
-    }
-
-    public String getSubjectName() {
-        return subjectName;
-    }
-
-    public void setSubjectName(String subjectName) {
-        this.subjectName = subjectName;
-    }
-
-    public String getPosition() {
-        return position;
-    }
-
-    public void setPosition(String position) {
-        this.position = position;
-    }
-
-    public String getCollege() {
-        return college;
-    }
-
-    public void setCollege(String college) {
-        this.college = college;
-    }
-
-    public Long getApplyStatus() {
-        return applyStatus;
-    }
-
-    public void setApplyStatus(Long applyStatus) {
-        this.applyStatus = applyStatus;
-    }
-
-    public Date getCreatTime() {
-        return creatTime;
-    }
-
-    public void setCreatTime(Date creatTime) {
-        this.creatTime = creatTime;
-    }
-
-    public Long getApplyNumber() {
-        return applyNumber;
-    }
-
-    public void setApplyNumber(Long applyNumber) {
-        this.applyNumber = applyNumber;
-    }
-
-    public String getUserCode() {
-        return userCode;
-    }
-
-    public void setUserCode(String userCode) {
-        this.userCode = userCode;
-    }
-
-    public String getUserCode2() {
-        return userCode2;
-    }
-
-    public void setUserCode2(String userCode2) {
-        this.userCode2 = userCode2;
-    }
-
-    public Integer getUserSex() {
-        return userSex;
-    }
-
-    public void setUserSex(Integer userSex) {
-        this.userSex = userSex;
-    }
-
-    public Integer getUserSex2() {
-        return userSex2;
-    }
-
-    public void setUserSex2(Integer userSex2) {
-        this.userSex2 = userSex2;
-    }
-
-    public String getIllustrate() {
-        return illustrate;
-    }
-
-    public void setIllustrate(String illustrate) {
-        this.illustrate = illustrate;
-    }
-
-    public String getPhonenumber() {        return phonenumber;    }
-
-    public void setPhonenumber(String phonenumber) {        this.phonenumber = phonenumber;    }
-
-    public String getPhonenumber2() {
-        return phonenumber2;
-    }
-
-    public void setPhonenumber2(String phonenumber2) {
-        this.phonenumber2 = phonenumber2;
-    }
-
-    public Date getApprovalTime() {
-        return approvalTime;
-    }
-
-    public void setApprovalTime(Date approvalTime) {
-        this.approvalTime = approvalTime;
-    }
-
-    public String getApprovalUser() {
-        return approvalUser;
-    }
-
-    public void setApprovalUser(String approvalUser) {
-        this.approvalUser = approvalUser;
-    }
-
-    public String getSafeUserName() {        return safeUserName;    }
-
-    public void setSafeUserName(String safeUserName) {        this.safeUserName = safeUserName;    }
-
-    public String getSafeUserId() {        return safeUserId;    }
-
-    public void setSafeUserId(String safeUserId) {        this.safeUserId = safeUserId;    }
-
-    public String getSafeUserPhone() {        return safeUserPhone;    }
-
-    public void setSafeUserPhone(String safeUserPhone) {        this.safeUserPhone = safeUserPhone;    }
-}

+ 0 - 188
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/SlSubjectRelation.java

@@ -1,188 +0,0 @@
-package com.zd.smartlock.domain;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.zd.common.core.annotation.Excel;
-import com.zd.common.core.web.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.hibernate.validator.constraints.Length;
-
-import java.util.Date;
-
-/**
- * 实验室关联对象 sl_subject_relation
- *
- * @author zd
- * @date 2022-09-03
- */
-@ApiModel("实验室关联")
-public class SlSubjectRelation extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 主键 */
-    @ApiModelProperty(value = "${comment}")
-    private Long id;
-    /** 实验室id */
-    @Excel(name = "实验室id")
-    @ApiModelProperty(value = "实验室id")
-    private Long subjectId;
-    /** 实验室名称 */
-    @Excel(name = "实验室名称")
-    @Length(message = "实验室名称长度不能超过50")
-    @ApiModelProperty(value = "实验室名称")
-    private String subjectName;
-    /** 房间id */
-    @Excel(name = "房间id")
-    @Length(message = "房间id长度不能超过255")
-    @ApiModelProperty(value = "房间id")
-    private String lockRoomId;
-    /** 门锁编号 */
-    @Excel(name = "门锁编号")
-    @Length(message = "门锁编号长度不能超过255")
-    @ApiModelProperty(value = "门锁编号")
-    private String lockCode;
-    /** 创建时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
-    @ApiModelProperty(value = "创建时间")
-    private Date creatTime;
-    /** 房间位置 */
-    @Excel(name = "房间位置")
-    @Length(message = "房间位置长度不能超过255")
-    @ApiModelProperty(value = "房间位置")
-    private String roomLocation;
-
-    /** 房间名称 */
-    @Excel(name = "房间名称")
-    @Length(message = "房间名称长度不能超过255")
-    @ApiModelProperty(value = "房间名称")
-    private String roomName;
-
-    /** 实验室位置 */
-    @Excel(name = "实验室位置")
-    @Length(message = "实验室位置长度不能超过255")
-    @ApiModelProperty(value = "实验室位置")
-    private String subjectLocation;
-
-    /** 学院 */
-    @Excel(name = "学院")
-    @Length(message = "学院长度不能超过255")
-    @ApiModelProperty(value = "学院")
-    private String college;
-
-    @ApiModelProperty(value = "安全负责人id")
-    private Long safeUserId;
-
-    @ApiModelProperty(value = "安全负责人姓名")
-    private String safeUserName;
-
-    @ApiModelProperty(value = "安全负责人电话")
-    private String safeUserPhone;
-
-    private Long deptId;
-
-    private String deptName;
-
-    private Long userId;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getSubjectId() {
-        return subjectId;
-    }
-
-    public void setSubjectId(Long subjectId) {
-        this.subjectId = subjectId;
-    }
-
-    public String getSubjectName() {
-        return subjectName;
-    }
-
-    public void setSubjectName(String subjectName) {
-        this.subjectName = subjectName;
-    }
-
-    public String getLockRoomId() {
-        return lockRoomId;
-    }
-
-    public void setLockRoomId(String lockRoomId) {
-        this.lockRoomId = lockRoomId;
-    }
-
-    public String getLockCode() {
-        return lockCode;
-    }
-
-    public void setLockCode(String lockCode) {
-        this.lockCode = lockCode;
-    }
-
-    public Date getCreatTime() {
-        return creatTime;
-    }
-
-    public void setCreatTime(Date creatTime) {
-        this.creatTime = creatTime;
-    }
-
-    @Override
-    public String getDeptName() {
-        return deptName;
-    }
-
-    @Override
-    public void setDeptName(String deptName) {
-        this.deptName = deptName;
-    }
-
-    public String getRoomLocation() {        return roomLocation;    }
-
-    public void setRoomLocation(String roomLocation) {        this.roomLocation = roomLocation;    }
-
-    public String getRoomName() {        return roomName;    }
-
-    public void setRoomName(String roomName) {        this.roomName = roomName;    }
-
-    @Override
-    public Long getDeptId() {        return deptId;    }
-
-    @Override
-    public void setDeptId(Long deptId) {        this.deptId = deptId;    }
-
-    @Override
-    public Long getUserId() {        return userId;    }
-
-    @Override
-    public void setUserId(Long userId) {        this.userId = userId;    }
-
-    public String getSubjectLocation() {        return subjectLocation;    }
-
-    public void setSubjectLocation(String subjectLocation) {        this.subjectLocation = subjectLocation;    }
-
-    public String getCollege() {        return college;    }
-
-    public void setCollege(String college) {
-        this.college = college;
-    }
-
-    public Long getSafeUserId() {        return safeUserId;    }
-
-    public void setSafeUserId(Long safeUserId) {        this.safeUserId = safeUserId;    }
-
-    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;    }
-}

+ 0 - 89
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/SlUserRelation.java

@@ -1,89 +0,0 @@
-package com.zd.smartlock.domain;
-
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.zd.common.core.annotation.Excel;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-import org.hibernate.validator.constraints.Length;
-import com.zd.common.core.web.domain.BaseEntity;
-
-/**
- * 人员关联对象 sl_user_relation
- *
- * @author zd
- * @date 2022-09-02
- */
-@ApiModel("人员关联")
-public class SlUserRelation extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 主键 */
-    @ApiModelProperty(value = "${comment}")
-    private Long id;
-    /** 用户姓名 */
-    @Excel(name = "用户姓名")
-    @Length(message = "用户姓名长度不能超过50")
-    @ApiModelProperty(value = "用户姓名")
-    private String userName;
-    /** 门锁服务人员编号 */
-    @Excel(name = "门锁服务人员编号")
-    @Length(message = "门锁服务人员编号长度不能超过50")
-    @ApiModelProperty(value = "门锁服务人员编号")
-    private String lockUserCode;
-    /** $column.columnComment */
-    @Excel(name = "门锁服务人员编号")
-    @ApiModelProperty(value = "门锁服务人员编号")
-    private Long type;
-    /** 创建时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
-    @ApiModelProperty(value = "创建时间")
-    private Date creatTime;
-
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getLockUserCode() {
-        return lockUserCode;
-    }
-
-    public void setLockUserCode(String lockUserCode) {
-        this.lockUserCode = lockUserCode;
-    }
-
-    public Long getType() {
-        return type;
-    }
-
-    public void setType(Long type) {
-        this.type = type;
-    }
-
-    public Date getCreatTime() {
-        return creatTime;
-    }
-
-    public void setCreatTime(Date creatTime) {
-        this.creatTime = creatTime;
-    }
-}

+ 0 - 104
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlBuild.java

@@ -1,104 +0,0 @@
-package com.zd.smartlock.domain.api;
-
-import com.zd.smartlock.domain.BaseDomain;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * @Author: liujh
- * @Date: 2022/08/29/14:29
- * @Description:
- */
-@ApiModel("建筑查询实体")
-public class SlBuild extends BaseDomain {
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "建筑编号")
-    private String buildcode;
-
-    @ApiModelProperty(value = "父级建筑id")
-    private String buildfatherid;
-
-    @ApiModelProperty(value = "建筑id")
-    private Integer buildid;
-
-    @ApiModelProperty(value = "建筑名称")
-    private String buildname;
-
-    @ApiModelProperty(value = "建筑类型,1园区,2楼栋,3楼层,4房间,5楼梯,6装饰间,7门禁")
-    private String buildtype;
-
-    @ApiModelProperty(value = "建筑类型,1园区,2楼栋,3楼层,4房间,5楼梯,6装饰间,7门禁")
-    private String  buildtypename;
-
-    @ApiModelProperty(value = "区域房间类型,1宿舍区域,2公共区域,3随房间属性")
-    private String roomtype;
-
-    @ApiModelProperty(value = "区域房间类型,1宿舍区域,2公共区域,3随房间属性")
-    private String roomtypename;
-
-
-    public String getBuildcode() {
-        return buildcode;
-    }
-
-    public void setBuildcode(String buildcode) {
-        this.buildcode = buildcode;
-    }
-
-    public String getBuildfatherid() {
-        return buildfatherid;
-    }
-
-    public void setBuildfatherid(String buildfatherid) {
-        this.buildfatherid = buildfatherid;
-    }
-
-    public Integer getBuildid() {
-        return buildid;
-    }
-
-    public void setBuildid(Integer buildid) {
-        this.buildid = buildid;
-    }
-
-    public String getBuildname() {
-        return buildname;
-    }
-
-    public void setBuildname(String buildname) {
-        this.buildname = buildname;
-    }
-
-    public String getBuildtype() {
-        return buildtype;
-    }
-
-    public void setBuildtype(String buildtype) {
-        this.buildtype = buildtype;
-    }
-
-    public String getBuildtypename() {
-        return buildtypename;
-    }
-
-    public void setBuildtypename(String buildtypename) {
-        this.buildtypename = buildtypename;
-    }
-
-    public String getRoomtype() {
-        return roomtype;
-    }
-
-    public void setRoomtype(String roomtype) {
-        this.roomtype = roomtype;
-    }
-
-    public String getRoomtypename() {
-        return roomtypename;
-    }
-
-    public void setRoomtypename(String roomtypename) {
-        this.roomtypename = roomtypename;
-    }
-}

+ 0 - 84
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlDoorLock.java

@@ -1,84 +0,0 @@
-package com.zd.smartlock.domain.api;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.util.Date;
-
-/**
- * @Author: liujh
- * @Date: 2022/08/29/14:48
- * @Description:
- */
-@ApiModel("门锁中间表")
-public class SlDoorLock {
-
-    @ApiModelProperty(value = "主键")
-    private Long id;
-
-    @ApiModelProperty(value = "人员id")
-    private Long userId;
-
-    @ApiModelProperty(value = "人员姓名")
-    private String userName;
-
-    @ApiModelProperty(value = "人员卡号")
-    private String cardNum;
-
-    @ApiModelProperty(value = "实验室id")
-    private Long subjectId;
-
-    @ApiModelProperty(value = "实验室名称")
-    private String subjectName;
-
-    @ApiModelProperty(value = "部门id")
-    private Long deptId;
-
-    @ApiModelProperty(value = "部门名称")
-    private String deptName;
-
-    @ApiModelProperty(value = "门锁id")
-    private String doorLockid;
-
-    @ApiModelProperty(value = "人脸编号")
-    private String faceCode;
-
-    @ApiModelProperty(value = "人脸状态(1正常,0停用)")
-    private Long faceState;
-
-    @ApiModelProperty(value = "手指 1-10")
-    private Long finger;
-
-    @ApiModelProperty(value = "指纹编号")
-    private String fingerCode;
-
-    @ApiModelProperty(value = "指纹状态(1正常,0停用)")
-    private Long fingerState;
-
-    @ApiModelProperty(value = "卡片状态(1正常,0停用)")
-    private Long cardState;
-
-    @ApiModelProperty(value = "开始时间")
-    private Date cardBegintime;
-
-    @ApiModelProperty(value = "结束时间")
-    private Date cardEndtime;
-
-    @ApiModelProperty(value = "1人脸  2指纹 3门卡")
-    private Long dataType;
-
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    @ApiModelProperty(value = "修改时间")
-    private Date updateTime;
-
-    @ApiModelProperty(value = "修改人")
-    private String updateBy;
-
-    @ApiModelProperty(value = "创建人")
-    private String cereatBy;
-
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-}

+ 0 - 58
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlGroup.java

@@ -1,58 +0,0 @@
-package com.zd.smartlock.domain.api;
-
-import com.zd.smartlock.domain.BaseDomain;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * @Author: liujh
- * @Date: 2022/09/05/15:36
- * @Description:
- */
-@ApiModel("组织信息")
-public class SlGroup extends BaseDomain {
-
-    @ApiModelProperty(value = "组织编号")
-    private String pgcode;
-
-    @ApiModelProperty(value = "父级组织id")
-    private String pgfatherid;
-
-    @ApiModelProperty(value = "父级组织id")
-    private String pgid;
-
-    @ApiModelProperty(value = "组织名称")
-    private String pgname;
-
-    public String getPgcode() {
-        return pgcode;
-    }
-
-    public void setPgcode(String pgcode) {
-        this.pgcode = pgcode;
-    }
-
-    public String getPgfatherid() {
-        return pgfatherid;
-    }
-
-    public void setPgfatherid(String pgfatherid) {
-        this.pgfatherid = pgfatherid;
-    }
-
-    public String getPgid() {
-        return pgid;
-    }
-
-    public void setPgid(String pgid) {
-        this.pgid = pgid;
-    }
-
-    public String getPgname() {
-        return pgname;
-    }
-
-    public void setPgname(String pgname) {
-        this.pgname = pgname;
-    }
-}

+ 0 - 42
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlLockOnline.java

@@ -1,42 +0,0 @@
-package com.zd.smartlock.domain.api;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * @Author: liujh
- * @Date: 2022/09/05/14:30
- * @Description:
- */
-@ApiModel("门锁状态")
-public class SlLockOnline {
-
-    @ApiModelProperty(value = "是否在线")
-    private String onLine;
-
-    @ApiModelProperty(value = "1在线/0离线")
-    private Integer onLineStatus;
-
-    @ApiModelProperty(value = "门锁编号")
-    private String lockCode;
-
-    public String getOnLine() {
-        return onLine;
-    }
-
-    public void setOnLine(String onLine) {
-        this.onLine = onLine;
-    }
-
-    public String getLockCode() {
-        return lockCode;
-    }
-
-    public void setLockCode(String lockCode) {
-        this.lockCode = lockCode;
-    }
-
-    public Integer getOnLineStatus() {        return onLineStatus;    }
-
-    public void setOnLineStatus(Integer onLineStatus) {        this.onLineStatus = onLineStatus;    }
-}

+ 0 - 80
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlOpenAndClosLog.java

@@ -1,80 +0,0 @@
-package com.zd.smartlock.domain.api;
-
-import com.zd.smartlock.domain.BaseDomain;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * @Author: liujh
- * @Date: 2022/09/03/14:50
- * @Description:
- */
-@ApiModel("开关门记录")
-public class SlOpenAndClosLog extends BaseDomain {
-
-    @ApiModelProperty(value = "卡号/指纹号/人脸号/二维码编号")
-    private String cardcode;
-
-    @ApiModelProperty(value = "学/工号")
-    private String personcode;
-
-    @ApiModelProperty(value = "组织")
-    private String personlocation;
-
-    @ApiModelProperty(value = "姓名")
-    private String personname;
-
-    @ApiModelProperty(value = "开门日期")
-    private String unlockingdate;
-
-    @ApiModelProperty(value = "开门方式")
-    private String unlockingtype;
-
-    public String getCardcode() {
-        return cardcode;
-    }
-
-    public void setCardcode(String cardcode) {
-        this.cardcode = cardcode;
-    }
-
-    public String getPersoncode() {
-        return personcode;
-    }
-
-    public void setPersoncode(String personcode) {
-        this.personcode = personcode;
-    }
-
-    public String getPersonlocation() {
-        return personlocation;
-    }
-
-    public void setPersonlocation(String personlocation) {
-        this.personlocation = personlocation;
-    }
-
-    public String getPersonname() {
-        return personname;
-    }
-
-    public void setPersonname(String personname) {
-        this.personname = personname;
-    }
-
-    public String getUnlockingdate() {
-        return unlockingdate;
-    }
-
-    public void setUnlockingdate(String unlockingdate) {
-        this.unlockingdate = unlockingdate;
-    }
-
-    public String getUnlockingtype() {
-        return unlockingtype;
-    }
-
-    public void setUnlockingtype(String unlockingtype) {
-        this.unlockingtype = unlockingtype;
-    }
-}

+ 0 - 82
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlOpenDoorSearch.java

@@ -1,82 +0,0 @@
-package com.zd.smartlock.domain.api;
-
-import com.zd.smartlock.domain.BaseDomain;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * @Author: liujh
- * @Date: 2022/09/03/15:04
- * @Description:
- */
-@ApiModel("开关门记录查询条件")
-public class SlOpenDoorSearch extends BaseDomain {
-
-    @ApiModelProperty(value = "房间id")
-    private String roomid;
-
-    @ApiModelProperty(value = "结束日期")
-    private String edate;
-
-    @ApiModelProperty(value = "类型(0或空=所有记录,1=报警记录,2=开门记录)")
-    private String recordtype;
-
-    @ApiModelProperty(value = "起始日期")
-    private String sdate;
-
-    @ApiModelProperty(value = "根据人员姓名/人员编号/卡号/指纹编号/人脸编号/二维码编号检索")
-    private String search;
-
-    @ApiModelProperty(value = "操作类型 (0或空=所有记录,1=报警记录,2=开门记录)")
-    private String unlockingtype;
-
-    public String getRoomid() {
-        return roomid;
-    }
-
-    public void setRoomid(String roomid) {
-        this.roomid = roomid;
-    }
-
-    public String getEdate() {
-        return edate;
-    }
-
-    public void setEdate(String edate) {
-        this.edate = edate;
-    }
-
-    public String getRecordtype() {
-        return recordtype;
-    }
-
-    public void setRecordtype(String recordtype) {
-        this.recordtype = recordtype;
-    }
-
-    public String getSdate() {
-        return sdate;
-    }
-
-    public void setSdate(String sdate) {
-        this.sdate = sdate;
-    }
-
-    @Override
-    public String getSearch() {
-        return search;
-    }
-
-    @Override
-    public void setSearch(String search) {
-        this.search = search;
-    }
-
-    public String getUnlockingtype() {
-        return unlockingtype;
-    }
-
-    public void setUnlockingtype(String unlockingtype) {
-        this.unlockingtype = unlockingtype;
-    }
-}

+ 0 - 123
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlPostUser.java

@@ -1,123 +0,0 @@
-package com.zd.smartlock.domain.api;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * @Author: liujh
- * @Date: 2022/09/05/16:01
- * @Description:
- */
-@ApiModel("添加人员信息")
-public class SlPostUser {
-
-    @ApiModelProperty(value = "卡号")
-    private String cardcode;
-
-    @ApiModelProperty(value = "是否下发人脸(1是,0否)")
-    private String issendface;
-
-    @ApiModelProperty(value = "是否下发指纹(1是,0否)")
-    private String issendfinger;
-
-    @ApiModelProperty(value = "是否下发密码(1是,0否)")
-    private String issendpass;
-
-    @ApiModelProperty(value = "权限类型(1管理权限,0使用权限,管理权限不占用入住人数)")
-    private Integer managertype;
-
-    @ApiModelProperty(value = "6位数字密码(不允许连续数字或连续三个及以上相同数字)")
-    private String password;
-
-    @ApiModelProperty(value = "学号")
-    private String personcode;
-
-    @ApiModelProperty(value = "房间id")
-    private String roomid;
-
-    @ApiModelProperty(value = "授权开始日期")
-    private String empsdate;
-
-    @ApiModelProperty(value = "授权结束日期")
-    private String empedate;
-
-    public String getCardcode() {
-        return cardcode;
-    }
-
-    public void setCardcode(String cardcode) {
-        this.cardcode = cardcode;
-    }
-
-    public String getIssendface() {
-        return issendface;
-    }
-
-    public void setIssendface(String issendface) {
-        this.issendface = issendface;
-    }
-
-    public String getIssendfinger() {
-        return issendfinger;
-    }
-
-    public void setIssendfinger(String issendfinger) {
-        this.issendfinger = issendfinger;
-    }
-
-    public String getIssendpass() {
-        return issendpass;
-    }
-
-    public void setIssendpass(String issendpass) {
-        this.issendpass = issendpass;
-    }
-
-    public Integer getManagertype() {
-        return managertype;
-    }
-
-    public void setManagertype(Integer managertype) {
-        this.managertype = managertype;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getPersoncode() {
-        return personcode;
-    }
-
-    public void setPersoncode(String personcode) {
-        this.personcode = personcode;
-    }
-
-    public String getRoomid() {
-        return roomid;
-    }
-
-    public void setRoomid(String roomid) {
-        this.roomid = roomid;
-    }
-
-    public String getEmpsdate() {
-        return empsdate;
-    }
-
-    public void setEmpsdate(String empsdate) {
-        this.empsdate = empsdate;
-    }
-
-    public String getEmpedate() {
-        return empedate;
-    }
-
-    public void setEmpedate(String empedate) {
-        this.empedate = empedate;
-    }
-}

+ 0 - 157
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlRoom.java

@@ -1,157 +0,0 @@
-package com.zd.smartlock.domain.api;
-
-import com.zd.smartlock.domain.BaseDomain;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * @Author: liujh
- * @Date: 2022/08/30/10:42
- * @Description:
- */
-@ApiModel("房间信息")
-public class SlRoom extends BaseDomain {
-    @ApiModelProperty(value = "归属楼层建筑ID")
-    private String buildid;
-
-    @ApiModelProperty(value = "房间预约功能(-1不支持,0关闭,1打开)")
-    private Integer isbook;
-
-    @ApiModelProperty(value = "房间位置(1左侧2右侧)")
-    private Integer leftright;
-
-    @ApiModelProperty(value = "房间编号")
-    private String roomcode;
-
-    @ApiModelProperty(value = "门锁唯一ID")
-    private String roomcode2;
-
-    @ApiModelProperty(value = "房间id")
-    private Integer roomid;
-
-    @ApiModelProperty(value = "房间位置")
-    private String roomlocation;
-
-    @ApiModelProperty(value = "房间最大支持入住人数")
-    private  Integer roommaxperson;
-
-    @ApiModelProperty(value = "房间名称")
-    private  String roomname;
-
-    @ApiModelProperty(value = "公共房间类型(1教室,2办公室,3会议室,4实验室)")
-    private  Integer roomnexttype;
-
-    @ApiModelProperty(value = "房间类型(1宿舍,2公共房间,4酒店房间)")
-    private  Integer roomtype;
-
-    @ApiModelProperty(value = "房间类型2(1房间,2楼梯,3装饰房间)")
-    private  Integer roomtype2;
-
-    @ApiModelProperty(value = "排列顺序(从左到右由小到大排列)")
-    private  Integer sequence;
-
-
-    public String getBuildid() {
-        return buildid;
-    }
-
-    public void setBuildid(String buildid) {
-        this.buildid = buildid;
-    }
-
-    public Integer getIsbook() {
-        return isbook;
-    }
-
-    public void setIsbook(Integer isbook) {
-        this.isbook = isbook;
-    }
-
-    public Integer getLeftright() {
-        return leftright;
-    }
-
-    public void setLeftright(Integer leftright) {
-        this.leftright = leftright;
-    }
-
-    public String getRoomcode() {
-        return roomcode;
-    }
-
-    public void setRoomcode(String roomcode) {
-        this.roomcode = roomcode;
-    }
-
-    public String getRoomcode2() {
-        return roomcode2;
-    }
-
-    public void setRoomcode2(String roomcode2) {
-        this.roomcode2 = roomcode2;
-    }
-
-    public Integer getRoomid() {
-        return roomid;
-    }
-
-    public void setRoomid(Integer roomid) {
-        this.roomid = roomid;
-    }
-
-    public String getRoomlocation() {
-        return roomlocation;
-    }
-
-    public void setRoomlocation(String roomlocation) {
-        this.roomlocation = roomlocation;
-    }
-
-    public Integer getRoommaxperson() {
-        return roommaxperson;
-    }
-
-    public void setRoommaxperson(Integer roommaxperson) {
-        this.roommaxperson = roommaxperson;
-    }
-
-    public String getRoomname() {
-        return roomname;
-    }
-
-    public void setRoomname(String roomname) {
-        this.roomname = roomname;
-    }
-
-    public Integer getRoomnexttype() {
-        return roomnexttype;
-    }
-
-    public void setRoomnexttype(Integer roomnexttype) {
-        this.roomnexttype = roomnexttype;
-    }
-
-    public Integer getRoomtype() {
-        return roomtype;
-    }
-
-    public void setRoomtype(Integer roomtype) {
-        this.roomtype = roomtype;
-    }
-
-    public Integer getRoomtype2() {
-        return roomtype2;
-    }
-
-    public void setRoomtype2(Integer roomtype2) {
-        this.roomtype2 = roomtype2;
-    }
-
-    public Integer getSequence() {
-        return sequence;
-    }
-
-    public void setSequence(Integer sequence) {
-        this.sequence = sequence;
-    }
-}

+ 0 - 0
zd-modules/zd-smartlock/src/main/java/com/zd/smartlock/domain/api/SlUser.java


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio