From c6512655e722d9ca80dd8c34b79f6d3923ecf86c Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期二, 22 六月 2021 16:07:50 +0800
Subject: [PATCH] Merge branch 'test' into 'test_screen'

---
 springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImpl.java |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImpl.java
index b732292..3685d5f 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImpl.java
@@ -4,9 +4,12 @@
 import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.JsonObject;
 import com.panzhihua.common.api.LangchaoApiConstants;
+import com.panzhihua.common.api.LcReturnObject;
 import com.panzhihua.common.constants.TokenConstant;
 import com.panzhihua.common.enums.LocalEventToLangChaoEventTypeEnum;
 import com.panzhihua.common.model.dtos.api.EventFile;
@@ -102,7 +105,7 @@
             log.info("方法submitEventRegister发生错误:{}", e.getMessage());
         }
         HttpResponse result = request.execute();
-        log.info(result.body());
+        log.info("submit上传浪潮事件信息:{}",result.body());
         return result.body();
     }
 
@@ -168,7 +171,8 @@
             EventGridDataDetailsVO gridData = (EventGridDataDetailsVO) grid.getData();
             eventInfo.setGridName(gridData.getGridName());
             eventInfo.setCaseTypeCode(LocalEventToLangChaoEventTypeEnum.getCodeByName(eventInfoVo.getEventType()));
-            eventInfo.setCaseTypeName(LocalEventToLangChaoEventTypeEnum.getEventNameByCode(eventInfoVo.getEventType()));
+            String caseTypeName= LocalEventToLangChaoEventTypeEnum.getEventNameByCode(eventInfoVo.getEventType());
+            eventInfo.setCaseTypeName(caseTypeName);
             if (eventInfoVo.getEventCategory() != 1L) {
                 eventInfo.setHappenTime(String.valueOf(eventInfoVo.getPropagandaTime().getTime()));
             } else {
@@ -188,18 +192,22 @@
             if (eventInfoVo.getProcessDate() != null) {
                 eventInfo.setHandleTime(String.valueOf(eventInfoVo.getProcessDate().getTime()));
             }
-            eventInfo.setCaseName(eventInfoVo.getEventTitle());
-            submitEventRegister(eventInfo);
-            log.info("定时向浪潮服务器提交网格事件登记结束");
-            log.info("开始上传附件信息");
-            List<EventResourceVO> picsList = eventInfoVo.getPics();
-            uploadLcApiEventFile(eventInfoVo, picsList, "png");
-            List<EventResourceVO> audiosList = eventInfoVo.getAudios();
-            uploadLcApiEventFile(eventInfoVo, audiosList, "mp3");
-            List<EventResourceVO> videoList = eventInfoVo.getVideos();
-            uploadLcApiEventFile(eventInfoVo, videoList, "mp4");
-            log.info("结束上传附件信息");
-            gridService.updateLcUploadFlag(eventInfoVo.getId());
+            eventInfo.setCaseName(gridData.getGridName().concat(caseTypeName).concat(eventInfoVo.getEventTitle()));
+            String remoteData = submitEventRegister(eventInfo);
+            LcReturnObject lcReturnObject=JSONObject.parseObject(remoteData, LcReturnObject.class);
+            log.info("提交浪潮服务器,接口返回结果为:{}",remoteData);
+            if(lcReturnObject.getSuccess()){
+                log.info("定时向浪潮服务器提交网格事件登记结束");
+                log.info("开始上传附件信息");
+                List<EventResourceVO> picsList = eventInfoVo.getPics();
+                uploadLcApiEventFile(eventInfoVo, picsList, "png");
+                List<EventResourceVO> audiosList = eventInfoVo.getAudios();
+                uploadLcApiEventFile(eventInfoVo, audiosList, "mp3");
+                List<EventResourceVO> videoList = eventInfoVo.getVideos();
+                uploadLcApiEventFile(eventInfoVo, videoList, "mp4");
+                log.info("结束上传附件信息");
+                gridService.updateLcUploadFlag(eventInfoVo.getId());
+            }
         });
     }
 

--
Gitblit v1.7.1