记得上下班打卡 | 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
9f9ca7ad
Commit
9f9ca7ad
authored
Jun 30, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改消费日志
parent
a3d22cc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
259 additions
and
304 deletions
+259
-304
KylinOrderTicketsServiceImpl.java
...vice/kylin/service/impl/KylinOrderTicketsServiceImpl.java
+259
-304
No files found.
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinOrderTicketsServiceImpl.java
View file @
9f9ca7ad
...
...
@@ -310,16 +310,16 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
ResponseDto
<
PayResultVo
>
resultData
=
order
(
payOrderParam
,
uid
,
isMember
,
isTrueName
,
performanceData
,
ticketData
,
entersVoList
,
isStudent
,
ticketTimesData
,
currentTime
);
// redisLockUtil.unlock(lock);
log
.
debug
(
"总耗时 ->"
+(
System
.
currentTimeMillis
()-
startTime
)+
"毫秒"
);
log
.
debug
(
"总耗时 ->"
+
(
System
.
currentTimeMillis
()
-
startTime
)
+
"毫秒"
);
return
resultData
;
}
}
catch
(
Exception
e
)
{
//
if (isDownGeneral) {
//
currentTime = System.currentTimeMillis();
//
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
//
currentTime = System.currentTimeMillis() - currentTime;
//
log.debug("redis 修改库存 异常 -> time:" + (currentTime) + "毫秒");
//
}
if
(
isDownGeneral
)
{
currentTime
=
System
.
currentTimeMillis
();
dataUtils
.
changeSurplusGeneral
(
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 修改库存 异常 -> time:"
+
(
currentTime
)
+
"毫秒"
);
}
e
.
printStackTrace
();
log
.
error
(
"Kylin Order Pay Error = "
+
e
.
getMessage
());
// redisLockUtil.unlock(lock);
...
...
@@ -328,312 +328,267 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
}
private
ResponseDto
<
PayResultVo
>
order
(
PayOrderParam
payOrderParam
,
String
uid
,
boolean
isMember
,
int
isTrueName
,
KylinPerformanceVo
performanceData
,
KylinTicketVo
ticketData
,
List
<
AdamEntersVo
>
entersVoList
,
Integer
isStudent
,
KylinTicketTimesVo
ticketTimesData
,
Long
currentTime
)
{
try
{
LinkedList
<
String
>
sqls
=
new
LinkedList
<>();
String
source
=
CurrentUtil
.
getCliSource
()
==
null
?
""
:
CurrentUtil
.
getCliSource
();
String
version
=
CurrentUtil
.
getCliVersion
()
==
null
?
""
:
CurrentUtil
.
getCliVersion
();
LocalDateTime
now
=
LocalDateTime
.
now
();
//生成订单 order_ticket
KylinOrderTickets
orderTickets
=
new
KylinOrderTickets
();
String
orderTicketId
=
IDGenerator
.
nextSnowId
().
toString
();
orderTickets
.
setOrderTicketsId
(
orderTicketId
);
orderTickets
.
setUserId
(
uid
);
Map
token
=
CurrentUtil
.
getTokenClaims
();
orderTickets
.
setUserName
(
StringUtils
.
defaultString
(((
String
)
token
.
get
(
"nickname"
)),
""
));
orderTickets
.
setUserMobile
(
StringUtils
.
defaultString
(((
String
)
token
.
get
(
"mobile"
)),
""
));
orderTickets
.
setPerformanceTitle
(
performanceData
.
getTitle
());
orderTickets
.
setOrderCode
(
IDGenerator
.
ticketOrderCode
(
orderTicketId
));
orderTickets
.
setPayCode
(
""
);
orderTickets
.
setQrCode
(
""
);
orderTickets
.
setOrderType
(
source
);
orderTickets
.
setOrderVersion
(
version
);
orderTickets
.
setNumber
(
payOrderParam
.
getNumber
());
orderTickets
.
setPrice
(
ticketData
.
getPrice
());
orderTickets
.
setPriceMember
(
ticketData
.
getMemberPrice
());
if
(
isMember
)
{
orderTickets
.
setPriceTotal
(
ticketData
.
getMemberPrice
().
multiply
(
new
BigDecimal
(
payOrderParam
.
getNumber
())).
add
(
payOrderParam
.
getIsExpress
()
==
1
?
ticketData
.
getPriceExpress
()
:
new
BigDecimal
(
"0"
)));
}
else
{
orderTickets
.
setPriceTotal
(
ticketData
.
getPrice
().
multiply
(
new
BigDecimal
(
payOrderParam
.
getNumber
())).
add
(
payOrderParam
.
getIsExpress
()
==
1
?
ticketData
.
getPriceExpress
()
:
new
BigDecimal
(
"0"
)));
}
orderTickets
.
setPriceActual
(
orderTickets
.
getPriceTotal
());
orderTickets
.
setPriceVoucher
(
new
BigDecimal
(
"0.0"
));
orderTickets
.
setPriceExpress
(
ticketData
.
getPriceExpress
());
orderTickets
.
setPriceRefund
(
new
BigDecimal
(
0.0
));
orderTickets
.
setRefundNumber
(
0
);
orderTickets
.
setPayType
(
payOrderParam
.
getPayType
());
orderTickets
.
setPaymentType
(
null
);
orderTickets
.
setTimePay
(
null
);
if
(
payOrderParam
.
getIsExpress
()
==
1
)
{
currentTime
=
System
.
currentTimeMillis
();
AdamAddressesVo
addressesVo
=
orderUtils
.
getAddress
(
uid
,
payOrderParam
.
getAddressId
());
//feignAdamBaseClient.queryAddresses(payOrderParam.getAddressId(), uid).getData();
orderTickets
.
setExpressContacts
(
addressesVo
.
getName
());
orderTickets
.
setExpressAddress
(
addressesVo
.
getProvince
()
+
addressesVo
.
getCity
()
+
addressesVo
.
getCounty
()
+
addressesVo
.
getAddress
());
orderTickets
.
setExpressPhone
(
addressesVo
.
getPhone
());
orderTickets
.
setCity
(
addressesVo
.
getCity
());
orderTickets
.
setProvince
(
addressesVo
.
getProvince
());
orderTickets
.
setCounty
(
addressesVo
.
getCounty
());
orderTickets
.
setGetTicketType
(
"express"
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"feign 获取入场人 -> time:"
+
(
currentTime
)
+
"毫秒"
);
}
else
{
orderTickets
.
setExpressContacts
(
""
);
orderTickets
.
setExpressAddress
(
""
);
orderTickets
.
setExpressPhone
(
""
);
orderTickets
.
setCity
(
""
);
orderTickets
.
setProvince
(
""
);
orderTickets
.
setCounty
(
""
);
orderTickets
.
setGetTicketType
(
"electronic"
);
}
orderTickets
.
setCouponType
(
"no"
);
orderTickets
.
setGetTicketDescribe
(
""
);
orderTickets
.
setPayCountdownMinute
(
performanceData
.
getPayCountdownMinute
());
orderTickets
.
setCreatedAt
(
now
);
orderTickets
.
setUpdatedAt
(
null
);
//生成订单 order_ticket_status
KylinOrderTicketStatus
orderTicketStatus
=
new
KylinOrderTicketStatus
();
String
orderTicketStatusId
=
IDGenerator
.
nextSnowId
().
toString
();
orderTicketStatus
.
setOrderTicketStatusId
(
orderTicketStatusId
);
orderTicketStatus
.
setOrderId
(
orderTicketId
);
orderTicketStatus
.
setExpressType
(
payOrderParam
.
getExpressType
());
orderTicketStatus
.
setTransferStatus
(
KylinTableStatusConst
.
ORDER_TRANSFER_STATUS0
);
orderTicketStatus
.
setStatus
(
KylinTableStatusConst
.
ORDER_STATUS0
);
orderTicketStatus
.
setIsStudent
(
isStudent
);
orderTicketStatus
.
setPayStatus
(
KylinTableStatusConst
.
ORDER_PAY_STATUS0
);
orderTicketStatus
.
setCreatedAt
(
now
);
orderTicketStatus
.
setUpdatedAt
(
null
);
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_ticket_status.add"
));
LinkedList
<
Object
[]>
sqlsDataB
=
new
LinkedList
<
Object
[]>();
sqlsDataB
.
add
(
orderTicketStatus
.
getAddObject
());
//生成订单 order_ticket_relation
KylinOrderTicketRelations
orderTicketRelations
=
new
KylinOrderTicketRelations
();
String
orderTicketRelationId
=
IDGenerator
.
nextSnowId
();
orderTicketRelations
.
setOrderTicketRelationsId
(
orderTicketRelationId
);
orderTicketRelations
.
setOrderId
(
orderTicketId
);
orderTicketRelations
.
setTransferId
(
""
);
orderTicketRelations
.
setLiveId
(
""
);
orderTicketRelations
.
setAgentId
(
payOrderParam
.
getAgentId
());
orderTicketRelations
.
setIsMember
(
isMember
?
1
:
0
);
orderTicketRelations
.
setPerformanceId
(
payOrderParam
.
getPerformanceId
());
orderTicketRelations
.
setTimeId
(
payOrderParam
.
getTimeId
());
orderTicketRelations
.
setTicketId
(
payOrderParam
.
getTicketId
());
orderTicketRelations
.
setCreatedAt
(
now
);
orderTicketRelations
.
setUpdatedAt
(
null
);
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_ticket_relation.add"
));
LinkedList
<
Object
[]>
sqlsDataC
=
new
LinkedList
<
Object
[]>();
sqlsDataC
.
add
(
orderTicketRelations
.
getAddObject
());
//生成票
KylinOrderTicketEntities
orderTicketEntities
=
new
KylinOrderTicketEntities
();
LinkedList
<
Object
[]>
sqlsDataD
=
null
;
sqlsDataD
=
new
LinkedList
<
Object
[]>();
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_ticket_entities.add"
));
if
(
isTrueName
==
1
)
{
for
(
AdamEntersVo
enters
:
entersVoList
)
{
String
orderTicketEntitiesId
=
IDGenerator
.
nextSnowId
().
toString
();
orderTicketEntities
.
setOrderTicketEntitiesId
(
orderTicketEntitiesId
);
orderTicketEntities
.
setOrderId
(
orderTicketId
);
orderTicketEntities
.
setTicketId
(
payOrderParam
.
getTicketId
());
orderTicketEntities
.
setUserId
(
uid
);
orderTicketEntities
.
setPerformanceId
(
payOrderParam
.
getPerformanceId
());
orderTicketEntities
.
setTimeId
(
payOrderParam
.
getTimeId
());
orderTicketEntities
.
setEnterType
(
enters
.
getType
());
orderTicketEntities
.
setEnterName
(
enters
.
getName
());
orderTicketEntities
.
setEnterMobile
(
enters
.
getMobile
());
orderTicketEntities
.
setEnterIdCode
(
enters
.
getIdCard
());
orderTicketEntities
.
setStatus
(
KylinTableStatusConst
.
ENTITIES_STATUS0
);
orderTicketEntities
.
setSysDamai
(
ticketData
.
getSysDamai
());
orderTicketEntities
.
setCheckClient
(
""
);
orderTicketEntities
.
setIsPayment
(
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT0
);
orderTicketEntities
.
setRefundPrice
(
BigDecimal
.
valueOf
(
0.0
));
orderTicketEntities
.
setComment
(
""
);
orderTicketEntities
.
setCreatedAt
(
now
);
orderTicketEntities
.
setUpdatedAt
(
null
);
sqlsDataD
.
add
(
orderTicketEntities
.
getAddObject
());
// 生成vo
KylinOrderTicketEntitiesVo
orderTicketEntitiesVo
=
new
KylinOrderTicketEntitiesVo
();
BeanUtils
.
copyProperties
(
orderTicketEntities
,
orderTicketEntitiesVo
);
orderTicketEntitiesVo
.
setPerformanceTitle
(
performanceData
.
getTitle
());
orderTicketEntitiesVo
.
setTicketTitle
(
ticketData
.
getTitle
());
orderTicketEntitiesVo
.
setUseStart
(
ticketData
.
getUseStart
());
orderTicketEntitiesVo
.
setUseEnd
(
ticketData
.
getUseEnd
());
orderTicketEntitiesVo
.
setTicketsmId
(
ticketData
.
getMid
());
orderTicketEntitiesVo
.
setTimemId
(
ticketTimesData
.
getMid
());
orderTicketEntitiesVo
.
setCreatedAt
(
orderTicketEntities
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderTicketEntitiesVo
.
setUpdatedAt
(
null
);
orderTicketEntitiesVo
.
setChangeDate
(
orderTicketEntities
.
getCreatedAt
());
currentTime
=
System
.
currentTimeMillis
();
mongoTemplate
.
insert
(
orderTicketEntitiesVo
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"mongo 添加入场人 -> time:"
+
(
currentTime
)
+
"毫秒"
);
currentTime
=
System
.
currentTimeMillis
();
dataUtils
.
changeBuyInfo
(
orderTicketEntitiesVo
.
getUserId
(),
orderTicketEntitiesVo
.
getEnterIdCode
(),
orderTicketEntitiesVo
.
getPerformanceId
(),
orderTicketEntitiesVo
.
getTicketId
(),
1
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 修改 限购 -> time:"
+
(
currentTime
)
+
"毫秒"
);
}
}
else
{
for
(
int
i
=
0
;
i
<
payOrderParam
.
getNumber
();
i
++)
{
String
orderTicketEntitiesId
=
IDGenerator
.
nextSnowId
().
toString
();
orderTicketEntities
.
setOrderTicketEntitiesId
(
orderTicketEntitiesId
);
orderTicketEntities
.
setOrderId
(
orderTicketId
);
orderTicketEntities
.
setTicketId
(
payOrderParam
.
getTicketId
());
orderTicketEntities
.
setUserId
(
uid
);
orderTicketEntities
.
setPerformanceId
(
payOrderParam
.
getPerformanceId
());
orderTicketEntities
.
setTimeId
(
payOrderParam
.
getTimeId
());
orderTicketEntities
.
setEnterType
(
0
);
orderTicketEntities
.
setEnterName
(
""
);
orderTicketEntities
.
setEnterMobile
(
""
);
orderTicketEntities
.
setEnterIdCode
(
""
);
orderTicketEntities
.
setStatus
(
KylinTableStatusConst
.
ENTITIES_STATUS0
);
orderTicketEntities
.
setSysDamai
(
ticketData
.
getSysDamai
());
orderTicketEntities
.
setCheckClient
(
""
);
orderTicketEntities
.
setIsPayment
(
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT0
);
orderTicketEntities
.
setComment
(
""
);
orderTicketEntities
.
setCreatedAt
(
now
);
orderTicketEntities
.
setUpdatedAt
(
null
);
sqlsDataD
.
add
(
orderTicketEntities
.
getAddObject
());
// 生成vo
KylinOrderTicketEntitiesVo
orderTicketEntitiesVo
=
new
KylinOrderTicketEntitiesVo
();
BeanUtils
.
copyProperties
(
orderTicketEntities
,
orderTicketEntitiesVo
);
orderTicketEntitiesVo
.
setPerformanceTitle
(
performanceData
.
getTitle
());
orderTicketEntitiesVo
.
setTicketTitle
(
ticketData
.
getTitle
());
orderTicketEntitiesVo
.
setUseStart
(
ticketData
.
getUseStart
());
orderTicketEntitiesVo
.
setUseEnd
(
ticketData
.
getUseEnd
());
orderTicketEntitiesVo
.
setTicketsmId
(
ticketData
.
getMid
());
orderTicketEntitiesVo
.
setTimemId
(
ticketTimesData
.
getMid
());
orderTicketEntitiesVo
.
setCreatedAt
(
orderTicketEntities
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderTicketEntitiesVo
.
setUpdatedAt
(
null
);
orderTicketEntitiesVo
.
setChangeDate
(
orderTicketEntities
.
getCreatedAt
());
currentTime
=
System
.
currentTimeMillis
();
mongoTemplate
.
insert
(
orderTicketEntitiesVo
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"mongo 添加入场人 -> time:"
+
(
currentTime
)
+
"毫秒"
);
currentTime
=
System
.
currentTimeMillis
();
dataUtils
.
changeBuyInfo
(
orderTicketEntitiesVo
.
getUserId
(),
orderTicketEntitiesVo
.
getEnterIdCode
(),
orderTicketEntitiesVo
.
getPerformanceId
(),
orderTicketEntitiesVo
.
getTicketId
(),
1
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 修改限购 -> time:"
+
(
currentTime
)
+
"毫秒"
);
}
}
// 调用支付
String
time1
=
DateUtil
.
format
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
ticketData
.
getUseStart
()),
DateUtil
.
Formatter
.
MM_dd_zh
);
String
time2
=
DateUtil
.
format
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
ticketData
.
getUseEnd
()),
DateUtil
.
Formatter
.
MM_dd_zh
);
String
useTime
=
ticketData
.
getType
()
==
2
?
time1
+
"~"
+
time2
:
time2
;
LinkedMultiValueMap
<
String
,
String
>
httpData
=
new
LinkedMultiValueMap
<
String
,
String
>();
httpData
.
add
(
"type"
,
"TICKET"
);
httpData
.
add
(
"price"
,
orderTickets
.
getPriceActual
().
toString
());
httpData
.
add
(
"name"
,
useTime
+
ticketData
.
getTitle
()
+
"-"
+
performanceData
.
getTitle
());
httpData
.
add
(
"detail"
,
performanceData
.
getTitle
()
+
"-"
+
ticketData
.
getTitle
()
+
"-"
+
useTime
);
httpData
.
add
(
"order_code"
,
orderTickets
.
getOrderCode
());
httpData
.
add
(
"client_ip"
,
CurrentUtil
.
getCliIpAddr
());
httpData
.
add
(
"notify_url"
,
synUrl
);
httpData
.
add
(
"create_date"
,
orderTickets
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
httpData
.
add
(
"expire_time"
,
(
orderTickets
.
getPayCountdownMinute
())
+
""
);
if
(
payOrderParam
.
getDeviceFrom
().
equals
(
"js"
)
||
payOrderParam
.
getDeviceFrom
().
equals
(
"applet"
))
{
httpData
.
add
(
"open_id"
,
payOrderParam
.
getOpenId
());
}
if
(
payOrderParam
.
getPayType
().
equals
(
"alipay"
)
&&
payOrderParam
.
getDeviceFrom
().
equals
(
"wap"
))
{
httpData
.
add
(
"show_url"
,
payOrderParam
.
getShowUrl
()
+
orderTicketId
);
httpData
.
add
(
"return_url"
,
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
}
LinkedList
<
String
>
sqls
=
new
LinkedList
<>();
String
source
=
CurrentUtil
.
getCliSource
()
==
null
?
""
:
CurrentUtil
.
getCliSource
();
String
version
=
CurrentUtil
.
getCliVersion
()
==
null
?
""
:
CurrentUtil
.
getCliVersion
();
LocalDateTime
now
=
LocalDateTime
.
now
();
//生成订单 order_ticket
KylinOrderTickets
orderTickets
=
new
KylinOrderTickets
();
String
orderTicketId
=
IDGenerator
.
nextSnowId
();
orderTickets
.
setOrderTicketsId
(
orderTicketId
);
orderTickets
.
setUserId
(
uid
);
Map
token
=
CurrentUtil
.
getTokenClaims
();
orderTickets
.
setUserName
(
StringUtils
.
defaultString
(((
String
)
token
.
get
(
"nickname"
)),
""
));
orderTickets
.
setUserMobile
(
StringUtils
.
defaultString
(((
String
)
token
.
get
(
"mobile"
)),
""
));
orderTickets
.
setPerformanceTitle
(
performanceData
.
getTitle
());
orderTickets
.
setOrderCode
(
IDGenerator
.
ticketOrderCode
(
orderTicketId
));
orderTickets
.
setPayCode
(
""
);
orderTickets
.
setQrCode
(
""
);
orderTickets
.
setOrderType
(
source
);
orderTickets
.
setOrderVersion
(
version
);
orderTickets
.
setNumber
(
payOrderParam
.
getNumber
());
orderTickets
.
setPrice
(
ticketData
.
getPrice
());
orderTickets
.
setPriceMember
(
ticketData
.
getMemberPrice
());
if
(
isMember
)
{
orderTickets
.
setPriceTotal
(
ticketData
.
getMemberPrice
().
multiply
(
new
BigDecimal
(
payOrderParam
.
getNumber
())).
add
(
payOrderParam
.
getIsExpress
()
==
1
?
ticketData
.
getPriceExpress
()
:
new
BigDecimal
(
"0"
)));
}
else
{
orderTickets
.
setPriceTotal
(
ticketData
.
getPrice
().
multiply
(
new
BigDecimal
(
payOrderParam
.
getNumber
())).
add
(
payOrderParam
.
getIsExpress
()
==
1
?
ticketData
.
getPriceExpress
()
:
new
BigDecimal
(
"0"
)));
}
orderTickets
.
setPriceActual
(
orderTickets
.
getPriceTotal
());
orderTickets
.
setPriceVoucher
(
new
BigDecimal
(
"0.0"
));
orderTickets
.
setPriceExpress
(
ticketData
.
getPriceExpress
());
orderTickets
.
setPriceRefund
(
new
BigDecimal
(
0.0
));
orderTickets
.
setRefundNumber
(
0
);
orderTickets
.
setPayType
(
payOrderParam
.
getPayType
());
orderTickets
.
setPaymentType
(
null
);
orderTickets
.
setTimePay
(
null
);
if
(
payOrderParam
.
getIsExpress
()
==
1
)
{
currentTime
=
System
.
currentTimeMillis
();
String
returnData
=
HttpUtil
.
post
(
payUrl
+
payOrderParam
.
getDeviceFrom
()
+
"/"
+
payOrderParam
.
getPayType
(),
httpData
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"调用 PHP 支付 -> time:"
+
(
currentTime
)
+
"毫秒"
);
PayResultVo
payResultVo
=
JsonUtils
.
fromJson
(
returnData
,
PayResultVo
.
class
);
// PayResultVo payResultVo = null;
// try {
// payResultVo = JsonUtils.fromJson("{\n" +
// " \"code\": \"20210618130049218267704668657P\",\n" +
// " \"order_code\": \"T7774750254320448484\",\n" +
// " \"status\": null,\n" +
// " \"order_id\": \"77747502543208448\",\n" +
// " \"showUrl\": \"http://devm.zhengzai.tv/#/ticket/purchase/detail?id=5936241&type=purchase&performance_id=5936241&ticket_id=10981&amount=1&products_array=&amount_array=&express=077747502543208448\",\n" +
// " \"returnUrl\": \"http://devm.zhengzai.tv/#/order/status?order_type=ticket&order_id=77747502543208448\",\n" +
// " \"price\": 0.01,\n" +
// " \"pay_data\": {\n" +
// " \"packages\": null,\n" +
// " \"partnerid\": null,\n" +
// " \"prepayid\": null,\n" +
// " \"sign\": null,\n" +
// " \"mweb_url\": null,\n" +
// " \"paySign\": null,\n" +
// " \"signType\": null,\n" +
// " \"redirect_url\": \"https://openapi.alipay.com/gateway.do?alipay_sdk=lokielse%2Fomnipay-alipay&app_id=2019082866535131&biz_content=%7B%22product_code%22%3A%22QUICK_WAP_PAY%22%2C%22total_amount%22%3A%220.01%22%2C%22subject%22%3A%2206%5Cu670830%5Cu65e5%5Cu5355%5Cu65e5%5Cu7968%5Cu80e1%5Cu5927%5Cu7f8e%5Cu5e76%5Cu53d1%5Cu4e0b%5Cu5355%22%2C%22body%22%3A%22%5Cu80e1%5Cu5927%5Cu7f8e%5Cu5e76%5Cu53d1%5Cu4e0b%5Cu5355%5Cu5355%5Cu65e5%5Cu796806%5Cu670830%5Cu65e5%22%2C%22out_trade_no%22%3A%2220210618130049218267704668657P%22%2C%22time_expire%22%3A%222021-06-18+13%3A06%22%2C%22quit_url%22%3A%22http%3A%5C%2F%5C%2Fdevm.zhengzai.tv%5C%2F%23%5C%2Fticket%5C%2Fpurchase%5C%2Fdetail%3Fid%3D5936241%26amp%3Btype%3Dpurchase%26amp%3Bperformance_id%3D5936241%26amp%3Bticket_id%3D10981%26amp%3Bamount%3D1%26amp%3Bproducts_array%3D%26amp%3Bamount_array%3D%26amp%3Bexpress%3D077747502543208448%22%7D&charset=utf-8&format=JSON&method=alipay.trade.wap.pay¬ify_url=http%3A%2F%2Ftestpay.zhengzai.tv%2Fnotify%2Fwap%2Falipay%2F1&return_url=http%3A%2F%2Fdevm.zhengzai.tv%2F%23%2Forder%2Fstatus%3Forder_type%3Dticket%26amp%3Border_id%3D77747502543208448&sign_type=RSA2×tamp=2021-06-18+13%3A00%3A49&version=1.0&sign=UaHmNdI1cXjjSkR4gwrnELSWXqb1Icg1uCOe0vEo5yHCqWOy4JZCZbjCR1xOHQKowSMBAr6U2XLtMAaNXr6mX%2B%2F5IiaChsD4IPoODNT7F4GckVcqP3GkdLZTro%2FGmBau6VoYw1uVpyutQTJsjEU1fQ%2F5KDAKLvg0XG%2F1D%2BXb%2Bv6LdLDvehCEPzy4W%2BCT0qPANU4ysgZkt9hP1ljH61%2FBWiDnfz%2BOdust4KBoJYQzNWO3XSwvc17OxdGHn8EBmYRJz6sr1nt0i2h4BGQtjrOHRB3dToVkxrlsHtbrOmiCdRFH6utSVA8UjeKtlEB%2FH%2BkQfVxPkpOicTjkokhDNK6svg%3D%3D\",\n" +
// " \"order_str\": null,\n" +
// " \"appId\": null,\n" +
// " \"appid\": null,\n" +
// " \"nonceStr\": null,\n" +
// " \"noncestr\": null,\n" +
// " \"timeStamp\": null,\n" +
// " \"timestamp\": null,\n" +
// " \"package\": null\n" +
// " }\n" +
// " }", PayResultVo.class);
// } catch (Exception e) {
// payResultVo = new PayResultVo();
// }
payResultVo
.
setOrder_id
(
orderTicketId
);
payResultVo
.
setPrice
(
orderTickets
.
getPriceActual
());
orderTickets
.
setPayCode
(
payResultVo
.
getCode
());
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_ticket.add"
));
LinkedList
<
Object
[]>
sqlsDataA
=
new
LinkedList
<>();
sqlsDataA
.
add
(
orderTickets
.
getAddObject
());
if
(
payOrderParam
.
getPayType
().
equals
(
"alipay"
)
&&
payOrderParam
.
getDeviceFrom
().
equals
(
"wap"
))
{
payResultVo
.
setShowUrl
(
payOrderParam
.
getShowUrl
()
+
orderTicketId
);
payResultVo
.
setReturnUrl
(
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
}
// 生成vo
KylinOrderTicketVo
orderTicketVo
=
new
KylinOrderTicketVo
();
orderTicketVo
.
setOrderTicket
(
orderTickets
);
orderTicketVo
.
setOrderTicketStatus
(
orderTicketStatus
);
orderTicketVo
.
setOrderTicketRelation
(
orderTicketRelations
);
orderTicketVo
.
setPerformanceImg
(
performanceData
.
getImgPoster
());
orderTicketVo
.
setTicketTitle
(
ticketData
.
getTitle
());
orderTicketVo
.
setUseStart
(
ticketData
.
getUseStart
());
orderTicketVo
.
setTimeStart
(
performanceData
.
getTimeStart
());
orderTicketVo
.
setOverdueAt
(
orderTickets
.
getCreatedAt
().
plusMinutes
(
performanceData
.
getPayCountdownMinute
()).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderTicketVo
.
setCreatedAt
(
orderTickets
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderTicketVo
.
setChangeDate
(
orderTickets
.
getCreatedAt
());
currentTime
=
System
.
currentTimeMillis
();
mongoTemplate
.
insert
(
orderTicketVo
,
KylinOrderTicketVo
.
class
.
getSimpleName
());
AdamAddressesVo
addressesVo
=
orderUtils
.
getAddress
(
uid
,
payOrderParam
.
getAddressId
());
//feignAdamBaseClient.queryAddresses(payOrderParam.getAddressId(), uid).getData();
orderTickets
.
setExpressContacts
(
addressesVo
.
getName
());
orderTickets
.
setExpressAddress
(
addressesVo
.
getProvince
()
+
addressesVo
.
getCity
()
+
addressesVo
.
getCounty
()
+
addressesVo
.
getAddress
());
orderTickets
.
setExpressPhone
(
addressesVo
.
getPhone
());
orderTickets
.
setCity
(
addressesVo
.
getCity
());
orderTickets
.
setProvince
(
addressesVo
.
getProvince
());
orderTickets
.
setCounty
(
addressesVo
.
getCounty
());
orderTickets
.
setGetTicketType
(
"express"
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"mongo 添加 订单 -> time:"
+
(
currentTime
)
+
"毫秒"
);
log
.
debug
(
"feign 获取入场人 -> time:"
+
(
currentTime
)
+
"毫秒"
);
}
else
{
orderTickets
.
setExpressContacts
(
""
);
orderTickets
.
setExpressAddress
(
""
);
orderTickets
.
setExpressPhone
(
""
);
orderTickets
.
setCity
(
""
);
orderTickets
.
setProvince
(
""
);
orderTickets
.
setCounty
(
""
);
orderTickets
.
setGetTicketType
(
"electronic"
);
}
orderTickets
.
setCouponType
(
"no"
);
orderTickets
.
setGetTicketDescribe
(
""
);
orderTickets
.
setPayCountdownMinute
(
performanceData
.
getPayCountdownMinute
());
orderTickets
.
setCreatedAt
(
now
);
orderTickets
.
setUpdatedAt
(
null
);
currentTime
=
System
.
currentTimeMillis
();
mongoVoUtils
.
resetOrderListVo
(
uid
,
1
,
orderTicketVo
.
getOrderTicketsId
(),
orderTicketVo
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 修改订单列表 -> time:"
+
(
currentTime
)
+
"毫秒"
);
// 执行sql
try
{
String
sqlData
=
SqlMapping
.
gets
(
sqls
,
sqlsDataB
,
sqlsDataC
,
sqlsDataD
,
sqlsDataA
);
//生成订单 order_ticket_status
KylinOrderTicketStatus
orderTicketStatus
=
new
KylinOrderTicketStatus
();
String
orderTicketStatusId
=
IDGenerator
.
nextSnowId
().
toString
();
orderTicketStatus
.
setOrderTicketStatusId
(
orderTicketStatusId
);
orderTicketStatus
.
setOrderId
(
orderTicketId
);
orderTicketStatus
.
setExpressType
(
payOrderParam
.
getExpressType
());
orderTicketStatus
.
setTransferStatus
(
KylinTableStatusConst
.
ORDER_TRANSFER_STATUS0
);
orderTicketStatus
.
setStatus
(
KylinTableStatusConst
.
ORDER_STATUS0
);
orderTicketStatus
.
setIsStudent
(
isStudent
);
orderTicketStatus
.
setPayStatus
(
KylinTableStatusConst
.
ORDER_PAY_STATUS0
);
orderTicketStatus
.
setCreatedAt
(
now
);
orderTicketStatus
.
setUpdatedAt
(
null
);
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_ticket_status.add"
));
LinkedList
<
Object
[]>
sqlsDataB
=
new
LinkedList
<
Object
[]>();
sqlsDataB
.
add
(
orderTicketStatus
.
getAddObject
());
//生成订单 order_ticket_relation
KylinOrderTicketRelations
orderTicketRelations
=
new
KylinOrderTicketRelations
();
String
orderTicketRelationId
=
IDGenerator
.
nextSnowId
();
orderTicketRelations
.
setOrderTicketRelationsId
(
orderTicketRelationId
);
orderTicketRelations
.
setOrderId
(
orderTicketId
);
orderTicketRelations
.
setTransferId
(
""
);
orderTicketRelations
.
setLiveId
(
""
);
orderTicketRelations
.
setAgentId
(
payOrderParam
.
getAgentId
());
orderTicketRelations
.
setIsMember
(
isMember
?
1
:
0
);
orderTicketRelations
.
setPerformanceId
(
payOrderParam
.
getPerformanceId
());
orderTicketRelations
.
setTimeId
(
payOrderParam
.
getTimeId
());
orderTicketRelations
.
setTicketId
(
payOrderParam
.
getTicketId
());
orderTicketRelations
.
setCreatedAt
(
now
);
orderTicketRelations
.
setUpdatedAt
(
null
);
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_ticket_relation.add"
));
LinkedList
<
Object
[]>
sqlsDataC
=
new
LinkedList
<
Object
[]>();
sqlsDataC
.
add
(
orderTicketRelations
.
getAddObject
());
//生成票
KylinOrderTicketEntities
orderTicketEntities
=
new
KylinOrderTicketEntities
();
LinkedList
<
Object
[]>
sqlsDataD
=
null
;
sqlsDataD
=
new
LinkedList
<
Object
[]>();
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_ticket_entities.add"
));
if
(
isTrueName
==
1
)
{
for
(
AdamEntersVo
enters
:
entersVoList
)
{
String
orderTicketEntitiesId
=
IDGenerator
.
nextSnowId
().
toString
();
orderTicketEntities
.
setOrderTicketEntitiesId
(
orderTicketEntitiesId
);
orderTicketEntities
.
setOrderId
(
orderTicketId
);
orderTicketEntities
.
setTicketId
(
payOrderParam
.
getTicketId
());
orderTicketEntities
.
setUserId
(
uid
);
orderTicketEntities
.
setPerformanceId
(
payOrderParam
.
getPerformanceId
());
orderTicketEntities
.
setTimeId
(
payOrderParam
.
getTimeId
());
orderTicketEntities
.
setEnterType
(
enters
.
getType
());
orderTicketEntities
.
setEnterName
(
enters
.
getName
());
orderTicketEntities
.
setEnterMobile
(
enters
.
getMobile
());
orderTicketEntities
.
setEnterIdCode
(
enters
.
getIdCard
());
orderTicketEntities
.
setStatus
(
KylinTableStatusConst
.
ENTITIES_STATUS0
);
orderTicketEntities
.
setSysDamai
(
ticketData
.
getSysDamai
());
orderTicketEntities
.
setCheckClient
(
""
);
orderTicketEntities
.
setIsPayment
(
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT0
);
orderTicketEntities
.
setRefundPrice
(
BigDecimal
.
valueOf
(
0.0
));
orderTicketEntities
.
setComment
(
""
);
orderTicketEntities
.
setCreatedAt
(
now
);
orderTicketEntities
.
setUpdatedAt
(
null
);
sqlsDataD
.
add
(
orderTicketEntities
.
getAddObject
());
// 生成vo
KylinOrderTicketEntitiesVo
orderTicketEntitiesVo
=
new
KylinOrderTicketEntitiesVo
();
BeanUtils
.
copyProperties
(
orderTicketEntities
,
orderTicketEntitiesVo
);
orderTicketEntitiesVo
.
setPerformanceTitle
(
performanceData
.
getTitle
());
orderTicketEntitiesVo
.
setTicketTitle
(
ticketData
.
getTitle
());
orderTicketEntitiesVo
.
setUseStart
(
ticketData
.
getUseStart
());
orderTicketEntitiesVo
.
setUseEnd
(
ticketData
.
getUseEnd
());
orderTicketEntitiesVo
.
setTicketsmId
(
ticketData
.
getMid
());
orderTicketEntitiesVo
.
setTimemId
(
ticketTimesData
.
getMid
());
orderTicketEntitiesVo
.
setCreatedAt
(
orderTicketEntities
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderTicketEntitiesVo
.
setUpdatedAt
(
null
);
orderTicketEntitiesVo
.
setChangeDate
(
orderTicketEntities
.
getCreatedAt
());
currentTime
=
System
.
currentTimeMillis
();
mongoTemplate
.
insert
(
orderTicketEntitiesVo
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"mongo 添加入场人 -> time:"
+
(
currentTime
)
+
"毫秒"
);
currentTime
=
System
.
currentTimeMillis
();
rabbitTemplate
.
convertAndSend
(
MQConst
.
EXCHANGES_LIQUIDNET_SQL_ORDER_CREADE
,
MQConst
.
ROUTING_KEY_SQL_ORDER_CREATE
,
sqlData
);
dataUtils
.
changeBuyInfo
(
orderTicketEntitiesVo
.
getUserId
(),
orderTicketEntitiesVo
.
getEnterIdCode
(),
orderTicketEntitiesVo
.
getPerformanceId
(),
orderTicketEntitiesVo
.
getTicketId
(),
1
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"MQ 发送 -> time:"
+
(
currentTime
)
+
"毫秒"
);
}
catch
(
Exception
e
){
log
.
error
(
"WARNING Kylin MQ Error = "
+
e
.
getMessage
());
log
.
debug
(
"redis 修改 限购 -> time:"
+
(
currentTime
)
+
"毫秒"
);
}
log
.
info
(
UserPathDto
.
setData
(
"下单(唤起支付)"
,
payOrderParam
,
payResultVo
));
return
ResponseDto
.
success
(
payResultVo
);
}
catch
(
Exception
e
){
currentTime
=
System
.
currentTimeMillis
();
dataUtils
.
changeSurplusGeneral
(
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 修改库存 异常 -> time:"
+
(
currentTime
)
+
"毫秒"
);
log
.
error
(
"Kylin Order Inner Pay Error = "
+
e
.
getMessage
());
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20018"
));
//乱七八糟异常
}
else
{
for
(
int
i
=
0
;
i
<
payOrderParam
.
getNumber
();
i
++)
{
String
orderTicketEntitiesId
=
IDGenerator
.
nextSnowId
().
toString
();
orderTicketEntities
.
setOrderTicketEntitiesId
(
orderTicketEntitiesId
);
orderTicketEntities
.
setOrderId
(
orderTicketId
);
orderTicketEntities
.
setTicketId
(
payOrderParam
.
getTicketId
());
orderTicketEntities
.
setUserId
(
uid
);
orderTicketEntities
.
setPerformanceId
(
payOrderParam
.
getPerformanceId
());
orderTicketEntities
.
setTimeId
(
payOrderParam
.
getTimeId
());
orderTicketEntities
.
setEnterType
(
0
);
orderTicketEntities
.
setEnterName
(
""
);
orderTicketEntities
.
setEnterMobile
(
""
);
orderTicketEntities
.
setEnterIdCode
(
""
);
orderTicketEntities
.
setStatus
(
KylinTableStatusConst
.
ENTITIES_STATUS0
);
orderTicketEntities
.
setSysDamai
(
ticketData
.
getSysDamai
());
orderTicketEntities
.
setCheckClient
(
""
);
orderTicketEntities
.
setIsPayment
(
KylinTableStatusConst
.
ENTITIES_IS_PAYMENT0
);
orderTicketEntities
.
setComment
(
""
);
orderTicketEntities
.
setCreatedAt
(
now
);
orderTicketEntities
.
setUpdatedAt
(
null
);
sqlsDataD
.
add
(
orderTicketEntities
.
getAddObject
());
// 生成vo
KylinOrderTicketEntitiesVo
orderTicketEntitiesVo
=
new
KylinOrderTicketEntitiesVo
();
BeanUtils
.
copyProperties
(
orderTicketEntities
,
orderTicketEntitiesVo
);
orderTicketEntitiesVo
.
setPerformanceTitle
(
performanceData
.
getTitle
());
orderTicketEntitiesVo
.
setTicketTitle
(
ticketData
.
getTitle
());
orderTicketEntitiesVo
.
setUseStart
(
ticketData
.
getUseStart
());
orderTicketEntitiesVo
.
setUseEnd
(
ticketData
.
getUseEnd
());
orderTicketEntitiesVo
.
setTicketsmId
(
ticketData
.
getMid
());
orderTicketEntitiesVo
.
setTimemId
(
ticketTimesData
.
getMid
());
orderTicketEntitiesVo
.
setCreatedAt
(
orderTicketEntities
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderTicketEntitiesVo
.
setUpdatedAt
(
null
);
orderTicketEntitiesVo
.
setChangeDate
(
orderTicketEntities
.
getCreatedAt
());
currentTime
=
System
.
currentTimeMillis
();
mongoTemplate
.
insert
(
orderTicketEntitiesVo
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"mongo 添加入场人 -> time:"
+
(
currentTime
)
+
"毫秒"
);
currentTime
=
System
.
currentTimeMillis
();
dataUtils
.
changeBuyInfo
(
orderTicketEntitiesVo
.
getUserId
(),
orderTicketEntitiesVo
.
getEnterIdCode
(),
orderTicketEntitiesVo
.
getPerformanceId
(),
orderTicketEntitiesVo
.
getTicketId
(),
1
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 修改限购 -> time:"
+
(
currentTime
)
+
"毫秒"
);
}
}
// 调用支付
String
time1
=
DateUtil
.
format
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
ticketData
.
getUseStart
()),
DateUtil
.
Formatter
.
MM_dd_zh
);
String
time2
=
DateUtil
.
format
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
ticketData
.
getUseEnd
()),
DateUtil
.
Formatter
.
MM_dd_zh
);
String
useTime
=
ticketData
.
getType
()
==
2
?
time1
+
"~"
+
time2
:
time2
;
LinkedMultiValueMap
<
String
,
String
>
httpData
=
new
LinkedMultiValueMap
<
String
,
String
>();
httpData
.
add
(
"type"
,
"TICKET"
);
httpData
.
add
(
"price"
,
orderTickets
.
getPriceActual
().
toString
());
httpData
.
add
(
"name"
,
useTime
+
ticketData
.
getTitle
()
+
"-"
+
performanceData
.
getTitle
());
httpData
.
add
(
"detail"
,
performanceData
.
getTitle
()
+
"-"
+
ticketData
.
getTitle
()
+
"-"
+
useTime
);
httpData
.
add
(
"order_code"
,
orderTickets
.
getOrderCode
());
httpData
.
add
(
"client_ip"
,
CurrentUtil
.
getCliIpAddr
());
httpData
.
add
(
"notify_url"
,
synUrl
);
httpData
.
add
(
"create_date"
,
orderTickets
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
httpData
.
add
(
"expire_time"
,
(
orderTickets
.
getPayCountdownMinute
())
+
""
);
if
(
payOrderParam
.
getDeviceFrom
().
equals
(
"js"
)
||
payOrderParam
.
getDeviceFrom
().
equals
(
"applet"
))
{
httpData
.
add
(
"open_id"
,
payOrderParam
.
getOpenId
());
}
if
(
payOrderParam
.
getPayType
().
equals
(
"alipay"
)
&&
payOrderParam
.
getDeviceFrom
().
equals
(
"wap"
))
{
httpData
.
add
(
"show_url"
,
payOrderParam
.
getShowUrl
()
+
orderTicketId
);
httpData
.
add
(
"return_url"
,
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
}
currentTime
=
System
.
currentTimeMillis
();
String
returnData
=
HttpUtil
.
post
(
payUrl
+
payOrderParam
.
getDeviceFrom
()
+
"/"
+
payOrderParam
.
getPayType
(),
httpData
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"调用 PHP 支付 -> time:"
+
(
currentTime
)
+
"毫秒"
);
PayResultVo
payResultVo
=
JsonUtils
.
fromJson
(
returnData
,
PayResultVo
.
class
);
payResultVo
.
setOrder_id
(
orderTicketId
);
payResultVo
.
setPrice
(
orderTickets
.
getPriceActual
());
orderTickets
.
setPayCode
(
payResultVo
.
getCode
());
sqls
.
add
(
SqlMapping
.
get
(
"kylin_order_ticket.add"
));
LinkedList
<
Object
[]>
sqlsDataA
=
new
LinkedList
<>();
sqlsDataA
.
add
(
orderTickets
.
getAddObject
());
if
(
payOrderParam
.
getPayType
().
equals
(
"alipay"
)
&&
payOrderParam
.
getDeviceFrom
().
equals
(
"wap"
))
{
payResultVo
.
setShowUrl
(
payOrderParam
.
getShowUrl
()
+
orderTicketId
);
payResultVo
.
setReturnUrl
(
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
}
// 生成vo
KylinOrderTicketVo
orderTicketVo
=
new
KylinOrderTicketVo
();
orderTicketVo
.
setOrderTicket
(
orderTickets
);
orderTicketVo
.
setOrderTicketStatus
(
orderTicketStatus
);
orderTicketVo
.
setOrderTicketRelation
(
orderTicketRelations
);
orderTicketVo
.
setPerformanceImg
(
performanceData
.
getImgPoster
());
orderTicketVo
.
setTicketTitle
(
ticketData
.
getTitle
());
orderTicketVo
.
setUseStart
(
ticketData
.
getUseStart
());
orderTicketVo
.
setTimeStart
(
performanceData
.
getTimeStart
());
orderTicketVo
.
setOverdueAt
(
orderTickets
.
getCreatedAt
().
plusMinutes
(
performanceData
.
getPayCountdownMinute
()).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderTicketVo
.
setCreatedAt
(
orderTickets
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderTicketVo
.
setChangeDate
(
orderTickets
.
getCreatedAt
());
currentTime
=
System
.
currentTimeMillis
();
mongoTemplate
.
insert
(
orderTicketVo
,
KylinOrderTicketVo
.
class
.
getSimpleName
());
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"mongo 添加 订单 -> time:"
+
(
currentTime
)
+
"毫秒"
);
currentTime
=
System
.
currentTimeMillis
();
mongoVoUtils
.
resetOrderListVo
(
uid
,
1
,
orderTicketVo
.
getOrderTicketsId
(),
orderTicketVo
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 修改订单列表 -> time:"
+
(
currentTime
)
+
"毫秒"
);
// 执行sql
String
sqlData
=
SqlMapping
.
gets
(
sqls
,
sqlsDataB
,
sqlsDataC
,
sqlsDataD
,
sqlsDataA
);
currentTime
=
System
.
currentTimeMillis
();
rabbitTemplate
.
convertAndSend
(
MQConst
.
EXCHANGES_LIQUIDNET_SQL_ORDER_CREADE
,
MQConst
.
ROUTING_KEY_SQL_ORDER_CREATE
,
sqlData
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"MQ 发送 -> time:"
+
(
currentTime
)
+
"毫秒"
);
log
.
info
(
UserPathDto
.
setData
(
"下单(唤起支付)"
,
payOrderParam
,
payResultVo
));
return
ResponseDto
.
success
(
payResultVo
);
}
@Override
...
...
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