|
@@ -18,6 +18,12 @@ import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.iot.service.config.rabbitmq.RabbitMQConfig;
|
|
|
import com.usky.iot.service.vo.AppInfoRequest;
|
|
|
import com.usky.iot.service.vo.BaseGgpFacilityRequest;
|
|
|
+import org.apache.http.HttpResponse;
|
|
|
+import org.apache.http.client.methods.HttpPost;
|
|
|
+import org.apache.http.entity.StringEntity;
|
|
|
+import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
+import org.apache.http.impl.client.HttpClients;
|
|
|
+import org.apache.http.util.EntityUtils;
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -28,6 +34,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.io.IOException;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.HashMap;
|
|
@@ -98,6 +105,40 @@ public class BaseAppInfoServiceImpl extends AbstractCrudService<BaseAppInfoMappe
|
|
|
rabbitTemplate.convertAndSend(rabbitMQConfig.patrolFInfoExchange,"",JSONObject.toJSONString(map));
|
|
|
|
|
|
this.save(baseAppInfo);
|
|
|
+ String url = "http://sgdzpic.3322.org:5901";
|
|
|
+ String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> \n" +
|
|
|
+ "<Agent ID=\"SSJCZHQY0001\" Type=\"18\" Ver=\"1.2.0.0\">\n" +
|
|
|
+ "<DVRHeart State=\"1\" TotalSpace=\"XXXXX\" FreeSpace=\"XXXXXX\">\n" +
|
|
|
+ "System,smss.exe,csrss.exe…\n" +
|
|
|
+ "</DVRHeart>\n" +
|
|
|
+ "<GetTicks/>\n" +
|
|
|
+ "<OperationCmd Type=\"18\" Channel=\"0\" TriggerTime=\"2024-06-21 11:19:40\" Note=\"XXXXXX\" GUID=\"XXXXX…\">\n" +
|
|
|
+ "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDABsSFBcUERsXFhceHBsgKEIrKCUlKFE6PTBCYFVlZF9V…\n" +
|
|
|
+ "</OperationCmd>\n" +
|
|
|
+ "</Agent>";
|
|
|
+ CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
+ HttpPost httpPost = new HttpPost(url);
|
|
|
+ try {
|
|
|
+ // 设置请求的内容为XML
|
|
|
+ StringEntity entity = new StringEntity(xml);
|
|
|
+ entity.setContentType("application/xml");
|
|
|
+ httpPost.setEntity(entity);
|
|
|
+
|
|
|
+ // 发送请求
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
+
|
|
|
+ // 打印响应状态和内容
|
|
|
+ System.out.println("Response Status: " + response.getStatusLine().getStatusCode());
|
|
|
+ System.out.println("Response Content: " + EntityUtils.toString(response.getEntity()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ try {
|
|
|
+ httpClient.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
// if (pushFlag.equals(1)){
|
|
|
// JSONObject a = remotePatrolAgboxService.updateHeart(jsonObj.toJSONString());
|
|
|
// }
|