SkuServiceProtoRpc.proto 25 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 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945
syntax = "proto3";

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

package com.infoloop.tianting;

service SkuServiceProtoRpc {
  rpc GetSkusByNameForDataAdminApi(GetSkusByNameForDataAdminApiRpcRequest) returns (GetSkusByNameForDataAdminApiRpcResponse) {}
  rpc CreateBasePSku (CreateBasePSkuRpcRequest) returns (CreateBasePSkuRpcResponse) {}
  rpc GetSkuById (GetSkuByIdRpcRequest) returns (GetSkuByIdRpcResponse) {}
  rpc GetSkusByIds (GetSkusByIdsRpcRequest) returns (GetSkusByIdsRpcResponse) {}
  rpc GetSkusByIdsInMaster (GetSkusByIdsInMasterRpcRequest) returns (GetSkusByIdsInMasterRpcResponse) {}
  rpc GetPSkuByIds (GetPSkuByIdsRpcRequest) returns (GetPSkuByIdsRpcResponse) {}
  rpc GetSkusByCodes (GetSkusByCodesRpcRequest) returns (GetSkusByCodesRpcResponse) {}
  rpc GetCategoriesByIds (GetCategoriesByIdsRpcRequest) returns (GetCategoriesByIdsRpcResponse) {}
  rpc GetCategoriesByIdsInMaster (GetCategoriesByIdsInMasterRpcRequest) returns (GetCategoriesByIdsInMasterRpcResponse) {}
  rpc GetAllCategoryAdvances (GetAllCategoryAdvancesRpcRequest) returns (GetAllCategoryAdvancesRpcResponse) {}
  rpc GetAllSkus (GetAllSkusRpcRequest) returns (GetAllSkusRpcResponse) {}
  rpc GetSkusByNameOrCode (GetSkusByNameOrCodeRpcRequest) returns (GetSkusByIdsRpcResponse) {}
  rpc GetSkusByCondition (GetSkusByConditionRpcRequest) returns (GetSkusByConditionRpcResponse) {}
  rpc GetSkusByCategoryIds (GetSkusByCategoryIdsRpcRequest) returns (GetSkusByCategoryIdsRpcResponse) {}
  rpc GetPSkusByEnterpriseId (GetPSkusByEnterpriseIdRpcRequest) returns (GetPSkusByEnterpriseIdRpcResponse) {}
  rpc getCategoriesByEnterpriseId (GetCategoriesByEnterpriseIdRpcRequest) returns (GetCategoriesByIdsRpcResponse) {}
  rpc BatchUpdateSkus (BatchUpdateSkusRequest) returns (BatchUpdateSkusResponse) {}
  rpc GetCategoriesByCodes (GetCategoriesByCodesRpcRequest) returns (GetCategoriesByCodesRpcResponse) {}
  rpc GetParentCategoriesByCodes (GetParentCategoriesByCodesRpcRequest) returns (GetParentCategoriesByCodesRpcResponse) {}
  rpc BatchCreateSkus (BatchCreateSkusRpcRequest) returns (BatchCreateSkusRpcResponse) {}
  rpc BatchCreateCategories (BatchCreateCategoriesRpcRequest) returns (BatchCreateCategoriesRpcResponse) {}
  //根据编码规则获取当前编码最大的值
  rpc GetSkuMaxCodeByPrefixAndLength (GetMaxCodeByPrefixAndLengthRpcRequest) returns (GetMaxCodeByPrefixAndLengthRpcResponse) {}
  rpc GetParentCategoriesMaxCodeByPrefixAndLength (GetMaxCodeByPrefixAndLengthRpcRequest) returns (GetMaxCodeByPrefixAndLengthRpcResponse) {}
  rpc GetCategoriesMaxCodeByPrefixAndLength (GetMaxCodeByPrefixAndLengthRpcRequest) returns (GetMaxCodeByPrefixAndLengthRpcResponse) {}

  // 根据品类查菜品列表 提供三方使用
  rpc getDishSkuByCategoryIds (GetDishSkuByCategoryIdsRpcRequest) returns (GetDishSkusByCategoryIdsRpcResponse) {}
  // 根据菜品id批量查菜品详情
  rpc GetDishSkusByIds (GetSkusByIdsRpcRequest) returns (GeDishSkuByIdsRpcResponse) {}

  rpc GetSkus(GetSkusRpcRequest) returns (GetSkusRpcResponse) {}
  rpc GetSkusCount(GetSkusCountRpcRequest) returns (getSkusCountRpcResponse){}
  rpc GetEnterpriseGSkuCount (GetEnterpriseGSkuCountRpcRequest) returns (GetEnterpriseGSkuCountRpcResponse) {}
  rpc GetSkusByStandardSkuIds (GetSkusByStandardSkuIdsRpcRequest) returns (GetSkusByStandardSkuIdsRpcResponse) {}
  rpc GetSkusByEnterpriseIdsAndStandardSkus (GetSkusByEnterpriseIdsAndStandardSkusRpcRequest) returns (GetSkusByEnterpriseIdsAndStandardSkusRpcResponse) {}
  rpc UpdateSkusStandardSkus (UpdateSkusStandardSkusRpcRequest) returns (UpdateSkusStandardSkusRpcResponse) {}

  //专门用于自动生成报价脚本
  rpc GetSkusByScriptCategoryIds (GetSkusByScriptCategoryIdsRpcRequest) returns (GetSkusByScriptCategoryIdsRpcResponse) {}
  rpc GetAllCategories (GetAllCategoriesRpcRequest) returns (GetAllCategoriesRpcResponse) {}
  rpc GetSkusLikeName (GetSkusLikeNameRpcRequest) returns (GetAllSkusRpcResponse) {}
  rpc UpdateSkuTargetPrice (SkuTargetPriceUpdateRpcRequest) returns (SkuTargetPriceUpdateRpcResponse) {}
  rpc BatchEnableSkus (BatchEnableSkusRpcRequest) returns (BatchEnableSkusRpcResponse) {}
  rpc BatchDeactivateSkus (BatchDeactivateSkusRpcRequest) returns (BatchDeactivateSkusRpcResponse) {}
  rpc CountSkusByStatus (CountSkusByStatusRpcRequest) returns (CountSkusByStatusRpcResponse) {}
  rpc GetAllSkusField (GetAllSkusFieldRpcRequest) returns (GetAllSkusFieldRpcResponse) {}
  rpc GetSkusByEnterpriseId(GetSkusByEnterpriseIdRpcRequest) returns (GetSkusByEnterpriseIdRpcResponse) {}
  rpc GetPCategoriesByIds (CategoriesByIdsRpcRequest) returns (CategoriesByIdsRpcResponse) {}
  rpc GetPCategoriesById (CategoriesByIdRpcRequest) returns (CategoriesByIdRpcResponse) {}
  rpc GetPCategoriesByParentId (CategoriesByParentIdRpcRequest) returns (CategoriesByParentIdRpcResponse) {}
  rpc GetSkusFieldByIds (GetSkusFieldByIdsRpcRequest) returns (GetAllSkusFieldRpcResponse) {}
  rpc GetSkuConversionRelationByAfterConversionSkuIds (GetSkuConversionRelationsBySkuIdsRpcRequest) returns (GetSkuConversionRelationsBySkuIdsRpcResponse) {}
  rpc GetSkuConversionRelationByOriginalConversionSkuIds (GetSkuConversionRelationsBySkuIdsRpcRequest) returns (GetSkuConversionRelationsBySkuIdsRpcResponse) {}
  rpc GetAllFieldSkusByIds (GetAllFieldSkusByIdsRpcRequest) returns (GetAllFieldSkusByIdsRpcResponse) {}
}

