Compare commits
2 Commits
71071e2283
...
14e5c154ec
Author | SHA1 | Date |
---|---|---|
|
14e5c154ec | |
|
6721936cef |
|
@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ public class YunKongMessageSchedule {
|
||||||
|
|
||||||
String url = host + "/system/common/queryYKInterface";
|
String url = host + "/system/common/queryYKInterface";
|
||||||
HttpClient httpClient = new HttpClient(PostDataFormat.RAW);
|
HttpClient httpClient = new HttpClient(PostDataFormat.RAW);
|
||||||
log.info("curl -k -X POST -H 'Content-Type: application/json' -d '{}' '{}'", JSON.toJSONString(request), url);
|
log.info("【运控接口】curl -k -X POST -H 'Content-Type: application/json' -d '{}' '{}'", JSON.toJSONString(request), url);
|
||||||
Result result = httpClient.post(new HashMap<>(), request, url);
|
Result result = httpClient.post(new HashMap<>(), request, url);
|
||||||
Assert.isTrue(result.isSuccess(), result.getMessage());
|
Assert.isTrue(result.isSuccess(), result.getMessage());
|
||||||
|
|
||||||
|
@ -70,6 +71,10 @@ public class YunKongMessageSchedule {
|
||||||
for (int i = 0; i < array.size(); i++) {
|
for (int i = 0; i < array.size(); i++) {
|
||||||
JSONObject item = array.getJSONObject(i);
|
JSONObject item = array.getJSONObject(i);
|
||||||
String externalId = item.getString("record_id");
|
String externalId = item.getString("record_id");
|
||||||
|
if (StringUtils.isEmpty(externalId)) {
|
||||||
|
log.info("【运控接口】当前外部id为null:" + item.toJSONString());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Message message = oldMessages.stream()
|
Message message = oldMessages.stream()
|
||||||
.filter(m -> externalId.equals(m.getExternalId()))
|
.filter(m -> externalId.equals(m.getExternalId()))
|
||||||
.findFirst().orElse(new Message());
|
.findFirst().orElse(new Message());
|
||||||
|
|
|
@ -70,6 +70,7 @@ public class TrxServiceImpl implements TrxService {
|
||||||
log.info("调用天融信获取随机字符串接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
log.info("调用天融信获取随机字符串接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
||||||
HttpResponse response = httpRequest.execute();
|
HttpResponse response = httpRequest.execute();
|
||||||
result = JSONObject.parseObject(response.body());
|
result = JSONObject.parseObject(response.body());
|
||||||
|
log.info("调用天融信获取随机字符串接口, 响应信息:" + JSONObject.toJSONString(result));
|
||||||
if ("-1".equals(result.getString("result"))) {
|
if ("-1".equals(result.getString("result"))) {
|
||||||
return new GeneralResult(false, "获取随机数失败" + result.getString("errmsg"));
|
return new GeneralResult(false, "获取随机数失败" + result.getString("errmsg"));
|
||||||
}
|
}
|
||||||
|
@ -95,6 +96,7 @@ public class TrxServiceImpl implements TrxService {
|
||||||
log.info("调用天融信获取随机字符串接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
log.info("调用天融信获取随机字符串接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
||||||
HttpResponse response = httpRequest.execute();
|
HttpResponse response = httpRequest.execute();
|
||||||
result = JSONObject.parseObject(response.body());
|
result = JSONObject.parseObject(response.body());
|
||||||
|
log.info("调用天融信获取随机字符串接口, 响应信息:" + JSONObject.toJSONString(result));
|
||||||
if ("-1".equals(result.getString("result"))) {
|
if ("-1".equals(result.getString("result"))) {
|
||||||
return new GeneralResult(false, "获取随机数失败" + result.getString("errmsg"));
|
return new GeneralResult(false, "获取随机数失败" + result.getString("errmsg"));
|
||||||
}
|
}
|
||||||
|
@ -146,6 +148,7 @@ public class TrxServiceImpl implements TrxService {
|
||||||
log.info("调用天融信用户登录接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
log.info("调用天融信用户登录接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
||||||
HttpResponse response = httpRequest.execute();
|
HttpResponse response = httpRequest.execute();
|
||||||
result = JSONObject.parseObject(response.body());
|
result = JSONObject.parseObject(response.body());
|
||||||
|
log.info("调用天融信用户登录接口, 响应信息:" + JSONObject.toJSONString(result));
|
||||||
if (!"0".equals(result.getString("result"))) {
|
if (!"0".equals(result.getString("result"))) {
|
||||||
return new GeneralResult(false, "用户登录天融信失败" + result.getString("errmsg"));
|
return new GeneralResult(false, "用户登录天融信失败" + result.getString("errmsg"));
|
||||||
}
|
}
|
||||||
|
@ -194,6 +197,7 @@ public class TrxServiceImpl implements TrxService {
|
||||||
log.info("调用天融信用户软key登录接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
log.info("调用天融信用户软key登录接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
||||||
HttpResponse response = httpRequest.execute();
|
HttpResponse response = httpRequest.execute();
|
||||||
result = JSONObject.parseObject(response.body());
|
result = JSONObject.parseObject(response.body());
|
||||||
|
log.info("调用天融信用户软key登录接口, 响应信息:" + JSONObject.toJSONString(result));
|
||||||
if (!"0".equals(result.getString("result"))) {
|
if (!"0".equals(result.getString("result"))) {
|
||||||
return new GeneralResult(false, "用户登录天融信失败" + result.getString("errmsg"));
|
return new GeneralResult(false, "用户登录天融信失败" + result.getString("errmsg"));
|
||||||
}
|
}
|
||||||
|
@ -319,6 +323,7 @@ public class TrxServiceImpl implements TrxService {
|
||||||
log.info("调用天融信下线接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
log.info("调用天融信下线接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
|
||||||
HttpResponse response = httpRequest.execute();
|
HttpResponse response = httpRequest.execute();
|
||||||
JSONObject result = JSONObject.parseObject(response.body());
|
JSONObject result = JSONObject.parseObject(response.body());
|
||||||
|
log.info("调用天融信下线接口, 响应信息: " + JSONObject.toJSONString(result));
|
||||||
if (!"0".equals(result.getString("result"))) {
|
if (!"0".equals(result.getString("result"))) {
|
||||||
return new GeneralResult(false, "下线失败" + result.getString("msg"));
|
return new GeneralResult(false, "下线失败" + result.getString("msg"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ public class QxUtils {
|
||||||
String str = JSONObject.toJSONString(qxReqVo);
|
String str = JSONObject.toJSONString(qxReqVo);
|
||||||
logger.info("call method[{}] req params[{}]",url,str);
|
logger.info("call method[{}] req params[{}]",url,str);
|
||||||
JSONObject result = JSONObject.parseObject(HttpUtil.post(url,str, 10000));
|
JSONObject result = JSONObject.parseObject(HttpUtil.post(url,str, 10000));
|
||||||
|
logger.info("调用权限系统接口响应信息" + result.toJSONString());
|
||||||
if (!"200".equals(result.getString("status"))) {
|
if (!"200".equals(result.getString("status"))) {
|
||||||
throw new IllegalArgumentException("调用权限系统接口异常" + result.getString("msg"));
|
throw new IllegalArgumentException("调用权限系统接口异常" + result.getString("msg"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue