ClientCustomerOrderService.proto 16.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
syntax = "proto3";

option java_multiple_files = true;
option java_package = "com.infoloop.tianting.clientcustomerorderservice";
option java_outer_classname = "ClientCustomerOrderServiceProto";
option objc_class_prefix = "OP";

package com.infoloop.tianting.clientcustomerorderservice;

service ClientCustomerOrderServiceRpc {
  //订单
  rpc GetClientCustomerOrderById (GetClientCustomerOrderByIdRpcRequest) returns (GetClientCustomerOrderByIdRpcResponse) {}
  rpc GetClientCustomerOrdersByIds (GetClientCustomerOrdersByIdsRpcRequest) returns (GetClientCustomerOrdersByIdsRpcResponse) {}
  rpc GetClientCustomerOrdersByCustomerId (GetClientCustomerOrdersByCustomerIdRpcRequest) returns (GetClientCustomerOrdersByCustomerIdRpcResponse) {}
  rpc QueryClientCustomerOrdersByCondition (QueryClientCustomerOrdersByConditionRpcRequest) returns (QueryClientCustomerOrdersByConditionRpcResponse) {}
  rpc CreateClientCustomerOrder (CreateClientCustomerOrderRpcRequest) returns (CreateClientCustomerOrderRpcResponse) {}
  rpc BatchCreateClientCustomerOrders (BatchCreateClientCustomerOrdersRpcRequest) returns (BatchCreateClientCustomerOrdersRpcResponse) {}
  rpc UpdateClientCustomerOrder (UpdateClientCustomerOrderRpcRequest) returns (UpdateClientCustomerOrderRpcResponse) {}
  rpc BatchUpdateClientCustomerOrders (BatchUpdateClientCustomerOrdersRpcRequest) returns (BatchUpdateClientCustomerOrdersRpcResponse) {}
  rpc DeleteClientCustomerOrdersByIds (DeleteClientCustomerOrdersByIdsRpcRequest) returns (DeleteClientCustomerOrdersRpcResponse) {}

  //订单明细
  rpc GetClientCustomerOrderDetailById (GetClientCustomerOrderDetailByIdRpcRequest) returns (GetClientCustomerOrderDetailByIdRpcResponse) {}
  rpc GetClientCustomerOrderDetailsByIds (GetClientCustomerOrderDetailsByIdsRpcRequest) returns (GetClientCustomerOrderDetailsByIdsRpcResponse) {}
  rpc GetClientCustomerOrderDetailsByOrderIds (GetClientCustomerOrderDetailsByOrderIdsRpcRequest) returns (GetClientCustomerOrderDetailsByOrderIdsRpcResponse) {}
  rpc CreateClientCustomerOrderDetail (CreateClientCustomerOrderDetailRpcRequest) returns (CreateClientCustomerOrderDetailRpcResponse) {}
  rpc BatchCreateClientCustomerOrderDetails (BatchCreateClientCustomerOrderDetailsRpcRequest) returns (BatchCreateClientCustomerOrderDetailsRpcResponse) {}
  rpc UpdateClientCustomerOrderDetail (UpdateClientCustomerOrderDetailRpcRequest) returns (UpdateClientCustomerOrderDetailRpcResponse) {}
  rpc BatchUpdateClientCustomerOrderDetails (BatchUpdateClientCustomerOrderDetailsRpcRequest) returns (BatchUpdateClientCustomerOrderDetailsRpcResponse) {}
  rpc DeleteClientCustomerOrderDetailsByIds (DeleteClientCustomerOrderDetailsByIdsRpcRequest) returns (DeleteClientCustomerOrderDetailsRpcResponse) {}

  // 操作记录
  rpc GetOrderOperationRecordsByOrderId (GetOrderOperationRecordsByOrderIdRequest) returns (GetOrderOperationRecordsByOrderIdResponse) {}
  rpc BatchCreateOrderOperationRecords (BatchCreateOrderOperationRecordsRequest) returns (BatchCreateOrderOperationRecordsResponse) {}
}

enum OrderStatusEnum {
  UNKNOWN_STATUS = 0;
  TO_PREPARE = 1;
  PREPARING = 2;
  PARTIAL_SERVED = 3;
  ALL_SERVED = 4;
  ORDER_CANCELED = 5;
}