enum SkuAttribute {
  UNKNOWN_ATTRIBUTE = 0;
  MATERIAL_ATTRIBUTE = 1;
  WORKING_ATTRIBUTE = 2;
  SET_MEAL_ATTRIBUTE = 3;
  DISH_ATTRIBUTE = 4;
}
message GeDishSkuByIdsRpcResponse {
  repeated SingleDishSkuByIdsRpcResponse response =1;
}

message SingleResponse {
  int32 id = 1;
  string name = 2;
}

message SingleSpecialResponse {
  int32 id = 1;
  string code = 2;
  string name = 3;
}

message SingleDishSkuByIdsRpcResponse {
  int32 enterpriseId = 1;
  int32 id = 2;
  string code = 3;
  string name = 4;
  string description = 5;
  int32 categoryId = 6;
  int64 createdAt = 7;
  string imageUrl = 8; // 图片
  string alias = 9;
  string basicMaterials =10; // 主料
  string fat = 11;
  string protein = 12;
  string carbohydrate = 13;
  string energy = 14;
  repeated SingleSpecialResponse allergies = 15; // 过敏源
  repeated SingleResponse tastes = 16; // 口味
  repeated SingleResponse efficacies = 17; // 功效
  repeated SingleSpecialResponse doctors = 18; // 医嘱
  repeated SingleResponse avoids = 19; // 忌口
  repeated SingleResponse skus = 20; // 配料
  repeated SingleResponse cecommends = 21;//推荐

}

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


