Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhuyifan
2025-03-03 11:27:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
56fe7de0745a23d27a56fe50711c4bf40d28891a
56fe7de0
1 parent
80cbadc7
fix
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
src/main/java/com/infoloop/tianting/config/BusinessConfig.java
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
src/main/resources/application.properties
src/main/java/com/infoloop/tianting/config/BusinessConfig.java
View file @
56fe7de
...
...
@@ -15,4 +15,5 @@ public class BusinessConfig {
private
String
hisCustomerQueryUrl
;
private
String
clientCustomerQueryUrl
;
private
String
payUrl
;
private
String
payClientId
;
}
...
...
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
View file @
56fe7de
...
...
@@ -23,7 +23,6 @@ import com.infoloop.tianting.utils.EncryptionUtil;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
...
...
@@ -47,9 +46,8 @@ public class PayServiceClient {
private
final
BusinessConfig
businessConfig
;
private
final
OrderServiceRpcClient
orderServiceRpcClient
;
private
final
XmlMapper
xmlMapper
=
new
XmlMapper
();
@Value
(
"${payment.client-id:Order0001}"
)
private
String
clientId
;
public
PayResponseDto
payInform
(
PayInformRequestDto
payRequestDto
)
{
final
var
orderById
=
orderServiceRpcClient
.
getOrderById
(
Integer
.
valueOf
(
payRequestDto
.
getOrderId
()));
...
...
@@ -57,7 +55,7 @@ public class PayServiceClient {
log
.
info
(
"Order {} not found or canceled, skipping."
,
payRequestDto
.
getOrderId
());
throw
ClientEndExceptions
.
BusinessException
.
build
(
ErrorCodeEnum
.
ORDER_CANCEL
);
}
String
url
=
businessConfig
.
getPayUrl
(
);
String
url
=
String
.
format
(
businessConfig
.
getPayUrl
(),
businessConfig
.
getPayClientId
()
);
String
requestDate
=
DateUtil
.
formatDate
(
LocalDateTime
.
now
(),
DateUtil
.
YMDHMS
);
ThirdPartyPayInformRequestDto
jsonData
=
buildRequestData
(
payRequestDto
,
requestDate
);
String
jsonDataString
;
...
...
@@ -79,7 +77,7 @@ public class PayServiceClient {
private
ThirdPartyPayInformRequestDto
buildRequestData
(
PayInformRequestDto
payRequestDto
,
String
requestDate
)
{
ThirdPartyPayInformRequestDto
jsonData
=
new
ThirdPartyPayInformRequestDto
();
jsonData
.
setClientId
(
clientId
);
jsonData
.
setClientId
(
businessConfig
.
getPayClientId
()
);
jsonData
.
setTradeId
(
payRequestDto
.
getOrderId
());
jsonData
.
setRequestDate
(
requestDate
);
jsonData
.
setRequestSource
(
"OFWXApplet"
);
...
...
@@ -89,7 +87,7 @@ public class PayServiceClient {
jsonData
.
setRemark
(
""
);
jsonData
.
setTransAmount
(
payRequestDto
.
getPrice
());
jsonData
.
setTradeDesc
(
""
);
jsonData
.
setSign
(
EncryptionUtil
.
sha1Encryption
(
clientId
+
payRequestDto
.
getOrderId
()
+
requestDate
+
clientId
));
jsonData
.
setSign
(
EncryptionUtil
.
sha1Encryption
(
businessConfig
.
getPayClientId
()
+
payRequestDto
.
getOrderId
()
+
requestDate
+
businessConfig
.
getPayClientId
()
));
return
jsonData
;
}
...
...
src/main/resources/application.properties
View file @
56fe7de
...
...
@@ -75,7 +75,8 @@ miniprogram.appSecret=5b309517bf918abf760b2195e91b99f3
business-
config.hisCustomerQueryUrl
=
https://nutri.amcare.com.cn/v3/hiscustomers/current/query
business-
config.clientCustomerQueryUrl
=
https://nutri.amcare.com.cn/v3/clientcustomers/current/query
business-
config.payUrl
=
http://10.2.5.162:21051/API/Microapp/CreateOrder?appid=Order0001
business-
config.payUrl
=
http://10.2.5.162:21051/API/Microapp/CreateOrder?appid={0}
business-
config.payClientId
=
Order
##Actuator\u914D\u7F6E
management.server.port
=
8088
...
...
Please
register
or
login
to post a comment