记得上下班打卡 | 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
f418ee88
Commit
f418ee88
authored
Jun 25, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
快递
parent
97db5662
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
20 deletions
+133
-20
PerformanceExpressSearchAdminParam.java
...e/kylin/dto/param/PerformanceExpressSearchAdminParam.java
+4
-0
PerformancesExpressController.java
...troller/zhengzai/kylin/PerformancesExpressController.java
+14
-14
performanceOrderList.html
...ngzai/kylin/performancesExpress/performanceOrderList.html
+4
-2
PerformancesExpressServiceImpl.java
...ai/kylin/service/impl/PerformancesExpressServiceImpl.java
+78
-0
ShunfengSignUtils.java
.../client/admin/zhengzai/kylin/utils/ShunfengSignUtils.java
+10
-4
db_kylin_structure.sql
.../liquidnet-service-kylin-impl/docu/db_kylin_structure.sql
+23
-0
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/param/PerformanceExpressSearchAdminParam.java
View file @
f418ee88
...
...
@@ -2,6 +2,8 @@ package com.liquidnet.service.kylin.dto.param;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
PerformanceExpressSearchAdminParam
{
...
...
@@ -24,4 +26,6 @@ public class PerformanceExpressSearchAdminParam {
private
String
expressContacts
;
private
String
expressPhone
;
private
List
<
String
>
ids
;
}
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 @
f418ee88
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
kylin
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.impl.PerformancesExpressServiceImpl
;
import
com.liquidnet.
client.admin.zhengzai.kylin.utils.ShunfengSignUtils
;
import
com.liquidnet.
service.base.ResponseDto
;
import
com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceListAdminDao
;
import
com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceOrderListAdminDao
;
import
com.liquidnet.service.kylin.dto.param.PerformanceExpressSearchAdminParam
;
...
...
@@ -13,6 +14,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
/**
...
...
@@ -40,8 +42,6 @@ public class PerformancesExpressController extends BaseController {
@Autowired
private
PerformancesExpressServiceImpl
performancesExpressServiceImpl
;
private
ShunfengSignUtils
shunfengSignUtils
;
/**
* 查询演出列表
*/
...
...
@@ -83,17 +83,17 @@ public class PerformancesExpressController extends BaseController {
@RequiresPermissions
(
"kylin:performancesExpress:placeOrder"
)
@PostMapping
(
"/placeOrder"
)
@ResponseBody
public
boolean
placeOrder
(
)
{
// 请求body companyId参数值和APPID一致!!!
String
body
=
"{\"dContact\":\"王昆\",\"companyId\":{{APP_ID}},\"jContact\":\"顺丰\",\"jTel\":\"111\",\"jMobile\":null,\"jAddress\":\"马甸\",\"dTel\":\"064756935\",\"dMobile\":null,\"dAddress\":\"北京市朝阳区花家地金兴路1号院5号楼1单元202\",\"custid\":\"7551234567\",\"payMethod\":\"0\",\"expressType\":\"1\",\"packagesNo\":\"1\",\"depositumInfo\":\"TCL空调\",\"depositumNo\":\"1\",\"remark\":null,\"isCollection\":\"1\",\"collectionMoney\":\"10.00\",\"isReceipt\":\"0\",\"receipt\":null}"
;
// 时间戳
long
currentTimeMillis
=
System
.
currentTimeMilli
s
();
System
.
out
.
println
(
"时间戳:"
+
currentTimeMillis
);
// 生成签名并请求
String
result
=
shunfengSignUtils
.
generateSignatureAndRequest
(
currentTimeMillis
+
""
,
body
,
"/order/v1/placeOrder"
);
System
.
out
.
println
(
"响应:"
+
result
);
return
true
;
public
AjaxResult
placeOrder
(
PerformanceExpressSearchAdminParam
performanceExpressSearchAdminParam
)
{
ResponseDto
res
=
performancesExpressServiceImpl
.
placeOrder
(
performanceExpressSearchAdminParam
);
try
{
if
(
res
.
isSuccess
())
{
return
succes
s
();
}
else
{
return
error
(
res
.
getMessage
());
}
}
catch
(
Exception
e
)
{
return
error
(
e
.
getMessage
()
);
}
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/performancesExpress/performanceOrderList.html
View file @
f418ee88
...
...
@@ -68,6 +68,8 @@
</div>
<th:block
th:include=
"include :: footer"
/>
<script
th:inline=
"javascript"
>
var
placeOrderFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:performancesExpress:placeOrder'
)}]];
var
prefix
=
ctx
+
"kylin/performancesExpress"
;
var
orderStatusDic
=
[[
$
{@
dict
.
getType
(
'zhengzai_order_status'
)}]];
...
...
@@ -76,6 +78,7 @@
var
options
=
{
url
:
prefix
+
"/performanceOrderList"
,
modalName
:
"演出订单"
,
placeOrderUrl
:
prefix
+
"/placeOrder"
,
columns
:
[{
checkbox
:
true
},
...
...
@@ -121,7 +124,6 @@
field
:
''
,
title
:
'收获用户'
,
formatter
:
function
(
value
,
row
,
index
)
{
console
.
log
(
row
)
var
expressContacts
=
row
.
expressContacts
;
var
expressAddress
=
row
.
expressAddress
;
var
expressPhone
=
row
.
expressPhone
;
...
...
@@ -133,7 +135,7 @@
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
var
actions
=
[];
// actions.push('
<
a
class
=
"btn btn-warning btn-xs ' + detailFlag + '"
href
=
"javascript:void(0)"
onclick
=
"$.operate.detail(
\
'' + row.orderTicketsId + '
\
')"
><
i
class
=
"fa fa-search"
><
/i>详细</
a
>
');
actions
.
push
(
'<a class="btn btn-danger btn-xs '
+
placeOrderFlag
+
'" href="javascript:void(0)" onclick="$.operate.remove(
\'
'
+
row
.
orderTicketsId
+
'
\'
,
\'
确定下单吗?
\'
, table.options.placeOrderUrl)"></i>下单</a>
'
);
return
actions
.
join
(
''
);
}
}]
...
...
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 @
f418ee88
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
kylin
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.ShunfengSignUtils
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.kylin.dao.*
;
import
com.liquidnet.service.kylin.dto.param.*
;
import
com.liquidnet.service.kylin.entity.*
;
...
...
@@ -11,7 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -30,11 +38,21 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinPerformance
@Autowired
MongoTemplate
mongoTemplate
;
@Autowired
private
ShunfengSignUtils
shunfengSignUtils
;
@Autowired
private
KylinPerformancesMapper
performancesMapper
;
@Autowired
private
KylinOrderTicketsMapper
kylinOrderTicketsMapper
;
@Autowired
private
KylinOrderExpressMapper
kylinOrderExpressMapper
;
@Autowired
private
KylinOrderExpress
kylinOrderExpress
;
public
List
<
PerformanceExpressPerformanceListAdminDao
>
getPerformancesList
(
PerformanceExpressSearchAdminParam
performanceExpressSearchAdminParam
)
{
List
<
PerformanceExpressPerformanceListAdminDao
>
voList
=
new
ArrayList
();
try
{
...
...
@@ -56,4 +74,64 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinPerformance
}
return
voList
;
}
public
ResponseDto
placeOrder
(
PerformanceExpressSearchAdminParam
performanceExpressSearchAdminParam
)
{
List
<
String
>
ids
=
performanceExpressSearchAdminParam
.
getIds
();
for
(
String
orderTicketsId
:
ids
)
{
KylinOrderTickets
orderInfo
=
kylinOrderTicketsMapper
.
selectOne
(
new
QueryWrapper
<
KylinOrderTickets
>().
eq
(
"order_tickets_id"
,
orderTicketsId
)
);
HashMap
<
String
,
Object
>
hBody
=
new
HashMap
<>();
hBody
.
put
(
"orderId"
,
orderInfo
.
getOrderCode
());
hBody
.
put
(
"jCompany"
,
"摩登天空"
);
hBody
.
put
(
"jContact"
,
"姜秀龙"
);
// hBody.put("jTel", "010");
hBody
.
put
(
"jMobile"
,
"15811009011"
);
hBody
.
put
(
"jProvince"
,
"北京"
);
hBody
.
put
(
"jCity"
,
"北京市"
);
hBody
.
put
(
"jAddress"
,
"摩登天空"
);
hBody
.
put
(
"dContact"
,
"张红梅"
);
hBody
.
put
(
"dMobile"
,
"15010806631"
);
hBody
.
put
(
"dProvince"
,
"北京"
);
hBody
.
put
(
"dCity"
,
"北京市"
);
hBody
.
put
(
"dAddress"
,
"华通大厦"
);
hBody
.
put
(
"custid"
,
"7551234567"
);
hBody
.
put
(
"payMethod"
,
0
);
// 运费付款方式:0-寄付月结;1-寄付现结;2-收方付;3-第三方付;
hBody
.
put
(
"expressType"
,
1
);
// 顺丰特快
hBody
.
put
(
"depositumInfo"
,
"票"
);
hBody
.
put
(
"depositumNo"
,
1
);
// 时间戳
long
currentTimeMillis
=
System
.
currentTimeMillis
();
// 生成签名并请求
String
result
=
shunfengSignUtils
.
generateSignatureAndRequest
(
currentTimeMillis
+
""
,
hBody
,
"/public/order/v1/placeOrder"
);
HashMap
hashMap
=
JsonUtils
.
fromJson
(
result
,
HashMap
.
class
);
System
.
out
.
println
(
result
);
if
(
hashMap
.
get
(
"succ"
).
equals
(
"fail"
))
{
String
msg
=
(
String
)
hashMap
.
get
(
"msg"
);
return
ResponseDto
.
failure
(
msg
);
}
else
{
String
orderExpressId
=
IDGenerator
.
nextSnowId
();
kylinOrderExpress
.
setOrderExpressId
(
orderExpressId
);
kylinOrderExpress
.
setOrderTicketsId
(
orderTicketsId
);
kylinOrderExpress
.
setMailno
((
String
)
hashMap
.
get
(
"mailno"
));
kylinOrderExpress
.
setExpressType
(
1
);
kylinOrderExpress
.
setFilterResult
((
Integer
)
hashMap
.
get
(
"filter_result"
));
kylinOrderExpress
.
setRemark
((
String
)
hashMap
.
get
(
"remark"
));
kylinOrderExpress
.
setOrigincode
((
String
)
hashMap
.
get
(
"origincode"
));
kylinOrderExpress
.
setDestcode
((
String
)
hashMap
.
get
(
"destcode"
));
kylinOrderExpress
.
setPrintIcon
((
String
)
hashMap
.
get
(
"printIcon"
));
kylinOrderExpress
.
setPrintFlag
((
String
)
hashMap
.
get
(
"printFlag"
));
kylinOrderExpress
.
setTwoDimensionCode
((
String
)
hashMap
.
get
(
"twoDimensionCode"
));
kylinOrderExpress
.
setCreatedAt
(
DateUtil
.
getNowTime
());
kylinOrderExpressMapper
.
insert
(
kylinOrderExpress
);
}
}
return
ResponseDto
.
success
();
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/ShunfengSignUtils.java
View file @
f418ee88
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
kylin
.
utils
;
import
com.liquidnet.client.admin.common.json.JSONObject
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -11,9 +13,11 @@ import org.apache.http.impl.client.CloseableHttpClient;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.util.HashMap
;
/**
* <p>
...
...
@@ -23,6 +27,7 @@ import java.io.IOException;
* @author jiangxiulong
* @since 2021-06-24 8:00 下午
*/
@Component
public
class
ShunfengSignUtils
{
/**
* appId
...
...
@@ -47,18 +52,18 @@ public class ShunfengSignUtils {
/**
* 生成签名并请求
* @param timestamp 时间戳
* @param body 请求body
* @param
h
body 请求body
* @return
*/
public
String
generateSignatureAndRequest
(
String
timestamp
,
String
body
,
String
url
)
{
public
String
generateSignatureAndRequest
(
String
timestamp
,
HashMap
<
String
,
Object
>
hbody
,
String
url
)
{
hbody
.
put
(
"companyId"
,
APP_ID
);
String
body
=
JsonUtils
.
toJson
(
hbody
);
// 生成签名
String
sign
=
genSign
(
timestamp
,
body
);
System
.
out
.
println
(
"签名:"
+
sign
);
CloseableHttpClient
client
=
HttpClients
.
createDefault
();
// 请求下单地址
HttpPost
httpPost
=
new
HttpPost
(
URL
+
url
);
System
.
out
.
println
(
"请求的url:"
+
URL
+
url
);
// sendAppId(sendAppId需赋值appId)
httpPost
.
addHeader
(
"sendAppId"
,
APP_ID
);
// 时间戳需和获取验签时一致!!!
...
...
@@ -66,6 +71,7 @@ public class ShunfengSignUtils {
// 签名
httpPost
.
addHeader
(
"sign"
,
sign
);
httpPost
.
addHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
httpPost
.
addHeader
(
"Accept"
,
"application/json"
);
// 请求body体需和获取验签时一致且编码UTF8!!!
httpPost
.
setEntity
(
new
StringEntity
(
body
,
"utf-8"
));
CloseableHttpResponse
response
=
null
;
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/docu/db_kylin_structure.sql
View file @
f418ee88
...
...
@@ -744,3 +744,26 @@ CREATE TABLE `kylin_order_refund_entities`
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
COMMENT
'退款入场人表'
;
drop
TABLE
if
exists
`kylin_order_express`
;
CREATE
TABLE
`kylin_order_express`
(
`mid`
int
unsigned
NOT
NULL
AUTO_INCREMENT
,
`order_express_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'order_express_id'
,
`order_tickets_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'订单id'
,
`mailno`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'顺丰运单号'
,
`express_type`
tinyint
NOT
NULL
DEFAULT
'0'
COMMENT
'快件产品类型 1顺丰特快...'
,
`filter_result`
tinyint
NOT
NULL
DEFAULT
'0'
COMMENT
'1-人工确认;2-可收派;3-不可以收派'
,
`remark`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'filter_result=3时返回不可以收派的原因代码'
,
`origincode`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'原寄地区域代码 可用于顺丰电子面单标签打印'
,
`destcode`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'目的地区域代码 可用于顺丰电子面单标签打印'
,
`print_icon`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'打印图标'
,
`print_flag`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'打印标志'
,
`two_dimension_code`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'二维码'
,
`created_at`
timestamp
NULL
DEFAULT
NULL
,
`updated_at`
timestamp
NULL
DEFAULT
NULL
,
KEY
`kylin_order_express_order_express_id_index`
(
`order_express_id`
),
PRIMARY
KEY
(
`mid`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
COMMENT
'订单快递表'
;
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