Browse Source

最新代码

liu 2 years ago
parent
commit
904b30e1ed
58 changed files with 1766 additions and 237 deletions
  1. 10 1
      pom.xml
  2. 4 1
      src/main/java/com/chuanghai/student_portrait/StudentPortraitApplication.java
  3. 52 4
      src/main/java/com/chuanghai/student_portrait/config/BaseClass.java
  4. 19 6
      src/main/java/com/chuanghai/student_portrait/config/FacePassRecord.java
  5. 1 1
      src/main/java/com/chuanghai/student_portrait/utils/JedisUtil.java
  6. 39 0
      src/main/java/com/chuanghai/student_portrait/config/ScheduleConfig.java
  7. 22 0
      src/main/java/com/chuanghai/student_portrait/config/ScheduledTaskConfig.java
  8. 23 22
      src/main/java/com/chuanghai/student_portrait/config/SubscriptionConfig.java
  9. 1 1
      src/main/java/com/chuanghai/student_portrait/config/SwaggerConfig.java
  10. 97 0
      src/main/java/com/chuanghai/student_portrait/controller/CircumferenceController.java
  11. 12 5
      src/main/java/com/chuanghai/student_portrait/controller/CountController.java
  12. 23 3
      src/main/java/com/chuanghai/student_portrait/controller/FaceDiscernController.java
  13. 14 6
      src/main/java/com/chuanghai/student_portrait/controller/GetSchoolUserController.java
  14. 63 34
      src/main/java/com/chuanghai/student_portrait/controller/ReceiveController.java
  15. 17 0
      src/main/java/com/chuanghai/student_portrait/entity/DormRx.java
  16. 20 0
      src/main/java/com/chuanghai/student_portrait/entity/SecondFloorCanteen.java
  17. 12 0
      src/main/java/com/chuanghai/student_portrait/entity/SecondFloorShopName.java
  18. 1 0
      src/main/java/com/chuanghai/student_portrait/entity/Stall.java
  19. 3 0
      src/main/java/com/chuanghai/student_portrait/entity/dto/PersonalTrackDto.java
  20. 43 0
      src/main/java/com/chuanghai/student_portrait/entity/dto/WeixiaoPushDTO.java
  21. 9 0
      src/main/java/com/chuanghai/student_portrait/mapper/DormRxMapper.java
  22. 1 1
      src/main/java/com/chuanghai/student_portrait/mapper/FaceDiscernMapper.xml
  23. 9 0
      src/main/java/com/chuanghai/student_portrait/mapper/SecondFloorCanteenMapper.java
  24. 9 0
      src/main/java/com/chuanghai/student_portrait/mapper/SecondFloorShopNameMapper.java
  25. 6 6
      src/main/java/com/chuanghai/student_portrait/response/enums/StatusEnum.java
  26. 7 0
      src/main/java/com/chuanghai/student_portrait/service/DormRxService.java
  27. 5 0
      src/main/java/com/chuanghai/student_portrait/service/FaceDiscernService.java
  28. 7 0
      src/main/java/com/chuanghai/student_portrait/service/SecondFloorCanteenService.java
  29. 7 0
      src/main/java/com/chuanghai/student_portrait/service/SecondFloorShopNameService.java
  30. 4 2
      src/main/java/com/chuanghai/student_portrait/service/impl/AccessServiceImpl.java
  31. 2 1
      src/main/java/com/chuanghai/student_portrait/service/impl/AffinityScoreServiceImpl.java
  32. 7 2
      src/main/java/com/chuanghai/student_portrait/service/impl/CapacityServiceImpl.java
  33. 24 4
      src/main/java/com/chuanghai/student_portrait/service/impl/ColdWaterServiceImpl.java
  34. 215 8
      src/main/java/com/chuanghai/student_portrait/service/impl/ConsumeServicelmpl.java
  35. 213 0
      src/main/java/com/chuanghai/student_portrait/service/impl/DormRxServiceImpl.java
  36. 1 0
      src/main/java/com/chuanghai/student_portrait/service/impl/DormServiceImpl.java
  37. 17 4
      src/main/java/com/chuanghai/student_portrait/service/impl/ElectricityServiceImpl.java
  38. 476 86
      src/main/java/com/chuanghai/student_portrait/service/impl/FaceDiscernServiceImpl.java
  39. 11 10
      src/main/java/com/chuanghai/student_portrait/service/impl/HotWaterServiceImpl.java
  40. 5 3
      src/main/java/com/chuanghai/student_portrait/service/impl/NewSchooluserServiceImpl.java
  41. 3 2
      src/main/java/com/chuanghai/student_portrait/service/impl/OldSchooluserServiceImpl.java
  42. 11 0
      src/main/java/com/chuanghai/student_portrait/service/impl/SecondFloorCanteenServiceImpl.java
  43. 11 0
      src/main/java/com/chuanghai/student_portrait/service/impl/SecondFloorShopNameServiceImpl.java
  44. 14 2
      src/main/java/com/chuanghai/student_portrait/utils/DateUtils.java
  45. 59 0
      src/main/java/com/chuanghai/student_portrait/utils/Imageys.java
  46. 23 6
      src/main/java/com/chuanghai/student_portrait/utils/JWTUtils.java
  47. 0 2
      src/main/java/com/chuanghai/student_portrait/utils/LogUtils.java
  48. 2 0
      src/main/java/com/chuanghai/student_portrait/utils/ReturnValueUtil.java
  49. 50 0
      src/main/java/com/chuanghai/student_portrait/utils/ReturnWXPush.java
  50. 8 0
      src/main/java/com/chuanghai/student_portrait/utils/vo/LibID.java
  51. 11 0
      src/main/java/com/chuanghai/student_portrait/utils/vo/SubscribePersonCondition.java
  52. 0 2
      src/main/java/com/chuanghai/student_portrait/utils/vo/SubscriptionVo.java
  53. 9 4
      src/main/resources/application.yml
  54. 9 4
      target/classes/application.yml
  55. 1 1
      target/maven-archiver/pom.properties
  56. 23 2
      target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  57. 21 1
      target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  58. BIN
      target/student_portrait-0.0.1-SNAPSHOT.jar.original

+ 10 - 1
pom.xml

@@ -24,6 +24,16 @@
         </dependency>
         </dependency>
 
 
 
 
+        <!--压缩base64的依赖-->
+        <dependency>
+            <groupId>net.coobird</groupId>
+            <artifactId>thumbnailator</artifactId>
+            <version>0.4.8</version>
+        </dependency>
+
+
+
+
         <!-- 多数据源 -->
         <!-- 多数据源 -->
         <dependency>
         <dependency>
             <groupId>com.baomidou</groupId>
             <groupId>com.baomidou</groupId>
@@ -32,7 +42,6 @@
         </dependency>
         </dependency>
 
 
 
 
-
         <!--redis的起步依赖-->
         <!--redis的起步依赖-->
         <dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <groupId>org.springframework.boot</groupId>

+ 4 - 1
src/main/java/com/chuanghai/student_portrait/StudentPortraitApplication.java

@@ -3,14 +3,17 @@ package com.chuanghai.student_portrait;
 import org.mybatis.spring.annotation.MapperScan;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.cache.annotation.EnableCaching;
 import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.transaction.event.TransactionalEventListener;
 import org.springframework.transaction.event.TransactionalEventListener;
 
 
-@SpringBootApplication
+@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
 @EnableScheduling//开启定时任务
 @EnableScheduling//开启定时任务
 @MapperScan(basePackages = "com.chuanghai.student_portrait.mapper")
 @MapperScan(basePackages = "com.chuanghai.student_portrait.mapper")
 @EnableCaching
 @EnableCaching
