Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
5ea85e61
Commit
5ea85e61
authored
Jan 02, 2020
by
shangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sonar问题修改9
parent
7d5642b4
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
36 deletions
+77
-36
AESUtil.java
...in/java/cn/quantgroup/cashloanflowboss/utils/AESUtil.java
+2
-2
GetBiNoAndFinanceProducts.java
...oup/cashloanflowboss/utils/GetBiNoAndFinanceProducts.java
+4
-3
RandomlyGeneratedParameters.java
...p/cashloanflowboss/utils/RandomlyGeneratedParameters.java
+6
-6
HttpRequest.java
...n/quantgroup/cashloanflowboss/utils/http/HttpRequest.java
+10
-3
HttpService.java
...n/quantgroup/cashloanflowboss/utils/http/HttpService.java
+55
-22
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/utils/AESUtil.java
View file @
5ea85e61
...
...
@@ -109,8 +109,8 @@ public class AESUtil {
byte
[]
original
=
cipher
.
doFinal
(
encrypted1
);
return
original
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
//
e.printStackTrace();
log
.
info
(
"={}"
,
e
);
return
null
;
}
}
...
...
src/main/java/cn/quantgroup/cashloanflowboss/utils/GetBiNoAndFinanceProducts.java
View file @
5ea85e61
...
...
@@ -16,7 +16,7 @@ public class GetBiNoAndFinanceProducts {
JSONArray
financeProducts
=
new
JSONArray
();
JSONArray
terms
=
new
JSONArray
();
JSONObject
para1
=
new
JSONObject
();
if
(
productId
==
CommonType
.
PRODUCTTYPEONE
.
getCode
()
||
productId
==
CommonType
.
PRODUCTTYPEFOUR
.
getCode
()
||
productId
==
CommonType
.
PRODUCTID900
.
getCode
()
||
productId
==
CommonType
.
PRODUCTID910
.
getCode
()
||
productId
==
CommonType
.
PRODUCTTYPEONE
.
getCode
()){
if
(
productId
==
CommonType
.
PRODUCTTYPEONE
.
getCode
()
||
productId
==
CommonType
.
PRODUCTTYPEFOUR
.
getCode
()
||
productId
==
CommonType
.
PRODUCTID900
.
getCode
()
||
productId
==
CommonType
.
PRODUCTID910
.
getCode
()
||
productId
==
CommonType
.
PRODUCTTYPEONE
.
getCode
()){
if
(
productId
==
CommonType
.
PRODUCTID900
.
getCode
()){
getResult
.
put
(
"biNo"
,
"9"
);
...
...
@@ -56,8 +56,9 @@ public class GetBiNoAndFinanceProducts {
getResult
.
put
(
"biNo"
,
"2"
);
para1
.
put
(
"min"
,
listPara1
.
get
(
4
).
toString
().
trim
());
para1
.
put
(
"max"
,
listPara1
.
get
(
0
).
toString
().
trim
());
for
(
int
i
=
3
;
i
<=
12
;
i
=
i
+
3
){
int
start
=
3
;
int
max
=
12
;
for
(
int
i
=
start
;
i
<=
max
;
i
=
i
+
start
){
JSONObject
jsonterm
=
new
JSONObject
();
jsonterm
.
put
(
"term"
,
i
);
JSONArray
fundInfo
=
new
JSONArray
();
...
...
src/main/java/cn/quantgroup/cashloanflowboss/utils/RandomlyGeneratedParameters.java
View file @
5ea85e61
This diff is collapsed.
Click to expand it.
src/main/java/cn/quantgroup/cashloanflowboss/utils/http/HttpRequest.java
View file @
5ea85e61
...
...
@@ -4,6 +4,7 @@ import cn.quantgroup.cashloanflowboss.utils.CommonConstant;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.Consts
;
import
org.apache.http.client.ClientProtocolException
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
...
...
@@ -21,6 +22,7 @@ import java.util.Map;
* @author xh
* @date 2017年2月28日 下午2:43:45
*/
@Slf4j
public
class
HttpRequest
{
/**
* 通过Post请求返回Json格式对象
...
...
@@ -133,7 +135,9 @@ public class HttpRequest {
jsonObject
.
put
(
"statusCode"
,
resultEntity
.
getStatusCode
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
// Logger.log("打印结果111:"+jsonObject);
...
...
@@ -167,7 +171,8 @@ public class HttpRequest {
jsonObject
.
put
(
"cookies"
,
JSONArray
.
toJSON
(
resultEntity
.
getCookies
()));
}
catch
(
Exception
e
){
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
System
.
out
.
println
(
"结果转传json失败,结果为:"
+
resultEntity
.
getResponseString
());
}
return
jsonObject
;
...
...
@@ -299,7 +304,9 @@ public class HttpRequest {
jsonObject
.
put
(
"cookies"
,
JSONArray
.
toJSON
(
resultEntity
.
getCookies
()));
jsonObject
.
put
(
"statusCode"
,
resultEntity
.
getStatusCode
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
System
.
out
.
println
(
"结果转传json失败,结果为:"
+
resultEntity
.
getResponseString
());
}
return
jsonObject
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/utils/http/HttpService.java
View file @
5ea85e61
...
...
@@ -180,7 +180,8 @@ public class HttpService {
response
=
httpService
.
getHttpClient
().
execute
(
httpGet
,
localContext
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
if
(
Objects
.
isNull
(
response
)){
log
.
info
(
"当前的response对象是空:{}"
,
response
);
...
...
@@ -196,17 +197,25 @@ public class HttpService {
}
}
catch
(
MalformedURLException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
URISyntaxException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
finally
{
if
(
response
!=
null
)
{
try
{
response
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
}
if
(!
Objects
.
isNull
(
httpGet
)){
...
...
@@ -222,7 +231,7 @@ public class HttpService {
Map
<
String
,
String
>
headerInfo
,
String
filePath
,
String
pwd
,
String
charset
)
{
HttpResultEntity
resultEntity
=
new
HttpResultEntity
();
String
result
=
""
;
if
(
null
==
url
||
url
.
isEmpty
()
||
!
url
.
startsWith
(
"http"
))
{
// 如果urlString为null或者urlString为空,或urlString非http开头,返回src空值
if
(
null
==
url
||
url
.
isEmpty
()
||
!
url
.
startsWith
(
httpUrl
))
{
// 如果urlString为null或者urlString为空,或urlString非http开头,返回src空值
return
resultEntity
;
}
...
...
@@ -271,7 +280,9 @@ public class HttpService {
System
.
out
.
println
(
"打印结果》》》》: "
+
response
.
getEntity
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
log
.
info
(
"进入doResponse方法之前: "
);
...
...
@@ -298,7 +309,7 @@ public class HttpService {
Map
<
String
,
String
>
headerInfo
,
String
filePath
,
String
pwd
,
String
charset
)
{
HttpResultEntity
resultEntity
=
new
HttpResultEntity
();
String
result
=
""
;
if
(
null
==
url
||
url
.
isEmpty
()
||
!
url
.
startsWith
(
"http"
))
{
// 如果urlString为null或者urlString为空,或urlString非http开头,返回src空值
if
(
null
==
url
||
url
.
isEmpty
()
||
!
url
.
startsWith
(
httpUrl
))
{
// 如果urlString为null或者urlString为空,或urlString非http开头,返回src空值
return
resultEntity
;
}
...
...
@@ -346,7 +357,9 @@ public class HttpService {
System
.
out
.
println
(
"打印结果》》》》: "
+
response
.
getEntity
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
...
...
@@ -461,7 +474,7 @@ public class HttpService {
Map
<
String
,
String
>
headerInfo
,
String
filePath
,
String
pwd
,
String
charset
)
{
HttpResultEntity
resultEntity
=
new
HttpResultEntity
();
String
result
=
""
;
if
(
null
==
url
||
url
.
isEmpty
()
||
!
url
.
startsWith
(
"http"
))
{
// 如果urlString为null或者urlString为空,或urlString非http开头,返回src空值
if
(
null
==
url
||
url
.
isEmpty
()
||
!
url
.
startsWith
(
httpUrl
))
{
// 如果urlString为null或者urlString为空,或urlString非http开头,返回src空值
return
resultEntity
;
}
...
...
@@ -498,7 +511,9 @@ public class HttpService {
response
=
httpService
.
getHttpClient
().
execute
(
httpPost
,
localContext
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
result
=
doResponse
(
response
,
url
);
resultEntity
.
setResponseString
(
result
);
...
...
@@ -519,19 +534,29 @@ public class HttpService {
instream
=
new
FileInputStream
(
new
File
(
filePath
));
trustStore
.
load
(
instream
,
pwd
.
toCharArray
());
}
catch
(
CertificateException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
KeyStoreException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
FileNotFoundException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
NoSuchAlgorithmException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
finally
{
try
{
if
(!
Objects
.
isNull
(
instream
)){
...
...
@@ -539,6 +564,8 @@ public class HttpService {
}
}
catch
(
Exception
ignore
)
{
log
.
info
(
"异常信息e={}"
,
ignore
);
}
}
...
...
@@ -551,11 +578,14 @@ public class HttpService {
return
HttpClients
.
custom
().
setSSLSocketFactory
(
sslsf
).
build
();
}
catch
(
KeyManagementException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
NoSuchAlgorithmException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
KeyStoreException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
return
HttpClients
.
createDefault
();
...
...
@@ -578,11 +608,14 @@ public class HttpService {
return
HttpClients
.
custom
().
setSSLSocketFactory
(
sslsf
).
build
();
}
catch
(
KeyManagementException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
NoSuchAlgorithmException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
catch
(
KeyStoreException
e
)
{
e
.
printStackTrace
();
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
return
HttpClients
.
createDefault
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment