wangyingyang

fix refund

......@@ -36,10 +36,10 @@ public class ClientOrderController {
}
@ApiOperation(value = "院区端已撤销订单")
@PostMapping("/client/orders/canceled/pagination")
@PostMapping("/client/orders/refund/pagination")
@ResponseStatus(HttpStatus.OK)
public OrderPageResult<OrderDto> getCanceledOrderByByPagination(@Valid @RequestBody OrderDbDTO.QueryCanceledOrderByPaginationDto queryOrderDto) {
return orderService.getCanceledOrdersByPagination(queryOrderDto);
public OrderPageResult<OrderDto> getRefundOrderByByPagination(@Valid @RequestBody OrderDbDTO.QueryRefundOrderByPaginationDto queryOrderDto) {
return orderService.getRefundOrdersByPagination(queryOrderDto);
}
}
......
......@@ -12,6 +12,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -54,9 +55,9 @@ public class PayController {
}
@ApiOperation(value = "支付撤销")
@PostMapping(value = "/pay/cancel")
@PostMapping(value = "/pay/refund", produces = MediaType.TEXT_HTML_VALUE)
@ResponseStatus(HttpStatus.OK)
public boolean cancel(@Valid @RequestBody PayDTO.PayCancelRequestDto payCancelRequestDto) {
return payServiceClient.cancelOrder(payCancelRequestDto);
public String cancel(@Valid @RequestBody PayDTO.PayRefundRequestDto payRefundRequestDto) {
return payServiceClient.orderPayRefund(payRefundRequestDto);
}
}
\ No newline at end of file
......
......@@ -36,7 +36,13 @@ public enum ErrorCodeEnum implements BaseEnum {
ORDER_CANCEL(406000009, "订单已自动取消"),
ORDER_PAY_CANCEL_FAILED(406000010, "支付撤销失败")
ORDER_PAY_REFUND_FAILED(406000010, "支付撤销失败"),
ORDER_NOT_FOUND(406000011, "订单未找到"),
ORDER_NOT_ONLINE_PAY(406000012, "该订单不是在线支付"),
ORDER_NOT_SUCCESS(406000013, "该订单未支付成功")
;
private final int code;
......
......@@ -65,7 +65,7 @@ public class OrderDbDTO {
@Data
@ApiModel(description = "查询已撤销订单Dto")
public static class QueryCanceledOrderByPaginationDto {
public static class QueryRefundOrderByPaginationDto {
private Integer enterpriseId;
private Integer clientId;
private Integer pn;
......@@ -406,7 +406,7 @@ public class OrderDbDTO {
@ApiModelProperty(value = "支付时间")
private String payTime;
@ApiModelProperty(value = "支付状态,1=待支付,2=支付中,3=支付成功,4=支付失败,5=支付取消")
@ApiModelProperty(value = "支付状态,1=待支付,2=支付中,3=支付成功,4=支付失败,5=支付取消, 6=支付已撤销")
private Integer payStatus;
@ApiModelProperty(value = "支付失败原因")
......
......@@ -26,14 +26,12 @@ public class PayDTO {
}
@Data
@ApiModel(description = "支付请求dto")
@ApiModel(description = "支付撤销请求dto")
@NoArgsConstructor
@AllArgsConstructor
public static class PayCancelRequestDto {
// private String clientId;
public static class PayRefundRequestDto {
private Integer orderId;
private String hospitalCode;
// private String price;
}
@Data
......
......@@ -9,9 +9,9 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.OrderAndDetailsDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailBatchUpdateDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryCanceledOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryRefundOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderResponse;
import com.infoloop.tianting.model.dto.OrderDbDTO.getMenuOrderCountDto;
......@@ -22,8 +22,8 @@ public interface OrderService {
OrderAndDetailsDto getOrdersByCustomerId(Integer customerId);
OrderAndDetailsDto getOrdersByCondition(QueryOrderByConditionDto queryOrderDto);
OrderPageResult<OrderDto> getOrdersByPagination(QueryOrderByPaginationDto queryOrderDto);
OrderPageResult<OrderDto> getCanceledOrdersByPagination(
QueryCanceledOrderByPaginationDto queryOrderDto);
OrderPageResult<OrderDto> getRefundOrdersByPagination(
QueryRefundOrderByPaginationDto queryOrderDto);
List<OrderDetailDto> getOrderDetailsByOrderId(Integer orderId);
CreateOrderResponse createOrder(CreateOrderDto createOrderDto);
CreateOrderResponse orderCreation(OperatorCreateOrderDto createOrderDto);
......
......@@ -64,9 +64,9 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.MealDetailDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailBatchUpdateDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailOperationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryCanceledOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryRefundOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto;
import com.infoloop.tianting.server.UserAuthData;
import com.infoloop.tianting.server.WebSocketServer;
......@@ -463,7 +463,7 @@ public class OrderServiceRpcClient {
.setPageNo(queryOrderDto.getPn())
.setPageSize(queryOrderDto.getPz())
.setShouldFilterStatus(true)
.setShouldFilterIsCanceled(false)
.setShouldFilterPayStatus(false)
.setStatus(queryOrderDto.getStatus())
.setEnterpriseId(queryOrderDto.getEnterpriseId())
.setClientId(queryOrderDto.getClientId())
......@@ -472,15 +472,15 @@ public class OrderServiceRpcClient {
return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request);
}
public QueryClientCustomerOrdersByPaginationRpcResponse queryCanceledClientCustomerOrdersByPagination(
QueryCanceledOrderByPaginationDto queryOrderDto) {
public QueryClientCustomerOrdersByPaginationRpcResponse queryRefundClientCustomerOrdersByPagination(
QueryRefundOrderByPaginationDto queryOrderDto) {
final var request = QueryClientCustomerOrdersByPaginationRpcRequest.newBuilder()
.setKeyword(queryOrderDto.getKeyword() == null ? "" : queryOrderDto.getKeyword())
.setPageNo(queryOrderDto.getPn())
.setPageSize(queryOrderDto.getPz())
.setShouldFilterStatus(false)
.setShouldFilterIsCanceled(true)
.setIsCanceled(true)
.setShouldFilterPayStatus(true)
.setPayStatus(PayStatusEnum.REFUND)
.setEnterpriseId(queryOrderDto.getEnterpriseId())
.setClientId(queryOrderDto.getClientId())
.addAllStallIds(queryOrderDto.getStallIds())
......
......@@ -18,9 +18,8 @@ import com.infoloop.tianting.config.BusinessConfig;
import com.infoloop.tianting.context.LoginContextHolder;
import com.infoloop.tianting.exception.ClientEndExceptions;
import com.infoloop.tianting.exception.ErrorCodeEnum;
import com.infoloop.tianting.model.dto.PayDTO.CancelPayResponseDto;
import com.infoloop.tianting.model.dto.PayDTO.PayCancelRequestDto;
import com.infoloop.tianting.model.dto.PayDTO.PayInformRequestDto;
import com.infoloop.tianting.model.dto.PayDTO.PayRefundRequestDto;
import com.infoloop.tianting.model.dto.PayDTO.PayResponseDto;
import com.infoloop.tianting.model.dto.PayDTO.ThirdPartyPayInformRequestDto;
import com.infoloop.tianting.model.dto.PaymentCallbackDTO;
......@@ -168,118 +167,133 @@ public class PayServiceClient {
log.error("Order not found, orderId: {}", orderId);
return false;
}
if (orderById.getPayStatus() != PayStatusEnum.TO_PAY
&& orderById.getPayStatus() != PayStatusEnum.IN_PROGRESS) {
log.error("Order status is not TO_PAY or IN_PROGRESS, orderId: {}", orderId);
return true;
}
long payTime;
try {
payTime =
DateUtil.parseDate(paymentCallbackResult.getTransDate(), "yyyyMMddHHmmss").getTime();
} catch (ParseException e) {
log.error("Failed to parse TransDate: {}", paymentCallbackResult.getTransDate(), e);
throw new IllegalArgumentException("支付时间格式错误: " + paymentCallbackResult.getTransDate(), e);
}
BigDecimal realAmount;
try {
realAmount = Convert.toBigDecimal(paymentCallbackResult.getRealAmount());
if (realAmount == null) {
throw new NumberFormatException("RealAmount is null or empty");
final var transType = paymentCallbackResult.getTransType();
if (transType.equals("00")) {
if (orderById.getPayStatus() != PayStatusEnum.TO_PAY
&& orderById.getPayStatus() != PayStatusEnum.IN_PROGRESS) {
log.error("Order status is not TO_PAY or IN_PROGRESS, orderId: {}", orderId);
return true;
}
} catch (NumberFormatException e) {
log.error("Invalid RealAmount value: {}", paymentCallbackResult.getRealAmount(), e);
throw new IllegalArgumentException("支付金额错误: " + paymentCallbackResult.getRealAmount(), e);
}
final var build =
ClientCustomerOrderModification.newBuilder()
.setId(orderId)
.setShouldUpdatePayTime(true)
.setPayTime(payTime)
.setShouldUpdatePayPrice(true)
.setPayPrice(realAmount.multiply(new BigDecimal("100")).intValue())
.setShouldUpdatePayStatus(true)
.setPayStatus(PayStatusEnum.SUCCEED)
.setShouldUpdateStatus(true)
.setStatus(OrderStatusEnum.PREPARING)
.setShouldUpdateTransactionId(true)
.setTransactionId(paymentCallbackResult.getTransSN())
.build();
final var updateResponse =
orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build);
log.info("callback updateClientCustomerOrder result: {}", updateResponse.getIsUpdated());
if (updateResponse.getIsUpdated()) {
final var orderPaymentSuccessData =
OrderPaymentSuccessData.builder()
.orderId(orderById.getId())
.orderCode(orderById.getOrderCode())
.createTime(DateUtil.formatDate(orderById.getCreatedAt(), DateUtil.Y_M_D_H_M_S))
.payTime(DateUtil.formatDate(orderById.getPayTime(), DateUtil.Y_M_D_H_M_S))
.build();
final var data =
SocketMessage.<OrderPaymentSuccessData>builder()
.type(MessageTypeEnum.ORDER)
.noticeType(NoticeTypeEnum.ORDER_PAYMENT_SUCCESS)
.subject(NoticeTypeEnum.ORDER_PAYMENT_SUCCESS.getDescription())
.message("您的订单:" + orderById.getOrderCode() + " 支付成功啦,快去查看吧~")
.data(orderPaymentSuccessData)
long payTime;
try {
payTime =
DateUtil.parseDate(paymentCallbackResult.getTransDate(), "yyyyMMddHHmmss").getTime();
} catch (ParseException e) {
log.error("Failed to parse TransDate: {}", paymentCallbackResult.getTransDate(), e);
throw new IllegalArgumentException("支付时间格式错误: " + paymentCallbackResult.getTransDate(), e);
}
BigDecimal realAmount;
try {
realAmount = Convert.toBigDecimal(paymentCallbackResult.getRealAmount());
if (realAmount == null) {
throw new NumberFormatException("RealAmount is null or empty");
}
} catch (NumberFormatException e) {
log.error("Invalid RealAmount value: {}", paymentCallbackResult.getRealAmount(), e);
throw new IllegalArgumentException("支付金额错误: " + paymentCallbackResult.getRealAmount(), e);
}
final var build =
ClientCustomerOrderModification.newBuilder()
.setId(orderId)
.setShouldUpdatePayTime(true)
.setPayTime(payTime)
.setShouldUpdatePayPrice(true)
.setPayPrice(realAmount.multiply(new BigDecimal("100")).intValue())
.setShouldUpdatePayStatus(true)
.setPayStatus(PayStatusEnum.SUCCEED)
.setShouldUpdateStatus(true)
.setStatus(OrderStatusEnum.PREPARING)
.setShouldUpdateTransactionId(true)
.setTransactionId(paymentCallbackResult.getTransSN())
.build();
WebSocketServer.sendMessageToUser(
UserSessionKey.builder()
.userId(orderById.getOpenId())
.userType(UserTypeEnum.MICRO)
.build(),
data);
if (LocalDate.now().equals(DateUtil.toLocalDate(orderById.getMealTime()))) {
final var orderCreateSuccessData =
OrderCreateSuccessData.builder().orderId(orderById.getId()).build();
final var createOrderData =
SocketMessage.<OrderCreateSuccessData>builder()
final var updateResponse =
orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build);
log.info("callback updateClientCustomerOrder result: {}", updateResponse.getIsUpdated());
if (updateResponse.getIsUpdated()) {
final var orderPaymentSuccessData =
OrderPaymentSuccessData.builder()
.orderId(orderById.getId())
.orderCode(orderById.getOrderCode())
.createTime(DateUtil.formatDate(orderById.getCreatedAt(), DateUtil.Y_M_D_H_M_S))
.payTime(DateUtil.formatDate(orderById.getPayTime(), DateUtil.Y_M_D_H_M_S))
.build();
final var data =
SocketMessage.<OrderPaymentSuccessData>builder()
.type(MessageTypeEnum.ORDER)
.noticeType(NoticeTypeEnum.ORDER_CREATED)
.subject(NoticeTypeEnum.ORDER_CREATED.getDescription())
.message("有新的订单下单成功啦,快去查看吧~")
.data(orderCreateSuccessData)
.noticeType(NoticeTypeEnum.ORDER_PAYMENT_SUCCESS)
.subject(NoticeTypeEnum.ORDER_PAYMENT_SUCCESS.getDescription())
.message("您的订单:" + orderById.getOrderCode() + " 支付成功啦,快去查看吧~")
.data(orderPaymentSuccessData)
.build();
final var clientOperatorIds =
clientResourceTagServiceRpcClient
.getOperatorIdsByStallIds(List.of(orderById.getStallId())).stream()
.map(SingleResourceLabelEntityRefsResponse::getEntityId)
.distinct()
.collect(Collectors.toList());
final var enterpriseOperatorIds =
enterpriseResourceServiceRpcClient.getOperatorIdsByStallId(
orderById.getEnterpriseId(), orderById.getStallId());
final var userAuthData = new ArrayList<UserAuthData>();
userAuthData.addAll(
clientOperatorIds.stream()
.map(
e ->
UserAuthData.builder()
.operatorId(e)
.userType(UserTypeEnum.CLIENT)
.build())
.collect(Collectors.toList()));
userAuthData.addAll(
enterpriseOperatorIds.stream()
.map(e -> UserAuthData.builder().operatorId(e).userType(UserTypeEnum.KDS).build())
.collect(Collectors.toList()));
log.info("received userAuthData:{}", JsonUtil.writeAsJson(userAuthData));
try {
WebSocketServer.sendMessageByUserTypes(
List.of(UserTypeEnum.CLIENT, UserTypeEnum.KDS), userAuthData, createOrderData);
} catch (IOException e) {
log.error("Failed to send message to user", e);
WebSocketServer.sendMessageToUser(
UserSessionKey.builder()
.userId(orderById.getOpenId())
.userType(UserTypeEnum.MICRO)
.build(),
data);
if (LocalDate.now().equals(DateUtil.toLocalDate(orderById.getMealTime()))) {
final var orderCreateSuccessData =
OrderCreateSuccessData.builder().orderId(orderById.getId()).build();
final var createOrderData =
SocketMessage.<OrderCreateSuccessData>builder()
.type(MessageTypeEnum.ORDER)
.noticeType(NoticeTypeEnum.ORDER_CREATED)
.subject(NoticeTypeEnum.ORDER_CREATED.getDescription())
.message("有新的订单下单成功啦,快去查看吧~")
.data(orderCreateSuccessData)
.build();
final var clientOperatorIds =
clientResourceTagServiceRpcClient
.getOperatorIdsByStallIds(List.of(orderById.getStallId())).stream()
.map(SingleResourceLabelEntityRefsResponse::getEntityId)
.distinct()
.collect(Collectors.toList());
final var enterpriseOperatorIds =
enterpriseResourceServiceRpcClient.getOperatorIdsByStallId(
orderById.getEnterpriseId(), orderById.getStallId());
final var userAuthData = new ArrayList<UserAuthData>();
userAuthData.addAll(
clientOperatorIds.stream()
.map(
e ->
UserAuthData.builder()
.operatorId(e)
.userType(UserTypeEnum.CLIENT)
.build())
.collect(Collectors.toList()));
userAuthData.addAll(
enterpriseOperatorIds.stream()
.map(e -> UserAuthData.builder().operatorId(e).userType(UserTypeEnum.KDS).build())
.collect(Collectors.toList()));
log.info("received userAuthData:{}", JsonUtil.writeAsJson(userAuthData));
try {
WebSocketServer.sendMessageByUserTypes(
List.of(UserTypeEnum.CLIENT, UserTypeEnum.KDS), userAuthData, createOrderData);
} catch (IOException e) {
log.error("Failed to send message to user", e);
}
}
}
return updateResponse.getIsUpdated();
} else {
final var build =
ClientCustomerOrderModification.newBuilder()
.setId(orderId)
.setShouldUpdatePayStatus(true)
.setPayStatus(PayStatusEnum.REFUND)
.build();
final var updateResponse =
orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build);
log.info("callback updateClientCustomerOrder result: {}", updateResponse.getIsUpdated());
return updateResponse.getIsUpdated();
}
return updateResponse.getIsUpdated();
} catch (JsonProcessingException e) {
log.error("Failed to parse XML response, raw XML: {}", paymentCallbackDTO.getPayResult(), e);
throw new RuntimeException("支付通知结果解析失败", e);
throw new RuntimeException("支付/退款通知结果解析失败", e);
} catch (Exception e) {
log.error("Unexpected error in callback, request: {}", paymentCallbackDTO, e);
throw new RuntimeException("支付通知处理失败", e);
throw new RuntimeException("支付/退款通知处理失败", e);
}
}
......@@ -305,20 +319,20 @@ public class PayServiceClient {
return updateResponse.getIsUpdated();
}
public boolean cancelOrder(PayCancelRequestDto payCancelRequestDto) {
Integer orderId = payCancelRequestDto.getOrderId();
public String orderPayRefund(PayRefundRequestDto payRefundRequestDto) {
Integer orderId = payRefundRequestDto.getOrderId();
final var orderById = orderServiceRpcClient.getOrderById(orderId);
if (orderById == null) {
log.error("Order not found, orderId: {}", orderId);
return false;
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_NOT_FOUND);
}
if (orderById.getOnlinePay() != OnlinePayEnum.ONLINE) {
log.info("Order {} is not online pay.", orderId);
return false;
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_NOT_ONLINE_PAY);
}
if (orderById.getPayStatus() != PayStatusEnum.SUCCEED) {
log.info("Order {} pay is not succeed.", orderId);
return false;
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_NOT_SUCCESS);
}
LocalDate today = LocalDate.now();
LocalDate tomorrow = today.plusDays(1);
......@@ -326,7 +340,7 @@ public class PayServiceClient {
LocalDateTime orderPayTime = DateUtil.toLocalDateTime(orderById.getPayTime());
if (!orderPayTime.isBefore(tomorrowZero)) {
log.info("Order {} pay is beyond cancel time.", orderId);
return false;
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED);
}
String appId = businessConfig.getPayClientId();
......@@ -337,7 +351,7 @@ public class PayServiceClient {
String payContentStr =
orderById.getId()
+ "^"
+ "01(退款)"
+ "01"
+ "^"
+ ""
+ "^"
......@@ -351,7 +365,7 @@ public class PayServiceClient {
+ "^"
+ orderById.getTransactionId()
+ "^"
+ payCancelRequestDto.getHospitalCode()
+ payRefundRequestDto.getHospitalCode()
+ "^"
+ ""
+ "^"
......@@ -378,36 +392,13 @@ public class PayServiceClient {
new Request.Builder().url(url).get().build();
Response payResponse = client.newCall(request).execute();
if (payResponse.code() != 200) {
log.error("cancel order pay failed, resp http code:" + payResponse.code());
return false;
}
String cancelPayJsonData = payResponse.body().string();
log.info("cancel order pay resp:" + cancelPayJsonData);
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(Feature.ALLOW_MISSING_VALUES, true);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES, false);
CancelPayResponseDto payResponseDto =
objectMapper.readValue(cancelPayJsonData, CancelPayResponseDto.class);
if (payResponseDto.getCode() != 0) {
log.error("cancel order pay failed, resp code:" + payResponseDto.getCode());
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_CANCEL_FAILED);
} else {
// 更新订单撤销状态
final var build =
ClientCustomerOrderModification.newBuilder()
.setId(orderId)
.setShouldUpdateIsCanceled(true)
.setIsCanceled(true)
.build();
orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build);
return true;
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED);
}
String htmlContent = payResponse.body().string();
return htmlContent;
} catch (Exception e) {
log.error(e.getMessage());
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_CANCEL_FAILED);
throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED);
}
}
}
......
......@@ -36,9 +36,9 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.OrderCountByStatusDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailBatchUpdateDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryCanceledOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.QueryRefundOrderByPaginationDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto;
import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderResponse;
import com.infoloop.tianting.model.dto.OrderDbDTO.getMenuOrderCountDto;
......@@ -515,9 +515,9 @@ public class OrderServiceImpl implements OrderService {
}
@Override
public OrderPageResult<OrderDto> getCanceledOrdersByPagination(
QueryCanceledOrderByPaginationDto queryOrderDto) {
final var response = orderServiceRpcClient.queryCanceledClientCustomerOrdersByPagination(queryOrderDto);
public OrderPageResult<OrderDto> getRefundOrdersByPagination(
QueryRefundOrderByPaginationDto queryOrderDto) {
final var response = orderServiceRpcClient.queryRefundClientCustomerOrdersByPagination(queryOrderDto);
final var customerIds = response.getResponsesList().stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).collect(Collectors.toList());
final var customerResponse = clientCustomerServiceRpcClient.getClientCustomersByIds(
queryOrderDto.getEnterpriseId(), customerIds);
......
......@@ -74,6 +74,7 @@ enum PayStatusEnum {
SUCCEED = 3;
FAILED = 4;
PAY_CANCELED = 5;
REFUND = 6;
}
enum CloseTimeType {
......@@ -181,8 +182,8 @@ message QueryClientCustomerOrdersByPaginationRpcRequest {
int32 pageNo = 6;
int32 pageSize = 7;
repeated int32 stallIds = 8;
bool shouldFilterIsCanceled = 9;
bool isCanceled = 10;
bool shouldFilterPayStatus = 9;
PayStatusEnum payStatus = 10;
}
message OrderCountByStatus {
......
......@@ -34,43 +34,43 @@ okhttp.max-idle-connections=10
okhttp.keep-alive-duration=300
##GRPC\u914D\u7F6E
grpc.order-service.url=localhost
grpc.order-service.port=4096
grpc.order-service.url=115.190.92.112
grpc.order-service.port=4065
grpc.menu-service.url=47.101.193.136
grpc.menu-service.url=115.190.92.112
grpc.menu-service.port=3017
grpc.sku-service.url=47.101.193.136
grpc.sku-service.url=115.190.92.112
grpc.sku-service.port=3027
grpc.category-service.url=47.101.193.136
grpc.category-service.url=115.190.92.112
grpc.category-service.port=3027
grpc.client-customer-service.url=47.101.193.136
grpc.client-customer-service.url=115.190.92.112
grpc.client-customer-service.port=3031
grpc.client-inventory-service.url=47.101.193.136
grpc.client-inventory-service.url=115.190.92.112
grpc.client-inventory-service.port=3037
grpc.meal-service.url=47.101.193.136
grpc.meal-service.url=115.190.92.112
grpc.meal-service.port=3017
grpc.delivery-service.url=47.101.193.136
grpc.delivery-service.url=115.190.92.112
grpc.delivery-service.port=3017
grpc.operator-service.url=115.190.92.112
grpc.operator-service.port=3031
grpc.woperator-service.url=47.101.193.136
grpc.woperator-service.url=115.190.92.112
grpc.woperator-service.port=3028
grpc.enterprise-resource-service.url=47.101.193.136
grpc.enterprise-resource-service.url=115.190.92.112
grpc.enterprise-resource-service.port=3026
grpc.client-resource-service.url=47.101.193.136
grpc.client-resource-service.url=115.190.92.112
grpc.client-resource-service.port=3019
grpc.meizhongyihe-service.url=47.101.193.136
grpc.meizhongyihe-service.url=115.190.92.112
grpc.meizhongyihe-service.port=3040
miniprogram.appId=wx40ec496d73b58ec6
......