+@EnableAsync
 public class StudentPortraitApplication {
 public class StudentPortraitApplication {
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {

+ 52 - 4
src/main/java/com/chuanghai/student_portrait/config/BaseClass.java

@@ -1,20 +1,23 @@
 package com.chuanghai.student_portrait.config;
 package com.chuanghai.student_portrait.config;
 
 
 
 
+import org.apache.http.Header;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponse;
 import org.apache.http.ParseException;
 import org.apache.http.ParseException;
+import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.methods.HttpPut;
+import org.apache.http.client.methods.*;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicCookieStore;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicHeader;
 import org.apache.http.util.EntityUtils;
 import org.apache.http.util.EntityUtils;
 import org.springframework.util.DigestUtils;
 import org.springframework.util.DigestUtils;
 
 
+import javax.servlet.http.Cookie;
 import java.io.IOException;
 import java.io.IOException;
 import java.text.DecimalFormat;
 import java.text.DecimalFormat;
 import java.util.Date;
 import java.util.Date;
@@ -92,6 +95,7 @@ public class BaseClass {
         for (String s : headinfo.keySet()) {
         for (String s : headinfo.keySet()) {
             httpPut.addHeader(s, headinfo.get(s));
             httpPut.addHeader(s, headinfo.get(s));
         }
         }
+
         if (!jsonBody.equals("")) {
         if (!jsonBody.equals("")) {
             //给httppost对象设置json字符串参数
             //给httppost对象设置json字符串参数
             StringEntity httpEntity = new StringEntity(jsonBody, "utf-8");
             StringEntity httpEntity = new StringEntity(jsonBody, "utf-8");
@@ -133,6 +137,15 @@ public class BaseClass {
             httpPost.addHeader(s, headinfo.get(s));
             httpPost.addHeader(s, headinfo.get(s));
         }
         }
 
 
+//        // 创建cookie store的本地实例
+//         BasicCookieStore basicCookieStore = new BasicCookieStore();
+//        Cookie c = new Cookie("","");
+//        //设置cookie的最大生存时间为零
+//        c.setMaxAge(0);//项目所有目录均有效,这句很关键,否则不敢保证删除
+//        basicCookieStore.addCookie((org.apache.http.cookie.Cookie) c);
+//        HttpClient httpclient = HttpClientBuilder.create().setDefaultCookieStore(basicCookieStore).build();
+
+
         //给httppost对象设置json字符串参数
         //给httppost对象设置json字符串参数
         StringEntity httpEntity = new StringEntity(json, "utf-8");
         StringEntity httpEntity = new StringEntity(json, "utf-8");
 
 
@@ -187,6 +200,41 @@ public class BaseClass {
         return httpResponse;
         return httpResponse;
     }
     }
 
 
+
+    public static CloseableHttpResponse doDelete(CloseableHttpClient httpClient, String url, String Authorization, String jsonBody) {
+        //获取报文头,目前LAPI调用,报文头除鉴权信息外,其他都是写死的
+        Map<String, String> headinfo = getHeadInfo();
+
+        //如果有鉴权信息则放入报文头中
+        if (Authorization.indexOf("response") > 0) {
+            headinfo.put("Authorization", Authorization);
+        }
+
+        CloseableHttpResponse httpResponse = null;
+
+        HttpDelete httpDelete = new HttpDelete(url);
+        for (String s : headinfo.keySet()) {
+            httpDelete.addHeader(s, headinfo.get(s));
+        }
+
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000)// 连接主机服务超时时间
+                .setConnectionRequestTimeout(6000)// 请求超时时间
+                .setSocketTimeout(6000)// 数据读取超时时间
+                .build();
+        try {
+            // 为httpPut实例设置配置
+            httpDelete.setConfig(requestConfig);
+            // 执行Put请求得到返回对象
+            httpResponse = httpClient.execute(httpDelete);
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return httpResponse;
+    }
+
+
+
     //计算cnonce值,cnonce用于鉴权
     //计算cnonce值,cnonce用于鉴权
     public static String getCnonce() {
     public static String getCnonce() {
         double d = Math.random();
         double d = Math.random();

+ 19 - 6
src/main/java/com/chuanghai/student_portrait/config/FacePassRecord.java

@@ -2,9 +2,8 @@ package com.chuanghai.student_portrait.config;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.chuanghai.student_portrait.utils.Base64Utils;
 import com.chuanghai.student_portrait.utils.DateUtils;
 import com.chuanghai.student_portrait.utils.DateUtils;
-import com.chuanghai.student_portrait.utils.FileUtil;
+import com.chuanghai.student_portrait.utils.Imageys;
 import com.chuanghai.student_portrait.utils.vo.UniviewVO;
 import com.chuanghai.student_portrait.utils.vo.UniviewVO;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -16,6 +15,9 @@ import java.io.IOException;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
+
+
+
 public class FacePassRecord extends BaseClass {
 public class FacePassRecord extends BaseClass {
 
 
     //人脸识别接口信息
     //人脸识别接口信息
@@ -34,7 +36,6 @@ public class FacePassRecord extends BaseClass {
     public static List<UniviewVO> passRecord(List<UniviewVO> univiewVOList, String requestMode, String reqBody) {
     public static List<UniviewVO> passRecord(List<UniviewVO> univiewVOList, String requestMode, String reqBody) {
         String url = getNvrUrl() + urlString;
         String url = getNvrUrl() + urlString;
         CloseableHttpClient httpClient = HttpClients.custom().build();
         CloseableHttpClient httpClient = HttpClients.custom().build();
-
         JSONObject jsonOParam = JSONObject.parseObject(reqBody);
         JSONObject jsonOParam = JSONObject.parseObject(reqBody);
         int offset = Integer.parseInt(jsonOParam.get("Offset").toString());
         int offset = Integer.parseInt(jsonOParam.get("Offset").toString());
         int total = 0;
         int total = 0;
@@ -63,6 +64,7 @@ public class FacePassRecord extends BaseClass {
         }
         }
         HttpEntity entity = resp2.getEntity();
         HttpEntity entity = resp2.getEntity();
         try {
         try {
+//            获取返回值
             String responString = EntityUtils.toString(entity);
             String responString = EntityUtils.toString(entity);
             //解析response中body,获取相关字段的值
             //解析response中body,获取相关字段的值
             JSONObject body = JSONObject.parseObject(responString);
             JSONObject body = JSONObject.parseObject(responString);
@@ -85,10 +87,20 @@ public class FacePassRecord extends BaseClass {
                     JSONObject compareInfo = JSONObject.parseObject(jsonArray.getJSONObject(i).get("CompareInfo").toString());
                     JSONObject compareInfo = JSONObject.parseObject(jsonArray.getJSONObject(i).get("CompareInfo").toString());
                     JSONObject snapshotImage = JSONObject.parseObject(compareInfo.get("SnapshotImage").toString());
                     JSONObject snapshotImage = JSONObject.parseObject(compareInfo.get("SnapshotImage").toString());
                     JSONObject bigImage = JSONObject.parseObject(snapshotImage.get("BigImage").toString());
                     JSONObject bigImage = JSONObject.parseObject(snapshotImage.get("BigImage").toString());
+
+                    String data1 = bigImage.getString("Data");
+//                    System.out.println("data1.length() = " + data1.length());
+//                    压碎图片
+                    Imageys imageys = new Imageys();
+                    String s = imageys.resizeImageTo40K(data1);
+//                    System.out.println("s.length() = " + s.length());
+
                     StringBuilder builder = new StringBuilder();
                     StringBuilder builder = new StringBuilder();
                     builder.append("data:image/jpeg;base64,");
                     builder.append("data:image/jpeg;base64,");
-                    builder.append(bigImage.getString("Data"));
-                    String dataBase = builder.toString();
+                    builder.append(s);
+//                    String dataBase = builder.toString();
+//                    String s1 = imageys.resizeImageTo40K(dataBase);
+//                    System.out.println("s1.length() = " + s1.length());
 
 
 
 
                     JSONObject personInfo = JSONObject.parseObject(compareInfo.get("PersonInfo").toString());
                     JSONObject personInfo = JSONObject.parseObject(compareInfo.get("PersonInfo").toString());
@@ -98,7 +110,8 @@ public class FacePassRecord extends BaseClass {
                     String IDnumber = identification.get("Number").toString();
                     String IDnumber = identification.get("Number").toString();
 
 
                     UniviewVO univiewVO = new UniviewVO();
                     UniviewVO univiewVO = new UniviewVO();
-                    univiewVO.setPictureScene(dataBase);
+//                    univiewVO.setPictureScene(s1);
+                    univiewVO.setPictureScene(builder.toString());
                     univiewVO.setActiveEvent("人脸识别");
                     univiewVO.setActiveEvent("人脸识别");
                     univiewVO.setActivePlace(channelName);
                     univiewVO.setActivePlace(channelName);
                     univiewVO.setActiveTime(date);
                     univiewVO.setActiveTime(date);

+ 1 - 1
src/main/java/com/chuanghai/student_portrait/utils/JedisUtil.java

@@ -1,4 +1,4 @@
-package com.chuanghai.student_portrait.utils;
+package com.chuanghai.student_portrait.config;
 
 
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
 import redis.clients.jedis.Jedis;
 import redis.clients.jedis.Jedis;

+ 39 - 0
src/main/java/com/chuanghai/student_portrait/config/ScheduleConfig.java

@@ -0,0 +1,39 @@
+package com.chuanghai.student_portrait.config;
+
+import org.apache.tomcat.util.threads.ThreadPoolExecutor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.TaskScheduler;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+
+import java.util.concurrent.Executor;
+
+@Configuration
+@EnableAsync
+public class ScheduleConfig {
+
+    @Bean("myAsync")
+    public Executor myAsync() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        // 最大线程数
+        executor.setMaxPoolSize(10);
+        // 核心线程数
+        executor.setCorePoolSize(10);
+        // 任务队列的大小
+        executor.setQueueCapacity(10);
+        // 线程前缀名
+        executor.setThreadNamePrefix("New-Thread-");
+        // 线程存活时间
+        executor.setKeepAliveSeconds(60);
+        // 拒绝处理策略:丢弃队列中最老的任务。
+        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardOldestPolicy() {
+        });
+        // 线程初始化
+        executor.initialize();
+        return executor;
+    }
+
+
+}

+ 22 - 0
src/main/java/com/chuanghai/student_portrait/config/ScheduledTaskConfig.java

@@ -0,0 +1,22 @@
+package com.chuanghai.student_portrait.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+
+/**
+ * @Description : scheduler配置类
+ * @Version : V1.0.0
+ * @Date : 2021/12/1 14:00
+ */
+@Configuration
+public class ScheduledTaskConfig implements SchedulingConfigurer {
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
+        taskScheduler.setPoolSize(3);
+        taskScheduler.initialize();
+        taskRegistrar.setTaskScheduler(taskScheduler);
+    }
+}

+ 23 - 22
src/main/java/com/chuanghai/student_portrait/config/SubscriptionConfig.java

@@ -2,8 +2,8 @@ package com.chuanghai.student_portrait.config;
 
 
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
 import com.chuanghai.student_portrait.utils.vo.SubscriptionVo;
 import com.chuanghai.student_portrait.utils.vo.SubscriptionVo;
-import com.chuanghai.student_portrait.utils.vo.UniviewVO;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -11,9 +11,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
 import org.apache.http.util.EntityUtils;
 
 
-
 import java.io.IOException;
 import java.io.IOException;
-import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 public class SubscriptionConfig extends BaseClass {
 public class SubscriptionConfig extends BaseClass {
@@ -29,7 +27,7 @@ public class SubscriptionConfig extends BaseClass {
      */
      */
     public static SubscriptionVo subscriptionRecord(SubscriptionVo subscriptionVo, String requestMode, String reqBody, String urlString) {
     public static SubscriptionVo subscriptionRecord(SubscriptionVo subscriptionVo, String requestMode, String reqBody, String urlString) {
         String url = getNvrUrl() + urlString;
         String url = getNvrUrl() + urlString;
-        CloseableHttpClient httpClient = HttpClients.custom().build();
+        CloseableHttpClient httpClient = HttpClients.custom().disableCookieManagement().build();
 
 
         JSONObject jsonOParam = JSONObject.parseObject(reqBody);
         JSONObject jsonOParam = JSONObject.parseObject(reqBody);
 
 
@@ -108,9 +106,10 @@ public class SubscriptionConfig extends BaseClass {
     }
     }
 
 
 
 
-    public static Map<String, String> searchByImageRecord(Map<String, String> dateMap, String requestMode, String reqBody, String urlString) {
+
+    public static Map<String, Object> commonRecord(Map<String, Object> dateMap, String requestMode, String reqBody, String urlString) {
         String url = getNvrUrl() + urlString;
         String url = getNvrUrl() + urlString;
-        CloseableHttpClient httpClient = HttpClients.custom().build();
+        CloseableHttpClient httpClient = HttpClients.custom().disableCookieManagement().build();
 
 
         JSONObject jsonOParam = JSONObject.parseObject(reqBody);
         JSONObject jsonOParam = JSONObject.parseObject(reqBody);
 
 
@@ -140,14 +139,11 @@ public class SubscriptionConfig extends BaseClass {
             String responString = EntityUtils.toString(entity);
             String responString = EntityUtils.toString(entity);
             //解析response中body,获取相关字段的值
             //解析response中body,获取相关字段的值
             JSONObject body = JSONObject.parseObject(responString);
             JSONObject body = JSONObject.parseObject(responString);
-            JSONObject response = JSONObject.parseObject(body.getString("Response"));
-            String ResponseString = response.getString("ResponseString");
-            String data = response.getString("Data");
-            JSONObject jsonObject = JSONObject.parseObject(data);
-            if (ResponseString.equals("Succeed")) {
-                String taskIdNumber = jsonObject.get("TaskId").toString();
-                dateMap.put("Succeed", taskIdNumber);
-            }
+
+            Map response = JSONObject.parseObject(body.getString("Response"), Map.class);
+
+            dateMap.put("Response", response);
+
         } catch (Exception e) {
         } catch (Exception e) {
             // TODO Auto-generated catch block
             // TODO Auto-generated catch block
             e.printStackTrace();
             e.printStackTrace();
@@ -171,7 +167,8 @@ public class SubscriptionConfig extends BaseClass {
         return dateMap;
         return dateMap;
     }
     }
 
 
-    public static Map<String, Object> commonRecord(Map<String, Object> dateMap, String requestMode, String reqBody, String urlString) {
+
+    public static Map<String, Object> alarmSubscription(Map<String, Object> dateMap, String requestMode, String reqBody, String urlString) {
         String url = getNvrUrl() + urlString;
         String url = getNvrUrl() + urlString;
         CloseableHttpClient httpClient = HttpClients.custom().build();
         CloseableHttpClient httpClient = HttpClients.custom().build();
 
 
@@ -190,11 +187,13 @@ public class SubscriptionConfig extends BaseClass {
 
 
         //System.out.println(curAuthorization);
         //System.out.println(curAuthorization);
 
 
-        CloseableHttpResponse resp2;
+        CloseableHttpResponse resp2 = null;
         //带鉴权信息调用业务接口
         //带鉴权信息调用业务接口
         if (requestMode.equals("POST")) {
         if (requestMode.equals("POST")) {
             resp2 = doPost(httpClient, url, curAuthorization, reqBody);
             resp2 = doPost(httpClient, url, curAuthorization, reqBody);
-        } else {
+        } else if ("DELETE".equals(requestMode)){
+            resp2=doDelete(httpClient, url, curAuthorization, reqBody);
+        }else {
             resp2 = doPut(httpClient, url, curAuthorization, reqBody);
             resp2 = doPut(httpClient, url, curAuthorization, reqBody);
         }
         }
         HttpEntity entity = resp2.getEntity();
         HttpEntity entity = resp2.getEntity();
@@ -203,11 +202,13 @@ public class SubscriptionConfig extends BaseClass {
             String responString = EntityUtils.toString(entity);
             String responString = EntityUtils.toString(entity);
             //解析response中body,获取相关字段的值
             //解析response中body,获取相关字段的值
             JSONObject body = JSONObject.parseObject(responString);
             JSONObject body = JSONObject.parseObject(responString);
-
-            Map response = JSONObject.parseObject(body.getString("Response"), Map.class);
-
-            dateMap.put("Response", response);
-
+            JSONObject response = JSONObject.parseObject(body.getString("Response"));
+            String ResponseString = response.getString("ResponseString");
+            String data = response.getString("Data");
+            JSONObject jsonObject = JSONObject.parseObject(data);
+            if ("Succeed".equals(ResponseString)) {
+                dateMap = JSONObject.parseObject(jsonObject.toString(),new TypeReference<Map<String, String>>(){});
+            }
         } catch (Exception e) {
         } catch (Exception e) {
             // TODO Auto-generated catch block
             // TODO Auto-generated catch block
             e.printStackTrace();
             e.printStackTrace();

+ 1 - 1
src/main/java/com/chuanghai/student_portrait/config/SwaggerConfig.java

@@ -32,7 +32,7 @@ public class SwaggerConfig {
 //                "15779633758@163.com"); // 作者邮箱
 //                "15779633758@163.com"); // 作者邮箱
         return new ApiInfoBuilder()
         return new ApiInfoBuilder()
                 .title("学生肖像-接口文档") // 标题
                 .title("学生肖像-接口文档") // 标题
-                .description("众里寻他千百度,慕然回首那人却在灯火阑珊处") // 描述
+                .description("学生肖像接口规范") // 描述
 //                .termsOfServiceUrl("https://www.baidu.com") // 跳转连接
 //                .termsOfServiceUrl("https://www.baidu.com") // 跳转连接
 //                .version("1.0") // 版本
 //                .version("1.0") // 版本
 //                .license("Swagger-的使用(详细教程)")
 //                .license("Swagger-的使用(详细教程)")

+ 97 - 0
src/main/java/com/chuanghai/student_portrait/controller/CircumferenceController.java

@@ -0,0 +1,97 @@
+package com.chuanghai.student_portrait.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.chuanghai.student_portrait.config.SubscriptionConfig;
+import com.chuanghai.student_portrait.service.FaceDiscernService;
+import com.chuanghai.student_portrait.utils.Base64Utils;
+import com.chuanghai.student_portrait.utils.FileUtil;
+import com.chuanghai.student_portrait.utils.LogUtils;
+import com.chuanghai.student_portrait.utils.vo.SubscribePersonCondition;
+import com.chuanghai.student_portrait.utils.vo.SubscriptionVo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * 宇视事件订阅
+ */
+@RestController
+@RequestMapping
+@Slf4j
+public class CircumferenceController {
+
+    @Autowired
+    FaceDiscernService faceDiscernService;
+
+
+    String id = "";
+
+    /**
+     * 预警订阅
+     *
+     * @return
+     */
+    @PostMapping("/post/getSubscription")
+    @Scheduled(cron = "0 0 0/1 * * ? ")
+    public SubscriptionVo getSubscription() {
+        LogUtils.logInfo("开始事件订阅");
+        SubscribePersonCondition subscribePersonCondition = new SubscribePersonCondition();
+        subscribePersonCondition.setLibIDNum(0);
+        JSONObject map = new JSONObject();
+        map.put("AddressType", 0);
+        map.put("IPAddress", "172.16.20.69");
+//        map.put("IPAddress", "192.168.161.100");
+        map.put("Port", 8086);
+        map.put("Duration", 3600);
+        map.put("SubscribePersonCondition", subscribePersonCondition);
+        String jsonString = map.toJSONString();
+        SubscriptionVo subscriptionVo = new SubscriptionVo();
+        SubscriptionVo vo = SubscriptionConfig.subscriptionRecord(subscriptionVo, "POST", jsonString, "/LAPI/V1.0/System/Event/Subscription");
+        LogUtils.logWarn("事件订阅得到的值: "+vo);
+        id = vo.getID();
+
+        return vo;
+
+    }
+
+
+    //    刷新订阅
+//        @Scheduled(cron = "0 0 0/2 * * ? ")
+//    @Scheduled(cron = "0 0 0/1 * * ? ")
+    public void refresh() {
+        if (ObjectUtils.isEmpty(id)||"".equals(id)) {
+            getSubscription();
+        }
+        JSONObject map = new JSONObject();
+        map.put("Duration", 3600);
+        String jsonString = map.toJSONString();
+        HashMap<String, Object> dateMap = new HashMap<>();
+        String url = "/LAPI/V1.0/System/Event/Subscription/"+id;
+        SubscriptionConfig.commonRecord(dateMap, "PUT", jsonString, url);
+            System.out.println("dateMap = " + dateMap);
+    }
+
+    @PostMapping("/LAPI/V1.0/System/Event/Notification/{url}")
+    public void a(HttpServletRequest request, HttpServletResponse response , @PathVariable String url /*, @RequestBody Map<String, Object> params*/) {
+
+       faceDiscernService.saveFaceContrast(request,response,url);
+    }
+
+
+}
+
+
+

+ 12 - 5
src/main/java/com/chuanghai/student_portrait/controller/CountController.java

@@ -14,10 +14,11 @@ import com.chuanghai.student_portrait.service.CityService;
 import com.chuanghai.student_portrait.service.ForewarningService;
 import com.chuanghai.student_portrait.service.ForewarningService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.chuanghai.student_portrait.service.ProvinceService;
 import com.chuanghai.student_portrait.service.ProvinceService;
-import com.chuanghai.student_portrait.utils.JedisUtil;
+import com.chuanghai.student_portrait.config.JedisUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import org.python.antlr.ast.If;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -173,6 +174,9 @@ public class CountController {
             return BaseResponse.error(StatusEnum.FAIL, "参数异常");
             return BaseResponse.error(StatusEnum.FAIL, "参数异常");
         }
         }
         City one = cityService.getOne(Wrappers.<City>lambdaQuery().eq(City::getCityName, name));
         City one = cityService.getOne(Wrappers.<City>lambdaQuery().eq(City::getCityName, name));
+        if (ObjectUtils.isEmpty(one)) {
+            return BaseResponse.error(StatusEnum.FAIL, "参数异常");
+        }
         String cityCode = one.getCityCode();
         String cityCode = one.getCityCode();
         String provinceCode = one.getProvinceCode() + "";
         String provinceCode = one.getProvinceCode() + "";
 
 
@@ -208,11 +212,14 @@ public class CountController {
             String schooluserId = forewarning.getSchooluserId();
             String schooluserId = forewarning.getSchooluserId();
             if (ObjectUtils.isNotEmpty(schooluserId)) {
             if (ObjectUtils.isNotEmpty(schooluserId)) {
                 NewSchooluser byId = newSchooluserService.getById(schooluserId);
                 NewSchooluser byId = newSchooluserService.getById(schooluserId);
-                String city = byId.getCity();
-                String province = byId.getProvince();
-                if (city.equals(cityCode) && province.equals(provinceCode)) {
-                    countForewarning = countForewarning + 1;
+                if (ObjectUtils.isNotEmpty(byId)) {
+                    String city = byId.getCity();
+                    String province = byId.getProvince();
+                    if (city.equals(cityCode) && province.equals(provinceCode)) {
+                        countForewarning = countForewarning + 1;
+                    }
                 }
                 }
+
             }
             }
         }
         }
         mapCount.put("studentCount", countSchoolUser);
         mapCount.put("studentCount", countSchoolUser);

+ 23 - 3
src/main/java/com/chuanghai/student_portrait/controller/FaceDiscernController.java

@@ -1,12 +1,20 @@
 package com.chuanghai.student_portrait.controller;
 package com.chuanghai.student_portrait.controller;
 
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.chuanghai.student_portrait.response.BaseResponse;
 import com.chuanghai.student_portrait.response.BaseResponse;
 import com.chuanghai.student_portrait.service.FaceDiscernService;
 import com.chuanghai.student_portrait.service.FaceDiscernService;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 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 org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
 
 
 /**
 /**
  * @Author:liu
  * @Author:liu
@@ -15,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
  */
 @RestController
 @RestController
 @RequestMapping("/access")
 @RequestMapping("/access")
+@Slf4j
 public class FaceDiscernController {
 public class FaceDiscernController {
 
 
     @Autowired
     @Autowired
@@ -43,5 +52,16 @@ public class FaceDiscernController {
         return faceDiscernService.repetitionCoordinate(id);
         return faceDiscernService.repetitionCoordinate(id);
     }
     }
 
 
+    @GetMapping("/single/coords")
+    @ApiOperation(value = "坐标出现的次数")
+    public BaseResponse coords(String id,String longitude,String latitude){
+        return faceDiscernService.getCoords(id,longitude,latitude);
+    }
+
+
+
+
+
+
 
 
 }
 }

+ 14 - 6
src/main/java/com/chuanghai/student_portrait/controller/GetSchoolUserController.java

@@ -87,7 +87,7 @@ public class GetSchoolUserController {
     }
     }
 
 
     //现在不需要获取微校数据
     //现在不需要获取微校数据
-    @Scheduled(cron = "0 0 0/2 * * ? ")   //从0时开始,每2小时运行一次
+//    @Scheduled(cron = "0 0 0/2 * * ? ")   //从0时开始,每2小时运行一次
     public String token() {
     public String token() {
         String cardNumber = getCardNumber();
         String cardNumber = getCardNumber();
         return cardNumber;
         return cardNumber;
@@ -95,6 +95,7 @@ public class GetSchoolUserController {
 
 
 //    获取组织架构
 //    获取组织架构
     @GetMapping("/get")
     @GetMapping("/get")
+//    @Scheduled(cron = "0 0/1 * * * ?  ")
     public Map get() {
     public Map get() {
         String token = this.token();
         String token = this.token();
         System.out.println("token = " + token);
         System.out.println("token = " + token);
@@ -121,10 +122,10 @@ public class GetSchoolUserController {
         Map<String, Object> param = new HashMap<>();
         Map<String, Object> param = new HashMap<>();
         ObjectMapper mapper = new ObjectMapper();
         ObjectMapper mapper = new ObjectMapper();
         param.put("access_token", token);
         param.put("access_token", token);
-        param.put("org_id", 573084);
+        param.put("org_id", 578692);
         param.put("fetch_child", 1);
         param.put("fetch_child", 1);
-//        param.put("page", page);
-        param.put("page", 2);
+        param.put("page", page);
+//        param.put("page", 2);
         param.put("page_size", 1000);
         param.put("page_size", 1000);
         HttpHeaders headers = new HttpHeaders();
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.APPLICATION_JSON);
         headers.setContentType(MediaType.APPLICATION_JSON);
@@ -234,7 +235,7 @@ public class GetSchoolUserController {
 
 
  //    定时获取微校数据
  //    定时获取微校数据
 //
 //
-    Integer i = 45;
+    Integer i = 0;
 
 
     //
     //
 //    @Scheduled(cron = "0 0/1 * * * ?  ")
 //    @Scheduled(cron = "0 0/1 * * * ?  ")
@@ -257,7 +258,14 @@ public class GetSchoolUserController {
      * @return
      * @return
      */
      */
     public OldSchooluser queryOldSchoolUser(String idCard) {
     public OldSchooluser queryOldSchoolUser(String idCard) {
-        OldSchooluser oldSchooluser = oldSchooluserService.list(Wrappers.<OldSchooluser>lambdaQuery().eq(OldSchooluser::getIdCard, idCard)).get(0);
+        OldSchooluser oldSchooluser = null;
+        try {
+             oldSchooluser = oldSchooluserService.list(Wrappers.<OldSchooluser>lambdaQuery().eq(OldSchooluser::getIdCard, idCard)).get(0);
+        }catch (Exception e){
+
+
+        }
+
         return oldSchooluser;
         return oldSchooluser;
     }
     }
 
 

+ 63 - 34
src/main/java/com/chuanghai/student_portrait/controller/ReceiveController.java

@@ -7,28 +7,28 @@ import com.chuanghai.student_portrait.entity.CollegesInfo;
 import com.chuanghai.student_portrait.entity.NewSchooluser;
 import com.chuanghai.student_portrait.entity.NewSchooluser;
 import com.chuanghai.student_portrait.entity.OldSchooluser;
 import com.chuanghai.student_portrait.entity.OldSchooluser;
 import com.chuanghai.student_portrait.entity.StructOfPeopleInSchool;
 import com.chuanghai.student_portrait.entity.StructOfPeopleInSchool;
+import com.chuanghai.student_portrait.entity.dto.WeixiaoPushDTO;
 import com.chuanghai.student_portrait.service.CollegesInfoService;
 import com.chuanghai.student_portrait.service.CollegesInfoService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.chuanghai.student_portrait.service.OldSchooluserService;
 import com.chuanghai.student_portrait.service.OldSchooluserService;
 import com.chuanghai.student_portrait.service.StructOfPeopleInSchoolService;
 import com.chuanghai.student_portrait.service.StructOfPeopleInSchoolService;
 import com.chuanghai.student_portrait.utils.AES;
 import com.chuanghai.student_portrait.utils.AES;
+import com.chuanghai.student_portrait.utils.LogUtils;
+import com.chuanghai.student_portrait.utils.ReturnWXPush;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
 import java.io.UnsupportedEncodingException;
 import java.util.regex.Matcher;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.regex.Pattern;
 
 
 @RestController
 @RestController
 @RequestMapping("/receive")
 @RequestMapping("/receive")
+@Slf4j
 public class ReceiveController {
 public class ReceiveController {
 
 
     @Autowired
     @Autowired
@@ -44,28 +44,35 @@ public class ReceiveController {
     NewSchooluserService newSchooluserService;
     NewSchooluserService newSchooluserService;
 
 
     @PostMapping("/push")
     @PostMapping("/push")
-    public void getReceive(HttpServletResponse response, HttpServletRequest request) {
+    public ReturnWXPush getReceive(@RequestBody WeixiaoPushDTO weixiaoPushDTO,HttpServletRequest request) {
 
 
+        LogUtils.logInfo("调用推送接口");
         try {
         try {
-            BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
-            StringBuilder responseStrBuilder = new StringBuilder();
-            String inputStr;
-            while ((inputStr = streamReader.readLine()) != null) {
-                responseStrBuilder.append(inputStr);
-            }
-            JSONObject jsonObject = JSONObject.parseObject(responseStrBuilder.toString());
-//            通过event判断是什么事件类型
-            String event = jsonObject.getString("event");
+//            BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
+//            StringBuilder responseStrBuilder = new StringBuilder();
+//            String inputStr;
+//            while ((inputStr = streamReader.readLine()) != null) {
+//                responseStrBuilder.append(inputStr);
+//            }
+//            JSONObject jsonObject = JSONObject.parseObject(responseStrBuilder.toString());
+////            通过event判断是什么事件类型
+//            String event = jsonObject.getString("event");
+            String appKey = weixiaoPushDTO.getApp_key();
+            String appSecret = weixiaoPushDTO.getApp_secret();
+            String event = weixiaoPushDTO.getEvent();
+            String rawData = weixiaoPushDTO.getRaw_data();
 
 
             String event1 = getEvent(event);
             String event1 = getEvent(event);
-            if ("org".equals(event1)) {
-                return;
-            }
-            String rawData = jsonObject.getString("raw_data");
+            LogUtils.logInfo("推送接口的类型是:"+event);
+//            if ("org".equals(event1)) {
+//                return ReturnWXPush.ok();
+//            }
+//            String rawData = jsonObject.getString("raw_data");
+//
+//            String appKey = jsonObject.getString("app_key");
+//
+//            String appSecret = jsonObject.getString("app_secret");
 
 
-            String appKey = jsonObject.getString("app_key");
-
-            String appSecret = jsonObject.getString("app_secret");
 
 
 //        String event="deleteUser";
 //        String event="deleteUser";
 //        String appKey = "DB60250B489345ED";
 //        String appKey = "DB60250B489345ED";
@@ -86,47 +93,69 @@ public class ReceiveController {
             String cardNumber = eventUser.getCardNumber();
             String cardNumber = eventUser.getCardNumber();
             Boolean aBoolean = existUser(cardNumber);
             Boolean aBoolean = existUser(cardNumber);
             if (aBoolean) {
             if (aBoolean) {
-                return;
+                LogUtils.logInfo("已添加");
+                return ReturnWXPush.ok();
             }
             }
-            oldSchooluserService.save(eventUser);
+//            oldSchooluserService.save(eventUser);
+//            log.info("添加旧微校人员信息");
             updateNum(eventUser.getIdentityType(), eventUser.getCollege(), 1);
             updateNum(eventUser.getIdentityType(), eventUser.getCollege(), 1);
             NewSchooluser newSchoolUser = oldSchooluserService.getNewSchoolUser(eventUser);
             NewSchooluser newSchoolUser = oldSchooluserService.getNewSchoolUser(eventUser);
             String identityType = newSchoolUser.getIdentityType();
             String identityType = newSchoolUser.getIdentityType();
-            if ("1".equals(identityType)) {
+            if ("1".equals(identityType)&&"墨轩湖校区".equals(eventUser.getCampus())) {
+                LogUtils.logInfo("添加新微校人员信息");
                 newSchooluserService.save(newSchoolUser);
                 newSchooluserService.save(newSchoolUser);
+            }else {
+                LogUtils.logInfo("不符合添加新微校人员信息");
+                LogUtils.logInfo("身份类型是:"+identityType+",校区是: "+eventUser.getCampus());
             }
             }
 
 
         } else if ("deleteUser".equals(event)) {
         } else if ("deleteUser".equals(event)) {
             Boolean aBoolean = existUser(eventUser.getCardNumber());
             Boolean aBoolean = existUser(eventUser.getCardNumber());
             if (!aBoolean) {
             if (!aBoolean) {
-                return;
+                LogUtils.logInfo("已删除");
+                return ReturnWXPush.ok();
             }
             }
-            oldSchooluserService.remove(Wrappers.<OldSchooluser>lambdaQuery().eq(OldSchooluser::getCardNumber, eventUser.getCardNumber()));
+//            oldSchooluserService.remove(Wrappers.<OldSchooluser>lambdaQuery().eq(OldSchooluser::getCardNumber, eventUser.getCardNumber()));
+//            log.info("删除旧微校人员信息");
             updateNum(eventUser.getIdentityType(), eventUser.getCollege(), -1);
             updateNum(eventUser.getIdentityType(), eventUser.getCollege(), -1);
             NewSchooluser newSchoolUser = oldSchooluserService.getNewSchoolUser(eventUser);
             NewSchooluser newSchoolUser = oldSchooluserService.getNewSchoolUser(eventUser);
             String identityType = newSchoolUser.getIdentityType();
             String identityType = newSchoolUser.getIdentityType();
-            if ("1".equals(identityType)) {
+            if ("1".equals(identityType)&&"墨轩湖校区".equals(eventUser.getCampus())) {
+                LogUtils.logInfo("删除新微校人员信息");
                 newSchooluserService.remove(Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getCardNumber, newSchoolUser.getCardNumber()));
                 newSchooluserService.remove(Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getCardNumber, newSchoolUser.getCardNumber()));
+            }else {
+                LogUtils.logInfo("不符合删除新微校人员信息");
+                LogUtils.logInfo("身份类型是:"+identityType+",校区是: "+eventUser.getCampus());
             }
             }
         } else if ("updateUser".equals(event)) {
         } else if ("updateUser".equals(event)) {
             Boolean aBoolean = existUser(eventUser.getCardNumber());
             Boolean aBoolean = existUser(eventUser.getCardNumber());
             if (aBoolean) {
             if (aBoolean) {
-                oldSchooluserService.update(eventUser, Wrappers.<OldSchooluser>lambdaQuery().eq(OldSchooluser::getCardNumber, eventUser.getCardNumber()));
+                //oldSchooluserService.update(eventUser, Wrappers.<OldSchooluser>lambdaQuery().eq(OldSchooluser::getCardNumber, eventUser.getCardNumber()));
                 NewSchooluser newSchoolUser = oldSchooluserService.getNewSchoolUser(eventUser);
                 NewSchooluser newSchoolUser = oldSchooluserService.getNewSchoolUser(eventUser);
+               // log.info("修改旧微校人员信息");
                 String identityType = newSchoolUser.getIdentityType();
                 String identityType = newSchoolUser.getIdentityType();
-                if ("1".equals(identityType)) {
+                if ("1".equals(identityType)&&"墨轩湖校区".equals(eventUser.getCampus())) {
+                    LogUtils.logInfo("修改新微校人员信息");
                     newSchooluserService.saveOrUpdate(newSchoolUser, Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getCardNumber, newSchoolUser.getCardNumber()));
                     newSchooluserService.saveOrUpdate(newSchoolUser, Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getCardNumber, newSchoolUser.getCardNumber()));
+                }else {
+                    LogUtils.logInfo("不符合修改新微校人员信息");
+                    LogUtils.logInfo("身份类型是:"+identityType+",校区是: "+eventUser.getCampus());
                 }
                 }
             }
             }
+
         }
         }
 
 
+        return ReturnWXPush.ok();
 
 
         } catch (UnsupportedEncodingException e) {
         } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
+            LogUtils.logError("推送接口异常 {}"+e);
+            return ReturnWXPush.fail();
         } catch (IOException e) {
         } catch (IOException e) {
-            throw new RuntimeException(e);
+            LogUtils.logError("推送接口异常 {}"+e);
+            return ReturnWXPush.fail();
         } catch (Exception e) {
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            LogUtils.logError("推送接口异常 {}"+e);
+            return ReturnWXPush.fail();
         }
         }
 
 
     }
     }

+ 17 - 0
src/main/java/com/chuanghai/student_portrait/entity/DormRx.java

@@ -0,0 +1,17 @@
+package com.chuanghai.student_portrait.entity;
+
+import lombok.Data;
+
+@Data
+public class DormRx {
+    private int id;
+
+    private String build;
+
+    private String floors;
+
+    private String  dom;
+
+    private String  addrId;
+
+}

+ 20 - 0
src/main/java/com/chuanghai/student_portrait/entity/SecondFloorCanteen.java

@@ -0,0 +1,20 @@
+package com.chuanghai.student_portrait.entity;
+
+import lombok.Data;
+
+@Data
+public class SecondFloorCanteen {
+    private  Integer id;
+//    订单号
+    private String orderId;
+//    窗口号
+    private String windowNumber;
+//    支付金额
+    private Double paymentAmount;
+//    支付时间
+    private String timePayment;
+//    支付状态
+    private String statePayment;
+//    支付方式
+    private String modePayment;
+}

+ 12 - 0
src/main/java/com/chuanghai/student_portrait/entity/SecondFloorShopName.java

@@ -0,0 +1,12 @@
+package com.chuanghai.student_portrait.entity;
+
+import lombok.Data;
+
+@Data
+public class SecondFloorShopName {
+    private Integer id;
+//    窗口编号
+    private String windowNumber;
+//    店铺名称
+    private String shopName;
+}

+ 1 - 0
src/main/java/com/chuanghai/student_portrait/entity/Stall.java

@@ -12,4 +12,5 @@ public class Stall {
     private Integer id;
     private Integer id;
     private String address;
     private String address;
     private String name;
     private String name;
+
 }
 }

+ 3 - 0
src/main/java/com/chuanghai/student_portrait/entity/dto/PersonalTrackDto.java

@@ -7,6 +7,7 @@ import java.util.Date;
 
 
 @Data
 @Data
 public class PersonalTrackDto  implements Serializable {
 public class PersonalTrackDto  implements Serializable {
+//    时间
     private Date dateTime;
     private Date dateTime;
 //    图片
 //    图片
     private String image;
     private String image;
@@ -14,6 +15,8 @@ public class PersonalTrackDto  implements Serializable {
     private String affair;
     private String affair;
 //   名字
 //   名字
     private String name;
     private String name;
+//    总名称
+    private String totalName;
 //    坐标--经度
 //    坐标--经度
     private String longitude;
     private String longitude;
 //    坐标--纬度
 //    坐标--纬度

+ 43 - 0
src/main/java/com/chuanghai/student_portrait/entity/dto/WeixiaoPushDTO.java

@@ -0,0 +1,43 @@
+package com.chuanghai.student_portrait.entity.dto;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2022/12/29 星期四 16:03
+ * @Description: 用于接收微校推送的数据
+ * @Version: 1.0
+ */
+@Data
+public class WeixiaoPushDTO {
+    /**
+     * 应用appKey
+     */
+    private String app_key;
+    /**
+     * 应用appSecret
+     */
+    private String app_secret;
+    /**
+     * 学校主体代码
+     */
+    private String school_code;
+    /**
+     * 推送事件类型
+     *  addUser 新增用户信息事件
+     *  updateUser  修改用户信息事件
+     *  deleteUser  删除用户信息事件
+     *  addOrg  新增组织架构事件
+     *  updateOrg  修改组织架构事件
+     *  deleteOrg  删除组织架构事件
+     */
+    private String event;
+    /**
+     * 推送加密后数据
+     */
+    private String raw_data;
+
+
+
+
+}

+ 9 - 0
src/main/java/com/chuanghai/student_portrait/mapper/DormRxMapper.java

@@ -0,0 +1,9 @@
+package com.chuanghai.student_portrait.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.chuanghai.student_portrait.entity.DormRx;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface DormRxMapper extends BaseMapper<DormRx> {
+}

+ 1 - 1
src/main/java/com/chuanghai/student_portrait/mapper/FaceDiscernMapper.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?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">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.chuanghai.student_portrait.mapper.primary.FaceDiscernMapper">
+<mapper namespace="com.chuanghai.student_portrait.mapper.FaceDiscernMapper">
 
 
 <!--    <select id="getStudentCount" resultType="com.chuanghai.student_portrait.entity.dto.FaceDisernDto">-->
 <!--    <select id="getStudentCount" resultType="com.chuanghai.student_portrait.entity.dto.FaceDisernDto">-->
 <!--        select shooluser_id as schoolUserID,COUNT(shooluser_id) as count from facediscern-->
 <!--        select shooluser_id as schoolUserID,COUNT(shooluser_id) as count from facediscern-->

+ 9 - 0
src/main/java/com/chuanghai/student_portrait/mapper/SecondFloorCanteenMapper.java

@@ -0,0 +1,9 @@
+package com.chuanghai.student_portrait.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.chuanghai.student_portrait.entity.SecondFloorCanteen;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SecondFloorCanteenMapper extends BaseMapper<SecondFloorCanteen> {
+}

+ 9 - 0
src/main/java/com/chuanghai/student_portrait/mapper/SecondFloorShopNameMapper.java

@@ -0,0 +1,9 @@
+package com.chuanghai.student_portrait.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.chuanghai.student_portrait.entity.SecondFloorShopName;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SecondFloorShopNameMapper extends BaseMapper<SecondFloorShopName> {
+}

+ 6 - 6
src/main/java/com/chuanghai/student_portrait/response/enums/StatusEnum.java

@@ -1,12 +1,12 @@
 package com.chuanghai.student_portrait.response.enums;
 package com.chuanghai.student_portrait.response.enums;
 
 
 public enum StatusEnum implements Code {
 public enum StatusEnum implements Code {
-    SUCCESS(20001, "操作成功"),
-    FAIL(50001,"操作失败 "),
-    SUCCESS_ADD(20002,"添加成功"),
-    FAIL_ADD(50002,"添加失败"),
-    SUCCESS_UPDATE(20003, "修改成功"),
-    FAIL_UPDATE(50003,"修改失败 "),
+    SUCCESS(201, "操作成功"),
+    FAIL(501,"操作失败 "),
+    SUCCESS_ADD(202,"添加成功"),
+    FAIL_ADD(502,"添加失败"),
+    SUCCESS_UPDATE(203, "修改成功"),
+    FAIL_UPDATE(503,"修改失败 "),
     SUCCESS_DELETE(20004, "删除成功"),
     SUCCESS_DELETE(20004, "删除成功"),
     FAIL_DELETE(50004,"删除失败 "),
     FAIL_DELETE(50004,"删除失败 "),
     SUCCESS_SELECT(20005, "查询成功"),
     SUCCESS_SELECT(20005, "查询成功"),

+ 7 - 0
src/main/java/com/chuanghai/student_portrait/service/DormRxService.java

@@ -0,0 +1,7 @@
+package com.chuanghai.student_portrait.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.chuanghai.student_portrait.entity.DormRx;
+
+public interface DormRxService extends IService<DormRx> {
+}

+ 5 - 0
src/main/java/com/chuanghai/student_portrait/service/FaceDiscernService.java

@@ -5,6 +5,8 @@ import com.chuanghai.student_portrait.entity.FaceDiscern;
 import com.chuanghai.student_portrait.entity.dto.FaceDisernDto;
 import com.chuanghai.student_portrait.entity.dto.FaceDisernDto;
 import com.chuanghai.student_portrait.response.BaseResponse;
 import com.chuanghai.student_portrait.response.BaseResponse;
 
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -27,6 +29,9 @@ public interface FaceDiscernService extends IService<FaceDiscern> {
 
 
     BaseResponse repetitionCoordinate(String id);
     BaseResponse repetitionCoordinate(String id);
 
 
+    void saveFaceContrast(HttpServletRequest request, HttpServletResponse response,String url);
+
+    BaseResponse getCoords(String id, String longitude, String latitude);
 
 
 
 
 //    ReturnValueUtil online(Integer page1);
 //    ReturnValueUtil online(Integer page1);

+ 7 - 0
src/main/java/com/chuanghai/student_portrait/service/SecondFloorCanteenService.java

@@ -0,0 +1,7 @@
+package com.chuanghai.student_portrait.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.chuanghai.student_portrait.entity.SecondFloorCanteen;
+
+public interface SecondFloorCanteenService extends IService<SecondFloorCanteen> {
+}

+ 7 - 0
src/main/java/com/chuanghai/student_portrait/service/SecondFloorShopNameService.java

@@ -0,0 +1,7 @@
+package com.chuanghai.student_portrait.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.chuanghai.student_portrait.entity.SecondFloorShopName;
+
+public interface SecondFloorShopNameService extends IService<SecondFloorShopName> {
+}

+ 4 - 2
src/main/java/com/chuanghai/student_portrait/service/impl/AccessServiceImpl.java

@@ -16,6 +16,7 @@ import com.chuanghai.student_portrait.utils.DateUtils;
 import com.chuanghai.student_portrait.utils.LogUtils;
 import com.chuanghai.student_portrait.utils.LogUtils;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,6 +37,7 @@ import java.util.Map;
  * @Version 1.0
  * @Version 1.0
  */
  */
 @Service
 @Service
+@Slf4j
 public class AccessServiceImpl extends ServiceImpl<AccessMapper, Access> implements AccessService {
 public class AccessServiceImpl extends ServiceImpl<AccessMapper, Access> implements AccessService {
 
 
     @Autowired
     @Autowired
@@ -125,8 +127,8 @@ public class AccessServiceImpl extends ServiceImpl<AccessMapper, Access> impleme
                         }
                         }
                     }
                     }
                 } catch (Exception e) {
                 } catch (Exception e) {
-                    e.printStackTrace();
-                    LogUtils.logError("e");
+                   e.printStackTrace();
+                   LogUtils.logError(e);
                 }
                 }
             });
             });
         }
         }

+ 2 - 1
src/main/java/com/chuanghai/student_portrait/service/impl/AffinityScoreServiceImpl.java

@@ -15,7 +15,7 @@ import com.chuanghai.student_portrait.service.ConsumeService;
 import com.chuanghai.student_portrait.service.FaceDiscernService;
 import com.chuanghai.student_portrait.service.FaceDiscernService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.chuanghai.student_portrait.utils.JedisUtil;
+import com.chuanghai.student_portrait.config.JedisUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -76,6 +76,7 @@ public class AffinityScoreServiceImpl extends ServiceImpl<AffinityScoreMapper, A
         try {
         try {
             jsonStr = objectMapper.writeValueAsString(list);	//areaList序列化为json字符串
             jsonStr = objectMapper.writeValueAsString(list);	//areaList序列化为json字符串
         } catch (JsonProcessingException e) {
         } catch (JsonProcessingException e) {
+
             e.printStackTrace();
             e.printStackTrace();
         }
         }
         jedisUtil.setnx("affinity"+id, jsonStr);
         jedisUtil.setnx("affinity"+id, jsonStr);

+ 7 - 2
src/main/java/com/chuanghai/student_portrait/service/impl/CapacityServiceImpl.java

@@ -12,7 +12,7 @@ import com.chuanghai.student_portrait.response.BaseResponse;
 import com.chuanghai.student_portrait.response.enums.StatusEnum;
 import com.chuanghai.student_portrait.response.enums.StatusEnum;
 import com.chuanghai.student_portrait.service.*;
 import com.chuanghai.student_portrait.service.*;
 import com.chuanghai.student_portrait.utils.DateUtils;
 import com.chuanghai.student_portrait.utils.DateUtils;
-import com.chuanghai.student_portrait.utils.JedisUtil;
+import com.chuanghai.student_portrait.config.JedisUtil;
 import com.chuanghai.student_portrait.utils.LogUtils;
 import com.chuanghai.student_portrait.utils.LogUtils;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -679,7 +679,12 @@ public class CapacityServiceImpl extends ServiceImpl<CapacityMapper, Capacity> i
         CapacityAllDto capacityAllDto4 = new CapacityAllDto();
         CapacityAllDto capacityAllDto4 = new CapacityAllDto();
         capacityAllDto4.setName(safety);
         capacityAllDto4.setName(safety);
         capacityAllDto4.setThreshold(totalCount4);
         capacityAllDto4.setThreshold(totalCount4);
-        capacityAllDto4.setTruth(totalCount4 - geAverageCount4);
+//        todo 现在暂时未负数后续需删除
+        if (totalCount4 - geAverageCount4<0) {
+            capacityAllDto4.setTruth(21783 - geAverageCount4);
+        }else {
+            capacityAllDto4.setTruth(totalCount4 - geAverageCount4);
+        }
         list.add(capacityAllDto4);
         list.add(capacityAllDto4);
 
 
 //        健康
 //        健康

+ 24 - 4
src/main/java/com/chuanghai/student_portrait/service/impl/ColdWaterServiceImpl.java

@@ -33,13 +33,14 @@ public class ColdWaterServiceImpl extends ServiceImpl<ColdWaterMapper, ColdWater
 
 
     @Autowired
     @Autowired
     DormService dormService;
     DormService dormService;
-    private static String url = "http://192.168.1.34:8080/HotWaters/cwaterMonthlist.action";
+//    private static String url = "https://chtech.ncjti.edu.cn/shuidian/HotWaters/cwaterqueryNow.action";
+    private static String url = "https://jtishfw.ncjti.edu.cn/jxch-smartmp/HotWaters/cwaterMonthlist.action";
     private Integer page = 1;
     private Integer page = 1;
     private Integer size = 8;
     private Integer size = 8;
 
 
     //    20秒钟运行一次
     //    20秒钟运行一次
-//    @Scheduled(cron = "0/20 * * 1 * ? ")
-    @Scheduled(cron = "0 0/1 * * * ? ")
+    @Scheduled(cron = "0 0/2 0 1 * ? ")
+//    @Scheduled(cron = "0 0/1 * * * ? ")
     public void autoQueryOrder() {
     public void autoQueryOrder() {
         Page<Dorm> dormPage = dormService.page(new Page<Dorm>(page, size));
         Page<Dorm> dormPage = dormService.page(new Page<Dorm>(page, size));
         List<Dorm> records = dormPage.getRecords();
         List<Dorm> records = dormPage.getRecords();
@@ -67,19 +68,23 @@ public class ColdWaterServiceImpl extends ServiceImpl<ColdWaterMapper, ColdWater
     public ResultValue getColdWater(String dormNumber) {
     public ResultValue getColdWater(String dormNumber) {
         String token="AqwxcdAxs4212pomk231qsxssaz";
         String token="AqwxcdAxs4212pomk231qsxssaz";
         MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
         MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
+//        dormNumber="墨轩湖校区"+dormNumber;
         map.add("dom", dormNumber);
         map.add("dom", dormNumber);
         map.add("page", 1);
         map.add("page", 1);
         map.add("rows", 1);
         map.add("rows", 1);
-        map.add("token",token);
+//        map.add("token",token);
         RestTemplate restTemplate = new RestTemplate();
         RestTemplate restTemplate = new RestTemplate();
         HttpHeaders headers = new HttpHeaders();
         HttpHeaders headers = new HttpHeaders();
+        headers.set("token",token);
         headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
         headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
 
 
         HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(map, headers);
         HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(map, headers);
         ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, request, String.class);
         ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, request, String.class);
         JSONObject jsonObj = JSON.parseObject(responseEntity.getBody());
         JSONObject jsonObj = JSON.parseObject(responseEntity.getBody());
 
 
+//        rows为数组
         JSONArray jsonArray = jsonObj.getJSONArray("rows");
         JSONArray jsonArray = jsonObj.getJSONArray("rows");
+
         if (ObjectUtils.isNotEmpty(jsonArray)) {
         if (ObjectUtils.isNotEmpty(jsonArray)) {
 
 
 
 
@@ -133,5 +138,20 @@ public class ColdWaterServiceImpl extends ServiceImpl<ColdWaterMapper, ColdWater
         return exists;
         return exists;
     }
     }
 
 
+    /**
+     * 通过宿舍号和时间判断该数据是否已添加
+     *
+     * @param dateTime
+     * @return
+     */
+    public Boolean chackColdWaterActiveDateTime(String dateTime) {
+        LambdaQueryWrapper<ColdWater> query = new LambdaQueryWrapper<>();
+        query.eq(ColdWater::getDataTime, dateTime);
+        boolean exists = this.getBaseMapper().exists(query);
+        return exists;
+    }
+
+
+
 
 
 }
 }

+ 215 - 8
src/main/java/com/chuanghai/student_portrait/service/impl/ConsumeServicelmpl.java

@@ -17,21 +17,30 @@ import com.chuanghai.student_portrait.response.BaseResponse;
 import com.chuanghai.student_portrait.response.enums.StatusEnum;
 import com.chuanghai.student_portrait.response.enums.StatusEnum;
 import com.chuanghai.student_portrait.service.*;
 import com.chuanghai.student_portrait.service.*;
 import com.chuanghai.student_portrait.utils.DateUtils;
 import com.chuanghai.student_portrait.utils.DateUtils;
-import com.chuanghai.student_portrait.utils.JedisUtil;
+import com.chuanghai.student_portrait.config.JedisUtil;
 import com.chuanghai.student_portrait.utils.LogUtils;
 import com.chuanghai.student_portrait.utils.LogUtils;
+import com.chuanghai.student_portrait.utils.Md5Utils;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 
+import com.sun.org.apache.bcel.internal.generic.NEW;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.aspectj.weaver.ast.Var;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.client.RestTemplate;
 
 
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.*;
@@ -64,6 +73,12 @@ public class ConsumeServicelmpl extends ServiceImpl<ConsumeMapper, Consume> impl
     ElectricityService electricityService;
     ElectricityService electricityService;
 
 
     @Autowired
     @Autowired
+    SecondFloorCanteenService secondFloorCanteenService;
+
+    @Autowired
+    SecondFloorShopNameService secondFloorShopNameService;
+
+    @Autowired
     JedisUtil jedisUtil;
     JedisUtil jedisUtil;
 
 
 
 
@@ -77,18 +92,75 @@ public class ConsumeServicelmpl extends ServiceImpl<ConsumeMapper, Consume> impl
 //            return BaseResponse.ok(StatusEnum.SUCCESS, list);
 //            return BaseResponse.ok(StatusEnum.SUCCESS, list);
 //        }
 //        }
         DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
         LocalDateTime now = LocalDateTime.now();
         LocalDateTime now = LocalDateTime.now();
 //        为空,默认为昨天的
 //        为空,默认为昨天的
         if (ObjectUtils.isEmpty(startTime)) {
         if (ObjectUtils.isEmpty(startTime)) {
             LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0);
             LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0);
             startTime = start.minusDays(1).format(pattern);
             startTime = start.minusDays(1).format(pattern);
+
         }
         }
         if (ObjectUtils.isEmpty(endTime)) {
         if (ObjectUtils.isEmpty(endTime)) {
             LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59);
             LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59);
             endTime = end.minusDays(1).format(pattern);
             endTime = end.minusDays(1).format(pattern);
+
+        }
+
+        ArrayList<ConsumeDto> consumeDtos = new ArrayList<>();
+
+//        二楼食堂的消费数据无法精确到个人,所以只有查询全校档口排名时才需要展示
+        if (ObjectUtils.isEmpty(idCard)) {
+            List<SecondFloorCanteen> secondFloorCanteenList = secondFloorCanteenService.list(Wrappers.<SecondFloorCanteen>lambdaQuery().between(SecondFloorCanteen::getTimePayment, startTime, endTime).select(SecondFloorCanteen::getWindowNumber));
+            HashMap<String, Integer> map = new HashMap<>();
+            Integer count = 1;
+//            统计每个窗口的消费次数
+            for (SecondFloorCanteen secondFloorCanteen : secondFloorCanteenList) {
+                String windowNumber = secondFloorCanteen.getWindowNumber();
+                if (map.containsKey(windowNumber)) {
+                    Integer integer = map.get(windowNumber);
+                    integer = integer + count;
+                    map.put(windowNumber, integer);
+                } else {
+                    map.put(windowNumber, count);
+                }
+            }
+//            统计每个店铺的消费记录
+            HashMap<String, Integer> map1 = new HashMap<>();
+            Set<Map.Entry<String, Integer>> entries = map.entrySet();
+            for (Map.Entry<String, Integer> entry : entries) {
+//                窗口号
+                String key = entry.getKey();
+//                消费次数
+                Integer value = entry.getValue();
+
+                SecondFloorShopName secondFloorShopName = secondFloorShopNameService.getOne(Wrappers.<SecondFloorShopName>lambdaQuery().eq(SecondFloorShopName::getWindowNumber,key));
+                String shopName = secondFloorShopName.getShopName();
+                if (map1.containsKey(shopName)) {
+                    Integer integer = map1.get(shopName);
+                    integer = integer + value;
+                    map1.put(shopName, integer);
+                } else {
+                    map1.put(shopName,value);
+                }
+            }
+
+            Set<Map.Entry<String, Integer>> map1Entry = map1.entrySet();
+            for (Map.Entry<String, Integer> stringIntegerEntry : map1Entry) {
+                String key = stringIntegerEntry.getKey();
+                Integer value = stringIntegerEntry.getValue();
+                ConsumeDto consumeDto = new ConsumeDto();
+                consumeDto.setName(key);
+                consumeDto.setCount(value);
+                consumeDtos.add(consumeDto);
+            }
+
         }
         }
 
 
 
 
+
+
+
+
         List<Consume> list = this.list(Wrappers.<Consume>lambdaQuery()
         List<Consume> list = this.list(Wrappers.<Consume>lambdaQuery()
                 .eq(ObjectUtils.isNotEmpty(idCard), Consume::getIdCard, idCard)
                 .eq(ObjectUtils.isNotEmpty(idCard), Consume::getIdCard, idCard)
                 .between(Consume::getConsumeTime, startTime, endTime));
                 .between(Consume::getConsumeTime, startTime, endTime));
@@ -105,22 +177,40 @@ public class ConsumeServicelmpl extends ServiceImpl<ConsumeMapper, Consume> impl
                 map.put(consumeAddress, count);
                 map.put(consumeAddress, count);
             }
             }
         }
         }
-//        }
-        ArrayList<ConsumeDto> consumeDtos = new ArrayList<>();
+
+
         Set<Map.Entry<String, Integer>> entries = map.entrySet();
         Set<Map.Entry<String, Integer>> entries = map.entrySet();
+        HashMap<String, Integer> map1 = new HashMap<>();
         for (Map.Entry<String, Integer> entry : entries) {
         for (Map.Entry<String, Integer> entry : entries) {
             String address = entry.getKey();
             String address = entry.getKey();
             Integer value = entry.getValue();
             Integer value = entry.getValue();
             Stall one = stallService.getOne(Wrappers.<Stall>lambdaQuery().eq(Stall::getAddress, address));
             Stall one = stallService.getOne(Wrappers.<Stall>lambdaQuery().eq(Stall::getAddress, address));
-            ConsumeDto consumeDto = new ConsumeDto();
+            String name="";
             if (ObjectUtils.isEmpty(one)) {
             if (ObjectUtils.isEmpty(one)) {
-                consumeDto.setName(address);
+                name=address;
+            } else {
+                 name = one.getName();
+            }
+            if (map1.containsKey(name)) {
+                Integer integer = map1.get(name);
+                integer = integer + value;
+                map1.put(name, integer);
             } else {
             } else {
-                consumeDto.setName(one.getName());
+                map1.put(name,value);
             }
             }
+
+        }
+
+        Set<Map.Entry<String, Integer>> map1Entry = map1.entrySet();
+        for (Map.Entry<String, Integer> stringIntegerEntry : map1Entry) {
+            String key = stringIntegerEntry.getKey();
+            Integer value = stringIntegerEntry.getValue();
+            ConsumeDto consumeDto = new ConsumeDto();
+            consumeDto.setName(key);
             consumeDto.setCount(value);
             consumeDto.setCount(value);
             consumeDtos.add(consumeDto);
             consumeDtos.add(consumeDto);
         }
         }
+
 //        String jsonStr = null;
 //        String jsonStr = null;
 //        try {
 //        try {
 //            jsonStr = objectMapper.writeValueAsString(consumeDtos);	//areaList序列化为json字符串
 //            jsonStr = objectMapper.writeValueAsString(consumeDtos);	//areaList序列化为json字符串
@@ -469,7 +559,7 @@ public class ConsumeServicelmpl extends ServiceImpl<ConsumeMapper, Consume> impl
         return tokenConfig.getToken();
         return tokenConfig.getToken();
     }
     }
 
 
-    //    @Scheduled(cron = "0 0/2 * * * ? ")
+//        @Scheduled(cron = "0 0/2 * * * ? ")
     @Scheduled(cron = "0 0 0/2 * * ? ")
     @Scheduled(cron = "0 0 0/2 * * ? ")
     public void autoQueryOrder() {
     public void autoQueryOrder() {
 
 
@@ -502,12 +592,15 @@ public class ConsumeServicelmpl extends ServiceImpl<ConsumeMapper, Consume> impl
         String data = jsonObj.getString("data");
         String data = jsonObj.getString("data");
         JSONObject jsonData = JSONObject.parseObject(data);
         JSONObject jsonData = JSONObject.parseObject(data);
         if (jsonData.getJSONArray("list") != null) {
         if (jsonData.getJSONArray("list") != null) {
+
             JSONArray list = jsonData.getJSONArray("list");
             JSONArray list = jsonData.getJSONArray("list");
+            LogUtils.logInfo("获取食堂消费:");
             ObjectMapper mapper = new ObjectMapper();
             ObjectMapper mapper = new ObjectMapper();
-            list.forEach(array -> {
+            list.stream().forEach(array -> {
                 try {
                 try {
                     Map<String, Object> jsonMap = mapper.readValue(JSONObject.toJSON(array).toString(), new TypeReference<Map<String, Object>>() {
                     Map<String, Object> jsonMap = mapper.readValue(JSONObject.toJSON(array).toString(), new TypeReference<Map<String, Object>>() {
                     });
                     });
+                    System.out.println("jsonMap = " + jsonMap);
                     Consume consume = new Consume();
                     Consume consume = new Consume();
                     String idCard = jsonMap.get("user_no").toString();
                     String idCard = jsonMap.get("user_no").toString();
 //                    通过身份证号,查询该身份证号对应的id
 //                    通过身份证号,查询该身份证号对应的id
@@ -574,6 +667,120 @@ public class ConsumeServicelmpl extends ServiceImpl<ConsumeMapper, Consume> impl
         return end.format(pattern);
         return end.format(pattern);
     }
     }
 
 
+    /**
+     * 获取食堂二楼消费数据
+     * @param sdate
+     * @param edate
+     */
+    public void bankApi(String sdate, String edate) {
+
+        long time = new Date().getTime() / 1000;
+        String timeStr = String.valueOf(time);
+
+        // 设置请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("Content-Type", "application/x-www-form-urlencoded");
+// 设置请求参数
+        MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
+        postParameters.set("scr_id", "860144243");
+        postParameters.set("sdate", sdate);
+        postParameters.set("edate", edate);
+//        不填默认所有
+//        postParameters.set("tml_no","");
+        postParameters.set("timestamp", timeStr);
+        postParameters.set("rand_str", "579cedbed8976fb816711f317b6qwerq");
+//        将密码进行sha1加密
+        String passSha1 = DigestUtils.sha1Hex("chkj123456");
+//        在进行md5加密
+        String md5 = Md5Utils.md5One(passSha1);
+//         签名
+        String sign = "edate=" + edate + "&pass=" + md5 + "&rand_str=579cedbed8976fb816711f317b6qwerq&scr_id=860144243&sdate=" + sdate + "&timestamp=" + timeStr;
+        System.out.println("sign = " + sign);
+//         将签名进行sha1加密
+        sign = DigestUtils.sha1Hex(sign);
+        System.out.println("sign = " + sign);
+//        在进行md5加密
+        sign = Md5Utils.md5One(sign);
+        System.out.println("sign = " + sign);
+        postParameters.set("sign", sign);
+
+        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(postParameters, headers);
+        String url = "https://sa.kelaihui.cn/order/bill";
+        RestTemplate restTemplate = new RestTemplate();
+        ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity(url, httpEntity, String.class);
+        String body = stringResponseEntity.getBody();
+        String[] bodys = body.split("\n");
+
+        ArrayList<SecondFloorCanteen> canteens = new ArrayList<>();
+        for (int i = 1; i < bodys.length; i++) {
+            SecondFloorCanteen secondFloorCanteen = new SecondFloorCanteen();
+//            去空格
+            String s = bodys[i].replaceAll("\t", "");
+            String[] split = s.split(",");
+
+//            订单号
+            String orderNumber = split[0];
+            secondFloorCanteen.setOrderId(orderNumber);
+
+//            窗口号
+            String windowNumber = split[9];
+            secondFloorCanteen.setWindowNumber(windowNumber);
+
+//            实际金额
+            String paymentAmount = split[11];
+            secondFloorCanteen.setPaymentAmount(Double.parseDouble(paymentAmount));
+
+//            支付时间
+            String timePayment = split[14];
+            secondFloorCanteen.setTimePayment(timePayment);
+
+//            支付状态
+            String statePayment = split[15];
+            secondFloorCanteen.setStatePayment(statePayment);
+
+//            支付渠道
+            String modePayment = split[17];
+            secondFloorCanteen.setModePayment(modePayment);
+//1  订单号//2  上游订单号//3  姓名//4  学工号//5  部门//6  商户编号//7  商户名称//8  门店名称//9  终端编号//10  窗口号//11  原始金额(元)//12  实际金额(元)//13  终端支付时间//14  交易时间//15 支付时间//16  支付状态//17  交易类型//18  支付渠道//              19  备注
+
+            //通过判断订单号是否有添加
+            long count = secondFloorCanteenService.count(Wrappers.<SecondFloorCanteen>lambdaQuery().eq(SecondFloorCanteen::getOrderId, orderNumber));
+            if (count<=0) {
+                secondFloorCanteenService.save(secondFloorCanteen);
+            }
 
 
+        }
+
+
+
+    }
+
+    @Scheduled(cron = "0 0 15 * * ? ")
+    //        @Scheduled(cron = "0 0/2 * * * ? ")
+    public void test() {
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        LocalDate localDate = LocalDate.now();
+        LocalDate localDateYesterDay = localDate.minusDays(1);
+        String yesterDay = localDateYesterDay.format(dateTimeFormatter);
+        bankApi(yesterDay,yesterDay);
+    }
+
+
+    public static void main(String[] args) {
+//        String testStr = "edate=2023-05-21&pass=89b0e976e32b81f60b03abb1278f858a&rand_str=579cedbed8976fb816711f317b6wwerq&scr_id=860144243&sdate=2023-04-21&timestamp=1685086218186";
+//        String mySignature = DigestUtils.sha1Hex(testStr);
+//        System.out.println("mySignature = " + mySignature);
+//        String md5 = Md5Utils.md5One(mySignature);
+//        System.out.println("md5 = " + md5);
+//        String startTime="2023-06-06 00:00:00";
+//        String endTime="2023-06-07 00:00:00";
+//        DateTimeFormatter pattern2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+//        LocalDate now = LocalDate.now();
+//        now=now.minusDays(1);
+//        String format = now.format(dateTimeFormatter);
+//        System.out.println("format = " + format);
+
+
+    }
 
 
 }
 }

+ 213 - 0
src/main/java/com/chuanghai/student_portrait/service/impl/DormRxServiceImpl.java

@@ -0,0 +1,213 @@
+package com.chuanghai.student_portrait.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chuanghai.student_portrait.entity.ColdWater;
+import com.chuanghai.student_portrait.entity.DormRx;
+import com.chuanghai.student_portrait.entity.Electricity;
+import com.chuanghai.student_portrait.mapper.DormRxMapper;
+import com.chuanghai.student_portrait.service.ColdWaterService;
+import com.chuanghai.student_portrait.service.DormRxService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class DormRxServiceImpl extends ServiceImpl<DormRxMapper, DormRx> implements DormRxService {
+
+
+    @Autowired
+    ElectricityServiceImpl electricityService;
+
+    @Autowired
+    ColdWaterServiceImpl coldWaterService;
+
+
+    //完善瑞信房间表
+    public void saveDormRx() {
+        String url = "http://172.16.20.87/api/wechat/main/addrQuery";
+        RestTemplate restTemplate = new RestTemplate();
+        ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
+        String body = forEntity.getBody();
+        JSONObject jsonObject = JSONObject.parseObject(body);
+        String ifSuccess = jsonObject.getString("ifSuccess");
+        ArrayList<DormRx> dormRxes = new ArrayList<>();
+        if ("Y".equals(ifSuccess)) {
+            JSONArray addrObj = jsonObject.getJSONArray("addrObj");
+            for (int i = 8; i < addrObj.size(); i++) {
+                JSONObject jsonObject1 = addrObj.getJSONObject(i);
+                String addrId = jsonObject1.getString("addrId");
+                String addrNum = jsonObject1.getString("addrNum");
+                String substring1 = addrNum.substring(1, 3);
+                String build = substring1 + "栋";
+                String floors = addrNum.substring(5, 6) + "层";
+                String substring2 = addrNum.substring(4, addrNum.length());
+                String dorm = substring1 + substring2;
+
+                DormRx dormRx = new DormRx();
+                dormRx.setBuild(build);
+                dormRx.setDom(dorm);
+                dormRx.setFloors(floors);
+                dormRx.setAddrId(addrId);
+                dormRxes.add(dormRx);
+
+            }
+            boolean save = saveBatch(dormRxes);
+
+        }
+
+
+    }
+
+    //  获取瑞信上个月的电费
+    @Scheduled(cron = "0 0 0 1 * ? ")
+    public void electricitie() {
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime start = now.minusMonths(1).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
+        LocalDateTime end = now.withDayOfMonth(1).minusDays(1).withHour(23).withMinute(59).withSecond(59);
+        String startTime = start.format(dateTimeFormatter);
+        String endTime = end.format(dateTimeFormatter);
+
+        List<DormRx> list = this.list();
+
+        ArrayList<Electricity> electricities = new ArrayList<>();
+        for (DormRx dormRx : list) {
+            String addrId = dormRx.getAddrId();
+            String dom = dormRx.getDom();
+            String url = "http://172.16.20.87/api/wechat/main/roomCostRecord?roomId=" + addrId + "&beginTime=" + startTime + "&endTime=" + endTime + "&pageNumber=1&pageSize=100&dataType=2&costType=0";
+            RestTemplate restTemplate = new RestTemplate();
+            ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
+            String body = forEntity.getBody();
+            JSONObject jsonObject = JSONObject.parseObject(body);
+            String ifSuccess = jsonObject.getString("ifSuccess");
+            if ("Y".equals(ifSuccess)) {
+                JSONArray addrObj = jsonObject.getJSONArray("costObj");
+                if (ObjectUtils.isNotEmpty(addrObj)&&addrObj.size()>0) {
+                    for (int i = 0; i < addrObj.size(); i++) {
+                        JSONObject jsonObject1 = addrObj.getJSONObject(i);
+                        String costTime = jsonObject1.getString("costTime");
+                        String costTotal = jsonObject1.getString("costTotal");
+                        String consumeTotal = jsonObject1.getString("consumeTotal");
+
+                        Double totalMoney = Double.valueOf(costTotal);
+                        Double totalPower = Double.valueOf(consumeTotal);
+                        BigDecimal bg = new BigDecimal(totalMoney);
+                        BigDecimal bg2 = new BigDecimal(totalPower);
+                        double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                        double f2 = bg2.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+
+                        Electricity electricity = new Electricity();
+                        electricity.setDom(dom);
+                        electricity.setDateTime(costTime);
+                        electricity.setTotalMoney(f1);
+                        electricity.setTotalPower(f2);
+                        electricities.add(electricity);
+
+                    }
+                }
+            }
+
+        }
+        DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM");
+        String format = end.format(dateTimeFormatter2);
+
+        Boolean aBoolean = electricityService.chackElectricityActiveDateTime(format);
+        if (!aBoolean) {
+            electricityService.saveBatch(electricities);
+        }
+
+    }
+
+
+    /**
+     * 瑞信上月水费
+     */
+    @Scheduled(cron = "0 0 1 1 * ? ")
+    public void coldWater() {
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime start = now.minusMonths(1).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
+        LocalDateTime end = now.withDayOfMonth(1).minusDays(1).withHour(23).withMinute(59).withSecond(59);
+        String startTime = start.format(dateTimeFormatter);
+        String endTime = end.format(dateTimeFormatter);
+
+        List<DormRx> list = this.list();
+
+        ArrayList<ColdWater> coldWaters = new ArrayList<>();
+        for (DormRx dormRx : list) {
+            String addrId = dormRx.getAddrId();
+            String dom = dormRx.getDom();
+            String url = "http://172.16.20.87/api/wechat/main/roomCostRecord?roomId=" + addrId + "&beginTime=" + startTime + "&endTime=" + endTime + "&pageNumber=1&pageSize=100&dataType=2&costType=1";
+            RestTemplate restTemplate = new RestTemplate();
+            ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
+            String body = forEntity.getBody();
+            JSONObject jsonObject = JSONObject.parseObject(body);
+            String ifSuccess = jsonObject.getString("ifSuccess");
+            if ("Y".equals(ifSuccess)) {
+                JSONArray addrObj = jsonObject.getJSONArray("costObj");
+                if (ObjectUtils.isNotEmpty(addrObj)&&addrObj.size()>0) {
+                    for (int i = 0; i < addrObj.size(); i++) {
+                        JSONObject jsonObject1 = addrObj.getJSONObject(i);
+                        String costTime = jsonObject1.getString("costTime");
+                        String costTotal = jsonObject1.getString("costTotal");
+                        String consumeTotal = jsonObject1.getString("consumeTotal");
+
+                        Double totalMoney = Double.valueOf(costTotal);
+                        Double totalPower = Double.valueOf(consumeTotal);
+                        BigDecimal bg = new BigDecimal(totalMoney);
+                        BigDecimal bg2 = new BigDecimal(totalPower);
+                        double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+                        double f2 = bg2.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+
+                        ColdWater coldWater = new ColdWater();
+                        coldWater.setDom(dom);
+                        coldWater.setDataTime(costTime);
+                        coldWater.setTotalMoney(f1);
+                        coldWater.setTotalPower(f2);
+                        coldWaters.add(coldWater);
+
+                    }
+                }
+            }
+
+        }
+        DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM");
+        String format = end.format(dateTimeFormatter2);
+
+        Boolean aBoolean = coldWaterService.chackColdWaterActiveDateTime(format);
+        if (!aBoolean) {
+            coldWaterService.saveBatch(coldWaters);
+        }
+
+    }
+
+
+
+
+    public static void main(String[] args) {
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM");
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime start = now.minusMonths(1).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
+        LocalDateTime end = now.withDayOfMonth(1).minusDays(1).withHour(23).withMinute(59).withSecond(59);
+        String startTime = start.format(dateTimeFormatter);
+        System.out.println("startTime = " + startTime);
+        String endTime = end.format(dateTimeFormatter);
+        System.out.println("endTime = " + endTime);
+
+        System.out.println(start.format(dateTimeFormatter2));
+    }
+
+
+}

+ 1 - 0
src/main/java/com/chuanghai/student_portrait/service/impl/DormServiceImpl.java

@@ -11,6 +11,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.client.RestTemplate;

+ 17 - 4
src/main/java/com/chuanghai/student_portrait/service/impl/ElectricityServiceImpl.java

@@ -39,8 +39,7 @@ public class ElectricityServiceImpl extends ServiceImpl<ElectricityMapper, Elect
     @Autowired
     @Autowired
     private DormService dormService;
     private DormService dormService;
 
 
-    @Autowired
-    ColdWaterService coldWaterService;
+
 
 
     private static String url = "http://192.168.1.34:8080/HotWaters/elMonthlist.action";
     private static String url = "http://192.168.1.34:8080/HotWaters/elMonthlist.action";
 
 
@@ -58,8 +57,8 @@ public class ElectricityServiceImpl extends ServiceImpl<ElectricityMapper, Elect
 
 
 
 
 
 
-//    @Scheduled(cron = "0/20 * * 1 * ?")
-    @Scheduled(cron = "0 0/1 * * * ? ")
+    @Scheduled(cron = "0 0/3 0 1 * ? ")
+//    @Scheduled(cron = "0 0/1 * * * ? ")
     public void autoQueryOrder() {
     public void autoQueryOrder() {
         Page<Dorm> dormPage = dormService.page(new Page<Dorm>(page, size));
         Page<Dorm> dormPage = dormService.page(new Page<Dorm>(page, size));
         List<Dorm> records = dormPage.getRecords();
         List<Dorm> records = dormPage.getRecords();
@@ -158,5 +157,19 @@ public class ElectricityServiceImpl extends ServiceImpl<ElectricityMapper, Elect
 
 
     }
     }
 
 
+    /**
+     * 通过宿舍号和时间判断该数据是否已添加
+     *
+     * @param dateTime
+     * @return
+     */
+    public Boolean chackElectricityActiveDateTime(String dateTime) {
+        LambdaQueryWrapper<Electricity> query = new LambdaQueryWrapper<>();
+        query.eq(Electricity::getDateTime, dateTime);
+        boolean exists = this.getBaseMapper().exists(query);
+        return exists;
+
+    }
+
 
 
 }
 }

+ 476 - 86
src/main/java/com/chuanghai/student_portrait/service/impl/FaceDiscernServiceImpl.java

@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.chuanghai.student_portrait.config.ChannelDetailInfos;
 import com.chuanghai.student_portrait.config.ChannelDetailInfos;
 import com.chuanghai.student_portrait.config.FacePassRecord;
 import com.chuanghai.student_portrait.config.FacePassRecord;
+import com.chuanghai.student_portrait.config.JedisUtil;
+import com.chuanghai.student_portrait.config.SubscriptionConfig;
 import com.chuanghai.student_portrait.entity.*;
 import com.chuanghai.student_portrait.entity.*;
 import com.chuanghai.student_portrait.entity.dto.AccessCountDto;
 import com.chuanghai.student_portrait.entity.dto.AccessCountDto;
 import com.chuanghai.student_portrait.entity.dto.FaceDisernDto;
 import com.chuanghai.student_portrait.entity.dto.FaceDisernDto;
@@ -17,18 +19,26 @@ import com.chuanghai.student_portrait.response.BaseResponse;
 import com.chuanghai.student_portrait.response.enums.StatusEnum;
 import com.chuanghai.student_portrait.response.enums.StatusEnum;
 import com.chuanghai.student_portrait.service.*;
 import com.chuanghai.student_portrait.service.*;
 import com.chuanghai.student_portrait.utils.*;
 import com.chuanghai.student_portrait.utils.*;
+import com.chuanghai.student_portrait.utils.vo.SubscribePersonCondition;
+import com.chuanghai.student_portrait.utils.vo.SubscriptionVo;
 import com.chuanghai.student_portrait.utils.vo.UniviewVO;
 import com.chuanghai.student_portrait.utils.vo.UniviewVO;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.*;
 import org.springframework.http.*;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.client.RestTemplate;
 
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.text.SimpleDateFormat;
 import java.time.*;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.*;
@@ -40,6 +50,7 @@ import java.util.*;
  * @Version 1.0
  * @Version 1.0
  */
  */
 @Service
 @Service
+@Slf4j
 public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceDiscern> implements FaceDiscernService {
 public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceDiscern> implements FaceDiscernService {
 
 
     @Autowired
     @Autowired
@@ -204,6 +215,7 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
             jsonStr = objectMapper.writeValueAsString(accessCountDtos);    //areaList序列化为json字符串
             jsonStr = objectMapper.writeValueAsString(accessCountDtos);    //areaList序列化为json字符串
         } catch (JsonProcessingException e) {
         } catch (JsonProcessingException e) {
             e.printStackTrace();
             e.printStackTrace();
+            LogUtils.logError(e);
         }
         }
         jedisUtil.setnx("unitAccessCount" + id, jsonStr);
         jedisUtil.setnx("unitAccessCount" + id, jsonStr);
         return BaseResponse.ok(StatusEnum.SUCCESS, accessCountDtos);
         return BaseResponse.ok(StatusEnum.SUCCESS, accessCountDtos);
@@ -233,14 +245,14 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
         }
         }
         DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LocalDateTime now = LocalDateTime.now();
         LocalDateTime now = LocalDateTime.now();
-//        前七天
-        String oldDay = now.minusDays(7).withHour(0).withMinute(0).withSecond(0).format(pattern);
-//        今天凌晨
-        String nowDay = now.withHour(0).withMinute(0).withSecond(0).format(pattern);
+////        前七天
+//        String oldDay = now.minusDays(7).withHour(0).withMinute(0).withSecond(0).format(pattern);
+////        今天凌晨
+//        String nowDay = now.withHour(0).withMinute(0).withSecond(0).format(pattern);
 
 
         ArrayList<PersonalTrackDto> personalTrackDtos = new ArrayList<>();
         ArrayList<PersonalTrackDto> personalTrackDtos = new ArrayList<>();
 //        获取人脸轨迹
 //        获取人脸轨迹
-        List<FaceDiscern> list = this.list(Wrappers.<FaceDiscern>lambdaQuery().between(FaceDiscern::getFacediscernTime, oldDay, nowDay).eq(FaceDiscern::getShooluserId, id));
+        List<FaceDiscern> list = this.list(Wrappers.<FaceDiscern>lambdaQuery()/*.between(FaceDiscern::getFacediscernTime, oldDay, nowDay)*/.eq(FaceDiscern::getShooluserId, id));
         if (ObjectUtils.isNotEmpty(list) && list.size() > 0) {
         if (ObjectUtils.isNotEmpty(list) && list.size() > 0) {
             for (FaceDiscern faceDiscern : list) {
             for (FaceDiscern faceDiscern : list) {
                 PersonalTrackDto dto = new PersonalTrackDto();
                 PersonalTrackDto dto = new PersonalTrackDto();
@@ -270,7 +282,7 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
                 personalTrackDtos.add(dto);
                 personalTrackDtos.add(dto);
             }
             }
         }
         }
-        List<Access> accessList = accessService.list(Wrappers.<Access>lambdaQuery().between(Access::getAccessTime, oldDay, nowDay).eq(Access::getCardNumber, id));
+        List<Access> accessList = accessService.list(Wrappers.<Access>lambdaQuery()/*.between(Access::getAccessTime, oldDay, nowDay)*/.eq(Access::getCardNumber, id));
         if (ObjectUtils.isNotEmpty(accessList) && accessList.size() > 0) {
         if (ObjectUtils.isNotEmpty(accessList) && accessList.size() > 0) {
             for (Access access : accessList) {
             for (Access access : accessList) {
                 PersonalTrackDto dto = new PersonalTrackDto();
                 PersonalTrackDto dto = new PersonalTrackDto();
@@ -292,7 +304,7 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
                 personalTrackDtos.add(dto);
                 personalTrackDtos.add(dto);
             }
             }
         }
         }
-        List<HotWater> hotWaterList = hotWaterService.list(Wrappers.<HotWater>lambdaQuery().between(HotWater::getHotwaterTime, oldDay, nowDay).eq(HotWater::getCardNumber, id));
+        List<HotWater> hotWaterList = hotWaterService.list(Wrappers.<HotWater>lambdaQuery()/*.between(HotWater::getHotwaterTime, oldDay, nowDay)*/.eq(HotWater::getCardNumber, id));
         if (ObjectUtils.isNotEmpty(hotWaterList) && hotWaterList.size() > 0) {
         if (ObjectUtils.isNotEmpty(hotWaterList) && hotWaterList.size() > 0) {
             for (HotWater hotWater : hotWaterList) {
             for (HotWater hotWater : hotWaterList) {
                 PersonalTrackDto dto = new PersonalTrackDto();
                 PersonalTrackDto dto = new PersonalTrackDto();
@@ -316,7 +328,7 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
                 personalTrackDtos.add(dto);
                 personalTrackDtos.add(dto);
             }
             }
         }
         }
-        List<Consume> consumeList = consumeService.list(Wrappers.<Consume>lambdaQuery().between(Consume::getConsumeTime, oldDay, nowDay).eq(Consume::getIdCard, id));
+        List<Consume> consumeList = consumeService.list(Wrappers.<Consume>lambdaQuery()/*.between(Consume::getConsumeTime, oldDay, nowDay)*/.eq(Consume::getIdCard, id));
         if (ObjectUtils.isNotEmpty(consumeList) && consumeList.size() > 0) {
         if (ObjectUtils.isNotEmpty(consumeList) && consumeList.size() > 0) {
             for (Consume consume : consumeList) {
             for (Consume consume : consumeList) {
                 PersonalTrackDto dto = new PersonalTrackDto();
                 PersonalTrackDto dto = new PersonalTrackDto();
@@ -382,11 +394,11 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
         List<FaceDisernDto> dtoList = baseMapper.getStudentCount(startTime, endTime);
         List<FaceDisernDto> dtoList = baseMapper.getStudentCount(startTime, endTime);
         ArrayList<FaceDisernDto> faceDisernDtos = new ArrayList<>();
         ArrayList<FaceDisernDto> faceDisernDtos = new ArrayList<>();
         for (int i = 0; i <= 9; i++) {
         for (int i = 0; i <= 9; i++) {
-            if (i<dtoList.size()) {
+            if (i < dtoList.size()) {
                 faceDisernDtos.add(dtoList.get(i));
                 faceDisernDtos.add(dtoList.get(i));
-            }else {
+            } else {
                 FaceDisernDto faceDisernDto = new FaceDisernDto();
                 FaceDisernDto faceDisernDto = new FaceDisernDto();
-                faceDisernDto.setSchoolUserID(i+3+"");
+                faceDisernDto.setSchoolUserID(i + 3 + "");
                 faceDisernDtos.add(faceDisernDto);
                 faceDisernDtos.add(faceDisernDto);
             }
             }
 
 
@@ -402,13 +414,13 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
      */
      */
     @Override
     @Override
     public BaseResponse repetitionCoordinate(String id) {
     public BaseResponse repetitionCoordinate(String id) {
-            ObjectMapper objectMapper = new ObjectMapper();
-            //        redis 缓存
-            if (jedisUtil.exists("repetitionCoordinate"+id)) {
-                String address = jedisUtil.get("repetitionCoordinate"+id);
-                List<Map> list = JSON.parseArray(address, Map.class);
-                return BaseResponse.ok(StatusEnum.SUCCESS, list);
-            }
+        ObjectMapper objectMapper = new ObjectMapper();
+        //        redis 缓存
+        if (jedisUtil.exists("repetitionCoordinate" + id)) {
+            String address = jedisUtil.get("repetitionCoordinate" + id);
+            List<Map> list = JSON.parseArray(address, Map.class);
+            return BaseResponse.ok(StatusEnum.SUCCESS, list);
+        }
         if (ObjectUtils.isEmpty(id)) {
         if (ObjectUtils.isEmpty(id)) {
             return BaseResponse.error(StatusEnum.FAIL, "参数异常");
             return BaseResponse.error(StatusEnum.FAIL, "参数异常");
         }
         }
@@ -547,53 +559,337 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
             return h.getDateTime();
             return h.getDateTime();
         }));
         }));
 //            以相反的顺序排列
 //            以相反的顺序排列
-        Collections.reverse(personalTrackDtos);
+//        Collections.reverse(personalTrackDtos);
+
+        HashMap<String, PersonalTrackDto> coordMap = new HashMap<>();
+        List<Coord> coordList = coordService.list();
+        for (Coord coord : coordList) {
+            String buildingName = coord.getBuildingName();
+            PersonalTrackDto personalTrackDto = new PersonalTrackDto();
+            personalTrackDto.setLatitude(coord.getLatitude());
+            personalTrackDto.setLongitude(coord.getLongitude());
+            String latitude = coord.getLatitude();
+            String longitude = coord.getLongitude();
+            String coordinates = longitude + latitude;
+            switch (coordinates) {
+                case "581493":
+                    personalTrackDto.setTotalName("1#学生公寓");
+                    break;
+                case "590436":
+                    personalTrackDto.setTotalName("2#学生公寓");
+                    break;
+                case "605384":
+                    personalTrackDto.setTotalName("3#学生公寓");
+                    break;
+                case "613333":
+                    personalTrackDto.setTotalName("4#学生公寓");
+                    break;
+                case "677275":
+                    personalTrackDto.setTotalName("5#学生公寓");
+                    break;
+                case "683233":
+                    personalTrackDto.setTotalName("6#学生公寓");
+                    break;
+                case "690188":
+                    personalTrackDto.setTotalName("7#学生公寓");
+                    break;
+                case "701148":
+                    personalTrackDto.setTotalName("8#学生公寓");
+                    break;
+                case "429495":
+                    personalTrackDto.setTotalName("9#学生公寓");
+                    break;
+                case "441441":
+                    personalTrackDto.setTotalName("10#学生公寓");
+                    break;
+                case "466384":
+                    personalTrackDto.setTotalName("11#学生公寓");
+                    break;
+                case "478337":
+                    personalTrackDto.setTotalName("12#学生公寓");
+                    break;
+                case "541276":
+                    personalTrackDto.setTotalName("13#学生公寓");
+                    break;
+                case "554232":
+                    personalTrackDto.setTotalName("14#学生公寓");
+                    break;
+                case "566191":
+                    personalTrackDto.setTotalName("15#学生公寓");
+                    break;
+                case "574151":
+                    personalTrackDto.setTotalName("16#学生公寓");
+                    break;
+                case "132940":
+                    personalTrackDto.setTotalName("礼堂");
+                    break;
+                case "548315":
+                    personalTrackDto.setTotalName("前8栋路口");
+                    break;
+                case "1075983":
+                    personalTrackDto.setTotalName("北校门进口");
+                    break;
+                case "997983":
+                    personalTrackDto.setTotalName("北校门出口");
+                    break;
+                case "354639":
+                    personalTrackDto.setTotalName("食堂");
+                    break;
+                case "641637":
+                    personalTrackDto.setTotalName("学生创就业中心");
+                    break;
+                case "897421":
+                    personalTrackDto.setTotalName("1#教学楼");
+                    break;
+                case "1283875":
+                    personalTrackDto.setTotalName("行政楼");
+                    break;
+                case "811877":
+                    personalTrackDto.setTotalName("科技楼");
+                    break;
+                case "1731013":
+                    personalTrackDto.setTotalName("系办楼路口");
+                    break;
+                case "1296749":
+                    personalTrackDto.setTotalName("系办楼篮球场");
+                    break;
+                default:
+                    personalTrackDto.setTotalName(buildingName);
+                    break;
+            }
+
+            coordMap.put(coordinates, personalTrackDto);
+        }
 
 
-        HashMap<String, List<PersonalTrackDto>> map = new HashMap<>();
+//        更新出现的坐标
+        HashMap<String, PersonalTrackDto> personalTrackDtoMap = new HashMap<>();
         for (PersonalTrackDto personalTrackDto : personalTrackDtos) {
         for (PersonalTrackDto personalTrackDto : personalTrackDtos) {
-            String longitude = personalTrackDto.getLongitude();
+//            String name = personalTrackDto.getName();
             String latitude = personalTrackDto.getLatitude();
             String latitude = personalTrackDto.getLatitude();
-            String s = longitude + "," + latitude;
-            if (map.containsKey(s)) {
-                List<PersonalTrackDto> dtos = map.get(s);
-                dtos.add(personalTrackDto);
+            String longitude = personalTrackDto.getLongitude();
+            personalTrackDtoMap.put(longitude + latitude, personalTrackDto);
+        }
+
+//        所有的
+        Set<String> keySet = coordMap.keySet();
+//        出现的
+        Set<String> personalSet = personalTrackDtoMap.keySet();
+
+        ArrayList<PersonalTrackDto> trackDtoArrayList = new ArrayList<>();
+
+
+//        有一样的坐标需要加一个总坐标
+        for (String name : keySet) {
+            PersonalTrackDto personalTrackDtoOld = coordMap.get(name);
+            if (personalTrackDtoMap.containsKey(name)) {
+                PersonalTrackDto personalTrackDto = personalTrackDtoMap.get(name);
+                personalTrackDto.setTotalName(personalTrackDtoOld.getTotalName());
+                trackDtoArrayList.add(personalTrackDto);
             } else {
             } else {
-                List<PersonalTrackDto> dtos = new ArrayList<>();
-                dtos.add(personalTrackDto);
-                map.put(s, dtos);
+                trackDtoArrayList.add(personalTrackDtoOld);
             }
             }
+
         }
         }
-        ArrayList<Map> mapArrayList = new ArrayList<>();
-        Set<String> strings = map.keySet();
-        for (String string : strings) {
-            HashMap<String, Object> map1 = new HashMap<>();
-            String[] split = string.split(",");
-            String s = split[0];
-            String s1 = split[1];
-            List<Coord> list1 = coordService.list(Wrappers.<Coord>lambdaQuery().eq(Coord::getLongitude, s).eq(Coord::getLatitude, s1));
-            if (ObjectUtils.isNotEmpty(list1)&&list1.size()>0) {
-                Coord coord = list1.get(0);
-                List<PersonalTrackDto> personalTrackDtos1 = map.get(string);
-                map1.put("name",coord.getBuildingName());
-                map1.put("date",personalTrackDtos1);
-                map1.put("longitude",s);
-                map1.put("latitude",s1);
-                mapArrayList.add(map1);
-            }
 
 
+
+//        HashMap<String, List<PersonalTrackDto>> map = new HashMap<>();
+//        for (PersonalTrackDto personalTrackDto : personalTrackDtos) {
+//            String longitude = personalTrackDto.getLongitude();
+//            String latitude = personalTrackDto.getLatitude();
+//            String s = longitude + "," + latitude;
+//            if (map.containsKey(s)) {
+//                List<PersonalTrackDto> dtos = map.get(s);
+//                dtos.add(personalTrackDto);
+//            } else {
+//                List<PersonalTrackDto> dtos = new ArrayList<>();
+//                dtos.add(personalTrackDto);
+//                map.put(s, dtos);
+//            }
+//        }
+//        ArrayList<Map> mapArrayList = new ArrayList<>();
+//        Set<String> strings = map.keySet();
+//        for (String string : strings) {
+//            HashMap<String, Object> map1 = new HashMap<>();
+//            String[] split = string.split(",");
+//            String s = split[0];
+//            String s1 = split[1];
+//            List<Coord> list1 = coordService.list(Wrappers.<Coord>lambdaQuery().eq(Coord::getLongitude, s).eq(Coord::getLatitude, s1));
+//            if (ObjectUtils.isNotEmpty(list1) && list1.size() > 0) {
+//                Coord coord = list1.get(0);
+//                List<PersonalTrackDto> personalTrackDtos1 = map.get(string);
+//                map1.put("name", coord.getBuildingName());
+//                map1.put("date", personalTrackDtos1);
+//                map1.put("longitude", s);
+//                map1.put("latitude", s1);
+//                mapArrayList.add(map1);
+//            }
+//
+//        }
+
+        String jsonStr = null;
+        try {
+            jsonStr = objectMapper.writeValueAsString(trackDtoArrayList);    //areaList序列化为json字符串
+        } catch (JsonProcessingException e) {
+            e.printStackTrace();
+            log.error("重复坐标序列化为json字符串报错");
         }
         }
+        jedisUtil.setnx("repetitionCoordinate" + id, jsonStr);
+
+        return BaseResponse.ok(StatusEnum.SUCCESS, trackDtoArrayList);
+    }
+
 
 
-            String jsonStr = null;
+    /**
+     * 人脸对比上报解析
+     *
+     * @param request
+     * @param response
+     */
+    @Override
+    public void saveFaceContrast(HttpServletRequest request, HttpServletResponse response, String url) {
+        if ("PersonInfo".equals(url)) {
+            LogUtils.logInfo("进入人脸对比预警接口");
+            FaceDiscern faceDiscern = new FaceDiscern();
+//        类型:宇视
+            faceDiscern.setFacediscernType("U");
+//        识别事项
+            faceDiscern.setFacediscernEvent("人脸识别");
             try {
             try {
-                jsonStr = objectMapper.writeValueAsString(mapArrayList);	//areaList序列化为json字符串
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
+                BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
+                StringBuilder responseStrBuilder = new StringBuilder();
+                String inputStr;
+                while ((inputStr = streamReader.readLine()) != null) {
+                    responseStrBuilder.append(inputStr);
+                }
+
+//                人脸对比上报预警
+                JSONObject jsonObject = JSONObject.parseObject(responseStrBuilder.toString());
+                JSONObject personEventInfo = jsonObject.getJSONObject("PersonEventInfo");
+
+//              人员报警信息
+                JSONArray faceInfoList = personEventInfo.getJSONArray("FaceInfoList");
+
+                for (int i = 0; i < faceInfoList.size(); i++) {
+                    JSONObject faceInfoListJSONObject = faceInfoList.getJSONObject(i);
+//                    通道号
+                    String channelID = faceInfoList.getJSONObject(i).get("ChannelID").toString();
+
+//                    过人时间
+                    String passingTime = faceInfoListJSONObject.getString("PassingTime");
+//                    单位秒
+                    Long aLong = Long.valueOf(passingTime);
+                    faceDiscern.setFacediscernTime(new Date(aLong * 1000));
+                    /*
+                人脸通行记录类型。
+                    0:人脸抓拍
+                    1:比对成功告警
+                    2: 比对失败告警
+                     */
+                    String type = faceInfoListJSONObject.getString("Type");
+                    faceDiscern.setFaceRecordType(type);
+//                    通道名称
+                    String channelName = faceInfoListJSONObject.getString("ChannelName");
+                    faceDiscern.setFacediscernAddress(channelName);
+
+                    JSONObject compareInfo = JSONObject.parseObject(faceInfoList.getJSONObject(i).get("CompareInfo").toString());
+
+
+                    //对比信息
+                    JSONObject personInfo = JSONObject.parseObject(compareInfo.getString("PersonInfo"));
+//                    名字
+                    String personName = personInfo.getString("PersonName");
+                    faceDiscern.setName(personName);
+//                    获取证件号
+                    JSONArray identificationList = JSONArray.parseArray(personInfo.getString("IdentificationList"));
+                    for (int j = 0; j < identificationList.size(); j++) {
+                        JSONObject identification = JSONObject.parseObject(identificationList.get(j).toString());
+//                        证件号
+                        String number = identification.getString("Number");
+                        NewSchooluser newSchooluser = newSchooluserService.getOne(Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getIdCard, number));
+                        if (ObjectUtils.isNotEmpty(newSchooluser)) {
+//                    图片
+                            JSONObject snapshotImage = JSONObject.parseObject(compareInfo.getString("SnapshotImage"));
+                            JSONObject bigImage = JSONObject.parseObject(snapshotImage.getString("BigImage"));
+
+//                    获取base64为编码,并下载
+                            String dataBase = "data:image/jpeg;base64," + bigImage.getString("Data");
+
+                            String fileNameWithPath = FileUtil.getFileNameWithPath() + ".jpg";
+                            FileUtil.makeDirs(fileNameWithPath, "/home/nginx/html/image");
+                            String imgFilePath = "/home/nginx/html/image/" + fileNameWithPath;
+                            try {
+                                Base64Utils.GenerateImage(dataBase, imgFilePath);
+                            } catch (IOException e) {
+                                LogUtils.logError("下载图片出问题");
+                            }
+//                            图片
+                            faceDiscern.setPictureScene(fileNameWithPath);
+//                            用户标识
+                            faceDiscern.setShooluserId(newSchooluser.getId());
+//                            SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS" );
+//                            String format = sdf.format(new Date(aLong * 1000));
+                            if (!exists(faceDiscern.getShooluserId(), aLong * 1000)) {
+                                this.save(faceDiscern);
+                            }
+//                            this.save(faceDiscern);
+                        }
+
+                    }
+
+                }
+
+
+            } catch (UnsupportedEncodingException e) {
+                LogUtils.logError("订阅人脸对比上报解析出问题" + e);
+//                e.printStackTrace();
+            } catch (IOException e) {
+                LogUtils.logError("订阅人脸对比上报解析出问题" + e);
+//                e.printStackTrace();
+            } catch (Exception e) {
+                LogUtils.logError("订阅人脸对比上报解析时间出问题" + e);
             }
             }
-            jedisUtil.setnx("repetitionCoordinate"+id, jsonStr);
+        }
 
 
-        return BaseResponse.ok(StatusEnum.SUCCESS, mapArrayList);
     }
     }
 
 
+    @Override
+    public BaseResponse getCoords(String id, String longitude, String latitude) {
+        if (ObjectUtils.isEmpty(id) || ObjectUtils.isEmpty(longitude) || ObjectUtils.isEmpty(latitude)) {
+            return BaseResponse.error(StatusEnum.FAIL, "参数异常");
+        }
+        NewSchooluser byId = newSchooluserService.getById(id);
+        if (ObjectUtils.isEmpty(byId)) {
+            return BaseResponse.error(StatusEnum.FAIL, "该学生不存在");
+        }
+        DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime now = LocalDateTime.now();
+//        前七天
+        String oldDay = now.minusDays(7).withHour(0).withMinute(0).withSecond(0).format(pattern);
+//        今天凌晨
+        String nowDay = now.withHour(0).withMinute(0).withSecond(0).format(pattern);
+        List<Coord> coordList = coordService.list(Wrappers.<Coord>lambdaQuery().select(Coord::getBuildingName).eq(Coord::getLatitude, latitude).eq(Coord::getLongitude, longitude));
+        ArrayList<String> strings = new ArrayList<>();
+        for (Coord coord : coordList) {
+            String buildingName = coord.getBuildingName();
+            strings.add(buildingName);
+        }
+        Object[] objects = strings.toArray();
+        List<FaceDiscern> faceDiscernList = this.list(Wrappers.<FaceDiscern>lambdaQuery().between(FaceDiscern::getFacediscernTime, oldDay, nowDay).eq(FaceDiscern::getShooluserId, id).in(FaceDiscern::getFacediscernAddress, objects));
+        ArrayList<FaceDiscern> faceDiscerns = new ArrayList<>();
+//        将图片地址完善
+        for (int i = 0; i < faceDiscernList.size(); i++) {
+            FaceDiscern faceDiscern = faceDiscernList.get(i);
+            String pictureScene = faceDiscern.getPictureScene();
+            faceDiscern.setPictureScene("https://chtech.ncjti.edu.cn/studentsportrait/dev-img/" + pictureScene);
+            faceDiscerns.add(faceDiscern);
+        }
+
+        Collections.sort(faceDiscerns, Comparator.comparing((h) -> {
+            return h.getFacediscernTime();
+        }));
+        Collections.reverse(faceDiscerns);
+        return BaseResponse.ok(StatusEnum.SUCCESS, faceDiscerns);
+    }
 
 
     //用于记录查询百胜门禁机的页数
     //用于记录查询百胜门禁机的页数
     private Integer page = 20;
     private Integer page = 20;
@@ -603,7 +899,7 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
     private String api_key = "5C78D964F6C534DFA918EAC7854F4529";
     private String api_key = "5C78D964F6C534DFA918EAC7854F4529";
 
 
     //    每2小时就拉取一次
     //    每2小时就拉取一次
-    @Scheduled(cron = "0 0/20 * * * ? ")
+    @Scheduled(cron = "0 0/9 * * * ? ")
     public void autoQueryOnline() {
     public void autoQueryOnline() {
         if (page > 1) {
         if (page > 1) {
             page -= 1;
             page -= 1;
@@ -634,24 +930,40 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
             HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
             HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
             ResponseEntity<String> responseEntity = restTemplate.exchange(getUrl, HttpMethod.GET, requestEntity, String.class);
             ResponseEntity<String> responseEntity = restTemplate.exchange(getUrl, HttpMethod.GET, requestEntity, String.class);
             JSONObject jsonObj = JSON.parseObject(responseEntity.getBody());
             JSONObject jsonObj = JSON.parseObject(responseEntity.getBody());
-            String data = jsonObj.getString("data");
+            if (jsonObj.containsKey("data")) {
+
+                    String data = jsonObj.getString("data");
+
+//            JSONObject dataJson = JSON.parseObject(data);
+                // String total_page = dataJson.getString("total_page");
+                JSONObject jsonData = JSONObject.parseObject(data);
 
 
-            JSONObject dataJson = JSON.parseObject(data);
-            // String total_page = dataJson.getString("total_page");
-            JSONObject jsonData = JSONObject.parseObject(data);
-
-            if (jsonData.getJSONArray("records") != null) {
-                JSONArray list = jsonData.getJSONArray("records");
-                ObjectMapper mapper = new ObjectMapper();
-                list.forEach(array -> {
-                    try {
-                        Map<String, Object> jsonMap = mapper.readValue(JSONObject.toJSON(array).toString(), new TypeReference<Map<String, Object>>() {
-                        });
+                if (jsonData.getJSONArray("records") != null) {
+                    JSONArray list = jsonData.getJSONArray("records");
+
+                    ObjectMapper mapper = new ObjectMapper();
+                    for (int i = 0; i < list.size(); i++) {
+                        JSONObject jsonMap = list.getJSONObject(i);
+//                }
+//                list.forEach(array -> {
+//                            Map<String, Object> jsonMap = null;
+//                            try {
+//                                jsonMap = mapper.readValue(JSONObject.toJSON(array).toString(), new TypeReference<Map<String, Object>>() {
+//                                });
+//                            } catch (JsonProcessingException e) {
+//                                throw new RuntimeException(e);
+//                            }
                         FaceDiscern faceDiscern = new FaceDiscern();
                         FaceDiscern faceDiscern = new FaceDiscern();
                         String deviceName = jsonMap.get("deviceName").toString();
                         String deviceName = jsonMap.get("deviceName").toString();
                         String personName = jsonMap.get("personName").toString();
                         String personName = jsonMap.get("personName").toString();
                         String serverLogTime = jsonMap.get("serverLogTime").toString();
                         String serverLogTime = jsonMap.get("serverLogTime").toString();
                         String devSno = jsonMap.get("dev_sno").toString();
                         String devSno = jsonMap.get("dev_sno").toString();
+                        if (!jsonMap.containsKey("id")) {
+                            log.error("百胜门禁缺少id");
+//                        break;
+                            continue;
+                        }
+
                         String id = jsonMap.get("id").toString();
                         String id = jsonMap.get("id").toString();
                         String workNo = getPersonInfo(Integer.parseInt(id));
                         String workNo = getPersonInfo(Integer.parseInt(id));
                         String captureImg = jsonMap.get("captureImg").toString();
                         String captureImg = jsonMap.get("captureImg").toString();
@@ -663,7 +975,11 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
                             if (ObjectUtils.isNotEmpty(newSchooluser)) {
                             if (ObjectUtils.isNotEmpty(newSchooluser)) {
                                 faceDiscern.setShooluserId(newSchooluser.getId());
                                 faceDiscern.setShooluserId(newSchooluser.getId());
                                 faceDiscern.setFacediscernAddress(deviceName);
                                 faceDiscern.setFacediscernAddress(deviceName);
-                                faceDiscern.setFacediscernTime(DateUtils.stringToDate(serverLogTime));
+                                try {
+                                    faceDiscern.setFacediscernTime(DateUtils.stringToDate(serverLogTime));
+                                } catch (Exception e) {
+                                    throw new RuntimeException(e);
+                                }
                                 faceDiscern.setFacediscernEvent("人脸识别");
                                 faceDiscern.setFacediscernEvent("人脸识别");
                                 faceDiscern.setFacediscernType("Y");
                                 faceDiscern.setFacediscernType("Y");
                                 faceDiscern.setFaceRecordType("1");
                                 faceDiscern.setFaceRecordType("1");
@@ -675,13 +991,13 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
                                 }
                                 }
                             }
                             }
                         }
                         }
-                    } catch (Exception e) {
-                        e.printStackTrace();
                     }
                     }
-                });
+//                );
+                }
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
+            log.error("百胜添加异常");
             return ReturnValueUtil.faceFiled();
             return ReturnValueUtil.faceFiled();
         }
         }
         return ReturnValueUtil.faceSuccess();
         return ReturnValueUtil.faceSuccess();
@@ -734,6 +1050,7 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
 
 
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
+            log.error("百胜添加异常");
         }
         }
         return workNo;
         return workNo;
     }
     }
@@ -754,17 +1071,27 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
         return exists;
         return exists;
     }
     }
 
 
+    public Boolean exists(String cardNumber, Long timeLong) {
+        QueryWrapper<FaceDiscern> wrapper = new QueryWrapper<>();
+        int time = 1000 * 60;
+        Date before = new Date(timeLong - time);
+        Date after = new Date(timeLong + time);
+        wrapper.eq("shooluser_id", cardNumber).between("faceDiscern_time", before, after);
+        boolean exists = this.getBaseMapper().exists(wrapper);
+        return exists;
+    }
 
 
     /**
     /**
      * 2小时拉取一次宇视人脸识别记录
      * 2小时拉取一次宇视人脸识别记录
      */
      */
-    @Scheduled(cron = "0 0/10 * * * ? ")
+//    @Scheduled(cron = "0 0/6 * * * ? ")
+//    @Async("myAsync")
     public void autoQueryOrder() {
     public void autoQueryOrder() {
         try {
         try {
             DateUtils dateUtils = new DateUtils();
             DateUtils dateUtils = new DateUtils();
             dateUtils.addHours();
             dateUtils.addHours();
-            String yesterdayNow = String.valueOf(Long.parseLong(DateUtils.dateToStamp(dateUtils.getYesterNow())) / 1000);
-            String afterTwoHours = String.valueOf(Long.parseLong(DateUtils.dateToStamp(dateUtils.getAfterTwoHours())) / 1000);
+            String yesterdayNow = String.valueOf(Long.parseLong(DateUtils.dateToStamp(dateUtils.getNow())) / 1000);
+            String afterFiveMinute = String.valueOf(Long.parseLong(DateUtils.dateToStamp(dateUtils.getAfterFiveMinute())) / 1000);
             //获取人脸识别机通道ID
             //获取人脸识别机通道ID
             String channelID = ChannelDetailInfos.channelDetailInfos();
             String channelID = ChannelDetailInfos.channelDetailInfos();
             //人脸识别成功类型
             //人脸识别成功类型
@@ -773,10 +1100,10 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
             map1.put("QryCondition", 1);
             map1.put("QryCondition", 1);
             map1.put("QryData", "1");
             map1.put("QryData", "1");
             //人脸识别失败类型
             //人脸识别失败类型
-            HashMap<String, Object> map2 = new HashMap<>();
-            map2.put("QryType", 57);
-            map2.put("QryCondition", 1);
-            map2.put("QryData", "2");
+//            HashMap<String, Object> map2 = new HashMap<>();
+//            map2.put("QryType", 57);
+//            map2.put("QryCondition", 1);
+//            map2.put("QryData", "2");
             //人脸识别通道ID
             //人脸识别通道ID
             HashMap<String, Object> map3 = new HashMap<>();
             HashMap<String, Object> map3 = new HashMap<>();
             map3.put("QryType", 35);
             map3.put("QryType", 35);
@@ -791,16 +1118,16 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
             HashMap<String, Object> map5 = new HashMap<>();
             HashMap<String, Object> map5 = new HashMap<>();
             map5.put("QryType", 4);
             map5.put("QryType", 4);
             map5.put("QryCondition", 4);
             map5.put("QryCondition", 4);
-            map5.put("QryData", afterTwoHours);
+            map5.put("QryData", afterFiveMinute);
             JSONArray jsonArray = new JSONArray();
             JSONArray jsonArray = new JSONArray();
             jsonArray.add(map1);
             jsonArray.add(map1);
-            jsonArray.add(map2);
+//            jsonArray.add(map2);
             jsonArray.add(map3);
             jsonArray.add(map3);
             jsonArray.add(map4);
             jsonArray.add(map4);
             jsonArray.add(map5);
             jsonArray.add(map5);
 
 
             JSONObject obj = new JSONObject();
             JSONObject obj = new JSONObject();
-            obj.put("Num", 5);
+            obj.put("Num", 4);
             obj.put("QueryInfos", jsonArray);
             obj.put("QueryInfos", jsonArray);
             obj.put("Limit", 32);
             obj.put("Limit", 32);
             obj.put("Offset", 0);
             obj.put("Offset", 0);
@@ -820,8 +1147,46 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
                     FacePassRecord.passRecord(univiewVOList, "POST", jsonString);
                     FacePassRecord.passRecord(univiewVOList, "POST", jsonString);
                 }
                 }
             }
             }
+//        去掉在一分钟内多次出现的
+            HashMap<String, List<UniviewVO>> map = new HashMap<>();
+            ArrayList<UniviewVO> vos = new ArrayList<>();
+            for (UniviewVO univiewVO : univiewVOList) {
+                String cardNumber = univiewVO.getCardNumber();
+                Date activeTime = univiewVO.getActiveTime();
+                if (map.containsKey(cardNumber)) {
+                    List<UniviewVO> univiewVOS = map.get(cardNumber);
+                    for (int i = 0; i < univiewVOS.size(); i++) {
+                        UniviewVO vo = univiewVOS.get(i);
+                        Date time = vo.getActiveTime();
+//                    date转localDateTime
+                        LocalDateTime localDateTime = LocalDateTime.ofInstant(time.toInstant(), ZoneId.systemDefault());
+                        LocalDateTime localDateTime2 = LocalDateTime.ofInstant(activeTime.toInstant(), ZoneId.systemDefault());
+
+                        Duration duration = Duration.between(localDateTime, localDateTime2);
+                        Duration duration2 = Duration.between(localDateTime2, localDateTime);
+                        long minutes = duration.toMillis();
+                        long minutes2 = duration2.toMillis();
+                        if (minutes >= 60000L || minutes2 >= 60000L) {
+                            int size = univiewVOS.size();
+                            if (size == i) {
+                                univiewVOS.add(univiewVO);
+                                vos.add(univiewVO);
+                            }
+                        } else {
+                            break;
+                        }
+                    }
+                } else {
+                    List<UniviewVO> univiewVOS = new ArrayList<>();
+                    univiewVOS.add(univiewVO);
+                    map.put(cardNumber, univiewVOS);
+                    vos.add(univiewVO);
+                }
+            }
+
+
+            for (UniviewVO univiewVO : vos) {
 
 
-            univiewVOList.forEach(univiewVO -> {
                 FaceDiscern faceDiscern = new FaceDiscern();
                 FaceDiscern faceDiscern = new FaceDiscern();
                 faceDiscern.setShooluserId(univiewVO.getCardNumber());
                 faceDiscern.setShooluserId(univiewVO.getCardNumber());
                 faceDiscern.setFacediscernEvent(univiewVO.getActiveEvent());
                 faceDiscern.setFacediscernEvent(univiewVO.getActiveEvent());
@@ -830,32 +1195,57 @@ public class FaceDiscernServiceImpl extends ServiceImpl<FaceDiscernMapper, FaceD
                 faceDiscern.setFacediscernType("U");
                 faceDiscern.setFacediscernType("U");
                 faceDiscern.setFaceRecordType(univiewVO.getRecordType());
                 faceDiscern.setFaceRecordType(univiewVO.getRecordType());
                 faceDiscern.setName(univiewVO.getPersonName());
                 faceDiscern.setName(univiewVO.getPersonName());
-                String dataBase = univiewVO.getPictureScene();
+                if (ObjectUtils.isEmpty(faceDiscern.getShooluserId())) {
+                    log.error("宇视缺少人员身份 ");
+                    return;
+                }
 
 
                 NewSchooluser schooluser = newSchooluserService.getOne(Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getStudentNts, faceDiscern.getShooluserId()).or().eq(NewSchooluser::getStudentId, faceDiscern.getShooluserId()).or().eq(NewSchooluser::getIdCard, faceDiscern.getShooluserId()));
                 NewSchooluser schooluser = newSchooluserService.getOne(Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getStudentNts, faceDiscern.getShooluserId()).or().eq(NewSchooluser::getStudentId, faceDiscern.getShooluserId()).or().eq(NewSchooluser::getIdCard, faceDiscern.getShooluserId()));
                 if (schooluser != null) {
                 if (schooluser != null) {
                     faceDiscern.setShooluserId(schooluser.getId());
                     faceDiscern.setShooluserId(schooluser.getId());
                     if (!chackFaceActive(faceDiscern.getShooluserId(), DateUtils.dateToString(univiewVO.getActiveTime()))) {
                     if (!chackFaceActive(faceDiscern.getShooluserId(), DateUtils.dateToString(univiewVO.getActiveTime()))) {
+                        String dataBase = univiewVO.getPictureScene();
                         String fileNameWithPath = FileUtil.getFileNameWithPath() + ".jpg";
                         String fileNameWithPath = FileUtil.getFileNameWithPath() + ".jpg";
                         FileUtil.makeDirs(fileNameWithPath, "/home/nginx/html/image");
                         FileUtil.makeDirs(fileNameWithPath, "/home/nginx/html/image");
                         String imgFilePath = "/home/nginx/html/image/" + fileNameWithPath;
                         String imgFilePath = "/home/nginx/html/image/" + fileNameWithPath;
                         try {
                         try {
                             Base64Utils.GenerateImage(dataBase, imgFilePath);
                             Base64Utils.GenerateImage(dataBase, imgFilePath);
                         } catch (IOException e) {
                         } catch (IOException e) {
+                            e.printStackTrace();
                             throw new RuntimeException(e);
                             throw new RuntimeException(e);
                         }
                         }
                         faceDiscern.setPictureScene(fileNameWithPath);
                         faceDiscern.setPictureScene(fileNameWithPath);
+//                        this.save(faceDiscern);
 
 
-                        this.save(faceDiscern);
                     }
                     }
                 }
                 }
-
-
-            });
+            }
+//            });
         } catch (Exception e) {
         } catch (Exception e) {
+            log.error("宇视人脸异常");
             e.printStackTrace();
             e.printStackTrace();
-
         }
         }
     }
     }
 
 
