记得上下班打卡 | 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
b0cb215b
Commit
b0cb215b
authored
Jul 15, 2021
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交支付查询
parent
8cbbe97f
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
55 additions
and
45 deletions
+55
-45
DragonConstant.java
...com/liquidnet/service/dragon/constant/DragonConstant.java
+7
-0
DragonPayAlipayAppReqDto.java
...iquidnet/service/dragon/dto/DragonPayAlipayAppReqDto.java
+0
-13
DragonPayAlipayAppRespDto.java
...quidnet/service/dragon/dto/DragonPayAlipayAppRespDto.java
+0
-13
DragonPayOrderQueryRespDto.java
...uidnet/service/dragon/dto/DragonPayOrderQueryRespDto.java
+7
-3
AlipayBiz.java
...iquidnet/service/dragon/channel/alipay/biz/AlipayBiz.java
+0
-3
PayChannelStrategyAlipayImpl.java
...n/channel/strategy/impl/PayChannelStrategyAlipayImpl.java
+6
-1
WepayBiz.java
.../liquidnet/service/dragon/channel/wepay/biz/WepayBiz.java
+1
-6
AbstractWepayStrategy.java
...on/channel/wepay/strategy/impl/AbstractWepayStrategy.java
+6
-2
PayController.java
...om/liquidnet/service/dragon/controller/PayController.java
+3
-3
DragonOrdersServiceImpl.java
.../service/dragon/service/impl/DragonOrdersServiceImpl.java
+15
-1
DataUtils.java
...in/java/com/liquidnet/service/dragon/utils/DataUtils.java
+10
-0
No files found.
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/constant/DragonConstant.java
View file @
b0cb215b
...
@@ -272,4 +272,11 @@ public class DragonConstant {
...
@@ -272,4 +272,11 @@ public class DragonConstant {
this
.
message
=
message
;
this
.
message
=
message
;
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
Integer
aaa
=
1
;
if
(
aaa
.
toString
().
equals
(
DragonConstant
.
PayStatusEnum
.
STATUS_PAID
.
getCode
())){
System
.
out
.
println
(
"支付成功"
);
}
}
}
}
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/dto/DragonPayAlipayAppReqDto.java
deleted
100644 → 0
View file @
8cbbe97f
package
com
.
liquidnet
.
service
.
dragon
.
dto
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: DragonPayAlipayAppReqDto
* @Package com.liquidnet.service.dragon.dto
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/9 11:00
*/
public
class
DragonPayAlipayAppReqDto
{
}
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/dto/DragonPayAlipayAppRespDto.java
deleted
100644 → 0
View file @
8cbbe97f
package
com
.
liquidnet
.
service
.
dragon
.
dto
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: DragonPayAlipayAppReqDto
* @Package com.liquidnet.service.dragon.dto
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/9 11:00
*/
public
class
DragonPayAlipayAppRespDto
{
}
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/dto/DragonPayOrderQueryRespDto.java
View file @
b0cb215b
...
@@ -2,6 +2,8 @@ package com.liquidnet.service.dragon.dto;
...
@@ -2,6 +2,8 @@ package com.liquidnet.service.dragon.dto;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @version V1.0
...
@@ -13,9 +15,11 @@ import lombok.Data;
...
@@ -13,9 +15,11 @@ import lombok.Data;
*/
*/
@Data
@Data
public
class
DragonPayOrderQueryRespDto
{
public
class
DragonPayOrderQueryRespDto
{
private
Integer
status
;
private
String
type
;
private
String
code
;
private
String
code
;
private
String
paymentId
;
private
String
orderCode
;
private
String
orderCode
;
private
BigDecimal
price
;
private
String
status
;
private
String
paymentType
;
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/alipay/biz/AlipayBiz.java
View file @
b0cb215b
...
@@ -119,9 +119,6 @@ public class AlipayBiz extends DragonPayBiz {
...
@@ -119,9 +119,6 @@ public class AlipayBiz extends DragonPayBiz {
*/
*/
public
static
Map
<
String
,
Object
>
tradeQuery
(
String
outTradeNo
)
{
public
static
Map
<
String
,
Object
>
tradeQuery
(
String
outTradeNo
)
{
log
.
info
(
"======>支付宝交易查询"
);
log
.
info
(
"======>支付宝交易查询"
);
String
charset
=
"UTF-8"
;
String
format
=
"json"
;
String
signType
=
"RSA2"
;
AlipayClient
alipayClient
=
PayAlipayUtils
.
getInstance
().
getHttpClient
();
AlipayClient
alipayClient
=
PayAlipayUtils
.
getInstance
().
getHttpClient
();
SortedMap
<
String
,
Object
>
bizContentMap
=
new
TreeMap
<>();
SortedMap
<
String
,
Object
>
bizContentMap
=
new
TreeMap
<>();
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyAlipayImpl.java
View file @
b0cb215b
...
@@ -140,8 +140,13 @@ public class PayChannelStrategyAlipayImpl implements IPayChannelStrategy {
...
@@ -140,8 +140,13 @@ public class PayChannelStrategyAlipayImpl implements IPayChannelStrategy {
@Override
@Override
public
DragonPayOrderQueryRespDto
checkOrderStatus
(
String
code
)
{
public
DragonPayOrderQueryRespDto
checkOrderStatus
(
String
code
)
{
Map
<
String
,
Object
>
result
=
alipayBiz
.
tradeQuery
(
code
);
Map
<
String
,
Object
>
result
Map
=
alipayBiz
.
tradeQuery
(
code
);
DragonPayOrderQueryRespDto
respDto
=
new
DragonPayOrderQueryRespDto
();
DragonPayOrderQueryRespDto
respDto
=
new
DragonPayOrderQueryRespDto
();
if
(
"10000"
.
equals
(
resultMap
.
get
(
"code"
)))
{
}
else
{
}
return
respDto
;
return
respDto
;
}
}
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/biz/WepayBiz.java
View file @
b0cb215b
...
@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Set
;
import
java.util.SortedMap
;
import
java.util.SortedMap
;
import
java.util.TreeMap
;
import
java.util.TreeMap
;
...
@@ -52,15 +51,11 @@ public class WepayBiz extends DragonPayBiz{
...
@@ -52,15 +51,11 @@ public class WepayBiz extends DragonPayBiz{
String
sign
=
PayWepayUtils
.
getInstance
().
createSign
(
paramMap
);
String
sign
=
PayWepayUtils
.
getInstance
().
createSign
(
paramMap
);
paramMap
.
put
(
"sign"
,
sign
);
paramMap
.
put
(
"sign"
,
sign
);
Set
<
String
>
ks
=
paramMap
.
keySet
();
String
data
=
PayWepayUtils
.
getInstance
().
getRequestXml
(
paramMap
);
String
data
=
PayWepayUtils
.
getInstance
().
getRequestXml
(
paramMap
);
try
{
try
{
HttpPost
httpost
=
new
HttpPost
(
"https://api.mch.weixin.qq.com/pay/orderquery"
);
HttpPost
httpost
=
new
HttpPost
(
"https://api.mch.weixin.qq.com/pay/orderquery"
);
httpost
.
setEntity
(
new
StringEntity
(
data
,
"UTF-8"
));
httpost
.
setEntity
(
new
StringEntity
(
data
,
"UTF-8"
));
CloseableHttpResponse
response
=
null
;
CloseableHttpResponse
response
=
PayWepayUtils
.
getInstance
().
getHttpClient
().
execute
(
httpost
);
response
=
PayWepayUtils
.
getInstance
().
getHttpClient
().
execute
(
httpost
);
HttpEntity
entity
=
response
.
getEntity
();
HttpEntity
entity
=
response
.
getEntity
();
//接受到返回信息
//接受到返回信息
String
xmlStr
=
EntityUtils
.
toString
(
response
.
getEntity
(),
"UTF-8"
);
String
xmlStr
=
EntityUtils
.
toString
(
response
.
getEntity
(),
"UTF-8"
);
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/strategy/impl/AbstractWepayStrategy.java
View file @
b0cb215b
...
@@ -158,8 +158,12 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
...
@@ -158,8 +158,12 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
WepayOrderQueryRespDto
result
=
wepayBiz
.
tradeQuery
(
code
,
this
.
getAppid
());
WepayOrderQueryRespDto
result
=
wepayBiz
.
tradeQuery
(
code
,
this
.
getAppid
());
DragonPayOrderQueryRespDto
respDto
=
new
DragonPayOrderQueryRespDto
();
DragonPayOrderQueryRespDto
respDto
=
new
DragonPayOrderQueryRespDto
();
respDto
.
setCode
(
code
);
respDto
.
setCode
(
code
);
respDto
.
setOrderCode
(
""
);
// respDto.setOrderCode("");
respDto
.
setStatus
(
""
);
// respDto.setStatus("");
// respDto.setType();
// respDto.setPaymentId();
// respDto.setPrice();
// respDto.setPaymentType();
return
respDto
;
return
respDto
;
}
}
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/controller/PayController.java
View file @
b0cb215b
...
@@ -66,7 +66,7 @@ public class PayController {
...
@@ -66,7 +66,7 @@ public class PayController {
@RequestParam
(
value
=
"notifyUrl"
)
@NotNull
(
message
=
"通知Url不能为空"
)
String
notifyUrl
,
@RequestParam
(
value
=
"notifyUrl"
)
@NotNull
(
message
=
"通知Url不能为空"
)
String
notifyUrl
,
@RequestParam
(
value
=
"returnUrl"
,
required
=
false
)
String
returnUrl
,
@RequestParam
(
value
=
"returnUrl"
,
required
=
false
)
String
returnUrl
,
// @RequestParam(value = "quitUrl",required = false) String quitUrl,
// @RequestParam(value = "quitUrl",required = false) String quitUrl,
//
@RequestParam(value = "showUrl",required = false) String showUrl,
@RequestParam
(
value
=
"showUrl"
,
required
=
false
)
String
showUrl
,
// @RequestParam(value = "code",required = false) String code,
// @RequestParam(value = "code",required = false) String code,
@RequestParam
(
value
=
"createDate"
,
required
=
true
)
String
createDate
,
@RequestParam
(
value
=
"createDate"
,
required
=
true
)
String
createDate
,
@RequestParam
(
value
=
"expireTime"
,
required
=
true
)
String
expireTime
){
@RequestParam
(
value
=
"expireTime"
,
required
=
true
)
String
expireTime
){
...
@@ -91,14 +91,14 @@ public class PayController {
...
@@ -91,14 +91,14 @@ public class PayController {
dragonPayBaseReqDto
.
setNotifyUrl
(
notifyUrl
);
dragonPayBaseReqDto
.
setNotifyUrl
(
notifyUrl
);
dragonPayBaseReqDto
.
setReturnUrl
(
returnUrl
);
dragonPayBaseReqDto
.
setReturnUrl
(
returnUrl
);
// dragonPayBaseReqDto.setQuitUrl(quitUrl);
// dragonPayBaseReqDto.setQuitUrl(quitUrl);
//
dragonPayBaseReqDto.setShowUrl(showUrl);
dragonPayBaseReqDto
.
setShowUrl
(
showUrl
);
// dragonPayBaseReqDto.setCode(code);
// dragonPayBaseReqDto.setCode(code);
dragonPayBaseReqDto
.
setCreateDate
(
createDate
);
dragonPayBaseReqDto
.
setCreateDate
(
createDate
);
dragonPayBaseReqDto
.
setExpireTime
(
expireTime
);
dragonPayBaseReqDto
.
setExpireTime
(
expireTime
);
return
dragonOrdersService
.
dragonPay
(
dragonPayBaseReqDto
);
return
dragonOrdersService
.
dragonPay
(
dragonPayBaseReqDto
);
}
}
@
Pos
tMapping
(
"/checkOrder"
)
@
Ge
tMapping
(
"/checkOrder"
)
@ApiOperation
(
"订单查询"
)
@ApiOperation
(
"订单查询"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrdersServiceImpl.java
View file @
b0cb215b
...
@@ -51,12 +51,26 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
...
@@ -51,12 +51,26 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
if
(
StringUtil
.
isEmpty
(
ordersDto
)){
if
(
StringUtil
.
isEmpty
(
ordersDto
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
}
//如果已支付 直接返回结果
if
(!
ordersDto
.
getStatus
().
toString
().
equals
(
DragonConstant
.
PayStatusEnum
.
STATUS_UNPAID
.
getCode
())){
DragonPayOrderQueryRespDto
queryRespDto
=
new
DragonPayOrderQueryRespDto
();
queryRespDto
.
setStatus
(
ordersDto
.
getStatus
());
queryRespDto
.
setType
(
ordersDto
.
getType
());
queryRespDto
.
setCode
(
ordersDto
.
getCode
());
queryRespDto
.
setPaymentId
(
ordersDto
.
getPaymentId
());
queryRespDto
.
setOrderCode
(
ordersDto
.
getOrderCode
());
queryRespDto
.
setPrice
(
ordersDto
.
getPrice
());
queryRespDto
.
setPaymentType
(
ordersDto
.
getPaymentType
());
return
queryRespDto
;
}
//如果未支付进行三方查询
String
payType
=
DragonConstant
.
PayTypeEnum
.
getEnumByCode
(
ordersDto
.
getPaymentType
()).
getPayType
();
String
payType
=
DragonConstant
.
PayTypeEnum
.
getEnumByCode
(
ordersDto
.
getPaymentType
()).
getPayType
();
return
payChannelStrategyContext
.
getStrategy
(
payType
).
checkOrderStatus
(
code
);
return
payChannelStrategyContext
.
getStrategy
(
payType
).
checkOrderStatus
(
code
);
}
}
@Override
@Override
public
DragonPayOrderQueryRespDto
checkOrderStatusByOrderCode
(
String
orderCode
)
{
public
DragonPayOrderQueryRespDto
checkOrderStatusByOrderCode
(
String
orderCode
)
{
return
null
;
String
code
=
dataUtils
.
getCodeByOrderCode
(
orderCode
);
return
this
.
checkOrderStatusByCode
(
code
);
}
}
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/utils/DataUtils.java
View file @
b0cb215b
...
@@ -11,6 +11,16 @@ public class DataUtils {
...
@@ -11,6 +11,16 @@ public class DataUtils {
@Autowired
@Autowired
private
RedisUtil
redisUtil
;
private
RedisUtil
redisUtil
;
/**
* 根据订单编号获取支付code
* @param orderCode
* @return
*/
public
String
getCodeByOrderCode
(
String
orderCode
)
{
//获取支付订单号
return
(
String
)
redisUtil
.
get
(
DragonConstant
.
REDIS_KET_PAY_ORDERCODE
+
orderCode
);
}
public
void
createPayOrder
(
String
orderCode
,
String
code
,
DragonOrdersDto
ordersDto
)
{
public
void
createPayOrder
(
String
orderCode
,
String
code
,
DragonOrdersDto
ordersDto
)
{
if
(!
redisUtil
.
hasKey
(
DragonConstant
.
REDIS_KET_PAY_ORDERCODE
+
orderCode
))
{
if
(!
redisUtil
.
hasKey
(
DragonConstant
.
REDIS_KET_PAY_ORDERCODE
+
orderCode
))
{
redisUtil
.
set
(
DragonConstant
.
REDIS_KET_PAY_ORDERCODE
+
orderCode
,
code
);
redisUtil
.
set
(
DragonConstant
.
REDIS_KET_PAY_ORDERCODE
+
orderCode
,
code
);
...
...
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