springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/api/LcReturnObject.java
@@ -20,7 +20,7 @@ /** *返回对象信息 */ private Object data; private String data; /** *返回的是否成功标识 */ springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java
@@ -127,6 +127,13 @@ } /** * 返回当前事件的时间戳 * @return */ public static Long getCurrentDateTimeStamp(){ return LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli(); } /** * 获取当前时间字符串,格式为yyyy-MM-dd HH:mm:ss * @return */ springcloud_k8s_panzhihuazhihuishequ/service_api/src/main/java/com/panzhihua/serviceapi/biz/impl/LcApiServiceImpl.java
@@ -7,7 +7,6 @@ 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; @@ -19,6 +18,7 @@ import com.panzhihua.common.model.vos.grid.EventGridDataDetailsVO; import com.panzhihua.common.model.vos.grid.EventResourceVO; import com.panzhihua.common.service.grid.GridService; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.serviceapi.biz.LcApiService; import com.panzhihua.serviceapi.model.dto.LcGridData; import lombok.extern.slf4j.Slf4j; @@ -189,10 +189,9 @@ eventInfo.setDataId(eventInfoVo.getId().toString()); //获取系统网格员映射的浪潮网格员对于的用户ID eventInfo.setUserId(lcGridUserId); if (eventInfoVo.getProcessDate() != null) { eventInfo.setHandleTime(String.valueOf(eventInfoVo.getProcessDate().getTime())); } eventInfo.setHandleTime(DateUtils.getCurrentDateTimeStamp().toString()); eventInfo.setCaseName(gridData.getGridName().concat(caseTypeName).concat(eventInfoVo.getEventTitle())); log.info("事件请求数据:{}", JSONObject.toJSONString(eventInfo)); String remoteData = submitEventRegister(eventInfo); LcReturnObject lcReturnObject=JSONObject.parseObject(remoteData, LcReturnObject.class); log.info("提交浪潮服务器,接口返回结果为:{}",remoteData); springcloud_k8s_panzhihuazhihuishequ/service_api/src/test/java/com/panzhihua/service_api/biz/impl/LcApiServiceImplTest.java
@@ -53,6 +53,13 @@ log.info(result); } @Test void automationUploadEventAndFile() { lcApiService.automationUploadEventAndFile(); } @Test void submitEventRegister() { EventInfo eventInfo = new EventInfo(); @@ -100,7 +107,7 @@ @Test void submitEventRegisterJobTest() { log.info("定时向浪潮服务器提交网格事件登记开始"); R<EventDetailsVO> event = gridService.eventDetails(1111999L); R<EventDetailsVO> event = gridService.eventDetails(4545676L); EventDetailsVO eventInfoVo = event.getData(); EventInfo eventInfo = new EventInfo(); String lcGrid = gridService.getLcGridIdByLocal(eventInfoVo.getGridId());