wangyingyang

fix refund

...@@ -83,6 +83,7 @@ public class OrderDbDTO { ...@@ -83,6 +83,7 @@ public class OrderDbDTO {
83 private Integer preparingCount; 83 private Integer preparingCount;
84 private Integer allServedCount; 84 private Integer allServedCount;
85 private Integer canceledCount; 85 private Integer canceledCount;
86 + private Integer refundCount;
86 } 87 }
87 88
88 @Data 89 @Data
......
...@@ -381,21 +381,17 @@ public class PayServiceClient { ...@@ -381,21 +381,17 @@ public class PayServiceClient {
381 String signInfo = DigestUtils.sha1Hex(signInfoStr.getBytes()); 381 String signInfo = DigestUtils.sha1Hex(signInfoStr.getBytes());
382 382
383 // 构建请求 383 // 构建请求
384 - // 设置请求体的媒体类型为JSON
385 try { 384 try {
386 - // MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
387 - // RequestBody body = RequestBody.create(mediaType, jsonDataString);
388 -
389 String url = businessConfig.getCancelPayUrl() + "?" + "appid=" + appId + "&paycontent=" + payContent + "&signinfo=" + signInfo; 385 String url = businessConfig.getCancelPayUrl() + "?" + "appid=" + appId + "&paycontent=" + payContent + "&signinfo=" + signInfo;
390 log.info("cancel order pay url:" + url); 386 log.info("cancel order pay url:" + url);
391 - Request request = 387 +// Request request =
392 - new Request.Builder().url(url).get().build(); 388 +// new Request.Builder().url(url).get().build();
393 - Response payResponse = client.newCall(request).execute(); 389 +// Response payResponse = client.newCall(request).execute();
394 - if (payResponse.code() != 200) { 390 +// if (payResponse.code() != 200) {
395 - throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED); 391 +// throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED);
396 - } 392 +// }
397 - String htmlContent = payResponse.body().string(); 393 +// String htmlContent = payResponse.body().string();
398 - return htmlContent; 394 + return url;
399 } catch (Exception e) { 395 } catch (Exception e) {
400 log.error(e.getMessage()); 396 log.error(e.getMessage());
401 throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED); 397 throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED);
......
...@@ -509,6 +509,7 @@ public class OrderServiceImpl implements OrderService { ...@@ -509,6 +509,7 @@ public class OrderServiceImpl implements OrderService {
509 .preparingCount(response.getCountByStatus().getPreparingCount()) 509 .preparingCount(response.getCountByStatus().getPreparingCount())
510 .toPrepareCount(response.getCountByStatus().getToPrepareCount()) 510 .toPrepareCount(response.getCountByStatus().getToPrepareCount())
511 .unknownCount(response.getCountByStatus().getUnknownCount()) 511 .unknownCount(response.getCountByStatus().getUnknownCount())
512 + .refundCount(response.getCountByStatus().getRefundCount())
512 .build(); 513 .build();
513 return PageUtil.from(results, response.getTotal(), response.getPages(), 514 return PageUtil.from(results, response.getTotal(), response.getPages(),
514 queryOrderDto.getPn(), queryOrderDto.getPz(), orderCountByStatus); 515 queryOrderDto.getPn(), queryOrderDto.getPz(), orderCountByStatus);
...@@ -582,8 +583,16 @@ public class OrderServiceImpl implements OrderService { ...@@ -582,8 +583,16 @@ public class OrderServiceImpl implements OrderService {
582 .orderNotice(orderNotice) 583 .orderNotice(orderNotice)
583 .build(); 584 .build();
584 }).collect(Collectors.toList()); 585 }).collect(Collectors.toList());
586 + final var orderCountByStatus = OrderCountByStatusDto.builder()
587 + .allServedCount(response.getCountByStatus().getAllServedCount())
588 + .canceledCount(response.getCountByStatus().getCanceledCount())
589 + .preparingCount(response.getCountByStatus().getPreparingCount())
590 + .toPrepareCount(response.getCountByStatus().getToPrepareCount())
591 + .unknownCount(response.getCountByStatus().getUnknownCount())
592 + .refundCount(response.getCountByStatus().getRefundCount())
593 + .build();
585 return PageUtil.from(results, response.getTotal(), response.getPages(), 594 return PageUtil.from(results, response.getTotal(), response.getPages(),
586 - queryOrderDto.getPn(), queryOrderDto.getPz(), OrderCountByStatusDto.builder().build()); 595 + queryOrderDto.getPn(), queryOrderDto.getPz(), orderCountByStatus);
587 } 596 }
588 private CustomerDetailDto getCustomerDetail(Integer customerId, 597 private CustomerDetailDto getCustomerDetail(Integer customerId,
589 List<SingleClientCustomerRpcResponse> customers) { 598 List<SingleClientCustomerRpcResponse> customers) {
......
...@@ -192,6 +192,7 @@ message OrderCountByStatus { ...@@ -192,6 +192,7 @@ message OrderCountByStatus {
192 int32 preparingCount = 3; 192 int32 preparingCount = 3;
193 int32 allServedCount = 4; 193 int32 allServedCount = 4;
194 int32 canceledCount = 5; 194 int32 canceledCount = 5;
195 + int32 refundCount = 6;
195 } 196 }
196 197
197 message QueryClientCustomerOrdersByPaginationRpcResponse { 198 message QueryClientCustomerOrdersByPaginationRpcResponse {
......