|
@@ -1,5 +1,7 @@
|
|
|
package com.warewms.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.warewms.common.utils.HeXunResponse;
|
|
|
import com.warewms.common.utils.HttpRequest;
|
|
|
import com.warewms.common.utils.JsonUtils;
|
|
|
import com.warewms.model.HeXunAlarmData;
|
|
@@ -10,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -51,6 +54,14 @@ public class HeXunDataServiceImpl implements HeXunDataService {
|
|
|
try {
|
|
|
|
|
|
String response = HttpRequest.postData("http://hxetm.com:20974/Interface_JCHGJT/info/addAlarm.do", JsonUtils.toJson(heXunAlarmData));
|
|
|
+
|
|
|
+ HeXunResponse heXunResponse = (HeXunResponse) JSONObject.parse(response);
|
|
|
+ if ("200".equals(heXunResponse.getCode())) {
|
|
|
+
|
|
|
+ machAlarmRecords.setUploadFlag("1");
|
|
|
+ machAlarmRecords.setUploadTime(new Date());
|
|
|
+ machAlarmRecords.update();
|
|
|
+ }
|
|
|
log.info("http response:" + response);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|