Showing
33 changed files
with
1154 additions
and
116 deletions
| 1 | package com.infoloop.tianting.config; | 1 | package com.infoloop.tianting.config; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.COperatorServiceProtoRpcGrpc; | ||
| 3 | import com.infoloop.tianting.CategoriesServiceProtoRpcGrpc; | 4 | import com.infoloop.tianting.CategoriesServiceProtoRpcGrpc; |
| 4 | import com.infoloop.tianting.SkuServiceProtoRpcGrpc; | 5 | import com.infoloop.tianting.SkuServiceProtoRpcGrpc; |
| 5 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderServiceRpcGrpc; | 6 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderServiceRpcGrpc; |
| ... | @@ -45,6 +46,9 @@ import static com.infoloop.tianting.constant.ConfigConstants.MEAL_SERVICE_RPC_UR | ... | @@ -45,6 +46,9 @@ import static com.infoloop.tianting.constant.ConfigConstants.MEAL_SERVICE_RPC_UR |
| 45 | import static com.infoloop.tianting.constant.ConfigConstants.MENU_SERVICE_CHANNEL; | 46 | import static com.infoloop.tianting.constant.ConfigConstants.MENU_SERVICE_CHANNEL; |
| 46 | import static com.infoloop.tianting.constant.ConfigConstants.MENU_SERVICE_RPC_PORT; | 47 | import static com.infoloop.tianting.constant.ConfigConstants.MENU_SERVICE_RPC_PORT; |
| 47 | import static com.infoloop.tianting.constant.ConfigConstants.MENU_SERVICE_RPC_URL; | 48 | import static com.infoloop.tianting.constant.ConfigConstants.MENU_SERVICE_RPC_URL; |
| 49 | +import static com.infoloop.tianting.constant.ConfigConstants.OPERATOR_SERVICE_CHANNEL; | ||
| 50 | +import static com.infoloop.tianting.constant.ConfigConstants.OPERATOR_SERVICE_RPC_PORT; | ||
| 51 | +import static com.infoloop.tianting.constant.ConfigConstants.OPERATOR_SERVICE_RPC_URL; | ||
| 48 | import static com.infoloop.tianting.constant.ConfigConstants.ORDER_SERVICE_CHANNEL; | 52 | import static com.infoloop.tianting.constant.ConfigConstants.ORDER_SERVICE_CHANNEL; |
| 49 | import static com.infoloop.tianting.constant.ConfigConstants.ORDER_SERVICE_RPC_PORT; | 53 | import static com.infoloop.tianting.constant.ConfigConstants.ORDER_SERVICE_RPC_PORT; |
| 50 | import static com.infoloop.tianting.constant.ConfigConstants.ORDER_SERVICE_RPC_URL; | 54 | import static com.infoloop.tianting.constant.ConfigConstants.ORDER_SERVICE_RPC_URL; |
| ... | @@ -209,4 +213,21 @@ public class GrpcConfig { | ... | @@ -209,4 +213,21 @@ public class GrpcConfig { |
| 209 | public TiantingDeliveryRuleServiceRpcGrpc.TiantingDeliveryRuleServiceRpcBlockingStub deliveryServiceRpcBlockingStub(@Autowired @Qualifier(DELIVERY_SERVICE_CHANNEL) final ManagedChannel channel) { | 213 | public TiantingDeliveryRuleServiceRpcGrpc.TiantingDeliveryRuleServiceRpcBlockingStub deliveryServiceRpcBlockingStub(@Autowired @Qualifier(DELIVERY_SERVICE_CHANNEL) final ManagedChannel channel) { |
| 210 | return TiantingDeliveryRuleServiceRpcGrpc.newBlockingStub(channel); | 214 | return TiantingDeliveryRuleServiceRpcGrpc.newBlockingStub(channel); |
| 211 | } | 215 | } |
| 216 | + | ||
| 217 | + @Bean(OPERATOR_SERVICE_CHANNEL) | ||
| 218 | + public ManagedChannel operatorServiceChannel(@Value(OPERATOR_SERVICE_RPC_URL) final String url, | ||
| 219 | + @Value(OPERATOR_SERVICE_RPC_PORT) final int port, | ||
| 220 | + @Autowired final ClientInterceptor clientInterceptor) { | ||
| 221 | + return NettyChannelBuilder.forAddress(url, port) | ||
| 222 | + .idleTimeout(DEFAULT_TIMEOUT_DAYS, TimeUnit.DAYS) | ||
| 223 | + .intercept(clientInterceptor) | ||
| 224 | + .usePlaintext() | ||
| 225 | + .maxInboundMessageSize(Integer.MAX_VALUE) | ||
| 226 | + .build(); | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + @Bean | ||
| 230 | + public COperatorServiceProtoRpcGrpc.COperatorServiceProtoRpcBlockingStub operatorServiceRpcBlockingStub(@Autowired @Qualifier(OPERATOR_SERVICE_CHANNEL) final ManagedChannel channel) { | ||
| 231 | + return COperatorServiceProtoRpcGrpc.newBlockingStub(channel); | ||
| 232 | + } | ||
| 212 | } | 233 | } | ... | ... |
| ... | @@ -7,6 +7,7 @@ import com.infoloop.tianting.intercepter.LoginInterceptor; | ... | @@ -7,6 +7,7 @@ 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.OperatorServiceRpcClient; | ||
| 10 | import com.infoloop.tianting.tracing.HttpTracingInterceptor; | 11 | import com.infoloop.tianting.tracing.HttpTracingInterceptor; |
| 11 | import lombok.RequiredArgsConstructor; | 12 | import lombok.RequiredArgsConstructor; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -33,12 +34,13 @@ public class WebMvcConfig implements WebMvcConfigurer { | ... | @@ -33,12 +34,13 @@ public class WebMvcConfig implements WebMvcConfigurer { |
| 33 | @Autowired | 34 | @Autowired |
| 34 | public WebMvcConfig(final Tracing tracing, | 35 | public WebMvcConfig(final Tracing tracing, |
| 35 | final ResourceInjector resourceInjector, | 36 | final ResourceInjector resourceInjector, |
| 36 | - final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient) { | 37 | + final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient, |
| 38 | + final OperatorServiceRpcClient operatorServiceRpcClient) { | ||
| 37 | this.httpInterceptors = new ArrayList<>(); | 39 | this.httpInterceptors = new ArrayList<>(); |
| 38 | this.httpInterceptors.add(new HttpTracingInterceptor(tracing)); | 40 | this.httpInterceptors.add(new HttpTracingInterceptor(tracing)); |
| 39 | this.httpInterceptors.add(new RequestMonitor()); | 41 | this.httpInterceptors.add(new RequestMonitor()); |
| 40 | this.httpInterceptors.add(new ApiSignInterceptor()); | 42 | this.httpInterceptors.add(new ApiSignInterceptor()); |
| 41 | - this.httpInterceptors.add(new LoginInterceptor(clientCustomerServiceRpcClient)); | 43 | + this.httpInterceptors.add(new LoginInterceptor(clientCustomerServiceRpcClient, operatorServiceRpcClient)); |
| 42 | this.httpInterceptors.add(resourceInjector); | 44 | this.httpInterceptors.add(resourceInjector); |
| 43 | 45 | ||
| 44 | } | 46 | } | ... | ... |
| ... | @@ -60,10 +60,14 @@ public interface ConfigConstants { | ... | @@ -60,10 +60,14 @@ public interface ConfigConstants { |
| 60 | String DELIVERY_SERVICE_RPC_PORT = "${grpc.delivery-service.port}"; | 60 | String DELIVERY_SERVICE_RPC_PORT = "${grpc.delivery-service.port}"; |
| 61 | String DELIVERY_SERVICE_CHANNEL = "delivery-service-channel"; | 61 | String DELIVERY_SERVICE_CHANNEL = "delivery-service-channel"; |
| 62 | 62 | ||
| 63 | + String OPERATOR_SERVICE_RPC_URL = "${grpc.operator-service.url}"; | ||
| 64 | + String OPERATOR_SERVICE_RPC_PORT = "${grpc.operator-service.port}"; | ||
| 65 | + String OPERATOR_SERVICE_CHANNEL = "operator-service-channel"; | ||
| 66 | + | ||
| 63 | String ASYNC_EXECUTOR = "asyncExecutor"; | 67 | String ASYNC_EXECUTOR = "asyncExecutor"; |
| 64 | String SCHEDULED_TASK_EXECUTOR = "scheduledTaskExecutor"; | 68 | String SCHEDULED_TASK_EXECUTOR = "scheduledTaskExecutor"; |
| 65 | 69 | ||
| 66 | - String MINI_PROGRAM_APP_ID = "${miniprogram.app-id}"; | 70 | + String MINI_PROGRAM_APP_ID = "${miniprogram.appId}"; |
| 67 | - String MINI_PROGRAM_APP_SECRET = "${miniprogram.app-secret}"; | 71 | + String MINI_PROGRAM_APP_SECRET = "${miniprogram.appSecret}"; |
| 68 | 72 | ||
| 69 | } | 73 | } | ... | ... |
| ... | @@ -22,8 +22,6 @@ import org.springframework.http.HttpStatus; | ... | @@ -22,8 +22,6 @@ import org.springframework.http.HttpStatus; |
| 22 | import org.springframework.validation.annotation.Validated; | 22 | import org.springframework.validation.annotation.Validated; |
| 23 | import org.springframework.web.bind.annotation.GetMapping; | 23 | import org.springframework.web.bind.annotation.GetMapping; |
| 24 | import org.springframework.web.bind.annotation.PathVariable; | 24 | import org.springframework.web.bind.annotation.PathVariable; |
| 25 | -import org.springframework.web.bind.annotation.PostMapping; | ||
| 26 | -import org.springframework.web.bind.annotation.RequestBody; | ||
| 27 | import org.springframework.web.bind.annotation.ResponseStatus; | 25 | import org.springframework.web.bind.annotation.ResponseStatus; |
| 28 | import org.springframework.web.bind.annotation.RestController; | 26 | import org.springframework.web.bind.annotation.RestController; |
| 29 | 27 | ||
| ... | @@ -36,7 +34,6 @@ import org.springframework.web.bind.annotation.RestController; | ... | @@ -36,7 +34,6 @@ import org.springframework.web.bind.annotation.RestController; |
| 36 | public class ClientCustomerController { | 34 | public class ClientCustomerController { |
| 37 | private final ClientCustomerService clientCustomerService; | 35 | private final ClientCustomerService clientCustomerService; |
| 38 | private final WxMiniProgramService wxMiniProgramService; | 36 | private final WxMiniProgramService wxMiniProgramService; |
| 39 | - private final LoginService loginService; | ||
| 40 | 37 | ||
| 41 | @ApiOperation(value = "根据hisCustomerId获取ClientCustomer") | 38 | @ApiOperation(value = "根据hisCustomerId获取ClientCustomer") |
| 42 | @GetMapping("/customers/his/{hisCustomerId}") | 39 | @GetMapping("/customers/his/{hisCustomerId}") |
| ... | @@ -61,26 +58,6 @@ public class ClientCustomerController { | ... | @@ -61,26 +58,6 @@ public class ClientCustomerController { |
| 61 | enterpriseId, customerId); | 58 | enterpriseId, customerId); |
| 62 | } | 59 | } |
| 63 | 60 | ||
| 64 | - @ApiOperation(value = "小程序:根据code获取openId") | ||
| 65 | - @GetMapping("/wx/miniprogram/customers/openid/{code}") | ||
| 66 | - @ResponseStatus(HttpStatus.OK) | ||
| 67 | - public WxUserOpenIdDto getOpenIdByCode(@PathVariable String code) { | ||
| 68 | - return wxMiniProgramService.getWxUserOpenIdByCode(code); | ||
| 69 | - } | ||
| 70 | 61 | ||
| 71 | - @ApiOperation(value = "小程序:根据code获取手机号") | ||
| 72 | - @GetMapping("/wx/miniprogram/customers/phone/{code}") | ||
| 73 | - @ResponseStatus(HttpStatus.OK) | ||
| 74 | - public WxUserPhoneResponseDto getPhoneByCode(@PathVariable String code) { | ||
| 75 | - return wxMiniProgramService.getUserPhoneInfoByCode(code); | ||
| 76 | - } | ||
| 77 | - | ||
| 78 | - @SaIgnore | ||
| 79 | - @ApiOperation(value = "登陆") | ||
| 80 | - @PostMapping("/login") | ||
| 81 | - @ResponseStatus(HttpStatus.OK) | ||
| 82 | - public SaTokenInfo login(@Valid@RequestBody LoginDto loginDto) { | ||
| 83 | - return loginService.login(loginDto); | ||
| 84 | - } | ||
| 85 | 62 | ||
| 86 | } | 63 | } | ... | ... |
| 1 | package com.infoloop.tianting.controller; | 1 | package com.infoloop.tianting.controller; |
| 2 | 2 | ||
| 3 | +import cn.dev33.satoken.annotation.SaIgnore; | ||
| 3 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; | 4 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; |
| 5 | +import com.infoloop.tianting.model.common.PageResult; | ||
| 6 | +import com.infoloop.tianting.model.dto.OrderDbDTO; | ||
| 4 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; | 7 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; |
| 5 | -import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderDto; | ||
| 6 | import com.infoloop.tianting.service.OrderService; | 8 | import com.infoloop.tianting.service.OrderService; |
| 7 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 8 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -28,11 +30,12 @@ import org.springframework.web.bind.annotation.RestController; | ... | @@ -28,11 +30,12 @@ import org.springframework.web.bind.annotation.RestController; |
| 28 | public class ClientOrderController { | 30 | public class ClientOrderController { |
| 29 | private final OrderService orderService; | 31 | private final OrderService orderService; |
| 30 | 32 | ||
| 31 | - @ApiOperation(value = "根据状态获取用户订单") | 33 | + @SaIgnore |
| 32 | - @PostMapping("/orders/condition") | 34 | + @ApiOperation(value = "院区端分页获取用户订单") |
| 35 | + @PostMapping("/client/orders/pagination") | ||
| 33 | @ResponseStatus(HttpStatus.OK) | 36 | @ResponseStatus(HttpStatus.OK) |
| 34 | - public List<OrderDto> getOrderByCondition(@Valid@RequestBody QueryOrderDto queryOrderDto) { | 37 | + public PageResult<OrderDto> getOrderByByPagination(@Valid@RequestBody OrderDbDTO.QueryOrderByPaginationDto queryOrderDto) { |
| 35 | - return orderService.getOrdersByCondition(queryOrderDto); | 38 | + return orderService.getOrdersByPagination(queryOrderDto); |
| 36 | } | 39 | } |
| 37 | 40 | ||
| 38 | } | 41 | } | ... | ... |
| 1 | package com.infoloop.tianting.controller; | 1 | package com.infoloop.tianting.controller; |
| 2 | 2 | ||
| 3 | +import cn.dev33.satoken.annotation.SaIgnore; | ||
| 3 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; | 4 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; |
| 4 | import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto; | 5 | import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto; |
| 5 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; | 6 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; |
| ... | @@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController; | ... | @@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController; |
| 26 | public class InventoryController { | 27 | public class InventoryController { |
| 27 | private final InventoryService inventoryService; | 28 | private final InventoryService inventoryService; |
| 28 | 29 | ||
| 30 | + @SaIgnore | ||
| 29 | @ApiOperation(value = "根据Id获取Client") | 31 | @ApiOperation(value = "根据Id获取Client") |
| 30 | @GetMapping("/enterprises/{enterpriseId}/clients/{clientId}") | 32 | @GetMapping("/enterprises/{enterpriseId}/clients/{clientId}") |
| 31 | @ResponseStatus(HttpStatus.OK) | 33 | @ResponseStatus(HttpStatus.OK) | ... | ... |
| 1 | +package com.infoloop.tianting.controller; | ||
| 2 | + | ||
| 3 | +import cn.dev33.satoken.annotation.SaIgnore; | ||
| 4 | +import cn.dev33.satoken.stp.SaTokenInfo; | ||
| 5 | +import com.fasterxml.jackson.core.JsonProcessingException; | ||
| 6 | +import com.fasterxml.jackson.databind.DeserializationFeature; | ||
| 7 | +import com.fasterxml.jackson.databind.JsonNode; | ||
| 8 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 9 | +import com.github.xiaoymin.knife4j.annotations.ApiSupport; | ||
| 10 | +import com.infoloop.tianting.model.dto.PermissionDTO; | ||
| 11 | +import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto; | ||
| 12 | +import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto1; | ||
| 13 | +import com.infoloop.tianting.service.LoginService; | ||
| 14 | +import com.infoloop.tianting.utils.JsonUtil; | ||
| 15 | +import io.swagger.annotations.Api; | ||
| 16 | +import io.swagger.annotations.ApiOperation; | ||
| 17 | +import java.util.LinkedHashMap; | ||
| 18 | +import javax.validation.Valid; | ||
| 19 | +import lombok.RequiredArgsConstructor; | ||
| 20 | +import lombok.extern.slf4j.Slf4j; | ||
| 21 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 22 | +import org.springframework.http.HttpStatus; | ||
| 23 | +import org.springframework.validation.annotation.Validated; | ||
| 24 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 25 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 26 | +import org.springframework.web.bind.annotation.ResponseStatus; | ||
| 27 | +import org.springframework.web.bind.annotation.RestController; | ||
| 28 | + | ||
| 29 | +@Api(tags = "登陆") | ||
| 30 | +@ApiSupport(order = -1) | ||
| 31 | +@Slf4j | ||
| 32 | +@Validated | ||
| 33 | +@RestController | ||
| 34 | +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) | ||
| 35 | +public class LoginController { | ||
| 36 | + private final LoginService loginService; | ||
| 37 | + | ||
| 38 | + @SaIgnore | ||
| 39 | + @ApiOperation(value = "登陆") | ||
| 40 | + @PostMapping("/login") | ||
| 41 | + @ResponseStatus(HttpStatus.OK) | ||
| 42 | + public SaTokenInfo login(@Valid @RequestBody PermissionDTO.LoginDto loginDto) { | ||
| 43 | + return loginService.login(loginDto); | ||
| 44 | + } | ||
| 45 | +} |
| 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.MenuDbDTO.BatchCreateMenuRefsDto; | ||
| 5 | +import com.infoloop.tianting.model.dto.MenuDbDTO.BatchCreateMenuRefsResponseDto; | ||
| 4 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDetailDto; | 6 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDetailDto; |
| 5 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; | 7 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; |
| 6 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuRefDto; | 8 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuRefDto; |
| ... | @@ -10,6 +12,7 @@ import io.swagger.annotations.ApiOperation; | ... | @@ -10,6 +12,7 @@ import io.swagger.annotations.ApiOperation; |
| 10 | import java.util.List; | 12 | import java.util.List; |
| 11 | import javax.validation.Valid; | 13 | import javax.validation.Valid; |
| 12 | import lombok.RequiredArgsConstructor; | 14 | import lombok.RequiredArgsConstructor; |
| 15 | +import lombok.Value; | ||
| 13 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | import org.springframework.http.HttpStatus; | 18 | import org.springframework.http.HttpStatus; |
| ... | @@ -56,4 +59,13 @@ public class MenuController { | ... | @@ -56,4 +59,13 @@ public class MenuController { |
| 56 | return menuService.getClientCustomerMenuRefsByCustomerId(enterpriseId, customerId); | 59 | return menuService.getClientCustomerMenuRefsByCustomerId(enterpriseId, customerId); |
| 57 | } | 60 | } |
| 58 | 61 | ||
| 62 | + @ApiOperation(value = "批量创建餐单绑定") | ||
| 63 | + @PostMapping("/menuRefs/creation") | ||
| 64 | + @ResponseStatus(HttpStatus.OK) | ||
| 65 | + public BatchCreateMenuRefsResponseDto batchCreateMenuRefsByCustomerId( | ||
| 66 | + @Valid@RequestBody BatchCreateMenuRefsDto batchCreateMenuRefsDto | ||
| 67 | + ){ | ||
| 68 | + return menuService.batchCreateMenuRefs(batchCreateMenuRefsDto); | ||
| 69 | + } | ||
| 70 | + | ||
| 59 | } | 71 | } | ... | ... |
| 1 | +package com.infoloop.tianting.controller; | ||
| 2 | + | ||
| 3 | +import cn.dev33.satoken.annotation.SaIgnore; | ||
| 4 | +import com.github.xiaoymin.knife4j.annotations.ApiSupport; | ||
| 5 | +import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto; | ||
| 6 | +import com.infoloop.tianting.model.dto.WxUserDto.WxUserPhoneResponseDto; | ||
| 7 | +import com.infoloop.tianting.service.WxMiniProgramService; | ||
| 8 | +import io.swagger.annotations.Api; | ||
| 9 | +import io.swagger.annotations.ApiOperation; | ||
| 10 | +import lombok.RequiredArgsConstructor; | ||
| 11 | +import lombok.extern.slf4j.Slf4j; | ||
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | +import org.springframework.http.HttpStatus; | ||
| 14 | +import org.springframework.validation.annotation.Validated; | ||
| 15 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 16 | +import org.springframework.web.bind.annotation.PathVariable; | ||
| 17 | +import org.springframework.web.bind.annotation.ResponseStatus; | ||
| 18 | +import org.springframework.web.bind.annotation.RestController; | ||
| 19 | + | ||
| 20 | +@Api(tags = "小程序个人信息") | ||
| 21 | +@ApiSupport(order = -1) | ||
| 22 | +@Slf4j | ||
| 23 | +@Validated | ||
| 24 | +@RestController | ||
| 25 | +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) | ||
| 26 | +public class MiniProgramController { | ||
| 27 | + | ||
| 28 | + private final WxMiniProgramService wxMiniProgramService; | ||
| 29 | + | ||
| 30 | + @ApiOperation(value = "小程序:根据code获取openId") | ||
| 31 | + @GetMapping("/wx/miniprogram/customers/openid/{code}") | ||
| 32 | + @ResponseStatus(HttpStatus.OK) | ||
| 33 | + public WxUserOpenIdDto getOpenIdByCode(@PathVariable String code) { | ||
| 34 | + return wxMiniProgramService.getWxUserOpenIdByCode(code); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + @SaIgnore | ||
| 38 | + @ApiOperation(value = "小程序:根据code获取手机号") | ||
| 39 | + @GetMapping("/wx/miniprogram/customers/phone/{code}") | ||
| 40 | + @ResponseStatus(HttpStatus.OK) | ||
| 41 | + public WxUserPhoneResponseDto getPhoneByCode(@PathVariable String code) { | ||
| 42 | + return wxMiniProgramService.getUserPhoneInfoByCode(code); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | +} |
| ... | @@ -3,8 +3,10 @@ package com.infoloop.tianting.controller; | ... | @@ -3,8 +3,10 @@ package com.infoloop.tianting.controller; |
| 3 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; | 3 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; |
| 4 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; | 4 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; |
| 5 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; | 5 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; |
| 6 | +import com.infoloop.tianting.model.dto.OrderDbDTO.OrderAndDetailsDto; | ||
| 6 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; | 7 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; |
| 7 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; | 8 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; |
| 9 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; | ||
| 8 | import com.infoloop.tianting.service.OrderService; | 10 | import com.infoloop.tianting.service.OrderService; |
| 9 | import io.swagger.annotations.Api; | 11 | import io.swagger.annotations.Api; |
| 10 | import io.swagger.annotations.ApiOperation; | 12 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -34,10 +36,22 @@ public class OrderController { | ... | @@ -34,10 +36,22 @@ public class OrderController { |
| 34 | @ApiOperation(value = "根据customerId获取用户订单") | 36 | @ApiOperation(value = "根据customerId获取用户订单") |
| 35 | @GetMapping("/orders/{customerId}") | 37 | @GetMapping("/orders/{customerId}") |
| 36 | @ResponseStatus(HttpStatus.OK) | 38 | @ResponseStatus(HttpStatus.OK) |
| 37 | - public List<OrderDto> getOrderByCustomerId(@PathVariable Integer customerId) { | 39 | + public OrderAndDetailsDto getOrderByCustomerId(@PathVariable Integer customerId) { |
| 38 | return orderService.getOrdersByCustomerId(customerId); | 40 | return orderService.getOrdersByCustomerId(customerId); |
| 39 | } | 41 | } |
| 40 | 42 | ||
| 43 | + @ApiOperation(value = "根据openId获取用户订单") | ||
| 44 | + @GetMapping("/enterprises/{enterpriseId}/orders/open/{openId}") | ||
| 45 | + @ResponseStatus(HttpStatus.OK) | ||
| 46 | + public OrderAndDetailsDto getOrderByOpenId(@PathVariable Integer enterpriseId, | ||
| 47 | + @PathVariable String openId) { | ||
| 48 | + return orderService.getOrdersByCondition(QueryOrderByConditionDto.builder() | ||
| 49 | + .shouldFilterOpenId(true) | ||
| 50 | + .enterpriseId(enterpriseId) | ||
| 51 | + .openId(openId) | ||
| 52 | + .build()); | ||
| 53 | + } | ||
| 54 | + | ||
| 41 | @ApiOperation(value = "根据orderId获取订单详情") | 55 | @ApiOperation(value = "根据orderId获取订单详情") |
| 42 | @GetMapping("/orderDetails/{orderId}") | 56 | @GetMapping("/orderDetails/{orderId}") |
| 43 | @ResponseStatus(HttpStatus.OK) | 57 | @ResponseStatus(HttpStatus.OK) | ... | ... |
| 1 | +package com.infoloop.tianting.controller; | ||
| 2 | + | ||
| 3 | +import com.github.xiaoymin.knife4j.annotations.ApiSupport; | ||
| 4 | +import com.infoloop.tianting.model.dto.MenuDbDTO; | ||
| 5 | +import com.infoloop.tianting.model.dto.MenuDbDTO.BatchCreateMenuRefsResponseDto; | ||
| 6 | +import com.infoloop.tianting.model.dto.PayDTO; | ||
| 7 | +import com.infoloop.tianting.model.dto.PayDTO.PayResponseDto; | ||
| 8 | +import com.infoloop.tianting.service.client.PayServiceClient; | ||
| 9 | +import io.swagger.annotations.Api; | ||
| 10 | +import io.swagger.annotations.ApiOperation; | ||
| 11 | +import javax.validation.Valid; | ||
| 12 | +import lombok.RequiredArgsConstructor; | ||
| 13 | +import lombok.extern.slf4j.Slf4j; | ||
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | +import org.springframework.http.HttpStatus; | ||
| 16 | +import org.springframework.validation.annotation.Validated; | ||
| 17 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 18 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 19 | +import org.springframework.web.bind.annotation.ResponseStatus; | ||
| 20 | +import org.springframework.web.bind.annotation.RestController; | ||
| 21 | + | ||
| 22 | +@Api(tags = "微信小程序发送付款通知接口") | ||
| 23 | +@ApiSupport(order = 0) | ||
| 24 | +@Slf4j | ||
| 25 | +@Validated | ||
| 26 | +@RestController | ||
| 27 | +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) | ||
| 28 | +public class PayController { | ||
| 29 | + private final PayServiceClient payServiceClient; | ||
| 30 | + | ||
| 31 | + @ApiOperation(value = "支付通知") | ||
| 32 | + @PostMapping("/pay/inform") | ||
| 33 | + @ResponseStatus(HttpStatus.OK) | ||
| 34 | + public PayResponseDto batchCreateMenuRefsByCustomerId( | ||
| 35 | + @Valid @RequestBody PayDTO.PayInformRequestDto payInformRequestDto | ||
| 36 | + ){ | ||
| 37 | + return payServiceClient.payInform(payInformRequestDto); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | +} |
| ... | @@ -9,7 +9,7 @@ import lombok.Getter; | ... | @@ -9,7 +9,7 @@ import lombok.Getter; |
| 9 | public enum LoginSourceEnum{ | 9 | public enum LoginSourceEnum{ |
| 10 | CUSTOMER(1, "小程序住院客户"), | 10 | CUSTOMER(1, "小程序住院客户"), |
| 11 | MINI_PROGRAM(2, "小程序非住院客户"), | 11 | MINI_PROGRAM(2, "小程序非住院客户"), |
| 12 | - CLIENT(3, "院区端"), | 12 | + OPERATOR(3, "院区端"), |
| 13 | KDS(4, "KDS"), | 13 | KDS(4, "KDS"), |
| 14 | ; | 14 | ; |
| 15 | 15 | ... | ... |
| ... | @@ -13,6 +13,7 @@ import com.infoloop.tianting.exception.ErrorCodeEnum; | ... | @@ -13,6 +13,7 @@ import com.infoloop.tianting.exception.ErrorCodeEnum; |
| 13 | import com.infoloop.tianting.model.common.ResponseResult; | 13 | import com.infoloop.tianting.model.common.ResponseResult; |
| 14 | import com.infoloop.tianting.service.ClientCustomerService; | 14 | import com.infoloop.tianting.service.ClientCustomerService; |
| 15 | import com.infoloop.tianting.service.client.ClientCustomerServiceRpcClient; | 15 | import com.infoloop.tianting.service.client.ClientCustomerServiceRpcClient; |
| 16 | +import com.infoloop.tianting.service.client.OperatorServiceRpcClient; | ||
| 16 | import com.infoloop.tianting.utils.ResponseUtil; | 17 | import com.infoloop.tianting.utils.ResponseUtil; |
| 17 | import lombok.RequiredArgsConstructor; | 18 | import lombok.RequiredArgsConstructor; |
| 18 | import lombok.extern.slf4j.Slf4j; | 19 | import lombok.extern.slf4j.Slf4j; |
| ... | @@ -32,8 +33,9 @@ import java.io.IOException; | ... | @@ -32,8 +33,9 @@ import java.io.IOException; |
| 32 | @SuppressWarnings("all") | 33 | @SuppressWarnings("all") |
| 33 | @RequiredArgsConstructor | 34 | @RequiredArgsConstructor |
| 34 | public class LoginInterceptor extends HandlerInterceptorAdapter { | 35 | public class LoginInterceptor extends HandlerInterceptorAdapter { |
| 35 | -// private final ClientCustomerService clientCustomerService; | 36 | + |
| 36 | private final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient; | 37 | private final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient; |
| 38 | + private final OperatorServiceRpcClient operatorServiceRpcClient; | ||
| 37 | 39 | ||
| 38 | @Override | 40 | @Override |
| 39 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { | 41 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { |
| ... | @@ -63,20 +65,34 @@ public class LoginInterceptor extends HandlerInterceptorAdapter { | ... | @@ -63,20 +65,34 @@ public class LoginInterceptor extends HandlerInterceptorAdapter { |
| 63 | 65 | ||
| 64 | private boolean handleLogin(HttpServletRequest request, HttpServletResponse response, LoginContextHolder.LoginInfo.LoginInfoBuilder builder) throws SaTokenException { | 66 | private boolean handleLogin(HttpServletRequest request, HttpServletResponse response, LoginContextHolder.LoginInfo.LoginInfoBuilder builder) throws SaTokenException { |
| 65 | StpUtil.checkLogin(); | 67 | StpUtil.checkLogin(); |
| 66 | - final var loginId = StpUtil.getLoginIdAsInt(); | ||
| 67 | final var enterpriseId = Convert.toInt(StpUtil.getExtra(CommonConstants.ENTERPRISE_ID)); | 68 | final var enterpriseId = Convert.toInt(StpUtil.getExtra(CommonConstants.ENTERPRISE_ID)); |
| 68 | final var loginSource = Convert.toInt(StpUtil.getExtra(CommonConstants.LOGIN_SOURCE)); | 69 | final var loginSource = Convert.toInt(StpUtil.getExtra(CommonConstants.LOGIN_SOURCE)); |
| 69 | -// if (loginSource.equals(LoginSourceEnum.CUSTOMER.getValue())) { | 70 | + if (loginSource.equals(LoginSourceEnum.CUSTOMER.getValue())) { |
| 70 | - final var customer = clientCustomerServiceRpcClient.getClientCustomerById(loginId); | 71 | + final var loginId = StpUtil.getLoginIdAsInt(); |
| 71 | - if (customer == null) { | 72 | + final var customer = clientCustomerServiceRpcClient.getClientCustomerById(loginId); |
| 72 | - response.setStatus(HttpStatus.FORBIDDEN.value()); | 73 | + if (customer == null) { |
| 73 | - ResponseUtil.write(response, ResponseResult.failed(ErrorCodeEnum.VALIDATE_FAILED)); | 74 | + response.setStatus(HttpStatus.FORBIDDEN.value()); |
| 74 | - return false; | 75 | + ResponseUtil.write(response, ResponseResult.failed(ErrorCodeEnum.VALIDATE_FAILED)); |
| 76 | + return false; | ||
| 77 | + } | ||
| 78 | + builder.id(loginId).enterpriseId(enterpriseId).name(customer.getResponse().getName()); | ||
| 79 | + return true; | ||
| 80 | + } else if (loginSource.equals(LoginSourceEnum.OPERATOR.getValue())){ | ||
| 81 | + final var loginId = StpUtil.getLoginIdAsInt(); | ||
| 82 | + final var opeartor = operatorServiceRpcClient.getCOperatorById(loginId); | ||
| 83 | + if (opeartor == null) { | ||
| 84 | + response.setStatus(HttpStatus.FORBIDDEN.value()); | ||
| 85 | + ResponseUtil.write(response, ResponseResult.failed(ErrorCodeEnum.VALIDATE_FAILED)); | ||
| 86 | + return false; | ||
| 87 | + } | ||
| 88 | + builder.id(loginId).enterpriseId(enterpriseId).name(opeartor.getName()); | ||
| 89 | + return true; | ||
| 90 | + | ||
| 91 | + } else { | ||
| 92 | + final var loginId = StpUtil.getLoginIdAsString(); | ||
| 93 | + builder.openid(loginId).enterpriseId(enterpriseId); | ||
| 94 | + return true; | ||
| 75 | } | 95 | } |
| 76 | - builder.id(loginId) | ||
| 77 | - .enterpriseId(enterpriseId) | ||
| 78 | - .name(customer.getResponse().getName()); | ||
| 79 | - return true; | ||
| 80 | } | 96 | } |
| 81 | 97 | ||
| 82 | 98 | ... | ... |
| 1 | package com.infoloop.tianting.model.dto; | 1 | package com.infoloop.tianting.model.dto; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; | ||
| 3 | import com.infoloop.tianting.menuservice.CloseTimeTypeEnum; | 4 | import com.infoloop.tianting.menuservice.CloseTimeTypeEnum; |
| 4 | import com.infoloop.tianting.menuservice.DishSelectRuleEnum; | 5 | import com.infoloop.tianting.menuservice.DishSelectRuleEnum; |
| 5 | import com.infoloop.tianting.menuservice.DishTypeEnum; | 6 | import com.infoloop.tianting.menuservice.DishTypeEnum; |
| 6 | import com.infoloop.tianting.menuservice.ModeOfPaymentEnum; | 7 | import com.infoloop.tianting.menuservice.ModeOfPaymentEnum; |
| 8 | +import com.infoloop.tianting.model.dto.MenuDbDTO.CreateMenuRefsDto; | ||
| 7 | import io.swagger.annotations.ApiModel; | 9 | import io.swagger.annotations.ApiModel; |
| 8 | import io.swagger.annotations.ApiModelProperty; | 10 | import io.swagger.annotations.ApiModelProperty; |
| 11 | +import io.swagger.models.auth.In; | ||
| 9 | import java.time.LocalDateTime; | 12 | import java.time.LocalDateTime; |
| 10 | import java.util.List; | 13 | import java.util.List; |
| 11 | import lombok.Builder; | 14 | import lombok.Builder; |
| ... | @@ -75,6 +78,9 @@ public class MenuDbDTO { | ... | @@ -75,6 +78,9 @@ public class MenuDbDTO { |
| 75 | 78 | ||
| 76 | @ApiModelProperty(value = "更新来源") | 79 | @ApiModelProperty(value = "更新来源") |
| 77 | private Integer updateSource; | 80 | private Integer updateSource; |
| 81 | + | ||
| 82 | + @ApiModelProperty(value = "发布时间") | ||
| 83 | + private String publishAt; | ||
| 78 | } | 84 | } |
| 79 | 85 | ||
| 80 | @Data | 86 | @Data |
| ... | @@ -116,4 +122,34 @@ public class MenuDbDTO { | ... | @@ -116,4 +122,34 @@ public class MenuDbDTO { |
| 116 | private Integer creationSource; | 122 | private Integer creationSource; |
| 117 | } | 123 | } |
| 118 | 124 | ||
| 125 | + @Data | ||
| 126 | + @Builder | ||
| 127 | + @ToString | ||
| 128 | + @ApiModel(description = "批量餐单绑定数据") | ||
| 129 | + public static class CreateMenuRefsDto { | ||
| 130 | + private Integer menuId; | ||
| 131 | + private Integer customerId; | ||
| 132 | + private boolean isTop; | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + @Data | ||
| 136 | + @Builder | ||
| 137 | + @ToString | ||
| 138 | + @ApiModel(description = "批量餐单绑定数据") | ||
| 139 | + public static class BatchCreateMenuRefsDto { | ||
| 140 | + private Integer createdBy; | ||
| 141 | + private OrderSourceEnum creationSource; | ||
| 142 | + private Integer enterpriseId; | ||
| 143 | + private List<CreateMenuRefsDto> creations; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + @Data | ||
| 147 | + @Builder | ||
| 148 | + @ToString | ||
| 149 | + @ApiModel(description = "批量餐单绑定数据") | ||
| 150 | + public static class BatchCreateMenuRefsResponseDto { | ||
| 151 | + private Boolean isCreated; | ||
| 152 | + private List<Integer> ids; | ||
| 153 | + } | ||
| 154 | + | ||
| 119 | } | 155 | } | ... | ... |
| 1 | package com.infoloop.tianting.model.dto; | 1 | package com.infoloop.tianting.model.dto; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.clientcustomerorderservice.CloseTimeType; | ||
| 3 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; | 4 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; |
| 5 | +import com.infoloop.tianting.menuservice.CloseTimeTypeEnum; | ||
| 4 | import com.infoloop.tianting.model.common.PageInfo; | 6 | import com.infoloop.tianting.model.common.PageInfo; |
| 5 | import io.swagger.annotations.ApiModel; | 7 | import io.swagger.annotations.ApiModel; |
| 6 | import io.swagger.annotations.ApiModelProperty; | 8 | import io.swagger.annotations.ApiModelProperty; |
| ... | @@ -43,10 +45,22 @@ public class OrderDbDTO { | ... | @@ -43,10 +45,22 @@ public class OrderDbDTO { |
| 43 | 45 | ||
| 44 | @Data | 46 | @Data |
| 45 | @ApiModel(description = "查询订单Dto") | 47 | @ApiModel(description = "查询订单Dto") |
| 46 | - public static class QueryOrderDto { | 48 | + public static class QueryOrderByPaginationDto { |
| 47 | private Integer enterpriseId; | 49 | private Integer enterpriseId; |
| 48 | - private boolean shouldFilterStatus; | 50 | + private Integer clientId; |
| 49 | private OrderStatusEnum status; | 51 | private OrderStatusEnum status; |
| 52 | + private Integer pn; | ||
| 53 | + private Integer pz; | ||
| 54 | + private String keyword; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @Data | ||
| 58 | + @Builder | ||
| 59 | + @ApiModel(description = "查询订单Dto") | ||
| 60 | + public static class QueryOrderByConditionDto { | ||
| 61 | + private Integer enterpriseId; | ||
| 62 | + private Boolean shouldFilterOpenId; | ||
| 63 | + private String openId; | ||
| 50 | } | 64 | } |
| 51 | 65 | ||
| 52 | @Data | 66 | @Data |
| ... | @@ -120,12 +134,6 @@ public class OrderDbDTO { | ... | @@ -120,12 +134,6 @@ public class OrderDbDTO { |
| 120 | @Builder | 134 | @Builder |
| 121 | @ApiModel(description = "创建订单视图") | 135 | @ApiModel(description = "创建订单视图") |
| 122 | public static class CreateOrderDto { | 136 | public static class CreateOrderDto { |
| 123 | -// @ApiModelProperty(value = "订单表主键,自增整数") | ||
| 124 | -// private Integer id; | ||
| 125 | - | ||
| 126 | -// @ApiModelProperty(value = "订单号") | ||
| 127 | -// private String orderCode; | ||
| 128 | - | ||
| 129 | @ApiModelProperty(value = "企业 ID") | 137 | @ApiModelProperty(value = "企业 ID") |
| 130 | private Integer enterpriseId; | 138 | private Integer enterpriseId; |
| 131 | 139 | ||
| ... | @@ -135,9 +143,15 @@ public class OrderDbDTO { | ... | @@ -135,9 +143,15 @@ public class OrderDbDTO { |
| 135 | @ApiModelProperty(value = "档口 ID") | 143 | @ApiModelProperty(value = "档口 ID") |
| 136 | private Integer stallId; | 144 | private Integer stallId; |
| 137 | 145 | ||
| 146 | + @ApiModelProperty(value = "需要创建客户 ID") | ||
| 147 | + public Boolean shouldCreateCustomerId; | ||
| 148 | + | ||
| 138 | @ApiModelProperty(value = "客户 ID") | 149 | @ApiModelProperty(value = "客户 ID") |
| 139 | private Integer customerId; | 150 | private Integer customerId; |
| 140 | 151 | ||
| 152 | + @ApiModelProperty(value = "需要创建阳光厅点餐客户open ID") | ||
| 153 | + private Boolean shouldCreateOpenId; | ||
| 154 | + | ||
| 141 | @ApiModelProperty(value = "阳光厅点餐客户 ID") | 155 | @ApiModelProperty(value = "阳光厅点餐客户 ID") |
| 142 | private String openId; | 156 | private String openId; |
| 143 | 157 | ||
| ... | @@ -180,9 +194,6 @@ public class OrderDbDTO { | ... | @@ -180,9 +194,6 @@ public class OrderDbDTO { |
| 180 | @ApiModelProperty(value = "点餐桌码") | 194 | @ApiModelProperty(value = "点餐桌码") |
| 181 | private String tableCode; | 195 | private String tableCode; |
| 182 | 196 | ||
| 183 | - @ApiModelProperty(value = "取餐码") | ||
| 184 | - private String pickupCode; | ||
| 185 | - | ||
| 186 | @ApiModelProperty(value = "订单类型 购买类型:1=堂食,2=外送") | 197 | @ApiModelProperty(value = "订单类型 购买类型:1=堂食,2=外送") |
| 187 | private Integer orderType; | 198 | private Integer orderType; |
| 188 | 199 | ||
| ... | @@ -205,10 +216,22 @@ public class OrderDbDTO { | ... | @@ -205,10 +216,22 @@ public class OrderDbDTO { |
| 205 | @ApiModelProperty(value = "更新来源:小程序点餐=1;院区端=2;kds=3;业务中台 = 4") | 216 | @ApiModelProperty(value = "更新来源:小程序点餐=1;院区端=2;kds=3;业务中台 = 4") |
| 206 | private Integer updateSource; | 217 | private Integer updateSource; |
| 207 | 218 | ||
| 219 | + @ApiModelProperty(value = "截单类型") | ||
| 220 | + private CloseTimeType closeTimeType; | ||
| 221 | + | ||
| 208 | @ApiModelProperty(value = "订单菜品详情列表") | 222 | @ApiModelProperty(value = "订单菜品详情列表") |
| 209 | private List<CreateOrderDetailDto> orderDetailDtos; | 223 | private List<CreateOrderDetailDto> orderDetailDtos; |
| 210 | } | 224 | } |
| 211 | 225 | ||
| 226 | + @Data | ||
| 227 | + @Builder | ||
| 228 | + @ToString | ||
| 229 | + @ApiModel(description = "订单与订单详情视图") | ||
| 230 | + public static class OrderAndDetailsDto { | ||
| 231 | + private List<OrderDto> orders; | ||
| 232 | + private List<OrderDetailDto> orderDetails; | ||
| 233 | + } | ||
| 234 | + | ||
| 212 | 235 | ||
| 213 | @Data | 236 | @Data |
| 214 | @Builder | 237 | @Builder |
| ... | @@ -383,6 +406,9 @@ public class OrderDbDTO { | ... | @@ -383,6 +406,9 @@ public class OrderDbDTO { |
| 383 | 406 | ||
| 384 | @ApiModelProperty(value = "调整配料备注") | 407 | @ApiModelProperty(value = "调整配料备注") |
| 385 | private String adjustSkuRemark; | 408 | private String adjustSkuRemark; |
| 409 | + | ||
| 410 | + @ApiModelProperty(value = "订单详情") | ||
| 411 | + private List<OrderDetailDto> orderDetails; | ||
| 386 | } | 412 | } |
| 387 | 413 | ||
| 388 | @Data | 414 | @Data | ... | ... |
| 1 | +package com.infoloop.tianting.model.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonProperty; | ||
| 4 | +import io.swagger.annotations.ApiModel; | ||
| 5 | +import javax.print.DocFlavor.STRING; | ||
| 6 | +import lombok.AllArgsConstructor; | ||
| 7 | +import lombok.Builder; | ||
| 8 | +import lombok.Data; | ||
| 9 | +import lombok.NoArgsConstructor; | ||
| 10 | +import org.springframework.context.annotation.Primary; | ||
| 11 | + | ||
| 12 | +@Data | ||
| 13 | +@ApiModel(description = "支付DTO") | ||
| 14 | +public class PayDTO { | ||
| 15 | + | ||
| 16 | + @Data | ||
| 17 | + @Builder | ||
| 18 | + @ApiModel(description = "支付通知请求dto") | ||
| 19 | + @NoArgsConstructor | ||
| 20 | + @AllArgsConstructor | ||
| 21 | + public static class PayInformRequestDto { | ||
| 22 | + private String clientId; | ||
| 23 | + private String orderId; | ||
| 24 | + private String openId; | ||
| 25 | + private String hospitalCode; | ||
| 26 | + private String price; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + @Data | ||
| 30 | + @Builder | ||
| 31 | + @ApiModel(description = "支付通知结果dto") | ||
| 32 | + @NoArgsConstructor | ||
| 33 | + @AllArgsConstructor | ||
| 34 | + public static class MiniPayRequest { | ||
| 35 | + private String timeStamp; | ||
| 36 | + @JsonProperty("package") | ||
| 37 | + private String packageInfo; | ||
| 38 | + private String paySign; | ||
| 39 | + private String appId; | ||
| 40 | + private String signType; | ||
| 41 | + private String nonceStr; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + @Data | ||
| 45 | + @Builder | ||
| 46 | + @ApiModel(description = "支付通知结果dto") | ||
| 47 | + @NoArgsConstructor | ||
| 48 | + @AllArgsConstructor | ||
| 49 | + public static class PayResult{ | ||
| 50 | + private Boolean TransSN; | ||
| 51 | + private String MsgId; | ||
| 52 | + private MiniPayRequest miniPayRequest; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + @Data | ||
| 56 | + @Builder | ||
| 57 | + @ApiModel(description = "支付通知响应dto") | ||
| 58 | + @NoArgsConstructor | ||
| 59 | + @AllArgsConstructor | ||
| 60 | + public static class PayResponseDto { | ||
| 61 | + private Boolean success; | ||
| 62 | + private String error; | ||
| 63 | + private PayResult result; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + @Data | ||
| 67 | + @Builder | ||
| 68 | + @ApiModel(description = "第三方支付平台通知请求dto") | ||
| 69 | + @NoArgsConstructor | ||
| 70 | + @AllArgsConstructor | ||
| 71 | + public static class ThirdPartyPayInformRequestDto { | ||
| 72 | + private String ClientId; | ||
| 73 | + private String TradeId; | ||
| 74 | + private String RequestDate; | ||
| 75 | + private String RequestSource; | ||
| 76 | + private String PayerOpenId; | ||
| 77 | + private String HospitalCode; | ||
| 78 | + private String PID; | ||
| 79 | + private String Remark; | ||
| 80 | + private String TransAmount; | ||
| 81 | + private String TradeDesc; | ||
| 82 | + private String Sign; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | +} |
| ... | @@ -16,10 +16,11 @@ public class PermissionDTO { | ... | @@ -16,10 +16,11 @@ public class PermissionDTO { |
| 16 | private LoginSourceEnum loginSourceEnum; | 16 | private LoginSourceEnum loginSourceEnum; |
| 17 | private boolean shouldLoginWithHisCustomerId; | 17 | private boolean shouldLoginWithHisCustomerId; |
| 18 | private String hisCustomerId; | 18 | private String hisCustomerId; |
| 19 | - private boolean shouldLoginWithCustomerId; | 19 | + private boolean shouldLoginWithOperatorPhone; |
| 20 | - private Integer customerId; | 20 | + private String operatorPhone; |
| 21 | - private boolean shouldLoginWithOpenId; | 21 | + private boolean shouldLoginWithOpenCode; |
| 22 | - private String openId; | 22 | + private String openCode; |
| 23 | + private Integer enterpriseId; | ||
| 23 | } | 24 | } |
| 24 | 25 | ||
| 25 | } | 26 | } | ... | ... |
| 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; | ||
| 4 | import io.swagger.models.auth.In; | 5 | import io.swagger.models.auth.In; |
| 6 | +import lombok.AllArgsConstructor; | ||
| 5 | import lombok.Builder; | 7 | import lombok.Builder; |
| 6 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | +import lombok.NoArgsConstructor; | ||
| 7 | 10 | ||
| 8 | @Data | 11 | @Data |
| 9 | @ApiModel(description = "WxUserDto") | 12 | @ApiModel(description = "WxUserDto") |
| ... | @@ -12,13 +15,24 @@ public class WxUserDto { | ... | @@ -12,13 +15,24 @@ public class WxUserDto { |
| 12 | @Data | 15 | @Data |
| 13 | @Builder | 16 | @Builder |
| 14 | @ApiModel(description = "WxUserOpenIdDto") | 17 | @ApiModel(description = "WxUserOpenIdDto") |
| 18 | + @NoArgsConstructor | ||
| 19 | + @AllArgsConstructor | ||
| 15 | public static class WxUserOpenIdDto { | 20 | public static class WxUserOpenIdDto { |
| 21 | + public String openid; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + @Data | ||
| 25 | + @Builder | ||
| 26 | + @ApiModel(description = "WxUserOpenIdDto") | ||
| 27 | + public static class WxUserOpenIdDto1 { | ||
| 16 | public String openId; | 28 | public String openId; |
| 17 | } | 29 | } |
| 18 | 30 | ||
| 19 | @Data | 31 | @Data |
| 20 | @Builder | 32 | @Builder |
| 21 | @ApiModel(description = "WxUserOpenIdDto") | 33 | @ApiModel(description = "WxUserOpenIdDto") |
| 34 | + @NoArgsConstructor | ||
| 35 | + @AllArgsConstructor | ||
| 22 | public static class WxUserTokenDto { | 36 | public static class WxUserTokenDto { |
| 23 | public String access_token; | 37 | public String access_token; |
| 24 | } | 38 | } |
| ... | @@ -26,14 +40,19 @@ public class WxUserDto { | ... | @@ -26,14 +40,19 @@ public class WxUserDto { |
| 26 | @Data | 40 | @Data |
| 27 | @Builder | 41 | @Builder |
| 28 | @ApiModel(description = "WxUserPhoneDto") | 42 | @ApiModel(description = "WxUserPhoneDto") |
| 43 | + @NoArgsConstructor | ||
| 44 | + @AllArgsConstructor | ||
| 29 | public static class WxUserPhoneInfoDto { | 45 | public static class WxUserPhoneInfoDto { |
| 30 | public String phoneNumber; | 46 | public String phoneNumber; |
| 31 | public String countryCode; | 47 | public String countryCode; |
| 32 | } | 48 | } |
| 33 | 49 | ||
| 50 | + | ||
| 34 | @Data | 51 | @Data |
| 35 | @Builder | 52 | @Builder |
| 36 | @ApiModel(description = "WxUserPhoneDto") | 53 | @ApiModel(description = "WxUserPhoneDto") |
| 54 | + @NoArgsConstructor | ||
| 55 | + @AllArgsConstructor | ||
| 37 | public static class WxUserPhoneResponseDto { | 56 | public static class WxUserPhoneResponseDto { |
| 38 | public Integer errcode; | 57 | public Integer errcode; |
| 39 | public String errmsg; | 58 | public String errmsg; |
| ... | @@ -41,4 +60,13 @@ public class WxUserDto { | ... | @@ -41,4 +60,13 @@ public class WxUserDto { |
| 41 | public WxUserPhoneInfoDto phone_info; | 60 | public WxUserPhoneInfoDto phone_info; |
| 42 | } | 61 | } |
| 43 | 62 | ||
| 63 | + @Data | ||
| 64 | + @Builder | ||
| 65 | + @ApiModel(description = "WxUserCodeDto") | ||
| 66 | + @NoArgsConstructor | ||
| 67 | + @AllArgsConstructor | ||
| 68 | + public static class WxUserCodeDto { | ||
| 69 | + public String code; | ||
| 70 | + } | ||
| 71 | + | ||
| 44 | } | 72 | } | ... | ... |
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.infoloop.tianting.model.dto.MenuDbDTO.BatchCreateMenuRefsDto; | ||
| 5 | +import com.infoloop.tianting.model.dto.MenuDbDTO.BatchCreateMenuRefsResponseDto; | ||
| 4 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDetailDto; | 6 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDetailDto; |
| 5 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; | 7 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; |
| 6 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuRefDto; | 8 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuRefDto; |
| ... | @@ -13,4 +15,6 @@ public interface MenuService { | ... | @@ -13,4 +15,6 @@ public interface MenuService { |
| 13 | List<MenuDetailDto> queryMenuDetailsByMenuId(Integer enterpriseId, Integer menuId); | 15 | List<MenuDetailDto> queryMenuDetailsByMenuId(Integer enterpriseId, Integer menuId); |
| 14 | 16 | ||
| 15 | List<MenuRefDto> getClientCustomerMenuRefsByCustomerId(Integer enterpriseId, Integer customerId); | 17 | List<MenuRefDto> getClientCustomerMenuRefsByCustomerId(Integer enterpriseId, Integer customerId); |
| 18 | + | ||
| 19 | + BatchCreateMenuRefsResponseDto batchCreateMenuRefs(BatchCreateMenuRefsDto batchCreateMenuRefsDto); | ||
| 16 | } | 20 | } | ... | ... |
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.model.common.PageResult; | ||
| 3 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; | 4 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; |
| 4 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; | 5 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; |
| 6 | +import com.infoloop.tianting.model.dto.OrderDbDTO.OrderAndDetailsDto; | ||
| 5 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; | 7 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; |
| 6 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; | 8 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; |
| 7 | -import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderDto; | 9 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; |
| 10 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; | ||
| 8 | import java.util.List; | 11 | import java.util.List; |
| 9 | 12 | ||
| 10 | public interface OrderService { | 13 | public interface OrderService { |
| 11 | - List<OrderDto> getOrdersByCustomerId(Integer customerId); | 14 | + OrderAndDetailsDto getOrdersByCustomerId(Integer customerId); |
| 12 | - List<OrderDto> getOrdersByCondition(QueryOrderDto queryOrderDto); | 15 | + OrderAndDetailsDto getOrdersByCondition(QueryOrderByConditionDto queryOrderDto); |
| 16 | + PageResult<OrderDto> getOrdersByPagination(QueryOrderByPaginationDto queryOrderDto); | ||
| 13 | List<OrderDetailDto> getOrderDetailsByOrderId(Integer orderId); | 17 | List<OrderDetailDto> getOrderDetailsByOrderId(Integer orderId); |
| 14 | CreateOrderResponse createOrder(CreateOrderDto createOrderDto); | 18 | CreateOrderResponse createOrder(CreateOrderDto createOrderDto); |
| 15 | } | 19 | } | ... | ... |
| 1 | package com.infoloop.tianting.service.client; | 1 | package com.infoloop.tianting.service.client; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.menuservice.BatchCreateClientCustomerMenuRefsRpcRequest; | ||
| 4 | +import com.infoloop.tianting.menuservice.BatchCreateClientCustomerMenuRefsRpcResponse; | ||
| 5 | +import com.infoloop.tianting.menuservice.ClientCustomerMenuRefCreation; | ||
| 3 | import com.infoloop.tianting.menuservice.GetClientCustomerMenuRefsByCustomerIdRpcRequest; | 6 | import com.infoloop.tianting.menuservice.GetClientCustomerMenuRefsByCustomerIdRpcRequest; |
| 4 | import com.infoloop.tianting.menuservice.GetClientCustomerMenuRefsByCustomerIdRpcResponse; | 7 | import com.infoloop.tianting.menuservice.GetClientCustomerMenuRefsByCustomerIdRpcResponse; |
| 5 | import com.infoloop.tianting.menuservice.GetMenuDetailsByMenuIdsRpcRequest; | 8 | import com.infoloop.tianting.menuservice.GetMenuDetailsByMenuIdsRpcRequest; |
| ... | @@ -7,7 +10,12 @@ import com.infoloop.tianting.menuservice.GetMenuDetailsByMenuIdsRpcResponse; | ... | @@ -7,7 +10,12 @@ import com.infoloop.tianting.menuservice.GetMenuDetailsByMenuIdsRpcResponse; |
| 7 | import com.infoloop.tianting.menuservice.GetMicroPublishedMenusByStallIdsRpcRequest; | 10 | import com.infoloop.tianting.menuservice.GetMicroPublishedMenusByStallIdsRpcRequest; |
| 8 | import com.infoloop.tianting.menuservice.GetMicroPublishedMenusByStallIdsRpcResponse; | 11 | import com.infoloop.tianting.menuservice.GetMicroPublishedMenusByStallIdsRpcResponse; |
| 9 | import com.infoloop.tianting.menuservice.MenuServiceRpcGrpc; | 12 | import com.infoloop.tianting.menuservice.MenuServiceRpcGrpc; |
| 13 | +import com.infoloop.tianting.model.dto.MenuDbDTO.BatchCreateMenuRefsDto; | ||
| 14 | +import com.infoloop.tianting.utils.DateUtil; | ||
| 15 | +import java.time.LocalDateTime; | ||
| 16 | +import java.time.ZoneOffset; | ||
| 10 | import java.util.List; | 17 | import java.util.List; |
| 18 | +import java.util.stream.Collectors; | ||
| 11 | import lombok.RequiredArgsConstructor; | 19 | import lombok.RequiredArgsConstructor; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| ... | @@ -49,4 +57,23 @@ public class MenuServiceRpcClient { | ... | @@ -49,4 +57,23 @@ public class MenuServiceRpcClient { |
| 49 | return menuServiceRpcBlockingStub.getClientCustomerMenuRefsByCustomerId(request); | 57 | return menuServiceRpcBlockingStub.getClientCustomerMenuRefsByCustomerId(request); |
| 50 | 58 | ||
| 51 | } | 59 | } |
| 60 | + | ||
| 61 | + public BatchCreateClientCustomerMenuRefsRpcResponse batchCreateClientCustomerMenuRefs( | ||
| 62 | + BatchCreateMenuRefsDto batchCreateMenuRefsDto) { | ||
| 63 | + final var creations = batchCreateMenuRefsDto.getCreations().stream().map(mr-> | ||
| 64 | + ClientCustomerMenuRefCreation.newBuilder() | ||
| 65 | + .setIsTop(mr.isTop()) | ||
| 66 | + .setMenuId(mr.getMenuId()) | ||
| 67 | + .setCustomerId(mr.getCustomerId()) | ||
| 68 | + .setBindAt(LocalDateTime.now().toEpochSecond(ZoneOffset.UTC)) | ||
| 69 | + .build()) | ||
| 70 | + .collect(Collectors.toList()); | ||
| 71 | + final var request = BatchCreateClientCustomerMenuRefsRpcRequest.newBuilder() | ||
| 72 | + .setCreatedBy(batchCreateMenuRefsDto.getCreatedBy()) | ||
| 73 | + .setEnterpriseId(batchCreateMenuRefsDto.getEnterpriseId()) | ||
| 74 | + .addAllCreations(creations) | ||
| 75 | + .setCreationSource(batchCreateMenuRefsDto.getCreationSource().getNumber()) | ||
| 76 | + .build(); | ||
| 77 | + return menuServiceRpcBlockingStub.batchCreateClientCustomerMenuRefs(request); | ||
| 78 | + } | ||
| 52 | } | 79 | } | ... | ... |
| 1 | +package com.infoloop.tianting.service.client; | ||
| 2 | + | ||
| 3 | +import com.infoloop.tianting.COperatorServiceProtoRpcGrpc; | ||
| 4 | +import com.infoloop.tianting.GetCOperatorByIdRpcRequest; | ||
| 5 | +import com.infoloop.tianting.GetCOperatorByMobileOrEmailRpcRequest; | ||
| 6 | +import com.infoloop.tianting.GetCOperatorByMobileOrEmailRpcResponse; | ||
| 7 | +import com.infoloop.tianting.SingleCOperatorRpcResponse; | ||
| 8 | +import lombok.RequiredArgsConstructor; | ||
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | +import org.springframework.stereotype.Service; | ||
| 11 | + | ||
| 12 | +@Service | ||
| 13 | +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) | ||
| 14 | +public class OperatorServiceRpcClient { | ||
| 15 | + | ||
| 16 | + private final COperatorServiceProtoRpcGrpc.COperatorServiceProtoRpcBlockingStub | ||
| 17 | + cOperatorServiceProtoRpcBlockingStub; | ||
| 18 | + | ||
| 19 | + public SingleCOperatorRpcResponse getCOperatorByMobileOrEmail(String keyword) { | ||
| 20 | + final var request = GetCOperatorByMobileOrEmailRpcRequest.newBuilder() | ||
| 21 | + .setKeyword(keyword) | ||
| 22 | + .build(); | ||
| 23 | + return cOperatorServiceProtoRpcBlockingStub.getCOperatorByMobileOrEmail(request).getResponse(); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + public SingleCOperatorRpcResponse getCOperatorById(Integer id) { | ||
| 27 | + final var request = GetCOperatorByIdRpcRequest.newBuilder().setId(id).build(); | ||
| 28 | + return cOperatorServiceProtoRpcBlockingStub.getCOperatorById(request).getResponse(); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +} |
| 1 | package com.infoloop.tianting.service.client; | 1 | package com.infoloop.tianting.service.client; |
| 2 | 2 | ||
| 3 | -//import com.infoloop.tianting.clientcustomerorderservice.BatchCreateClientCustomerOrderAndDetailsRpcRequest; | ||
| 4 | -//import com.infoloop.tianting.clientcustomerorderservice.BatchCreateClientCustomerOrderAndDetailsRpcResponse; | ||
| 5 | -import com.infoloop.tianting.clientcustomerorderservice.BatchCreateClientCustomerOrderDetailsRpcRequest; | ||
| 6 | -import com.infoloop.tianting.clientcustomerorderservice.BatchCreateClientCustomerOrderDetailsRpcResponse; | ||
| 7 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderCreation; | 3 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderCreation; |
| 8 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderDetailCreation; | 4 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderDetailCreation; |
| 9 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderServiceRpcGrpc; | 5 | import com.infoloop.tianting.clientcustomerorderservice.ClientCustomerOrderServiceRpcGrpc; |
| 6 | +import com.infoloop.tianting.clientcustomerorderservice.CloseTimeType; | ||
| 10 | import com.infoloop.tianting.clientcustomerorderservice.CreateClientCustomerOrderRpcRequest; | 7 | import com.infoloop.tianting.clientcustomerorderservice.CreateClientCustomerOrderRpcRequest; |
| 11 | import com.infoloop.tianting.clientcustomerorderservice.CreateClientCustomerOrderRpcResponse; | 8 | import com.infoloop.tianting.clientcustomerorderservice.CreateClientCustomerOrderRpcResponse; |
| 12 | import com.infoloop.tianting.clientcustomerorderservice.CustomerNotice; | 9 | import com.infoloop.tianting.clientcustomerorderservice.CustomerNotice; |
| ... | @@ -16,15 +13,20 @@ import com.infoloop.tianting.clientcustomerorderservice.GetClientCustomerOrdersB | ... | @@ -16,15 +13,20 @@ import com.infoloop.tianting.clientcustomerorderservice.GetClientCustomerOrdersB |
| 16 | import com.infoloop.tianting.clientcustomerorderservice.MealDetail; | 13 | import com.infoloop.tianting.clientcustomerorderservice.MealDetail; |
| 17 | import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; | 14 | import com.infoloop.tianting.clientcustomerorderservice.OrderSourceEnum; |
| 18 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; | 15 | import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; |
| 16 | +import com.infoloop.tianting.clientcustomerorderservice.PayStatusEnum; | ||
| 19 | import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByConditionRpcRequest; | 17 | import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByConditionRpcRequest; |
| 18 | +import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByPaginationRpcRequest; | ||
| 19 | +import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByPaginationRpcResponse; | ||
| 20 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderDetailRpcResponse; | 20 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderDetailRpcResponse; |
| 21 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderRpcResponse; | 21 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderRpcResponse; |
| 22 | import com.infoloop.tianting.enums.OrderTypeEnum; | 22 | import com.infoloop.tianting.enums.OrderTypeEnum; |
| 23 | +import com.infoloop.tianting.model.common.PageResult; | ||
| 23 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDetailDto; | 24 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDetailDto; |
| 24 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; | 25 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; |
| 25 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; | 26 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; |
| 26 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; | 27 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; |
| 27 | -import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderDto; | 28 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; |
| 29 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; | ||
| 28 | import io.swagger.models.auth.In; | 30 | import io.swagger.models.auth.In; |
| 29 | import java.time.ZoneOffset; | 31 | import java.time.ZoneOffset; |
| 30 | import java.util.ArrayList; | 32 | import java.util.ArrayList; |
| ... | @@ -43,15 +45,29 @@ public class OrderServiceRpcClient { | ... | @@ -43,15 +45,29 @@ public class OrderServiceRpcClient { |
| 43 | GetClientCustomerOrdersByCustomerIdRpcRequest.newBuilder().setCustomerId(customerId).build()).getResponsesList(); | 45 | GetClientCustomerOrdersByCustomerIdRpcRequest.newBuilder().setCustomerId(customerId).build()).getResponsesList(); |
| 44 | } | 46 | } |
| 45 | 47 | ||
| 46 | - public List<SingleClientCustomerOrderRpcResponse> getOrdersByCondition(QueryOrderDto queryOrderDto) { | 48 | + public List<SingleClientCustomerOrderRpcResponse> getOrdersByCondition( |
| 49 | + QueryOrderByConditionDto queryOrderDto) { | ||
| 47 | final var request = QueryClientCustomerOrdersByConditionRpcRequest.newBuilder() | 50 | final var request = QueryClientCustomerOrdersByConditionRpcRequest.newBuilder() |
| 48 | .setEnterpriseId(queryOrderDto.getEnterpriseId()) | 51 | .setEnterpriseId(queryOrderDto.getEnterpriseId()) |
| 49 | - .setShouldFilterStatus(queryOrderDto.isShouldFilterStatus()) | 52 | + .setShouldFilterOpenIds(queryOrderDto.getShouldFilterOpenId()) |
| 50 | - .setStatus(queryOrderDto.getStatus()) | 53 | + .addAllOpenIds(List.of(queryOrderDto.getOpenId())) |
| 51 | .build(); | 54 | .build(); |
| 52 | return orderServiceRpcBlockingStub.queryClientCustomerOrdersByCondition(request).getResponsesList(); | 55 | return orderServiceRpcBlockingStub.queryClientCustomerOrdersByCondition(request).getResponsesList(); |
| 53 | } | 56 | } |
| 54 | 57 | ||
| 58 | + public QueryClientCustomerOrdersByPaginationRpcResponse queryClientCustomerOrdersByPagination( | ||
| 59 | + QueryOrderByPaginationDto queryOrderDto) { | ||
| 60 | + final var request = QueryClientCustomerOrdersByPaginationRpcRequest.newBuilder() | ||
| 61 | + .setKeyword(queryOrderDto.getKeyword()) | ||
| 62 | + .setPageNo(queryOrderDto.getPn()) | ||
| 63 | + .setPageSize(queryOrderDto.getPz()) | ||
| 64 | + .setStatus(queryOrderDto.getStatus()) | ||
| 65 | + .setEnterpriseId(queryOrderDto.getEnterpriseId()) | ||
| 66 | + .setClientId(queryOrderDto.getClientId()) | ||
| 67 | + .build(); | ||
| 68 | + return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request); | ||
| 69 | + } | ||
| 70 | + | ||
| 55 | public List<SingleClientCustomerOrderDetailRpcResponse> getOrderDetailsByOrderId(Integer orderId) { | 71 | public List<SingleClientCustomerOrderDetailRpcResponse> getOrderDetailsByOrderId(Integer orderId) { |
| 56 | return orderServiceRpcBlockingStub.getClientCustomerOrderDetailsByOrderIds( | 72 | return orderServiceRpcBlockingStub.getClientCustomerOrderDetailsByOrderIds( |
| 57 | GetClientCustomerOrderDetailsByOrderIdsRpcRequest.newBuilder() | 73 | GetClientCustomerOrderDetailsByOrderIdsRpcRequest.newBuilder() |
| ... | @@ -59,6 +75,14 @@ public class OrderServiceRpcClient { | ... | @@ -59,6 +75,14 @@ public class OrderServiceRpcClient { |
| 59 | .addAllOrderIds(List.of(orderId)) | 75 | .addAllOrderIds(List.of(orderId)) |
| 60 | .build()).getResponsesList(); | 76 | .build()).getResponsesList(); |
| 61 | } | 77 | } |
| 78 | + | ||
| 79 | + public List<SingleClientCustomerOrderDetailRpcResponse> getOrderDetailsByOrderIds(List<Integer> orderIds) { | ||
| 80 | + return orderServiceRpcBlockingStub.getClientCustomerOrderDetailsByOrderIds( | ||
| 81 | + GetClientCustomerOrderDetailsByOrderIdsRpcRequest.newBuilder() | ||
| 82 | + .setIncludeDeleted(false) | ||
| 83 | + .addAllOrderIds(orderIds) | ||
| 84 | + .build()).getResponsesList(); | ||
| 85 | + } | ||
| 62 | // public GetOrdersByOpenIdRpcResponse queryOrdersByOpenId(Integer openId) { | 86 | // public GetOrdersByOpenIdRpcResponse queryOrdersByOpenId(Integer openId) { |
| 63 | // return orderServiceRpcBlockingStub.getOrdersByCustomerId( | 87 | // return orderServiceRpcBlockingStub.getOrdersByCustomerId( |
| 64 | // GetOrdersByOpenIdRpcRequest.newBuilder().setOpenId(openId).build()); | 88 | // GetOrdersByOpenIdRpcRequest.newBuilder().setOpenId(openId).build()); |
| ... | @@ -106,26 +130,31 @@ public class OrderServiceRpcClient { | ... | @@ -106,26 +130,31 @@ public class OrderServiceRpcClient { |
| 106 | .build(); | 130 | .build(); |
| 107 | 131 | ||
| 108 | final var creation = ClientCustomerOrderCreation.newBuilder() | 132 | final var creation = ClientCustomerOrderCreation.newBuilder() |
| 109 | - .setShouldCreateCustomerId(true) | 133 | + .setShouldCreateCustomerId(createOrderDto.getShouldCreateCustomerId()) |
| 110 | .setCustomerId(createOrderDto.getCustomerId()) | 134 | .setCustomerId(createOrderDto.getCustomerId()) |
| 111 | .setStallId(createOrderDto.getStallId()) | 135 | .setStallId(createOrderDto.getStallId()) |
| 112 | .setAddress(createOrderDto.getAddress()) | 136 | .setAddress(createOrderDto.getAddress()) |
| 113 | .setClientId(createOrderDto.getClientId()) | 137 | .setClientId(createOrderDto.getClientId()) |
| 114 | - .setShouldCreateOpenId(!createOrderDto.getOpenId().isEmpty()) | 138 | + .setShouldCreateOpenId(createOrderDto.getShouldCreateOpenId()) |
| 115 | .setOpenId(createOrderDto.getOpenId()) | 139 | .setOpenId(createOrderDto.getOpenId()) |
| 116 | .setShouldCreateRoomNo(!createOrderDto.getRoomNo().isEmpty()) | 140 | .setShouldCreateRoomNo(!createOrderDto.getRoomNo().isEmpty()) |
| 117 | .setRoomNo(createOrderDto.getRoomNo()) | 141 | .setRoomNo(createOrderDto.getRoomNo()) |
| 118 | .setShouldCreateTableCode(createOrderDto.getOrderType().equals(OrderTypeEnum.DINE_IN.getValue())) | 142 | .setShouldCreateTableCode(createOrderDto.getOrderType().equals(OrderTypeEnum.DINE_IN.getValue())) |
| 119 | .setTableCode(createOrderDto.getTableCode()) | 143 | .setTableCode(createOrderDto.getTableCode()) |
| 120 | .setOnlinePay(createOrderDto.getOnlinePay()) | 144 | .setOnlinePay(createOrderDto.getOnlinePay()) |
| 145 | + .setShouldCreatePayStatus(createOrderDto.getOnlinePay()) | ||
| 146 | + .setPayStatus(PayStatusEnum.TO_PAY) | ||
| 121 | .setMenuId(createOrderDto.getMenuId()) | 147 | .setMenuId(createOrderDto.getMenuId()) |
| 122 | .setTotalNum(createOrderDto.getTotalNum()) | 148 | .setTotalNum(createOrderDto.getTotalNum()) |
| 123 | .setPayPrice(createOrderDto.getPayPrice()) | 149 | .setPayPrice(createOrderDto.getPayPrice()) |
| 124 | .setMealTime(createOrderDto.getMealTime().toInstant(ZoneOffset.UTC).toEpochMilli()) | 150 | .setMealTime(createOrderDto.getMealTime().toInstant(ZoneOffset.UTC).toEpochMilli()) |
| 125 | - .setShouldCreatePickupCode(createOrderDto.getOrderType().equals(OrderTypeEnum.DINE_IN.getValue())) | 151 | + .setShouldCreateTableCode(createOrderDto.getCloseTimeType().equals(CloseTimeType.IMMEDIATELY)) |
| 126 | - .setPickupCode(createOrderDto.getPickupCode()) | 152 | + .setTableCode(createOrderDto.getTableCode()) |
| 153 | + .setShouldCreatePickupCode(createOrderDto.getCloseTimeType().equals(CloseTimeType.IMMEDIATELY)) | ||
| 154 | +// .setPickupCode(createOrderDto.getPickupCode()) | ||
| 127 | .setRemark(createOrderDto.getRemark()) | 155 | .setRemark(createOrderDto.getRemark()) |
| 128 | .setCustomerNoticeJson(customerNotice) | 156 | .setCustomerNoticeJson(customerNotice) |
| 157 | + .setCloseTimeType(createOrderDto.getCloseTimeType()) | ||
| 129 | .setShouldCreateOrderDetails(true) | 158 | .setShouldCreateOrderDetails(true) |
| 130 | .addAllOrderDetails(orderDetails) | 159 | .addAllOrderDetails(orderDetails) |
| 131 | .build(); | 160 | .build(); |
| ... | @@ -136,12 +165,6 @@ public class OrderServiceRpcClient { | ... | @@ -136,12 +165,6 @@ public class OrderServiceRpcClient { |
| 136 | .setEnterpriseId(createOrderDto.getEnterpriseId()) | 165 | .setEnterpriseId(createOrderDto.getEnterpriseId()) |
| 137 | .setCreatedBy(createOrderDto.getCreatedBy()) | 166 | .setCreatedBy(createOrderDto.getCreatedBy()) |
| 138 | .build()); | 167 | .build()); |
| 139 | -// BatchCreateClientCustomerOrderDetailsRpcResponse orderDetailsRpcResponse = orderServiceRpcBlockingStub.batchCreateClientCustomerOrderDetails( | ||
| 140 | -// BatchCreateClientCustomerOrderDetailsRpcRequest.newBuilder() | ||
| 141 | -// .addAllCreations(orderDetails) | ||
| 142 | -// .setCreatedBy(createOrderDto.getCreatedBy()) | ||
| 143 | -// .setEnterpriseId(createOrderDto.getEnterpriseId()) | ||
| 144 | -// .setCreationSource(OrderSourceEnum.forNumber(createOrderDto.getCreationSource())).build()); | ||
| 145 | return CreateOrderResponse.builder().id(orderResponse.getId()).isCreated(true).build(); | 168 | return CreateOrderResponse.builder().id(orderResponse.getId()).isCreated(true).build(); |
| 146 | } | 169 | } |
| 147 | 170 | ... | ... |
| 1 | +package com.infoloop.tianting.service.client; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.databind.DeserializationFeature; | ||
| 4 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 5 | +import com.infoloop.tianting.model.dto.PayDTO.PayInformRequestDto; | ||
| 6 | +import com.infoloop.tianting.model.dto.PayDTO.PayResponseDto; | ||
| 7 | +import com.infoloop.tianting.model.dto.PayDTO.ThirdPartyPayInformRequestDto; | ||
| 8 | +import com.infoloop.tianting.model.dto.WxUserDto.WxUserPhoneResponseDto; | ||
| 9 | +import com.infoloop.tianting.utils.DateUtil; | ||
| 10 | +import com.infoloop.tianting.utils.EncryptionUtil; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | +import lombok.RequiredArgsConstructor; | ||
| 13 | +import okhttp3.FormBody; | ||
| 14 | +import okhttp3.MediaType; | ||
| 15 | +import okhttp3.OkHttpClient; | ||
| 16 | +import okhttp3.Request; | ||
| 17 | +import okhttp3.RequestBody; | ||
| 18 | +import okhttp3.Response; | ||
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 20 | +import org.springframework.stereotype.Service; | ||
| 21 | + | ||
| 22 | +@Service | ||
| 23 | +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) | ||
| 24 | +public class PayServiceClient { | ||
| 25 | + | ||
| 26 | + private final OkHttpClient client = new OkHttpClient(); | ||
| 27 | + | ||
| 28 | + public PayResponseDto payInform(PayInformRequestDto payRequestDto) { | ||
| 29 | + try { | ||
| 30 | + String url = "http://10.2.1.166:21051/API/Microapp/CreateOrder?appid=Order0001"; | ||
| 31 | + String clientId = "Order0001"; | ||
| 32 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
| 33 | + ThirdPartyPayInformRequestDto jsonData = new ThirdPartyPayInformRequestDto(); | ||
| 34 | + jsonData.setClientId(clientId); | ||
| 35 | + jsonData.setTradeId(payRequestDto.getOrderId()); | ||
| 36 | + String requestDate = DateUtil.formatDate(LocalDateTime.now(), DateUtil.YMDHMS); | ||
| 37 | + jsonData.setRequestDate(requestDate); | ||
| 38 | + jsonData.setRequestSource(""); | ||
| 39 | + jsonData.setPayerOpenId(payRequestDto.getOpenId()); | ||
| 40 | + jsonData.setHospitalCode(payRequestDto.getHospitalCode()); | ||
| 41 | + jsonData.setPID(""); | ||
| 42 | + jsonData.setRemark(""); | ||
| 43 | + jsonData.setTransAmount(payRequestDto.getPrice()); | ||
| 44 | + jsonData.setTradeDesc(""); | ||
| 45 | + String signStr = EncryptionUtil.sha1Encryption( | ||
| 46 | + clientId+payRequestDto.getOrderId()+requestDate+"Order0001"); | ||
| 47 | + jsonData.setSign(signStr); | ||
| 48 | + String jsonDataString = objectMapper.writeValueAsString(jsonData); | ||
| 49 | + | ||
| 50 | + // 设置请求体的媒体类型为JSON | ||
| 51 | + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); | ||
| 52 | + RequestBody body = RequestBody.create(mediaType, jsonDataString); | ||
| 53 | + Request getPhoneRequest = new Request.Builder() | ||
| 54 | + .url(url) | ||
| 55 | + .post(body) | ||
| 56 | + .build(); | ||
| 57 | + Response payResponse = client.newCall(getPhoneRequest).execute(); | ||
| 58 | + String payJsonData = payResponse.body().string(); | ||
| 59 | + System.out.println("pay json:"+payJsonData); | ||
| 60 | + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | ||
| 61 | + PayResponseDto payResponseDto = objectMapper.readValue(payJsonData, PayResponseDto.class); | ||
| 62 | + return payResponseDto; | ||
| 63 | + } catch (Exception e) { | ||
| 64 | + System.out.println(e.getStackTrace().toString()); | ||
| 65 | + throw new IllegalArgumentException("支付通知失败"); | ||
| 66 | + } | ||
| 67 | + } | ||
| 68 | +} |
| 1 | package com.infoloop.tianting.service.client; | 1 | package com.infoloop.tianting.service.client; |
| 2 | 2 | ||
| 3 | +import com.fasterxml.jackson.databind.DeserializationFeature; | ||
| 4 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 3 | import com.infoloop.tianting.constant.ConfigConstants; | 5 | import com.infoloop.tianting.constant.ConfigConstants; |
| 4 | import com.infoloop.tianting.model.dto.WxUserDto; | 6 | import com.infoloop.tianting.model.dto.WxUserDto; |
| 7 | +import com.infoloop.tianting.model.dto.WxUserDto.WxUserCodeDto; | ||
| 5 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto; | 8 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto; |
| 9 | +import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto1; | ||
| 6 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserPhoneResponseDto; | 10 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserPhoneResponseDto; |
| 7 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserTokenDto; | 11 | import com.infoloop.tianting.model.dto.WxUserDto.WxUserTokenDto; |
| 8 | import com.infoloop.tianting.utils.JsonUtil; | 12 | import com.infoloop.tianting.utils.JsonUtil; |
| 9 | import lombok.RequiredArgsConstructor; | 13 | import lombok.RequiredArgsConstructor; |
| 14 | +import lombok.Value; | ||
| 10 | import okhttp3.FormBody; | 15 | import okhttp3.FormBody; |
| 16 | +import okhttp3.MediaType; | ||
| 11 | import okhttp3.OkHttpClient; | 17 | import okhttp3.OkHttpClient; |
| 12 | import okhttp3.Request; | 18 | import okhttp3.Request; |
| 13 | import okhttp3.RequestBody; | 19 | import okhttp3.RequestBody; |
| ... | @@ -24,29 +30,37 @@ public class WxMiniProgramClient { | ... | @@ -24,29 +30,37 @@ public class WxMiniProgramClient { |
| 24 | 30 | ||
| 25 | public WxUserPhoneResponseDto getUserPhoneInfoByCode(String code) { | 31 | public WxUserPhoneResponseDto getUserPhoneInfoByCode(String code) { |
| 26 | try { | 32 | try { |
| 27 | - String getTokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" | 33 | + String getTokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx40ec496d73b58ec6" |
| 28 | - + ConfigConstants.MINI_PROGRAM_APP_ID +"&secret=" + ConfigConstants.MINI_PROGRAM_APP_SECRET; | 34 | + +"&secret=5b309517bf918abf760b2195e91b99f3"; |
| 29 | Request getTokenRequest = new Request.Builder() | 35 | Request getTokenRequest = new Request.Builder() |
| 30 | .url(getTokenUrl) | 36 | .url(getTokenUrl) |
| 31 | .build(); | 37 | .build(); |
| 32 | Response getTokenResponse = client.newCall(getTokenRequest).execute(); | 38 | Response getTokenResponse = client.newCall(getTokenRequest).execute(); |
| 39 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
| 40 | + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | ||
| 33 | String tokenJsonData = getTokenResponse.body().string(); | 41 | String tokenJsonData = getTokenResponse.body().string(); |
| 34 | - WxUserTokenDto wxUserTokenDto = JsonUtil.readJsonAs(tokenJsonData, WxUserTokenDto.class); | 42 | + WxUserTokenDto wxUserTokenDto = objectMapper.readValue(tokenJsonData, WxUserTokenDto.class); |
| 43 | + System.out.println("token:" + wxUserTokenDto.getAccess_token()); | ||
| 35 | String getPhoneUrl = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" | 44 | String getPhoneUrl = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" |
| 36 | + wxUserTokenDto.getAccess_token(); | 45 | + wxUserTokenDto.getAccess_token(); |
| 37 | - FormBody.Builder formBuilder = new FormBody.Builder(); | 46 | + WxUserCodeDto jsonData = new WxUserCodeDto(); |
| 38 | - formBuilder.add("code", code); | 47 | + jsonData.setCode(code); |
| 39 | - RequestBody requestBody = formBuilder.build(); | 48 | + String jsonDataString = objectMapper.writeValueAsString(jsonData); |
| 49 | + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); | ||
| 50 | + RequestBody body = RequestBody.create(mediaType, jsonDataString); | ||
| 40 | Request getPhoneRequest = new Request.Builder() | 51 | Request getPhoneRequest = new Request.Builder() |
| 41 | .url(getPhoneUrl) | 52 | .url(getPhoneUrl) |
| 42 | - .post(requestBody) | 53 | + .post(body) |
| 43 | .build(); | 54 | .build(); |
| 44 | Response getPhoneResponse = client.newCall(getPhoneRequest).execute(); | 55 | Response getPhoneResponse = client.newCall(getPhoneRequest).execute(); |
| 45 | String phoneJsonData = getPhoneResponse.body().string(); | 56 | String phoneJsonData = getPhoneResponse.body().string(); |
| 46 | - WxUserPhoneResponseDto wxUserPhoneResponseDto = JsonUtil.readJsonAs(phoneJsonData, WxUserPhoneResponseDto.class); | 57 | + System.out.println("------------------------"); |
| 58 | + System.out.println("phone json:" + phoneJsonData); | ||
| 59 | + WxUserPhoneResponseDto wxUserPhoneResponseDto = objectMapper.readValue(phoneJsonData, WxUserPhoneResponseDto.class); | ||
| 47 | return wxUserPhoneResponseDto; | 60 | return wxUserPhoneResponseDto; |
| 48 | 61 | ||
| 49 | } catch (Exception e) { | 62 | } catch (Exception e) { |
| 63 | + System.out.println(e.getMessage()); | ||
| 50 | throw new IllegalArgumentException("获取用户手机号失败"); | 64 | throw new IllegalArgumentException("获取用户手机号失败"); |
| 51 | } | 65 | } |
| 52 | } | 66 | } |
| ... | @@ -55,8 +69,8 @@ public class WxMiniProgramClient { | ... | @@ -55,8 +69,8 @@ public class WxMiniProgramClient { |
| 55 | try { | 69 | try { |
| 56 | 70 | ||
| 57 | String url = "https://api.weixin.qq.com/sns/jscode2session" + | 71 | String url = "https://api.weixin.qq.com/sns/jscode2session" + |
| 58 | - "?appid=" + ConfigConstants.MINI_PROGRAM_APP_ID + "&secret=" + ConfigConstants.MINI_PROGRAM_APP_SECRET + "&js_code=" + code + "&grant_type=authorization_code"; | 72 | + "?appid=wx40ec496d73b58ec6" + "&secret=5b309517bf918abf760b2195e91b99f3" + "&js_code=" + code + "&grant_type=authorization_code"; |
| 59 | - | 73 | + System.out.println("url:" +url); |
| 60 | Request request = new Request.Builder() | 74 | Request request = new Request.Builder() |
| 61 | .url(url) | 75 | .url(url) |
| 62 | .build(); | 76 | .build(); |
| ... | @@ -64,13 +78,11 @@ public class WxMiniProgramClient { | ... | @@ -64,13 +78,11 @@ public class WxMiniProgramClient { |
| 64 | Response response = client.newCall(request).execute(); | 78 | Response response = client.newCall(request).execute(); |
| 65 | 79 | ||
| 66 | String jsonData = response.body().string(); | 80 | String jsonData = response.body().string(); |
| 67 | - WxUserOpenIdDto res = JsonUtil.readJsonAs(jsonData, WxUserOpenIdDto.class); | 81 | + ObjectMapper objectMapper = new ObjectMapper(); |
| 68 | - return res; | 82 | + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
| 69 | - | 83 | + return objectMapper.readValue(jsonData, WxUserOpenIdDto.class); |
| 70 | -// String openid = data.getOpenid(); | ||
| 71 | -// | ||
| 72 | -// return WxUserLoginResponseDto.builder().openId(openid).build(); | ||
| 73 | } catch (Exception e) { | 84 | } catch (Exception e) { |
| 85 | + System.out.println("error"+e.getMessage()); | ||
| 74 | throw new IllegalArgumentException("获取用户openid失败"); | 86 | throw new IllegalArgumentException("获取用户openid失败"); |
| 75 | } | 87 | } |
| 76 | } | 88 | } | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.infoloop.tianting.service.impl; | ... | @@ -3,6 +3,7 @@ package com.infoloop.tianting.service.impl; |
| 3 | import cn.dev33.satoken.stp.SaLoginModel; | 3 | import cn.dev33.satoken.stp.SaLoginModel; |
| 4 | import cn.dev33.satoken.stp.SaTokenInfo; | 4 | import cn.dev33.satoken.stp.SaTokenInfo; |
| 5 | import cn.dev33.satoken.stp.StpUtil; | 5 | import cn.dev33.satoken.stp.StpUtil; |
| 6 | +import com.infoloop.tianting.COperatorServiceProtoRpcGrpc; | ||
| 6 | import com.infoloop.tianting.clientcustomerservice.GetClientCustomerByIdRpcRequest; | 7 | import com.infoloop.tianting.clientcustomerservice.GetClientCustomerByIdRpcRequest; |
| 7 | import com.infoloop.tianting.clientcustomerservice.SingleClientCustomerRpcResponse; | 8 | import com.infoloop.tianting.clientcustomerservice.SingleClientCustomerRpcResponse; |
| 8 | import com.infoloop.tianting.constant.CommonConstants; | 9 | import com.infoloop.tianting.constant.CommonConstants; |
| ... | @@ -11,7 +12,10 @@ import com.infoloop.tianting.exception.ErrorCodeEnum; | ... | @@ -11,7 +12,10 @@ import com.infoloop.tianting.exception.ErrorCodeEnum; |
| 11 | import com.infoloop.tianting.model.dto.PermissionDTO.LoginDto; | 12 | import com.infoloop.tianting.model.dto.PermissionDTO.LoginDto; |
| 12 | import com.infoloop.tianting.service.ClientCustomerService; | 13 | import com.infoloop.tianting.service.ClientCustomerService; |
| 13 | import com.infoloop.tianting.service.LoginService; | 14 | import com.infoloop.tianting.service.LoginService; |
| 15 | +import com.infoloop.tianting.service.WxMiniProgramService; | ||
| 14 | import com.infoloop.tianting.service.client.ClientCustomerServiceRpcClient; | 16 | import com.infoloop.tianting.service.client.ClientCustomerServiceRpcClient; |
| 17 | +import com.infoloop.tianting.service.client.OperatorServiceRpcClient; | ||
| 18 | +import com.infoloop.tianting.service.client.WxMiniProgramClient; | ||
| 15 | import lombok.RequiredArgsConstructor; | 19 | import lombok.RequiredArgsConstructor; |
| 16 | import lombok.extern.slf4j.Slf4j; | 20 | import lombok.extern.slf4j.Slf4j; |
| 17 | import org.springframework.beans.factory.annotation.Autowired; | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -23,20 +27,22 @@ import org.springframework.stereotype.Service; | ... | @@ -23,20 +27,22 @@ import org.springframework.stereotype.Service; |
| 23 | public class LoginServiceImpl implements LoginService { | 27 | public class LoginServiceImpl implements LoginService { |
| 24 | 28 | ||
| 25 | private final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient; | 29 | private final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient; |
| 30 | + private final OperatorServiceRpcClient operatorServiceRpcClient; | ||
| 31 | + private final WxMiniProgramClient wxMiniProgramClient; | ||
| 26 | 32 | ||
| 27 | @Override | 33 | @Override |
| 28 | public SaTokenInfo login(LoginDto loginDto) { | 34 | public SaTokenInfo login(LoginDto loginDto) { |
| 29 | - if (loginDto.isShouldLoginWithOpenId()) { | 35 | + if (loginDto.isShouldLoginWithOpenCode()) { |
| 36 | + final var wxUserOpenIdDto = wxMiniProgramClient.getUserOpenIdByCode(loginDto.getOpenCode()); | ||
| 37 | + StpUtil.login(wxUserOpenIdDto.getOpenid(), SaLoginModel.create() | ||
| 38 | + .setExtra(CommonConstants.ENTERPRISE_ID, loginDto.getEnterpriseId()) | ||
| 39 | + .setExtra(CommonConstants.LOGIN_SOURCE, loginDto.getLoginSourceEnum().getValue()) | ||
| 40 | + .build()); | ||
| 30 | return StpUtil.getTokenInfo(); | 41 | return StpUtil.getTokenInfo(); |
| 31 | } | 42 | } |
| 32 | - else { | 43 | + else if (loginDto.isShouldLoginWithHisCustomerId()){ |
| 33 | - final SingleClientCustomerRpcResponse customer; | 44 | + final var customer = clientCustomerServiceRpcClient.getClientCustomerByHISCustomerId( |
| 34 | - if (loginDto.isShouldLoginWithHisCustomerId()){ | 45 | + loginDto.getHisCustomerId()).getResponse(); |
| 35 | - customer = clientCustomerServiceRpcClient.getClientCustomerByHISCustomerId(loginDto.getHisCustomerId()).getResponse(); | ||
| 36 | - } else { | ||
| 37 | - customer = clientCustomerServiceRpcClient.getClientCustomerById(loginDto.getCustomerId()).getResponse(); | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | if (customer.getId() == 0) { | 46 | if (customer.getId() == 0) { |
| 41 | throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.UNAUTHORIZED.name()); | 47 | throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.UNAUTHORIZED.name()); |
| 42 | } | 48 | } |
| ... | @@ -46,6 +52,18 @@ public class LoginServiceImpl implements LoginService { | ... | @@ -46,6 +52,18 @@ public class LoginServiceImpl implements LoginService { |
| 46 | .build()); | 52 | .build()); |
| 47 | return StpUtil.getTokenInfo(); | 53 | return StpUtil.getTokenInfo(); |
| 48 | } | 54 | } |
| 55 | + else { | ||
| 56 | + final var operator = operatorServiceRpcClient.getCOperatorByMobileOrEmail( | ||
| 57 | + loginDto.getOperatorPhone()); | ||
| 58 | + if (operator.getId() == 0) { | ||
| 59 | + throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.UNAUTHORIZED.name()); | ||
| 60 | + } | ||
| 61 | + StpUtil.login(operator.getId(), SaLoginModel.create() | ||
| 62 | + .setExtra(CommonConstants.ENTERPRISE_ID, operator.getEnterpriseId()) | ||
| 63 | + .setExtra(CommonConstants.LOGIN_SOURCE, loginDto.getLoginSourceEnum().getValue()) | ||
| 64 | + .build()); | ||
| 65 | + return StpUtil.getTokenInfo(); | ||
| 66 | + } | ||
| 49 | } | 67 | } |
| 50 | 68 | ||
| 51 | } | 69 | } | ... | ... |
| 1 | package com.infoloop.tianting.service.impl; | 1 | package com.infoloop.tianting.service.impl; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.model.dto.MenuDbDTO.BatchCreateMenuRefsDto; | ||
| 4 | +import com.infoloop.tianting.model.dto.MenuDbDTO.BatchCreateMenuRefsResponseDto; | ||
| 3 | import com.infoloop.tianting.model.dto.MenuDbDTO.DishRuleJson; | 5 | import com.infoloop.tianting.model.dto.MenuDbDTO.DishRuleJson; |
| 4 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDetailDto; | 6 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDetailDto; |
| 5 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; | 7 | import com.infoloop.tianting.model.dto.MenuDbDTO.MenuDto; |
| ... | @@ -60,6 +62,7 @@ public class MenuServiceImpl implements MenuService { | ... | @@ -60,6 +62,7 @@ public class MenuServiceImpl implements MenuService { |
| 60 | .updatedBy(menu.getUpdatedBy()) | 62 | .updatedBy(menu.getUpdatedBy()) |
| 61 | .updateSource(menu.getUpdateSource()) | 63 | .updateSource(menu.getUpdateSource()) |
| 62 | .updatedAt(DateUtil.formatDate(menu.getUpdatedAt())) | 64 | .updatedAt(DateUtil.formatDate(menu.getUpdatedAt())) |
| 65 | + .publishAt(DateUtil.formatDate(menu.getPublishAt())) | ||
| 63 | .build()).collect(Collectors.toList()); | 66 | .build()).collect(Collectors.toList()); |
| 64 | } | 67 | } |
| 65 | 68 | ||
| ... | @@ -106,4 +109,13 @@ public class MenuServiceImpl implements MenuService { | ... | @@ -106,4 +109,13 @@ public class MenuServiceImpl implements MenuService { |
| 106 | 109 | ||
| 107 | } | 110 | } |
| 108 | 111 | ||
| 112 | + @Override | ||
| 113 | + public BatchCreateMenuRefsResponseDto batchCreateMenuRefs(BatchCreateMenuRefsDto batchCreateMenuRefsDto) { | ||
| 114 | + final var response = menuServiceRpcClient.batchCreateClientCustomerMenuRefs(batchCreateMenuRefsDto); | ||
| 115 | + return BatchCreateMenuRefsResponseDto.builder() | ||
| 116 | + .ids(response.getIdsList()) | ||
| 117 | + .isCreated(response.getIsCreated()) | ||
| 118 | + .build(); | ||
| 119 | + } | ||
| 120 | + | ||
| 109 | } | 121 | } | ... | ... |
| 1 | package com.infoloop.tianting.service.impl; | 1 | package com.infoloop.tianting.service.impl; |
| 2 | 2 | ||
| 3 | -import com.infoloop.tianting.model.dto.OrderDbDTO; | 3 | +import com.infoloop.tianting.model.common.PageResult; |
| 4 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; | 4 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; |
| 5 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; | 5 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; |
| 6 | import com.infoloop.tianting.model.dto.OrderDbDTO.CustomerNotice; | 6 | import com.infoloop.tianting.model.dto.OrderDbDTO.CustomerNotice; |
| 7 | import com.infoloop.tianting.model.dto.OrderDbDTO.MealDetailDto; | 7 | import com.infoloop.tianting.model.dto.OrderDbDTO.MealDetailDto; |
| 8 | +import com.infoloop.tianting.model.dto.OrderDbDTO.OrderAndDetailsDto; | ||
| 8 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; | 9 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; |
| 9 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; | 10 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDto; |
| 10 | -import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderDto; | 11 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; |
| 11 | -import com.infoloop.tianting.model.vo.TestExampleDbVO; | 12 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; |
| 12 | import com.infoloop.tianting.service.OrderService; | 13 | import com.infoloop.tianting.service.OrderService; |
| 13 | import com.infoloop.tianting.service.client.OrderServiceRpcClient; | 14 | import com.infoloop.tianting.service.client.OrderServiceRpcClient; |
| 14 | import com.infoloop.tianting.utils.DateUtil; | 15 | import com.infoloop.tianting.utils.DateUtil; |
| 16 | +import com.infoloop.tianting.utils.PageUtil; | ||
| 15 | import java.util.List; | 17 | import java.util.List; |
| 16 | import java.util.stream.Collectors; | 18 | import java.util.stream.Collectors; |
| 17 | import lombok.RequiredArgsConstructor; | 19 | import lombok.RequiredArgsConstructor; |
| ... | @@ -70,9 +72,9 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -70,9 +72,9 @@ public class OrderServiceImpl implements OrderService { |
| 70 | } | 72 | } |
| 71 | 73 | ||
| 72 | @Override | 74 | @Override |
| 73 | - public List<OrderDto> getOrdersByCustomerId(Integer customerId) { | 75 | + public OrderAndDetailsDto getOrdersByCustomerId(Integer customerId) { |
| 74 | final var responseList = orderServiceRpcClient.getOrdersByCustomerId(customerId); | 76 | final var responseList = orderServiceRpcClient.getOrdersByCustomerId(customerId); |
| 75 | - return responseList.stream().map(r -> OrderDto.builder() | 77 | + final var orders = responseList.stream().map(r -> OrderDto.builder() |
| 76 | .id(r.getId()) | 78 | .id(r.getId()) |
| 77 | .enterpriseId(r.getEnterpriseId()) | 79 | .enterpriseId(r.getEnterpriseId()) |
| 78 | .clientId(r.getClientId()) | 80 | .clientId(r.getClientId()) |
| ... | @@ -103,12 +105,122 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -103,12 +105,122 @@ public class OrderServiceImpl implements OrderService { |
| 103 | .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) | 105 | .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) |
| 104 | .updatedBy(r.getUpdatedBy()) | 106 | .updatedBy(r.getUpdatedBy()) |
| 105 | .build()).collect(Collectors.toList()); | 107 | .build()).collect(Collectors.toList()); |
| 108 | + final var ids = orders.stream().map(OrderDto::getId).collect(Collectors.toList()); | ||
| 109 | + final var detailsResponse = orderServiceRpcClient.getOrderDetailsByOrderIds(ids); | ||
| 110 | + final var detailDtos = detailsResponse.stream().map(d -> | ||
| 111 | + OrderDetailDto.builder() | ||
| 112 | + .id(d.getId()) | ||
| 113 | + .count(d.getCount()) | ||
| 114 | + .categoryId(d.getCategoryId()) | ||
| 115 | + .mealId(d.getMealId()) | ||
| 116 | + .menuDetailId(d.getMenuDetailId()) | ||
| 117 | + .orderId(d.getOrderId()) | ||
| 118 | + .price(d.getPrice()) | ||
| 119 | + .showName(d.getShowName()) | ||
| 120 | + .mealDetailJson(MealDetailDto.builder() | ||
| 121 | + .allergies(d.getMealDetailJson().getAllergiesList()) | ||
| 122 | + .basicMaterials(d.getMealDetailJson().getBasicMaterials()) | ||
| 123 | + .dockers(d.getMealDetailJson().getDockersList()) | ||
| 124 | + .efficacies(d.getMealDetailJson().getEfficaciesList()) | ||
| 125 | + .fat(d.getMealDetailJson().getFat()) | ||
| 126 | + .tastes(d.getMealDetailJson().getTastesList()) | ||
| 127 | + .protein(d.getMealDetailJson().getProtein()) | ||
| 128 | + .carbohydrate(d.getMealDetailJson().getCarbohydrate()) | ||
| 129 | + .energy(d.getMealDetailJson().getEnergy()) | ||
| 130 | + .avoids(d.getMealDetailJson().getAvoidsList()) | ||
| 131 | + .skus(d.getMealDetailJson().getSkusList()) | ||
| 132 | + .build()) | ||
| 133 | + .adjustSkuRemark(d.getAdjustSkuRemark()) | ||
| 134 | + .enterpriseId(d.getEnterpriseId()) | ||
| 135 | + .skuId(d.getSkuId()) | ||
| 136 | + .notServe(d.getNotServe()) | ||
| 137 | + .creationSource(d.getCreationSource().getNumber()) | ||
| 138 | + .createdBy(d.getCreatedBy()) | ||
| 139 | + .createdAt(DateUtil.formatDate(d.getCreatedAt())) | ||
| 140 | + .updateSource(d.getUpdateSource().getNumber()) | ||
| 141 | + .updatedAt(DateUtil.formatDate(d.getUpdatedAt())) | ||
| 142 | + .updatedBy(d.getUpdatedBy()) | ||
| 143 | + .build()).collect(Collectors.toList()); | ||
| 144 | + return OrderAndDetailsDto.builder().orderDetails(detailDtos).orders(orders).build(); | ||
| 106 | } | 145 | } |
| 107 | 146 | ||
| 108 | @Override | 147 | @Override |
| 109 | - public List<OrderDto> getOrdersByCondition(QueryOrderDto queryOrderDto) { | 148 | + public OrderAndDetailsDto getOrdersByCondition(QueryOrderByConditionDto queryOrderDto) { |
| 110 | final var responseList = orderServiceRpcClient.getOrdersByCondition(queryOrderDto); | 149 | final var responseList = orderServiceRpcClient.getOrdersByCondition(queryOrderDto); |
| 111 | - return responseList.stream().map(r -> OrderDto.builder() | 150 | + final var orders = responseList.stream().map(r -> OrderDto.builder() |
| 151 | + .id(r.getId()) | ||
| 152 | + .enterpriseId(r.getEnterpriseId()) | ||
| 153 | + .clientId(r.getClientId()) | ||
| 154 | + .stallId(r.getStallId()) | ||
| 155 | + .customerId(r.getCustomerId()) | ||
| 156 | + .openId(r.getOpenId()) | ||
| 157 | + .address(r.getAddress()) | ||
| 158 | + .orderCode(r.getOrderCode()) | ||
| 159 | + .menuId(r.getMenuId()) | ||
| 160 | + .pickupCode(r.getPickupCode()) | ||
| 161 | + .tableCode(r.getTableCode()) | ||
| 162 | + .roomNo(r.getRoomNo()) | ||
| 163 | + .status(r.getStatus().getNumber()) | ||
| 164 | + .customerNoticeJson(CustomerNotice.builder() | ||
| 165 | + .avoids(r.getCustomerNoticeJson().getAvoidsList()) | ||
| 166 | + .doctors(r.getCustomerNoticeJson().getDoctorsList()).build()) | ||
| 167 | + .onlinePay(r.getOnlinePay()) | ||
| 168 | + .payStatus(r.getPayStatusValue()) | ||
| 169 | + .payPrice(r.getPayPrice()) | ||
| 170 | + .payTime(DateUtil.formatDate(r.getPayTime())) | ||
| 171 | + .mealTime(DateUtil.formatDate(r.getMealTime())) | ||
| 172 | + .orderType(r.getOrderTypeValue()) | ||
| 173 | + .remark(r.getRemark()) | ||
| 174 | + .creationSource(r.getCreationSource().getNumber()) | ||
| 175 | + .createdBy(r.getCreatedBy()) | ||
| 176 | + .createdAt(DateUtil.formatDate(r.getCreatedAt())) | ||
| 177 | + .updateSource(r.getUpdateSource().getNumber()) | ||
| 178 | + .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) | ||
| 179 | + .updatedBy(r.getUpdatedBy()) | ||
| 180 | + .build()).collect(Collectors.toList()); | ||
| 181 | + final var ids = orders.stream().map(OrderDto::getId).collect(Collectors.toList()); | ||
| 182 | + final var detailsResponse = orderServiceRpcClient.getOrderDetailsByOrderIds(ids); | ||
| 183 | + final var detailDtos = detailsResponse.stream().map(d -> | ||
| 184 | + OrderDetailDto.builder() | ||
| 185 | + .id(d.getId()) | ||
| 186 | + .count(d.getCount()) | ||
| 187 | + .categoryId(d.getCategoryId()) | ||
| 188 | + .mealId(d.getMealId()) | ||
| 189 | + .menuDetailId(d.getMenuDetailId()) | ||
| 190 | + .orderId(d.getOrderId()) | ||
| 191 | + .price(d.getPrice()) | ||
| 192 | + .showName(d.getShowName()) | ||
| 193 | + .mealDetailJson(MealDetailDto.builder() | ||
| 194 | + .allergies(d.getMealDetailJson().getAllergiesList()) | ||
| 195 | + .basicMaterials(d.getMealDetailJson().getBasicMaterials()) | ||
| 196 | + .dockers(d.getMealDetailJson().getDockersList()) | ||
| 197 | + .efficacies(d.getMealDetailJson().getEfficaciesList()) | ||
| 198 | + .fat(d.getMealDetailJson().getFat()) | ||
| 199 | + .tastes(d.getMealDetailJson().getTastesList()) | ||
| 200 | + .protein(d.getMealDetailJson().getProtein()) | ||
| 201 | + .carbohydrate(d.getMealDetailJson().getCarbohydrate()) | ||
| 202 | + .energy(d.getMealDetailJson().getEnergy()) | ||
| 203 | + .avoids(d.getMealDetailJson().getAvoidsList()) | ||
| 204 | + .skus(d.getMealDetailJson().getSkusList()) | ||
| 205 | + .build()) | ||
| 206 | + .adjustSkuRemark(d.getAdjustSkuRemark()) | ||
| 207 | + .enterpriseId(d.getEnterpriseId()) | ||
| 208 | + .skuId(d.getSkuId()) | ||
| 209 | + .notServe(d.getNotServe()) | ||
| 210 | + .creationSource(d.getCreationSource().getNumber()) | ||
| 211 | + .createdBy(d.getCreatedBy()) | ||
| 212 | + .createdAt(DateUtil.formatDate(d.getCreatedAt())) | ||
| 213 | + .updateSource(d.getUpdateSource().getNumber()) | ||
| 214 | + .updatedAt(DateUtil.formatDate(d.getUpdatedAt())) | ||
| 215 | + .updatedBy(d.getUpdatedBy()) | ||
| 216 | + .build()).collect(Collectors.toList()); | ||
| 217 | + return OrderAndDetailsDto.builder().orderDetails(detailDtos).orders(orders).build(); | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + @Override | ||
| 221 | + public PageResult<OrderDto> getOrdersByPagination(QueryOrderByPaginationDto queryOrderDto) { | ||
| 222 | + final var response = orderServiceRpcClient.queryClientCustomerOrdersByPagination(queryOrderDto); | ||
| 223 | + final var results = response.getResponsesList().stream().map(r -> OrderDto.builder() | ||
| 112 | .id(r.getId()) | 224 | .id(r.getId()) |
| 113 | .enterpriseId(r.getEnterpriseId()) | 225 | .enterpriseId(r.getEnterpriseId()) |
| 114 | .clientId(r.getClientId()) | 226 | .clientId(r.getClientId()) |
| ... | @@ -132,12 +244,18 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -132,12 +244,18 @@ public class OrderServiceImpl implements OrderService { |
| 132 | .mealTime(DateUtil.formatDate(r.getMealTime())) | 244 | .mealTime(DateUtil.formatDate(r.getMealTime())) |
| 133 | .orderType(r.getOrderTypeValue()) | 245 | .orderType(r.getOrderTypeValue()) |
| 134 | .remark(r.getRemark()) | 246 | .remark(r.getRemark()) |
| 247 | + .isDeleted(r.getIsDeleted()) | ||
| 248 | + .isRead(r.getIsRead()) | ||
| 135 | .creationSource(r.getCreationSource().getNumber()) | 249 | .creationSource(r.getCreationSource().getNumber()) |
| 136 | .createdBy(r.getCreatedBy()) | 250 | .createdBy(r.getCreatedBy()) |
| 137 | .createdAt(DateUtil.formatDate(r.getCreatedAt())) | 251 | .createdAt(DateUtil.formatDate(r.getCreatedAt())) |
| 138 | .updateSource(r.getUpdateSource().getNumber()) | 252 | .updateSource(r.getUpdateSource().getNumber()) |
| 139 | .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) | 253 | .updatedAt(DateUtil.formatDate(r.getUpdatedAt())) |
| 140 | .updatedBy(r.getUpdatedBy()) | 254 | .updatedBy(r.getUpdatedBy()) |
| 255 | + .closeTimeType(r.getCloseTimeTypeValue()) | ||
| 256 | + .totalNum(r.getTotalNum()) | ||
| 141 | .build()).collect(Collectors.toList()); | 257 | .build()).collect(Collectors.toList()); |
| 258 | + return PageUtil.from(results, response.getTotal(), response.getPages(), | ||
| 259 | + queryOrderDto.getPn(), queryOrderDto.getPz()); | ||
| 142 | } | 260 | } |
| 143 | } | 261 | } | ... | ... |
| 1 | +package com.infoloop.tianting.utils; | ||
| 2 | + | ||
| 3 | +import java.security.MessageDigest; | ||
| 4 | + | ||
| 5 | +public class EncryptionUtil { | ||
| 6 | + | ||
| 7 | + public static String sha1Encryption(String input) { | ||
| 8 | + try { | ||
| 9 | + // 获取SHA1算法的MessageDigest实例 | ||
| 10 | + MessageDigest md = MessageDigest.getInstance("SHA1"); | ||
| 11 | + | ||
| 12 | + // 将输入字符串转换为字节数组并更新MessageDigest | ||
| 13 | + md.update(input.getBytes()); | ||
| 14 | + | ||
| 15 | + // 计算哈希值,得到字节数组形式的结果 | ||
| 16 | + byte[] digest = md.digest(); | ||
| 17 | + | ||
| 18 | + // 将字节数组转换为十六进制字符串表示 | ||
| 19 | + StringBuilder hexString = new StringBuilder(); | ||
| 20 | + for (byte b : digest) { | ||
| 21 | + String hex = Integer.toHexString(0xff & b); | ||
| 22 | + if (hex.length() == 1) { | ||
| 23 | + hexString.append('0'); | ||
| 24 | + } | ||
| 25 | + hexString.append(hex); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + return hexString.toString(); | ||
| 29 | + } catch (Exception e) { | ||
| 30 | + e.printStackTrace(); | ||
| 31 | + return null; | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | +} |
| 1 | +syntax = "proto3"; | ||
| 2 | + | ||
| 3 | +option java_multiple_files = true; | ||
| 4 | +option java_package = "com.infoloop.tianting"; | ||
| 5 | +option java_outer_classname = "COperatorsServiceProto"; | ||
| 6 | +option objc_class_prefix = "OP"; | ||
| 7 | + | ||
| 8 | +package com.infoloop.tianting; | ||
| 9 | + | ||
| 10 | +service COperatorServiceProtoRpc { | ||
| 11 | + rpc GetCOperatorById(GetCOperatorByIdRpcRequest) returns (GetCOperatorByIdRpcResponse) {} | ||
| 12 | + rpc GetCOperatorByIds(GetCOperatorByIdsRpcRequest) returns (GetCOperatorByIdsRpcResponse) {} | ||
| 13 | + rpc GetCOperatorsByClientIds(GetCOperatorsByIdsRpcRequest) returns (GetCOperatorsByIdsRpcResponse) {} | ||
| 14 | + rpc GetCOperatorByCondition(GetCOperatorByConditionRpcRequest) returns (GetCOperatorByConditionRpcResponse) {} | ||
| 15 | + rpc GetCOperatorByEmail (GetCOperatorByEmailRpcRequest) returns (GetCOperatorByEmailRpcResponse) {} | ||
| 16 | + rpc UpdateCOperatorStatusByClientIds(UpdateCOperatorStatusByClientIdsRpcRequest) returns (UpdateCOperatorStatusByClientIdsRpcResponse) {} | ||
| 17 | + rpc GetCOperatorOnlyById(GetOperatorOnlyByIdRpcRequest) returns (GetOperatorOnlyByIdRpcResponse) {} | ||
| 18 | + rpc GetCOperatorByMobile (GetCOperatorByMobileRpcRequest) returns (GetCOperatorByMobileRpcResponse) {} | ||
| 19 | + rpc UpdateCOperatorPasswordById(UpdateCOperatorPasswordByIdRpcRequest) returns (UpdateCOperatorPasswordByIdRpcResponse) {} | ||
| 20 | + rpc UpdateCOperatorMobileById(UpdateCOperatorMobileByIdRpcRequest) returns (UpdateCOperatorMobileByIdRpcResponse) {} | ||
| 21 | + rpc UpdateCOperatorAliasById(UpdateCOperatorAliasByIdRpcRequest) returns (UpdateCOperatorAliasByIdRpcResponse) {} | ||
| 22 | + rpc CreateCOperator (CreateCOperatorRpcRequest) returns (CreateCOperatorRpcResponse) {} | ||
| 23 | + rpc UpdateCOperator (UpdateCOperatorRpcRequest) returns (UpdateCOperatorRpcResponse) {} | ||
| 24 | + rpc DeleteCOperatorByIds (DeleteCOperatorByIdsRpcRequest) returns (DeleteCOperatorByIdsRpcResponse) {} | ||
| 25 | + rpc GetRoleIdsByOperatorId (GetRoleIdsByOperatorIdRpcRequest) returns (GetRoleIdsByOperatorIdRpcResponse) {} | ||
| 26 | + rpc CreateCRoles (CreateCRolesRpcRequest) returns (CreateCRolesRpcResponse) {} | ||
| 27 | + rpc CreateCRole (CreateCRoleRpcRequest) returns (CreateCRoleRpcResponse) {} | ||
| 28 | + rpc GetCOperatorByMobileOrEmail (GetCOperatorByMobileOrEmailRpcRequest) returns (GetCOperatorByMobileOrEmailRpcResponse) {} | ||
| 29 | + | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +enum COperatorStatus { | ||
| 33 | + UN_KNOW_COPERATOR = 0; | ||
| 34 | + ENABLE = 1; | ||
| 35 | + DISABLE = 3; | ||
| 36 | +} | ||
| 37 | + | ||
| 38 | +message UpdateCOperatorStatusByClientIdsRpcRequest { | ||
| 39 | + repeated int32 clientIds = 1; | ||
| 40 | + int32 enterpriseId = 2; | ||
| 41 | + COperatorStatus status = 3; | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +message UpdateCOperatorStatusByClientIdsRpcResponse { | ||
| 45 | + bool isUpdated = 1; | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | + | ||
| 49 | +message GetOperatorOnlyByIdRpcRequest { | ||
| 50 | + int32 id = 1; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +message GetOperatorOnlyByIdRpcResponse { | ||
| 54 | + SingleCOperatorRpcResponse response = 1; | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +message GetCOperatorByMobileRpcRequest { | ||
| 58 | + string mobile = 1; | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +message GetCOperatorByMobileRpcResponse { | ||
| 62 | + SingleCOperatorRpcResponse response = 1; | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +message GetCOperatorByIdRpcRequest { | ||
| 66 | + int32 enterpriseId = 1; | ||
| 67 | + int32 id = 2; | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +message GetCOperatorByIdsRpcRequest { | ||
| 71 | + repeated int32 ids = 1; | ||
| 72 | + bool includeDeleted = 2; | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | +message GetCOperatorsByIdsRpcRequest { | ||
| 76 | + repeated int32 ids = 1; | ||
| 77 | + bool includeDeleted = 2; | ||
| 78 | + bool isPrimary = 3; | ||
| 79 | + bool shouldFilerIsPrimary = 4; | ||
| 80 | +} | ||
| 81 | + | ||
| 82 | +message GetCOperatorByConditionRpcResponse { | ||
| 83 | + repeated SingleCOperatorRpcResponse responses = 1; | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +message GetCOperatorByConditionRpcRequest { | ||
| 87 | + int32 enterpriseId = 1; | ||
| 88 | + repeated int32 ids = 2; | ||
| 89 | + repeated int32 clientIds = 3; | ||
| 90 | + string name = 4; | ||
| 91 | + string email = 5; | ||
| 92 | + string password = 6; | ||
| 93 | + COperatorStatus status = 7; | ||
| 94 | + repeated int32 stallIds = 8; | ||
| 95 | + string mobile = 9; | ||
| 96 | + bool isPrimary = 10; | ||
| 97 | + bool shouldFilerIds = 11; | ||
| 98 | + bool shouldFilerClientIds = 12; | ||
| 99 | + bool shouldFilerName = 13; | ||
| 100 | + bool shouldFilerEmail = 14; | ||
| 101 | + bool shouldFilerPassword = 15; | ||
| 102 | + bool shouldFilerStatus = 16; | ||
| 103 | + bool shouldFilerStallIds = 17; | ||
| 104 | + bool shouldFilerMobile = 18; | ||
| 105 | + bool shouldFilerIsPrimary = 19; | ||
| 106 | +} | ||
| 107 | + | ||
| 108 | +message UpdateCOperatorPasswordByIdRpcRequest { | ||
| 109 | + int32 id = 1; | ||
| 110 | + string password = 2; | ||
| 111 | +} | ||
| 112 | + | ||
| 113 | +message UpdateCOperatorPasswordByIdRpcResponse { | ||
| 114 | + bool isUpdated = 1; | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +message UpdateCOperatorMobileByIdRpcRequest { | ||
| 118 | + int32 id = 1; | ||
| 119 | + string mobile = 2; | ||
| 120 | +} | ||
| 121 | + | ||
| 122 | +message UpdateCOperatorAliasByIdRpcRequest { | ||
| 123 | + int32 id = 1; | ||
| 124 | + string alias = 2; | ||
| 125 | +} | ||
| 126 | + | ||
| 127 | +message UpdateCOperatorMobileByIdRpcResponse { | ||
| 128 | + bool isUpdated = 1; | ||
| 129 | +} | ||
| 130 | + | ||
| 131 | +message UpdateCOperatorAliasByIdRpcResponse { | ||
| 132 | + bool isUpdated = 1; | ||
| 133 | +} | ||
| 134 | + | ||
| 135 | +message SingleCOperatorRpcResponse { | ||
| 136 | + int32 id = 1; | ||
| 137 | + int32 enterpriseId = 2; | ||
| 138 | + int32 clientId = 3; | ||
| 139 | + string name = 4; | ||
| 140 | + bool isEmailSet = 5; | ||
| 141 | + string email = 6; | ||
| 142 | + string password = 7; | ||
| 143 | + int32 status = 8; | ||
| 144 | + int64 createdAt = 9; | ||
| 145 | + int64 updatedAt = 10; | ||
| 146 | + bool isDeleted = 11; | ||
| 147 | + bool isStallIdSet = 12; | ||
| 148 | + int32 stallId = 13; | ||
| 149 | + bool isPrimary = 14; | ||
| 150 | + bool isMobileSet = 15; | ||
| 151 | + string mobile = 16; | ||
| 152 | + string phone = 17; | ||
| 153 | + string alias = 18; | ||
| 154 | +} | ||
| 155 | + | ||
| 156 | +message GetCOperatorByIdRpcResponse { | ||
| 157 | + SingleCOperatorRpcResponse response = 1; | ||
| 158 | +} | ||
| 159 | +message GetCOperatorsByIdsRpcResponse { | ||
| 160 | + repeated SingleCOperatorRpcResponse responses = 1; | ||
| 161 | +} | ||
| 162 | + | ||
| 163 | +message GetCOperatorByIdsRpcResponse { | ||
| 164 | + repeated SingleCOperatorRpcResponse responses = 1; | ||
| 165 | +} | ||
| 166 | + | ||
| 167 | +message GetCOperatorByEmailRpcRequest { | ||
| 168 | + string email = 1; | ||
| 169 | +} | ||
| 170 | + | ||
| 171 | +message GetCOperatorByEmailRpcResponse { | ||
| 172 | + SingleCOperatorRpcResponse response = 1; | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +message GetRoleIdsByOperatorIdRpcRequest { | ||
| 176 | + int32 enterpriseId = 1; | ||
| 177 | + int32 operatorId = 2; | ||
| 178 | +} | ||
| 179 | + | ||
| 180 | +message GetRoleIdsByOperatorIdRpcResponse { | ||
| 181 | + repeated int32 roleIds = 1; | ||
| 182 | +} | ||
| 183 | + | ||
| 184 | +message SingleCRoleCreationRpcRequest { | ||
| 185 | + int32 clientId = 1; | ||
| 186 | + string code = 2; | ||
| 187 | + string name = 3; | ||
| 188 | + string description = 4; | ||
| 189 | + int32 status = 5; | ||
| 190 | +} | ||
| 191 | + | ||
| 192 | +message CreateCRolesRpcRequest { | ||
| 193 | + int32 enterpriseId = 1; | ||
| 194 | + repeated SingleCRoleCreationRpcRequest creations = 2; | ||
| 195 | +} | ||
| 196 | + | ||
| 197 | +message CreateCRolesRpcResponse { | ||
| 198 | + bool isCreated = 1; | ||
| 199 | + repeated int32 ids = 2; | ||
| 200 | +} | ||
| 201 | + | ||
| 202 | + | ||
| 203 | +message CreateCOperatorRpcResponse { | ||
| 204 | + bool isCreated = 1; | ||
| 205 | + int32 id = 2; | ||
| 206 | +} | ||
| 207 | + | ||
| 208 | +message UpdateCOperatorRpcResponse { | ||
| 209 | + bool isUpdated = 1; | ||
| 210 | +} | ||
| 211 | + | ||
| 212 | +message CreateCOperatorRpcRequest { | ||
| 213 | + int32 enterpriseId = 1; | ||
| 214 | + int32 clientId = 2; | ||
| 215 | + string code = 3; | ||
| 216 | + string name = 4; | ||
| 217 | + string email = 5; | ||
| 218 | + string password = 6; | ||
| 219 | + string phone = 7; | ||
| 220 | + string note = 8; | ||
| 221 | + string openId = 9; | ||
| 222 | + int32 stallId = 10; | ||
| 223 | + bool isSuper = 11; | ||
| 224 | + bool isPrimary = 12; | ||
| 225 | + int32 bookingMode = 13; | ||
| 226 | + int32 canWriteRealPurchasePrice = 14; | ||
| 227 | + string mobile = 15; | ||
| 228 | + int32 canWriteSkuBarcode = 16; | ||
| 229 | + string description = 17; | ||
| 230 | + int32 status = 18; | ||
| 231 | + int32 creationSource = 19; | ||
| 232 | + int32 createdBy = 20; | ||
| 233 | +} | ||
| 234 | + | ||
| 235 | +message DeleteCOperatorByIdsRpcRequest{ | ||
| 236 | + int32 enterpriseId = 1; | ||
| 237 | + int32 clientId = 2; | ||
| 238 | + repeated int32 ids = 3; | ||
| 239 | + int32 updateSource = 19; | ||
| 240 | + int32 updatedBy = 20; | ||
| 241 | +} | ||
| 242 | + | ||
| 243 | + | ||
| 244 | +message DeleteCOperatorByIdsRpcResponse{ | ||
| 245 | + bool isDeleted = 1; | ||
| 246 | +} | ||
| 247 | + | ||
| 248 | + | ||
| 249 | +message UpdateCOperatorRpcRequest { | ||
| 250 | + int32 id = 38; | ||
| 251 | + int32 enterpriseId = 1; | ||
| 252 | + int32 clientId = 2; | ||
| 253 | + string code = 3; | ||
| 254 | + string name = 4; | ||
| 255 | + string email = 5; | ||
| 256 | + string password = 6; | ||
| 257 | + string phone = 7; | ||
| 258 | + string note = 8; | ||
| 259 | + string openId = 9; | ||
| 260 | + int32 stallId = 10; | ||
| 261 | + bool isSuper = 11; | ||
| 262 | + bool isPrimary = 12; | ||
| 263 | + int32 bookingMode = 13; | ||
| 264 | + int32 canWriteRealPurchasePrice = 14; | ||
| 265 | + string mobile = 15; | ||
| 266 | + int32 canWriteSkuBarcode = 16; | ||
| 267 | + string description = 17; | ||
| 268 | + int32 status = 18; | ||
| 269 | + int32 updatedSource = 19; | ||
| 270 | + int32 updatedBy = 20; | ||
| 271 | + bool shouldUpdateClientId = 21; | ||
| 272 | + bool shouldUpdateCode = 22; | ||
| 273 | + bool shouldUpdateName = 23; | ||
| 274 | + bool shouldUpdateEmail = 24; | ||
| 275 | + bool shouldUpdatePassword = 25; | ||
| 276 | + bool shouldUpdatePhone = 26; | ||
| 277 | + bool shouldUpdateNote = 27; | ||
| 278 | + bool shouldUpdateOpenId = 28; | ||
| 279 | + bool shouldUpdateStallId = 29; | ||
| 280 | + bool shouldUpdateIsSuper = 30; | ||
| 281 | + bool shouldUpdateIsPrimary = 31; | ||
| 282 | + bool shouldUpdateBookingMode = 32; | ||
| 283 | + bool shouldUpdateCanWriteRealPurchasePrice = 33; | ||
| 284 | + bool shouldUpdateMobile = 34; | ||
| 285 | + bool shouldUpdateCanWriteSkuBarcode = 35; | ||
| 286 | + bool shouldUpdateDescription = 36; | ||
| 287 | + bool shouldUpdateStatus = 37; | ||
| 288 | +} | ||
| 289 | + | ||
| 290 | +message CreateCRoleRpcRequest { | ||
| 291 | + int32 enterpriseId = 1; | ||
| 292 | + SingleCRoleCreationRpcRequest creation = 2; | ||
| 293 | +} | ||
| 294 | + | ||
| 295 | +message CreateCRoleRpcResponse { | ||
| 296 | + bool isCreated = 1; | ||
| 297 | + int32 id = 2; | ||
| 298 | +} | ||
| 299 | + | ||
| 300 | +message GetCOperatorByMobileOrEmailRpcRequest { | ||
| 301 | + string keyword = 1; | ||
| 302 | +} | ||
| 303 | + | ||
| 304 | +message GetCOperatorByMobileOrEmailRpcResponse { | ||
| 305 | + SingleCOperatorRpcResponse response = 1; | ||
| 306 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -18,6 +18,7 @@ service ClientCustomerOrderServiceRpc { | ... | @@ -18,6 +18,7 @@ service ClientCustomerOrderServiceRpc { |
| 18 | rpc UpdateClientCustomerOrder (UpdateClientCustomerOrderRpcRequest) returns (UpdateClientCustomerOrderRpcResponse) {} | 18 | rpc UpdateClientCustomerOrder (UpdateClientCustomerOrderRpcRequest) returns (UpdateClientCustomerOrderRpcResponse) {} |
| 19 | rpc BatchUpdateClientCustomerOrders (BatchUpdateClientCustomerOrdersRpcRequest) returns (BatchUpdateClientCustomerOrdersRpcResponse) {} | 19 | rpc BatchUpdateClientCustomerOrders (BatchUpdateClientCustomerOrdersRpcRequest) returns (BatchUpdateClientCustomerOrdersRpcResponse) {} |
| 20 | rpc DeleteClientCustomerOrdersByIds (DeleteClientCustomerOrdersByIdsRpcRequest) returns (DeleteClientCustomerOrdersRpcResponse) {} | 20 | rpc DeleteClientCustomerOrdersByIds (DeleteClientCustomerOrdersByIdsRpcRequest) returns (DeleteClientCustomerOrdersRpcResponse) {} |
| 21 | + rpc QueryClientCustomerOrdersByPagination (QueryClientCustomerOrdersByPaginationRpcRequest) returns (QueryClientCustomerOrdersByPaginationRpcResponse) {} | ||
| 21 | 22 | ||
| 22 | //订单明细 | 23 | //订单明细 |
| 23 | rpc GetClientCustomerOrderDetailById (GetClientCustomerOrderDetailByIdRpcRequest) returns (GetClientCustomerOrderDetailByIdRpcResponse) {} | 24 | rpc GetClientCustomerOrderDetailById (GetClientCustomerOrderDetailByIdRpcRequest) returns (GetClientCustomerOrderDetailByIdRpcResponse) {} |
| ... | @@ -142,6 +143,21 @@ message GetClientCustomerOrdersByCustomerIdRpcResponse { | ... | @@ -142,6 +143,21 @@ message GetClientCustomerOrdersByCustomerIdRpcResponse { |
| 142 | repeated SingleClientCustomerOrderRpcResponse responses = 1; | 143 | repeated SingleClientCustomerOrderRpcResponse responses = 1; |
| 143 | } | 144 | } |
| 144 | 145 | ||
| 146 | +message QueryClientCustomerOrdersByPaginationRpcRequest { | ||
| 147 | + string keyword = 1; | ||
| 148 | + OrderStatusEnum status = 2; | ||
| 149 | + int32 clientId = 3; | ||
| 150 | + int32 enterpriseId = 4; | ||
| 151 | + int32 pageNo = 5; | ||
| 152 | + int32 pageSize = 6; | ||
| 153 | +} | ||
| 154 | + | ||
| 155 | +message QueryClientCustomerOrdersByPaginationRpcResponse { | ||
| 156 | + int64 total = 1; | ||
| 157 | + int64 pages = 2; | ||
| 158 | + repeated SingleClientCustomerOrderRpcResponse responses = 3; | ||
| 159 | +} | ||
| 160 | + | ||
| 145 | message QueryClientCustomerOrdersByConditionRpcRequest { | 161 | message QueryClientCustomerOrdersByConditionRpcRequest { |
| 146 | int32 enterpriseId = 1; | 162 | int32 enterpriseId = 1; |
| 147 | bool shouldFilterOrderCode = 2; | 163 | bool shouldFilterOrderCode = 2; | ... | ... |
| ... | @@ -61,8 +61,11 @@ grpc.meal-service.port=3017 | ... | @@ -61,8 +61,11 @@ grpc.meal-service.port=3017 |
| 61 | grpc.delivery-service.url=47.101.193.136 | 61 | grpc.delivery-service.url=47.101.193.136 |
| 62 | grpc.delivery-service.port=3017 | 62 | grpc.delivery-service.port=3017 |
| 63 | 63 | ||
| 64 | -miniprogram.appId= | 64 | +grpc.operator-service.url=47.101.193.136 |
| 65 | -miniprogram.appSecret= | 65 | +grpc.operator-service.port=3031 |
| 66 | + | ||
| 67 | +miniprogram.appId=wx40ec496d73b58ec6 | ||
| 68 | +miniprogram.appSecret=5b309517bf918abf760b2195e91b99f3 | ||
| 66 | 69 | ||
| 67 | ##Actuator\u914D\u7F6E | 70 | ##Actuator\u914D\u7F6E |
| 68 | management.server.port=8088 | 71 | management.server.port=8088 | ... | ... |
-
Please register or login to post a comment