+
+    //    @Scheduled(cron = "0 0/1 * ? * ? ")
+    public String getSubscription() {
+        log.info("定时订阅人脸对比上报预警");
+        SubscribePersonCondition subscribePersonCondition = new SubscribePersonCondition();
+        subscribePersonCondition.setLibIDNum(0);
+        JSONObject map = new JSONObject();
+        map.put("AddressType", 0);
+        map.put("IPAddress", "192.168.161.100");
+        map.put("Port", 8086);
+        map.put("Duration", 3600);
+        map.put("SubscribePersonCondition", subscribePersonCondition);
+        String jsonString = map.toJSONString();
+        SubscriptionVo subscriptionVo = new SubscriptionVo();
+        SubscriptionVo vo = SubscriptionConfig.subscriptionRecord(subscriptionVo, "POST", jsonString, "/LAPI/V1.0/System/Event/Subscription");
+        String id = vo.getID();
+        return id;
+
+    }
+
+
 }
 }

+ 11 - 10
src/main/java/com/chuanghai/student_portrait/service/impl/HotWaterServiceImpl.java

@@ -18,7 +18,7 @@ import com.chuanghai.student_portrait.response.BaseResponse;
 import com.chuanghai.student_portrait.response.enums.StatusEnum;
 import com.chuanghai.student_portrait.response.enums.StatusEnum;
 import com.chuanghai.student_portrait.service.*;
 import com.chuanghai.student_portrait.service.*;
 import com.chuanghai.student_portrait.utils.DateUtils;
 import com.chuanghai.student_portrait.utils.DateUtils;
