Просмотр исходного кода

Merge remote-tracking branch 'origin/V1' into V1

yanliming 5 лет назад
Родитель
Сommit
ee3f1ff5e6

+ 2 - 1
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceFilterLogServiceImpl.java

@@ -77,6 +77,7 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
             PersonDeviceFilterLog personDeviceFilterLog = personDeviceFilterLogDAO.findByPersonIdAndDeviceNoAndTimeZones(personId,deviceNo,timeZones);
 
             if (personDeviceFilterLog != null){
+                BigDecimal oldTemper = personDeviceFilterLog.getTemperature();
                 personDeviceFilterLog.setUpdateTime(new Date());
                 personDeviceFilterLog.setTemperature(temperature);
                 personDeviceFilterLog.setRecordTime(date);
@@ -91,7 +92,7 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
                     personDeviceFilterLog.setMatchStatus(0);
                     personDeviceFilterLog.setMatchFaceId(0);
                 }
-                BigDecimal oldTemper = personDeviceFilterLog.getTemperature();
+
                 if (!LApiUtil.compareToInterval(oldTemper,36,37)){
                     if (LApiUtil.compareToInterval(temperature,36,37)){
 

+ 2 - 2
common/src/main/java/com/jpsoft/smart/modules/common/utils/LApiUtil.java

@@ -202,9 +202,9 @@ public class LApiUtil {
       // long time = date.getTime();
      //   System.out.println(date);
       //  192.168.11.13:80/V1.0/PeopleLibraries/1584409665/People/1111?LastChange=1584428390872
+        boolean success = LApiUtil.compareToInterval(new BigDecimal(36.3),36,37);
+        System.out.println(success);
 
-        String format = DateUtil.format(new Date(), "yyyy-MM-dd-HH");
-        System.out.println(format);
     }
 
 

+ 5 - 1
common/src/main/java/com/jpsoft/smart/modules/lapi/service/impl/LapiServiceImpl.java

@@ -91,6 +91,10 @@ public class LapiServiceImpl implements ILapiService {
         if (deviceList.size() <= 0) {
             throw new Exception("人员与设备绑定错误");
         }
+        String base64Data = OSSUtil.downloadToBase64(personInfo.getFaceImageUrl());
+        if (base64Data.length()>512*1024 || base64Data.length()<10*1024){
+            throw new Exception("人员照片大小限定为10k~512k");
+        }
         List<LapiMsgResult> lapiMsgResults = new ArrayList<>();
         for (DeviceInfo deviceInfo : deviceList) {
             HashMap<String, Object> map = new HashMap<>();
@@ -118,7 +122,7 @@ public class LapiServiceImpl implements ILapiService {
             map3.put("FaceID", personInfo.getId());
             map3.put("Name", personInfo.getId() + ".jpg");
 
-            String base64Data = OSSUtil.downloadToBase64(personInfo.getFaceImageUrl());
+
 
             map3.put("Size", base64Data.length());
             map3.put("Data", base64Data);