提交 1dfbe045 authored 作者: 刘海泉's avatar 刘海泉

修改扫描的问题

上级 57789ef3
......@@ -7,6 +7,7 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
......@@ -58,9 +59,10 @@ public class AppIntegralTruckRuleVO {
@ApiModelProperty(value = "预期收益结束范围", example = "")
private String incomeMsg;
public String getIncomeMsg() {
if (incomeBegin == null && incomeEnd !=null) {return "日收益小于等于"+incomeEnd.toString()+"元";}
if (incomeEnd == null && incomeBegin !=null) {return "日收益大于等于"+incomeBegin.toString()+"元";}
return "日收益"+ incomeBegin.toString() + "元—" + incomeEnd.toString()+"元";
if(incomeEnd == null && incomeBegin == null){ return StringUtils.EMPTY;}
if (incomeBegin == null ) {return "日收益小于等于"+incomeEnd+"元";}
if (incomeEnd == null) {return "日收益大于等于"+incomeBegin+"元";}
return "日收益"+ incomeBegin + "元—" + incomeEnd+"元";
}
@ApiModelProperty(value = "创建时间", example = "")
......
......@@ -46,7 +46,7 @@ public class NetworkDriverAccountSyncJob {
param.setMobile(vo.getMobile());
try {
Thread.sleep(2000L);
} catch (Exception e) {
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
networkDriverAccountService.createNetworkDriverAccount(param);
......
......@@ -2,6 +2,7 @@ package com.clx.performance.utils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
......@@ -54,210 +55,6 @@ public class HttpUtils {
private static final int CONNECT_DEFAULT_ROUTE = 5;
/**
* get
*
* @param host
* @param path
* @param headers
* @param querys
* @return
* @throws Exception
*/
public static HttpResponse doGet(String host, String path,
Map<String, String> headers,
Map<String, String> querys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpGet request = new HttpGet(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
return httpClient.execute(request);
}
/**
* post form
*
* @param host
* @param path
* @param headers
* @param querys
* @param bodys
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path,
Map<String, String> headers,
Map<String, String> querys,
Map<String, String> bodys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (bodys != null) {
List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
for (String key : bodys.keySet()) {
nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
}
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
request.setEntity(formEntity);
}
return httpClient.execute(request);
}
/**
* Post String
*
* @param host
* @param path
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path,
Map<String, String> headers,
Map<String, String> querys,
String body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (StringUtils.isNotBlank(body)) {
request.setEntity(new StringEntity(body, "utf-8"));
}
return httpClient.execute(request);
}
/**
* Post stream
*
* @param host
* @param path
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path,
Map<String, String> headers,
Map<String, String> querys,
byte[] body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (body != null) {
request.setEntity(new ByteArrayEntity(body));
}
return httpClient.execute(request);
}
/**
* Put String
*
* @param host
* @param path
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPut(String host, String path,
Map<String, String> headers,
Map<String, String> querys,
String body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPut request = new HttpPut(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (StringUtils.isNotBlank(body)) {
request.setEntity(new StringEntity(body, "utf-8"));
}
return httpClient.execute(request);
}
/**
* Put stream
*
* @param host
* @param path
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPut(String host, String path,
Map<String, String> headers,
Map<String, String> querys,
byte[] body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPut request = new HttpPut(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (body != null) {
request.setEntity(new ByteArrayEntity(body));
}
return httpClient.execute(request);
}
/**
* Delete
*
* @param host
* @param path
* @param headers
* @param querys
* @return
* @throws Exception
*/
public static HttpResponse doDelete(String host, String path,
Map<String, String> headers,
Map<String, String> querys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
return httpClient.execute(request);
}
private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
StringBuilder sbUrl = new StringBuilder();
......@@ -290,44 +87,6 @@ public class HttpUtils {
return sbUrl.toString();
}
private static HttpClient wrapClient(String host) {
HttpClient httpClient = new DefaultHttpClient();
if (host.startsWith("https://")) {
sslClient(httpClient);
}
return httpClient;
}
private static void sslClient(HttpClient httpClient) {
try {
SSLContext ctx = SSLContext.getInstance("TLS");
X509TrustManager tm = new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] xcs, String str) {
}
public void checkServerTrusted(X509Certificate[] xcs, String str) {
}
};
ctx.init(null, new TrustManager[]{tm}, null);
SSLSocketFactory ssf = new SSLSocketFactory(ctx);
ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
ClientConnectionManager ccm = httpClient.getConnectionManager();
SchemeRegistry registry = ccm.getSchemeRegistry();
registry.register(new Scheme("https", 443, ssf));
} catch (KeyManagementException ex) {
throw new RuntimeException(ex);
} catch (NoSuchAlgorithmException ex) {
throw new RuntimeException(ex);
}
}
public static String httpGetRequest(String url) throws Exception {
HttpGet httpGet = new HttpGet(url);
......@@ -391,7 +150,7 @@ public class HttpUtils {
try {
response.close();
} catch (IOException var36) {
var36.printStackTrace();
log.error(ExceptionUtils.getStackTrace(var36));
}
}
......@@ -399,7 +158,7 @@ public class HttpUtils {
try {
in.close();
} catch (IOException var35) {
var35.printStackTrace();
log.error(ExceptionUtils.getStackTrace(var35));
}
}
......
......@@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit;
@Component
public class RedisUtil {
public static final String NAMESPACE_SEPARATOR = "clx_order::";
private final ThreadLocal<String> lockSeqThreadLocal = new ThreadLocal<>();
private final static String COMPARE_AND_DELETE =
"if redis.call('get',KEYS[1]) == ARGV[1] then return redis.call('del',KEYS[1]) " + "else return 0 end";
......@@ -87,13 +86,6 @@ public class RedisUtil {
return setAtomicLockKey(key, lockSeqId, second);
}
private void setLockSeqId(String lockSeqId) {
lockSeqThreadLocal.set(lockSeqId);
}
private String getLockSeqId() {
return lockSeqThreadLocal.get();
}
public Boolean unlock(String key, String uuid) {
RedisConnection redisConnection = redisTemplate.getConnectionFactory().getConnection();
......
package com.clx.performance.utils.zjxl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.exception.ExceptionUtils;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -11,6 +14,7 @@ import java.text.SimpleDateFormat;
* @Date 2023/9/18 13:11
* @Version 1.0
*/
@Slf4j
public class ZJXLPositionUtils {
public ZJXLPositionUtils() {
}
......@@ -29,7 +33,7 @@ public class ZJXLPositionUtils {
try {
return sdf1.format(sdf.parse(time));
} catch (ParseException var4) {
var4.printStackTrace();
log.error(ExceptionUtils.getStackTrace(var4));
return null;
}
}
......
......@@ -8,6 +8,7 @@ import com.msl.common.enums.ResultCodeEnum;
import com.msl.common.exception.ServiceSystemException;
import com.openapi.sdk.service.DataExchangeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -199,7 +200,7 @@ public class ZjxlGpsService {
try {
result = dataExchangeService.postHttps(api, map);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
throw new ServiceSystemException(ResultCodeEnum.FAIL, "中交兴路调用失败");
}
log.info("中交兴路返回数据, api:{}, {}", api, result);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论