message GetDishSkusByCategoryIdsRpcResponse {
  repeated SingleDishSkuResponse response = 1;
}

message SingleDishSkuResponse {
  int32 id = 1;
  string name = 2;
  string code = 3;
  int32 enterpriseId = 4;
  string basicMaterials =5;
  repeated string avoid = 6;

}
message GetCategoriesByCodesRpcRequest {
  repeated string codes = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}


message GetCategoriesByCodesRpcResponse {
  repeated SingleCategoryResponse response = 1;
}

message GetParentCategoriesByCodesRpcRequest {
  repeated string codes = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetParentCategoriesByCodesRpcResponse {
  repeated SingleCategoryResponse response = 1;
}

message UpdateSkusStandardSkusRpcRequest {
  int32 standardSkuId = 1;
  string standardSkuName = 2;
  repeated int32 ids = 3;
  string standardSkuConversionQuantity = 4;
  bool shouldUpdateStandardSkuConversionQuantity = 5;
}

message UpdateSkusStandardSkusRpcResponse {
  bool isUpdated = 1;
}


message GetEnterpriseGSkuCountRpcRequest {
  bool includeDeleted = 1;
  repeated int32 enterpriseIds = 2;
  bool shouldFilterEnterpriseIds = 3;
  int32 pn = 4;
  int32 pz = 5;
}

message GetEnterpriseGSkuCountRpcResponse {
  int32 count = 2;
  repeated SingleEnterpriseGSkuCountRpcResponse response = 1;
}

message GetSkusByStandardSkuIdsRpcRequest {
  repeated int32 standardSkuIds = 1;
}

message GetSkusByStandardSkuIdsRpcResponse {
  repeated SingleSkuResponse response = 1;
}

message GetSkusByEnterpriseIdsAndStandardSkusRpcRequest {
  repeated int32 enterpriseIds = 1;
  bool shouldFilterSkuIds = 2;
  repeated int32 skuIds = 3;
}

message GetSkusByEnterpriseIdsAndStandardSkusRpcResponse {
  repeated SingleSkuResponse response = 1;
}

message SingleEnterpriseGSkuCountRpcResponse {
  int32 enterprise = 1;
  int32 count = 3;
}


message SingleEnterpriseSkuAndGSkuRpcResponse {
  int32 pSkuId = 1;
  string pSkuName = 2;
  int32 enterpriseId = 3;
  string enterpriseName = 4;
  string pSkuUnit = 5;
  string pSkuBrand = 6;
  string pSkuSpecificationUnit = 7;
  int32 gSkuId = 8;
  string gSkuName = 9;
  string gSkuUnit = 10;
  string gSkuBrand = 11;
  string gSkuSpecificationUnit = 12;
}

message GetSkusRpcRequest {
  int32 status = 1;
  bool shouldFilterStatus = 10;
  int32 pn = 2;
  bool shouldFilterPn = 3;
  int32 pz = 4;
  bool shouldFilterPz = 5;
  string keyWord = 6;
  bool shouldFilterKeyWord = 7;
  repeated int32 enterpriseIds = 8;
  bool shouldFilterEnterpriseIds = 9;
}

message GetSkusRpcResponse {
  int32 count = 2;
  repeated SingleSkuResponse response = 1;
}

message GetSkusCountRpcRequest {
  bool includeDeleted = 1;
  repeated int32 enterpriseIds = 2;
}

message getSkusCountRpcResponse {
  int32 count = 1;
}

message GetSkusByCategoryIdsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 categoryIds = 2;
}