enum OrderSourceEnum {
  UNKNOWN_SOURCE = 0;
  MINI_PROGRAM = 1;
  STALL = 2;
  KDS = 3;
  MIDDLE_PLATFORM = 4;
}

enum OrderTypeEnum {
  UNKNOWN_ORDER_TYPE = 0;
  DINE_IN = 1;
  DELIVERY = 2;
}

enum PayStatusEnum {
  UNKNOWN_PAY_STATUS = 0;
  TO_PAY = 1;
  IN_PROGRESS = 2;
  SUCCEED = 3;
  FAILED = 4;
  PAY_CANCELED = 5;
}

enum CloseTimeType {
  IMMEDIATELY = 0;
  RESERVATION = 1;
}

message CustomerNotice {
  repeated string avoids = 1;
  repeated string doctors = 2;
}

message SingleClientCustomerOrderRpcResponse {
  int32 id = 1;
  string orderCode = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 stallId = 5;
  int32 customerId = 6;
  string openId = 7;
  OrderStatusEnum status = 8;
  int32 menuId = 9;
  CloseTimeType closeTimeType = 10;
  int32 totalNum = 11;
  int32 payPrice = 12;
  bool onlinePay = 13;
  int64 payTime = 14;
  PayStatusEnum payStatus = 15;
  string errorMsg = 16;
  string transactionId = 17;
  int64 mealTime = 18;
  string address = 19;
  string roomNo = 20;
  string tableCode = 21;
  string pickupCode = 22;
  OrderTypeEnum orderType = 23;
  string remark = 24;
  CustomerNotice customerNoticeJson = 25;
  int32 createdBy = 26;
  int64 createdAt = 27;
  OrderSourceEnum creationSource = 28;
  int32 updatedBy = 29;
  int64 updatedAt = 30;
  OrderSourceEnum updateSource = 31;
  bool isDeleted = 32;
  bool isRead = 33;
}

message GetClientCustomerOrderByIdRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetClientCustomerOrderByIdRpcResponse {
  SingleClientCustomerOrderRpcResponse response = 1;
}

message GetClientCustomerOrdersByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetClientCustomerOrdersByIdsRpcResponse {
  repeated SingleClientCustomerOrderRpcResponse responses = 1;
}

message GetClientCustomerOrdersByCustomerIdRpcRequest {
  int32 customerId = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetClientCustomerOrdersByCustomerIdRpcResponse {
  repeated SingleClientCustomerOrderRpcResponse responses = 1;
}

message QueryClientCustomerOrdersByConditionRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterOrderCode = 2;
  string orderCode = 3;
  bool shouldFilterClientIds = 4;
  repeated int32 clientIds = 5;
  bool shouldFilterStallIds = 6;
  repeated int32 stallIds = 7;
  bool shouldFilterCustomerIds = 8;
  repeated int32 customerIds = 9;
  bool shouldFilterOpenIds = 10;
  repeated string openIds = 11;
  bool shouldFilterStatus = 12;
  OrderStatusEnum status = 13;
  bool shouldFilterMenuIds = 14;
  repeated int32 menuIds = 15;
  bool shouldFilterCloseTimeType = 16;
  CloseTimeType closeTimeType = 17;
  bool shouldFilterOnlinePay = 18;
  bool onlinePay = 19;
  bool shouldFilterPayTimeStart = 20;
  int64 payTimeStart = 21;
  bool shouldFilterPayTimeEnd = 22;
  int64 payTimeEnd = 23;
  bool shouldFilterPayStatus = 24;
  PayStatusEnum payStatus = 25;
  bool shouldFilterMealTimeStart = 26;
  int64 mealTimeStart = 27;
  bool shouldFilterMealTimeEnd = 28;
  int64 mealTimeEnd = 29;
  bool shouldFilterRoomNo = 30;
  string roomNo = 31;
  bool shouldFilterTableCode = 32;
  string tableCode = 33;
  bool shouldFilterPickupCode = 34;
  string pickupCode = 35;
  bool shouldFilterOrderType = 37;
  OrderTypeEnum orderType = 36;
  bool shouldFilterCreatedAtStart = 38;
  int64 createdAtStart = 39;
  bool shouldFilterCreatedAtEnd = 40;
  int64 createdAtEnd = 41;
  bool shouldFilterIsRead = 42;
  bool isRead = 43;
}