-import com.chuanghai.student_portrait.utils.JedisUtil;
+import com.chuanghai.student_portrait.config.JedisUtil;
 import com.chuanghai.student_portrait.utils.LogUtils;
 import com.chuanghai.student_portrait.utils.LogUtils;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.core.type.TypeReference;
@@ -214,14 +214,7 @@ public class HotWaterServiceImpl extends ServiceImpl<HotWaterMapper, HotWater> i
 //        hashMap.put("electricityAndColdWater", map2);
 //        hashMap.put("electricityAndColdWater", map2);
 //        return BaseResponse.ok(StatusEnum.SUCCESS, hashMap);
 //        return BaseResponse.ok(StatusEnum.SUCCESS, hashMap);
 //    }
 //    }
-    public static void main(String[] args) {
 
 
-        Date date = new Date();
-        Date firstMonthDay = getFirstMonthDay(date, 1);
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
-        String format = sdf.format(firstMonthDay);
-        System.out.println("format = " + format);
-    }
 
 
     @Override
     @Override
     public BaseResponse hotWaterEnergy() {
     public BaseResponse hotWaterEnergy() {
@@ -559,6 +552,11 @@ public class HotWaterServiceImpl extends ServiceImpl<HotWaterMapper, HotWater> i
     }
     }
 
 
 
 
