记得上下班打卡 | 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
1a58f591
Commit
1a58f591
authored
Mar 01, 2022
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!177
parents
6f0483a8
0e579870
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
282 additions
and
250 deletions
+282
-250
liquidnet-service-adam-test.yml
...s-config/liquidnet-config/liquidnet-service-adam-test.yml
+1
-1
DragonServiceCommonBiz.java
.../liquidnet/service/dragon/biz/DragonServiceCommonBiz.java
+0
-1
PayChannelStrategyAlipayImpl.java
...n/channel/strategy/impl/PayChannelStrategyAlipayImpl.java
+3
-0
PayChannelStrategyDouYinImpl.java
...n/channel/strategy/impl/PayChannelStrategyDouYinImpl.java
+3
-9
PayChannelStrategyUnionpayImpl.java
...channel/strategy/impl/PayChannelStrategyUnionpayImpl.java
+4
-3
PayChannelStrategyWepayImpl.java
...on/channel/strategy/impl/PayChannelStrategyWepayImpl.java
+3
-1
DragonServiceCommonBiz.java
.../liquidnet/service/dragon/biz/DragonServiceCommonBiz.java
+1
-0
DragonPayBiz.java
...net/service/dragon/channel/strategy/biz/DragonPayBiz.java
+22
-19
PayChannelStrategyAlipayImpl.java
...n/channel/strategy/impl/PayChannelStrategyAlipayImpl.java
+3
-0
PayChannelStrategyDouYinImpl.java
...n/channel/strategy/impl/PayChannelStrategyDouYinImpl.java
+4
-0
PayChannelStrategyUnionpayImpl.java
...channel/strategy/impl/PayChannelStrategyUnionpayImpl.java
+4
-0
PayChannelStrategyWepayImpl.java
...on/channel/strategy/impl/PayChannelStrategyWepayImpl.java
+3
-1
PayController.java
...om/liquidnet/service/dragon/controller/PayController.java
+26
-20
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+1
-1
DataUtils.java
...in/java/com/liquidnet/service/dragon/utils/DataUtils.java
+1
-1
SweetAppletSubMsgSendServiceImpl.java
.../sweet/service/impl/SweetAppletSubMsgSendServiceImpl.java
+109
-0
SweetAppletSubMsgServiceImpl.java
...vice/sweet/service/impl/SweetAppletSubMsgServiceImpl.java
+94
-193
No files found.
liquidnet-bus-config/liquidnet-config/liquidnet-service-adam-test.yml
View file @
1a58f591
...
...
@@ -26,7 +26,7 @@ liquidnet:
mobile
:
13724286255
user-info
:
false
limit
:
enters
:
1
0
enters
:
1
2
enters_opr
:
20
#以下为spring各环境个性配置
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/biz/DragonServiceCommonBiz.java
View file @
1a58f591
...
...
@@ -49,7 +49,6 @@ public class DragonServiceCommonBiz {
orders
.
setOrderCodeId
(
dragonPayBaseReqDto
.
getOrderId
());
orders
.
setClientIp
(
dragonPayBaseReqDto
.
getClientIp
());
orders
.
setNotifyUrl
(
dragonPayBaseReqDto
.
getNotifyUrl
());
orders
.
setNotifyUrl
(
dragonPayBaseReqDto
.
getNotifyUrl
());
orders
.
setNotifyStatus
(
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_INIT
.
getCode
()));
orders
.
setPaymentType
((
dragonPayBaseReqDto
.
getDeviceFrom
()+
dragonPayBaseReqDto
.
getPayType
()).
toUpperCase
());
// orders.setPaymentId();
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyAlipayImpl.java
View file @
1a58f591
...
...
@@ -90,6 +90,9 @@ public class PayChannelStrategyAlipayImpl extends AbstractPayChannelStrategyImpl
String
returnStr
=
"fail"
;
String
code
=
notifyMap
.
get
(
"out_trade_no"
);
if
(
StringUtil
.
isBlank
(
code
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
//持久化通知记录
dragonServiceCommonBiz
.
createDragonOrderLogs
(
code
,
dragonPayBiz
.
getPaymentType
(
payType
,
deviceFrom
),
JSON
.
toJSONString
(
notifyMap
));
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyDouYinImpl.java
View file @
1a58f591
...
...
@@ -3,15 +3,12 @@ package com.liquidnet.service.dragon.channel.strategy.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.biz.DragonServiceCommonBiz
;
import
com.liquidnet.service.dragon.channel.douyinpay.strategy.DouYinayStrategyContext
;
import
com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler
;
import
com.liquidnet.service.dragon.channel.strategy.biz.DragonPayBiz
;
import
com.liquidnet.service.dragon.channel.wepay.constant.WepayConstant
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.WepayStrategyContext
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.constant.DragonErrorCodeEnum
;
import
com.liquidnet.service.dragon.dto.DragonOrdersDto
;
...
...
@@ -20,18 +17,12 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import
com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto
;
import
com.liquidnet.service.dragon.utils.DataUtils
;
import
com.liquidnet.service.dragon.utils.PayDouYinpayUtils
;
import
com.liquidnet.service.dragon.utils.PayWepayUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
...
...
@@ -74,6 +65,9 @@ public class PayChannelStrategyDouYinImpl extends AbstractPayChannelStrategyImpl
JSONObject
msg
=
jsonObject
.
getJSONObject
(
"msg"
);
// Map msg= (Map) map.get("msg");
String
code
=
msg
.
get
(
"cp_orderno"
).
toString
();
if
(
StringUtil
.
isBlank
(
code
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
//持久化通知记录
dragonServiceCommonBiz
.
createDragonOrderLogs
(
code
,
dragonPayBiz
.
getPaymentType
(
payType
,
deviceFrom
),
JSON
.
toJSONString
(
jsonObject
));
// 根据银行订单号获取支付信息
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyUnionpayImpl.java
View file @
1a58f591
...
...
@@ -2,13 +2,12 @@ package com.liquidnet.service.dragon.channel.strategy.impl;
import
com.alibaba.fastjson.JSON
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.biz.DragonServiceCommonBiz
;
import
com.liquidnet.service.dragon.channel.alipay.constant.AlipayConstant
;
import
com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler
;
import
com.liquidnet.service.dragon.channel.strategy.biz.DragonPayBiz
;
import
com.liquidnet.service.dragon.channel.unionpay.biz.UnionpayBiz
;
import
com.liquidnet.service.dragon.channel.unionpay.constant.UnionpayConstant
;
import
com.liquidnet.service.dragon.channel.unionpay.sdk.AcpService
;
import
com.liquidnet.service.dragon.channel.unionpay.sdk.SDKConstants
;
import
com.liquidnet.service.dragon.channel.unionpay.strategy.UnionpayStrategyContext
;
...
...
@@ -26,7 +25,6 @@ import org.springframework.stereotype.Component;
import
javax.servlet.http.HttpServletRequest
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
...
...
@@ -77,6 +75,9 @@ public class PayChannelStrategyUnionpayImpl extends AbstractPayChannelStrategyIm
log
.
info
(
"接收到{}支付结果{}"
,
payType
,
notifyMap
);
//商户订单号
String
code
=
notifyMap
.
get
(
"orderId"
);
//获取后台通知的数据
if
(
StringUtil
.
isBlank
(
code
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
//持久化通知记录
dragonServiceCommonBiz
.
createDragonOrderLogs
(
code
,
dragonPayBiz
.
getPaymentType
(
payType
,
deviceFrom
),
JSON
.
toJSONString
(
notifyMap
));
// 根据银行订单号获取支付信息
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyWepayImpl.java
View file @
1a58f591
...
...
@@ -72,7 +72,9 @@ public class PayChannelStrategyWepayImpl extends AbstractPayChannelStrategyImpl
log
.
info
(
"接收到{}支付结果{}"
,
payType
,
notifyMap
);
String
code
=
notifyMap
.
get
(
"out_trade_no"
);
if
(
StringUtil
.
isBlank
(
code
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
//持久化通知记录
dragonServiceCommonBiz
.
createDragonOrderLogs
(
code
,
dragonPayBiz
.
getPaymentType
(
payType
,
deviceFrom
),
JSON
.
toJSONString
(
notifyMap
));
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/biz/DragonServiceCommonBiz.java
View file @
1a58f591
...
...
@@ -46,6 +46,7 @@ public class DragonServiceCommonBiz {
orders
.
setName
(
dragonPayBaseReqDto
.
getName
());
orders
.
setDetail
(
dragonPayBaseReqDto
.
getDetail
());
orders
.
setOrderCode
(
dragonPayBaseReqDto
.
getOrderCode
());
orders
.
setOrderCodeId
(
dragonPayBaseReqDto
.
getOrderId
());
orders
.
setClientIp
(
dragonPayBaseReqDto
.
getClientIp
());
orders
.
setNotifyUrl
(
dragonPayBaseReqDto
.
getNotifyUrl
());
orders
.
setNotifyStatus
(
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_INIT
.
getCode
()));
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/biz/DragonPayBiz.java
View file @
1a58f591
...
...
@@ -38,7 +38,7 @@ public class DragonPayBiz {
private
DragonServiceCommonBiz
dragonServiceCommonBiz
;
public
PayNotifyReqBo
buildPayNotifyReqBo
(
DragonOrdersDto
dragonOrdersDto
)
{
public
PayNotifyReqBo
buildPayNotifyReqBo
(
DragonOrdersDto
dragonOrdersDto
)
{
PayNotifyReqBo
payNotifyReqBo
=
new
PayNotifyReqBo
();
payNotifyReqBo
.
setNotifyUrl
(
dragonOrdersDto
.
getNotifyUrl
());
PayNotifyDto
payNotifyDto
=
new
PayNotifyDto
();
...
...
@@ -47,36 +47,38 @@ public class DragonPayBiz {
payNotifyDto
.
setCode
(
dragonOrdersDto
.
getCode
());
payNotifyDto
.
setPaymentId
(
dragonOrdersDto
.
getPaymentId
());
payNotifyDto
.
setOrderCode
(
dragonOrdersDto
.
getOrderCode
());
payNotifyDto
.
setOrderCodeId
(
dragonOrdersDto
.
getOrderCodeId
());
payNotifyDto
.
setPrice
(
dragonOrdersDto
.
getPrice
());
payNotifyDto
.
setPaymentType
(
dragonOrdersDto
.
getPaymentType
());
if
(
StringUtil
.
isNotNull
(
dragonOrdersDto
.
getPaymentAt
()))
{
if
(
StringUtil
.
isNotNull
(
dragonOrdersDto
.
getPaymentAt
()))
{
payNotifyDto
.
setPaymentAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
dragonOrdersDto
.
getPaymentAt
()));
}
else
{
}
else
{
payNotifyDto
.
setPaymentAt
(
""
);
}
payNotifyReqBo
.
setPayNotifyDto
(
payNotifyDto
);
return
payNotifyReqBo
;
}
public
DragonPayOrderQueryRespDto
buildPayOrderQueryRespDto
(
DragonOrdersDto
ordersDto
){
public
DragonPayOrderQueryRespDto
buildPayOrderQueryRespDto
(
DragonOrdersDto
ordersDto
)
{
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
.
setOrderCodeId
(
ordersDto
.
getOrderCodeId
());
queryRespDto
.
setPrice
(
ordersDto
.
getPrice
());
queryRespDto
.
setPaymentType
(
ordersDto
.
getPaymentType
());
if
(
StringUtil
.
isNotNull
(
ordersDto
.
getPaymentAt
()))
{
if
(
StringUtil
.
isNotNull
(
ordersDto
.
getPaymentAt
()))
{
queryRespDto
.
setPaymentAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
ordersDto
.
getPaymentAt
()));
}
else
{
}
else
{
queryRespDto
.
setPaymentAt
(
""
);
}
return
queryRespDto
;
}
public
boolean
sendNotify
(
PayNotifyReqBo
payNotifyReqBo
){
public
boolean
sendNotify
(
PayNotifyReqBo
payNotifyReqBo
)
{
PayNotifyDto
payNotifyDto
=
payNotifyReqBo
.
getPayNotifyDto
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
...
...
@@ -88,25 +90,26 @@ public class DragonPayBiz {
params
.
add
(
"code"
,
payNotifyDto
.
getCode
());
params
.
add
(
"paymentId"
,
payNotifyDto
.
getPaymentId
());
params
.
add
(
"orderCode"
,
payNotifyDto
.
getOrderCode
());
params
.
add
(
"orderCodeId"
,
payNotifyDto
.
getOrderCodeId
());
params
.
add
(
"price"
,
payNotifyDto
.
getPrice
().
toString
());
params
.
add
(
"paymentType"
,
payNotifyDto
.
getPaymentType
());
params
.
add
(
"paymentAt"
,
payNotifyDto
.
getPaymentAt
());
jsonData
=
JsonUtils
.
toJson
(
covertNVPS2Params
(
params
));
log
.
info
(
"dragon:notify:post url:{}"
,
payNotifyReqBo
.
getNotifyUrl
());
log
.
info
(
"dragon:notify:post data:{}"
,
jsonData
);
log
.
info
(
"dragon:notify:post url:{}"
,
payNotifyReqBo
.
getNotifyUrl
());
log
.
info
(
"dragon:notify:post data:{}"
,
jsonData
);
//执行post请求
String
response
=
HttpUtil
.
post
(
payNotifyReqBo
.
getNotifyUrl
(),
params
);
log
.
debug
(
"PAY RESPONSE="
+
response
);
if
(
response
.
equalsIgnoreCase
(
"success"
))
{
dragonServiceCommonBiz
.
createDragonPayNotify
(
payNotifyReqBo
,
jsonData
);
dragonServiceCommonBiz
.
createDragonPayNotify
(
payNotifyReqBo
,
jsonData
);
//更新通知状态-通知成功
dragonServiceCommonBiz
.
updateNotifyStatus
(
payNotifyDto
.
getCode
(),
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_SUCCESS
.
getCode
()));
dragonServiceCommonBiz
.
updateNotifyStatus
(
payNotifyDto
.
getCode
(),
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_SUCCESS
.
getCode
()));
return
true
;
}
else
{
dragonServiceCommonBiz
.
createDragonPayNotifyFail
(
payNotifyReqBo
,
jsonData
);
dragonServiceCommonBiz
.
createDragonPayNotifyFail
(
payNotifyReqBo
,
jsonData
);
//更新通知状态-通知失败
dragonServiceCommonBiz
.
updateNotifyStatus
(
payNotifyDto
.
getCode
(),
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_FAIL
.
getCode
()));
dragonServiceCommonBiz
.
updateNotifyStatus
(
payNotifyDto
.
getCode
(),
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_FAIL
.
getCode
()));
return
false
;
}
...
...
@@ -119,10 +122,10 @@ public class DragonPayBiz {
// return false;
// }
catch
(
Exception
e
)
{
log
.
error
(
"dragon:sendNotify 请求失败"
,
e
);
dragonServiceCommonBiz
.
createDragonPayNotifyFail
(
payNotifyReqBo
,
jsonData
);
log
.
error
(
"dragon:sendNotify 请求失败"
,
e
);
dragonServiceCommonBiz
.
createDragonPayNotifyFail
(
payNotifyReqBo
,
jsonData
);
//更新通知状态-通知失败
dragonServiceCommonBiz
.
updateNotifyStatus
(
payNotifyDto
.
getCode
(),
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_FAIL
.
getCode
()));
dragonServiceCommonBiz
.
updateNotifyStatus
(
payNotifyDto
.
getCode
(),
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_FAIL
.
getCode
()));
return
false
;
}
}
...
...
@@ -195,14 +198,14 @@ public class DragonPayBiz {
// }
// }
public
String
getPaymentType
(
String
payType
,
String
deviceFrom
)
{
return
(
deviceFrom
+
payType
).
toUpperCase
();
public
String
getPaymentType
(
String
payType
,
String
deviceFrom
)
{
return
(
deviceFrom
+
payType
).
toUpperCase
();
}
private
static
Map
<
String
,
Object
>
covertNVPS2Params
(
List
<
NameValuePair
>
nvpList
)
{
Map
<
String
,
Object
>
rsMap
=
ObjectUtil
.
cloneHashMapStringAndObj
();
for
(
NameValuePair
nameValuePair
:
nvpList
)
{
rsMap
.
put
(
nameValuePair
.
getName
(),
nameValuePair
.
getValue
());
rsMap
.
put
(
nameValuePair
.
getName
(),
nameValuePair
.
getValue
());
}
return
rsMap
;
}
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyAlipayImpl.java
View file @
1a58f591
...
...
@@ -90,6 +90,9 @@ public class PayChannelStrategyAlipayImpl extends AbstractPayChannelStrategyImpl
String
returnStr
=
"fail"
;
String
code
=
notifyMap
.
get
(
"out_trade_no"
);
if
(
StringUtil
.
isBlank
(
code
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
//持久化通知记录
dragonServiceCommonBiz
.
createDragonOrderLogs
(
code
,
dragonPayBiz
.
getPaymentType
(
payType
,
deviceFrom
),
JSON
.
toJSONString
(
notifyMap
));
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyDouYinImpl.java
View file @
1a58f591
...
...
@@ -3,6 +3,7 @@ package com.liquidnet.service.dragon.channel.strategy.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.biz.DragonServiceCommonBiz
;
import
com.liquidnet.service.dragon.channel.douyinpay.strategy.DouYinayStrategyContext
;
...
...
@@ -64,6 +65,9 @@ public class PayChannelStrategyDouYinImpl extends AbstractPayChannelStrategyImpl
JSONObject
msg
=
jsonObject
.
getJSONObject
(
"msg"
);
// Map msg= (Map) map.get("msg");
String
code
=
msg
.
get
(
"cp_orderno"
).
toString
();
if
(
StringUtil
.
isBlank
(
code
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
//持久化通知记录
dragonServiceCommonBiz
.
createDragonOrderLogs
(
code
,
dragonPayBiz
.
getPaymentType
(
payType
,
deviceFrom
),
JSON
.
toJSONString
(
jsonObject
));
// 根据银行订单号获取支付信息
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyUnionpayImpl.java
View file @
1a58f591
...
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.dragon.channel.strategy.impl;
import
com.alibaba.fastjson.JSON
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.biz.DragonServiceCommonBiz
;
import
com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler
;
...
...
@@ -74,6 +75,9 @@ public class PayChannelStrategyUnionpayImpl extends AbstractPayChannelStrategyIm
log
.
info
(
"接收到{}支付结果{}"
,
payType
,
notifyMap
);
//商户订单号
String
code
=
notifyMap
.
get
(
"orderId"
);
//获取后台通知的数据
if
(
StringUtil
.
isBlank
(
code
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
//持久化通知记录
dragonServiceCommonBiz
.
createDragonOrderLogs
(
code
,
dragonPayBiz
.
getPaymentType
(
payType
,
deviceFrom
),
JSON
.
toJSONString
(
notifyMap
));
// 根据银行订单号获取支付信息
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyWepayImpl.java
View file @
1a58f591
...
...
@@ -72,7 +72,9 @@ public class PayChannelStrategyWepayImpl extends AbstractPayChannelStrategyImpl
log
.
info
(
"接收到{}支付结果{}"
,
payType
,
notifyMap
);
String
code
=
notifyMap
.
get
(
"out_trade_no"
);
if
(
StringUtil
.
isBlank
(
code
)){
throw
new
LiquidnetServiceException
(
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getCode
(),
DragonErrorCodeEnum
.
TRADE_ERROR_NOT_EXISTS
.
getMessage
());
}
//持久化通知记录
dragonServiceCommonBiz
.
createDragonOrderLogs
(
code
,
dragonPayBiz
.
getPaymentType
(
payType
,
deviceFrom
),
JSON
.
toJSONString
(
notifyMap
));
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/controller/PayController.java
View file @
1a58f591
...
...
@@ -42,6 +42,7 @@ public class PayController {
*/
/**
* 电脑网页支付宝支付
*
* @return
*//*
...
...
@@ -55,6 +56,7 @@ public class PayController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "price", value = "支付金额", example = "0.1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "name", value = "订单名称", example = "测试订单001"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "detail", value = "订单描述", example = "测试订单001"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "订单id", example = "orderId"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderCode", value = "订单编号", example = "ORDER0001"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "clientIp", value = "客户端ip", example = "127.0.0.1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "notifyUrl", value = "通知url", example = "devdragon.zhengzai.tv"),
...
...
@@ -65,24 +67,25 @@ public class PayController {
public ResponseDto<DragonPayBaseRespDto> dragonPay(
@RequestParam(value = "payType") @NotNull(message = "支付类型不能为空") String payType,
@RequestParam(value = "deviceFrom") @NotNull(message = "设备来源不能为空") String deviceFrom,
@RequestParam(value = "openId",required = false) String openId,
@RequestParam(value = "openId",
required = false) String openId,
@RequestParam(value = "type") @NotNull(message = "业务类型不能为空") String type,
@RequestParam(value = "price") @NotNull(message = "支付金额不能为空") BigDecimal price,
@RequestParam(value = "name") @NotNull(message = "订单名称不能为空") String name,
@RequestParam(value = "detail") @NotNull(message = "订单描述不能为空") String detail,
@RequestParam(value = "orderCode") @NotNull(message = "订单编号不能为空") String orderCode,
@RequestParam(value = "clientIp") @NotNull(message = "客户端ip不能为空") String clientIp,
@RequestParam(value = "notifyUrl") @NotNull(message = "通知Url不能为空") String notifyUrl,
@RequestParam(value = "returnUrl",required = false) String returnUrl,
@RequestParam(value = "price") @NotNull(message = "支付金额不能为空") BigDecimal price,
@RequestParam(value = "name") @NotNull(message = "订单名称不能为空") String name,
@RequestParam(value = "detail") @NotNull(message = "订单描述不能为空") String detail,
@RequestParam(value = "orderCode") @NotNull(message = "订单编号不能为空") String orderCode,
@RequestParam(value = "orderId", required = false) String orderId,
@RequestParam(value = "clientIp") @NotNull(message = "客户端ip不能为空") String clientIp,
@RequestParam(value = "notifyUrl") @NotNull(message = "通知Url不能为空") String notifyUrl,
@RequestParam(value = "returnUrl", required = false) String returnUrl,
// @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 = "createDate",required = true)
String createDate,
@RequestParam(value = "expireTime",required = true) String expireTime)
{
@RequestParam(value = "createDate", required = true)
String createDate,
@RequestParam(value = "expireTime", required = true) String expireTime)
{
long startTime = System.currentTimeMillis();
//为什么在js和applet中才需要判断open_id?
if
(payType.equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode()))
{
if
(deviceFrom.equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode())||
deviceFrom.equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) {
if
(payType.equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode()))
{
if
(deviceFrom.equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode()) ||
deviceFrom.equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) {
if (StringUtil.isEmpty(openId)) {
return ResponseDto.failure("微信支付openId不能为空!");
}
...
...
@@ -103,6 +106,9 @@ public class PayController {
// }
dragonPayBaseReqDto.setDetail("正在现场");
dragonPayBaseReqDto.setOrderCode(orderCode);
if(orderId!=null) {
dragonPayBaseReqDto.setOrderId(orderId);
}
dragonPayBaseReqDto.setClientIp(clientIp);
dragonPayBaseReqDto.setNotifyUrl(notifyUrl);
dragonPayBaseReqDto.setReturnUrl(returnUrl);
...
...
@@ -112,7 +118,7 @@ public class PayController {
dragonPayBaseReqDto.setCreateDate(createDate);
dragonPayBaseReqDto.setExpireTime(expireTime);
ResponseDto<DragonPayBaseRespDto> responseDto = dragonOrdersService.dragonPay(dragonPayBaseReqDto);
log.info("PayController->dragonPay->总耗时:{}",
(System.currentTimeMillis() - startTime)+
"毫秒");
log.info("PayController->dragonPay->总耗时:{}",
(System.currentTimeMillis() - startTime) +
"毫秒");
return responseDto;
}
...
...
@@ -123,7 +129,7 @@ public class PayController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "", example = "PAY202107131522368438531155")
})
@ResponseBody
public ResponseDto<DragonPayOrderQueryRespDto> checkOrder(@RequestParam(value = "code") @NotNull(message = "支付编号不能为空!") String code){
public ResponseDto<DragonPayOrderQueryRespDto> checkOrder(@RequestParam(value = "code") @NotNull(message = "支付编号不能为空!") String code)
{
DragonPayOrderQueryRespDto respDto = dragonOrdersService.checkOrderStatusByCode(code);
return ResponseDto.success(respDto);
}
...
...
@@ -135,7 +141,7 @@ public class PayController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "", example = "PAY202107131522368438531155")
})
@ResponseBody
public ResponseDto<DragonPayOrderQueryRespDto> thirdCheckOrder(@RequestParam(value = "code") @NotNull(message = "支付编号不能为空!") String code){
public ResponseDto<DragonPayOrderQueryRespDto> thirdCheckOrder(@RequestParam(value = "code") @NotNull(message = "支付编号不能为空!") String code)
{
DragonPayOrderQueryRespDto respDto = dragonOrdersService.checkOrderStatusByCode(code);
return ResponseDto.success(respDto);
}
...
...
@@ -147,11 +153,11 @@ public class PayController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "", example = "PAY202107131522368438531155")
})
@ResponseBody
public ResponseDto<Map<String,
String>> manulNotify(@RequestParam(value = "code") @NotNull(message = "支付编号不能为空!") String code)
{
public ResponseDto<Map<String,
String>> manulNotify(@RequestParam(value = "code") @NotNull(message = "支付编号不能为空!") String code)
{
boolean respDto = dragonOrdersService.manulNotify(code);
Map<String,String> rs = new HashMap<>();
rs.put("code",code);
rs.put("result",
""+
respDto);
Map<String,
String> rs = new HashMap<>();
rs.put("code",
code);
rs.put("result",
"" +
respDto);
return ResponseDto.success(rs);
}
}
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
1a58f591
...
...
@@ -633,7 +633,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
// 没有订单号 从redids里面查
dto
.
setRefundCode
(
dataUtils
.
getOrderCode
(
msg
.
getString
(
"cp_refundno"
)));
dto
.
setRefundPrice
(
msg
.
getBigDecimal
(
"refund_amount"
).
divide
(
BigDecimal
.
valueOf
(
100
)).
toString
());
// SimpleDateFormat sdf = new SimpleDateFormat( " yyyy年MM月dd日 " );
// SimpleDateFormat sdf = new SimpleDateFormat( " yyyy年MM月dd日 " );
// 抖音没有传回时间
dto
.
setRefundAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
LocalDateTime
.
now
()));
//抖音回调没有写错误原因
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/utils/DataUtils.java
View file @
1a58f591
...
...
@@ -11,7 +11,7 @@ public class DataUtils {
@Autowired
private
RedisUtil
redisUtil
;
private
long
keyExpireTime
=
3600
*
24
*
7
;
private
long
keyExpireTime
=
3600
*
24
*
30
;
public
void
createPayOrder
(
String
code
,
DragonOrdersDto
ordersDto
)
{
redisUtil
.
set
(
DragonConstant
.
REDIS_KET_PAY_CODE
+
code
,
ordersDto
,
keyExpireTime
);
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetAppletSubMsgSendServiceImpl.java
0 → 100644
View file @
1a58f591
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
cn.binarywang.wx.miniapp.api.WxMaService
;
import
cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.service.sweet.config.WechatMaConfigure
;
import
com.liquidnet.service.sweet.entity.SweetAppletSubMsg
;
import
com.liquidnet.service.sweet.mapper.SweetAppletSubMsgMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 小程序订阅消息记录表 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-11-22
*/
@Service
@Slf4j
public
class
SweetAppletSubMsgSendServiceImpl
{
@Autowired
private
SweetAppletSubMsgMapper
subMsgMapper
;
@Autowired
WechatMaConfigure
wechatMaConfigure
;
@Async
public
void
toSend
(
List
<
SweetAppletSubMsg
>
msgList
,
String
targetId
,
String
title
,
String
timeStart
)
{
ArrayList
<
String
>
msgIdList
=
CollectionUtil
.
arrayListString
();
if
(!
CollectionUtils
.
isEmpty
(
msgList
))
{
for
(
SweetAppletSubMsg
info
:
msgList
)
{
try
{
String
msgId
=
info
.
getMsgId
();
// 发送订阅消息接口
boolean
subMessage
=
sendSubMessage
(
info
,
targetId
,
title
,
timeStart
);
if
(
subMessage
)
{
msgIdList
.
add
(
msgId
);
}
}
catch
(
Exception
e
)
{
// log.error("小程序演出订阅提醒消息处理异常", e);
}
}
if
(!
CollectionUtils
.
isEmpty
(
msgIdList
))
{
SweetAppletSubMsg
update
=
new
SweetAppletSubMsg
();
update
.
setIsPush
(
2
);
update
.
setUpdatedAt
(
LocalDateTime
.
now
());
subMsgMapper
.
update
(
update
,
Wrappers
.
lambdaUpdate
(
SweetAppletSubMsg
.
class
)
.
in
(
SweetAppletSubMsg:
:
getMsgId
,
msgIdList
)
);
}
}
}
/**
* 微信小程序推送订阅消息
*/
private
boolean
sendSubMessage
(
SweetAppletSubMsg
info
,
String
performancesId
,
String
title
,
String
timeStart
)
{
WxMaSubscribeMessage
subscribeMessage
=
new
WxMaSubscribeMessage
();
subscribeMessage
.
setPage
(
"pages/webview?query=showdetails&id="
.
concat
(
performancesId
));
subscribeMessage
.
setTemplateId
(
info
.
getTemplateId
());
subscribeMessage
.
setToUser
(
info
.
getOpenId
());
ArrayList
<
WxMaSubscribeMessage
.
MsgData
>
wxMaSubscribeData
=
new
ArrayList
<>();
WxMaSubscribeMessage
.
MsgData
wxMaSubscribeData1
=
new
WxMaSubscribeMessage
.
MsgData
();
wxMaSubscribeData1
.
setName
(
"thing1"
);
wxMaSubscribeData1
.
setValue
(
title
);
//每个参数 存放到大集合中
wxMaSubscribeData
.
add
(
wxMaSubscribeData1
);
// 第二个内容:用户昵称
WxMaSubscribeMessage
.
MsgData
wxMaSubscribeData2
=
new
WxMaSubscribeMessage
.
MsgData
();
wxMaSubscribeData2
.
setName
(
"time2"
);
wxMaSubscribeData2
.
setValue
(
timeStart
);
wxMaSubscribeData
.
add
(
wxMaSubscribeData2
);
// 第三个内容:领取方式
WxMaSubscribeMessage
.
MsgData
wxMaSubscribeData3
=
new
WxMaSubscribeMessage
.
MsgData
();
wxMaSubscribeData3
.
setName
(
"thing3"
);
wxMaSubscribeData3
.
setValue
(
"您关注的演出活动门票即将开售,请准备购票"
);
wxMaSubscribeData
.
add
(
wxMaSubscribeData3
);
subscribeMessage
.
setData
(
wxMaSubscribeData
);
try
{
//获取微信小程序配置:
WxMaService
wxService
=
wechatMaConfigure
.
getWxMaService
(
info
.
getAppletType
());
//进行推送
wxService
.
getMsgService
().
sendSubscribeMsg
(
subscribeMessage
);
return
true
;
}
catch
(
Exception
e
)
{
// log.error("sendSubMessageException e{}", e);
}
return
false
;
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetAppletSubMsgServiceImpl.java
View file @
1a58f591
This diff is collapsed.
Click to expand it.
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