wangyingyang

fix refund

......@@ -83,6 +83,7 @@ public class OrderDbDTO {
private Integer preparingCount;
private Integer allServedCount;
private Integer canceledCount;
private Integer refundCount;
}
@Data
......
......@@ -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);
......
......@@ -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) {
......
......@@ -192,6 +192,7 @@ message OrderCountByStatus {
int32 preparingCount = 3;
int32 allServedCount = 4;
int32 canceledCount = 5;
int32 refundCount = 6;
}
message QueryClientCustomerOrdersByPaginationRpcResponse {
......