| | |
| | | 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; |
| | |
| | | log.info("方法submitEventRegister发生错误:{}", e.getMessage()); |
| | | } |
| | | HttpResponse result = request.execute(); |
| | | log.info(result.body()); |
| | | log.info("submit上传浪潮事件信息:{}",result.body()); |
| | | return result.body(); |
| | | } |
| | | |
| | |
| | | eventInfo.setHandleTime(String.valueOf(eventInfoVo.getProcessDate().getTime())); |
| | | } |
| | | eventInfo.setCaseName(gridData.getGridName().concat(caseTypeName).concat(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()); |
| | | 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()); |
| | | } |
| | | }); |
| | | } |
| | | |