message QueryClientCustomerOrdersByConditionRpcResponse {
  repeated SingleClientCustomerOrderRpcResponse responses = 1;
}

message ClientCustomerOrderCreation{
  int32 clientId = 2;
  int32 stallId = 3;
  bool shouldCreateCustomerId = 4;
  int32 customerId = 5;
  bool shouldCreateOpenId = 6;
  string openId = 7;
  OrderStatusEnum status = 8;
  int32 menuId = 9;
  CloseTimeType closeTimeType = 10;
  int32 totalNum = 11;
  bool shouldCreatePayPrice = 12;
  int32 payPrice = 13;
  bool shouldCreateOnlinePay = 14;
  bool onlinePay = 15;
  bool shouldCreatePayTime = 16;
  int64 payTime = 17;
  bool shouldCreatePayStatus = 18;
  PayStatusEnum payStatus = 19;
  bool shouldCreateErrorMsg = 20;
  string errorMsg = 21;
  bool shouldCreateTransactionId = 22;
  string transactionId = 23;
  int64 mealTime = 24;
  bool shouldCreateAddress = 25;
  string address = 26;
  bool shouldCreateRoomNo = 27;
  string roomNo = 28;
  bool shouldCreateTableCode = 29;
  string tableCode = 30;
  bool shouldCreatePickupCode = 31;
  string pickupCode = 32;
  bool shouldCreateOrderType = 33;
  OrderTypeEnum orderType = 34;
  bool shouldCreateRemark = 35;
  string remark = 36;
  bool shouldCreateCustomerNoticeJson = 37;
  CustomerNotice customerNoticeJson = 38;
  bool isRead = 39;
  bool shouldCreateOrderDetails = 40;
  repeated ClientCustomerOrderDetailCreation orderDetails = 41;
}

message CreateClientCustomerOrderRpcRequest {
  ClientCustomerOrderCreation creation = 1;
  int32 enterpriseId = 2;
  int32 createdBy = 3;
  OrderSourceEnum creationSource = 4;
}

message CreateClientCustomerOrderRpcResponse {
  int32 id = 1;
  bool isCreated = 2;
}

message BatchCreateClientCustomerOrdersRpcRequest {
  repeated ClientCustomerOrderCreation creations = 1;
  int32 enterpriseId = 2;
  int32 createdBy = 3;
  OrderSourceEnum creationSource = 4;
}

message BatchCreateClientCustomerOrdersRpcResponse {
  repeated int32 ids = 1;
  bool isCreated = 2;
}

message ClientCustomerOrderModification {
  int32 id = 1;
  bool shouldUpdateOrderCode = 2;
  string orderCode = 3;
  bool shouldUpdateClientId = 4;
  int32 clientId = 5;
  bool shouldUpdateStallId = 6;
  int32 stallId = 7;
  bool shouldUpdateCustomerId = 8;
  int32 customerId = 9;
  bool shouldUpdateOpenId = 10;
  string openId = 11;
  bool shouldUpdateStatus = 12;
  OrderStatusEnum status = 13;
  bool shouldUpdateMenuId = 14;
  int32 menuId = 15;
  bool shouldUpdateCloseTimeType = 16;
  CloseTimeType closeTimeType = 17;
  bool shouldUpdateTotalNum = 18;
  int32 totalNum = 19;
  bool shouldUpdatePayPrice = 20;
  int32 payPrice = 21;
  bool shouldUpdateOnlinePay = 22;
  bool onlinePay = 23;
  bool shouldUpdatePayTime = 24;
  int64 payTime = 25;
  bool shouldUpdatePayStatus = 26;
  PayStatusEnum payStatus = 27;
  bool shouldUpdateErrorMsg = 28;
  string errorMsg = 29;
  bool shouldUpdateTransactionId = 30;
  string transactionId = 31;
  bool shouldUpdateMealTime = 32;
  int64 mealTime = 33;
  bool shouldUpdateAddress = 34;
  string address = 35;
  bool shouldUpdateRoomNo = 36;
  string roomNo = 37;
  bool shouldUpdateTableCode = 38;
  string tableCode = 39;
  bool shouldUpdatePickupCode = 40;
  string pickupCode = 41;
  bool shouldUpdateOrderType = 42;
  OrderTypeEnum orderType = 43;
  bool shouldUpdateRemark = 44;
  string remark = 45;
  bool shouldUpdateCustomerNoticeJson = 46;
  CustomerNotice customerNoticeJson = 47;
  bool shouldUpdateIsRead = 48;
  bool isRead = 49;
}