message GetSkusByCategoryIdsRpcResponse {
  repeated SinglePSkuByIdsRpcResponse response = 1;
}

message GetSkuConversionRelationsBySkuIdsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 skuIds = 2;
  bool includeDeleted = 3;
}

message SingleSkuConversionRelation {
  int32  id = 1;
  int32 originalSkuId = 2;
  int32 afterConversionSkuId = 3;
  string maxConversionQuantity = 4;
  bool isDefaultSku = 5;
  bool isSmallToBigType = 6;
}

message GetSkuConversionRelationsBySkuIdsRpcResponse {
  repeated SingleSkuConversionRelation response = 1;
}

message CategoriesByParentIdRpcRequest {
  repeated int32  ids = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
  int32 parentId = 4;
}

message CategoriesByParentIdRpcResponse {
  repeated SingleCategoryResponse response = 1;
}

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

message CategoriesByIdRpcRequest {
  int32  id = 1;
  int32 enterpriseId = 2;
}

message CategoriesByIdRpcResponse {
  SingleCategoryResponse response = 1;
}

message CategoriesByIdsRpcResponse {
  repeated SingleCategoryResponse response = 1;
}

message GetSkusByEnterpriseIdRpcRequest {
  int32 enterpriseId = 2;
  bool includeDeleted = 4;
}

message GetSkusByEnterpriseIdRpcResponse {
  repeated SinglePSkuByIdsRpcResponse response = 1;
}

message GetPSkuByIdsRpcRequest{
  repeated int32 ids = 1;
  bool includeDeleted = 4;
}

message GetPSkuByIdsRpcResponse {
  repeated SinglePSkuByIdsRpcResponse response = 1;
}

//    1: 标品2: 非标品3: 料箱isInspectionAndQuarantineTINYINT(1) 是否需要检验检疫证 0(false) YES 检验、检疫证
enum SkuType{
  UNKNOWN_SKU_TYPE = 0; //未知
  STANDARD_SKU_TYPE = 1; //标品,常温
  UN_STANDARD_SKU_TYPE = 2; //非标品
  WAREHOUSE_USE_SKU_TYPE = 3; //仓库用品
  ICE_SKU_TYPE = 4; //冻品
}

message SinglePSkuByIdsRpcResponse {
  string assistantUnit = 1;
  string brand = 2;
  string code = 8;
  int32 conversionBase = 3;
  int32 conversionQuantity = 4;
  string description = 5;
  int32 id = 6;
  string name = 7;
  string specification = 9;
  string specificationUnit = 10;
  int32 status = 11;
  int32 type = 12;
  string  unit = 13;
  int32 categoryId = 14;
  string step = 15;
  bool isCurrentPrice = 16;
  int64 createdAt = 17;
  string imageUrl = 18;
  SkuAttribute attribute = 19;
  SkuDecimalRulesMethod decimalRulesMethod = 20;
  string alias = 21;
  int32 enterpriseId = 22;
  string basicMaterials =23;
  int32 fat = 24;
  int32 protein = 25;
  int32 carbohydrate = 26;
  int32 energy = 27;
  int32 allergys = 28;
  bool isBOM = 29;
  string overentryRatio = 30;
}

