Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

chenw 6 years ago
parent
commit
3115bd597e
19 changed files with 92 additions and 39 deletions
  1. 46 4
      applications/device/device-client/pom.xml
  2. 15 0
      applications/device/device-client/src/main/resources/banner.txt
  3. BIN
      applications/device/device-client/src/main/resources/icon.ico
  4. BIN
      applications/device/device-client/src/main/winserver/deviceclient.exe
  5. 0 14
      applications/device/device-client/src/main/winserver/deviceclient.xml
  6. 3 0
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDataAnalyzeService.java
  7. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libInfra.so
  8. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libNetFramework.so
  9. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libStream.so
  10. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libStreamSvr.so
  11. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libavnetsdk.so
  12. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libdhconfigsdk.so
  13. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libdhnetsdk.so
  14. 0 1
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/manifest.txt
  15. 1 1
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/controller/AccessControlController.java
  16. 4 2
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/AccessControlRecordMapper.java
  17. 4 0
      applications/device/device-server/src/main/resources/mapper/AccessControlRecordMapper.xml
  18. 2 2
      applications/device/device-server/src/main/resources/mapper/StudentInfoMapper.xml
  19. 17 15
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/ReceiveService.java

+ 46 - 4
applications/device/device-client/pom.xml

@@ -39,13 +39,13 @@
         </dependency>
         <!-- JSON -->
         <dependency>
-          <groupId>com.alibaba</groupId>
-          <artifactId>fastjson</artifactId>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
         </dependency>
         <!-- httpClient -->
         <dependency>
-          <groupId>org.apache.httpcomponents</groupId>
-          <artifactId>httpclient</artifactId>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
         </dependency>
     </dependencies>
     <build>
@@ -54,6 +54,48 @@
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>com.akathist.maven.plugins.launch4j</groupId>
+                <artifactId>launch4j-maven-plugin</artifactId>
+                <version>1.7.25</version>
+                <executions>
+                    <execution>
+                        <id>l4j</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>launch4j</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <jar>${project.build.directory}/${artifactId}-${version}.jar</jar>
+                    <headerType>console</headerType>
+                    <outfile>${project.build.directory}/device-client.exe</outfile>
+                    <downloadUrl>http://java.com/download</downloadUrl>
+                    <classPath>
+                        <mainClass>org.springframework.boot.loader.JarLauncher</mainClass>
+                    </classPath>
+                    <icon>src/main/resources/icon.ico</icon>
+                    <stayAlive>true</stayAlive>
+                    <restartOnCrash>true</restartOnCrash>
+                    <jre>
+                        <minVersion>1.8.0</minVersion>
+                        <jdkPreference>preferJre</jdkPreference>
+                    </jre>
+                    <versionInfo>
+                        <fileVersion>1.0.0.0</fileVersion>
+                        <txtFileVersion>${project.version}</txtFileVersion>
+                        <fileDescription>${project.name}</fileDescription>
+                        <copyright>2018 usoftchina.com</copyright>
+                        <productVersion>1.0.0.0</productVersion>
+                        <txtProductVersion>1.0.0.0</txtProductVersion>
+                        <productName>${project.name}</productName>
+                        <companyName>usoftchina.com</companyName>
+                        <internalName>device-client</internalName>
+                        <originalFilename>device-client.exe</originalFilename>
+                    </versionInfo>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 </project>

+ 15 - 0
applications/device/device-client/src/main/resources/banner.txt

@@ -0,0 +1,15 @@
+${AnsiColor.BRIGHT_YELLOW}
+
+88        88   ad88888ba     ,ad8888ba,    88888888888  888888888888  ,ad8888ba,   88        88  88  888b      88         db
+88        88  d8"     "8b   d8"'    `"8b   88                88      d8"'    `"8b  88        88  88  8888b     88        d88b
+88        88  Y8,          d8'        `8b  88                88     d8'            88        88  88  88 `8b    88       d8'`8b
+88        88  `Y8aaaaa,    88          88  88aaaaa           88     88             88aaaaaaaa88  88  88  `8b   88      d8'  `8b
+88        88    `"""""8b,  88          88  88"""""           88     88             88""""""""88  88  88   `8b  88     d8YaaaaY8b
+88        88          `8b  Y8,        ,8P  88                88     Y8,            88        88  88  88    `8b 88    d8""""""""8b
+Y8a.    .a8P  Y8a     a8P   Y8a.    .a8P   88                88      Y8a.    .a8P  88        88  88  88     `8888   d8'        `8b
+ `"Y8888Y"'    "Y88888P"     `"Y8888Y"'    88                88       `"Y8888Y"'   88        88  88  88      `888  d8'          `8b
+
+
+Application Version: ${application.version}${application.formatted-version}
+Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
+${AnsiColor.DEFAULT}

BIN
applications/device/device-client/src/main/resources/icon.ico


BIN
applications/device/device-client/src/main/winserver/deviceclient.exe


+ 0 - 14
applications/device/device-client/src/main/winserver/deviceclient.xml

@@ -1,14 +0,0 @@
-<service>
-    <id>deviceclient</id>
-    <name>device client</name>
-    <description>client server for smart school platform</description>
-    <!-- java环境变量 -->
-    <env name="JAVA_HOME" value="%JAVA_HOME%"/>
-    <executable>java</executable>
-    <arguments>-jar "E:\springboot\ test.jar"</arguments>
-    <!-- 开机启动 -->
-    <startmode>Automatic</startmode>
-    <!-- 日志配置 -->
-    <logpath>%BASE%\log</logpath>
-    <logmode>rotate</logmode>
-</service>

