diff --git a/RuoYi-Vue-Oracle/pom.xml b/RuoYi-Vue-Oracle/pom.xml
index 0b18833..401737e 100644
--- a/RuoYi-Vue-Oracle/pom.xml
+++ b/RuoYi-Vue-Oracle/pom.xml
@@ -214,6 +214,28 @@
+
+
+ cn.hutool
+ hutool-all
+ 5.8.15
+
+
+ org.bouncycastle
+ bcprov-ext-jdk15on
+ 1.69
+
+
+ org.bouncycastle
+ bcpkix-jdk15on
+ 1.69
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+ 1.69
+
+
javax.xml.ws
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 d1bc9e6..b99f659 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
@@ -6,10 +6,12 @@ import cn.zhxu.okhttps.HttpResult;
import cn.zhxu.okhttps.OkHttps;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
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.oil.mapper.ThDeviceMapper;
import com.ruoyi.project.outside.service.OutSideService;
import org.apache.http.client.HttpClient;
import org.springframework.beans.factory.annotation.Autowired;
@@ -18,6 +20,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
@Component
public class EquTask {
@@ -28,6 +31,8 @@ public class EquTask {
private MyTaskClient myClient;
@Autowired
private OutSideService outSideService;
+ @Autowired
+ private ThDeviceMapper thDeviceMapper;
/**
* 港口原有设备对接
*/
@@ -42,11 +47,9 @@ public class EquTask {
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);
+ thDevice.setDeptId(5l);
+ List equLists = thDeviceMapper.selectDeviceList(thDevice);
equLists.forEach(e->{
HashMap map = new HashMap<>();
@@ -55,12 +58,17 @@ public class EquTask {
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());
+ .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.toString());
+ try {
+ Integer integer = outSideService.insertOldDeviceData(vocByArray.toJSONString());
+ } catch (JsonProcessingException jsonProcessingException) {
+ jsonProcessingException.printStackTrace();
+ }
});
}
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
index 3592e9f..97d2d18 100644
--- 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
@@ -1,5 +1,6 @@
package com.ruoyi.common.wsdl;
+import cn.hutool.core.lang.Console;
import cn.hutool.http.webservice.SoapClient;
@@ -12,24 +13,24 @@ import javax.xml.soap.SOAPMessage;
*/
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);
+
+ // 新建客户端
+ SoapClient client = SoapClient.create("http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx")
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
+ .setMethod("web:getCountryCityByIp", "http://WebXml.com.cn/")
+ // 设置参数,此处自动添加方法的前缀:web
+ .setParam("phone", "18437762352")
+ .setParam("msg", "1112121")
+ .setParam("dwdm", "SGJT-山港集团");
+
+ // 发送请求,参数true表示返回一个格式化后的XML内容
+ // 返回内容为XML字符串,可以配合XmlUtil解析这个响应
+ Console.log(client.send(true));
+
}
+
+
+
+
+
}
\ No newline at end of file
diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
index 3ee8565..3509291 100644
--- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
+++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -23,7 +23,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
/**
* spring security配置
- *
+ *
* @author ruoyi
*/
@EnableMethodSecurity(prePostEnabled = true, securedEnabled = true)
@@ -35,7 +35,7 @@ public class SecurityConfig
*/
@Autowired
private UserDetailsService userDetailsService;
-
+
/**
* 认证失败处理类
*/
@@ -53,7 +53,7 @@ public class SecurityConfig
*/
@Autowired
private JwtAuthenticationTokenFilter authenticationTokenFilter;
-
+
/**
* 跨域过滤器
*/
@@ -97,35 +97,36 @@ public class SecurityConfig
protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception
{
return httpSecurity
- // CSRF禁用,因为不使用session
- .csrf(csrf -> csrf.disable())
- // 禁用HTTP响应标头
- .headers((headersCustomizer) -> {
- headersCustomizer.cacheControl(cache -> cache.disable()).frameOptions(options -> options.sameOrigin());
- })
- // 认证失败处理类
- .exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler))
- // 基于token,所以不需要session
- .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
- // 注解标记允许匿名访问的url
- .authorizeHttpRequests((requests) -> {
- permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
- // 对于登录login 注册register 验证码captchaImage 允许匿名访问
- requests.antMatchers("/login", "/register", "/captchaImage","/outside/*").permitAll()
- // 静态资源,可匿名访问
- .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
- .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
- // 除上面外的所有请求全部需要鉴权认证
- .anyRequest().authenticated();
- })
- // 添加Logout filter
- .logout(logout -> logout.logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler))
- // 添加JWT filter
- .addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class)
- // 添加CORS filter
- .addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class)
- .addFilterBefore(corsFilter, LogoutFilter.class)
- .build();
+ // CSRF禁用,因为不使用session
+ .csrf(csrf -> csrf.disable())
+ // 禁用HTTP响应标头
+ .headers((headersCustomizer) -> {
+ headersCustomizer.cacheControl(cache -> cache.disable()).frameOptions(options -> options.sameOrigin());
+ })
+ // 认证失败处理类
+ .exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler))
+ // 基于token,所以不需要session
+ .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
+ // 注解标记允许匿名访问的url
+ .authorizeHttpRequests((requests) -> {
+ permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
+ // 对于登录login 注册register 验证码captchaImage 允许匿名访问
+ requests.antMatchers("/login","/bbc/**",
+ "/register", "/captchaImage","/outside/*").permitAll()
+ // 静态资源,可匿名访问
+ .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
+ .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
+ // 除上面外的所有请求全部需要鉴权认证
+ .anyRequest().authenticated();
+ })
+ // 添加Logout filter
+ .logout(logout -> logout.logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler))
+ // 添加JWT filter
+ .addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class)
+ // 添加CORS filter
+ .addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class)
+ .addFilterBefore(corsFilter, LogoutFilter.class)
+ .build();
}
/**
diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/system/controller/BbcController.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/system/controller/BbcController.java
index a0229c2..f9df66a 100644
--- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/system/controller/BbcController.java
+++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/system/controller/BbcController.java
@@ -1,268 +1,307 @@
-//package com.ruoyi.project.system.controller;
-//
-//
-//import com.alibaba.fastjson2.JSON;
-//import com.alibaba.fastjson2.JSONObject;
-//import com.banboocloud.Codec.BamboocloudFacade;
-//import com.ruoyi.common.utils.reflect.ReflectUtils;
-//import com.ruoyi.framework.web.controller.BaseController;
-//import com.ruoyi.project.system.domain.SysUser;
-//import com.ruoyi.project.system.service.ISysDeptService;
-//import com.ruoyi.project.system.service.ISysPostService;
-//import com.ruoyi.project.system.service.ISysRoleService;
-//import com.ruoyi.project.system.service.ISysUserService;
-//import com.ruoyi.project.system.utils.BamboocloudUtils;
-//
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.web.bind.annotation.PostMapping;
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.bind.annotation.ResponseBody;
-//import org.springframework.web.bind.annotation.RestController;
-//
-//import javax.servlet.ServletException;
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
-//import java.io.BufferedReader;
-//import java.io.IOException;
-//import java.io.PrintWriter;
-//import java.util.*;
-//
-///**
-// * swagger 用户测试方法
-// * 加密认证
-// * @author ruoyi
-// */
-//
-//@RestController
-//@RequestMapping("/bbc/user")
-//public class BbcController extends BaseController {
-//
-// private String bimRequestId;
-//
-// private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class);
-//
-//
-// @Autowired
-// private ISysUserService userService;
-//
-// @Autowired
-// private ISysRoleService roleService;
-//
-// @Autowired
-// private ISysDeptService deptService;
-//
-// @Autowired
-// private ISysPostService postService;
-//
-//// @ApiOperation("测试")
-// @RequestMapping()
-// public JSONObject bbcUser() {
-//
-// JSONObject jsonObject = new JSONObject();
-// jsonObject.put("resultCode", "0");
-// jsonObject.put("message", "success");
-// return jsonObject;
-//
-// }
-//
-//// @ApiOperation("对象属性字段查询")
-// @PostMapping("/schemaService")
-// public String SchemaService(HttpServletRequest req, HttpServletResponse resp) {
-//
-// JSONObject jsonObject = new JSONObject();
-//
-// // StringBuilder sb = stringBuilder(req);
-// String bodyparam= BamboocloudUtils.getRequestBody(req);
-// logger.info("json--param-->" + bodyparam);
-// // String bodyparam = sb.toString();
-// //解密json字符传
-// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES");
-// logger.info("json--param-->" + bodyparam);
-// Map reqmap = (Map) JSON.parse(bodyparam);
-// //验证签名
-// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) {
-// String username = (String) reqmap.get("bimRemoteUser");
-// String password = (String) reqmap.get("bimRemotePwd");
-// //判断接口中的调用名及调用密码是否正确
-// if (BamboocloudUtils.checkUsernamePassword(username, password)) {
-//// //添加返回的对象及属性字段名
-//// MapJson mapJson = new MapJson();
-//// Map>> map = new HashMap<>();
-//// jsonObject.put("account", mapJson.accountList());
-//// jsonObject.put("organization", mapJson.organizationList());
-//// jsonObject.put("role", mapJson.roleList());
-//// jsonObject.put("post", mapJson.postList());
-//// jsonObject.put("dict", mapJson.dictDataList());
-//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId"));
-// String mapJs = JSON.toJSONString(jsonObject);
-// logger.info(jsonObject.toJSONString());
-// //返回加密的json字符串
-// mapJs = BamboocloudFacade.encrypt(mapJs, "123456", "AES");
-// //jsonObject.put(map);
-// //