message UpdateClientCustomerOrderRpcRequest {
  ClientCustomerOrderModification modification = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  OrderSourceEnum updateSource = 4;
}

message UpdateClientCustomerOrderRpcResponse {
  bool isUpdated = 1;
}

message BatchUpdateClientCustomerOrdersRpcRequest {
  repeated ClientCustomerOrderModification modifications = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  OrderSourceEnum updateSource = 4;
}

message BatchUpdateClientCustomerOrdersRpcResponse {
  bool isUpdated = 1;
}

message DeleteClientCustomerOrdersByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  OrderSourceEnum updateSource = 4;
}

message DeleteClientCustomerOrdersRpcResponse {
  bool isDeleted = 1;
}

message MealDetail {
  string basicMaterials = 1;
  repeated string tastes = 2;
  repeated string efficacies = 3;
  repeated string dockers = 4;
  string energy = 5;
  string fat = 6;
  string protein = 7;
  string carbohydrate = 8;
  repeated string allergies = 9;
  repeated string avoids = 10;
  repeated string skus = 11;
}

message SingleClientCustomerOrderDetailRpcResponse {
  int32 id = 1;
  int32 orderId = 2;
  int32 menuDetailId = 3;
  int32 count = 4;
  int32 mealId = 5;
  int32 categoryId = 6;
  int32 skuId = 7;
  string showName = 8;
  MealDetail mealDetailJson = 9;
  int32 price = 10;
  string adjustSkuRemark = 11;
  int32 createdBy = 12;
  int64 createdAt = 13;
  OrderSourceEnum creationSource = 14;
  int32 updatedBy = 15;
  int64 updatedAt = 16;
  OrderSourceEnum updateSource = 17;
  bool isDeleted = 18;
  bool notServe = 19;
  int32 enterpriseId = 20;
}

message GetClientCustomerOrderDetailByIdRpcRequest {
  int32 id = 1;
  bool includeDeleted = 2;
}

message GetClientCustomerOrderDetailByIdRpcResponse {
  SingleClientCustomerOrderDetailRpcResponse response = 1;
}

message GetClientCustomerOrderDetailsByIdsRpcRequest {
  repeated int32 ids = 1;
  bool includeDeleted = 2;
}

message GetClientCustomerOrderDetailsByIdsRpcResponse {
  repeated SingleClientCustomerOrderDetailRpcResponse responses = 1;
}

message GetClientCustomerOrderDetailsByOrderIdsRpcRequest {
  repeated int32 orderIds = 1;
  bool includeDeleted = 2;
}

message GetClientCustomerOrderDetailsByOrderIdsRpcResponse {
  repeated SingleClientCustomerOrderDetailRpcResponse responses = 1;
}

message ClientCustomerOrderDetailCreation{
  bool shouldCreateOrderId = 1;
  int32 orderId = 2;
  int32 menuDetailId = 3;
  int32 count = 4;
  int32 mealId = 5;
  int32 categoryId = 6;
  int32 skuId = 7;
  bool shouldCreateShowName = 8;
  string showName = 9;
  bool shouldCreateMealDetailJson = 10;
  MealDetail mealDetailJson = 11;
  bool shouldCreatePrice = 12;
  int32 price = 13;
  bool shouldCreateAdjustSkuRemark = 14;
  string adjustSkuRemark = 15;
  bool notServe = 16;
}

message CreateClientCustomerOrderDetailRpcRequest {
  ClientCustomerOrderDetailCreation creation = 1;
  int32 createdBy = 2;
  OrderSourceEnum creationSource = 3;
  int32 enterpriseId = 4;
}