//计算规则  0.四舍五入 1.进位到最小售卖量的倍数 2.舍位到最小售卖量倍数
enum SkuDecimalRulesMethod{
  ROUNDING_DECIMAL_RULE_METHOD = 0;
  CARRY_DECIMAL_RULE_METHOD = 1;
  TRUNCTION_DECIMAL_RULE_METHOD = 2;
}

message GetSkusByCodesRpcRequest {
  repeated string codes = 1;
  bool includeDeleted = 2;
  int32 enterpriseId = 3;
}

message GetSkusByCodesRpcResponse {
  repeated SingleSkuResponse response = 1;
}

message GetSkusLikeNameRpcRequest {
  int32 enterpriseId = 1;
  string name = 2;
  bool includeDeleted = 3;
}

message GetSkusByNameForDataAdminApiRpcRequest{
  string name = 1;

}

message SkuForDataAdminApiResponse{
  int32 id = 1;
  string name = 2;
  string code = 3;
  int32 enterpriseId = 4;

}

message GetSkusByNameForDataAdminApiRpcResponse{
  repeated SkuForDataAdminApiResponse skuForDataAdminApiResponse = 1;

}

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


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

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

message SingleSkuResponse {
  int32 id = 1;
  string name = 2;
  string code = 3;
  int32 enterpriseId = 4;
  int32 categoryId = 5;
  string brand = 6;
  string unit = 7;
  string specification = 8;
  int32 status = 9;
  int32 targetPrice = 10;
  string specificationUnit = 11;
  bool isCurrentPrice = 12;
  SkuAttribute attribute = 13;
  int32 expirationDuration = 14;
  int32 expirationUnit = 15;
  int32 standardSkuConversionQuantity = 16;
  int32 standardSkuId = 17;
  string standardSkuName = 18;
  string label = 19;
  string originSpecification = 20;
  bool isBom = 21;
  string description = 22;
  int32 type = 23;
  string assistantUnit = 24;
  int32 conversionBase = 25;
  int32 conversionQuantity = 26;
  int32 isInWarehouseValid =27;
  string overentryRatio = 28;
}

message SingleSkuAllFieldRpcResponse {
  int32 id = 1;
  string name = 2;
  string code = 3;
  int32 enterpriseId = 4;
  int32 categoryId = 5;
  string brand = 6;
  string unit = 7;
  string specification = 8;
  int32 status = 9;
  int32 targetPrice = 10;
  string specificationUnit = 11;
  string step = 12;
  bool isCurrentPrice = 13;
  SkuAttribute attribute = 14;
  SkuDecimalRulesMethod decimalRulesMethod = 15;
  int32 isInWarehouseValid = 16;
  string overentryRatio = 17;
}


message SingleSkuRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 categoryId = 3;
  int32 unitId = 4;
  string unit = 5;
  string code = 6;
  string name = 7;
  string alias = 8;
  string step = 9;
  string standardSkuName = 10;
  int32 standardSkuId = 11;
  string description = 12;
  string specification = 13;
  int32 specificationUnitId = 14;
  string specificationUnit = 15;
  string brand = 16;
  string origin = 17;
  int32 sort = 18;
  string imageUrl = 19;
  SkuStatus status = 20;
  string skuUnit = 21;
  bool isBench = 22;
  SkuType type = 23;
  int32 expirationDuration = 24;
  SkuExpirationUnit expirationUnit = 25;
  int32 skuTaxCategoryId = 26;
  bool isBOM = 27;
  bool isInspectionAndQuarantine = 28;
  int32 targetPrice = 29;
  int64 createdAt = 30;
  int64 updatedAt = 31;
  bool isDeleted = 32;
  string profitRate = 33;
  string pickSortName = 34;
  int32 conversionQuantity = 35;
  int32 conversionBase = 36;
  string assistantUnit = 37;
  int32 standardCodeId = 38;
  string standardCode = 39;
  string barCode = 40;
  string contentJson = 41;
  string properties = 42;
  string tags = 43;
  string dimension = 44;
  string dimensionUnit = 45;
  int32 sourceType = 46;
  int32 sourceId = 47;
  string englishName = 48;
  string traceEnterprise = 49;
  int32 traceDistrictId = 50;
  string traceSpecification = 51;
  string tracePurchaseType = 52;
  int32 weight = 53;
  string weightUnit = 54;
  int32 versionId = 55;
  int32 scanType = 56;
  string label = 57;
  bool isCurrentPrice = 58;
  SkuAttribute attribute = 59;
  SkuDecimalRulesMethod decimalRulesMethod = 60;
  bool isEnabledStep = 61;
  int32 standardSkuConversionQuantity = 62;
  string originSpecification = 63;
  string basicMaterials = 64;
  string geometricProperties = 65;
  int32 isInWarehouseValid = 66;
  string overentryRatio = 67;
}

