记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
54533841
Commit
54533841
authored
Jul 07, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
ece5d399
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
351 additions
and
8 deletions
+351
-8
PerformancesExpressController.java
...troller/zhengzai/kylin/PerformancesExpressController.java
+1
-1
PerformancesExpressServiceImpl.java
...ai/kylin/service/impl/PerformancesExpressServiceImpl.java
+7
-7
HttpClientUtils.java
...et/client/admin/zhengzai/kylin/utils/HttpClientUtils.java
+309
-0
ShunfengSignUtils.java
.../client/admin/zhengzai/kylin/utils/ShunfengSignUtils.java
+34
-0
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/PerformancesExpressController.java
View file @
54533841
...
@@ -75,7 +75,7 @@ public class PerformancesExpressController extends BaseController {
...
@@ -75,7 +75,7 @@ public class PerformancesExpressController extends BaseController {
@RequiresPermissions
(
"kylin:performancesExpress:placeOrder"
)
@RequiresPermissions
(
"kylin:performancesExpress:placeOrder"
)
@PostMapping
(
"/placeOrder"
)
@PostMapping
(
"/placeOrder"
)
@ResponseBody
@ResponseBody
public
AjaxResult
placeOrder
(
PerformanceExpressSearchAdminParam
performanceExpressSearchAdminParam
)
{
public
AjaxResult
placeOrder
(
PerformanceExpressSearchAdminParam
performanceExpressSearchAdminParam
)
throws
Exception
{
ResponseDto
res
=
performancesExpressServiceImpl
.
placeOrder
(
performanceExpressSearchAdminParam
);
ResponseDto
res
=
performancesExpressServiceImpl
.
placeOrder
(
performanceExpressSearchAdminParam
);
try
{
try
{
if
(
res
.
isSuccess
())
{
if
(
res
.
isSuccess
())
{
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/PerformancesExpressServiceImpl.java
View file @
54533841
...
@@ -121,7 +121,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
...
@@ -121,7 +121,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
return
voList
;
return
voList
;
}
}
public
ResponseDto
placeOrder
(
PerformanceExpressSearchAdminParam
performanceExpressSearchAdminParam
)
{
public
ResponseDto
placeOrder
(
PerformanceExpressSearchAdminParam
performanceExpressSearchAdminParam
)
throws
Exception
{
List
<
String
>
ids
=
performanceExpressSearchAdminParam
.
getIds
();
List
<
String
>
ids
=
performanceExpressSearchAdminParam
.
getIds
();
for
(
String
orderTicketsId
:
ids
)
{
for
(
String
orderTicketsId
:
ids
)
{
// 已经存在未取消的下单数据过滤掉
// 已经存在未取消的下单数据过滤掉
...
@@ -155,7 +155,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
...
@@ -155,7 +155,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
kylinOrderExpressMapper
.
insert
(
kylinOrderExpressPre
);
kylinOrderExpressMapper
.
insert
(
kylinOrderExpressPre
);
// 请求下单数据
// 请求下单数据
HashMap
<
String
,
Object
>
hBody
=
new
HashMap
<>();
Map
<
String
,
String
>
hBody
=
new
HashMap
<>();
hBody
.
put
(
"custid"
,
custid
);
hBody
.
put
(
"custid"
,
custid
);
hBody
.
put
(
"jCompany"
,
jCompany
);
hBody
.
put
(
"jCompany"
,
jCompany
);
hBody
.
put
(
"jContact"
,
jContact
);
hBody
.
put
(
"jContact"
,
jContact
);
...
@@ -165,21 +165,21 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
...
@@ -165,21 +165,21 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
hBody
.
put
(
"jAddress"
,
jAddress
);
hBody
.
put
(
"jAddress"
,
jAddress
);
// TODO: 2021/6/30 前端选择
// TODO: 2021/6/30 前端选择
hBody
.
put
(
"payMethod"
,
2
);
// 运费付款方式:0-寄付月结;1-寄付现结;2-收方付;3-第三方付;
hBody
.
put
(
"payMethod"
,
"2"
);
// 运费付款方式:0-寄付月结;1-寄付现结;2-收方付;3-第三方付;
hBody
.
put
(
"expressType"
,
expressType
);
// 顺丰特快
hBody
.
put
(
"expressType"
,
expressType
.
toString
()
);
// 顺丰特快
hBody
.
put
(
"depositumInfo"
,
depositumInfo
);
hBody
.
put
(
"depositumInfo"
,
depositumInfo
);
hBody
.
put
(
"orderId"
,
OrderExpressCode
);
hBody
.
put
(
"orderId"
,
OrderExpressCode
);
hBody
.
put
(
"depositumNo"
,
orderInfo
.
getNumber
());
hBody
.
put
(
"depositumNo"
,
orderInfo
.
getNumber
()
.
toString
()
);
hBody
.
put
(
"dContact"
,
orderInfo
.
getExpressContacts
());
hBody
.
put
(
"dContact"
,
orderInfo
.
getExpressContacts
());
hBody
.
put
(
"dMobile"
,
orderInfo
.
getExpressPhone
());
hBody
.
put
(
"dMobile"
,
orderInfo
.
getExpressPhone
());
hBody
.
put
(
"dAddress"
,
orderInfo
.
getExpressAddress
());
hBody
.
put
(
"dAddress"
,
orderInfo
.
getExpressAddress
());
// 生成签名并请求
// 生成签名并请求
String
result
=
shunfengSignUtils
.
generateSignatureAndRequest
(
hBody
,
"/public/order/v1/placeOrder"
);
String
result
=
shunfengSignUtils
.
generateSignatureAndRequest
Test
(
hBody
,
"/public/order/v1/placeOrder"
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result
);
HashMap
hashMap
=
new
HashMap
();
HashMap
hashMap
=
new
HashMap
();
try
{
try
{
...
@@ -499,7 +499,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
...
@@ -499,7 +499,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
}
}
// @Async
// @Async
public
void
batchPlaceOrder
(
String
performanceId
)
{
public
void
batchPlaceOrder
(
String
performanceId
)
throws
Exception
{
int
count
;
int
count
;
int
limitNum
=
10
;
int
limitNum
=
10
;
int
mid
=
0
;
int
mid
=
0
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/HttpClientUtils.java
0 → 100644
View file @
54533841
This diff is collapsed.
Click to expand it.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/ShunfengSignUtils.java
View file @
54533841
...
@@ -10,6 +10,7 @@ import org.apache.commons.codec.binary.Base64;
...
@@ -10,6 +10,7 @@ import org.apache.commons.codec.binary.Base64;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.entity.StringEntity
;
...
@@ -23,6 +24,7 @@ import org.springframework.stereotype.Component;
...
@@ -23,6 +24,7 @@ import org.springframework.stereotype.Component;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
/**
* <p>
* <p>
...
@@ -58,6 +60,38 @@ public class ShunfengSignUtils {
...
@@ -58,6 +60,38 @@ public class ShunfengSignUtils {
@Autowired
@Autowired
private
KylinOrderExpressMapper
kylinOrderExpressMapper
;
private
KylinOrderExpressMapper
kylinOrderExpressMapper
;
/**
* 生成签名并请求
* @param hbody 请求body
* @return
*/
public
String
generateSignatureAndRequestTest
(
Map
<
String
,
String
>
hbody
,
String
url
)
throws
Exception
{
long
currentTimeMillis
=
System
.
currentTimeMillis
();
// 时间戳
String
timestamp
=
currentTimeMillis
+
""
;
hbody
.
put
(
"companyId"
,
APP_ID
);
String
body
=
JsonUtils
.
toJson
(
hbody
);
// 生成签名
String
sign
=
genSign
(
timestamp
,
body
);
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"sendAppId"
,
APP_ID
);
headers
.
put
(
"timestamp"
,
timestamp
);
headers
.
put
(
"sign"
,
sign
);
headers
.
put
(
"Content-Type"
,
"application/json;charset=utf-8"
);
headers
.
put
(
"Accept"
,
"application/json"
);
// CloseableHttpClient client = HttpClients.createDefault();
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
HttpResponse
httpResponse
=
HttpClientUtils
.
doPost
(
URL
,
url
,
""
,
headers
,
querys
,
hbody
);
System
.
out
.
println
(
httpResponse
);
if
(
httpResponse
.
getStatusLine
().
getStatusCode
()
==
200
)
{
System
.
out
.
println
(
"发送请求成功"
);
HttpEntity
entity
=
httpResponse
.
getEntity
();
// 发送响应且编码UTF8!!!
return
EntityUtils
.
toString
(
entity
,
"utf-8"
);
}
return
"error"
;
}
/**
/**
* 生成签名并请求
* 生成签名并请求
* @param hbody 请求body
* @param hbody 请求body
...
...
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