message CreateClientCustomerOrderDetailRpcResponse {
  int32 id = 1;
  bool isCreated = 2;
}

message BatchCreateClientCustomerOrderDetailsRpcRequest {
  repeated ClientCustomerOrderDetailCreation creations = 1;
  int32 createdBy = 2;
  OrderSourceEnum creationSource = 3;
  int32 enterpriseId = 4;
}

message BatchCreateClientCustomerOrderDetailsRpcResponse {
  repeated int32 ids = 1;
  bool isCreated = 2;
}

message ClientCustomerOrderDetailModification {
  int32 id = 1;
  bool shouldUpdateMenuDetailId = 2;
  int32 menuDetailId = 3;
  bool shouldUpdateCount = 4;
  int32 count = 5;
  bool shouldUpdateMealId = 6;
  int32 mealId = 7;
  bool shouldUpdateCategoryId = 8;
  int32 categoryId = 9;
  bool shouldUpdateSkuId = 10;
  int32 skuId = 11;
  bool shouldUpdateShowName = 12;
  string showName = 13;
  bool shouldUpdateMealDetailJson = 14;
  MealDetail mealDetailJson = 15;
  bool shouldUpdatePrice = 16;
  int32 price = 17;
  bool shouldUpdateAdjustSkuRemark = 18;
  string adjustSkuRemark = 19;
  bool shouldUpdateNotServe = 20;
  bool notServe = 21;
}

message UpdateClientCustomerOrderDetailRpcRequest {
  ClientCustomerOrderDetailModification modification = 1;
  int32 updatedBy = 2;
  OrderSourceEnum updateSource = 3;
  int32 enterpriseId = 4;
}

message UpdateClientCustomerOrderDetailRpcResponse {
  bool isUpdated = 1;
}

message BatchUpdateClientCustomerOrderDetailsRpcRequest {
  repeated ClientCustomerOrderDetailModification modifications = 1;
  int32 updatedBy = 2;
  OrderSourceEnum updateSource = 3;
  int32 enterpriseId = 4;
}

message BatchUpdateClientCustomerOrderDetailsRpcResponse {
  bool isUpdated = 1;
}

message DeleteClientCustomerOrderDetailsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 updatedBy = 2;
  OrderSourceEnum updateSource = 3;
}

message DeleteClientCustomerOrderDetailsRpcResponse {
  bool isDeleted = 1;
}

enum OrderOperationType {
  UNKNOWN_OPERATION_TYPE = 0;
  CREATE_ORDER = 1;
  CANCEL_ORDER = 2;
  REPLACE_DISHES = 3;
  ADD_DISHES = 4;
  NOT_SERVE = 5;
}

message OrderOperationRecord {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 orderId = 3;
  OrderOperationType type = 4;
  string originalOrderJson = 5;
  string adjustOrderJson = 6;
  string originalOrderDetailJson = 7;
  string adjustOrderDetailJson = 8;
  string operator = 9;
  int32 createdBy = 10;
  int64 createdAt = 11;
  OrderSourceEnum creationSource = 12;
}

message GetOrderOperationRecordsByOrderIdRequest {
  int32 enterpriseId = 1;
  int32 orderId = 2;
}

message GetOrderOperationRecordsByOrderIdResponse {
  repeated OrderOperationRecord responses = 1;
}

message OrderOperationRecordCreation {
  int32 orderId = 1;
  OrderOperationType type = 2;
  bool shouldCreateOriginalOrderJson = 3;
  string originalOrderJson = 4;
  bool shouldCreateAdjustOrderJson = 5;
  string adjustOrderJson = 6;
  bool shouldCreateOriginalOrderDetailJson = 7;
  string originalOrderDetailJson = 8;
  bool shouldCreateAdjustOrderDetailJson = 9;
  string adjustOrderDetailJson = 10;
}

message BatchCreateOrderOperationRecordsRequest {
  repeated OrderOperationRecordCreation creations = 1;
  int32 enterpriseId = 2;
  int32 createdBy = 3;
  string operator = 4;
  OrderSourceEnum creationSource = 5;
}

message BatchCreateOrderOperationRecordsResponse {
  bool isCreated = 1;
  repeated int32 ids = 2;
}