+ 3 - 0
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDataAnalyzeService.java

@@ -63,6 +63,9 @@ public class DahuaDataAnalyzeService {
                  */
                 case DahuaEvents.EVENT_IVS_ACCESS_CTL:
                     DEV_EVENT_ACCESS_CTL_INFO info = new DEV_EVENT_ACCESS_CTL_INFO(pAlarmInfo);
+                    if (logger.isDebugEnabled()) {
+                        logger.debug(info.toString());
+                    }
                     AccessControlInfo accessControlInfo = new AccessControlInfo();
                     if (dwBufSize > 0) {
                         accessControlInfo.setImageData(pBuffer.getByteArray(0, dwBufSize));

BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libInfra.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libNetFramework.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libStream.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libStreamSvr.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libavnetsdk.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libdhconfigsdk.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libdhnetsdk.so


+ 0 - 1
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/manifest.txt

@@ -1 +0,0 @@
-libavnetsdk.so,libdhconfigsdk.so,libdhnetsdk.so,libInfra.so,libNetFramework.so,libStream.so,libStreamSvr.so

+ 1 - 1
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/controller/AccessControlController.java

@@ -58,7 +58,7 @@ public class AccessControlController {
      * @return
      */
     @PostMapping("/event")
-    public Result onAccessControlEvent(AccessControlInfo info) {
+    public Result onAccessControlEvent(@RequestBody AccessControlInfo info) {
         accessControlService.onAccessControlEvent(info);
         return Result.success();
     }

+ 4 - 2
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/AccessControlRecordMapper.java

@@ -1,7 +1,9 @@
 package com.usoftchina.smartschool.device.mapper;
 
+import com.netflix.ribbon.proxy.annotation.ClientProperties;
 import com.usoftchina.smartschool.device.po.AccessControlRecord;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
 import java.util.List;
@@ -22,6 +24,6 @@ public interface AccessControlRecordMapper {
      * @param endDate
      * @return
      */
-    List<AccessControlRecord> selectByStuNumberAndDate(String stuNumber, Date beginDate,
-                                                     Date endDate);
+    List<AccessControlRecord> selectByStuNumberAndDate(@Param("name") String stuNumber,@Param("begin") Date beginDate,
+                                                       @Param("end") Date endDate);
 }

+ 4 - 0
applications/device/device-server/src/main/resources/mapper/AccessControlRecordMapper.xml

@@ -106,4 +106,8 @@
         </trim>
     </insert>
 
+    <select id="selectByStuNumberAndDate" resultType="com.usoftchina.smartschool.device.po.AccessControlRecord">
+        select * from  out_in_record where  stu_name=#{name}
+    </select>
+
 </mapper>

+ 2 - 2
applications/device/device-server/src/main/resources/mapper/StudentInfoMapper.xml

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.usoftchina.smartschool.device.mapper.AccessControlRecordMapper" >
+<mapper namespace="com.usoftchina.smartschool.device.mapper.StudentInfoMapper" >
     <select id="selectInfoByCardNo" parameterType="string" resultMap="studentInfo">
         select school_appid,school_secret,sys_parents.openid,sys_student.stu_name,sys_student.stu_id,sys_school.school_id,
          stu_number,sys_student.clazz_id,stu_class,stu_grade,stu_classnickname,stu_sex from sys_student left join sys_school on sys_student.school_id=sys_school.school_id
         left join sys_parents_stu on sys_student.stu_id=sys_parents_stu.stu_id left join sys_parents on sys_parents.parent_id =
-        sys_parents_stu.parent_id where stu_cardNo = #{cardNo}
+        sys_parents_stu.parent_id where stu_cardNo = #{cardNo} and  ifnull(openid,'') != ''
     </select>
 
     <resultMap id="studentInfo" type="com.usoftchina.smartschool.device.po.StudentInfo" >

+ 17 - 15
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/ReceiveService.java

@@ -60,23 +60,25 @@ public class ReceiveService {
         Result result = null;
         //记录发送失败次数
         int count = 0;
-        for (MessageInfo msg : data) {
-            if (!msg.getSend()) {
-                //处理openid,如果不存在openid,则直接忽略
-                //getOpenId(msg);
-                result = wxPushService.wechatPush(msg);
-                if (result.isSuccess()) {
-                    msg.setSend(true);
-                } else {
-                    msg.setReason(result.getMessage());
-                    count ++;
+        if (null != data) {
+            for (MessageInfo msg : data) {
+                if (!msg.getSend()) {
+                    //处理openid,如果不存在openid,则直接忽略
+                    //getOpenId(msg);
+                    result = wxPushService.wechatPush(msg);
+                    if (result.isSuccess()) {
+                        msg.setSend(true);
+                    } else {
+                        msg.setReason(result.getMessage());
+                        count++;
+                    }
                 }
             }
-        }
-        //存在发送失败的消息
-        if (count > 0) {
-            msgPackage.addRetry();
-            sendService.sendDelayMessage(msgPackage);
+            //存在发送失败的消息
+            if (count > 0) {
+                msgPackage.addRetry();
+                sendService.sendDelayMessage(msgPackage);
+            }
         }
         /**
          * Delivery Tag 用来标识信道中投递的消息。RabbitMQ 推送消息给 Consumer 时,会附带一个 Delivery Tag,