message GetSkusByIdsRpcResponse {
  repeated SingleSkuResponse response = 1;
}

message GetAllFieldSkusByIdsRpcResponse {
  repeated SingleSkuRpcResponse response = 1;
}

message GetSkusByIdsInMasterRpcResponse {
  repeated SingleSkuResponse response = 1;
}

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

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

message SingleCategoryResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 parentId = 3;
  string code = 4;
  string name = 5;
  int32 status = 6;
  int32 standardCategoryId = 7;
  int64 createdAt = 8;
  int64 updatedAt = 9;
  bool isDeleted = 10;
  int64 deletedAt = 11;
  bool isBOM = 12;
  bool isImageSet = 13;
  string image = 14;
  int32 sourceType = 15;
  int32 sourceId = 16;
  bool isShowApp  = 17;
}

message GetCategoriesByIdsRpcResponse {
  repeated SingleCategoryResponse response = 1;
}

message GetCategoriesByIdsInMasterRpcResponse {
  repeated SingleCategoryResponse response = 1;
}

message CreateBasePSkuRpcRequest {
  int32 enterpriseId = 1;
  int32 categoryId = 2;
  string code = 3;
  string name = 4;
  int32 unitId = 5;
  string unit = 6;
  string type = 7;
  int32 createBy = 8;
  int64 createAt = 9;
  int32 createSource = 10;
}

message CreateBasePSkuRpcResponse {
  int32 id = 1;
}
message GetSkuByIdRpcRequest {
  int32 id = 1;
}

message GetSkuByIdRpcResponse {
  SingleSkuResponse response = 1;
}

message GetAllCategoryAdvancesRpcRequest {
  int32 enterpriseId = 1;
  bool needFilterClientId = 2;
  int32 clientId = 3;
  repeated int32 categoryIds = 4;
  bool includeDeleted = 5;
}

message SingleCategoryAdvanceResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 categoryId = 4;
  int32 advanceLength = 5;
  int32 status = 6;
  int64 createdAt = 7;
  int64 updatedAt = 8;
  bool isDeleted = 9;
  int64 deletedAt = 10;
}

message GetAllCategoryAdvancesRpcResponse {
  repeated SingleCategoryAdvanceResponse response = 1;
}

message GetAllSkusRpcRequest {
  int32 enterpriseId = 1;
  bool includeDeleted = 2;
}

message GetAllSkusRpcResponse {
  repeated SingleSkuResponse response = 1;
}

//专门用于自动生成报价脚本
message GetSkusByScriptCategoryIdsRpcRequest {
  bool includeDeleted = 1;
  repeated int32 categoryIds = 2;
}

message GetSkusByScriptCategoryIdsRpcResponse {
  repeated SingleSkuResponse response = 1;
}

message GetAllCategoriesRpcRequest {
  int32 enterpriseId = 1;
  bool includeDeleted = 2;
}

message GetAllCategoriesRpcResponse {
  repeated SingleCategoryResponse response = 1;
}

message SkuTargetPriceUpdateRpcRequest {
  int32 enterpriseId = 1;
  int32 id = 2;
  int32 targetPrice = 3;
}

message SkuTargetPriceUpdateRpcResponse {
  bool isUpdated = 1;
}

message BatchEnableSkusRpcRequest{
  repeated int32 ids = 1;
}

message BatchEnableSkusRpcResponse{
  bool isEnabled = 1;
}

