feat(order): 增加支付方式枚举并更新相关逻辑- 在 ClientCustomerOrderService.proto 中添加 OnlinePayEnum 枚举类型
Showing
4 changed files
with
24 additions
and
12 deletions
| ... | @@ -2,6 +2,7 @@ package com.infoloop.tianting.model.dto; | ... | @@ -2,6 +2,7 @@ package com.infoloop.tianting.model.dto; |
| 2 | 2 | ||
| 3 | import com.infoloop.tianting.annotation.RequestKeyParam; | 3 | import com.infoloop.tianting.annotation.RequestKeyParam; |
| 4 | import com.infoloop.tianting.clientcustomerorderservice.CloseTimeType; | 4 | import com.infoloop.tianting.clientcustomerorderservice.CloseTimeType; |
| 5 | +import com.infoloop.tianting.clientcustomerorderservice.OnlinePayEnum; | ||
| 5 | import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; | 6 | import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; |
| 6 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; | 7 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; |
| 7 | import com.infoloop.tianting.clientcustomerorderservice.PayStatusEnum; | 8 | import com.infoloop.tianting.clientcustomerorderservice.PayStatusEnum; |
| ... | @@ -222,6 +223,9 @@ public class OrderDbDTO { | ... | @@ -222,6 +223,9 @@ public class OrderDbDTO { |
| 222 | @ApiModelProperty(value = "备注") | 223 | @ApiModelProperty(value = "备注") |
| 223 | private String remark; | 224 | private String remark; |
| 224 | 225 | ||
| 226 | + @ApiModelProperty(value = "支付方式") | ||
| 227 | + private OnlinePayEnum onlinePay; | ||
| 228 | + | ||
| 225 | @ApiModelProperty(value = "订单菜品详情列表") | 229 | @ApiModelProperty(value = "订单菜品详情列表") |
| 226 | private List<OperatorCreateOrderDetailDto> orderDetailDtos; | 230 | private List<OperatorCreateOrderDetailDto> orderDetailDtos; |
| 227 | } | 231 | } |
| ... | @@ -260,8 +264,8 @@ public class OrderDbDTO { | ... | @@ -260,8 +264,8 @@ public class OrderDbDTO { |
| 260 | @ApiModelProperty(value = "实际支付金额,单位为分") | 264 | @ApiModelProperty(value = "实际支付金额,单位为分") |
| 261 | private Integer payPrice; | 265 | private Integer payPrice; |
| 262 | 266 | ||
| 263 | - @ApiModelProperty(value = "是否在线付费;0=未付费,1=付费") | 267 | + @ApiModelProperty(value = "支付方式") |
| 264 | - private Boolean onlinePay; | 268 | + private OnlinePayEnum onlinePay; |
| 265 | 269 | ||
| 266 | @ApiModelProperty(value = "支付时间") | 270 | @ApiModelProperty(value = "支付时间") |
| 267 | private LocalDateTime payTime; | 271 | private LocalDateTime payTime; |
| ... | @@ -364,8 +368,8 @@ public class OrderDbDTO { | ... | @@ -364,8 +368,8 @@ public class OrderDbDTO { |
| 364 | @ApiModelProperty(value = "实际支付金额,单位为分") | 368 | @ApiModelProperty(value = "实际支付金额,单位为分") |
| 365 | private Integer payPrice; | 369 | private Integer payPrice; |
| 366 | 370 | ||
| 367 | - @ApiModelProperty(value = "是否在线付费;0=未付费,1=付费") | 371 | + @ApiModelProperty(value = "支付方式") |
| 368 | - private Boolean onlinePay; | 372 | + private OnlinePayEnum onlinePay; |
| 369 | 373 | ||
| 370 | @ApiModelProperty(value = "支付时间") | 374 | @ApiModelProperty(value = "支付时间") |
| 371 | private String payTime; | 375 | private String payTime; | ... | ... |
| ... | @@ -558,7 +558,7 @@ public class OrderServiceRpcClient { | ... | @@ -558,7 +558,7 @@ public class OrderServiceRpcClient { |
| 558 | .setTableCode(createOrderDto.getTableCode() == null ? "" : createOrderDto.getTableCode()) | 558 | .setTableCode(createOrderDto.getTableCode() == null ? "" : createOrderDto.getTableCode()) |
| 559 | .setShouldCreateOnlinePay(true) | 559 | .setShouldCreateOnlinePay(true) |
| 560 | .setOnlinePay(createOrderDto.getOnlinePay()) | 560 | .setOnlinePay(createOrderDto.getOnlinePay()) |
| 561 | - .setShouldCreatePayStatus(createOrderDto.getOnlinePay()) | 561 | + .setShouldCreatePayStatus(true) |
| 562 | .setPayStatus(PayStatusEnum.TO_PAY) | 562 | .setPayStatus(PayStatusEnum.TO_PAY) |
| 563 | .setMenuId(createOrderDto.getMenuId()) | 563 | .setMenuId(createOrderDto.getMenuId()) |
| 564 | .setTotalNum(createOrderDto.getTotalNum()) | 564 | .setTotalNum(createOrderDto.getTotalNum()) | ... | ... |
| ... | @@ -16,7 +16,6 @@ import com.infoloop.tianting.deliveryruleservice.SingleClientLabelRpcResponse; | ... | @@ -16,7 +16,6 @@ import com.infoloop.tianting.deliveryruleservice.SingleClientLabelRpcResponse; |
| 16 | import com.infoloop.tianting.exception.ClientEndExceptions; | 16 | import com.infoloop.tianting.exception.ClientEndExceptions; |
| 17 | import com.infoloop.tianting.exception.ErrorCodeEnum; | 17 | import com.infoloop.tianting.exception.ErrorCodeEnum; |
| 18 | import com.infoloop.tianting.menuservice.CloseTimeTypeEnum; | 18 | import com.infoloop.tianting.menuservice.CloseTimeTypeEnum; |
| 19 | -import com.infoloop.tianting.menuservice.ModeOfPaymentEnum; | ||
| 20 | import com.infoloop.tianting.menuservice.SingleMenuDetailRpcResponse; | 19 | import com.infoloop.tianting.menuservice.SingleMenuDetailRpcResponse; |
| 21 | import com.infoloop.tianting.model.common.OrderPageResult; | 20 | import com.infoloop.tianting.model.common.OrderPageResult; |
| 22 | import com.infoloop.tianting.model.dto.ClientLabelDTO.HisAllergy; | 21 | import com.infoloop.tianting.model.dto.ClientLabelDTO.HisAllergy; |
| ... | @@ -102,6 +101,7 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -102,6 +101,7 @@ public class OrderServiceImpl implements OrderService { |
| 102 | createOrderDto.setCreatedBy(operatorLoginInfo.getId()); | 101 | createOrderDto.setCreatedBy(operatorLoginInfo.getId()); |
| 103 | createOrderDto.setClientId(operator.getClientId()); | 102 | createOrderDto.setClientId(operator.getClientId()); |
| 104 | createOrderDto.setAddress(record.getDepartmentName() + record.getRoomNo()); | 103 | createOrderDto.setAddress(record.getDepartmentName() + record.getRoomNo()); |
| 104 | + createOrderDto.setOnlinePay(createOrderDto.getOnlinePay()); | ||
| 105 | createOrderDto.setPayPrice(0); | 105 | createOrderDto.setPayPrice(0); |
| 106 | final var menu = menuServiceRpcClient.getMenuById(operator.getEnterpriseId(), | 106 | final var menu = menuServiceRpcClient.getMenuById(operator.getEnterpriseId(), |
| 107 | createOrderDto.getMenuId()).getResponse(); | 107 | createOrderDto.getMenuId()).getResponse(); |
| ... | @@ -113,8 +113,7 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -113,8 +113,7 @@ public class OrderServiceImpl implements OrderService { |
| 113 | createOrderDto.setRoomNo(record.getRoomNo()); | 113 | createOrderDto.setRoomNo(record.getRoomNo()); |
| 114 | createOrderDto.setCreationSource(OrderSourceEnum.STALL.getNumber()); | 114 | createOrderDto.setCreationSource(OrderSourceEnum.STALL.getNumber()); |
| 115 | createOrderDto.setEnterpriseId(operatorLoginInfo.getEnterpriseId()); | 115 | createOrderDto.setEnterpriseId(operatorLoginInfo.getEnterpriseId()); |
| 116 | - var onlinePay = menu.getOrderRuleJson().getModeOfPayment() == ModeOfPaymentEnum.ONLINE; | 116 | + createOrderDto.setOnlinePay(createOrderDto.getOnlinePay()); |
| 117 | - createOrderDto.setOnlinePay(onlinePay); | ||
| 118 | OrderTypeEnum orderType; | 117 | OrderTypeEnum orderType; |
| 119 | if (menu.getOrderRuleJson().getCloseTimeType() == CloseTimeTypeEnum.RESERVATION) { | 118 | if (menu.getOrderRuleJson().getCloseTimeType() == CloseTimeTypeEnum.RESERVATION) { |
| 120 | orderType = OrderTypeEnum.DELIVERY; | 119 | orderType = OrderTypeEnum.DELIVERY; | ... | ... |
| ... | @@ -81,6 +81,15 @@ enum CloseTimeType { | ... | @@ -81,6 +81,15 @@ enum CloseTimeType { |
| 81 | RESERVATION = 1; | 81 | RESERVATION = 1; |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | +enum OnlinePayEnum { | ||
| 85 | + UNKNOWN = 0; | ||
| 86 | + ONLINE = 1; //在线 | ||
| 87 | + OFFLINE = 2; //线下 | ||
| 88 | + LEAVE_HOSPITAL = 3;//出院 | ||
| 89 | + EMPLOYEE_CARD = 4; //员工卡 | ||
| 90 | + PAPER_VERIFICATION = 5; //纸质核销 | ||
| 91 | +} | ||
| 92 | + | ||
| 84 | enum ServeStatusEnum { | 93 | enum ServeStatusEnum { |
| 85 | UNKNOWN_SERVE_STATUS = 0; | 94 | UNKNOWN_SERVE_STATUS = 0; |
| 86 | SERVE_NOT_START = 1; | 95 | SERVE_NOT_START = 1; |
| ... | @@ -106,7 +115,7 @@ message SingleClientCustomerOrderRpcResponse { | ... | @@ -106,7 +115,7 @@ message SingleClientCustomerOrderRpcResponse { |
| 106 | CloseTimeType closeTimeType = 10; | 115 | CloseTimeType closeTimeType = 10; |
| 107 | int32 totalNum = 11; | 116 | int32 totalNum = 11; |
| 108 | int32 payPrice = 12; | 117 | int32 payPrice = 12; |
| 109 | - bool onlinePay = 13; | 118 | + OnlinePayEnum onlinePay = 13; |
| 110 | int64 payTime = 14; | 119 | int64 payTime = 14; |
| 111 | PayStatusEnum payStatus = 15; | 120 | PayStatusEnum payStatus = 15; |
| 112 | string errorMsg = 16; | 121 | string errorMsg = 16; |
| ... | @@ -205,7 +214,7 @@ message QueryClientCustomerOrdersByConditionRpcRequest { | ... | @@ -205,7 +214,7 @@ message QueryClientCustomerOrdersByConditionRpcRequest { |
| 205 | bool shouldFilterCloseTimeType = 16; | 214 | bool shouldFilterCloseTimeType = 16; |
| 206 | CloseTimeType closeTimeType = 17; | 215 | CloseTimeType closeTimeType = 17; |
| 207 | bool shouldFilterOnlinePay = 18; | 216 | bool shouldFilterOnlinePay = 18; |
| 208 | - bool onlinePay = 19; | 217 | + OnlinePayEnum onlinePay = 19; |
| 209 | bool shouldFilterPayTimeStart = 20; | 218 | bool shouldFilterPayTimeStart = 20; |
| 210 | int64 payTimeStart = 21; | 219 | int64 payTimeStart = 21; |
| 211 | bool shouldFilterPayTimeEnd = 22; | 220 | bool shouldFilterPayTimeEnd = 22; |
| ... | @@ -254,7 +263,7 @@ message ClientCustomerOrderCreation{ | ... | @@ -254,7 +263,7 @@ message ClientCustomerOrderCreation{ |
| 254 | bool shouldCreatePayPrice = 12; | 263 | bool shouldCreatePayPrice = 12; |
| 255 | int32 payPrice = 13; | 264 | int32 payPrice = 13; |
| 256 | bool shouldCreateOnlinePay = 14; | 265 | bool shouldCreateOnlinePay = 14; |
| 257 | - bool onlinePay = 15; | 266 | + OnlinePayEnum onlinePay = 15; |
| 258 | bool shouldCreatePayTime = 16; | 267 | bool shouldCreatePayTime = 16; |
| 259 | int64 payTime = 17; | 268 | int64 payTime = 17; |
| 260 | bool shouldCreatePayStatus = 18; | 269 | bool shouldCreatePayStatus = 18; |
| ... | @@ -330,7 +339,7 @@ message ClientCustomerOrderModification { | ... | @@ -330,7 +339,7 @@ message ClientCustomerOrderModification { |
| 330 | bool shouldUpdatePayPrice = 20; | 339 | bool shouldUpdatePayPrice = 20; |
| 331 | int32 payPrice = 21; | 340 | int32 payPrice = 21; |
| 332 | bool shouldUpdateOnlinePay = 22; | 341 | bool shouldUpdateOnlinePay = 22; |
| 333 | - bool onlinePay = 23; | 342 | + OnlinePayEnum onlinePay = 23; |
| 334 | bool shouldUpdatePayTime = 24; | 343 | bool shouldUpdatePayTime = 24; |
| 335 | int64 payTime = 25; | 344 | int64 payTime = 25; |
| 336 | bool shouldUpdatePayStatus = 26; | 345 | bool shouldUpdatePayStatus = 26; | ... | ... |
-
Please register or login to post a comment