浏览代码

修改水电导出接口,修改远程连接接口,修改连接门锁超时时效

liu 1 年之前
父节点
当前提交
61ec53765c

+ 6 - 4
src/main/java/com/template/common/utils/HttpClientHelper.java

@@ -29,7 +29,6 @@ import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.ssl.SSLContexts;
 import org.apache.http.util.EntityUtils;
-import org.apache.poi.util.StringUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -49,9 +48,12 @@ public class HttpClientHelper {
     private static PoolingHttpClientConnectionManager poolConnManager = null;
     private int maxTotalPool = 200;
     private int maxConPerRoute = 20;
-    private int socketTimeout = 100000;
-    private int connectionRequestTimeout = 90000;
-    private int connectTimeout = 90000;
+//    private int socketTimeout = 100000;
+    private int socketTimeout = 30000;
+//    private int connectionRequestTimeout = 90000;
+    private int connectionRequestTimeout = 15000;
+//    private int connectTimeout = 90000;
+    private int connectTimeout = 15000;
 
     // 代理信息
     public static String proxy_ip;

+ 4 - 1
src/main/java/com/template/controller/HouseLockController.java

@@ -209,7 +209,10 @@ public class HouseLockController implements HouseLockControllerAPI {
 
         try {
 
-            passwordIssController.remoteUnlocking(luid);
+            Boolean aBoolean = passwordIssController.remoteUnlocking(luid);
+            if (!aBoolean) {
+                return CommonResult.fail("远程开锁失败,远程开锁前,门锁需要先按“4#”进入请求远程开锁模式");
+            }
 
             UnlockingRecord unlockingRecord = new UnlockingRecord();
             unlockingRecord.setRoomNumber(remoteUnlockingDto.getRoomNumber());

+ 1 - 1
src/main/java/com/template/controller/HouseNumberController.java

@@ -325,7 +325,7 @@ public class HouseNumberController implements HouseNumberControllerAPI {
                 }
                 dataRow1.createCell(3).setCellValue(houseType);
                 dataRow1.createCell(4).setCellValue(vo.getHouseName());
-                dataRow1.createCell(5).setCellValue(vo.getHouseName());
+                dataRow1.createCell(5).setCellValue(vo.getRoomNumber());
 
             }
         }

+ 8 - 4
src/main/java/com/template/controller/PasswordIssController.java

@@ -430,7 +430,7 @@ public class PasswordIssController {
      * @param luid
      * @return
      */
-    public void remoteUnlocking(String luid) {
+    public Boolean remoteUnlocking(String luid) {
         HashMap<String, Object> map = new HashMap<>();
         map.put("luid", luid);//"80A036AEA1D3");
         map.put("categoryId", doorLockConfig.getCategoryId());//"d0c248256f8346d2a19afa296562b319");//设备分类ID 所有蓝牙wifi锁默认统一值
@@ -438,12 +438,16 @@ public class PasswordIssController {
 
         try {
             JSONObject jsonObject = queryData(jsonContent, PasswordUrlEnum.RemoteOpen.getUrl());
-
-
+            Integer result = jsonObject.getInteger("result");
+            if (result==1) {
+                return true;
+            }else {
+                return false;
+            }
         } catch (Exception e) {
             e.printStackTrace();
         }
-//        return null;
+        return false;
     }