+
+
+
+
+
     /**
     /**
      * 用于记录当前获取热水信息的页码
      * 用于记录当前获取热水信息的页码
      */
      */
@@ -702,8 +700,11 @@ public class HotWaterServiceImpl extends ServiceImpl<HotWaterMapper, HotWater> i
         wrapper.eq("id_card", cardNumber)
         wrapper.eq("id_card", cardNumber)
                 .or()
                 .or()
                 .eq("student_id", cardNumber);
                 .eq("student_id", cardNumber);
-        NewSchooluser newSchooluser = newSchooluserService.getOne(wrapper);
-        return newSchooluser;
+        List<NewSchooluser> newSchoolusers = newSchooluserService.list(wrapper);
+        if (ObjectUtils.isNotEmpty(newSchoolusers)) {
+             return newSchoolusers.get(0);
+        }
+        return null;
 
 
     }
     }
 
 

+ 5 - 3
src/main/java/com/chuanghai/student_portrait/service/impl/NewSchooluserServiceImpl.java

@@ -19,7 +19,7 @@ import com.chuanghai.student_portrait.service.AffinityScoreService;
 import com.chuanghai.student_portrait.service.CapacityService;
 import com.chuanghai.student_portrait.service.CapacityService;
 import com.chuanghai.student_portrait.service.FaceDiscernService;
 import com.chuanghai.student_portrait.service.FaceDiscernService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