message BatchDeactivateSkusRpcRequest{
  repeated int32 ids = 1;
}

message BatchDeactivateSkusRpcResponse{
  bool isDeactivated = 1;
}

enum SkuStatus{
  UNKNOWN_SKU_STATUS = 0;
  ENABLE_SKU_STATUS = 1;
  DEACTIVATE_SKU_STATUS = 3;
}

enum SkuExpirationUnit{
  UNKNOWN_SKU_EXPIRATION_UNIT = 0;
  YEAR_SKU_EXPIRATION_UNIT = 1;
  MONTH_SKU_EXPIRATION_UNIT = 2;
  DAY_SKU_EXPIRATION_UNIT = 3;
}

message CountSkusByStatusRpcRequest{
  repeated int32 ids = 1;
  int32 status = 2;
  bool includeDeleted = 3;
}

message CountSkusByStatusRpcResponse{
  int32 counts = 1;
}

message GetAllSkusFieldRpcRequest {
  int32 enterpriseId = 1;
  bool includeDeleted = 2;
}


message GetSkusFieldByIdsRpcRequest {
  int32 enterpriseId = 1;
  bool includeDeleted = 2;
  repeated int32 skuIds = 3;
}
message GetAllSkusFieldRpcResponse {
  repeated SingleSkuAllFieldRpcResponse response = 1;
}
message GetSkusByNameOrCodeRpcRequest{
  int32 enterpriseId = 1;
  string name = 2;
  string code = 3;
}

message GetSkusByConditionRpcRequest {
  int32 enterpriseId = 1;
  repeated string names = 2;
  bool shouldFilterNames = 3;
  repeated string codes = 4;
  bool shouldFilterCodes = 5;
  repeated int32 ids = 6;
  bool shouldFilterIds = 7;
  bool shouldFilterKeyword = 8;
  string keyword = 9;
  bool shouldFilterCategoryIds = 10;
  repeated int32 categoryIds = 11;
  bool shouldFilterAttribute = 12;
  SkuAttribute  attribute = 13;
  bool shouldFilterId = 14;
  int32 id = 15;

}

message GetSkusByConditionRpcResponse {
  repeated SinglePSkuByIdsRpcResponse response = 1;
}

message GetPSkusByEnterpriseIdRpcRequest {
  int32 enterpriseId = 1;
  bool includeDeleted = 2;
}

message GetPSkusByEnterpriseIdRpcResponse {
  repeated SingleSkuResponse responses = 1;
}

message GetCategoriesByEnterpriseIdRpcRequest{
  int32 enterpriseId = 1;
}


message SingleUpdateSkus {
  int32 id = 1;
  string label = 2;
  bool shouldUpdateLabel = 3;
  bool shouldUpdateName = 4;
  string name = 5;
  bool shouldUpdateAttribute = 6;
  int32 attribute = 7;
  bool shouldUpdateUnit = 8;
  string unit = 9;
  bool shouldUpdateBrand = 10;
  string brand = 11;
  bool shouldUpdateExpirationDuration = 12;
  int32 expirationDuration = 13;
  bool shouldUpdateExpirationUnit = 14;
  int32 expirationUnit = 15;
  bool shouldUpdateConversionQuantity = 16;
  string conversionQuantity = 17;
  bool shouldUpdateConversionBase = 18;
  string conversionBase = 19;
  bool shouldUpdateType = 20;
  int32 type = 21;
  bool shouldUpdateDescription = 22;
  string description = 23;
  bool shouldUpdateBarCode = 24;
  string barCode = 25;
  bool shouldUpdateStep = 26;
  double step = 27;
  bool shouldUpdateDecimalRulesMethod = 28;
  int32 decimalRulesMethod = 29;
  bool shouldUpdateSpecification = 30;
  string specification = 31;
  bool shouldUpdateSpecificationUnit = 32;
  string specificationUnit = 33;
  bool shouldUpdateAssistantUnit = 34;
  string assistantUnit = 35;
  bool shouldUpdateStatus = 36;
  SkuStatus status = 37;
  bool shouldUpdateCategoryId = 38;
  int32 categoryId = 39;
  string englishName = 40;
  bool shouldUpdateEnglishName = 41;
  string traceEnterprise = 42;
  bool shouldUpdateTraceEnterprise = 43;
  string pickSortName = 44;
  bool shouldUpdatePickSortName = 45;
  int32 fat = 46;
  bool shouldUpdateFat = 47;
  int32 protein = 48;
  bool shouldUpdateProtein = 49;
  int32 carbohydrate = 50;
  bool shouldUpdateCarbohydrate = 51;
  int32 energy = 52;
  bool shouldUpdateEnergy = 53;
  string imageUrl = 54;
  bool shouldUpdateImageUrl = 55;
  string basicMaterials = 56;
  bool shouldBasicMaterials = 57;
  string code = 58;
  bool shouldUpdateCode = 59;
  int32 isDeleted = 60;
  bool shouldUpdateIsDeleted = 61;
  bool shouldUpdateOverentryRatio = 62;
  string overentryRatio = 63;
}

