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
wangyingyang
2025-03-20 15:30:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f2832ad6fa379088483d6182699089f1ecebd8a2
f2832ad6
1 parent
016e04a5
fix refund
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
13 deletions
src/main/java/com/infoloop/tianting/model/dto/OrderDbDTO.java
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
src/main/java/com/infoloop/tianting/service/impl/OrderServiceImpl.java
src/main/proto/ClientCustomerOrderService.proto
src/main/java/com/infoloop/tianting/model/dto/OrderDbDTO.java
View file @
f2832ad
...
...
@@ -83,6 +83,7 @@ public class OrderDbDTO {
private
Integer
preparingCount
;
private
Integer
allServedCount
;
private
Integer
canceledCount
;
private
Integer
refundCount
;
}
@Data
...
...
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
View file @
f2832ad
...
...
@@ -381,21 +381,17 @@ public class PayServiceClient {
String
signInfo
=
DigestUtils
.
sha1Hex
(
signInfoStr
.
getBytes
());
// 构建请求
// 设置请求体的媒体类型为JSON
try
{
// MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
// RequestBody body = RequestBody.create(mediaType, jsonDataString);
String
url
=
businessConfig
.
getCancelPayUrl
()
+
"?"
+
"appid="
+
appId
+
"&paycontent="
+
payContent
+
"&signinfo="
+
signInfo
;
log
.
info
(
"cancel order pay url:"
+
url
);
Request
request
=
new
Request
.
Builder
().
url
(
url
).
get
().
build
();
Response
payResponse
=
client
.
newCall
(
request
).
execute
();
if
(
payResponse
.
code
()
!=
200
)
{
throw
ClientEndExceptions
.
BusinessException
.
build
(
ErrorCodeEnum
.
ORDER_PAY_REFUND_FAILED
);
}
String
htmlContent
=
payResponse
.
body
().
string
();
return
htmlContent
;
//
Request request =
//
new Request.Builder().url(url).get().build();
//
Response payResponse = client.newCall(request).execute();
//
if (payResponse.code() != 200) {
//
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED);
//
}
//
String htmlContent = payResponse.body().string();
return
url
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
throw
ClientEndExceptions
.
BusinessException
.
build
(
ErrorCodeEnum
.
ORDER_PAY_REFUND_FAILED
);
...
...
src/main/java/com/infoloop/tianting/service/impl/OrderServiceImpl.java
View file @
f2832ad
...
...
@@ -509,6 +509,7 @@ public class OrderServiceImpl implements OrderService {
.
preparingCount
(
response
.
getCountByStatus
().
getPreparingCount
())
.
toPrepareCount
(
response
.
getCountByStatus
().
getToPrepareCount
())
.
unknownCount
(
response
.
getCountByStatus
().
getUnknownCount
())
.
refundCount
(
response
.
getCountByStatus
().
getRefundCount
())
.
build
();
return
PageUtil
.
from
(
results
,
response
.
getTotal
(),
response
.
getPages
(),
queryOrderDto
.
getPn
(),
queryOrderDto
.
getPz
(),
orderCountByStatus
);
...
...
@@ -582,8 +583,16 @@ public class OrderServiceImpl implements OrderService {
.
orderNotice
(
orderNotice
)
.
build
();
}).
collect
(
Collectors
.
toList
());
final
var
orderCountByStatus
=
OrderCountByStatusDto
.
builder
()
.
allServedCount
(
response
.
getCountByStatus
().
getAllServedCount
())
.
canceledCount
(
response
.
getCountByStatus
().
getCanceledCount
())
.
preparingCount
(
response
.
getCountByStatus
().
getPreparingCount
())
.
toPrepareCount
(
response
.
getCountByStatus
().
getToPrepareCount
())
.
unknownCount
(
response
.
getCountByStatus
().
getUnknownCount
())
.
refundCount
(
response
.
getCountByStatus
().
getRefundCount
())
.
build
();
return
PageUtil
.
from
(
results
,
response
.
getTotal
(),
response
.
getPages
(),
queryOrderDto
.
getPn
(),
queryOrderDto
.
getPz
(),
OrderCountByStatusDto
.
builder
().
build
()
);
queryOrderDto
.
getPn
(),
queryOrderDto
.
getPz
(),
orderCountByStatus
);
}
private
CustomerDetailDto
getCustomerDetail
(
Integer
customerId
,
List
<
SingleClientCustomerRpcResponse
>
customers
)
{
...
...
src/main/proto/ClientCustomerOrderService.proto
View file @
f2832ad
...
...
@@ -192,6 +192,7 @@ message OrderCountByStatus {
int32
preparingCount
=
3
;
int32
allServedCount
=
4
;
int32
canceledCount
=
5
;
int32
refundCount
=
6
;
}
message
QueryClientCustomerOrdersByPaginationRpcResponse
{
...
...
Please
register
or
login
to post a comment