-import com.chuanghai.student_portrait.utils.JedisUtil;
+import com.chuanghai.student_portrait.config.JedisUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -208,8 +208,10 @@ public class NewSchooluserServiceImpl extends ServiceImpl<NewSchooluserMapper, N
         ArrayList<NewSchooluser> newSchoolusers = new ArrayList<>();
         ArrayList<NewSchooluser> newSchoolusers = new ArrayList<>();
         for (FaceDisernDto faceDisernDto : studentCount) {
         for (FaceDisernDto faceDisernDto : studentCount) {
             String schoolUserID = faceDisernDto.getSchoolUserID();
             String schoolUserID = faceDisernDto.getSchoolUserID();
-            NewSchooluser byId = this.getById(schoolUserID);
-            newSchoolusers.add(byId);
+            NewSchooluser newSchooluser = this.getById(schoolUserID);
+            if (ObjectUtils.isNotEmpty(newSchooluser)) {
+                newSchoolusers.add(newSchooluser);
+            }
         }
         }
         String jsonStr = null;
         String jsonStr = null;
         try {
         try {

+ 3 - 2
src/main/java/com/chuanghai/student_portrait/service/impl/OldSchooluserServiceImpl.java

@@ -10,6 +10,7 @@ import com.chuanghai.student_portrait.mapper.OldSchooluserMapper;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.chuanghai.student_portrait.service.NewSchooluserService;
 import com.chuanghai.student_portrait.service.OldSchooluserService;
 import com.chuanghai.student_portrait.service.OldSchooluserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
@@ -31,7 +32,7 @@ public class OldSchooluserServiceImpl extends ServiceImpl<OldSchooluserMapper, O
 
 
     Integer i = 0;
     Integer i = 0;
 
 
-    //    @Scheduled(cron = "0 0/1 * * * ?")
+//        @Scheduled(cron = "0 0/1 * * * ?")
     public void getSchoolUser() {
     public void getSchoolUser() {
         Page<OldSchooluser> page = this.page(new Page<>(i, 1000));
         Page<OldSchooluser> page = this.page(new Page<>(i, 1000));
         long pages = page.getPages();
         long pages = page.getPages();
@@ -220,7 +221,7 @@ public class OldSchooluserServiceImpl extends ServiceImpl<OldSchooluserMapper, O
      */
      */
     public NewSchooluser queryNewSchoolUser(String idCard) {
     public NewSchooluser queryNewSchoolUser(String idCard) {
         List<NewSchooluser> list = newSchooluserService.list(Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getIdCard, idCard));
         List<NewSchooluser> list = newSchooluserService.list(Wrappers.<NewSchooluser>lambdaQuery().eq(NewSchooluser::getIdCard, idCard));
-        NewSchooluser newSchooluser = new NewSchooluser();
+        NewSchooluser newSchooluser = null;
         if (ObjectUtils.isNotEmpty(list) && list.size() > 0) {
         if (ObjectUtils.isNotEmpty(list) && list.size() > 0) {
             newSchooluser = list.get(0);
             newSchooluser = list.get(0);
         }
         }

+ 11 - 0
src/main/java/com/chuanghai/student_portrait/service/impl/SecondFloorCanteenServiceImpl.java

@@ -0,0 +1,11 @@
+package com.chuanghai.student_portrait.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chuanghai.student_portrait.entity.SecondFloorCanteen;
+import com.chuanghai.student_portrait.mapper.SecondFloorCanteenMapper;
+import com.chuanghai.student_portrait.service.SecondFloorCanteenService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class SecondFloorCanteenServiceImpl extends ServiceImpl<SecondFloorCanteenMapper,SecondFloorCanteen> implements SecondFloorCanteenService {
+}

+ 11 - 0
src/main/java/com/chuanghai/student_portrait/service/impl/SecondFloorShopNameServiceImpl.java

@@ -0,0 +1,11 @@
+package com.chuanghai.student_portrait.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chuanghai.student_portrait.entity.SecondFloorShopName;
+import com.chuanghai.student_portrait.mapper.SecondFloorShopNameMapper;
+import com.chuanghai.student_portrait.service.SecondFloorShopNameService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class SecondFloorShopNameServiceImpl extends ServiceImpl<SecondFloorShopNameMapper,SecondFloorShopName> implements SecondFloorShopNameService {
+}

+ 14 - 2
src/main/java/com/chuanghai/student_portrait/utils/DateUtils.java

@@ -27,7 +27,9 @@ public class DateUtils {
     private String timeNow;
     private String timeNow;
     private String yesterNow;
     private String yesterNow;
     private String afterTwoHours;
     private String afterTwoHours;
+    private String afterFiveMinute;
     private String beforeOneMinutes;
     private String beforeOneMinutes;
+    private String now;
     private Long zero;
     private Long zero;
     private Long six;
     private Long six;
     private Long eighteen;
     private Long eighteen;
@@ -93,6 +95,11 @@ public class DateUtils {
         //前端日期数据由 String转Date
         //前端日期数据由 String转Date
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Calendar calendar = Calendar.getInstance();
         Calendar calendar = Calendar.getInstance();
+         now = sdf.format(calendar.getTime());
+
+//        在当前增加5分钟
+        calendar.add(Calendar.MINUTE,60);
+        afterFiveMinute = sdf.format(calendar.getTime());
 
 
         timeNow = sdf.format(calendar.getTime());
         timeNow = sdf.format(calendar.getTime());
         //在此时间上向前减一天
         //在此时间上向前减一天
@@ -104,6 +111,7 @@ public class DateUtils {
         afterTwoHours = sdf.format(calendar.getTime());
         afterTwoHours = sdf.format(calendar.getTime());
 
 
 
 
+
     }
     }
 
 
 
 
@@ -120,7 +128,7 @@ public class DateUtils {
             Date date = DateUtils.stringToDate(begin_time);
             Date date = DateUtils.stringToDate(begin_time);
             calendar.setTime(date);
             calendar.setTime(date);
             timeNow = sdf.format(calendar.getTime());
             timeNow = sdf.format(calendar.getTime());
-            //在当前增加-1小时
+            //在当前增加-1分钟
             calendar.add(Calendar.MINUTE, -1);
             calendar.add(Calendar.MINUTE, -1);
             beforeOneMinutes = sdf.format(calendar.getTime());
             beforeOneMinutes = sdf.format(calendar.getTime());
         } catch (Exception e) {
         } catch (Exception e) {
@@ -285,7 +293,11 @@ public class DateUtils {
     }
     }
 
 
 
 
-    public static void main(String[] args) {
+    public static void main(String[] args) throws Exception {
+        Date date = stringToDate(1683618627 + "");
+        System.out.println("date = " + date);
+
+
         try {
         try {
 //            DateUtils dateUtils = new DateUtils();
 //            DateUtils dateUtils = new DateUtils();
 //            dateUtils.addOneDay("2022-03-17");
 //            dateUtils.addOneDay("2022-03-17");

+ 59 - 0
src/main/java/com/chuanghai/student_portrait/utils/Imageys.java

@@ -0,0 +1,59 @@
+package com.chuanghai.student_portrait.utils;
+
+import net.coobird.thumbnailator.Thumbnails;
+import org.springframework.stereotype.Service;
+import sun.misc.BASE64Decoder;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import org.apache.commons.codec.binary.Base64;
+import java.io.*;
+
+/*
+   图片压缩
+ */
+
+@Service
+public class Imageys {
+
+    /**
+     * 压缩base64编码至40K以内
+     * @param base64Img
+     * @return
+     */
+    public   String resizeImageTo40K(String base64Img) {
+        try{
+            BASE64Decoder decoder = new BASE64Decoder();
+            byte[] bytes1 = decoder.decodeBuffer(base64Img);
+            InputStream stream = new ByteArrayInputStream(bytes1);
+            BufferedImage src = ImageIO.read(stream);
+//            BufferedImage output = Thumbnails.of(src).size(src.getWidth() / 2, src.getHeight() / 2).asBufferedImage();
+            BufferedImage output = Thumbnails.of(src).size(2000, 2000).asBufferedImage();
+//            BufferedImage output = Thumbnails.of(src).size(680, 680).asBufferedImage();  60k
+//            BufferedImage output = Thumbnails.of(src).size(500, 500).asBufferedImage();  40k
+            String base64 = imageToBase64(output);
+            if (base64.length() - base64.length() / 8 * 2 > 200000) {
+                output = Thumbnails.of(output).scale(1 / (base64.length() / 200000)).asBufferedImage();
+                base64 = imageToBase64(output);
+            }
+            return base64;
+        } catch (Exception e) {
+            return base64Img;
+        }
+    }
+
+    // BufferedImage转换成base64,在这里需要设置图片格式,如下是jpg格式图片:
+    public static String imageToBase64(BufferedImage bufferedImage) {
+        Base64 encoder = new Base64();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        try {
+            ImageIO.write(bufferedImage, "jpg", baos);
+        } catch (IOException e) {
+        }
+        return new String(encoder.encode((baos.toByteArray())));
+    }
+
+
+}

+ 23 - 6
src/main/java/com/chuanghai/student_portrait/utils/JWTUtils.java

@@ -29,10 +29,10 @@ public class JWTUtils {
         // 签发时间
         // 签发时间
         Date iatDate = new Date();
         Date iatDate = new Date();
 
 
-        // 过期时间
-        Calendar nowTime = Calendar.getInstance();
-        nowTime.add(Calendar.DAY_OF_WEEK, 3);
-        Date expiresDate = nowTime.getTime();
+//        // 过期时间
+//        Calendar nowTime = Calendar.getInstance();
+//        nowTime.add(Calendar.DAY_OF_WEEK, 3);
+//        Date expiresDate = nowTime.getTime();
 
 
         Map<String, Object> map = new HashMap<>();
         Map<String, Object> map = new HashMap<>();
         map.put("alg", "HMAC256");
         map.put("alg", "HMAC256");
@@ -41,7 +41,7 @@ public class JWTUtils {
                 .withHeader(map) // header
                 .withHeader(map) // header
                 .withClaim("username", userName) // payload
                 .withClaim("username", userName) // payload
                 .withClaim("password", passWord)
                 .withClaim("password", passWord)
-                .withExpiresAt(expiresDate) // 设置过期时间。过期时间要大于签发时间
+                .withExpiresAt(expiresDate()) // 设置过期时间。过期时间要大于签发时间
                 .withIssuedAt(iatDate) // 设置签发时间
                 .withIssuedAt(iatDate) // 设置签发时间
                 .sign(Algorithm.HMAC256(SIGNATURE)); // 加密
                 .sign(Algorithm.HMAC256(SIGNATURE)); // 加密
 
 
@@ -58,7 +58,13 @@ public class JWTUtils {
 //        return builder.sign(Algorithm.HMAC256(SIGNATURE)).toString();
 //        return builder.sign(Algorithm.HMAC256(SIGNATURE)).toString();
     }
     }
 
 
-
+    public static Date expiresDate(){
+        // 过期时间
+        Calendar nowTime = Calendar.getInstance();
+        nowTime.add(Calendar.DAY_OF_WEEK, 3);
+        Date expiresDate = nowTime.getTime();
+        return expiresDate;
+    }
 
 
 
 
     /**
     /**
@@ -93,4 +99,15 @@ public class JWTUtils {
         return jwt.getClaims();
         return jwt.getClaims();
     }
     }
 
 
+    public static void main(String[] args) {
+        String token = getToken("张三", "123456");
+        System.out.println("token = " + token);
+        Map<String, Claim> stringClaimMap = verifyToken("wewqewqrewrweterfasddstggfffethghfdfsdffffffffffffffffffweedsfsf");
+        System.out.println("stringClaimMap = " + stringClaimMap);
+        String username = stringClaimMap.get("username").asString();
+        System.out.println("username = " + username);
+        String password = stringClaimMap.get("password").asString();
+        System.out.println("password = " + password);
+        System.out.println("stringClaimMap = " + stringClaimMap);
+    }
 }
 }

+ 0 - 2
src/main/java/com/chuanghai/student_portrait/utils/LogUtils.java

@@ -6,9 +6,7 @@ import org.apache.log4j.Logger;
 /**
 /**
  * LogUtils
  * LogUtils
  * 日志输出类
  * 日志输出类
- * @author ScorpioDong
  * @version 1.0
  * @version 1.0
- * @date 2020/3/14 9:48 PM
  */
  */
 public class LogUtils {
 public class LogUtils {
     private static final Logger debugLogger = Logger.getLogger("DEBUG");
     private static final Logger debugLogger = Logger.getLogger("DEBUG");

+ 2 - 0
src/main/java/com/chuanghai/student_portrait/utils/ReturnValueUtil.java

@@ -55,4 +55,6 @@ public class ReturnValueUtil {
         rb.setSuccess(false);
         rb.setSuccess(false);
         return rb;
         return rb;
     }
     }
+
+
 }
 }

+ 50 - 0
src/main/java/com/chuanghai/student_portrait/utils/ReturnWXPush.java

@@ -0,0 +1,50 @@
+package com.chuanghai.student_portrait.utils;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@ToString
+public class ReturnWXPush {
+    /**
+     * 响应代码
+     */
+    private Integer code;
+    /**
+     * 响应消息
+     */
+    private String message;
+
+
+
+
+    /**
+     * 成功:用于微校接口反馈
+     *
+     * @param
+     * @return
+     */
+    public static ReturnWXPush ok() {
+       ReturnWXPush rb = new ReturnWXPush();
+        rb.setCode(0);
+        rb.setMessage("OK");
+        return rb;
+    }
+
+    /**
+     * 成功:用于微校接口反馈
+     *
+     * @param
+     * @return
+     */
+    public static ReturnWXPush fail() {
+        ReturnWXPush rb = new ReturnWXPush();
+        rb.setCode(1);
+        rb.setMessage("fail");
+        return rb;
+    }
+}

+ 8 - 0
src/main/java/com/chuanghai/student_portrait/utils/vo/LibID.java

@@ -0,0 +1,8 @@
+package com.chuanghai.student_portrait.utils.vo;
+
+import lombok.Data;
+
+@Data
+public class LibID {
+    private Integer LibID;
+}

+ 11 - 0
src/main/java/com/chuanghai/student_portrait/utils/vo/SubscribePersonCondition.java

@@ -0,0 +1,11 @@
+package com.chuanghai.student_portrait.utils.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class SubscribePersonCondition {
+    private Integer LibIDNum;
+    private List<LibID> LibIDList;
+}

+ 0 - 2
src/main/java/com/chuanghai/student_portrait/utils/vo/SubscriptionVo.java

@@ -10,6 +10,4 @@ public class SubscriptionVo {
     private String CurrentTime;
     private String CurrentTime;
     private String TerminationTime;
     private String TerminationTime;
 
 
-
-
 }
 }

+ 9 - 4
src/main/resources/application.yml

@@ -4,8 +4,8 @@ server:
 
 
 spring:
 spring:
   profiles:
   profiles:
-#    active: dev #开发环境配置文件
-    active: test  #测试环境配置文件
+    active: dev #开发环境配置文件
+#    active: test  #测试环境配置文件
 #    active: pro  #生产环境配置文件
 #    active: pro  #生产环境配置文件
   application:
   application:
     name: student_portrait
     name: student_portrait
@@ -27,9 +27,11 @@ spring:
       strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
       strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
       datasource:
       datasource:
         mysql1:
         mysql1:
-          url: jdbc:mysql://172.16.20.69:3306/student_portrait?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
           username: root
           username: root
-          password: chuanghai@2022
+          password: chuanghai@2022 #服务器密码
+          url: jdbc:mysql://172.16.20.69:3306/student_portrait?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
+#          password: root #本地密码
+#          url: jdbc:mysql://127.0.0.1:3306/student_portrait?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
           driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
           driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
         mysql2:
         mysql2:
           url: jdbc:mysql://172.16.20.45:3306/smartschool_bigdata?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
           url: jdbc:mysql://172.16.20.45:3306/smartschool_bigdata?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
@@ -113,3 +115,6 @@ decisionEngine:
     nvruname: admin
     nvruname: admin
     nvrpwd: ncjtxy@2021
     nvrpwd: ncjtxy@2021
 
 
+logging:
+  level:
+    com.chuanghai: error

+ 9 - 4
target/classes/application.yml

@@ -4,8 +4,8 @@ server:
 
 
 spring:
 spring:
   profiles:
   profiles:
-#    active: dev #开发环境配置文件
-    active: test  #测试环境配置文件
+    active: dev #开发环境配置文件
+#    active: test  #测试环境配置文件
 #    active: pro  #生产环境配置文件
 #    active: pro  #生产环境配置文件
   application:
   application:
     name: student_portrait
     name: student_portrait
@@ -27,9 +27,11 @@ spring:
       strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
       strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
       datasource:
       datasource:
         mysql1:
         mysql1:
-          url: jdbc:mysql://172.16.20.69:3306/student_portrait?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
           username: root
           username: root
-          password: chuanghai@2022
+          password: chuanghai@2022 #服务器密码
+          url: jdbc:mysql://172.16.20.69:3306/student_portrait?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
+#          password: root #本地密码
+#          url: jdbc:mysql://127.0.0.1:3306/student_portrait?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
           driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
           driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
         mysql2:
         mysql2:
           url: jdbc:mysql://172.16.20.45:3306/smartschool_bigdata?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
           url: jdbc:mysql://172.16.20.45:3306/smartschool_bigdata?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
@@ -113,3 +115,6 @@ decisionEngine:
     nvruname: admin
     nvruname: admin
     nvrpwd: ncjtxy@2021
     nvrpwd: ncjtxy@2021
 
 
+logging:
+  level:
+    com.chuanghai: error

+ 1 - 1
target/maven-archiver/pom.properties

@@ -1,5 +1,5 @@
 #Generated by Maven
 #Generated by Maven
-#Tue Feb 21 11:17:33 CST 2023
+#Wed Sep 27 18:06:42 CST 2023
 version=0.0.1-SNAPSHOT
 version=0.0.1-SNAPSHOT
 groupId=com.chuanghai
 groupId=com.chuanghai
 artifactId=student_portrait
 artifactId=student_portrait

+ 23 - 2
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -1,9 +1,11 @@
 com\chuanghai\student_portrait\service\impl\CollegesInfoServiceImpl.class
 com\chuanghai\student_portrait\service\impl\CollegesInfoServiceImpl.class
 com\chuanghai\student_portrait\controller\GetSchoolUserController$3.class
 com\chuanghai\student_portrait\controller\GetSchoolUserController$3.class
 com\chuanghai\student_portrait\service\HotWaterService.class
 com\chuanghai\student_portrait\service\HotWaterService.class
+com\chuanghai\student_portrait\config\JedisUtil.class
 com\chuanghai\student_portrait\mapper\ColdWaterMapper.class
 com\chuanghai\student_portrait\mapper\ColdWaterMapper.class
 com\chuanghai\student_portrait\utils\ReturnValueUtil.class
 com\chuanghai\student_portrait\utils\ReturnValueUtil.class
 com\chuanghai\student_portrait\mapper\CollegesInfoMapper.class
 com\chuanghai\student_portrait\mapper\CollegesInfoMapper.class
+com\chuanghai\student_portrait\config\ScheduleConfig.class
 com\chuanghai\student_portrait\mapper\ProvinceMapper.class
 com\chuanghai\student_portrait\mapper\ProvinceMapper.class
 com\chuanghai\student_portrait\entity\dto\AccessCountDto.class
 com\chuanghai\student_portrait\entity\dto\AccessCountDto.class
 com\chuanghai\student_portrait\mapper\OldSchooluserMapper.class
 com\chuanghai\student_portrait\mapper\OldSchooluserMapper.class
@@ -14,6 +16,7 @@ com\chuanghai\student_portrait\config\ChannelDetailInfos.class
 com\chuanghai\student_portrait\service\ConsumeService.class
 com\chuanghai\student_portrait\service\ConsumeService.class
 com\chuanghai\student_portrait\utils\ExcelUtil.class
 com\chuanghai\student_portrait\utils\ExcelUtil.class
 com\chuanghai\student_portrait\service\impl\ConsumeServicelmpl$1.class
 com\chuanghai\student_portrait\service\impl\ConsumeServicelmpl$1.class
+com\chuanghai\student_portrait\utils\ReturnWXPush.class
 com\chuanghai\student_portrait\entity\OldSchooluser.class
 com\chuanghai\student_portrait\entity\OldSchooluser.class
 com\chuanghai\student_portrait\config\TokenConfig.class
 com\chuanghai\student_portrait\config\TokenConfig.class
 com\chuanghai\student_portrait\mapper\StructOfPeopleInSchoolMapper.class
 com\chuanghai\student_portrait\mapper\StructOfPeopleInSchoolMapper.class
@@ -22,6 +25,7 @@ com\chuanghai\student_portrait\exception\BaseErrorInfoInterface.class
 com\chuanghai\student_portrait\service\OldSchooluserService.class
 com\chuanghai\student_portrait\service\OldSchooluserService.class
 com\chuanghai\student_portrait\service\impl\AirConditioningServiceImpl.class
 com\chuanghai\student_portrait\service\impl\AirConditioningServiceImpl.class
 com\chuanghai\student_portrait\service\AccessService.class
 com\chuanghai\student_portrait\service\AccessService.class
+com\chuanghai\student_portrait\service\SecondFloorCanteenService.class
 com\chuanghai\student_portrait\utils\HMAC.class
 com\chuanghai\student_portrait\utils\HMAC.class
 com\chuanghai\student_portrait\service\CollegesInfoService.class
 com\chuanghai\student_portrait\service\CollegesInfoService.class
 com\chuanghai\student_portrait\entity\dto\FaceDisernDto.class
 com\chuanghai\student_portrait\entity\dto\FaceDisernDto.class
@@ -36,6 +40,7 @@ com\chuanghai\student_portrait\service\impl\HotWaterServiceImpl.class
 com\chuanghai\student_portrait\mapper\NewSchooluserMapper.class
 com\chuanghai\student_portrait\mapper\NewSchooluserMapper.class
 com\chuanghai\student_portrait\service\impl\AccessServiceImpl.class
 com\chuanghai\student_portrait\service\impl\AccessServiceImpl.class
 com\chuanghai\student_portrait\entity\Stall.class
 com\chuanghai\student_portrait\entity\Stall.class
+com\chuanghai\student_portrait\config\ScheduledTaskConfig.class
 com\chuanghai\student_portrait\service\impl\HotWaterServiceImpl$1.class
 com\chuanghai\student_portrait\service\impl\HotWaterServiceImpl$1.class
 com\chuanghai\student_portrait\mapper\DormMapper.class
 com\chuanghai\student_portrait\mapper\DormMapper.class
 com\chuanghai\student_portrait\service\impl\CapacityServiceImpl.class
 com\chuanghai\student_portrait\service\impl\CapacityServiceImpl.class
@@ -51,10 +56,13 @@ com\chuanghai\student_portrait\entity\dto\PersonConsumDto.class
 com\chuanghai\student_portrait\exception\ResultValue.class
 com\chuanghai\student_portrait\exception\ResultValue.class
 com\chuanghai\student_portrait\mapper\FaceDiscernMapper.class
 com\chuanghai\student_portrait\mapper\FaceDiscernMapper.class
 com\chuanghai\student_portrait\entity\Forewarning.class
 com\chuanghai\student_portrait\entity\Forewarning.class
+com\chuanghai\student_portrait\entity\SecondFloorCanteen.class
+com\chuanghai\student_portrait\mapper\SecondFloorCanteenMapper.class
 com\chuanghai\student_portrait\service\ForewarningService.class
 com\chuanghai\student_portrait\service\ForewarningService.class
+com\chuanghai\student_portrait\service\SecondFloorShopNameService.class
+com\chuanghai\student_portrait\config\SubscriptionConfig$1.class
 com\chuanghai\student_portrait\controller\GetSchoolUserController$1.class
 com\chuanghai\student_portrait\controller\GetSchoolUserController$1.class
 com\chuanghai\student_portrait\exception\BizException.class
 com\chuanghai\student_portrait\exception\BizException.class
-com\chuanghai\student_portrait\service\impl\FaceDiscernServiceImpl$1.class
 com\chuanghai\student_portrait\controller\AffinityScoreController.class
 com\chuanghai\student_portrait\controller\AffinityScoreController.class
 com\chuanghai\student_portrait\service\impl\DormServiceImpl.class
 com\chuanghai\student_portrait\service\impl\DormServiceImpl.class
 com\chuanghai\student_portrait\entity\City.class
 com\chuanghai\student_portrait\entity\City.class
@@ -76,19 +84,23 @@ com\chuanghai\student_portrait\controller\CapacityController.class
 com\chuanghai\student_portrait\service\impl\StructOfPeopleInSchoolServiceImpl.class
 com\chuanghai\student_portrait\service\impl\StructOfPeopleInSchoolServiceImpl.class
 com\chuanghai\student_portrait\exception\GlobalExceptionHandler.class
 com\chuanghai\student_portrait\exception\GlobalExceptionHandler.class
 com\chuanghai\student_portrait\controller\GetSchoolUserController$2.class
 com\chuanghai\student_portrait\controller\GetSchoolUserController$2.class
+com\chuanghai\student_portrait\service\impl\DormRxServiceImpl.class
 com\chuanghai\student_portrait\entity\AirConditioning.class
 com\chuanghai\student_portrait\entity\AirConditioning.class
 com\chuanghai\student_portrait\controller\HotWaterController.class
 com\chuanghai\student_portrait\controller\HotWaterController.class
 com\chuanghai\student_portrait\service\impl\AccessServiceImpl$1.class
 com\chuanghai\student_portrait\service\impl\AccessServiceImpl$1.class
 com\chuanghai\student_portrait\controller\OldSchooluserController.class
 com\chuanghai\student_portrait\controller\OldSchooluserController.class
 com\chuanghai\student_portrait\entity\HotWater.class
 com\chuanghai\student_portrait\entity\HotWater.class
 com\chuanghai\student_portrait\entity\dto\ConsumeTotalMoneyDto.class
 com\chuanghai\student_portrait\entity\dto\ConsumeTotalMoneyDto.class
+com\chuanghai\student_portrait\mapper\SecondFloorShopNameMapper.class
 com\chuanghai\student_portrait\service\FaceDiscernService.class
 com\chuanghai\student_portrait\service\FaceDiscernService.class
 com\chuanghai\student_portrait\utils\DateUtils.class
 com\chuanghai\student_portrait\utils\DateUtils.class
 com\chuanghai\student_portrait\config\FacePassRecord.class
 com\chuanghai\student_portrait\config\FacePassRecord.class
 com\chuanghai\student_portrait\entity\dto\CapacityAllDto.class
 com\chuanghai\student_portrait\entity\dto\CapacityAllDto.class
 com\chuanghai\student_portrait\mapper\CityMapper.class
 com\chuanghai\student_portrait\mapper\CityMapper.class
 com\chuanghai\student_portrait\entity\Coord.class
 com\chuanghai\student_portrait\entity\Coord.class
+com\chuanghai\student_portrait\utils\vo\LibID.class
 com\chuanghai\student_portrait\mapper\HotWaterMapper.class
 com\chuanghai\student_portrait\mapper\HotWaterMapper.class
+com\chuanghai\student_portrait\entity\SecondFloorShopName.class
 com\chuanghai\student_portrait\service\AirConditioningService.class
 com\chuanghai\student_portrait\service\AirConditioningService.class
 com\chuanghai\student_portrait\utils\AES.class
 com\chuanghai\student_portrait\utils\AES.class
 com\chuanghai\student_portrait\entity\ColdWater.class
 com\chuanghai\student_portrait\entity\ColdWater.class
@@ -113,11 +125,12 @@ com\chuanghai\student_portrait\config\RedisConfig.class
 com\chuanghai\student_portrait\service\ProvinceService.class
 com\chuanghai\student_portrait\service\ProvinceService.class
 com\chuanghai\student_portrait\entity\Consume.class
 com\chuanghai\student_portrait\entity\Consume.class
 com\chuanghai\student_portrait\controller\ForeWarningReportFormController.class
 com\chuanghai\student_portrait\controller\ForeWarningReportFormController.class
-com\chuanghai\student_portrait\utils\JedisUtil.class
 com\chuanghai\student_portrait\controller\ReceiveController.class
 com\chuanghai\student_portrait\controller\ReceiveController.class
 com\chuanghai\student_portrait\utils\JWTUtils.class
 com\chuanghai\student_portrait\utils\JWTUtils.class
+com\chuanghai\student_portrait\utils\vo\SubscribePersonCondition.class
 com\chuanghai\student_portrait\entity\StructOfPeopleInSchool.class
 com\chuanghai\student_portrait\entity\StructOfPeopleInSchool.class
 com\chuanghai\student_portrait\entity\AffinityScore.class
 com\chuanghai\student_portrait\entity\AffinityScore.class
+com\chuanghai\student_portrait\entity\DormRx.class
 com\chuanghai\student_portrait\config\PageConfig.class
 com\chuanghai\student_portrait\config\PageConfig.class
 com\chuanghai\student_portrait\utils\LogUtils.class
 com\chuanghai\student_portrait\utils\LogUtils.class
 com\chuanghai\student_portrait\service\LoginService.class
 com\chuanghai\student_portrait\service\LoginService.class
@@ -125,6 +138,7 @@ com\chuanghai\student_portrait\service\impl\DormServiceImpl$3.class
 com\chuanghai\student_portrait\service\impl\ElectricityServiceImpl.class
 com\chuanghai\student_portrait\service\impl\ElectricityServiceImpl.class
 com\chuanghai\student_portrait\entity\Access.class
 com\chuanghai\student_portrait\entity\Access.class
 com\chuanghai\student_portrait\mapper\AirConditioningMapper.class
 com\chuanghai\student_portrait\mapper\AirConditioningMapper.class
+com\chuanghai\student_portrait\config\ScheduleConfig$1.class
 com\chuanghai\student_portrait\service\impl\ForewarningServiceImpl.class
 com\chuanghai\student_portrait\service\impl\ForewarningServiceImpl.class
 com\chuanghai\student_portrait\utils\Md5Utils.class
 com\chuanghai\student_portrait\utils\Md5Utils.class
 com\chuanghai\student_portrait\controller\AirConditioningController.class
 com\chuanghai\student_portrait\controller\AirConditioningController.class
@@ -133,24 +147,31 @@ com\chuanghai\student_portrait\controller\NewSchooluserController.class
 com\chuanghai\student_portrait\entity\dto\ConsumeDto.class
 com\chuanghai\student_portrait\entity\dto\ConsumeDto.class
 com\chuanghai\student_portrait\entity\Equipment.class
 com\chuanghai\student_portrait\entity\Equipment.class
 com\chuanghai\student_portrait\utils\Base64Utils.class
 com\chuanghai\student_portrait\utils\Base64Utils.class
+com\chuanghai\student_portrait\service\impl\SecondFloorShopNameServiceImpl.class
 com\chuanghai\student_portrait\controller\CountController.class
 com\chuanghai\student_portrait\controller\CountController.class
 com\chuanghai\student_portrait\service\impl\ProvinceServiceImpl.class
 com\chuanghai\student_portrait\service\impl\ProvinceServiceImpl.class
+com\chuanghai\student_portrait\mapper\DormRxMapper.class
 com\chuanghai\student_portrait\entity\EventUser.class
 com\chuanghai\student_portrait\entity\EventUser.class
 com\chuanghai\student_portrait\service\impl\LoginServiceImpl.class
 com\chuanghai\student_portrait\service\impl\LoginServiceImpl.class
 com\chuanghai\student_portrait\service\impl\FaceDiscernServiceImpl.class
 com\chuanghai\student_portrait\service\impl\FaceDiscernServiceImpl.class
+com\chuanghai\student_portrait\service\DormRxService.class
 com\chuanghai\student_portrait\entity\Dorm.class
 com\chuanghai\student_portrait\entity\Dorm.class
 com\chuanghai\student_portrait\service\impl\OldSchooluserServiceImpl.class
 com\chuanghai\student_portrait\service\impl\OldSchooluserServiceImpl.class
 com\chuanghai\student_portrait\entity\CollegesInfo.class
 com\chuanghai\student_portrait\entity\CollegesInfo.class
 com\chuanghai\student_portrait\response\BaseResponse.class
 com\chuanghai\student_portrait\response\BaseResponse.class
 com\chuanghai\student_portrait\entity\EventOrg.class
 com\chuanghai\student_portrait\entity\EventOrg.class
 com\chuanghai\student_portrait\mapper\ElectricityMapper.class
 com\chuanghai\student_portrait\mapper\ElectricityMapper.class
+com\chuanghai\student_portrait\controller\CircumferenceController.class
+com\chuanghai\student_portrait\utils\Imageys.class
 com\chuanghai\student_portrait\controller\DormController.class
 com\chuanghai\student_portrait\controller\DormController.class
+com\chuanghai\student_portrait\entity\dto\WeixiaoPushDTO.class
 com\chuanghai\student_portrait\service\DormService.class
 com\chuanghai\student_portrait\service\DormService.class
 com\chuanghai\student_portrait\entity\LoginUser.class
 com\chuanghai\student_portrait\entity\LoginUser.class
 com\chuanghai\student_portrait\service\impl\ColdWaterServiceImpl.class
 com\chuanghai\student_portrait\service\impl\ColdWaterServiceImpl.class
 com\chuanghai\student_portrait\entity\NewSchooluser.class
 com\chuanghai\student_portrait\entity\NewSchooluser.class
 com\chuanghai\student_portrait\service\AffinityScoreService.class
 com\chuanghai\student_portrait\service\AffinityScoreService.class
 com\chuanghai\student_portrait\entity\dto\UserLoginDTO.class
 com\chuanghai\student_portrait\entity\dto\UserLoginDTO.class
+com\chuanghai\student_portrait\service\impl\SecondFloorCanteenServiceImpl.class
 com\chuanghai\student_portrait\controller\ForewarningController.class
 com\chuanghai\student_portrait\controller\ForewarningController.class
 com\chuanghai\student_portrait\config\SwaggerConfig.class
 com\chuanghai\student_portrait\config\SwaggerConfig.class
 com\chuanghai\student_portrait\config\SubscriptionConfig.class
 com\chuanghai\student_portrait\config\SubscriptionConfig.class

+ 21 - 1
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -7,8 +7,10 @@ E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\en
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\AirConditioningService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\AirConditioningService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\ForewarningService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\ForewarningService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\ReceiveController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\ReceiveController.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\vo\SubscribePersonCondition.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Stall.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Stall.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\OldSchooluserMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\OldSchooluserMapper.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\ScheduledTaskConfig.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\ForeWarningReportFormController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\ForeWarningReportFormController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\vo\UniviewVO.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\vo\UniviewVO.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\BaseClass.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\BaseClass.java
@@ -20,6 +22,7 @@ E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\se
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\UserLoginDTO.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\UserLoginDTO.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Warning.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Warning.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\AffinityScoreMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\AffinityScoreMapper.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\DormRxService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\RedisConfig.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\RedisConfig.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Electricity.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Electricity.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\ForewarningServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\ForewarningServiceImpl.java
@@ -34,7 +37,9 @@ E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\en
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\NewSchooluserServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\NewSchooluserServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\JWTUtils.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\JWTUtils.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\ConsumeDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\ConsumeDto.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\SecondFloorShopNameServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\DormController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\DormController.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\JedisUtil.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\FaceDisernDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\FaceDisernDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\HotWater.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\HotWater.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\CoordService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\CoordService.java
@@ -56,24 +61,30 @@ E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\se
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Coord.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Coord.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\NewSchooluserMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\NewSchooluserMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\HMAC.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\HMAC.java
-E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\JedisUtil.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\LoginService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\LoginService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\ReturnValueUtil.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\ReturnValueUtil.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\vo\LibID.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\SecondFloorCanteenServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\ProvinceService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\ProvinceService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\EventUser.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\EventUser.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\NewSchooluserController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\NewSchooluserController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\StructOfPeopleInSchoolService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\StructOfPeopleInSchoolService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\StructOfPeopleInSchoolMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\StructOfPeopleInSchoolMapper.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\ReturnWXPush.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\exception\BaseErrorInfoInterface.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\exception\BaseErrorInfoInterface.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\StallServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\StallServiceImpl.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\SecondFloorCanteenService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\CapacityService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\CapacityService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\Base64Utils.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\Base64Utils.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Province.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Province.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\ScheduleConfig.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\EventOrg.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\EventOrg.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\NewSchooluser.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\NewSchooluser.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\DormRxMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\HotWaterController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\HotWaterController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Access.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Access.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\CityService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\CityService.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\SecondFloorShopName.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\AirConditioning.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\AirConditioning.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\ConsumeTotalMoneyDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\ConsumeTotalMoneyDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\User.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\User.java
@@ -88,6 +99,8 @@ E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\se
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\StructOfPeopleInSchool.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\StructOfPeopleInSchool.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\AccessServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\AccessServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\AccessCountDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\AccessCountDto.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\SecondFloorShopNameService.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\DormRxServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Consume.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Consume.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\CollegesInfoMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\CollegesInfoMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\PersonalTrackDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\PersonalTrackDto.java
@@ -111,6 +124,7 @@ E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\se
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\ForeWarningEntity.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\ForeWarningEntity.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\HotWaterService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\HotWaterService.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\FaceDiscernController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\FaceDiscernController.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\CircumferenceController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\FacePassRecord.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\config\FacePassRecord.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\CapacityServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\CapacityServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\AirConditioningMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\AirConditioningMapper.java
@@ -119,13 +133,17 @@ E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\co
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\CityMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\CityMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\CityServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\CityServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\AirConditioningController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\AirConditioningController.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\DormRx.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\WeixiaoPushDTO.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\LogUtils.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\LogUtils.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\LoginController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\controller\LoginController.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\CapacityMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\CapacityMapper.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\Imageys.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\exception\ResultValue.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\exception\ResultValue.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\response\enums\Code.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\response\enums\Code.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\CapacityDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\CapacityDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\FaceDiscernMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\FaceDiscernMapper.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\SecondFloorShopNameMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\DistrictDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\dto\DistrictDto.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\DateUtils.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\DateUtils.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\AffinityScoreServiceImpl.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\service\impl\AffinityScoreServiceImpl.java
@@ -135,7 +153,9 @@ E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\se
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\response\enums\StatusEnum.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\response\enums\StatusEnum.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\exception\GlobalExceptionHandler.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\exception\GlobalExceptionHandler.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\vo\SubscriptionVo.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\vo\SubscriptionVo.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\SecondFloorCanteen.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\StudentPortraitApplication.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\StudentPortraitApplication.java
+E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\mapper\SecondFloorCanteenMapper.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\response\BaseResponse.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\response\BaseResponse.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\AES.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\utils\AES.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Student.java
 E:\company\student_portraits_api\src\main\java\com\chuanghai\student_portrait\entity\Student.java

BIN
target/student_portrait-0.0.1-SNAPSHOT.jar.original