diff --git a/RuoYi-Vue-Oracle/pom.xml b/RuoYi-Vue-Oracle/pom.xml
index 19f49d6..0b18833 100644
--- a/RuoYi-Vue-Oracle/pom.xml
+++ b/RuoYi-Vue-Oracle/pom.xml
@@ -27,7 +27,7 @@
5.3.33
5.7.12
1.4.7
- 2.0.43
+ 4.0.3
1.2.23
2.13.0
1.21
@@ -55,6 +55,12 @@
4.1.63.Final
+
+
+ cn.zhxu
+ okhttps
+ 4.0.3
+
org.springframework.boot
@@ -159,11 +165,16 @@
${bitwalker.version}
-
+
+
+
+
+
+
- com.alibaba.fastjson2
- fastjson2
- ${fastjson.version}
+ cn.zhxu
+ okhttps-fastjson2
+ 4.0.3
@@ -171,6 +182,11 @@
org.springframework
spring-context-support
+
+ org.springframework
+ spring-core
+
+
@@ -179,6 +195,58 @@
${jwt.version}
+
+
+ org.apache.axis
+ axis
+ 1.4
+
+
+ org.apache.axis
+ axis-jaxrpc
+ 1.4
+
+
+
+
+
+
+
+
+
+
+
+ javax.xml.ws
+ jaxws-api
+ 2.3.1
+
+
+
+
+ com.sun.xml.ws
+ jaxws-rt
+ 2.3.1
+
+
+
+
+ cn.hutool
+ hutool-all
+ 5.7.15
+
+
+ axis
+ axis-wsdl4j
+ 1.5.1
+
+
+ commons-discovery
+ commons-discovery
+ 0.2
+
+
+
+
javax.xml.bind
diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/RuoYiApplication.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/RuoYiApplication.java
index 7ac0620..9b9ffb8 100644
--- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/RuoYiApplication.java
+++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/RuoYiApplication.java
@@ -1,9 +1,12 @@
package com.ruoyi;
+import com.ruoyi.common.task.EquTask;
import com.ruoyi.common.tcp.CarTcpNettyServer;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 启动程序
@@ -11,17 +14,14 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@EnableScheduling
public class RuoYiApplication
{
public static void main(String[] args)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
+
SpringApplication.run(RuoYiApplication.class, args);
- try {
- new CarTcpNettyServer().bind(8001);
- } catch (Exception e) {
- e.printStackTrace();
- }
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/EquTask.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/EquTask.java
index ba557fe..d1bc9e6 100644
--- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/EquTask.java
+++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/EquTask.java
@@ -1,15 +1,23 @@
package com.ruoyi.common.task;
+import cn.zhxu.okhttps.HTTP;
+import cn.zhxu.okhttps.HttpCall;
+import cn.zhxu.okhttps.HttpResult;
+import cn.zhxu.okhttps.OkHttps;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.task.forest.MyTaskClient;
+import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.project.oil.domain.monitor.ThDevice;
import com.ruoyi.project.outside.service.OutSideService;
+import org.apache.http.client.HttpClient;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
+import java.util.HashMap;
@Component
public class EquTask {
@@ -23,17 +31,36 @@ public class EquTask {
/**
* 港口原有设备对接
*/
+ @Scheduled(fixedRate = 10000)
public void equ(){
- String tokenByStr = myClient.loginRequest("admin", Md5Utils.hash("123456"));
- JSONObject tokenByJson = JSONObject.parseObject(tokenByStr);
+ String hash = "16EA8A305FB58BE0730DD67F04F022F4";
+
+ HttpResult httpResult = OkHttps.sync("http://10.201.35.30:8090/user/login").addBodyPara("userName", "admin")
+ .addBodyPara("password", hash)
+ .bodyType("application/json")
+ .post();
+ JSONObject tokenByJson = httpResult.getBody().toBean(JSONObject.class);
JSONObject dataByJson = tokenByJson.getJSONObject("data");
String token = dataByJson.getString("token");
ArrayList equLists = new ArrayList<>(); //查询 数据库 获取 港口以前的 设备信息
+ ThDevice thDevice = new ThDevice();
+ thDevice.setSn("e75153fd53d243289057ffec33f36cb9");
+ thDevice.setName("油气回收voc监测设备3#");
+ equLists.add(thDevice);
equLists.forEach(e->{
- String vocByStr = myClient.selectRequest(token, e.getSn(), e.getName());
- JSONObject vocByJson = JSONObject.parseObject(vocByStr);
+ HashMap map = new HashMap<>();
+
+ map.put("sensorUId",e.getSn());
+ map.put("label",e.getName());
+ HttpResult result = OkHttps.sync("http://10.201.35.30:8090/enviSensor/select?" +
+ "page=1&pageSize=20&valid=0&type=5&sensorUId={sensorUId}&label={label}")
+ .addPathPara(map)
+ .addHeader("token", token)
+ .get();
+ JSONObject vocByJson = result.getBody().toBean(JSONObject.class);
JSONObject vocDataByJson = vocByJson.getJSONObject("data");
JSONArray vocByArray = vocDataByJson.getJSONArray("array");
+ System.out.println(vocByArray.toJSONString());
});
}
diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/forest/MyTaskClient.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/forest/MyTaskClient.java
index 3e7d0d4..b1014ed 100644
--- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/forest/MyTaskClient.java
+++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/task/forest/MyTaskClient.java
@@ -16,4 +16,9 @@ public interface MyTaskClient {
)
String selectRequest(@Body String token,@Var("sensorUId") String sensorUId,@Var("label")String label);
+
+ @Get(url = "http://10.171.19.193:8080/dxpt/ws/shortMessageWs?wsdl"
+ )
+ String sms(@Var("phone") String phone,@Var("msg") String msg,@Var("Dwdm")String Dwdm);
+
}
diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/wsdl/TestWsdl.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/wsdl/TestWsdl.java
new file mode 100644
index 0000000..3592e9f
--- /dev/null
+++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/wsdl/TestWsdl.java
@@ -0,0 +1,35 @@
+package com.ruoyi.common.wsdl;
+
+import cn.hutool.http.webservice.SoapClient;
+
+
+import javax.xml.soap.SOAPMessage;
+
+/**
+ * 测试调用wsdl接口
+ * @author laijiangfeng
+ * @date 2024/9/27 9:51
+ */
+public class TestWsdl {
+ public static void main(String[] args) throws Exception {
+ // 创建SoapClient实例 wsdl协议请求地址:http://xxx.cn/services/GanSuInterface (去掉?wsdl)
+ SoapClient client = SoapClient.create("http://10.171.19.193:8080/dxpt/ws/shortMessageWs")
+ // 设置方法名和命名空间(命名空间url:http://webservice.xxx.xxx ,方法名:getSydwJsonList)
+ // tns 命名空间targetNamespace,没有命名空间时直接写方法名即可
+ .setMethod("tns:returnMassages", "http://service.cxf.com")
+ // 设置参数(最后的false参数表示参数不加命名空间的前缀web)
+ .setParam("in0", "afe9cff39173ff8901917a54c90e448d", false);
+
+ //获取SOAPMessage实例(此步作用是输出请求的XML参数,实际开发并不需要)
+ SOAPMessage message = client.getMessage();
+ System.out.println(client.getMsgStr(true));
+
+ // 发送请求(true表示输出的结果格式化处理)
+ String send = client.send(true);
+// Document document = DocumentHelper.parseText(send);
+// Element root = document.getRootElement();
+// String value = root.getStringValue();
+ System.out.println(send);
+// System.out.println(value);
+ }
+}
\ No newline at end of file
diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/wsdl/WebServiceUtil.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/wsdl/WebServiceUtil.java
new file mode 100644
index 0000000..6bfa35d
--- /dev/null
+++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/common/wsdl/WebServiceUtil.java
@@ -0,0 +1,50 @@
+package com.ruoyi.common.wsdl;
+
+import org.apache.axis.client.Call;
+import org.springframework.util.*;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+public class WebServiceUtil {
+
+ public static String sendMessage(Collection phones, String msg) throws Exception {
+
+ System.out.println("开始调用webservice");
+ List