记得上下班打卡 | 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
ad3b72f2
Commit
ad3b72f2
authored
May 18, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持 小程序多个支付
parent
cc298d6e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
5 deletions
+47
-5
DragonPayBaseReqDto.java
...com/liquidnet/service/dragon/dto/DragonPayBaseReqDto.java
+2
-0
IDGenerator.java
...ain/java/com/liquidnet/commons/lang/util/IDGenerator.java
+10
-1
DragonServiceCommonBiz.java
.../liquidnet/service/dragon/biz/DragonServiceCommonBiz.java
+5
-1
AbstractWepayStrategy.java
...on/channel/wepay/strategy/impl/AbstractWepayStrategy.java
+5
-1
WepayStrategyAppletImpl.java
.../channel/wepay/strategy/impl/WepayStrategyAppletImpl.java
+5
-1
PayController.java
...om/liquidnet/service/dragon/controller/PayController.java
+4
-0
DragonOrdersServiceImpl.java
.../service/dragon/service/impl/DragonOrdersServiceImpl.java
+5
-1
PayWepayUtils.java
...ava/com/liquidnet/service/dragon/utils/PayWepayUtils.java
+11
-0
No files found.
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/dto/DragonPayBaseReqDto.java
View file @
ad3b72f2
...
@@ -41,6 +41,8 @@ public class DragonPayBaseReqDto implements Serializable, Cloneable{
...
@@ -41,6 +41,8 @@ public class DragonPayBaseReqDto implements Serializable, Cloneable{
//苹果的stransactionId
//苹果的stransactionId
private
String
transactionId
;
private
String
transactionId
;
private
String
appIdType
=
""
;
@Override
@Override
public
String
toString
(){
public
String
toString
(){
return
JsonUtils
.
toJson
(
this
);
return
JsonUtils
.
toJson
(
this
);
...
...
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/IDGenerator.java
View file @
ad3b72f2
...
@@ -22,6 +22,7 @@ public class IDGenerator {
...
@@ -22,6 +22,7 @@ public class IDGenerator {
return
nextMilliId
().
concat
(
s
.
substring
(
s
.
length
()
-
7
));
return
nextMilliId
().
concat
(
s
.
substring
(
s
.
length
()
-
7
));
}
}
public
static
String
nextTimeId2
()
{
public
static
String
nextTimeId2
()
{
String
s
=
String
.
valueOf
(
System
.
nanoTime
());
String
s
=
String
.
valueOf
(
System
.
nanoTime
());
return
nextMilliId2
().
concat
(
s
.
substring
(
s
.
length
()
-
7
));
return
nextMilliId2
().
concat
(
s
.
substring
(
s
.
length
()
-
7
));
...
@@ -112,6 +113,10 @@ public class IDGenerator {
...
@@ -112,6 +113,10 @@ public class IDGenerator {
public
static
String
payCode
()
{
public
static
String
payCode
()
{
return
"PAY"
+
nextTimeId
();
return
"PAY"
+
nextTimeId
();
}
}
public
static
String
payCodeByType
()
{
return
"PAYB"
+
nextTimeId
();
}
public
static
String
getZxlNftImageCosCode
()
{
public
static
String
getZxlNftImageCosCode
()
{
return
"ZXLNFTIMAGE"
+
nextTimeId
();
return
"ZXLNFTIMAGE"
+
nextTimeId
();
...
@@ -147,7 +152,11 @@ public class IDGenerator {
...
@@ -147,7 +152,11 @@ public class IDGenerator {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
getWriteOffCode
());
/*System.out.println(getWriteOffCode());*/
/* System.out.println("202205181331531784685706".length());*/
String
s
=
nextTimeId
();
System
.
out
.
println
(
s
);
System
.
out
.
println
(
s
.
length
());
}
}
/**
/**
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/biz/DragonServiceCommonBiz.java
View file @
ad3b72f2
...
@@ -50,7 +50,11 @@ public class DragonServiceCommonBiz {
...
@@ -50,7 +50,11 @@ public class DragonServiceCommonBiz {
orders
.
setClientIp
(
dragonPayBaseReqDto
.
getClientIp
());
orders
.
setClientIp
(
dragonPayBaseReqDto
.
getClientIp
());
orders
.
setNotifyUrl
(
dragonPayBaseReqDto
.
getNotifyUrl
());
orders
.
setNotifyUrl
(
dragonPayBaseReqDto
.
getNotifyUrl
());
orders
.
setNotifyStatus
(
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_INIT
.
getCode
()));
orders
.
setNotifyStatus
(
Integer
.
valueOf
(
DragonConstant
.
PayNotifyStatusEnum
.
NOTIFY_INIT
.
getCode
()));
orders
.
setPaymentType
((
dragonPayBaseReqDto
.
getDeviceFrom
()+
dragonPayBaseReqDto
.
getPayType
()).
toUpperCase
());
if
(
dragonPayBaseReqDto
.
getAppIdType
().
equals
(
"b"
)){
orders
.
setPaymentType
((
dragonPayBaseReqDto
.
getDeviceFrom
()+
dragonPayBaseReqDto
.
getAppIdType
()+
dragonPayBaseReqDto
.
getPayType
()).
toUpperCase
());
}
else
{
orders
.
setPaymentType
((
dragonPayBaseReqDto
.
getDeviceFrom
()+
dragonPayBaseReqDto
.
getPayType
()).
toUpperCase
());
}
// orders.setPaymentId();
// orders.setPaymentId();
orders
.
setPaymentAt
(
LocalDateTime
.
now
());
orders
.
setPaymentAt
(
LocalDateTime
.
now
());
// orders.setFinishedAt();
// orders.setFinishedAt();
...
...
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 @
ad3b72f2
...
@@ -154,7 +154,11 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
...
@@ -154,7 +154,11 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
protected
SortedMap
<
String
,
Object
>
buildRequestParamMap
(
DragonPayBaseReqDto
dragonPayBaseReqDto
){
protected
SortedMap
<
String
,
Object
>
buildRequestParamMap
(
DragonPayBaseReqDto
dragonPayBaseReqDto
){
String
nonceStr
=
PayWepayUtils
.
getInstance
().
getNonceStr
();
String
nonceStr
=
PayWepayUtils
.
getInstance
().
getNonceStr
();
SortedMap
<
String
,
Object
>
parameters
=
new
TreeMap
<>();
SortedMap
<
String
,
Object
>
parameters
=
new
TreeMap
<>();
parameters
.
put
(
"mch_id"
,
PayWepayUtils
.
getInstance
().
getMerchantId
());
if
(
dragonPayBaseReqDto
.
getAppIdType
().
equals
(
"b"
)){
parameters
.
put
(
"mch_id"
,
PayWepayUtils
.
getInstance
().
getMerchantBId
());
}
else
{
parameters
.
put
(
"mch_id"
,
PayWepayUtils
.
getInstance
().
getMerchantId
());
}
parameters
.
put
(
"nonce_str"
,
nonceStr
);
parameters
.
put
(
"nonce_str"
,
nonceStr
);
parameters
.
put
(
"spbill_create_ip"
,
dragonPayBaseReqDto
.
getClientIp
());
parameters
.
put
(
"spbill_create_ip"
,
dragonPayBaseReqDto
.
getClientIp
());
parameters
.
put
(
"total_fee"
,
dragonPayBaseReqDto
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
100L
)).
intValue
()+
""
);
parameters
.
put
(
"total_fee"
,
dragonPayBaseReqDto
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
100L
)).
intValue
()+
""
);
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/strategy/impl/WepayStrategyAppletImpl.java
View file @
ad3b72f2
...
@@ -32,7 +32,11 @@ public class WepayStrategyAppletImpl extends AbstractWepayStrategy{
...
@@ -32,7 +32,11 @@ public class WepayStrategyAppletImpl extends AbstractWepayStrategy{
@Override
@Override
SortedMap
<
String
,
Object
>
appendRequestParam
(
SortedMap
<
String
,
Object
>
requestMap
,
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
SortedMap
<
String
,
Object
>
appendRequestParam
(
SortedMap
<
String
,
Object
>
requestMap
,
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
requestMap
.
put
(
"trade_type"
,
"JSAPI"
);
requestMap
.
put
(
"trade_type"
,
"JSAPI"
);
requestMap
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAPPLET_APP_ID
());
if
(
dragonPayBaseReqDto
.
getAppIdType
().
equals
(
"b"
)){
requestMap
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAPPLETB_APPID
());
}
else
{
requestMap
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAPPLET_APP_ID
());
}
requestMap
.
put
(
"openid"
,
dragonPayBaseReqDto
.
getOpenId
());
//只有trade_type="JSAPI"时必须传
requestMap
.
put
(
"openid"
,
dragonPayBaseReqDto
.
getOpenId
());
//只有trade_type="JSAPI"时必须传
return
requestMap
;
return
requestMap
;
}
}
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/controller/PayController.java
View file @
ad3b72f2
...
@@ -91,6 +91,10 @@ public class PayController {
...
@@ -91,6 +91,10 @@ public class PayController {
DragonPayBaseReqDto
dragonPayBaseReqDto
=
DragonPayBaseReqDto
.
getNew
();
DragonPayBaseReqDto
dragonPayBaseReqDto
=
DragonPayBaseReqDto
.
getNew
();
dragonPayBaseReqDto
.
setPayType
(
payType
);
dragonPayBaseReqDto
.
setPayType
(
payType
);
dragonPayBaseReqDto
.
setDeviceFrom
(
deviceFrom
);
dragonPayBaseReqDto
.
setDeviceFrom
(
deviceFrom
);
if
(
deviceFrom
.
equals
(
"appletb"
)){
dragonPayBaseReqDto
.
setDeviceFrom
(
"applet"
);
dragonPayBaseReqDto
.
setAppIdType
(
"b"
);
}
dragonPayBaseReqDto
.
setOpenId
(
openId
);
dragonPayBaseReqDto
.
setOpenId
(
openId
);
dragonPayBaseReqDto
.
setType
(
type
);
dragonPayBaseReqDto
.
setType
(
type
);
dragonPayBaseReqDto
.
setPrice
(
price
);
dragonPayBaseReqDto
.
setPrice
(
price
);
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrdersServiceImpl.java
View file @
ad3b72f2
...
@@ -56,7 +56,11 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
...
@@ -56,7 +56,11 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
@Override
@Override
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
//设置支付编号
//设置支付编号
dragonPayBaseReqDto
.
setCode
(
IDGenerator
.
payCode
());
if
(
dragonPayBaseReqDto
.
getAppIdType
().
equals
(
"b"
)){
dragonPayBaseReqDto
.
setCode
(
IDGenerator
.
payCodeByType
());
}
else
{
dragonPayBaseReqDto
.
setCode
(
IDGenerator
.
payCode
());
}
log
.
info
(
"dragon:dragonPay:req:dragonPayBaseReqDto : {}"
,
dragonPayBaseReqDto
.
toString
());
log
.
info
(
"dragon:dragonPay:req:dragonPayBaseReqDto : {}"
,
dragonPayBaseReqDto
.
toString
());
return
payChannelStrategyContext
.
getStrategy
(
dragonPayBaseReqDto
.
getPayType
()).
dragonPay
(
dragonPayBaseReqDto
);
return
payChannelStrategyContext
.
getStrategy
(
dragonPayBaseReqDto
.
getPayType
()).
dragonPay
(
dragonPayBaseReqDto
);
}
}
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/utils/PayWepayUtils.java
View file @
ad3b72f2
...
@@ -44,6 +44,9 @@ public class PayWepayUtils {
...
@@ -44,6 +44,9 @@ public class PayWepayUtils {
private
final
String
WAP_APP_ID
=
"wx3498304dda39c5a1"
;
private
final
String
WAP_APP_ID
=
"wx3498304dda39c5a1"
;
private
final
String
APPLET_APP_ID
=
"wx4732efeaa2b08086"
;
private
final
String
APPLET_APP_ID
=
"wx4732efeaa2b08086"
;
private
final
String
APPLETB_APPID
=
"wxe3a093ce7278d5b1"
;
private
final
String
merchantBId
=
"1614003616"
;
public
PayWepayUtils
()
{
public
PayWepayUtils
()
{
}
}
...
@@ -60,6 +63,14 @@ public class PayWepayUtils {
...
@@ -60,6 +63,14 @@ public class PayWepayUtils {
return
APPLET_APP_ID
;
return
APPLET_APP_ID
;
}
}
public
String
getAPPLETB_APPID
()
{
return
APPLETB_APPID
;
}
public
String
getMerchantBId
()
{
return
merchantBId
;
}
public
String
getJS_APP_ID
()
{
public
String
getJS_APP_ID
()
{
return
JS_APP_ID
;
return
JS_APP_ID
;
}
}
...
...
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