Selaa lähdekoodia

2022-12-29 联调后使用https协议通信并取消传输图片

milo 1 vuosi sitten
vanhempi
commit
1251d9da5f

+ 10 - 2
code/robot2ips/src/main/java/com/sunwin/robot2ips/service/impl/CheckDataServiceImpl.java

@@ -89,7 +89,14 @@ public class CheckDataServiceImpl implements CheckDataService {
         //根据机器人拆分组装后遍历上传
         for (RecordData recordData : uploadResult) {
             //HttpPost
-            String resp = HttpUtils.HttpPostWithJson(url, JSONObject.toJSONString(recordData));
+            logger.info("send data ={}", JSONObject.toJSONString(recordData));
+            String resp = null;
+            try {
+                resp = HttpsUtils.HttpsPostUtil(url, JSONObject.toJSONString(recordData), "JSON");
+            } catch (Exception e) {
+                logger.error("send req error ={}", e.getMessage());
+            }
+            //String resp = HttpUtils.HttpPostWithJson(url, JSONObject.toJSONString(recordData));
             //上传成功
             logger.info("get msg from ips msg={}", resp);
             if (!StringUtils.isEmpty(resp)) {
@@ -147,7 +154,8 @@ public class CheckDataServiceImpl implements CheckDataService {
             for (RecordTaskPoint recordTaskPoint : checkDataArray) {
                 //巡检照片转base64
                 String base64 = FtpUtils.addrToBase64(recordTaskPoint.getImage());
-                recordTaskPoint.setImage(base64);
+                //ips好像未处理图片 放入图片接口报错 所以注释。。
+                recordTaskPoint.setImage(null);
                 //取巡检数据的巡检时间的年月日作为任务日期
                 Date updateDate = DateUtil.strToDate(recordTaskPoint.getUpdateTime());
                 String yyyyMMdd = DateUtil.parseToString(updateDate, DateUtil.DateFormat_yyyy_MM_dd);