Compare commits
No commits in common. "be16d6a901a1831919dfba5da487205b5da7c1f7" and "13a54ebcb6412f6ed0f0311a6f003585f4e8457e" have entirely different histories.
be16d6a901
...
13a54ebcb6
|
@ -27,7 +27,7 @@
|
||||||
<spring-framework.version>5.3.33</spring-framework.version>
|
<spring-framework.version>5.3.33</spring-framework.version>
|
||||||
<spring-security.version>5.7.12</spring-security.version>
|
<spring-security.version>5.7.12</spring-security.version>
|
||||||
<pagehelper.spring.boot.starter.version>1.4.7</pagehelper.spring.boot.starter.version>
|
<pagehelper.spring.boot.starter.version>1.4.7</pagehelper.spring.boot.starter.version>
|
||||||
<fastjson.version>4.0.3</fastjson.version>
|
<fastjson.version>2.0.43</fastjson.version>
|
||||||
<druid.version>1.2.23</druid.version>
|
<druid.version>1.2.23</druid.version>
|
||||||
<commons.io.version>2.13.0</commons.io.version>
|
<commons.io.version>2.13.0</commons.io.version>
|
||||||
<bitwalker.version>1.21</bitwalker.version>
|
<bitwalker.version>1.21</bitwalker.version>
|
||||||
|
@ -55,12 +55,6 @@
|
||||||
<version>4.1.63.Final</version>
|
<version>4.1.63.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.zhxu</groupId>
|
|
||||||
<artifactId>okhttps</artifactId>
|
|
||||||
<version>4.0.3</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- SpringBoot 测试 -->
|
<!-- SpringBoot 测试 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -165,16 +159,11 @@
|
||||||
<version>${bitwalker.version}</version>
|
<version>${bitwalker.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- <!– 阿里JSON解析器 –>-->
|
<!-- 阿里JSON解析器 -->
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>com.alibaba.fastjson2</groupId>-->
|
|
||||||
<!-- <artifactId>fastjson2</artifactId>-->
|
|
||||||
<!-- <version>${fastjson.version}</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.zhxu</groupId>
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
<artifactId>okhttps-fastjson2</artifactId>
|
<artifactId>fastjson2</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>${fastjson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring框架基本的核心工具-->
|
<!-- Spring框架基本的核心工具-->
|
||||||
|
@ -182,11 +171,6 @@
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context-support</artifactId>
|
<artifactId>spring-context-support</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Token生成与解析-->
|
<!-- Token生成与解析-->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -195,58 +179,6 @@
|
||||||
<version>${jwt.version}</version>
|
<version>${jwt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.axis</groupId>
|
|
||||||
<artifactId>axis</artifactId>
|
|
||||||
<version>1.4</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.axis</groupId>
|
|
||||||
<artifactId>axis-jaxrpc</artifactId>
|
|
||||||
<version>1.4</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>com.roufid.tutorials</groupId>-->
|
|
||||||
<!-- <artifactId>example-app</artifactId>-->
|
|
||||||
<!-- <version>1.0</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- JAX-WS API -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.xml.ws</groupId>
|
|
||||||
<artifactId>jaxws-api</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- JAX-WS Runtime -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.sun.xml.ws</groupId>
|
|
||||||
<artifactId>jaxws-rt</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 工具集 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.hutool</groupId>
|
|
||||||
<artifactId>hutool-all</artifactId>
|
|
||||||
<version>5.7.15</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>axis</groupId>
|
|
||||||
<artifactId>axis-wsdl4j</artifactId>
|
|
||||||
<version>1.5.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-discovery</groupId>
|
|
||||||
<artifactId>commons-discovery</artifactId>
|
|
||||||
<version>0.2</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Jaxb -->
|
<!-- Jaxb -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.xml.bind</groupId>
|
<groupId>javax.xml.bind</groupId>
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
package com.ruoyi;
|
package com.ruoyi;
|
||||||
|
|
||||||
import com.ruoyi.common.task.EquTask;
|
|
||||||
import com.ruoyi.common.tcp.CarTcpNettyServer;
|
import com.ruoyi.common.tcp.CarTcpNettyServer;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
|
@ -14,14 +11,17 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||||
@EnableScheduling
|
|
||||||
public class RuoYiApplication
|
public class RuoYiApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
|
|
||||||
SpringApplication.run(RuoYiApplication.class, args);
|
SpringApplication.run(RuoYiApplication.class, args);
|
||||||
|
try {
|
||||||
|
new CarTcpNettyServer().bind(8001);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||||
" .-------. ____ __ \n" +
|
" .-------. ____ __ \n" +
|
||||||
" | _ _ \\ \\ \\ / / \n" +
|
" | _ _ \\ \\ \\ / / \n" +
|
||||||
|
|
|
@ -1,23 +1,15 @@
|
||||||
package com.ruoyi.common.task;
|
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.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.ruoyi.common.task.forest.MyTaskClient;
|
import com.ruoyi.common.task.forest.MyTaskClient;
|
||||||
import com.ruoyi.common.utils.http.HttpUtils;
|
|
||||||
import com.ruoyi.common.utils.sign.Md5Utils;
|
import com.ruoyi.common.utils.sign.Md5Utils;
|
||||||
import com.ruoyi.project.oil.domain.monitor.ThDevice;
|
import com.ruoyi.project.oil.domain.monitor.ThDevice;
|
||||||
import com.ruoyi.project.outside.service.OutSideService;
|
import com.ruoyi.project.outside.service.OutSideService;
|
||||||
import org.apache.http.client.HttpClient;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class EquTask {
|
public class EquTask {
|
||||||
|
@ -31,36 +23,17 @@ public class EquTask {
|
||||||
/**
|
/**
|
||||||
* 港口原有设备对接
|
* 港口原有设备对接
|
||||||
*/
|
*/
|
||||||
@Scheduled(fixedRate = 10000)
|
|
||||||
public void equ(){
|
public void equ(){
|
||||||
String hash = "16EA8A305FB58BE0730DD67F04F022F4";
|
String tokenByStr = myClient.loginRequest("admin", Md5Utils.hash("123456"));
|
||||||
|
JSONObject tokenByJson = JSONObject.parseObject(tokenByStr);
|
||||||
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");
|
JSONObject dataByJson = tokenByJson.getJSONObject("data");
|
||||||
String token = dataByJson.getString("token");
|
String token = dataByJson.getString("token");
|
||||||
ArrayList<ThDevice> equLists = new ArrayList<>(); //查询 数据库 获取 港口以前的 设备信息
|
ArrayList<ThDevice> equLists = new ArrayList<>(); //查询 数据库 获取 港口以前的 设备信息
|
||||||
ThDevice thDevice = new ThDevice();
|
|
||||||
thDevice.setSn("e75153fd53d243289057ffec33f36cb9");
|
|
||||||
thDevice.setName("油气回收voc监测设备3#");
|
|
||||||
equLists.add(thDevice);
|
|
||||||
equLists.forEach(e->{
|
equLists.forEach(e->{
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
String vocByStr = myClient.selectRequest(token, e.getSn(), e.getName());
|
||||||
|
JSONObject vocByJson = JSONObject.parseObject(vocByStr);
|
||||||
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");
|
JSONObject vocDataByJson = vocByJson.getJSONObject("data");
|
||||||
JSONArray vocByArray = vocDataByJson.getJSONArray("array");
|
JSONArray vocByArray = vocDataByJson.getJSONArray("array");
|
||||||
System.out.println(vocByArray.toJSONString());
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,4 @@ public interface MyTaskClient {
|
||||||
)
|
)
|
||||||
String selectRequest(@Body String token,@Var("sensorUId") String sensorUId,@Var("label")String label);
|
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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
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<String> phones, String msg) throws Exception {
|
|
||||||
|
|
||||||
System.out.println("开始调用webservice");
|
|
||||||
List<Map<String, Object>> storeItemList_ = new ArrayList<>();
|
|
||||||
String endpoint = "http://10.171.19.193:8080/dxpt/ws/shortMessageWs?wsdl";
|
|
||||||
String soapaction = "http://service.cxf.com/";
|
|
||||||
String method = "returnMassages";
|
|
||||||
org.apache.axis.client.Service service = new org.apache.axis.client.Service();
|
|
||||||
Call call = (Call) service.createCall();// 通过service创建call对象
|
|
||||||
call.setTargetEndpointAddress(endpoint);
|
|
||||||
call.setOperationName(new QName(soapaction, method));
|
|
||||||
call.addParameter(new QName(soapaction, "phone"),
|
|
||||||
org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
|
|
||||||
call.addParameter(new QName(soapaction, "msg"),
|
|
||||||
org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
|
|
||||||
call.addParameter(new QName(soapaction, "Dwdm"),
|
|
||||||
org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
|
|
||||||
|
|
||||||
call.setUseSOAPAction(true);
|
|
||||||
//call.setReturnType(org.apache.axis.encoding.XMLType.SOAP_STRING); //返回参数的类型
|
|
||||||
call.setReturnType(org.apache.axis.encoding.XMLType.SOAP_VECTOR);
|
|
||||||
//call.setReturnType(XMLType.XSD_STRING);
|
|
||||||
call.setSOAPActionURI(soapaction + method);
|
|
||||||
java.util.Vector xmlStr = (java.util.Vector) call.invoke(new Object[]{StringUtils.collectionToCommaDelimitedString(phones), msg, "SGJT-山港集团"});
|
|
||||||
System.out.println("webservice response content :" + StringUtils.collectionToCommaDelimitedString(xmlStr));
|
|
||||||
return StringUtils.collectionToCommaDelimitedString(xmlStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
Collection<String> objects = new ArrayList<>();
|
|
||||||
objects.add("18437762352");
|
|
||||||
try {
|
|
||||||
sendMessage(objects,"ceshi");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,200 +0,0 @@
|
||||||
package com.ruoyi.common.wsdl;
|
|
||||||
|
|
||||||
|
|
||||||
import ch.qos.logback.core.net.server.Client;
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import org.apache.axis.client.Call;
|
|
||||||
import org.apache.axis.client.Service;
|
|
||||||
import org.apache.axis.encoding.XMLType;
|
|
||||||
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
|
|
||||||
import org.apache.axis.encoding.ser.BeanSerializerFactory;
|
|
||||||
import org.apache.axis.message.SOAPHeaderElement;
|
|
||||||
import org.apache.axis.types.Schema;
|
|
||||||
import org.apache.commons.collections4.MapUtils;
|
|
||||||
import org.apache.commons.compress.utils.Lists;
|
|
||||||
|
|
||||||
import javax.xml.namespace.QName;
|
|
||||||
import javax.xml.rpc.ParameterMode;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class WebServiceUtils {
|
|
||||||
// 接口调用地址
|
|
||||||
private static String url = "http://10.171.19.193:8080/dxpt/ws/shortMessageWs?wsdl";
|
|
||||||
// 命名空间
|
|
||||||
private static String namespace = "http://service.cxf.com/";
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
|
||||||
map.put("phone","18437762352");
|
|
||||||
map.put("msg","ceshi");
|
|
||||||
map.put("Dwdm","SGJT-山港集团");
|
|
||||||
String call = call("returnMassages", map);
|
|
||||||
System.out.println(call);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WebService - 调用接口
|
|
||||||
*
|
|
||||||
* @param methodName 函数名
|
|
||||||
* @param params 参数
|
|
||||||
* @param clazz 返回对象class
|
|
||||||
* @return 返回结果(Object)
|
|
||||||
*/
|
|
||||||
public static <T> T call(String methodName, Map<String, String> params, Class<T> clazz) {
|
|
||||||
// log.info("调用 WebService 发送参数==>" + JsonUtil.object2Json(params));
|
|
||||||
String soapActionURI = namespace + methodName;
|
|
||||||
try {
|
|
||||||
Service service = new Service();
|
|
||||||
|
|
||||||
SOAPHeaderElement header = new SOAPHeaderElement(namespace, methodName);
|
|
||||||
header.setNamespaceURI(namespace);
|
|
||||||
|
|
||||||
Call call = (Call) service.createCall();
|
|
||||||
call.setTargetEndpointAddress(url);
|
|
||||||
|
|
||||||
call.setOperationName(new QName(namespace, methodName));
|
|
||||||
|
|
||||||
// 添加参数
|
|
||||||
List<String> parameterList = Lists.newArrayList();
|
|
||||||
if (params != null) {
|
|
||||||
Set<String> paramsKey = params.keySet();
|
|
||||||
for (String key : paramsKey) {
|
|
||||||
call.addParameter(new QName(namespace, key), XMLType.XSD_STRING, ParameterMode.IN);
|
|
||||||
String pValue = MapUtils.getString(params, key);
|
|
||||||
header.addChildElement(key).setValue(pValue);
|
|
||||||
parameterList.add(pValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
call.setUseSOAPAction(true);
|
|
||||||
call.setSOAPActionURI(soapActionURI);
|
|
||||||
call.addHeader(header);
|
|
||||||
|
|
||||||
// 进行序列化 实体类也要序列化 implements Serializable
|
|
||||||
call.registerTypeMapping(clazz, new QName(namespace, soapActionURI),
|
|
||||||
new BeanSerializerFactory(clazz, new QName(namespace, soapActionURI)),
|
|
||||||
new BeanDeserializerFactory(clazz, new QName(namespace, soapActionURI)));
|
|
||||||
// 设置输出的类
|
|
||||||
call.setReturnClass(clazz);
|
|
||||||
// 接口返回结果
|
|
||||||
T result = (T) call.invoke(parameterList.toArray());
|
|
||||||
// log.info("调用 WebService 接口返回===>" + result);
|
|
||||||
return result;
|
|
||||||
} catch (Exception e) {
|
|
||||||
// log.error("调用 WebService 接口错误信息==>" + e.getMessage());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WebService - 接口调用
|
|
||||||
*
|
|
||||||
* @param methodName 函数名
|
|
||||||
* @param params 参数
|
|
||||||
* @return 返回结果(String)
|
|
||||||
*/
|
|
||||||
public static String call(String methodName, Map<String, String> params) {
|
|
||||||
// log.info("调用 WebService 发送参数==>" + JsonUtil.object2Json(params));
|
|
||||||
System.out.println("调用 WebService 发送参数==>" + JSONObject.toJSONString(params));
|
|
||||||
String soapActionURI = namespace + methodName;
|
|
||||||
try {
|
|
||||||
Service service = new Service();
|
|
||||||
|
|
||||||
SOAPHeaderElement header = new SOAPHeaderElement(namespace, methodName);
|
|
||||||
header.setNamespaceURI(namespace);
|
|
||||||
|
|
||||||
Call call = (Call) service.createCall();
|
|
||||||
call.setTargetEndpointAddress(url);
|
|
||||||
|
|
||||||
call.setOperationName(new QName(namespace, methodName));
|
|
||||||
|
|
||||||
// 添加参数
|
|
||||||
List<String> parameterList = Lists.newArrayList();
|
|
||||||
if (params != null) {
|
|
||||||
Set<String> paramsKey = params.keySet();
|
|
||||||
for (String key : paramsKey) {
|
|
||||||
call.addParameter(new QName(namespace, key), XMLType.XSD_STRING, ParameterMode.IN);
|
|
||||||
String pValue = MapUtils.getString(params, key);
|
|
||||||
header.addChildElement(key).setValue(pValue);
|
|
||||||
parameterList.add(pValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
call.setUseSOAPAction(true);
|
|
||||||
call.setSOAPActionURI(soapActionURI);
|
|
||||||
call.addHeader(header);
|
|
||||||
// 设置返回类型
|
|
||||||
call.setReturnType(new QName(namespace, methodName), String.class);
|
|
||||||
// 接口返回结果
|
|
||||||
|
|
||||||
String result = (String) call.invoke(parameterList.toArray());
|
|
||||||
// log.info("调用 WebService 接口返回===>" + result);
|
|
||||||
System.out.println("调用 WebService 接口返回===>" + result);
|
|
||||||
return result;
|
|
||||||
} catch (Exception e) {
|
|
||||||
// log.error("调用 WebService 接口错误信息==>" + e.getMessage());
|
|
||||||
System.out.println("调用 WebService 接口返回===>" + e.getMessage());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WebService - 调用接口
|
|
||||||
*
|
|
||||||
* @param methodName 函数名
|
|
||||||
* @param params 参数
|
|
||||||
* @return 返回结果(String)
|
|
||||||
*/
|
|
||||||
public static String call2(String methodName, Map<String, String> params) {
|
|
||||||
// log.info("调用 WebService 发送参数==>" + JsonUtil.object2Json(params));
|
|
||||||
String soapActionURI = namespace + methodName;
|
|
||||||
try {
|
|
||||||
Service service = new Service();
|
|
||||||
|
|
||||||
SOAPHeaderElement header = new SOAPHeaderElement(namespace, methodName);
|
|
||||||
header.setNamespaceURI(namespace);
|
|
||||||
|
|
||||||
Call call = (Call) service.createCall();
|
|
||||||
call.setTargetEndpointAddress(url);
|
|
||||||
|
|
||||||
call.setOperationName(new QName(namespace, methodName));
|
|
||||||
|
|
||||||
// 添加参数
|
|
||||||
List<String> parameterList = Lists.newArrayList();
|
|
||||||
if (params != null) {
|
|
||||||
Set<String> paramsKey = params.keySet();
|
|
||||||
for (String key : paramsKey) {
|
|
||||||
call.addParameter(new QName(namespace, key), XMLType.XSD_STRING, ParameterMode.IN);
|
|
||||||
String pValue = MapUtils.getString(params, key);
|
|
||||||
header.addChildElement(key).setValue(pValue);
|
|
||||||
parameterList.add(pValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
call.setUseSOAPAction(true);
|
|
||||||
call.setSOAPActionURI(soapActionURI);
|
|
||||||
call.addHeader(header);
|
|
||||||
// 设置返回类型
|
|
||||||
call.setReturnType(XMLType.XSD_SCHEMA);
|
|
||||||
// 接口返回结果
|
|
||||||
Schema schemaResult = (Schema)call.invoke(parameterList.toArray());
|
|
||||||
String result = "";
|
|
||||||
for(int i = 0; i<schemaResult.get_any().length; i++){
|
|
||||||
result = result + schemaResult.get_any()[i];
|
|
||||||
}
|
|
||||||
// log.error("调用 WebService 接口返回===>" + result);
|
|
||||||
return result;
|
|
||||||
} catch (Exception e) {
|
|
||||||
// log.error("调用 WebService 接口错误信息==>" + e.getMessage());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,7 +6,6 @@ import com.ruoyi.framework.web.domain.BaseEntity;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
public class ThDevice extends BaseEntity {
|
public class ThDevice extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
|
@ -1,268 +1,268 @@
|
||||||
//package com.ruoyi.project.system.controller;
|
package com.ruoyi.project.system.controller;
|
||||||
//
|
|
||||||
//
|
|
||||||
//import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
//import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
//import com.banboocloud.Codec.BamboocloudFacade;
|
import com.banboocloud.Codec.BamboocloudFacade;
|
||||||
//import com.ruoyi.common.utils.reflect.ReflectUtils;
|
import com.ruoyi.common.utils.reflect.ReflectUtils;
|
||||||
//import com.ruoyi.framework.web.controller.BaseController;
|
import com.ruoyi.framework.web.controller.BaseController;
|
||||||
//import com.ruoyi.project.system.domain.SysUser;
|
import com.ruoyi.project.system.domain.SysUser;
|
||||||
//import com.ruoyi.project.system.service.ISysDeptService;
|
import com.ruoyi.project.system.service.ISysDeptService;
|
||||||
//import com.ruoyi.project.system.service.ISysPostService;
|
import com.ruoyi.project.system.service.ISysPostService;
|
||||||
//import com.ruoyi.project.system.service.ISysRoleService;
|
import com.ruoyi.project.system.service.ISysRoleService;
|
||||||
//import com.ruoyi.project.system.service.ISysUserService;
|
import com.ruoyi.project.system.service.ISysUserService;
|
||||||
//import com.ruoyi.project.system.utils.BamboocloudUtils;
|
import com.ruoyi.project.system.utils.BamboocloudUtils;
|
||||||
//
|
|
||||||
//import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
//import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
//import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
//import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
//import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
//import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
//
|
|
||||||
//import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
//import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
//import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
//import java.io.IOException;
|
import java.io.IOException;
|
||||||
//import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
//import java.util.*;
|
import java.util.*;
|
||||||
//
|
|
||||||
///**
|
/**
|
||||||
// * swagger 用户测试方法
|
* swagger 用户测试方法
|
||||||
// * 加密认证
|
* 加密认证
|
||||||
// * @author ruoyi
|
* @author ruoyi
|
||||||
// */
|
*/
|
||||||
//
|
|
||||||
//@RestController
|
@RestController
|
||||||
//@RequestMapping("/bbc/user")
|
@RequestMapping("/bbc/user")
|
||||||
//public class BbcController extends BaseController {
|
public class BbcController extends BaseController {
|
||||||
//
|
|
||||||
// private String bimRequestId;
|
private String bimRequestId;
|
||||||
//
|
|
||||||
// private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class);
|
private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class);
|
||||||
//
|
|
||||||
//
|
|
||||||
// @Autowired
|
@Autowired
|
||||||
// private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
//
|
|
||||||
// @Autowired
|
@Autowired
|
||||||
// private ISysRoleService roleService;
|
private ISysRoleService roleService;
|
||||||
//
|
|
||||||
// @Autowired
|
@Autowired
|
||||||
// private ISysDeptService deptService;
|
private ISysDeptService deptService;
|
||||||
//
|
|
||||||
// @Autowired
|
@Autowired
|
||||||
// private ISysPostService postService;
|
private ISysPostService postService;
|
||||||
//
|
|
||||||
//// @ApiOperation("测试")
|
// @ApiOperation("测试")
|
||||||
// @RequestMapping()
|
@RequestMapping()
|
||||||
// public JSONObject bbcUser() {
|
public JSONObject bbcUser() {
|
||||||
//
|
|
||||||
// JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
// jsonObject.put("resultCode", "0");
|
jsonObject.put("resultCode", "0");
|
||||||
// jsonObject.put("message", "success");
|
jsonObject.put("message", "success");
|
||||||
// return jsonObject;
|
return jsonObject;
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//// @ApiOperation("对象属性字段查询")
|
// @ApiOperation("对象属性字段查询")
|
||||||
// @PostMapping("/schemaService")
|
@PostMapping("/schemaService")
|
||||||
// public String SchemaService(HttpServletRequest req, HttpServletResponse resp) {
|
public String SchemaService(HttpServletRequest req, HttpServletResponse resp) {
|
||||||
//
|
|
||||||
// JSONObject jsonObject = new JSONObject();
|
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<String, Object> reqmap = (Map<String, Object>) 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<String, List<Map<String, Object>>> 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);
|
|
||||||
// //<Object> values = jsonObject.values();
|
|
||||||
// return mapJs;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// jsonObject.put("bimRequestId", bimRequestId);
|
|
||||||
// jsonObject.put("resultCode", "505");
|
|
||||||
// jsonObject.put("message", "连接失败,请检查连接器配置的参数");
|
|
||||||
// logger.info(jsonObject.toJSONString());
|
|
||||||
// String mapJs = JSON.toJSONString(jsonObject);
|
|
||||||
// //返回加密的json字符串
|
|
||||||
// mapJs = BamboocloudFacade.encrypt(mapJs, "123456", "AES");
|
|
||||||
// return mapJs;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//// @ApiOperation("新增用户")
|
|
||||||
//// @ApiImplicitParam(name = "user", value = "新增用户信息", dataType = "User")
|
|
||||||
// @PostMapping("/UserCreateService")
|
|
||||||
// @ResponseBody
|
|
||||||
// public String userCreateService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
|
||||||
//
|
|
||||||
// Map<String, Object> schema = new HashMap<String, Object>();
|
|
||||||
//
|
|
||||||
// JSONObject jsonObject = new JSONObject();
|
|
||||||
//
|
|
||||||
// StringBuilder sb = stringBuilder(req);
|
// StringBuilder sb = stringBuilder(req);
|
||||||
// //修改多值的属性格式方便转换
|
String bodyparam= BamboocloudUtils.getRequestBody(req);
|
||||||
|
logger.info("json--param-->" + bodyparam);
|
||||||
// String bodyparam = sb.toString();
|
// String bodyparam = sb.toString();
|
||||||
// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES");
|
//解密json字符传
|
||||||
// String p = bodyparam;
|
bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES");
|
||||||
// String z = "[\"";
|
logger.info("json--param-->" + bodyparam);
|
||||||
// String y = "\"]";
|
Map<String, Object> reqmap = (Map<String, Object>) JSON.parse(bodyparam);
|
||||||
// bodyparam.indexOf(z);
|
//验证签名
|
||||||
// bodyparam.indexOf(y);
|
if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) {
|
||||||
// while (bodyparam.contains(z)) {
|
String username = (String) reqmap.get("bimRemoteUser");
|
||||||
// p = bodyparam.substring(bodyparam.indexOf(z), bodyparam.indexOf(y) + 2).replace(z, "\"").replace(y, "\"").replace("\",\"", ",");
|
String password = (String) reqmap.get("bimRemotePwd");
|
||||||
// bodyparam = bodyparam.substring(0, bodyparam.indexOf(z)) + p + bodyparam.substring(bodyparam.indexOf(y) + 2, bodyparam.length());
|
//判断接口中的调用名及调用密码是否正确
|
||||||
// }
|
if (BamboocloudUtils.checkUsernamePassword(username, password)) {
|
||||||
// logger.info("json--param-->" + bodyparam);
|
// //添加返回的对象及属性字段名
|
||||||
// Map<String, Object> reqmap = (Map<String, Object>) JSON.parse(bodyparam);
|
// MapJson mapJson = new MapJson();
|
||||||
// String username = (String) reqmap.get("bimRemoteUser");
|
// Map<String, List<Map<String, Object>>> map = new HashMap<>();
|
||||||
// String password = (String) reqmap.get("bimRemotePwd");
|
// jsonObject.put("account", mapJson.accountList());
|
||||||
//
|
// jsonObject.put("organization", mapJson.organizationList());
|
||||||
// if (BamboocloudUtils.checkUsernamePassword(username, password)) {
|
// 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);
|
||||||
//// User user = createUpdateUser(reqmap);
|
logger.info(jsonObject.toJSONString());
|
||||||
// SysUser user = new SysUser();
|
//返回加密的json字符串
|
||||||
// //用户创建
|
mapJs = BamboocloudFacade.encrypt(mapJs, "123456", "AES");
|
||||||
// userService.insertUser(user);
|
//jsonObject.put(map);
|
||||||
// //获取返回给IAM连接器的唯一标识,用于后续该条数据的更新修改删除
|
//<Object> values = jsonObject.values();
|
||||||
// String uid = user.getUserId() + "";
|
return mapJs;
|
||||||
// if (uid != null) {
|
}
|
||||||
// schema.put("uid", uid);
|
}
|
||||||
// schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
jsonObject.put("bimRequestId", bimRequestId);
|
||||||
// schema.put("resultCode", "0");
|
jsonObject.put("resultCode", "505");
|
||||||
// schema.put("message", "success");
|
jsonObject.put("message", "连接失败,请检查连接器配置的参数");
|
||||||
// } else {
|
logger.info(jsonObject.toJSONString());
|
||||||
// schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
String mapJs = JSON.toJSONString(jsonObject);
|
||||||
// schema.put("resultCode", "500");
|
//返回加密的json字符串
|
||||||
// schema.put("message", "账号创建失败");
|
mapJs = BamboocloudFacade.encrypt(mapJs, "123456", "AES");
|
||||||
// }
|
return mapJs;
|
||||||
// String mapJson = JSON.toJSONString(schema);
|
}
|
||||||
// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES");
|
|
||||||
// return mapJson;
|
// @ApiOperation("新增用户")
|
||||||
// }
|
// @ApiImplicitParam(name = "user", value = "新增用户信息", dataType = "User")
|
||||||
// schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
@PostMapping("/UserCreateService")
|
||||||
// schema.put("resultCode", "500");
|
@ResponseBody
|
||||||
// schema.put("message", "账号创建失败,请检查连接器配置的参数");
|
public String userCreateService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||||
// String mapJson = JSON.toJSONString(schema);
|
|
||||||
// //返回加密的json字符串
|
Map<String, Object> schema = new HashMap<String, Object>();
|
||||||
// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES");
|
|
||||||
// return mapJson;
|
JSONObject jsonObject = new JSONObject();
|
||||||
// }
|
|
||||||
//
|
StringBuilder sb = stringBuilder(req);
|
||||||
//
|
//修改多值的属性格式方便转换
|
||||||
//// @ApiOperation("修改用户")
|
String bodyparam = sb.toString();
|
||||||
//// @ApiImplicitParam(name = "user", value = "修改用户信息", dataType = "User")
|
bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES");
|
||||||
// @PostMapping("/UserUpdateService")
|
String p = bodyparam;
|
||||||
// @ResponseBody
|
String z = "[\"";
|
||||||
// public String userUpdateService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
String y = "\"]";
|
||||||
//
|
bodyparam.indexOf(z);
|
||||||
// Map<String, Object> schema = new HashMap<String, Object>();
|
bodyparam.indexOf(y);
|
||||||
//
|
while (bodyparam.contains(z)) {
|
||||||
// JSONObject jsonObject = new JSONObject();
|
p = bodyparam.substring(bodyparam.indexOf(z), bodyparam.indexOf(y) + 2).replace(z, "\"").replace(y, "\"").replace("\",\"", ",");
|
||||||
//
|
bodyparam = bodyparam.substring(0, bodyparam.indexOf(z)) + p + bodyparam.substring(bodyparam.indexOf(y) + 2, bodyparam.length());
|
||||||
// StringBuilder sb = stringBuilder(req);
|
}
|
||||||
//
|
logger.info("json--param-->" + bodyparam);
|
||||||
// String bodyparam = sb.toString();
|
Map<String, Object> reqmap = (Map<String, Object>) JSON.parse(bodyparam);
|
||||||
//
|
String username = (String) reqmap.get("bimRemoteUser");
|
||||||
// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES");
|
String password = (String) reqmap.get("bimRemotePwd");
|
||||||
// //修改多值的属性格式方便转换
|
|
||||||
// String p = bodyparam;
|
if (BamboocloudUtils.checkUsernamePassword(username, password)) {
|
||||||
// String bdp = bodyparam;
|
/**
|
||||||
// String z = "[\"";
|
* 新增用户
|
||||||
// String y = "\"]";
|
*/
|
||||||
// bodyparam.indexOf(z);
|
//获取用户创建所需的参数
|
||||||
// bodyparam.indexOf(y);
|
// User user = createUpdateUser(reqmap);
|
||||||
// while (bodyparam.contains(z)) {
|
SysUser user = new SysUser();
|
||||||
// p = bodyparam.substring(bodyparam.indexOf(z), bodyparam.indexOf(y) + 2).replace(z, "\"").replace(y, "\"").replace("\",\"", ",");
|
//用户创建
|
||||||
// bodyparam = bodyparam.substring(0, bodyparam.indexOf(z)) + p + bodyparam.substring(bodyparam.indexOf(y) + 2, bodyparam.length());
|
userService.insertUser(user);
|
||||||
// }
|
//获取返回给IAM连接器的唯一标识,用于后续该条数据的更新修改删除
|
||||||
// logger.info("json--param-->" + bodyparam);
|
String uid = user.getUserId() + "";
|
||||||
// Map<String, Object> reqmap = (Map<String, Object>) JSON.parse(bodyparam);
|
if (uid != null) {
|
||||||
// String username = (String) reqmap.get("bimRemoteUser");
|
schema.put("uid", uid);
|
||||||
// String password = (String) reqmap.get("bimRemotePwd");
|
schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
||||||
// if (BamboocloudUtils.checkUsernamePassword(username, password)) {
|
schema.put("resultCode", "0");
|
||||||
// SysUser user = new SysUser();
|
schema.put("message", "success");
|
||||||
// //获取用于更新的参数
|
} else {
|
||||||
//// user = createUpdateUser(reqmap);
|
schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
||||||
// //获取用于更新的唯一标识
|
schema.put("resultCode", "500");
|
||||||
// user.setUserId(Long.valueOf(String.valueOf(reqmap.get("bimUid"))));
|
schema.put("message", "账号创建失败");
|
||||||
// //更新用户
|
}
|
||||||
// userService.updateUser(user);
|
String mapJson = JSON.toJSONString(schema);
|
||||||
// schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES");
|
||||||
// schema.put("resultCode", "0");
|
return mapJson;
|
||||||
// schema.put("message", "success");
|
}
|
||||||
// String mapJson = JSON.toJSONString(schema);
|
schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
||||||
// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES");
|
schema.put("resultCode", "500");
|
||||||
// logger.info("response----->" + schema);
|
schema.put("message", "账号创建失败,请检查连接器配置的参数");
|
||||||
// return mapJson;
|
String mapJson = JSON.toJSONString(schema);
|
||||||
// }
|
//返回加密的json字符串
|
||||||
// schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES");
|
||||||
// schema.put("resultCode", "500");
|
return mapJson;
|
||||||
// schema.put("message", "账号更新失败,请检查连接器配置的参数");
|
}
|
||||||
// String mapJson = JSON.toJSONString(schema);
|
|
||||||
// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES");
|
|
||||||
// logger.info("response----->" + schema);
|
// @ApiOperation("修改用户")
|
||||||
// return mapJson;
|
// @ApiImplicitParam(name = "user", value = "修改用户信息", dataType = "User")
|
||||||
// }
|
@PostMapping("/UserUpdateService")
|
||||||
//
|
@ResponseBody
|
||||||
//
|
public String userUpdateService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||||
// public StringBuilder stringBuilder(HttpServletRequest req) {
|
|
||||||
// BufferedReader br = null;
|
Map<String, Object> schema = new HashMap<String, Object>();
|
||||||
// StringBuilder sb = new StringBuilder();
|
|
||||||
// String str = "";
|
JSONObject jsonObject = new JSONObject();
|
||||||
// try {
|
|
||||||
// br = req.getReader();
|
StringBuilder sb = stringBuilder(req);
|
||||||
// while ((str = br.readLine()) != null) {
|
|
||||||
// sb.append(str);
|
String bodyparam = sb.toString();
|
||||||
// }
|
|
||||||
// br.close();
|
bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES");
|
||||||
// } catch (IOException e) {
|
//修改多值的属性格式方便转换
|
||||||
// e.printStackTrace();
|
String p = bodyparam;
|
||||||
// if (br != null)
|
String bdp = bodyparam;
|
||||||
// try {
|
String z = "[\"";
|
||||||
// br.close();
|
String y = "\"]";
|
||||||
// } catch (IOException eo) {
|
bodyparam.indexOf(z);
|
||||||
// eo.printStackTrace();
|
bodyparam.indexOf(y);
|
||||||
// }
|
while (bodyparam.contains(z)) {
|
||||||
// } finally {
|
p = bodyparam.substring(bodyparam.indexOf(z), bodyparam.indexOf(y) + 2).replace(z, "\"").replace(y, "\"").replace("\",\"", ",");
|
||||||
// if (br != null) {
|
bodyparam = bodyparam.substring(0, bodyparam.indexOf(z)) + p + bodyparam.substring(bodyparam.indexOf(y) + 2, bodyparam.length());
|
||||||
// try {
|
}
|
||||||
// br.close();
|
logger.info("json--param-->" + bodyparam);
|
||||||
// } catch (IOException e) {
|
Map<String, Object> reqmap = (Map<String, Object>) JSON.parse(bodyparam);
|
||||||
// e.printStackTrace();
|
String username = (String) reqmap.get("bimRemoteUser");
|
||||||
// }
|
String password = (String) reqmap.get("bimRemotePwd");
|
||||||
// }
|
if (BamboocloudUtils.checkUsernamePassword(username, password)) {
|
||||||
// }
|
SysUser user = new SysUser();
|
||||||
// return sb;
|
//获取用于更新的参数
|
||||||
// }
|
// user = createUpdateUser(reqmap);
|
||||||
//
|
//获取用于更新的唯一标识
|
||||||
//}
|
user.setUserId(Long.valueOf(String.valueOf(reqmap.get("bimUid"))));
|
||||||
//
|
//更新用户
|
||||||
|
userService.updateUser(user);
|
||||||
|
schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
||||||
|
schema.put("resultCode", "0");
|
||||||
|
schema.put("message", "success");
|
||||||
|
String mapJson = JSON.toJSONString(schema);
|
||||||
|
mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES");
|
||||||
|
logger.info("response----->" + schema);
|
||||||
|
return mapJson;
|
||||||
|
}
|
||||||
|
schema.put("bimRequestId", reqmap.get("bimRequestId"));
|
||||||
|
schema.put("resultCode", "500");
|
||||||
|
schema.put("message", "账号更新失败,请检查连接器配置的参数");
|
||||||
|
String mapJson = JSON.toJSONString(schema);
|
||||||
|
mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES");
|
||||||
|
logger.info("response----->" + schema);
|
||||||
|
return mapJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public StringBuilder stringBuilder(HttpServletRequest req) {
|
||||||
|
BufferedReader br = null;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String str = "";
|
||||||
|
try {
|
||||||
|
br = req.getReader();
|
||||||
|
while ((str = br.readLine()) != null) {
|
||||||
|
sb.append(str);
|
||||||
|
}
|
||||||
|
br.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
if (br != null)
|
||||||
|
try {
|
||||||
|
br.close();
|
||||||
|
} catch (IOException eo) {
|
||||||
|
eo.printStackTrace();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (br != null) {
|
||||||
|
try {
|
||||||
|
br.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ spring:
|
||||||
# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
|
# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
|
||||||
# username: root
|
# username: root
|
||||||
# password: password
|
# password: password
|
||||||
url: jdbc:oracle:thin:@10.169.28.44:1521/orcl
|
url: jdbc:oracle:thin:@218.58.79.146:17521/orcl
|
||||||
username: spg_voc
|
username: system
|
||||||
password: SPG$spgvoc_24!
|
password: oracle
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|
|
@ -73,15 +73,15 @@ spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
# host: 192.168.31.105
|
host: 192.168.31.105
|
||||||
host: 127.0.0.1
|
# host: 127.0.0.1
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 0
|
database: 0
|
||||||
# 密码
|
# 密码
|
||||||
password: 123456
|
# password: 123456
|
||||||
# password: admin123!
|
password: admin123!
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
lettuce:
|
lettuce:
|
||||||
|
|
Loading…
Reference in New Issue