message BatchUpdateSkusRequest {
  int32 enterpriseId = 1;
  repeated SingleUpdateSkus skus = 2;
}

message BatchUpdateSkusResponse {
  bool isUpdated = 1;
}

message BatchCreateSkusRpcRequest {
  int32 enterpriseId = 1;
  repeated SingleCreateSkusRpcRequest skus = 2;
  int32 creationSource = 3;
  int32 createdBy = 4;
}

message SingleCreateSkusRpcRequest {
  string code = 1;
  string name = 2;
  int32 categoryId = 3;
  string unit = 4;
  double step = 5;
  string description = 6;
  bool isSetSpecification = 7;
  string specification = 8;
  bool isSetSpecificationUnit = 9;
  string specificationUnit = 10;
  string brand = 11;
  int32 status = 12;
  int32 type = 13;
  bool isSetConversionQuantity = 14;
  string conversionQuantity = 15;
  bool isSetConversionBase = 16;
  string conversionBase = 17;
  bool isSetBarCode = 18;
  string barCode = 19;
  bool isSetLabel = 20;
  string label = 21;
  int32 attribute = 22;
  bool isSetAssistedUnit = 23;
  string assistedUnit = 24;
  int32 decimalRulesMethod = 25;
  bool isSetExpirationDuration = 26;
  int32 expirationDuration = 27;
  bool isSetExpirationUnit = 28;
  int32 expirationUnit = 29;
  string englishName = 30;
  bool isEnglishName = 31;
  string traceEnterprise = 32;
  bool isTraceEnterprise = 33;
  string pickSortName = 34;
  bool isPickSortName = 35;
  int32 fat = 36;
  bool isFat = 37;
  int32 protein = 38;
  bool isProtein = 39;
  int32 carbohydrate = 40;
  bool isCarbohydrate = 41;
  int32 energy = 42;
  bool isEnergy = 43;
  string imageUrl = 44;
  bool isImageUrl = 45;
  string basicMaterials = 46;
  bool isBasicMaterials = 47;
}

message BatchCreateSkusRpcResponse {
  bool isSuccessful = 1;
  repeated int32 ids = 2;
}

message BatchCreateCategoriesRpcRequest {
  int32 enterpriseId = 1;
  repeated SingleCreateCategoryRpcRequest categories = 2;
  int32 creationSource = 3;
  int32 createdBy = 4;
}

message SingleCreateCategoryRpcRequest {
  int32 parentId = 1;
  string code = 2;
  string name = 3;
  int32 status = 4;
  bool isBom = 5;
}

message BatchCreateCategoriesRpcResponse {
  bool isSuccessful = 1;
  repeated int32 ids = 2;
}

message GetMaxCodeByPrefixAndLengthRpcRequest {
  int32 enterpriseId = 1;
  string prefix = 2;
  int32 length = 3;
}

message GetMaxCodeByPrefixAndLengthRpcResponse{
  string maxCode = 1;
}