Merge branch 'feature/order_cancel' into 'master'
Feature/order cancel See merge request !1
Showing
171 changed files
with
619 additions
and
239 deletions
src/main/java/com/infoloop/tianting/App.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/advice/ExceptionAdvice.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/advice/RequestAdvice.java
100644 → 100755
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/annotation/ApiSign.java
100644 → 100755
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/annotation/RepeatSubmit.java
100644 → 100755
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/config/AppConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/BusinessConfig.java
100644 → 100755
| ... | @@ -16,4 +16,6 @@ public class BusinessConfig { | ... | @@ -16,4 +16,6 @@ public class BusinessConfig { |
| 16 | private String clientCustomerQueryUrl; | 16 | private String clientCustomerQueryUrl; |
| 17 | private String payUrl; | 17 | private String payUrl; |
| 18 | private String payClientId; | 18 | private String payClientId; |
| 19 | + private String cancelPayUrl; | ||
| 20 | + private String refundSecurityKey; | ||
| 19 | } | 21 | } | ... | ... |
src/main/java/com/infoloop/tianting/config/GrpcConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/JacksonConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/RedisConfig.java
100644 → 100755
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/config/RetryConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/SaTokenConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/SmsConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/SwaggerConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/TaskPoolConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/TracingConfig.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/config/WebMvcConfig.java
100644 → 100755
| ... | @@ -7,10 +7,10 @@ import com.infoloop.tianting.intercepter.LoginInterceptor; | ... | @@ -7,10 +7,10 @@ import com.infoloop.tianting.intercepter.LoginInterceptor; |
| 7 | import com.infoloop.tianting.intercepter.RequestMonitor; | 7 | import com.infoloop.tianting.intercepter.RequestMonitor; |
| 8 | import com.infoloop.tianting.intercepter.ResourceInjector; | 8 | import com.infoloop.tianting.intercepter.ResourceInjector; |
| 9 | import com.infoloop.tianting.service.client.ClientCustomerServiceRpcClient; | 9 | import com.infoloop.tianting.service.client.ClientCustomerServiceRpcClient; |
| 10 | +import com.infoloop.tianting.service.client.MeiZhongYiHeServiceClient; | ||
| 10 | import com.infoloop.tianting.service.client.OperatorServiceRpcClient; | 11 | import com.infoloop.tianting.service.client.OperatorServiceRpcClient; |
| 11 | import com.infoloop.tianting.service.client.WOperatorServiceRpcClient; | 12 | import com.infoloop.tianting.service.client.WOperatorServiceRpcClient; |
| 12 | import com.infoloop.tianting.tracing.HttpTracingInterceptor; | 13 | import com.infoloop.tianting.tracing.HttpTracingInterceptor; |
| 13 | -import lombok.RequiredArgsConstructor; | ||
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | import org.springframework.boot.web.servlet.FilterRegistrationBean; | 15 | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| 16 | import org.springframework.context.annotation.Bean; | 16 | import org.springframework.context.annotation.Bean; |
| ... | @@ -37,12 +37,13 @@ public class WebMvcConfig implements WebMvcConfigurer { | ... | @@ -37,12 +37,13 @@ public class WebMvcConfig implements WebMvcConfigurer { |
| 37 | final ResourceInjector resourceInjector, | 37 | final ResourceInjector resourceInjector, |
| 38 | final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient, | 38 | final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient, |
| 39 | final OperatorServiceRpcClient operatorServiceRpcClient, | 39 | final OperatorServiceRpcClient operatorServiceRpcClient, |
| 40 | - final WOperatorServiceRpcClient wOperatorServiceRpcClient) { | 40 | + final WOperatorServiceRpcClient wOperatorServiceRpcClient, |
| 41 | + final MeiZhongYiHeServiceClient meiZhongYiHeServiceClient) { | ||
| 41 | this.httpInterceptors = new ArrayList<>(); | 42 | this.httpInterceptors = new ArrayList<>(); |
| 42 | this.httpInterceptors.add(new HttpTracingInterceptor(tracing)); | 43 | this.httpInterceptors.add(new HttpTracingInterceptor(tracing)); |
| 43 | this.httpInterceptors.add(new RequestMonitor()); | 44 | this.httpInterceptors.add(new RequestMonitor()); |
| 44 | this.httpInterceptors.add(new ApiSignInterceptor()); | 45 | this.httpInterceptors.add(new ApiSignInterceptor()); |
| 45 | - this.httpInterceptors.add(new LoginInterceptor(clientCustomerServiceRpcClient, operatorServiceRpcClient, wOperatorServiceRpcClient)); | 46 | + this.httpInterceptors.add(new LoginInterceptor(clientCustomerServiceRpcClient, meiZhongYiHeServiceClient, operatorServiceRpcClient, wOperatorServiceRpcClient)); |
| 46 | this.httpInterceptors.add(resourceInjector); | 47 | this.httpInterceptors.add(resourceInjector); |
| 47 | 48 | ||
| 48 | } | 49 | } | ... | ... |
src/main/java/com/infoloop/tianting/config/WebSocketConfig.java
100644 → 100755
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
| ... | @@ -35,4 +35,11 @@ public class ClientOrderController { | ... | @@ -35,4 +35,11 @@ public class ClientOrderController { |
| 35 | return orderService.getOrdersByPagination(queryOrderDto); | 35 | return orderService.getOrdersByPagination(queryOrderDto); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | + @ApiOperation(value = "院区端已撤销订单") | ||
| 39 | + @PostMapping("/client/orders/refund/pagination") | ||
| 40 | + @ResponseStatus(HttpStatus.OK) | ||
| 41 | + public OrderPageResult<OrderDto> getRefundOrderByByPagination(@Valid @RequestBody OrderDbDTO.QueryRefundOrderByPaginationDto queryOrderDto) { | ||
| 42 | + return orderService.getRefundOrdersByPagination(queryOrderDto); | ||
| 43 | + } | ||
| 44 | + | ||
| 38 | } | 45 | } | ... | ... |
File mode changed
| 1 | package com.infoloop.tianting.controller; | 1 | package com.infoloop.tianting.controller; |
| 2 | 2 | ||
| 3 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; | 3 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; |
| 4 | -import com.infoloop.tianting.model.dto.ClientLabelDTO; | ||
| 5 | -import com.infoloop.tianting.model.dto.ClientLabelDTO.LabelDto; | ||
| 6 | import com.infoloop.tianting.model.dto.KdsDTO; | 4 | import com.infoloop.tianting.model.dto.KdsDTO; |
| 7 | import com.infoloop.tianting.model.dto.KdsDTO.KdsMealDetailDto; | 5 | import com.infoloop.tianting.model.dto.KdsDTO.KdsMealDetailDto; |
| 8 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDto; | 6 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDto; |
| ... | @@ -10,8 +8,6 @@ import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderSkuDto; | ... | @@ -10,8 +8,6 @@ import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderSkuDto; |
| 10 | import com.infoloop.tianting.service.KdsService; | 8 | import com.infoloop.tianting.service.KdsService; |
| 11 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
| 13 | -import java.util.List; | ||
| 14 | -import javax.validation.Valid; | ||
| 15 | import lombok.RequiredArgsConstructor; | 11 | import lombok.RequiredArgsConstructor; |
| 16 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 17 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -22,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestBody; | ... | @@ -22,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestBody; |
| 22 | import org.springframework.web.bind.annotation.ResponseStatus; | 18 | import org.springframework.web.bind.annotation.ResponseStatus; |
| 23 | import org.springframework.web.bind.annotation.RestController; | 19 | import org.springframework.web.bind.annotation.RestController; |
| 24 | 20 | ||
| 21 | +import javax.validation.Valid; | ||
| 22 | +import java.util.List; | ||
| 23 | + | ||
| 25 | @Api(tags = "KDS") | 24 | @Api(tags = "KDS") |
| 26 | @ApiSupport(order = -1) | 25 | @ApiSupport(order = -1) |
| 27 | @Slf4j | 26 | @Slf4j | ... | ... |
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
| ... | @@ -12,6 +12,7 @@ import lombok.RequiredArgsConstructor; | ... | @@ -12,6 +12,7 @@ import lombok.RequiredArgsConstructor; |
| 12 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.http.HttpStatus; | 14 | import org.springframework.http.HttpStatus; |
| 15 | +import org.springframework.http.MediaType; | ||
| 15 | import org.springframework.validation.annotation.Validated; | 16 | import org.springframework.validation.annotation.Validated; |
| 16 | import org.springframework.web.bind.annotation.PathVariable; | 17 | import org.springframework.web.bind.annotation.PathVariable; |
| 17 | import org.springframework.web.bind.annotation.PostMapping; | 18 | import org.springframework.web.bind.annotation.PostMapping; |
| ... | @@ -53,4 +54,10 @@ public class PayController { | ... | @@ -53,4 +54,10 @@ public class PayController { |
| 53 | return payServiceClient.callback(paymentCallbackDTO); | 54 | return payServiceClient.callback(paymentCallbackDTO); |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 57 | + @ApiOperation(value = "支付撤销") | ||
| 58 | + @PostMapping(value = "/pay/refund", produces = MediaType.TEXT_HTML_VALUE) | ||
| 59 | + @ResponseStatus(HttpStatus.OK) | ||
| 60 | + public String cancel(@Valid @RequestBody PayDTO.PayRefundRequestDto payRefundRequestDto) { | ||
| 61 | + return payServiceClient.orderPayRefund(payRefundRequestDto); | ||
| 62 | + } | ||
| 56 | } | 63 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
File mode changed
src/main/java/com/infoloop/tianting/enums/LoginSourceEnum.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/enums/OrderTypeEnum.java
100644 → 100755
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/exception/BaseEnum.java
100644 → 100755
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/exception/ErrorCodeEnum.java
100644 → 100755
| ... | @@ -34,7 +34,15 @@ public enum ErrorCodeEnum implements BaseEnum { | ... | @@ -34,7 +34,15 @@ public enum ErrorCodeEnum implements BaseEnum { |
| 34 | 34 | ||
| 35 | SKUS_STOCK_NO_ENOUGH_TODAY(406000008, "下单菜品: {0} 库存不足"), | 35 | SKUS_STOCK_NO_ENOUGH_TODAY(406000008, "下单菜品: {0} 库存不足"), |
| 36 | 36 | ||
| 37 | - ORDER_CANCEL(406000009, "订单已自动取消") | 37 | + ORDER_CANCEL(406000009, "订单已自动取消"), |
| 38 | + | ||
| 39 | + ORDER_PAY_REFUND_FAILED(406000010, "支付撤销失败"), | ||
| 40 | + | ||
| 41 | + ORDER_NOT_FOUND(406000011, "订单未找到"), | ||
| 42 | + | ||
| 43 | + ORDER_NOT_ONLINE_PAY(406000012, "该订单不是在线支付"), | ||
| 44 | + | ||
| 45 | + ORDER_NOT_SUCCESS(406000013, "该订单未支付成功") | ||
| 38 | ; | 46 | ; |
| 39 | private final int code; | 47 | private final int code; |
| 40 | 48 | ... | ... |
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/model/common/IdsParam.java
100644 → 100755
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/model/common/PageInfo.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/model/common/PageResult.java
100644 → 100755
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/model/dto/CategoryDbDTO.java
100644 → 100755
File mode changed
| ... | @@ -4,12 +4,13 @@ import com.infoloop.tianting.clientcustomerservice.ClientCustomerHospitalRecordH | ... | @@ -4,12 +4,13 @@ import com.infoloop.tianting.clientcustomerservice.ClientCustomerHospitalRecordH |
| 4 | import com.infoloop.tianting.clientcustomerservice.ClientCustomerSexEnum; | 4 | import com.infoloop.tianting.clientcustomerservice.ClientCustomerSexEnum; |
| 5 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; | 5 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; |
| 6 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
| 7 | -import java.util.List; | ||
| 8 | import lombok.AllArgsConstructor; | 7 | import lombok.AllArgsConstructor; |
| 9 | import lombok.Builder; | 8 | import lombok.Builder; |
| 10 | import lombok.Data; | 9 | import lombok.Data; |
| 11 | import lombok.NoArgsConstructor; | 10 | import lombok.NoArgsConstructor; |
| 12 | 11 | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 13 | @Data | 14 | @Data |
| 14 | @ApiModel(description = "ClientCustomerDTO") | 15 | @ApiModel(description = "ClientCustomerDTO") |
| 15 | public class ClientCustomerDbDTO { | 16 | public class ClientCustomerDbDTO { | ... | ... |
| ... | @@ -5,12 +5,12 @@ import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; | ... | @@ -5,12 +5,12 @@ import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; |
| 5 | import com.infoloop.tianting.deliveryruleservice.ClientDishLabelStatusEnum; | 5 | import com.infoloop.tianting.deliveryruleservice.ClientDishLabelStatusEnum; |
| 6 | import com.infoloop.tianting.deliveryruleservice.ClientLabelTypeEnum; | 6 | import com.infoloop.tianting.deliveryruleservice.ClientLabelTypeEnum; |
| 7 | import io.swagger.annotations.ApiModel; | 7 | import io.swagger.annotations.ApiModel; |
| 8 | -import io.swagger.models.auth.In; | ||
| 9 | -import java.util.List; | ||
| 10 | import lombok.Builder; | 8 | import lombok.Builder; |
| 11 | import lombok.Data; | 9 | import lombok.Data; |
| 12 | import lombok.ToString; | 10 | import lombok.ToString; |
| 13 | 11 | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | @Data | 14 | @Data |
| 15 | @ApiModel(description = "标签DTO") | 15 | @ApiModel(description = "标签DTO") |
| 16 | public class ClientLabelDTO { | 16 | public class ClientLabelDTO { | ... | ... |
| ... | @@ -3,11 +3,11 @@ package com.infoloop.tianting.model.dto; | ... | @@ -3,11 +3,11 @@ package com.infoloop.tianting.model.dto; |
| 3 | import com.infoloop.tianting.clientinventoryservice.ClientType; | 3 | import com.infoloop.tianting.clientinventoryservice.ClientType; |
| 4 | import com.infoloop.tianting.clientinventoryservice.CustomerSource; | 4 | import com.infoloop.tianting.clientinventoryservice.CustomerSource; |
| 5 | import io.swagger.annotations.ApiModel; | 5 | import io.swagger.annotations.ApiModel; |
| 6 | -import io.swagger.models.auth.In; | ||
| 7 | -import java.util.List; | ||
| 8 | import lombok.Builder; | 6 | import lombok.Builder; |
| 9 | import lombok.Data; | 7 | import lombok.Data; |
| 10 | 8 | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | @Data | 11 | @Data |
| 12 | @ApiModel(description = "院区DTO") | 12 | @ApiModel(description = "院区DTO") |
| 13 | public class InventoryDbDTO { | 13 | public class InventoryDbDTO { | ... | ... |
src/main/java/com/infoloop/tianting/model/dto/KdsDTO.java
100644 → 100755
| ... | @@ -6,13 +6,13 @@ import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto; | ... | @@ -6,13 +6,13 @@ import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto; |
| 6 | import com.infoloop.tianting.model.dto.OrderDbDTO.CustomerDetailDto; | 6 | import com.infoloop.tianting.model.dto.OrderDbDTO.CustomerDetailDto; |
| 7 | import com.infoloop.tianting.model.dto.OrderDbDTO.CustomerNotice; | 7 | import com.infoloop.tianting.model.dto.OrderDbDTO.CustomerNotice; |
| 8 | import io.swagger.annotations.ApiModel; | 8 | import io.swagger.annotations.ApiModel; |
| 9 | -import io.swagger.models.auth.In; | ||
| 10 | -import java.util.List; | ||
| 11 | import lombok.AllArgsConstructor; | 9 | import lombok.AllArgsConstructor; |
| 12 | import lombok.Builder; | 10 | import lombok.Builder; |
| 13 | import lombok.Data; | 11 | import lombok.Data; |
| 14 | import lombok.NoArgsConstructor; | 12 | import lombok.NoArgsConstructor; |
| 15 | 13 | ||
| 14 | +import java.util.List; | ||
| 15 | + | ||
| 16 | @Data | 16 | @Data |
| 17 | @ApiModel(description = "kds DTO") | 17 | @ApiModel(description = "kds DTO") |
| 18 | public class KdsDTO { | 18 | public class KdsDTO { | ... | ... |
src/main/java/com/infoloop/tianting/model/dto/MealDbDTO.java
100644 → 100755
| ... | @@ -2,11 +2,12 @@ package com.infoloop.tianting.model.dto; | ... | @@ -2,11 +2,12 @@ package com.infoloop.tianting.model.dto; |
| 2 | 2 | ||
| 3 | import com.infoloop.tianting.setmealscheduleservice.MealStatus; | 3 | import com.infoloop.tianting.setmealscheduleservice.MealStatus; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| 5 | -import java.util.List; | ||
| 6 | import lombok.Builder; | 5 | import lombok.Builder; |
| 7 | import lombok.Data; | 6 | import lombok.Data; |
| 8 | import lombok.ToString; | 7 | import lombok.ToString; |
| 9 | 8 | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 10 | @Data | 11 | @Data |
| 11 | @ApiModel(description = "餐别相关DTO") | 12 | @ApiModel(description = "餐别相关DTO") |
| 12 | public class MealDbDTO { | 13 | public class MealDbDTO { | ... | ... |
src/main/java/com/infoloop/tianting/model/dto/MenuDbDTO.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/model/dto/OperationDTO.java
100644 → 100755
| ... | @@ -2,14 +2,13 @@ package com.infoloop.tianting.model.dto; | ... | @@ -2,14 +2,13 @@ package com.infoloop.tianting.model.dto; |
| 2 | 2 | ||
| 3 | import com.infoloop.tianting.clientcustomerorderservice.OrderOperationType; | 3 | import com.infoloop.tianting.clientcustomerorderservice.OrderOperationType; |
| 4 | import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; | 4 | import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; |
| 5 | -import com.infoloop.tianting.model.dto.MenuDbDTO.DishRuleJson; | ||
| 6 | -import com.infoloop.tianting.model.dto.MenuDbDTO.OrderRuleJson; | ||
| 7 | import io.swagger.annotations.ApiModel; | 5 | import io.swagger.annotations.ApiModel; |
| 8 | -import java.util.List; | ||
| 9 | import lombok.Builder; | 6 | import lombok.Builder; |
| 10 | import lombok.Data; | 7 | import lombok.Data; |
| 11 | import lombok.ToString; | 8 | import lombok.ToString; |
| 12 | 9 | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 13 | @Data | 12 | @Data |
| 14 | @ApiModel(description = "操作记录DTO") | 13 | @ApiModel(description = "操作记录DTO") |
| 15 | public class OperationDTO { | 14 | public class OperationDTO { | ... | ... |
src/main/java/com/infoloop/tianting/model/dto/OrderDbDTO.java
100644 → 100755
| ... | @@ -64,6 +64,17 @@ public class OrderDbDTO { | ... | @@ -64,6 +64,17 @@ public class OrderDbDTO { |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | @Data | 66 | @Data |
| 67 | + @ApiModel(description = "查询已撤销订单Dto") | ||
| 68 | + public static class QueryRefundOrderByPaginationDto { | ||
| 69 | + private Integer enterpriseId; | ||
| 70 | + private Integer clientId; | ||
| 71 | + private Integer pn; | ||
| 72 | + private Integer pz; | ||
| 73 | + private String keyword; | ||
| 74 | + private List<Integer> stallIds; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + @Data | ||
| 67 | @Builder | 78 | @Builder |
| 68 | @ApiModel(description = "订单不同状态的数量Dto") | 79 | @ApiModel(description = "订单不同状态的数量Dto") |
| 69 | public static class OrderCountByStatusDto { | 80 | public static class OrderCountByStatusDto { |
| ... | @@ -72,6 +83,7 @@ public class OrderDbDTO { | ... | @@ -72,6 +83,7 @@ public class OrderDbDTO { |
| 72 | private Integer preparingCount; | 83 | private Integer preparingCount; |
| 73 | private Integer allServedCount; | 84 | private Integer allServedCount; |
| 74 | private Integer canceledCount; | 85 | private Integer canceledCount; |
| 86 | + private Integer refundCount; | ||
| 75 | } | 87 | } |
| 76 | 88 | ||
| 77 | @Data | 89 | @Data |
| ... | @@ -395,7 +407,7 @@ public class OrderDbDTO { | ... | @@ -395,7 +407,7 @@ public class OrderDbDTO { |
| 395 | @ApiModelProperty(value = "支付时间") | 407 | @ApiModelProperty(value = "支付时间") |
| 396 | private String payTime; | 408 | private String payTime; |
| 397 | 409 | ||
| 398 | - @ApiModelProperty(value = "支付状态,1=待支付,2=支付中,3=支付成功,4=支付失败,5=支付取消") | 410 | + @ApiModelProperty(value = "支付状态,1=待支付,2=支付中,3=支付成功,4=支付失败,5=支付取消, 6=支付已撤销") |
| 399 | private Integer payStatus; | 411 | private Integer payStatus; |
| 400 | 412 | ||
| 401 | @ApiModelProperty(value = "支付失败原因") | 413 | @ApiModelProperty(value = "支付失败原因") |
| ... | @@ -455,12 +467,18 @@ public class OrderDbDTO { | ... | @@ -455,12 +467,18 @@ public class OrderDbDTO { |
| 455 | @ApiModelProperty(value = "是否已读") | 467 | @ApiModelProperty(value = "是否已读") |
| 456 | private Boolean isRead; | 468 | private Boolean isRead; |
| 457 | 469 | ||
| 470 | + @ApiModelProperty(value = "是否已撤销") | ||
| 471 | + private Boolean isCanceled; | ||
| 472 | + | ||
| 458 | @ApiModelProperty(value = "截单类型") | 473 | @ApiModelProperty(value = "截单类型") |
| 459 | private Integer closeTimeType; | 474 | private Integer closeTimeType; |
| 460 | 475 | ||
| 461 | @ApiModelProperty(value = "订单所属用户的信息") | 476 | @ApiModelProperty(value = "订单所属用户的信息") |
| 462 | private CustomerDetailDto customer; | 477 | private CustomerDetailDto customer; |
| 463 | 478 | ||
| 479 | + @ApiModelProperty(value = "该订单的忌口冲突、医嘱信息") | ||
| 480 | + private List<String> orderNotice; | ||
| 481 | + | ||
| 464 | // @ApiModelProperty(value = "订单菜品详情列表") | 482 | // @ApiModelProperty(value = "订单菜品详情列表") |
| 465 | // private List<OrderDetailDto> orderDetailDtos; | 483 | // private List<OrderDetailDto> orderDetailDtos; |
| 466 | } | 484 | } | ... | ... |
src/main/java/com/infoloop/tianting/model/dto/PayDTO.java
100644 → 100755
| ... | @@ -26,6 +26,15 @@ public class PayDTO { | ... | @@ -26,6 +26,15 @@ public class PayDTO { |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | @Data | 28 | @Data |
| 29 | + @ApiModel(description = "支付撤销请求dto") | ||
| 30 | + @NoArgsConstructor | ||
| 31 | + @AllArgsConstructor | ||
| 32 | + public static class PayRefundRequestDto { | ||
| 33 | + private Integer orderId; | ||
| 34 | + private String hospitalCode; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + @Data | ||
| 29 | @ApiModel(description = "支付MiniPay结果") | 38 | @ApiModel(description = "支付MiniPay结果") |
| 30 | @NoArgsConstructor | 39 | @NoArgsConstructor |
| 31 | @AllArgsConstructor | 40 | @AllArgsConstructor |
| ... | @@ -76,6 +85,15 @@ public class PayDTO { | ... | @@ -76,6 +85,15 @@ public class PayDTO { |
| 76 | } | 85 | } |
| 77 | 86 | ||
| 78 | @Data | 87 | @Data |
| 88 | + @ApiModel(description = "取消支付响应") | ||
| 89 | + @NoArgsConstructor | ||
| 90 | + @AllArgsConstructor | ||
| 91 | + public static class CancelPayResponseDto { | ||
| 92 | + private Integer code; | ||
| 93 | + private String message; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + @Data | ||
| 79 | @Builder | 97 | @Builder |
| 80 | @ApiModel(description = "第三方支付平台通知请求dto") | 98 | @ApiModel(description = "第三方支付平台通知请求dto") |
| 81 | @NoArgsConstructor | 99 | @NoArgsConstructor | ... | ... |
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/model/dto/PermissionDTO.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/model/dto/SettlementDTO.java
100644 → 100755
| ... | @@ -2,13 +2,13 @@ package com.infoloop.tianting.model.dto; | ... | @@ -2,13 +2,13 @@ package com.infoloop.tianting.model.dto; |
| 2 | 2 | ||
| 3 | import com.infoloop.tianting.enums.SettlementDimensionEnum; | 3 | import com.infoloop.tianting.enums.SettlementDimensionEnum; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| 5 | -import java.util.ArrayList; | ||
| 6 | -import java.util.Map; | ||
| 7 | import lombok.Builder; | 5 | import lombok.Builder; |
| 8 | import lombok.Data; | 6 | import lombok.Data; |
| 9 | 7 | ||
| 10 | import java.time.LocalDateTime; | 8 | import java.time.LocalDateTime; |
| 9 | +import java.util.ArrayList; | ||
| 11 | import java.util.List; | 10 | import java.util.List; |
| 11 | +import java.util.Map; | ||
| 12 | 12 | ||
| 13 | @Data | 13 | @Data |
| 14 | @ApiModel(description = "统计DTO") | 14 | @ApiModel(description = "统计DTO") | ... | ... |
src/main/java/com/infoloop/tianting/model/dto/SkuDbDTO.java
100644 → 100755
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/model/dto/WxUserDto.java
100644 → 100755
| 1 | package com.infoloop.tianting.model.dto; | 1 | package com.infoloop.tianting.model.dto; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import io.swagger.models.auth.In; | ||
| 6 | import lombok.AllArgsConstructor; | 4 | import lombok.AllArgsConstructor; |
| 7 | import lombok.Builder; | 5 | import lombok.Builder; |
| 8 | import lombok.Data; | 6 | import lombok.Data; | ... | ... |
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/server/UserAuthData.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/server/WebSocketServer.java
100644 → 100755
File mode changed
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/server/message/data/CustomerAlterRoomNoData.java
100644 → 100755
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/server/message/data/OrderPaymentSuccessData.java
100644 → 100755
File mode changed
File mode changed
File mode changed
File mode changed
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | import com.infoloop.tianting.model.dto.CategoryDbDTO.CategoryDto; | 3 | import com.infoloop.tianting.model.dto.CategoryDbDTO.CategoryDto; |
| 4 | + | ||
| 4 | import java.util.List; | 5 | import java.util.List; |
| 5 | 6 | ||
| 6 | public interface CategoriesService { | 7 | public interface CategoriesService { | ... | ... |
File mode changed
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | -import com.infoloop.tianting.deliveryruleservice.ClientLabelTypeEnum; | ||
| 4 | import com.infoloop.tianting.model.dto.ClientLabelDTO.LabelDto; | 3 | import com.infoloop.tianting.model.dto.ClientLabelDTO.LabelDto; |
| 5 | import com.infoloop.tianting.model.dto.ClientLabelDTO.QueryLabelsDto; | 4 | import com.infoloop.tianting.model.dto.ClientLabelDTO.QueryLabelsDto; |
| 5 | + | ||
| 6 | import java.util.List; | 6 | import java.util.List; |
| 7 | 7 | ||
| 8 | public interface DeliveryRuleService { | 8 | public interface DeliveryRuleService { | ... | ... |
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | -import com.infoloop.tianting.clientinventoryservice.QueryClientTableCodesByConditionRpcResponse; | ||
| 4 | import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto; | 3 | import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto; |
| 5 | import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientTableCodeDto; | 4 | import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientTableCodeDto; |
| 6 | import com.infoloop.tianting.model.dto.InventoryDbDTO.TableCodeQueryConditionDto; | 5 | import com.infoloop.tianting.model.dto.InventoryDbDTO.TableCodeQueryConditionDto; |
| 6 | + | ||
| 7 | import java.util.List; | 7 | import java.util.List; |
| 8 | 8 | ||
| 9 | public interface InventoryService { | 9 | public interface InventoryService { | ... | ... |
src/main/java/com/infoloop/tianting/service/KdsService.java
100644 → 100755
| ... | @@ -5,6 +5,7 @@ import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDto; | ... | @@ -5,6 +5,7 @@ import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDto; |
| 5 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationQueryDto; | 5 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationQueryDto; |
| 6 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderSkuDto; | 6 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderSkuDto; |
| 7 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderSkuQueryDto; | 7 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderSkuQueryDto; |
| 8 | + | ||
| 8 | import java.util.List; | 9 | import java.util.List; |
| 9 | 10 | ||
| 10 | public interface KdsService { | 11 | public interface KdsService { | ... | ... |
src/main/java/com/infoloop/tianting/service/LoginService.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/service/MealService.java
100644 → 100755
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | import com.infoloop.tianting.model.dto.MealDbDTO.MealDto; | 3 | import com.infoloop.tianting.model.dto.MealDbDTO.MealDto; |
| 4 | + | ||
| 4 | import java.util.List; | 5 | import java.util.List; |
| 5 | 6 | ||
| 6 | public interface MealService { | 7 | public interface MealService { | ... | ... |
| ... | @@ -2,6 +2,7 @@ package com.infoloop.tianting.service; | ... | @@ -2,6 +2,7 @@ package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | import com.infoloop.tianting.model.dto.ClientLabelDTO.HisAllergy; | 3 | import com.infoloop.tianting.model.dto.ClientLabelDTO.HisAllergy; |
| 4 | import com.infoloop.tianting.model.dto.ClientLabelDTO.HisMedicalAdviceDto; | 4 | import com.infoloop.tianting.model.dto.ClientLabelDTO.HisMedicalAdviceDto; |
| 5 | + | ||
| 5 | import java.util.List; | 6 | import java.util.List; |
| 6 | 7 | ||
| 7 | public interface MeiZhongYiHeService { | 8 | public interface MeiZhongYiHeService { | ... | ... |
src/main/java/com/infoloop/tianting/service/MenuService.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/service/OrderService.java
100644 → 100755
| ... | @@ -11,6 +11,7 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; | ... | @@ -11,6 +11,7 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; |
| 11 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; | 11 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; |
| 12 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; | 12 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; |
| 13 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; | 13 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; |
| 14 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryRefundOrderByPaginationDto; | ||
| 14 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto; | 15 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto; |
| 15 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderResponse; | 16 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderResponse; |
| 16 | import com.infoloop.tianting.model.dto.OrderDbDTO.getMenuOrderCountDto; | 17 | import com.infoloop.tianting.model.dto.OrderDbDTO.getMenuOrderCountDto; |
| ... | @@ -21,6 +22,8 @@ public interface OrderService { | ... | @@ -21,6 +22,8 @@ public interface OrderService { |
| 21 | OrderAndDetailsDto getOrdersByCustomerId(Integer customerId); | 22 | OrderAndDetailsDto getOrdersByCustomerId(Integer customerId); |
| 22 | OrderAndDetailsDto getOrdersByCondition(QueryOrderByConditionDto queryOrderDto); | 23 | OrderAndDetailsDto getOrdersByCondition(QueryOrderByConditionDto queryOrderDto); |
| 23 | OrderPageResult<OrderDto> getOrdersByPagination(QueryOrderByPaginationDto queryOrderDto); | 24 | OrderPageResult<OrderDto> getOrdersByPagination(QueryOrderByPaginationDto queryOrderDto); |
| 25 | + OrderPageResult<OrderDto> getRefundOrdersByPagination( | ||
| 26 | + QueryRefundOrderByPaginationDto queryOrderDto); | ||
| 24 | List<OrderDetailDto> getOrderDetailsByOrderId(Integer orderId); | 27 | List<OrderDetailDto> getOrderDetailsByOrderId(Integer orderId); |
| 25 | CreateOrderResponse createOrder(CreateOrderDto createOrderDto); | 28 | CreateOrderResponse createOrder(CreateOrderDto createOrderDto); |
| 26 | CreateOrderResponse orderCreation(OperatorCreateOrderDto createOrderDto); | 29 | CreateOrderResponse orderCreation(OperatorCreateOrderDto createOrderDto); | ... | ... |
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | import com.infoloop.tianting.model.dto.SettlementDTO.SettlementRequestDto; | 3 | import com.infoloop.tianting.model.dto.SettlementDTO.SettlementRequestDto; |
| 4 | + | ||
| 4 | import java.io.ByteArrayOutputStream; | 5 | import java.io.ByteArrayOutputStream; |
| 5 | 6 | ||
| 6 | public interface SettlementService { | 7 | public interface SettlementService { | ... | ... |
src/main/java/com/infoloop/tianting/service/SkuService.java
100644 → 100755
File mode changed
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | -import com.infoloop.tianting.model.dto.SkuDbDTO.SkuDto; | ||
| 4 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto; | 3 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto; |
| 5 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserPhoneResponseDto; | 4 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserPhoneResponseDto; |
| 6 | -import java.util.List; | ||
| 7 | 5 | ||
| 8 | public interface WxMiniProgramService { | 6 | public interface WxMiniProgramService { |
| 9 | WxUserOpenIdDto getWxUserOpenIdByCode(String code); | 7 | WxUserOpenIdDto getWxUserOpenIdByCode(String code); | ... | ... |
File mode changed
src/main/java/com/infoloop/tianting/service/client/ClientCustomerServiceHttpClient.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/service/client/ClientCustomerServiceRpcClient.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/service/client/ClientResourceTagServiceRpcClient.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/service/client/DeliveryRuleServiceRpcClient.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/service/client/EnterpriseResourceServiceRpcClient.java
100644 → 100755
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
| ... | @@ -66,6 +66,7 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; | ... | @@ -66,6 +66,7 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; |
| 66 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailOperationDto; | 66 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailOperationDto; |
| 67 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; | 67 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; |
| 68 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; | 68 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; |
| 69 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryRefundOrderByPaginationDto; | ||
| 69 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto; | 70 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto; |
| 70 | import com.infoloop.tianting.server.UserAuthData; | 71 | import com.infoloop.tianting.server.UserAuthData; |
| 71 | import com.infoloop.tianting.server.WebSocketServer; | 72 | import com.infoloop.tianting.server.WebSocketServer; |
| ... | @@ -186,7 +187,19 @@ public class OrderServiceRpcClient { | ... | @@ -186,7 +187,19 @@ public class OrderServiceRpcClient { |
| 186 | .setUpdateSource(updateOrderDto.getUpdatedSource()) | 187 | .setUpdateSource(updateOrderDto.getUpdatedSource()) |
| 187 | .setModification(modification) | 188 | .setModification(modification) |
| 188 | .build(); | 189 | .build(); |
| 189 | - return orderServiceRpcBlockingStub.updateClientCustomerOrder(request); | 190 | + final UpdateClientCustomerOrderRpcResponse updateClientCustomerOrderRpcResponse = orderServiceRpcBlockingStub.updateClientCustomerOrder(request); |
| 191 | + if (updateClientCustomerOrderRpcResponse.getIsUpdated() && updateOrderDto.getStatus() == OrderStatusEnum.ORDER_CANCELED) { | ||
| 192 | + final var orderById = getOrderById(updateOrderDto.getId()); | ||
| 193 | + if (orderById != null && orderById.getCloseTimeType() == CloseTimeType.IMMEDIATELY) { | ||
| 194 | + final var orderDetails = getOrderDetailsByOrderId(orderById.getId()); | ||
| 195 | + final var isSuccess = addSkusSellQuantities(orderById.getEnterpriseId(), orderById.getStallId(), orderDetails.stream().map(e -> AddSkusSellQuantityBO.builder() | ||
| 196 | + .skuId(e.getSkuId()) | ||
| 197 | + .quantity(-e.getCount()) | ||
| 198 | + .build()).collect(Collectors.toList())); | ||
| 199 | + log.info("Order {} returnSkusSellQuantities result: {}", orderById.getId(), isSuccess); | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + return updateClientCustomerOrderRpcResponse; | ||
| 190 | } | 203 | } |
| 191 | 204 | ||
| 192 | public boolean updateClientCustomerOrderCancel(int enterpriseId, int id) { | 205 | public boolean updateClientCustomerOrderCancel(int enterpriseId, int id) { |
| ... | @@ -461,6 +474,8 @@ public class OrderServiceRpcClient { | ... | @@ -461,6 +474,8 @@ public class OrderServiceRpcClient { |
| 461 | .setKeyword(queryOrderDto.getKeyword() == null ? "" : queryOrderDto.getKeyword()) | 474 | .setKeyword(queryOrderDto.getKeyword() == null ? "" : queryOrderDto.getKeyword()) |
| 462 | .setPageNo(queryOrderDto.getPn()) | 475 | .setPageNo(queryOrderDto.getPn()) |
| 463 | .setPageSize(queryOrderDto.getPz()) | 476 | .setPageSize(queryOrderDto.getPz()) |
| 477 | + .setShouldFilterStatus(true) | ||
| 478 | + .setShouldFilterPayStatus(false) | ||
| 464 | .setStatus(queryOrderDto.getStatus()) | 479 | .setStatus(queryOrderDto.getStatus()) |
| 465 | .setEnterpriseId(queryOrderDto.getEnterpriseId()) | 480 | .setEnterpriseId(queryOrderDto.getEnterpriseId()) |
| 466 | .setClientId(queryOrderDto.getClientId()) | 481 | .setClientId(queryOrderDto.getClientId()) |
| ... | @@ -469,6 +484,22 @@ public class OrderServiceRpcClient { | ... | @@ -469,6 +484,22 @@ public class OrderServiceRpcClient { |
| 469 | return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request); | 484 | return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request); |
| 470 | } | 485 | } |
| 471 | 486 | ||
| 487 | + public QueryClientCustomerOrdersByPaginationRpcResponse queryRefundClientCustomerOrdersByPagination( | ||
| 488 | + QueryRefundOrderByPaginationDto queryOrderDto) { | ||
| 489 | + final var request = QueryClientCustomerOrdersByPaginationRpcRequest.newBuilder() | ||
| 490 | + .setKeyword(queryOrderDto.getKeyword() == null ? "" : queryOrderDto.getKeyword()) | ||
| 491 | + .setPageNo(queryOrderDto.getPn()) | ||
| 492 | + .setPageSize(queryOrderDto.getPz()) | ||
| 493 | + .setShouldFilterStatus(false) | ||
| 494 | + .setShouldFilterPayStatus(true) | ||
| 495 | + .setPayStatus(PayStatusEnum.REFUND) | ||
| 496 | + .setEnterpriseId(queryOrderDto.getEnterpriseId()) | ||
| 497 | + .setClientId(queryOrderDto.getClientId()) | ||
| 498 | + .addAllStallIds(queryOrderDto.getStallIds()) | ||
| 499 | + .build(); | ||
| 500 | + return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request); | ||
| 501 | + } | ||
| 502 | + | ||
| 472 | public List<SingleClientCustomerOrderDetailRpcResponse> getOrderDetailsByOrderId(Integer orderId) { | 503 | public List<SingleClientCustomerOrderDetailRpcResponse> getOrderDetailsByOrderId(Integer orderId) { |
| 473 | return orderServiceRpcBlockingStub.getClientCustomerOrderDetailsByOrderIds( | 504 | return orderServiceRpcBlockingStub.getClientCustomerOrderDetailsByOrderIds( |
| 474 | GetClientCustomerOrderDetailsByOrderIdsRpcRequest.newBuilder() | 505 | GetClientCustomerOrderDetailsByOrderIdsRpcRequest.newBuilder() | ... | ... |
| ... | @@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; | ... | @@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; |
| 8 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; | 8 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; |
| 9 | import com.fasterxml.jackson.dataformat.xml.XmlMapper; | 9 | import com.fasterxml.jackson.dataformat.xml.XmlMapper; |
| 10 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderModification; | 10 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderModification; |
| 11 | +import com.infoloop.tianting.clientcustomerorderservice.OnlinePayEnum; | ||
| 11 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; | 12 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; |
| 12 | import com.infoloop.tianting.clientcustomerorderservice.PayStatusEnum; | 13 | import com.infoloop.tianting.clientcustomerorderservice.PayStatusEnum; |
| 13 | import com.infoloop.tianting.clientresourcetagservice.SingleResourceLabelEntityRefsResponse; | 14 | import com.infoloop.tianting.clientresourcetagservice.SingleResourceLabelEntityRefsResponse; |
| ... | @@ -16,6 +17,7 @@ import com.infoloop.tianting.context.LoginContextHolder; | ... | @@ -16,6 +17,7 @@ import com.infoloop.tianting.context.LoginContextHolder; |
| 16 | import com.infoloop.tianting.exception.ClientEndExceptions; | 17 | import com.infoloop.tianting.exception.ClientEndExceptions; |
| 17 | import com.infoloop.tianting.exception.ErrorCodeEnum; | 18 | import com.infoloop.tianting.exception.ErrorCodeEnum; |
| 18 | import com.infoloop.tianting.model.dto.PayDTO.PayInformRequestDto; | 19 | import com.infoloop.tianting.model.dto.PayDTO.PayInformRequestDto; |
| 20 | +import com.infoloop.tianting.model.dto.PayDTO.PayRefundRequestDto; | ||
| 19 | import com.infoloop.tianting.model.dto.PayDTO.PayResponseDto; | 21 | import com.infoloop.tianting.model.dto.PayDTO.PayResponseDto; |
| 20 | import com.infoloop.tianting.model.dto.PayDTO.ThirdPartyPayInformRequestDto; | 22 | import com.infoloop.tianting.model.dto.PayDTO.ThirdPartyPayInformRequestDto; |
| 21 | import com.infoloop.tianting.model.dto.PaymentCallbackDTO; | 23 | import com.infoloop.tianting.model.dto.PaymentCallbackDTO; |
| ... | @@ -34,6 +36,9 @@ import com.infoloop.tianting.utils.EncryptionUtil; | ... | @@ -34,6 +36,9 @@ import com.infoloop.tianting.utils.EncryptionUtil; |
| 34 | import com.infoloop.tianting.utils.JsonUtil; | 36 | import com.infoloop.tianting.utils.JsonUtil; |
| 35 | import lombok.RequiredArgsConstructor; | 37 | import lombok.RequiredArgsConstructor; |
| 36 | import lombok.extern.slf4j.Slf4j; | 38 | import lombok.extern.slf4j.Slf4j; |
| 39 | +import okhttp3.OkHttpClient; | ||
| 40 | +import org.apache.commons.codec.binary.Base64; | ||
| 41 | +import org.apache.commons.codec.digest.DigestUtils; | ||
| 37 | import org.springframework.beans.factory.annotation.Autowired; | 42 | import org.springframework.beans.factory.annotation.Autowired; |
| 38 | import org.springframework.http.HttpEntity; | 43 | import org.springframework.http.HttpEntity; |
| 39 | import org.springframework.http.HttpHeaders; | 44 | import org.springframework.http.HttpHeaders; |
| ... | @@ -45,6 +50,9 @@ import org.springframework.web.client.RestTemplate; | ... | @@ -45,6 +50,9 @@ import org.springframework.web.client.RestTemplate; |
| 45 | 50 | ||
| 46 | import java.io.IOException; | 51 | import java.io.IOException; |
| 47 | import java.math.BigDecimal; | 52 | import java.math.BigDecimal; |
| 53 | +import java.math.RoundingMode; | ||
| 54 | +import java.net.URLEncoder; | ||
| 55 | +import java.nio.charset.StandardCharsets; | ||
| 48 | import java.text.MessageFormat; | 56 | import java.text.MessageFormat; |
| 49 | import java.text.ParseException; | 57 | import java.text.ParseException; |
| 50 | import java.time.LocalDate; | 58 | import java.time.LocalDate; |
| ... | @@ -53,196 +61,341 @@ import java.util.ArrayList; | ... | @@ -53,196 +61,341 @@ import java.util.ArrayList; |
| 53 | import java.util.List; | 61 | import java.util.List; |
| 54 | import java.util.stream.Collectors; | 62 | import java.util.stream.Collectors; |
| 55 | 63 | ||
| 56 | - | ||
| 57 | @Slf4j | 64 | @Slf4j |
| 58 | @Service | 65 | @Service |
| 59 | @RequiredArgsConstructor(onConstructor = @__(@Autowired)) | 66 | @RequiredArgsConstructor(onConstructor = @__(@Autowired)) |
| 60 | public class PayServiceClient { | 67 | public class PayServiceClient { |
| 61 | 68 | ||
| 62 | - private final RestTemplate restTemplate; | 69 | + private final RestTemplate restTemplate; |
| 63 | 70 | ||
| 64 | - private final BusinessConfig businessConfig; | 71 | + private final BusinessConfig businessConfig; |
| 65 | 72 | ||
| 66 | - private final OrderServiceRpcClient orderServiceRpcClient; | 73 | + private final OrderServiceRpcClient orderServiceRpcClient; |
| 67 | 74 | ||
| 68 | - private final ClientResourceTagServiceRpcClient clientResourceTagServiceRpcClient; | 75 | + private final ClientResourceTagServiceRpcClient clientResourceTagServiceRpcClient; |
| 69 | 76 | ||
| 70 | - private final EnterpriseResourceServiceRpcClient enterpriseResourceServiceRpcClient; | 77 | + private final EnterpriseResourceServiceRpcClient enterpriseResourceServiceRpcClient; |
| 71 | 78 | ||
| 72 | - private final XmlMapper xmlMapper = new XmlMapper(); | 79 | + private final XmlMapper xmlMapper = new XmlMapper(); |
| 73 | 80 | ||
| 74 | - public PayResponseDto payInform(PayInformRequestDto payRequestDto) { | 81 | + private final OkHttpClient client = new OkHttpClient(); |
| 75 | - final var orderById = orderServiceRpcClient.getOrderById(Integer.valueOf(payRequestDto.getOrderId())); | ||
| 76 | - if (orderById == null || orderById.getPayStatus() == PayStatusEnum.PAY_CANCELED || orderById.getStatus() == OrderStatusEnum.ORDER_CANCELED) { | ||
| 77 | - log.info("Order {} not found or canceled, skipping.", payRequestDto.getOrderId()); | ||
| 78 | - throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_CANCEL); | ||
| 79 | - } | ||
| 80 | - String url = MessageFormat.format(businessConfig.getPayUrl(), businessConfig.getPayClientId()); | ||
| 81 | - String requestDate = DateUtil.formatDate(LocalDateTime.now(), DateUtil.YMDHMS); | ||
| 82 | - ThirdPartyPayInformRequestDto jsonData = buildRequestData(payRequestDto, requestDate); | ||
| 83 | - String jsonDataString; | ||
| 84 | - try { | ||
| 85 | - ObjectMapper objectMapper = new ObjectMapper(); | ||
| 86 | - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | ||
| 87 | - objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); | ||
| 88 | - objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE); | ||
| 89 | - jsonDataString = objectMapper.writeValueAsString(jsonData); | ||
| 90 | - } catch (JsonProcessingException e) { | ||
| 91 | - log.error("Failed to serialize request data", e); | ||
| 92 | - throw new IllegalArgumentException("支付信息获取失败: JSON 解析错误"); | ||
| 93 | - } | ||
| 94 | - HttpEntity<String> requestEntity = new HttpEntity<>(jsonDataString, createHeaders()); | ||
| 95 | - log.info("payInform request: {}", jsonDataString); | ||
| 96 | - ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class); | ||
| 97 | - return processResponse(responseEntity); | ||
| 98 | - } | ||
| 99 | 82 | ||
| 100 | - private ThirdPartyPayInformRequestDto buildRequestData(PayInformRequestDto payRequestDto, String requestDate) { | 83 | + public PayResponseDto payInform(PayInformRequestDto payRequestDto) { |
| 101 | - ThirdPartyPayInformRequestDto jsonData = new ThirdPartyPayInformRequestDto(); | 84 | + final var orderById = |
| 102 | - jsonData.setClientId(businessConfig.getPayClientId()); | 85 | + orderServiceRpcClient.getOrderById(Integer.valueOf(payRequestDto.getOrderId())); |
| 103 | - jsonData.setTradeId(payRequestDto.getOrderId()); | 86 | + if (orderById == null |
| 104 | - jsonData.setRequestDate(requestDate); | 87 | + || orderById.getPayStatus() == PayStatusEnum.PAY_CANCELED |
| 105 | - jsonData.setRequestSource("OFWXApplet"); | 88 | + || orderById.getStatus() == OrderStatusEnum.ORDER_CANCELED) { |
| 106 | - jsonData.setPayerOpenId(LoginContextHolder.getOpenId()); | 89 | + log.info("Order {} not found or canceled, skipping.", payRequestDto.getOrderId()); |
| 107 | - jsonData.setHospitalCode(payRequestDto.getHospitalCode()); | 90 | + throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_CANCEL); |
| 108 | - jsonData.setPID(payRequestDto.getPhone()); | 91 | + } |
| 109 | - jsonData.setRemark(""); | 92 | + String url = MessageFormat.format(businessConfig.getPayUrl(), businessConfig.getPayClientId()); |
| 110 | - jsonData.setTransAmount(payRequestDto.getPrice()); | 93 | + String requestDate = DateUtil.formatDate(LocalDateTime.now(), DateUtil.YMDHMS); |
| 111 | - jsonData.setTradeDesc(""); | 94 | + ThirdPartyPayInformRequestDto jsonData = buildRequestData(payRequestDto, requestDate); |
| 112 | - jsonData.setSign(EncryptionUtil.sha1Encryption(businessConfig.getPayClientId() + payRequestDto.getOrderId() + requestDate + businessConfig.getPayClientId())); | 95 | + String jsonDataString; |
| 113 | - return jsonData; | 96 | + try { |
| 97 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
| 98 | + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | ||
| 99 | + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); | ||
| 100 | + objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE); | ||
| 101 | + jsonDataString = objectMapper.writeValueAsString(jsonData); | ||
| 102 | + } catch (JsonProcessingException e) { | ||
| 103 | + log.error("Failed to serialize request data", e); | ||
| 104 | + throw new IllegalArgumentException("支付信息获取失败: JSON 解析错误"); | ||
| 114 | } | 105 | } |
| 106 | + HttpEntity<String> requestEntity = new HttpEntity<>(jsonDataString, createHeaders()); | ||
| 107 | + log.info("payInform request: {}", jsonDataString); | ||
| 108 | + ResponseEntity<String> responseEntity = | ||
| 109 | + restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class); | ||
| 110 | + return processResponse(responseEntity); | ||
| 111 | + } | ||
| 115 | 112 | ||
| 116 | - private HttpHeaders createHeaders() { | 113 | + private ThirdPartyPayInformRequestDto buildRequestData( |
| 117 | - HttpHeaders headers = new HttpHeaders(); | 114 | + PayInformRequestDto payRequestDto, String requestDate) { |
| 118 | - headers.setContentType(MediaType.APPLICATION_JSON); | 115 | + ThirdPartyPayInformRequestDto jsonData = new ThirdPartyPayInformRequestDto(); |
| 119 | - return headers; | 116 | + jsonData.setClientId(businessConfig.getPayClientId()); |
| 117 | + jsonData.setTradeId(payRequestDto.getOrderId()); | ||
| 118 | + jsonData.setRequestDate(requestDate); | ||
| 119 | + jsonData.setRequestSource("OFWXApplet"); | ||
| 120 | + jsonData.setPayerOpenId(LoginContextHolder.getOpenId()); | ||
| 121 | + jsonData.setHospitalCode(payRequestDto.getHospitalCode()); | ||
| 122 | + jsonData.setPID(LoginContextHolder.getOpenId()); | ||
| 123 | + jsonData.setRemark(""); | ||
| 124 | + jsonData.setTransAmount(payRequestDto.getPrice()); | ||
| 125 | + jsonData.setTradeDesc(""); | ||
| 126 | + jsonData.setSign( | ||
| 127 | + EncryptionUtil.sha1Encryption( | ||
| 128 | + businessConfig.getPayClientId() | ||
| 129 | + + payRequestDto.getOrderId() | ||
| 130 | + + requestDate | ||
| 131 | + + businessConfig.getPayClientId())); | ||
| 132 | + return jsonData; | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + private HttpHeaders createHeaders() { | ||
| 136 | + HttpHeaders headers = new HttpHeaders(); | ||
| 137 | + headers.setContentType(MediaType.APPLICATION_JSON); | ||
| 138 | + return headers; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + private PayResponseDto processResponse(ResponseEntity<String> responseEntity) { | ||
| 142 | + if (!responseEntity.getStatusCode().is2xxSuccessful() || responseEntity.getBody() == null) { | ||
| 143 | + log.error("payInform failed with response: {}", responseEntity.getBody()); | ||
| 144 | + throw new IllegalArgumentException("支付信息获取失败"); | ||
| 145 | + } | ||
| 146 | + try { | ||
| 147 | + log.info("processResponse response: {}", responseEntity.getBody()); | ||
| 148 | + return xmlMapper.readValue(responseEntity.getBody(), PayResponseDto.class); | ||
| 149 | + } catch (Exception e) { | ||
| 150 | + log.error("Failed to parse XML response", e); | ||
| 151 | + throw new RuntimeException("支付信息结果解析失败", e); | ||
| 120 | } | 152 | } |
| 153 | + } | ||
| 121 | 154 | ||
| 122 | - private PayResponseDto processResponse(ResponseEntity<String> responseEntity) { | 155 | + public boolean callback(PaymentCallbackDTO paymentCallbackDTO) { |
| 123 | - if (!responseEntity.getStatusCode().is2xxSuccessful() || responseEntity.getBody() == null) { | 156 | + log.info("callback request received: {}", paymentCallbackDTO); |
| 124 | - log.error("payInform failed with response: {}", responseEntity.getBody()); | 157 | + try { |
| 125 | - throw new IllegalArgumentException("支付信息获取失败"); | 158 | + final var paymentCallbackResult = |
| 159 | + xmlMapper.readValue(paymentCallbackDTO.getPayResult(), PaymentCallbackResult.class); | ||
| 160 | + log.info("Parsed paymentCallbackResult: {}", paymentCallbackResult); | ||
| 161 | + final var orderId = Integer.parseInt(paymentCallbackResult.getTradeId()); | ||
| 162 | + final var orderById = orderServiceRpcClient.getOrderById(orderId); | ||
| 163 | + if (orderById == null) { | ||
| 164 | + log.error("Order not found, orderId: {}", orderId); | ||
| 165 | + return false; | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + final var transType = paymentCallbackResult.getTransType(); | ||
| 169 | + if (transType.equals("00")) { | ||
| 170 | + if (orderById.getPayStatus() != PayStatusEnum.TO_PAY | ||
| 171 | + && orderById.getPayStatus() != PayStatusEnum.IN_PROGRESS) { | ||
| 172 | + log.error("Order status is not TO_PAY or IN_PROGRESS, orderId: {}", orderId); | ||
| 173 | + return true; | ||
| 126 | } | 174 | } |
| 175 | + long payTime; | ||
| 127 | try { | 176 | try { |
| 128 | - log.info("processResponse response: {}", responseEntity.getBody()); | 177 | + payTime = |
| 129 | - return xmlMapper.readValue(responseEntity.getBody(), PayResponseDto.class); | 178 | + DateUtil.parseDate(paymentCallbackResult.getTransDate(), "yyyyMMddHHmmss").getTime(); |
| 130 | - } catch (Exception e) { | 179 | + } catch (ParseException e) { |
| 131 | - log.error("Failed to parse XML response", e); | 180 | + log.error("Failed to parse TransDate: {}", paymentCallbackResult.getTransDate(), e); |
| 132 | - throw new RuntimeException("支付信息结果解析失败", e); | 181 | + throw new IllegalArgumentException("支付时间格式错误: " + paymentCallbackResult.getTransDate(), e); |
| 133 | } | 182 | } |
| 134 | - } | 183 | + BigDecimal realAmount; |
| 135 | - | ||
| 136 | - public boolean callback(PaymentCallbackDTO paymentCallbackDTO) { | ||
| 137 | - log.info("callback request received: {}", paymentCallbackDTO); | ||
| 138 | try { | 184 | try { |
| 139 | - final var paymentCallbackResult = xmlMapper.readValue(paymentCallbackDTO.getPayResult(), PaymentCallbackResult.class); | 185 | + realAmount = Convert.toBigDecimal(paymentCallbackResult.getRealAmount()); |
| 140 | - log.info("Parsed paymentCallbackResult: {}", paymentCallbackResult); | 186 | + if (realAmount == null) { |
| 141 | - final var orderId = Integer.parseInt(paymentCallbackResult.getTradeId()); | 187 | + throw new NumberFormatException("RealAmount is null or empty"); |
| 142 | - final var orderById = orderServiceRpcClient.getOrderById(orderId); | 188 | + } |
| 143 | - if (orderById == null) { | 189 | + } catch (NumberFormatException e) { |
| 144 | - log.error("Order not found, orderId: {}", orderId); | 190 | + log.error("Invalid RealAmount value: {}", paymentCallbackResult.getRealAmount(), e); |
| 145 | - return false; | 191 | + throw new IllegalArgumentException("支付金额错误: " + paymentCallbackResult.getRealAmount(), e); |
| 146 | - } | 192 | + } |
| 147 | - if (orderById.getPayStatus() != PayStatusEnum.TO_PAY && orderById.getPayStatus() != PayStatusEnum.IN_PROGRESS) { | 193 | + final var build = |
| 148 | - log.error("Order status is not TO_PAY or IN_PROGRESS, orderId: {}", orderId); | 194 | + ClientCustomerOrderModification.newBuilder() |
| 149 | - return true; | 195 | + .setId(orderId) |
| 150 | - } | 196 | + .setShouldUpdatePayTime(true) |
| 151 | - long payTime; | 197 | + .setPayTime(payTime) |
| 152 | - try { | 198 | + .setShouldUpdatePayPrice(true) |
| 153 | - payTime = DateUtil.parseDate(paymentCallbackResult.getTransDate(), "yyyyMMddHHmmss").getTime(); | 199 | + .setPayPrice(realAmount.multiply(new BigDecimal("100")).intValue()) |
| 154 | - } catch (ParseException e) { | 200 | + .setShouldUpdatePayStatus(true) |
| 155 | - log.error("Failed to parse TransDate: {}", paymentCallbackResult.getTransDate(), e); | 201 | + .setPayStatus(PayStatusEnum.SUCCEED) |
| 156 | - throw new IllegalArgumentException("支付时间格式错误: " + paymentCallbackResult.getTransDate(), e); | 202 | + .setShouldUpdateStatus(true) |
| 157 | - } | 203 | + .setStatus(OrderStatusEnum.PREPARING) |
| 158 | - BigDecimal realAmount; | 204 | + .setShouldUpdateTransactionId(true) |
| 159 | - try { | 205 | + .setTransactionId(paymentCallbackResult.getTransSN()) |
| 160 | - realAmount = Convert.toBigDecimal(paymentCallbackResult.getRealAmount()); | 206 | + .build(); |
| 161 | - if (realAmount == null) { | 207 | + final var updateResponse = |
| 162 | - throw new NumberFormatException("RealAmount is null or empty"); | 208 | + orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build); |
| 163 | - } | 209 | + log.info("callback updateClientCustomerOrder result: {}", updateResponse.getIsUpdated()); |
| 164 | - } catch (NumberFormatException e) { | 210 | + if (updateResponse.getIsUpdated()) { |
| 165 | - log.error("Invalid RealAmount value: {}", paymentCallbackResult.getRealAmount(), e); | 211 | + final var orderPaymentSuccessData = |
| 166 | - throw new IllegalArgumentException("支付金额错误: " + paymentCallbackResult.getRealAmount(), e); | 212 | + OrderPaymentSuccessData.builder() |
| 167 | - } | 213 | + .orderId(orderById.getId()) |
| 168 | - final var build = ClientCustomerOrderModification.newBuilder() | 214 | + .orderCode(orderById.getOrderCode()) |
| 169 | - .setId(orderId) | 215 | + .createTime(DateUtil.formatDate(orderById.getCreatedAt(), DateUtil.Y_M_D_H_M_S)) |
| 170 | - .setShouldUpdatePayTime(true).setPayTime(payTime) | 216 | + .payTime(DateUtil.formatDate(orderById.getPayTime(), DateUtil.Y_M_D_H_M_S)) |
| 171 | - .setShouldUpdatePayPrice(true).setPayPrice(realAmount.multiply(new BigDecimal("100")).intValue()) | 217 | + .build(); |
| 172 | - .setShouldUpdatePayStatus(true).setPayStatus(PayStatusEnum.SUCCEED) | 218 | + final var data = |
| 173 | - .setShouldUpdateStatus(true).setStatus(OrderStatusEnum.PREPARING) | 219 | + SocketMessage.<OrderPaymentSuccessData>builder() |
| 174 | - .setShouldUpdateTransactionId(true).setTransactionId(paymentCallbackResult.getTransSN()) | 220 | + .type(MessageTypeEnum.ORDER) |
| 221 | + .noticeType(NoticeTypeEnum.ORDER_PAYMENT_SUCCESS) | ||
| 222 | + .subject(NoticeTypeEnum.ORDER_PAYMENT_SUCCESS.getDescription()) | ||
| 223 | + .message("您的订单:" + orderById.getOrderCode() + " 支付成功啦,快去查看吧~") | ||
| 224 | + .data(orderPaymentSuccessData) | ||
| 225 | + .build(); | ||
| 226 | + WebSocketServer.sendMessageToUser( | ||
| 227 | + UserSessionKey.builder() | ||
| 228 | + .userId(orderById.getOpenId()) | ||
| 229 | + .userType(UserTypeEnum.MICRO) | ||
| 230 | + .build(), | ||
| 231 | + data); | ||
| 232 | + if (LocalDate.now().equals(DateUtil.toLocalDate(orderById.getMealTime()))) { | ||
| 233 | + final var orderCreateSuccessData = | ||
| 234 | + OrderCreateSuccessData.builder().orderId(orderById.getId()).build(); | ||
| 235 | + final var createOrderData = | ||
| 236 | + SocketMessage.<OrderCreateSuccessData>builder() | ||
| 237 | + .type(MessageTypeEnum.ORDER) | ||
| 238 | + .noticeType(NoticeTypeEnum.ORDER_CREATED) | ||
| 239 | + .subject(NoticeTypeEnum.ORDER_CREATED.getDescription()) | ||
| 240 | + .message("有新的订单下单成功啦,快去查看吧~") | ||
| 241 | + .data(orderCreateSuccessData) | ||
| 175 | .build(); | 242 | .build(); |
| 176 | - final var updateResponse = orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build); | 243 | + final var clientOperatorIds = |
| 177 | - log.info("callback updateClientCustomerOrder result: {}", updateResponse.getIsUpdated()); | 244 | + clientResourceTagServiceRpcClient |
| 178 | - if (updateResponse.getIsUpdated()) { | 245 | + .getOperatorIdsByStallIds(List.of(orderById.getStallId())).stream() |
| 179 | - final var orderPaymentSuccessData = OrderPaymentSuccessData.builder() | 246 | + .map(SingleResourceLabelEntityRefsResponse::getEntityId) |
| 180 | - .orderId(orderById.getId()) | 247 | + .distinct() |
| 181 | - .orderCode(orderById.getOrderCode()) | 248 | + .collect(Collectors.toList()); |
| 182 | - .createTime(DateUtil.formatDate(orderById.getCreatedAt(), DateUtil.Y_M_D_H_M_S)) | 249 | + final var enterpriseOperatorIds = |
| 183 | - .payTime(DateUtil.formatDate(orderById.getPayTime(), DateUtil.Y_M_D_H_M_S)) | 250 | + enterpriseResourceServiceRpcClient.getOperatorIdsByStallId( |
| 184 | - .build(); | 251 | + orderById.getEnterpriseId(), orderById.getStallId()); |
| 185 | - final var data = SocketMessage.<OrderPaymentSuccessData>builder() | 252 | + final var userAuthData = new ArrayList<UserAuthData>(); |
| 186 | - .type(MessageTypeEnum.ORDER) | 253 | + userAuthData.addAll( |
| 187 | - .noticeType(NoticeTypeEnum.ORDER_PAYMENT_SUCCESS) | 254 | + clientOperatorIds.stream() |
| 188 | - .subject(NoticeTypeEnum.ORDER_PAYMENT_SUCCESS.getDescription()) | 255 | + .map( |
| 189 | - .message("您的订单:" + orderById.getOrderCode() + " 支付成功啦,快去查看吧~") | 256 | + e -> |
| 190 | - .data(orderPaymentSuccessData) | 257 | + UserAuthData.builder() |
| 191 | - .build(); | 258 | + .operatorId(e) |
| 192 | - WebSocketServer.sendMessageToUser(UserSessionKey.builder() | 259 | + .userType(UserTypeEnum.CLIENT) |
| 193 | - .userId(orderById.getOpenId()) | 260 | + .build()) |
| 194 | - .userType(UserTypeEnum.MICRO) | 261 | + .collect(Collectors.toList())); |
| 195 | - .build(), data); | 262 | + userAuthData.addAll( |
| 196 | - if (LocalDate.now().equals(DateUtil.toLocalDate(orderById.getMealTime()))) { | 263 | + enterpriseOperatorIds.stream() |
| 197 | - final var orderCreateSuccessData = OrderCreateSuccessData.builder() | 264 | + .map(e -> UserAuthData.builder().operatorId(e).userType(UserTypeEnum.KDS).build()) |
| 198 | - .orderId(orderById.getId()) | 265 | + .collect(Collectors.toList())); |
| 199 | - .build(); | 266 | + log.info("received userAuthData:{}", JsonUtil.writeAsJson(userAuthData)); |
| 200 | - final var createOrderData = SocketMessage.<OrderCreateSuccessData>builder() | 267 | + try { |
| 201 | - .type(MessageTypeEnum.ORDER) | 268 | + WebSocketServer.sendMessageByUserTypes( |
| 202 | - .noticeType(NoticeTypeEnum.ORDER_CREATED) | 269 | + List.of(UserTypeEnum.CLIENT, UserTypeEnum.KDS), userAuthData, createOrderData); |
| 203 | - .subject(NoticeTypeEnum.ORDER_CREATED.getDescription()) | 270 | + } catch (IOException e) { |
| 204 | - .message("有新的订单下单成功啦,快去查看吧~") | 271 | + log.error("Failed to send message to user", e); |
| 205 | - .data(orderCreateSuccessData) | ||
| 206 | - .build(); | ||
| 207 | - final var clientOperatorIds = clientResourceTagServiceRpcClient.getOperatorIdsByStallIds(List.of(orderById.getStallId())).stream().map(SingleResourceLabelEntityRefsResponse::getEntityId).distinct().collect(Collectors.toList()); | ||
| 208 | - final var enterpriseOperatorIds = enterpriseResourceServiceRpcClient.getOperatorIdsByStallId(orderById.getEnterpriseId(), orderById.getStallId()); | ||
| 209 | - final var userAuthData = new ArrayList<UserAuthData>(); | ||
| 210 | - userAuthData.addAll(clientOperatorIds.stream().map(e -> UserAuthData.builder().operatorId(e).userType(UserTypeEnum.CLIENT).build()).collect(Collectors.toList())); | ||
| 211 | - userAuthData.addAll(enterpriseOperatorIds.stream().map(e -> UserAuthData.builder().operatorId(e).userType(UserTypeEnum.KDS).build()).collect(Collectors.toList())); | ||
| 212 | - log.info("received userAuthData:{}", JsonUtil.writeAsJson(userAuthData)); | ||
| 213 | - try { | ||
| 214 | - WebSocketServer.sendMessageByUserTypes(List.of(UserTypeEnum.CLIENT, UserTypeEnum.KDS), userAuthData, createOrderData); | ||
| 215 | - } catch (IOException e) { | ||
| 216 | - log.error("Failed to send message to user", e); | ||
| 217 | - } | ||
| 218 | - } | ||
| 219 | } | 272 | } |
| 220 | - return updateResponse.getIsUpdated(); | 273 | + } |
| 221 | - } catch (JsonProcessingException e) { | ||
| 222 | - log.error("Failed to parse XML response, raw XML: {}", paymentCallbackDTO.getPayResult(), e); | ||
| 223 | - throw new RuntimeException("支付通知结果解析失败", e); | ||
| 224 | - } catch (Exception e) { | ||
| 225 | - log.error("Unexpected error in callback, request: {}", paymentCallbackDTO, e); | ||
| 226 | - throw new RuntimeException("支付通知处理失败", e); | ||
| 227 | - } | ||
| 228 | - } | ||
| 229 | - | ||
| 230 | - public boolean waiting(Integer orderId) { | ||
| 231 | - final var orderById = orderServiceRpcClient.getOrderById(orderId); | ||
| 232 | - if (orderById == null) { | ||
| 233 | - log.error("waiting Order not found, orderId: {}", orderId); | ||
| 234 | - return false; | ||
| 235 | - } | ||
| 236 | - if (orderById.getPayStatus() != PayStatusEnum.TO_PAY) { | ||
| 237 | - log.info("waiting Order {} already processed, skipping.", orderId); | ||
| 238 | - return false; | ||
| 239 | } | 274 | } |
| 240 | - final var build = ClientCustomerOrderModification.newBuilder() | 275 | + return updateResponse.getIsUpdated(); |
| 276 | + } else { | ||
| 277 | + final var build = | ||
| 278 | + ClientCustomerOrderModification.newBuilder() | ||
| 241 | .setId(orderId) | 279 | .setId(orderId) |
| 242 | - .setShouldUpdatePayStatus(true).setPayStatus(PayStatusEnum.IN_PROGRESS) | 280 | + .setShouldUpdatePayStatus(true) |
| 281 | + .setPayStatus(PayStatusEnum.REFUND) | ||
| 243 | .build(); | 282 | .build(); |
| 244 | - final var updateResponse = orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build); | 283 | + final var updateResponse = |
| 245 | - log.info("waiting updateClientCustomerOrder result: {}", updateResponse.getIsUpdated()); | 284 | + orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build); |
| 285 | + log.info("callback updateClientCustomerOrder result: {}", updateResponse.getIsUpdated()); | ||
| 246 | return updateResponse.getIsUpdated(); | 286 | return updateResponse.getIsUpdated(); |
| 287 | + } | ||
| 288 | + } catch (JsonProcessingException e) { | ||
| 289 | + log.error("Failed to parse XML response, raw XML: {}", paymentCallbackDTO.getPayResult(), e); | ||
| 290 | + throw new RuntimeException("支付/退款通知结果解析失败", e); | ||
| 291 | + } catch (Exception e) { | ||
| 292 | + log.error("Unexpected error in callback, request: {}", paymentCallbackDTO, e); | ||
| 293 | + throw new RuntimeException("支付/退款通知处理失败", e); | ||
| 294 | + } | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + public boolean waiting(Integer orderId) { | ||
| 298 | + final var orderById = orderServiceRpcClient.getOrderById(orderId); | ||
| 299 | + if (orderById == null) { | ||
| 300 | + log.error("waiting Order not found, orderId: {}", orderId); | ||
| 301 | + return false; | ||
| 302 | + } | ||
| 303 | + if (orderById.getPayStatus() != PayStatusEnum.TO_PAY) { | ||
| 304 | + log.info("waiting Order {} already processed, skipping.", orderId); | ||
| 305 | + return false; | ||
| 306 | + } | ||
| 307 | + final var build = | ||
| 308 | + ClientCustomerOrderModification.newBuilder() | ||
| 309 | + .setId(orderId) | ||
| 310 | + .setShouldUpdatePayStatus(true) | ||
| 311 | + .setPayStatus(PayStatusEnum.IN_PROGRESS) | ||
| 312 | + .build(); | ||
| 313 | + final var updateResponse = | ||
| 314 | + orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build); | ||
| 315 | + log.info("waiting updateClientCustomerOrder result: {}", updateResponse.getIsUpdated()); | ||
| 316 | + return updateResponse.getIsUpdated(); | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + public String orderPayRefund(PayRefundRequestDto payRefundRequestDto) { | ||
| 320 | + Integer orderId = payRefundRequestDto.getOrderId(); | ||
| 321 | + final var orderById = orderServiceRpcClient.getOrderById(orderId); | ||
| 322 | + if (orderById == null) { | ||
| 323 | + log.error("Order not found, orderId: {}", orderId); | ||
| 324 | + throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_NOT_FOUND); | ||
| 325 | + } | ||
| 326 | + if (orderById.getOnlinePay() != OnlinePayEnum.ONLINE) { | ||
| 327 | + log.info("Order {} is not online pay.", orderId); | ||
| 328 | + throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_NOT_ONLINE_PAY); | ||
| 329 | + } | ||
| 330 | + if (orderById.getPayStatus() != PayStatusEnum.SUCCEED) { | ||
| 331 | + log.info("Order {} pay is not succeed.", orderId); | ||
| 332 | + throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_NOT_SUCCESS); | ||
| 333 | + } | ||
| 334 | + LocalDate today = LocalDate.now(); | ||
| 335 | + LocalDate tomorrow = today.plusDays(1); | ||
| 336 | + LocalDateTime tomorrowZero = tomorrow.atStartOfDay(); | ||
| 337 | + LocalDateTime orderPayTime = DateUtil.toLocalDateTime(orderById.getPayTime()).minusHours(8); | ||
| 338 | + if (!orderPayTime.isBefore(tomorrowZero)) { | ||
| 339 | + log.info("Order {} pay is beyond cancel time.", orderId); | ||
| 340 | + throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED); | ||
| 341 | + } | ||
| 342 | + | ||
| 343 | + String appId = businessConfig.getPayClientId(); | ||
| 344 | + | ||
| 345 | + // 构建paycontent | ||
| 346 | + String payTime = DateUtil.formatDate(orderById.getPayTime(), DateUtil.YMDHMS); | ||
| 347 | + | ||
| 348 | + BigDecimal price = | ||
| 349 | + new BigDecimal(orderById.getPayPrice()) | ||
| 350 | + .divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).negate(); | ||
| 351 | + | ||
| 352 | + String payContentStr = | ||
| 353 | + orderById.getId() | ||
| 354 | + + "^" | ||
| 355 | + + "01" | ||
| 356 | + + "^" | ||
| 357 | + + "" | ||
| 358 | + + "^" | ||
| 359 | + + orderById.getOpenId() | ||
| 360 | + + "^" | ||
| 361 | + + orderById.getOrderCode() | ||
| 362 | + + "^" | ||
| 363 | + + price | ||
| 364 | + + "^" | ||
| 365 | + + payTime | ||
| 366 | + + "^" | ||
| 367 | + + orderById.getTransactionId() | ||
| 368 | + + "^" | ||
| 369 | + + payRefundRequestDto.getHospitalCode() | ||
| 370 | + + "^" | ||
| 371 | + + "" | ||
| 372 | + + "^" | ||
| 373 | + + LoginContextHolder.getId() | ||
| 374 | + + "^" | ||
| 375 | + + LoginContextHolder.getName(); | ||
| 376 | + String payContent = | ||
| 377 | + URLEncoder.encode( | ||
| 378 | + Base64.encodeBase64String(payContentStr.getBytes()), StandardCharsets.UTF_8); | ||
| 379 | + | ||
| 380 | + // 构建signinfo | ||
| 381 | + String signInfoStr = appId + orderById.getId() + payTime + businessConfig.getRefundSecurityKey(); | ||
| 382 | + String signInfo = DigestUtils.sha1Hex(signInfoStr.getBytes()); | ||
| 383 | + | ||
| 384 | + // 构建请求 | ||
| 385 | + try { | ||
| 386 | + String url = businessConfig.getCancelPayUrl() + "?" + "appid=" + appId + "&paycontent=" + payContent + "&signinfo=" + signInfo; | ||
| 387 | + log.info("cancel order pay url:" + url); | ||
| 388 | +// Request request = | ||
| 389 | +// new Request.Builder().url(url).get().build(); | ||
| 390 | +// Response payResponse = client.newCall(request).execute(); | ||
| 391 | +// if (payResponse.code() != 200) { | ||
| 392 | +// throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED); | ||
| 393 | +// } | ||
| 394 | +// String htmlContent = payResponse.body().string(); | ||
| 395 | + return url; | ||
| 396 | + } catch (Exception e) { | ||
| 397 | + log.error(e.getMessage()); | ||
| 398 | + throw ClientEndExceptions.BusinessException.build(ErrorCodeEnum.ORDER_PAY_REFUND_FAILED); | ||
| 247 | } | 399 | } |
| 400 | + } | ||
| 248 | } | 401 | } | ... | ... |
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
| ... | @@ -18,6 +18,7 @@ import lombok.extern.slf4j.Slf4j; | ... | @@ -18,6 +18,7 @@ import lombok.extern.slf4j.Slf4j; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.stereotype.Service; | 19 | import org.springframework.stereotype.Service; |
| 20 | 20 | ||
| 21 | +import java.util.ArrayList; | ||
| 21 | import java.util.List; | 22 | import java.util.List; |
| 22 | import java.util.stream.Collectors; | 23 | import java.util.stream.Collectors; |
| 23 | 24 | ||
| ... | @@ -70,40 +71,45 @@ public class MenuServiceImpl implements MenuService { | ... | @@ -70,40 +71,45 @@ public class MenuServiceImpl implements MenuService { |
| 70 | @Override | 71 | @Override |
| 71 | public List<MenuDto> queryPublishedMenusByStallId(Integer enterpriseId, List<Integer> stallIds) { | 72 | public List<MenuDto> queryPublishedMenusByStallId(Integer enterpriseId, List<Integer> stallIds) { |
| 72 | final var response = menuServiceRpcClient.queryPublishedMenusByStallId(enterpriseId, stallIds); | 73 | final var response = menuServiceRpcClient.queryPublishedMenusByStallId(enterpriseId, stallIds); |
| 73 | - return response.getResponsesList().stream().map(menu -> | 74 | + return new ArrayList<>(response.getResponsesList().stream() |
| 74 | - MenuDto.builder() | 75 | + .collect(Collectors.toMap( |
| 75 | - .id(menu.getId()) | 76 | + SingleMenuRpcResponse::getId, |
| 76 | - .code(menu.getCode()) | 77 | + menu -> MenuDto.builder() |
| 77 | - .enterpriseId(menu.getEnterpriseId()) | 78 | + .id(menu.getId()) |
| 78 | - .name(menu.getName()) | 79 | + .code(menu.getCode()) |
| 79 | - .status(menu.getStatusValue()) | 80 | + .enterpriseId(menu.getEnterpriseId()) |
| 80 | - .customerScope(menu.getCustomerScope()) | 81 | + .name(menu.getName()) |
| 81 | - .nutritionPromotion(menu.getNutritionPromotion()) | 82 | + .status(menu.getStatusValue()) |
| 82 | - .nutritionalStatistics(menu.getNutritionalStatistics()) | 83 | + .customerScope(menu.getCustomerScope()) |
| 83 | - .dishRuleJson(DishRuleJson.builder() | 84 | + .nutritionPromotion(menu.getNutritionPromotion()) |
| 84 | - .days(menu.getDishRuleJson().getDays()) | 85 | + .nutritionalStatistics(menu.getNutritionalStatistics()) |
| 85 | - .dishType(menu.getDishRuleJson().getDishType()) | 86 | + .dishRuleJson(DishRuleJson.builder() |
| 86 | - .mealIds(menu.getDishRuleJson().getMealIdsList()) | 87 | + .days(menu.getDishRuleJson().getDays()) |
| 87 | - .build()) | 88 | + .dishType(menu.getDishRuleJson().getDishType()) |
| 88 | - .orderRuleJson(OrderRuleJson.builder() | 89 | + .mealIds(menu.getDishRuleJson().getMealIdsList()) |
| 89 | - .allowMicroPlaceOrder(menu.getOrderRuleJson().getAllowMicroPlaceOrder()) | 90 | + .build()) |
| 90 | - .closeTimeType(menu.getOrderRuleJson().getCloseTimeType()) | 91 | + .orderRuleJson(OrderRuleJson.builder() |
| 91 | - .dishSelectRule(menu.getOrderRuleJson().getDishSelectRule()) | 92 | + .allowMicroPlaceOrder(menu.getOrderRuleJson().getAllowMicroPlaceOrder()) |
| 92 | - .earlyDays(menu.getOrderRuleJson().getEarlyDays()) | 93 | + .closeTimeType(menu.getOrderRuleJson().getCloseTimeType()) |
| 93 | - .modeOfPayment(menu.getOrderRuleJson().getModeOfPayment()) | 94 | + .dishSelectRule(menu.getOrderRuleJson().getDishSelectRule()) |
| 94 | - .placeOrderCount(menu.getOrderRuleJson().getPlaceOrderCount()) | 95 | + .earlyDays(menu.getOrderRuleJson().getEarlyDays()) |
| 95 | - .startTime(menu.getOrderRuleJson().getStartTime()) | 96 | + .modeOfPayment(menu.getOrderRuleJson().getModeOfPayment()) |
| 96 | - .endTime(menu.getOrderRuleJson().getEndTime()) | 97 | + .placeOrderCount(menu.getOrderRuleJson().getPlaceOrderCount()) |
| 97 | - .deadline(menu.getOrderRuleJson().getDeadline()) | 98 | + .startTime(menu.getOrderRuleJson().getStartTime()) |
| 98 | - .build()) | 99 | + .endTime(menu.getOrderRuleJson().getEndTime()) |
| 99 | - .createdBy(menu.getCreatedBy()) | 100 | + .deadline(menu.getOrderRuleJson().getDeadline()) |
| 100 | - .creationSource(menu.getCreationSource()) | 101 | + .build()) |
| 101 | - .createdAt(DateUtil.formatDate(menu.getCreatedAt())) | 102 | + .createdBy(menu.getCreatedBy()) |
| 102 | - .updatedBy(menu.getUpdatedBy()) | 103 | + .creationSource(menu.getCreationSource()) |
| 103 | - .updateSource(menu.getUpdateSource()) | 104 | + .createdAt(DateUtil.formatDate(menu.getCreatedAt())) |
| 104 | - .updatedAt(DateUtil.formatDate(menu.getUpdatedAt())) | 105 | + .updatedBy(menu.getUpdatedBy()) |
| 105 | - .publishAt(DateUtil.formatDate(menu.getPublishAt())) | 106 | + .updateSource(menu.getUpdateSource()) |
| 106 | - .build()).collect(Collectors.toList()); | 107 | + .updatedAt(DateUtil.formatDate(menu.getUpdatedAt())) |
| 108 | + .publishAt(DateUtil.formatDate(menu.getPublishAt())) | ||
| 109 | + .build(), | ||
| 110 | + (existing, replacement) -> existing | ||
| 111 | + )) | ||
| 112 | + .values()); | ||
| 107 | } | 113 | } |
| 108 | 114 | ||
| 109 | @Override | 115 | @Override | ... | ... |
| ... | @@ -7,6 +7,7 @@ import com.infoloop.tianting.clientcustomerorderservice.CloseTimeType; | ... | @@ -7,6 +7,7 @@ import com.infoloop.tianting.clientcustomerorderservice.CloseTimeType; |
| 7 | import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; | 7 | import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; |
| 8 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; | 8 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; |
| 9 | import com.infoloop.tianting.clientcustomerorderservice.OrderTypeEnum; | 9 | import com.infoloop.tianting.clientcustomerorderservice.OrderTypeEnum; |
| 10 | +import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderDetailRpcResponse; | ||
| 10 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderRpcResponse; | 11 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderRpcResponse; |
| 11 | import com.infoloop.tianting.clientcustomerservice.SingleClientCustomerLabelRefRpcResponse; | 12 | import com.infoloop.tianting.clientcustomerservice.SingleClientCustomerLabelRefRpcResponse; |
| 12 | import com.infoloop.tianting.clientcustomerservice.SingleClientCustomerRpcResponse; | 13 | import com.infoloop.tianting.clientcustomerservice.SingleClientCustomerRpcResponse; |
| ... | @@ -37,6 +38,7 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; | ... | @@ -37,6 +38,7 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; |
| 37 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; | 38 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; |
| 38 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; | 39 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; |
| 39 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; | 40 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; |
| 41 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryRefundOrderByPaginationDto; | ||
| 40 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto; | 42 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto; |
| 41 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderResponse; | 43 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderResponse; |
| 42 | import com.infoloop.tianting.model.dto.OrderDbDTO.getMenuOrderCountDto; | 44 | import com.infoloop.tianting.model.dto.OrderDbDTO.getMenuOrderCountDto; |
| ... | @@ -56,6 +58,7 @@ import org.springframework.beans.factory.annotation.Autowired; | ... | @@ -56,6 +58,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 56 | import org.springframework.stereotype.Service; | 58 | import org.springframework.stereotype.Service; |
| 57 | 59 | ||
| 58 | import java.util.ArrayList; | 60 | import java.util.ArrayList; |
| 61 | +import java.util.Arrays; | ||
| 59 | import java.util.List; | 62 | import java.util.List; |
| 60 | import java.util.stream.Collectors; | 63 | import java.util.stream.Collectors; |
| 61 | import java.util.stream.Stream; | 64 | import java.util.stream.Stream; |
| ... | @@ -318,6 +321,7 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -318,6 +321,7 @@ public class OrderServiceImpl implements OrderService { |
| 318 | .updateSource(r.getUpdateSource().getNumber()) | 321 | .updateSource(r.getUpdateSource().getNumber()) |
| 319 | .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) | 322 | .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) |
| 320 | .updatedBy(r.getUpdatedBy()) | 323 | .updatedBy(r.getUpdatedBy()) |
| 324 | + .isCanceled(r.getIsCanceled()) | ||
| 321 | .build()).collect(Collectors.toList()); | 325 | .build()).collect(Collectors.toList()); |
| 322 | final var ids = orders.stream().map(OrderDto::getId).collect(Collectors.toList()); | 326 | final var ids = orders.stream().map(OrderDto::getId).collect(Collectors.toList()); |
| 323 | final var detailsResponse = orderServiceRpcClient.getOrderDetailsByOrderIds(ids); | 327 | final var detailsResponse = orderServiceRpcClient.getOrderDetailsByOrderIds(ids); |
| ... | @@ -391,6 +395,7 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -391,6 +395,7 @@ public class OrderServiceImpl implements OrderService { |
| 391 | .updateSource(r.getUpdateSource().getNumber()) | 395 | .updateSource(r.getUpdateSource().getNumber()) |
| 392 | .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) | 396 | .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) |
| 393 | .updatedBy(r.getUpdatedBy()) | 397 | .updatedBy(r.getUpdatedBy()) |
| 398 | + .isCanceled(r.getIsCanceled()) | ||
| 394 | .build()).collect(Collectors.toList()); | 399 | .build()).collect(Collectors.toList()); |
| 395 | final var ids = orders.stream().map(OrderDto::getId).collect(Collectors.toList()); | 400 | final var ids = orders.stream().map(OrderDto::getId).collect(Collectors.toList()); |
| 396 | final var detailsResponse = orderServiceRpcClient.getOrderDetailsByOrderIds(ids); | 401 | final var detailsResponse = orderServiceRpcClient.getOrderDetailsByOrderIds(ids); |
| ... | @@ -437,7 +442,28 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -437,7 +442,28 @@ public class OrderServiceImpl implements OrderService { |
| 437 | final var customerIds = response.getResponsesList().stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).collect(Collectors.toList()); | 442 | final var customerIds = response.getResponsesList().stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).collect(Collectors.toList()); |
| 438 | final var customerResponse = clientCustomerServiceRpcClient.getClientCustomersByIds( | 443 | final var customerResponse = clientCustomerServiceRpcClient.getClientCustomersByIds( |
| 439 | queryOrderDto.getEnterpriseId(), customerIds); | 444 | queryOrderDto.getEnterpriseId(), customerIds); |
| 440 | - final var results = response.getResponsesList().stream().map(r -> OrderDto.builder() | 445 | + final var orderIds = response.getResponsesList().stream().map(SingleClientCustomerOrderRpcResponse::getId).collect(Collectors.toList()); |
| 446 | + final var orderDetails = orderServiceRpcClient.getOrderDetailsByOrderIds(orderIds); | ||
| 447 | + final var results = response.getResponsesList().stream().map(r -> { | ||
| 448 | + final var curOrderDetails = orderDetails.stream().filter(d -> | ||
| 449 | + d.getOrderId() == r.getId()).collect(Collectors.toList()); | ||
| 450 | + List<String> orderNotice = new ArrayList<>(); | ||
| 451 | + for (SingleClientCustomerOrderDetailRpcResponse detail: curOrderDetails) { | ||
| 452 | + final var avoids = detail.getMealDetailJson().getAvoidsList(); | ||
| 453 | + final var existAvoids = r.getCustomerNoticeJson().getAvoidsList().stream().anyMatch(avoids::contains); | ||
| 454 | + if (existAvoids) { | ||
| 455 | + orderNotice.add("忌口冲突"); | ||
| 456 | + break; | ||
| 457 | + } | ||
| 458 | + } | ||
| 459 | + String[] keywords = {"禁食", "禁水", "禁食水"}; | ||
| 460 | + final var result = Arrays.stream(keywords) | ||
| 461 | + .filter(keyword -> r.getCustomerNoticeJson().getDoctorsList().stream().anyMatch(str -> str.contains(keyword))) | ||
| 462 | + .findFirst(); | ||
| 463 | + if (result.isPresent()) { | ||
| 464 | + orderNotice.add("医嘱包含" + result.get()); | ||
| 465 | + } | ||
| 466 | + return OrderDto.builder() | ||
| 441 | .id(r.getId()) | 467 | .id(r.getId()) |
| 442 | .enterpriseId(r.getEnterpriseId()) | 468 | .enterpriseId(r.getEnterpriseId()) |
| 443 | .clientId(r.getClientId()) | 469 | .clientId(r.getClientId()) |
| ... | @@ -453,8 +479,8 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -453,8 +479,8 @@ public class OrderServiceImpl implements OrderService { |
| 453 | .adjustRoomNo(!r.getSyncRoomNo().isEmpty()) | 479 | .adjustRoomNo(!r.getSyncRoomNo().isEmpty()) |
| 454 | .status(r.getStatus()) | 480 | .status(r.getStatus()) |
| 455 | .customerNoticeJson(CustomerNotice.builder() | 481 | .customerNoticeJson(CustomerNotice.builder() |
| 456 | - .avoids(r.getCustomerNoticeJson().getAvoidsList()) | 482 | + .avoids(r.getCustomerNoticeJson().getAvoidsList()) |
| 457 | - .doctors(r.getCustomerNoticeJson().getDoctorsList()).build()) | 483 | + .doctors(r.getCustomerNoticeJson().getDoctorsList()).build()) |
| 458 | .onlinePay(r.getOnlinePay()) | 484 | .onlinePay(r.getOnlinePay()) |
| 459 | .payStatus(r.getPayStatusValue()) | 485 | .payStatus(r.getPayStatusValue()) |
| 460 | .payPrice(r.getPayPrice()) | 486 | .payPrice(r.getPayPrice()) |
| ... | @@ -472,19 +498,102 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -472,19 +498,102 @@ public class OrderServiceImpl implements OrderService { |
| 472 | .updatedBy(r.getUpdatedBy()) | 498 | .updatedBy(r.getUpdatedBy()) |
| 473 | .closeTimeType(r.getCloseTimeTypeValue()) | 499 | .closeTimeType(r.getCloseTimeTypeValue()) |
| 474 | .totalNum(r.getTotalNum()) | 500 | .totalNum(r.getTotalNum()) |
| 501 | + .isCanceled(r.getIsCanceled()) | ||
| 475 | .customer(getCustomerDetail(r.getCustomerId(), customerResponse.getResponsesList())) | 502 | .customer(getCustomerDetail(r.getCustomerId(), customerResponse.getResponsesList())) |
| 476 | - .build()).collect(Collectors.toList()); | 503 | + .orderNotice(orderNotice) |
| 504 | + .build(); | ||
| 505 | + }).collect(Collectors.toList()); | ||
| 477 | final var orderCountByStatus = OrderCountByStatusDto.builder() | 506 | final var orderCountByStatus = OrderCountByStatusDto.builder() |
| 478 | .allServedCount(response.getCountByStatus().getAllServedCount()) | 507 | .allServedCount(response.getCountByStatus().getAllServedCount()) |
| 479 | .canceledCount(response.getCountByStatus().getCanceledCount()) | 508 | .canceledCount(response.getCountByStatus().getCanceledCount()) |
| 480 | .preparingCount(response.getCountByStatus().getPreparingCount()) | 509 | .preparingCount(response.getCountByStatus().getPreparingCount()) |
| 481 | .toPrepareCount(response.getCountByStatus().getToPrepareCount()) | 510 | .toPrepareCount(response.getCountByStatus().getToPrepareCount()) |
| 482 | .unknownCount(response.getCountByStatus().getUnknownCount()) | 511 | .unknownCount(response.getCountByStatus().getUnknownCount()) |
| 512 | + .refundCount(response.getCountByStatus().getRefundCount()) | ||
| 483 | .build(); | 513 | .build(); |
| 484 | return PageUtil.from(results, response.getTotal(), response.getPages(), | 514 | return PageUtil.from(results, response.getTotal(), response.getPages(), |
| 485 | queryOrderDto.getPn(), queryOrderDto.getPz(), orderCountByStatus); | 515 | queryOrderDto.getPn(), queryOrderDto.getPz(), orderCountByStatus); |
| 486 | } | 516 | } |
| 487 | 517 | ||
| 518 | + @Override | ||
| 519 | + public OrderPageResult<OrderDto> getRefundOrdersByPagination( | ||
| 520 | + QueryRefundOrderByPaginationDto queryOrderDto) { | ||
| 521 | + final var response = orderServiceRpcClient.queryRefundClientCustomerOrdersByPagination(queryOrderDto); | ||
| 522 | + final var customerIds = response.getResponsesList().stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).collect(Collectors.toList()); | ||
| 523 | + final var customerResponse = clientCustomerServiceRpcClient.getClientCustomersByIds( | ||
| 524 | + queryOrderDto.getEnterpriseId(), customerIds); | ||
| 525 | + final var orderIds = response.getResponsesList().stream().map(SingleClientCustomerOrderRpcResponse::getId).collect(Collectors.toList()); | ||
| 526 | + final var orderDetails = orderServiceRpcClient.getOrderDetailsByOrderIds(orderIds); | ||
| 527 | + final var results = response.getResponsesList().stream().map(r -> { | ||
| 528 | + final var curOrderDetails = orderDetails.stream().filter(d -> | ||
| 529 | + d.getOrderId() == r.getId()).collect(Collectors.toList()); | ||
| 530 | + List<String> orderNotice = new ArrayList<>(); | ||
| 531 | + for (SingleClientCustomerOrderDetailRpcResponse detail: curOrderDetails) { | ||
| 532 | + final var avoids = detail.getMealDetailJson().getAvoidsList(); | ||
| 533 | + final var existAvoids = r.getCustomerNoticeJson().getAvoidsList().stream().anyMatch(avoids::contains); | ||
| 534 | + if (existAvoids) { | ||
| 535 | + orderNotice.add("忌口冲突"); | ||
| 536 | + break; | ||
| 537 | + } | ||
| 538 | + } | ||
| 539 | + String[] keywords = {"禁食", "禁水", "禁食水"}; | ||
| 540 | + final var result = Arrays.stream(keywords) | ||
| 541 | + .filter(keyword -> r.getCustomerNoticeJson().getDoctorsList().stream().anyMatch(str -> str.contains(keyword))) | ||
| 542 | + .findFirst(); | ||
| 543 | + if (result.isPresent()) { | ||
| 544 | + orderNotice.add("医嘱包含" + result.get()); | ||
| 545 | + } | ||
| 546 | + return OrderDto.builder() | ||
| 547 | + .id(r.getId()) | ||
| 548 | + .enterpriseId(r.getEnterpriseId()) | ||
| 549 | + .clientId(r.getClientId()) | ||
| 550 | + .stallId(r.getStallId()) | ||
| 551 | + .customerId(r.getCustomerId()) | ||
| 552 | + .openId(r.getOpenId()) | ||
| 553 | + .address(r.getAddress()) | ||
| 554 | + .orderCode(r.getOrderCode()) | ||
| 555 | + .menuId(r.getMenuId()) | ||
| 556 | + .pickupCode(r.getPickupCode()) | ||
| 557 | + .tableCode(r.getTableCode()) | ||
| 558 | + .roomNo(r.getSyncRoomNo().isEmpty() ? r.getRoomNo() : r.getSyncRoomNo()) | ||
| 559 | + .adjustRoomNo(!r.getSyncRoomNo().isEmpty()) | ||
| 560 | + .status(r.getStatus()) | ||
| 561 | + .customerNoticeJson(CustomerNotice.builder() | ||
| 562 | + .avoids(r.getCustomerNoticeJson().getAvoidsList()) | ||
| 563 | + .doctors(r.getCustomerNoticeJson().getDoctorsList()).build()) | ||
| 564 | + .onlinePay(r.getOnlinePay()) | ||
| 565 | + .payStatus(r.getPayStatusValue()) | ||
| 566 | + .payPrice(r.getPayPrice()) | ||
| 567 | + .payTime(DateUtil.formatDate(r.getPayTime())) | ||
| 568 | + .mealTime(DateUtil.formatDate(r.getMealTime())) | ||
| 569 | + .orderType(r.getOrderTypeValue()) | ||
| 570 | + .remark(r.getRemark()) | ||
| 571 | + .isDeleted(r.getIsDeleted()) | ||
| 572 | + .isRead(r.getIsRead()) | ||
| 573 | + .creationSource(r.getCreationSource().getNumber()) | ||
| 574 | + .createdBy(r.getCreatedBy()) | ||
| 575 | + .createdAt(DateUtil.formatDate(r.getCreatedAt())) | ||
| 576 | + .updateSource(r.getUpdateSource().getNumber()) | ||
| 577 | + .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) | ||
| 578 | + .updatedBy(r.getUpdatedBy()) | ||
| 579 | + .closeTimeType(r.getCloseTimeTypeValue()) | ||
| 580 | + .totalNum(r.getTotalNum()) | ||
| 581 | + .isCanceled(r.getIsCanceled()) | ||
| 582 | + .customer(getCustomerDetail(r.getCustomerId(), customerResponse.getResponsesList())) | ||
| 583 | + .orderNotice(orderNotice) | ||
| 584 | + .build(); | ||
| 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(); | ||
| 594 | + return PageUtil.from(results, response.getTotal(), response.getPages(), | ||
| 595 | + queryOrderDto.getPn(), queryOrderDto.getPz(), orderCountByStatus); | ||
| 596 | + } | ||
| 488 | private CustomerDetailDto getCustomerDetail(Integer customerId, | 597 | private CustomerDetailDto getCustomerDetail(Integer customerId, |
| 489 | List<SingleClientCustomerRpcResponse> customers) { | 598 | List<SingleClientCustomerRpcResponse> customers) { |
| 490 | final var filterCustomers = customers.stream().filter(c -> c.getId() == customerId) | 599 | final var filterCustomers = customers.stream().filter(c -> c.getId() == customerId) | ... | ... |
File mode changed
| ... | @@ -65,7 +65,7 @@ public class SkuServiceImpl implements SkuService { | ... | @@ -65,7 +65,7 @@ public class SkuServiceImpl implements SkuService { |
| 65 | .efficacyList(sku.getEfficaciesList().stream().map(efficacy -> SkuDetailSingleResponseDto.builder().id(efficacy.getId()).name(efficacy.getName()).build()).collect( | 65 | .efficacyList(sku.getEfficaciesList().stream().map(efficacy -> SkuDetailSingleResponseDto.builder().id(efficacy.getId()).name(efficacy.getName()).build()).collect( |
| 66 | Collectors.toList())) | 66 | Collectors.toList())) |
| 67 | .doctorList(sku.getDoctorsList().stream().map(doctor -> SkuSpecialDetailSingleResponseDto | 67 | .doctorList(sku.getDoctorsList().stream().map(doctor -> SkuSpecialDetailSingleResponseDto |
| 68 | - .builder().id(doctor.getId()).name(doctor.getName()).build()).collect( | 68 | + .builder().id(doctor.getId()).code(doctor.getCode()).name(doctor.getName()).build()).collect( |
| 69 | Collectors.toList())) | 69 | Collectors.toList())) |
| 70 | .avoidList(sku.getAvoidsList().stream().map(avoid -> SkuDetailSingleResponseDto.builder().id(avoid.getId()).name(avoid.getName()).build()).collect( | 70 | .avoidList(sku.getAvoidsList().stream().map(avoid -> SkuDetailSingleResponseDto.builder().id(avoid.getId()).name(avoid.getName()).build()).collect( |
| 71 | Collectors.toList())) | 71 | Collectors.toList())) | ... | ... |
File mode changed
src/main/java/com/infoloop/tianting/store/LoginCodeStore.java
100644 → 100755
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/utils/DateUtil.java
100644 → 100755
| ... | @@ -158,4 +158,8 @@ public final class DateUtil extends DateUtils { | ... | @@ -158,4 +158,8 @@ public final class DateUtil extends DateUtils { |
| 158 | return Instant.ofEpochMilli(timestamp).atZone(CHINA_ZONE).toLocalDate(); | 158 | return Instant.ofEpochMilli(timestamp).atZone(CHINA_ZONE).toLocalDate(); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | + public static LocalDateTime toLocalDateTime(long timestamp) { | ||
| 162 | + return Instant.ofEpochMilli(timestamp).atZone(CHINA_ZONE).toLocalDateTime(); | ||
| 163 | + } | ||
| 164 | + | ||
| 161 | } | 165 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
src/main/java/com/infoloop/tianting/utils/EncryptionUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/ExcelUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/ExceptionUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/FileTypeUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/FileUtil.java
100644 → 100755
File mode changed
File mode changed
src/main/java/com/infoloop/tianting/utils/IdGeneratorUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/ImageUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/JsonUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/PageUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/ReflectUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/RequestUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/ResponseUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/SmsUtil.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/ValidGroup.java
100644 → 100755
File mode changed
src/main/java/com/infoloop/tianting/utils/VerificationUtil.java
100644 → 100755
File mode changed
| ... | @@ -74,6 +74,7 @@ enum PayStatusEnum { | ... | @@ -74,6 +74,7 @@ enum PayStatusEnum { |
| 74 | SUCCEED = 3; | 74 | SUCCEED = 3; |
| 75 | FAILED = 4; | 75 | FAILED = 4; |
| 76 | PAY_CANCELED = 5; | 76 | PAY_CANCELED = 5; |
| 77 | + REFUND = 6; | ||
| 77 | } | 78 | } |
| 78 | 79 | ||
| 79 | enum CloseTimeType { | 80 | enum CloseTimeType { |
| ... | @@ -139,6 +140,7 @@ message SingleClientCustomerOrderRpcResponse { | ... | @@ -139,6 +140,7 @@ message SingleClientCustomerOrderRpcResponse { |
| 139 | bool isConfirm = 34; | 140 | bool isConfirm = 34; |
| 140 | bool isAllocation = 35; | 141 | bool isAllocation = 35; |
| 141 | string syncRoomNo = 36; | 142 | string syncRoomNo = 36; |
| 143 | + bool isCanceled = 37; | ||
| 142 | } | 144 | } |
| 143 | 145 | ||
| 144 | message GetClientCustomerOrderByIdRpcRequest { | 146 | message GetClientCustomerOrderByIdRpcRequest { |
| ... | @@ -173,12 +175,15 @@ message GetClientCustomerOrdersByCustomerIdRpcResponse { | ... | @@ -173,12 +175,15 @@ message GetClientCustomerOrdersByCustomerIdRpcResponse { |
| 173 | 175 | ||
| 174 | message QueryClientCustomerOrdersByPaginationRpcRequest { | 176 | message QueryClientCustomerOrdersByPaginationRpcRequest { |
| 175 | string keyword = 1; | 177 | string keyword = 1; |
| 176 | - OrderStatusEnum status = 2; | 178 | + bool shouldFilterStatus = 2; |
| 177 | - int32 clientId = 3; | 179 | + OrderStatusEnum status = 3; |
| 178 | - int32 enterpriseId = 4; | 180 | + int32 clientId = 4; |
| 179 | - int32 pageNo = 5; | 181 | + int32 enterpriseId = 5; |
| 180 | - int32 pageSize = 6; | 182 | + int32 pageNo = 6; |
| 181 | - repeated int32 stallIds = 7; | 183 | + int32 pageSize = 7; |
| 184 | + repeated int32 stallIds = 8; | ||
| 185 | + bool shouldFilterPayStatus = 9; | ||
| 186 | + PayStatusEnum payStatus = 10; | ||
| 182 | } | 187 | } |
| 183 | 188 | ||
| 184 | message OrderCountByStatus { | 189 | message OrderCountByStatus { |
| ... | @@ -187,6 +192,7 @@ message OrderCountByStatus { | ... | @@ -187,6 +192,7 @@ message OrderCountByStatus { |
| 187 | int32 preparingCount = 3; | 192 | int32 preparingCount = 3; |
| 188 | int32 allServedCount = 4; | 193 | int32 allServedCount = 4; |
| 189 | int32 canceledCount = 5; | 194 | int32 canceledCount = 5; |
| 195 | + int32 refundCount = 6; | ||
| 190 | } | 196 | } |
| 191 | 197 | ||
| 192 | message QueryClientCustomerOrdersByPaginationRpcResponse { | 198 | message QueryClientCustomerOrdersByPaginationRpcResponse { |
| ... | @@ -246,6 +252,8 @@ message QueryClientCustomerOrdersByConditionRpcRequest { | ... | @@ -246,6 +252,8 @@ message QueryClientCustomerOrdersByConditionRpcRequest { |
| 246 | bool isAllocation = 47; | 252 | bool isAllocation = 47; |
| 247 | bool shouldFilterStatues = 48; | 253 | bool shouldFilterStatues = 48; |
| 248 | repeated OrderStatusEnum statues = 49; | 254 | repeated OrderStatusEnum statues = 49; |
| 255 | + bool shouldFilterIsCanceled = 50; | ||
| 256 | + bool isCanceled = 51; | ||
| 249 | } | 257 | } |
| 250 | 258 | ||
| 251 | message QueryClientCustomerOrdersByConditionRpcResponse { | 259 | message QueryClientCustomerOrdersByConditionRpcResponse { |
| ... | @@ -375,6 +383,8 @@ message ClientCustomerOrderModification { | ... | @@ -375,6 +383,8 @@ message ClientCustomerOrderModification { |
| 375 | bool isAllocation = 53; | 383 | bool isAllocation = 53; |
| 376 | bool shouldUpdateSyncRoomNo = 54; | 384 | bool shouldUpdateSyncRoomNo = 54; |
| 377 | string syncRoomNo = 55; | 385 | string syncRoomNo = 55; |
| 386 | + bool shouldUpdateIsCanceled = 56; | ||
| 387 | + bool isCanceled = 57; | ||
| 378 | } | 388 | } |
| 379 | 389 | ||
| 380 | message UpdateClientCustomerOrderRpcRequest { | 390 | message UpdateClientCustomerOrderRpcRequest { | ... | ... |
| ... | @@ -80,6 +80,8 @@ business-config.hisCustomerQueryUrl = https://nutri.amcare.com.cn/v3/hiscustomer | ... | @@ -80,6 +80,8 @@ business-config.hisCustomerQueryUrl = https://nutri.amcare.com.cn/v3/hiscustomer |
| 80 | business-config.clientCustomerQueryUrl = https://nutri.amcare.com.cn/v3/clientcustomers/current/query | 80 | business-config.clientCustomerQueryUrl = https://nutri.amcare.com.cn/v3/clientcustomers/current/query |
| 81 | business-config.payUrl = http://10.2.5.162:21051/API/Microapp/CreateOrder?appid={0} | 81 | business-config.payUrl = http://10.2.5.162:21051/API/Microapp/CreateOrder?appid={0} |
| 82 | business-config.payClientId = Order | 82 | business-config.payClientId = Order |
| 83 | +business-config.cancelPayUrl = http://10.2.5.162:21051/frame/requestbase64 | ||
| 84 | +business-config.refundSecurityKey = 0987654321 | ||
| 83 | 85 | ||
| 84 | ##Actuator\u914D\u7F6E | 86 | ##Actuator\u914D\u7F6E |
| 85 | management.server.port=8088 | 87 | management.server.port=8088 | ... | ... |
-
Please register or login to post a comment