TiantingClientInventoryServiceRpc.proto 154 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 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552
syntax = "proto3";

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

package com.infoloop.tianting.clientinventoryservice;

service TiantingClientInventoryServiceRpc {
  //仓库
  rpc GetWarehouseById (SingleWarehouseGetRpcRequest) returns (SingleWarehouseGetRpcResponse);
  rpc GetWarehousesByIds (WarehousesGetRpcRequest) returns (WarehousesGetRpcResponse);
  rpc GetWarehousesByClientId (WarehousesGetAllRpcRequest) returns (WarehousesGetAllRpcResponse);
  rpc CreateWarehouse (SingleWarehouseCreateRpcRequest) returns (SingleWarehouseCreateRpcResponse);
  rpc UpdateWarehouse (SingleWarehouseUpdateRpcRequest) returns (SingleWarehouseUpdateRpcResponse);
  rpc ChangeWarehouseStatus (SingleWarehouseStatusChangeRpcRequest) returns (SingleWarehouseStatusChangeRpcResponse);
  rpc DeleteWarehouses (WarehousesDeleteRpcRequest) returns (WarehousesDeleteRpcResponse);
  rpc GetWarehousesByCondition (GetWarehousesByConditionRpcRequest) returns (GetWarehousesByConditionRpcResponse);

  //供货商
  rpc GetAllSuppliers (GetAllSuppliersRpcRequest) returns (GetAllSuppliersRpcResponse) {}
  rpc GetSupplierById (GetSupplierByIdRpcRequest) returns (GetSupplierByIdRpcResponse) {}
  rpc GetSuppliersByIds (GetSuppliersByIdsRpcRequest) returns (GetSuppliersByIdsRpcResponse) {}
  rpc GetSupplierByName (GetSupplierByNameRpcRequest) returns (GetSupplierByNameRpcResponse) {}
  rpc CreateSupplier (CreateSupplierRpcRequest) returns (CreateSupplierRpcResponse) {}
  rpc CreateSuppliers (CreateSuppliersRpcRequest) returns (CreateSuppliersRpcResponse) {}
  rpc UpdateSupplier (UpdateSupplierRpcRequest) returns (UpdateSupplierRpcResponse) {}
  rpc DeleteSuppliersByIds (DeleteSuppliersByIdsRpcRequest) returns (DeleteSuppliersByIdsRpcResponse) {}

  //库区
  rpc GetAreaById (SingleAreaGetRpcRequest) returns (SingleAreaGetRpcResponse);
  rpc GetAreas (GetAreasRpcRequest) returns (GetAreasRpcResponse);
  rpc GetAreasByIds (AreasGetByIdsRpcRequest) returns (AreasGetByIdsRpcResponse);
  rpc GetAreasByWarehouseIds (GetAreasByWarehouseIdsRpcRequest) returns (GetAreasByWarehouseIdsRpcResponse);
  rpc GetAllAreas (AllAreasGetRpcRequest) returns (AllAreasGetRpcResponse);
  rpc CreateArea (SingleAreaCreateRpcRequest) returns (SingleAreaCreateRpcResponse);
  rpc UpdateArea (SingleAreaUpdateRpcRequest) returns (SingleAreaUpdateRpcResponse);
  rpc BulkDeleteAreas (AreasBulkDeleteRpcRequest) returns (AreasBulkDeleteRpcResponse);

  //库位
  rpc GetBlock (GetBlockRpcRequest) returns (GetBlockRpcResponse);
  rpc GetBlockById (SingleBlockGetByIdRpcRequest) returns (SingleBlockGetByIdRpcResponse);
  rpc GetBlockByWarehouseIds (GetBlockByWarehouseIdsRpcRequest) returns (GetBlockByWarehouseIdsRpcResponse);
  rpc GetBlocksByIds (BlocksGetByIdsRpcRequest) returns (BlocksGetByIdsRpcResponse);
  rpc GetBlocksByAreaId (BlocksGetAllRpcRequest) returns (BlocksGetAllRpcResponse);
  rpc CreateBlock (SingleBlockCreateRpcRequest) returns (SingleBlockCreateRpcResponse);
  rpc UpdateBlock (SingleBlockUpdateRpcRequest) returns (SingleBlockUpdateRpcResponse);
  rpc DeleteBlockById (SingleBlockDeleteRpcRequest) returns (SingleBlockDeleteRpcResponse);
  rpc DeleteBlocksByIds (BlocksDeleteRpcRequest) returns (BlocksDeleteRpcResponse);
  rpc GetBlocksByClientId (BlocksGetByClientIdRpcRequest) returns (BlocksGetByClientIdRpcResponse);
  rpc GetCBlocksByIds (CBlocksGetByIdsRpcRequest) returns (CBlocksGetByIdsRpcResponse) {}

  //拆箱
  rpc CreateLegacySplitRecord(LegacyCreateSplitRecordRpcRequest) returns (LegacyCreateSplitRecordRpcResponse);

  //库存
  rpc GetStocksByIds (GetStocksByIdsRpcRequest) returns (GetStocksByIdsRpcResponse) {}

  rpc GetStockRelationsByCondition(GetStockRelationsByConditionRpcRequest) returns (GetStockRelationsByConditionRpcResponse) {}

  rpc GetStockRelationsByConditionExcludeClient(GetStockRelationsByConditionExcludeClientRpcRequest) returns (GetStockRelationsByConditionExcludeClientRpcResponse) {}

  rpc UpdateStocks (StocksUpdateRpcRequest) returns (StocksUpdateRpcResponse) {}

  rpc GetStockByStockId (SingleStockGetRpcRequest) returns (SingleStockGetRpcResponse);

  rpc UpdateStock (SingleStockUpdateRpcRequest) returns (SingleStockUpdateRpcResponse);

  rpc UpdateSkuStock (SingleSkuStockUpdateRpcRequest) returns (SingleSkuStockUpdateRpcResponse);

  rpc GetSkuStockBySkuId (SingleSkuStockGetRpcRequest) returns (SingleSkuStockGetRpcResponse);

  rpc GetRelationsByPids (RelationsGetByPidsRpcRequest) returns (RelationsGetByPidsRpcResponse) {}

  rpc GetRelationsByOrderDetailIdsAndType (RelationsGetByOrderDetailIdsAndTypeRpcRequest) returns (RelationsGetByPidsRpcResponse) {}

  rpc QueryStocks (StocksQueryRpcRequest) returns (StocksQueryRpcResponse) {}

  rpc GetStockByRelationIds (GetStockByRelationIdsRpcRequest) returns (StocksQueryRpcResponse) {}

  rpc GetStockRelationsByProcessedAtBound (StockRelationsGetByProcessedAtBoundRpcRequest) returns (StockRelationsGetByProcessedAtBoundRpcResponse) {}

  rpc RecalculateStocksAtSpecifiedTimeByOperationTime (RecalculateStocksAtSpecifiedTimeByOperationTimeRpcRequest) returns (StocksRecalculationRpcResponse) {}

  rpc QueryAllClientStocks (StocksQueryAllClientRpcRequest) returns (StocksQueryRpcResponse) {}

  rpc QueryCleanedUpStocks (CleanedUpStocksQueryRpcRequest) returns (CleanedUpStocksQueryRpcResponse) {}

  rpc RecalculateStocksAtSpecifiedTime (StocksRecalculationRpcRequest) returns (StocksRecalculationRpcResponse) {}

  rpc DataPushClients (DataPushClientsRpcRequest) returns (DataPushClientsRpcResponse) {};

  rpc RecalculateAllClientStocksAtSpecifiedTime (AllClientStocksRecalculationRpcRequest) returns (StocksRecalculationRpcResponse) {}

  rpc BulkAlterRelations (RelationsBulkAlteringRpcRequest) returns (RelationsBulkAlteringRpcResponse) {}

  rpc BulkDeleteStockRelations (StockRelationsBulkDeletionRpcRequest) returns (StockRelationsBulkDeletionRpcResponse) {}

  rpc DeleteStockRelationsByIds (DeleteStockRelationsByIdsRpcRequest) returns (DeleteStockRelationsByIdsRpcResponse) {}


  rpc RecalculateAndUpdateSubsequentRelationsByAIds (SubsequentRelationsRecalculationAndUpdateRpcRequest) returns (SubsequentRelationsRecalculationAndUpdateRpcResponse) {}

  rpc FullDebitedRecalculateRelationsByAIds (FullDebitedRecalculateRelationsUpdateRpcRequest) returns (FullDebitedRecalculateRelationsUpdateRpcResponse) {}

  rpc BulkDeleteCreditStockRelations(CreditStockRelationsBulkDeleteRpcRequest) returns (CreditStockRelationsBulkDeleteRpcResponse) {}

  rpc GetStocksByConditions (GetStocksByConditionsRpcRequest) returns (GetStocksByConditionsRpcResponse) {}

  rpc GetStockRelationsByConditions (GetStockRelationsByConditionsRpcRequest) returns (GetStockRelationsByConditionsRpcResponse) {}

  rpc UpdateStockRelationNotInWarehouse (UpdateStockRelationNotInWarehouseRpcRequest) returns (UpdateStockRelationNotInWarehouseRpcResponse) {}

  rpc GetStocksByCondition (StocksGetByConditionRpcRequest) returns (StocksGetByConditionRpcResponse) {}

  //移库
  rpc LegacyMoveStock (LegacyMoveStockRpcRequest) returns (LegacyMoveStockRpcResponse);

  //入库
  rpc GetInventoryCreditSheetsByIds (InventoryCreditSheetsGetByIdsRpcRequest) returns (InventoryCreditSheetsGetByIdsRpcResponse);
  rpc GetInventoryCreditSheetById (SingleInventoryCreditSheetGetByIdRpcRequest) returns (SingleInventoryCreditSheetGetByIdRpcResponse);
  rpc GetInventoryCreditSheetItemById (SingleInventoryCreditSheetItemGetByIdRpcRequest) returns (SingleInventoryCreditSheetItemGetByIdRpcResponse);
  rpc CreateInventoryCreditSheet (SingleInventoryCreditSheetCreateRpcRequest) returns (SingleInventoryCreditSheetCreateRpcResponse);
  rpc UpdateInventoryCreditSheet (SingleInventoryCreditSheetUpdateRpcRequest) returns (SingleInventoryCreditSheetUpdateRpcResponse);
  rpc CompleteInventoryCreditSheet (SingleInventoryCreditSheetCompleteRpcRequest) returns (SingleInventoryCreditSheetCompleteRpcResponse);
  rpc CompleteInventoryCreditSheetV2 (SingleInventoryCreditSheetCompleteRpcRequest) returns (SingleInventoryCreditSheetCompleteRpcResponse);
  rpc CompleteInventoryCreditSheets (InventoryCreditSheetsCompleteRpcRequest) returns (InventoryCreditSheetsCompleteRpcResponse);
  rpc DeleteInventoryCreditSheet (SingleInventoryCreditSheetDeleteRpcRequest) returns (SingleInventoryCreditSheetDeleteRpcResponse);
  rpc DeleteInventoryCreditSheetItem (SingleInventoryCreditSheetItemDeleteRpcRequest) returns (SingleInventoryCreditSheetItemDeleteRpcResponse);
  rpc GetInventoryCreditSheetsByOrderIds (InventoryCreditSheetByOrderIdsRpcRequest) returns (InventoryCreditSheetByOrderIdsRpcResponse);
  rpc GetInventoryCreditSheetItemsByCreditIds (InventoryCreditSheetItemsByCreditIdsRpcRequest) returns (InventoryCreditSheetItemsByCreditIdsRpcResponse);
  rpc GetInventoryCreditSheetItemsByOrderDetailIds(InventoryCreditItemsGetByOrderDetailIdsRpcRequest) returns (InventoryCreditItemsGetByOrderDetailIdsRpcResponse);


  rpc GetInventoryCreditSheetItemsByIds (InventoryCreditItemsGetByIdsRpcRequest) returns (InventoryCreditItemsGetByIdsRpcResponse) {}
  rpc GetInventoryCreditSheetsByConditions (InventoryCreditSheetsByConditionsRpcRequest) returns (InventoryCreditSheetsByConditionsRpcResponse);
  rpc GetInventoryCreditSheetAndItemsByCreditId (InventoryCreditSheetAndItemsByCreditIdRpcRequest) returns (InventoryCreditSheetAndItemsByCreditIdRpcResponse);
  rpc GetInventoryCreditSheetStatisticsByConditions (InventoryCreditSheetStatisticsByConditionsRpcRequest) returns (InventoryCreditSheetStatisticsByConditionsRpcResponse);
  rpc CreateInventoryCreditSheetAndItems (InventoryCreditSheetAndItemsCreationRpcRequest) returns (InventoryCreditSheetAndItemsCreationRpcResponse);
  rpc CreateInventoryCreditSheetAndItemsV2 (InventoryCreditSheetAndItemsV2CreationRpcRequest) returns (InventoryCreditSheetAndItemsCreationRpcResponse);
  rpc CreateInventoryCreditSheetItems (InventoryCreditSheetItemsCreationRpcRequest) returns (InventoryCreditSheetItemsCreationRpcResponse);
  rpc UpdateInventoryCreditSheetById (InventoryCreditSheetUpdateByIdRpcRequest) returns (InventoryCreditSheetUpdateByIdRpcResponse);
  rpc BatchUpdateInventoryCreditSheetItemsByIds (BatchUpdateInventoryCreditSheetItemsByIdsRpcRequest) returns (BatchUpdateInventoryCreditSheetItemsByIdsRpcResponse);
  rpc UpdateInventoryCreditSheetItemsByCreditId (InventoryCreditSheetItemsUpdateByCreditIdRpcRequest) returns (InventoryCreditSheetItemsUpdateByCreditIdRpcResponse);
  rpc DeleteInventoryCreditSheetById (SingleInventoryCreditSheetDeletionByIdRpcRequest) returns (SingleInventoryCreditSheetDeletionByIdRpcResponse);
  rpc DeleteInventoryCreditSheetItemsByIds (InventoryCreditSheetItemsDeletionByIdsRpcRequest) returns (InventoryCreditSheetItemsDeletionByIdsRpcResponse);
  rpc GetInventoryCreditSheetDetailsByOrderDetailIds(GetInventoryCreditSheetDetailsByOrderDetailIdsRpcRequest) returns (GetInventoryCreditSheetDetailsByOrderDetailIdsRpcResponse);

  //出库
  rpc BatchCreateInventoryDebitSheet (BatchCreateInventoryDebitSheetRpcRequest) returns (BatchCreateInventoryDebitSheetRpcResponse);
  rpc GetInventoryDebitSheetsByIdsV2 (InventoryDebitSheetsGetByIdsV2RpcRequest) returns (InventoryDebitSheetsGetByIdsV2RpcResponse);
  rpc GetInventoryDebitSheetsByIds (InventoryDebitSheetsGetByIdsRpcRequest) returns (InventoryDebitSheetsGetByIdsRpcResponse);
  rpc GetInventoryDebitSheetById (SingleInventoryDebitSheetGetByIdRpcRequest) returns (SingleInventoryDebitSheetGetByIdRpcResponse);
  rpc GetInventoryDebitSheetsByOrderIds (InventoryDebitSheetByOrderIdsRpcRequest) returns (InventoryDebitSheetByOrderIdsRpcResponse);
  rpc GetInventoryDebitSheetsByConditions (InventoryDebitSheetsByConditionsRpcRequest) returns (InventoryDebitSheetsByConditionsRpcResponse);
  rpc QueryInventoryDebitSheetsByConditions (QueryInventoryDebitSheetsByConditionsRpcRequest) returns (InventoryDebitSheetsByConditionsRpcResponse);
  rpc CreateInventoryDebitSheet (SingleInventoryDebitSheetCreationRpcRequest) returns (SingleInventoryDebitSheetCreationRpcResponse);
  rpc DeleteInventoryDebitSheet (SingleInventoryDebitSheetDeleteRpcRequest) returns (SingleInventoryDebitSheetDeleteRpcResponse);
  rpc CompleteInventoryDebitSheetAndItems (CompleteInventoryDebitSheetAndItemsRpcRequest) returns (CompleteInventoryDebitSheetAndItemsRpcResponse);
  rpc DeleteInventoryDebitSheetsByIds (InventoryDebitSheetsDeleteByIdsRpcRequest) returns (InventoryDebitSheetsDeleteByIdsRpcResponse);

  //出库明细
  rpc DeleteInventoryDebitSheetItems (SingleInventoryDebitSheetItemsDeletionRpcRequest) returns (SingleInventoryDebitSheetItemsDeletionRpcResponse);
  rpc UpdateInventoryDebitSheet (SingleInventoryDebitSheetUpdateRpcRequest) returns (SingleInventoryDebitSheetUpdateRpcResponse);
  rpc GetInventoryDebitSheetItemById (SingleInventoryDebitSheetItemGetByIdRpcRequest) returns (SingleInventoryDebitSheetItemGetByIdRpcResponse);
  rpc GetInventoryDebitSheetItemsBySheetIds (InventoryDebitSheetItemsBySheetIdsRpcRequest) returns (InventoryDebitSheetItemsBySheetIdsRpcResponse);
  rpc UpdateInventoryDebitSheetItems (InventoryDebitSheetItemsUpdateRpcRequest) returns (InventoryDebitSheetItemsUpdateRpcResponse);
  rpc CreateInventoryDebitSheetItems (InventoryDebitSheetItemsCreationRpcRequest) returns (InventoryDebitSheetItemsCreationRpcResponse);
  rpc DeleteInventoryDebitSheetItemsByIds (InventoryDebitSheetItemsDeletionByIdsRpcRequest) returns (InventoryDebitSheetItemsDeletionByIdsRpcResponse);
  rpc GetInventoryDebitSheetItemsByIds (InventoryDebitSheetItemsByIdsRpcRequest) returns (InventoryDebitSheetItemsByIdsRpcResponse);
  rpc GetInventoryDebitSheetItemsByIdsV2 (InventoryDebitSheetItemsGetByIdsV2RpcRequest) returns (InventoryDebitSheetItemsGetByIdsV2RpcResponse);

  //项目点
  rpc GetClientsByEnterpriseId (GetClientsByEnterpriseIdRpcRequest) returns (GetClientsByEnterpriseIdRpcResponse);
  rpc GetStallsByEnterpriseId (GetStallsByEnterpriseIdRpcRequest) returns (GetStallsByEnterpriseIdRpcResponse);
  rpc BulkCreateAndModifyInventoryCredits (BulkCreateAndModifyInventoryCreditsRpcRequest) returns (BulkCreateAndModifyInventoryCreditsRpcResponse) {};
  rpc GetClientsByParentIds (GetClientsByParentIdsRpcRequest) returns (GetClientsByParentIdsRpcResponse);
  rpc GetStallsByClientId (GetStallsByClientIdRpcRequest) returns (GetStallsByClientIdRpcResponse);
  rpc GetClientsByIds (GetClientsByIdsRpcRequest) returns (GetClientsByIdsRpcResponse);
  rpc GetClientById (GetClientByIdRpcRequest) returns (GetClientByIdRpcResponse);
  rpc UpdateClientsStatusByIds (UpdateClientsStatusByIdsRpcRequest) returns (UpdateClientsStatusByIdsRpcResponse);
  rpc UpdateClientById (UpdateClientByIdRpcRequest) returns (UpdateClientByIdRpcResponse);
  rpc GetClientsByCreationSource (ClientsGetByCreationSourceRpcRequest) returns (ClientsGetByCreationSourceRpcResponse) {}
  rpc GetPClientsByIds (GetPClientsByIdsRpcRequest) returns (GetPClientsByIdsRpcResponse){}
  rpc GetStallsByIds (GetStallsByIdsRpcRequest) returns (GetStallsByIdsRpcResponse){}
  rpc GetClientsByParentIdsAndIds (GetClientsByParentIdsAndIdsRpcRequest) returns (GetClientsByParentIdsAndIdsRpcResponse) {}
  rpc createInventoryCheckSheets (InventoryCheckSheetsCreationRpcRequest) returns (InventoryCheckSheetsCreationRpcResponse);
  rpc GetClientsByCodes (GetClientsByCodesRpcRequest) returns (GetClientsByCodesRpcResponse) {};
  rpc GetClientsByName (GetClientsByNameRpcRequest) returns (GetClientsByCodesRpcResponse) {};
  rpc GetStallsByCodes (GetStallsByCodesRpcRequest) returns (GetStallsByCodesRpcResponse) {};
  rpc GetStallsByMoneyCodes (GetStallsByMoneyCodesRpcRequest) returns (GetStallsByMoneyCodesRpcResponse) {};
  rpc GetAllStallsWithMoneyCode (GetAllStallsWithMoneyCodeRpcRequest) returns (GetStallsByMoneyCodesRpcResponse) {};
  rpc CreateClients (CreateClientsRpcRequest) returns (CreateClientsRpcResponse) {};
  rpc BatchUpdateClients (BatchUpdateClientsRpcRequest) returns (BatchUpdateClientsRpcResponse) {};
  rpc GetClientsByConditions (GetClientsByConditionsRpcRequest) returns (GetClientsByConditionsRpcResponse);

  //根据编码规则获取项目的编码最大的值
  rpc GetClientMaxCodeByPrefixAndLength (GetClientMaxCodeByPrefixAndLengthRpcRequest) returns (GetClientMaxCodeByPrefixAndLengthRpcResponse) {}
  //根据编码规则获取档口编码最大的值
  rpc GetStallMaxCodeByPrefixAndLength (GetStallMaxCodeByPrefixAndLengthRpcRequest) returns (GetStallMaxCodeByPrefixAndLengthRpcResponse) {}


  rpc GetInventoryCheckSheetById (SingInventoryCheckSheetByIdRpcRequest) returns (SingInventoryCheckSheetByIdRpcResponse);
  rpc createInventoryCheckSheet (SingleInventoryCheckSheetCreationRpcRequest) returns (SingleInventoryCheckSheetCreationRpcResponse);
  rpc GetInventoryCheckSheetsByConditions (InventoryCheckSheetsByConditionsRpcRequest) returns (InventoryCheckSheetsByConditionsRpcResponse);
  rpc UpdateInventoryCheckSheet (InventoryCheckSheetUpdateRpcRequest) returns (InventoryCheckSheetUpdateRpcResponse);
  rpc GetInventoryCheckSheets (GetInventoryCheckSheetsRpcRequest) returns (GetInventoryCheckSheetsRpcResponse);
  rpc createInventoryCheekSheetDetails (InventoryCheekSheetDetailsCreationRpcRequest) returns (InventoryCheekSheetDetailsCreationRpcResponse);
  rpc GetMostRecentCorrectionDetails (GetMostRecentCorrectionDetailsRpcRequest) returns (GetMostRecentCorrectionDetailsRpcResponse);
  rpc GetInventoryCheckSheetsByIds (GetInventoryCheckSheetsByIdsRpcRequest) returns (GetInventoryCheckSheetsByIdsRpcResponse) {}

  rpc GetInventoryCheckSheetItemById (SingleGetInventoryCheckSheetItemByIdRpcRequest) returns (SingleGetInventoryCheckSheetItemByIdRpcResponse);
  rpc GetInventoryCheckSheetItemsBySheetIds (InventoryCheckSheetItemsBySheetIdsRpcRequest) returns (InventoryCheckSheetItemsBySheetIdsRpcResponse);
  rpc GetInventoryCheckSheetItemBySheetId (InventoryCheckSheetItemBySheetIdRpcRequest) returns (InventoryCheckSheetItemBySheetIdRpcResponse);
  rpc GetInventoryCheckSheetItemsByIds (GetInventoryCheckSheetItemsByIdsRpcRequest) returns (GetInventoryCheckSheetItemsByIdsRpcResponse);
  rpc createInventoryCheckSheetAndItems (InventoryCheckSheetAndItemsCreationRpcRequest) returns (InventoryCheckSheetAndItemsCreationRpcResponse);
  rpc UpdateInventoryCheckSheetItems (InventoryCheckSheetItemsUpdateRpcRequest) returns (InventoryCheckSheetItemsUpdateRpcResponse);
  rpc BatchCreateInventoryCheckSheetItems (BatchCreateInventoryCheckSheetItemsRpcRequest) returns (BatchCreateInventoryCheckSheetItemsRpcResponse);
  rpc DeleteInventoryCheckSheetItemsByIds (DeleteInventoryCheckSheetItemsByIdsRpcRequest) returns (DeleteInventoryCheckSheetItemsByIdsRpcResponse);
  rpc GetInventoryCheckSheetItemsBySheetIdAndSkuId (GetInventoryCheckSheetItemsBySheetIdAndSkuIdRpcRequest) returns (GetInventoryCheckSheetItemsBySheetIdAndSkuIdRpcResponse);
  rpc GetInventoryCheckSheetItemsByInventoryCheekSheetIds (GetInventoryCheckSheetItemsByInventoryCheekSheetIdsRpcRequest) returns (GetInventoryCheckSheetItemsByInventoryCheekSheetIdsRpcResponse);
  //删除盘库、盘库详情、relation、回退库存(有盈亏)
  rpc DeleteInventoryCheckSheetById (InventoryCheckSheetDeleteByIdRpcRequest) returns (InventoryCheckSheetDeleteByIdRpcResponse) {}

  //移库出库明细
  rpc GetMoveStockOutWarehouseDetailsByIds (GetMoveStockOutWarehouseDetailsByIdsRpcRequest) returns (GetMoveStockOutWarehouseDetailsByIdsRpcResponse);

  //移库出库明细

  rpc GetSplitStockOutWarehouseDetailsByIds (GetSplitStockOutWarehouseDetailsByIdsRpcRequest) returns (GetSplitStockOutWarehouseDetailsByIdsRpcResponse);
  /**
    入库调整库存用,仅处理relation与库存,
    涉及到盘库的逻辑也会在这里完成
    */
  rpc Credit (CreditRpcRequest) returns (CreditRpcResponse) {option deprecated = true;}

  rpc BatchCredit (BatchCreditRpcRequest) returns (BatchCreditRpcResponse);
  /**
    出库调整库存用,仅处理relation与库存
    涉及到盘库的逻辑也会在这里完成
   */
  rpc Debit (DebitRpcRequest) returns (DebitRpcResponse) {option deprecated = true;}

  /**
    拆箱调整库存
    仅处理relation与库存,
    涉及到盘库的逻辑也会在这里完成
   */
  rpc Split (SplitStockRpcRequest) returns (SplitStockRpcResponse) {option deprecated = true;}

  rpc QueryCreditSplitRecords (CreditSplitRecordsQueryRequest) returns (CreditSplitRecordsQueryResponse);

  rpc GetDebitSplitRecordsByIds (DebitSplitRecordsGetByIdsRequest) returns (DebitSplitRecordsQueryResponse);

  /**
    盘库调整库存专用
   */
  rpc CorrectStocks (CorrectStocksRpcRequest) returns (CorrectStocksRpcResponse) {option deprecated = true;}

  // 内置完成所有逻辑,移库也会在此完成
  rpc MoveStock (MoveStockRpcRequest) returns (MoveStockRpcResponse) {}

  // 调整入库
  rpc ModifyInventoryCredits (ModifyInventoryCreditRpcRequest) returns (ModifyInventoryCreditRpcResponse) {option deprecated = true;}

  //出库
  rpc GetAllOutWarehouseOrders (OutWarehouseOrderGetAllRpcRequest) returns (OutWarehouseOrderGetAllRpcResponse) {}

  //库存relation
  rpc GetStockRelationsByOrderDetailIds (StockRelationsGetByOrderDetailIdsRpcRequest) returns (StockRelationsGetByOrderDetailIdsRpcResponse) {}

  //操作日志
  rpc GetClientInventoryOperationRecordsByCondition (GetClientInventoryOperationRecordsByConditionRpcRequest) returns (GetClientInventoryOperationRecordsByConditionRpcResponse) {}
  rpc CreateClientInventoryOperationRecord (CreateClientInventoryOperationRecordRpcRequest) returns (CreateClientInventoryOperationRecordRpcResponse) {}
  rpc CreateClientInventoryOperationRecords (CreateClientInventoryOperationRecordsRpcRequest) returns (CreateClientInventoryOperationRecordsRpcResponse) {}

  rpc GetPaginatedBatchTraceAbilityByCondition (GetPaginatedBatchTraceAbilityByConditionRpcRequest) returns (GetPaginatedBatchTraceAbilityByConditionRpcResponse) {}

  rpc GetPaginatedInventoryPurchaseSourcesByCondition (GetPaginatedInventoryPurchaseSourcesByConditionRpcRequest) returns (GetPaginatedInventoryPurchaseSourcesByConditionRpcResponse) {}

  rpc GetTraceAbilitiesByStockId (GetTraceAbilitiesByStockIdRpcRequest) returns (GetTraceAbilitiesByStockIdRpcResponse) {}

  rpc GetBatchTraceRelationsByStockId (GetBatchTraceRelationsByStockIdRpcRequest) returns (GetBatchTraceRelationsByStockIdRpcResponse) {}

  rpc GetInWarehouseSourceByStockIds(GetInWarehouseSourceByStockIdsRpcRequest) returns (GetInWarehouseSourceByStockIdsRpcResponse) {}
  //报损原因
  rpc GetDamageReasonById (GetDamageReasonByIdRpcRequest) returns (GetDamageReasonByIdRpcResponse) {}
  rpc GetDamageReasonsByIds (GetDamageReasonsByIdsRpcRequest) returns (GetDamageReasonsByIdsRpcResponse) {}
  rpc GetAllDamageReasons (GetAllDamageReasonsRpcRequest) returns (GetAllDamageReasonsRpcResponse) {}
  rpc CreateDamageReason (CreateDamageReasonRpcRequest) returns (CreateDamageReasonRpcResponse) {}
  rpc BatchCreateDamageReasons (BatchCreateDamageReasonsRpcRequest) returns (BatchCreateDamageReasonsRpcResponse) {}
  rpc UpdateDamageReason (UpdateDamageReasonRpcRequest) returns (UpdateDamageReasonRpcResponse) {}
  rpc BatchUpdateDamageReasons (BatchUpdateDamageReasonsRpcRequest) returns (BatchUpdateDamageReasonsRpcResponse) {}
  rpc DeleteDamageReasonsByIds (DeleteDamageReasonsByIdsRpcRequest) returns (DeleteDamageReasonsRpcResponse) {}

  rpc GetReturnReasonById (GetReturnReasonByIdRpcRequest) returns (GetReturnReasonByIdRpcResponse) {}
  rpc GetReturnReasonsByIds (GetReturnReasonsByIdsRpcRequest) returns (GetReturnReasonsByIdsRpcResponse) {}
  rpc GetAllReturnReasons (GetAllReturnReasonsRpcRequest) returns (GetAllReturnReasonsRpcResponse) {}
  rpc CreateReturnReason (CreateReturnReasonRpcRequest) returns (CreateReturnReasonRpcResponse) {}
  rpc BatchCreateReturnReasons (BatchCreateReturnReasonsRpcRequest) returns (BatchCreateReturnReasonsRpcResponse) {}
  rpc UpdateReturnReason (UpdateReturnReasonRpcRequest) returns (UpdateReturnReasonRpcResponse) {}
  rpc BatchUpdateReturnReasons (BatchUpdateReturnReasonsRpcRequest) returns (BatchUpdateReturnReasonsRpcResponse) {}
  rpc DeleteReturnReasonsByIds (DeleteReturnReasonsByIdsRpcRequest) returns (DeleteReturnReasonsRpcResponse) {}

  //更新补货单为入库单
  rpc UpdateReplenishmentFormOrders (ReplenishmentFormOrdersUpdateRpcRequest) returns (ReplenishmentFormOrdersUpdateRpcResponse) {}

  //采购价格版本
  rpc CreatePurchasePriceVersions (PurchasePriceVersionsCreationRpcRequest) returns (PurchasePriceVersionsCreationRpcResponse) {}
  rpc GetPurchasePriceVersionsByCondition (PurchasePriceVersionsGetByConditionRpcRequest) returns (PurchasePriceVersionsGetByConditionRpcResponse) {}
  rpc GetPurchasePriceVersionsByIds (PurchasePriceVersionsGetByIdsRpcRequest) returns (PurchasePriceVersionsGetByIdsRpcResponse) {}

  //调拨出入库关联
  rpc GetAllocationWarehouseOrderRefsByCondition (GetAllocationWarehouseOrderRefsByConditionRpcRequest) returns (GetAllocationWarehouseOrderRefsByConditionRpcResponse) {}
  rpc BatchCreateAllocationWarehouseOrderRefs (BatchCreateAllocationWarehouseOrderRefsRpcRequest) returns (BatchCreateAllocationWarehouseOrderRefsRpcResponse) {}
  rpc BatchUpdateAllocationWarehouseOrderRefs (BatchUpdateAllocationWarehouseOrderRefsRpcRequest) returns (BatchUpdateAllocationWarehouseOrderRefsRpcResponse) {}

  //库存流水
  rpc BatchCreateCStockRelations (BatchCreateCStockRelationsRpcRequest) returns (BatchCreateCStockRelationsRpcResponse) {}

  //桌码
  rpc GetClientTableCodeById (GetClientTableCodeByIdRpcRequest) returns (GetClientTableCodeByIdRpcResponse) {}
  rpc GetClientTableCodesByIds (GetClientTableCodesByIdsRpcRequest) returns (GetClientTableCodesByIdsRpcResponse) {}
  rpc QueryClientTableCodesByCondition (QueryClientTableCodesByConditionRpcRequest) returns (QueryClientTableCodesByConditionRpcResponse) {}
  rpc CreateClientTableCode (CreateClientTableCodeRpcRequest) returns (CreateClientTableCodeRpcResponse) {}
  rpc BatchCreateClientTableCodes (BatchCreateClientTableCodesRpcRequest) returns (BatchCreateClientTableCodesRpcResponse) {}
  rpc UpdateClientTableCode (UpdateClientTableCodeRpcRequest) returns (UpdateClientTableCodeRpcResponse) {}
  rpc BatchUpdateClientTableCodes (BatchUpdateClientTableCodesRpcRequest) returns (BatchUpdateClientTableCodesRpcResponse) {}
  rpc DeleteClientTableCodesByIds (DeleteClientTableCodesByIdsRpcRequest) returns (DeleteClientTableCodesRpcResponse) {}
}

enum ClientInventoryCreditFailure {
  UNKNOWN_CREDIT_FAILURE = 0;
  NEGATIVE_CREDIT_VALUE_INVENTORY_CREDIT_FAILURE = 1;
}

enum ClientModifyInventoryCreditFailure {
  UNKNOWN_MODIFY_INVENTORY_CREDIT_FAILURE = 0;
  NEGATIVE_CREDIT_VALUE_MODIFY_INVENTORY_CREDIT_FAILURE = 1;
}

enum ClientModifyInventoryDebitFailure {
  UNKNOWN_MODIFY_INVENTORY_DEBIT_FAILURE = 0;
  NEGATIVE_CREDIT_VALUE_MODIFY_INVENTORY_DEBIT_FAILURE = 1;
}

enum BatchClientInventoryCreditFailure {
  UNKNOWN_BATCH_CREDIT_FAILURE = 0;
  NEGATIVE_BATCH__CREDIT_VALUE_INVENTORY_CREDIT_FAILURE = 1;
}

enum ClientInventoryDebitFailure {
  UNKNOWN_DEBIT_FAILURE = 0;
  // 出库时剩余库存不足
  INSUFFICIENT_CURRENT_STOCK_DEBIT_FAILURE = 1;
  // 当时有库存,但出了之后剩余库存不足以给下个出库使用
  INSUFFICIENT_STOCK_FOR_FUTURE_DEBIT_FAILURE = 2;
  // 指定出库的批次不存在,非调用方逻辑严重错误时不会发生
  SPECIFIED_WSTOCK_DOES_NOT_EXIST_DEBIT_FAILURE = 3;
  // 出库数量为非负数
  NONE_NEGATIVE_VALUE_INVENTORY_DEBIT_FAILURE = 4;
}

enum ClientInventoryCorrectionFailure {
  UNKNOWN_CORRECTION_FAILURE = 0;
  SPECIFIED_WSTOCK_DOES_NOT_EXIST_CORRECTION_FAILURE = 1;
  // 盘库后库存不足以给下个出库使用
  INSUFFICIENT_STOCK_FOR_FUTURE_CORRECTION_FAILURE = 2;
  // 每个stock在一次盘库中只能被指定一次
  DUPLICATED_STOCK_CORRECTION_SPECIFICATION_CORRECTION_FAILURE = 3;
  // 盘库后为负数
  NEGATIVE_QUANTITY_AFTER_CORRECTION_CORRECTION_FAILURE = 4;
  // 计算后的剩余数量不符合指定的sku盘库终值
  ACTUAL_LEFT_SKU_QUANTITY_NOT_MATCHING_EXPECTED_CORRECTION_FAILURE = 5;
}


//  1: 显示 2:隐藏3: 取消/删除4: 已盘库5: 已确认
enum CheckWarehouseOrderStatus {
  UNKNOWN_CHECK_WAREHOUSE_ORDER_STATUS = 0;
  INIT_CHECK_WAREHOUSE_ORDER_STATUS = 1;
  HIDE_CHECK_WAREHOUSE_ORDER_STATUS = 2;
  CANCEL_CHECK_WAREHOUSE_ORDER_STATUS = 3;
  COMPLETED_CHECK_WAREHOUSE_ORDER_STATUS = 4;
  CONFIRM_CHECK_WAREHOUSE_ORDER_STATUS = 5;
}

enum StockStatus {
  UNKNOWN_STOCK_STATUS = 0;
  VISIBLE_STOCK_STATUS = 1;
}

enum CorrectSheetType {
  INITIAL = 0;
  NORMAL = 1;
  CHANGED = 2;
}

enum CStockRelationStatus {
  UNKNOWN_RELATION_STATUS = 0;
  INIT_RELATION_STATUS = 1;
  COMPLETED_RELATION_STATUS = 10;
  GONE_TO_EXTENDS_RELATION_STATUS = 11;
  GONE_TO_EXTENDS_BY_OPERATION_TIME_RELATION_STATUS = 12;
}

enum CStockRelationType {
  UNKNOWN_RELATION_TYPE = 0;
  DEBIT_RELATION_TYPE = 1;
  CREDIT_RELATION_TYPE = 2;
  CORRECTION_RELATION_TYPE = 4;
  SPLIT_DEBIT_RELATION_TYPE = 8;
  SPLIT_CREDIT_RELATION_TYPE = 9;
  MOVE_DEBIT_RELATION_TYPE = 12;
  MOVE_CREDIT_RELATION_TYPE = 13;
}

//出库 --------start-----------
message SingleInventoryDebitSheetItemsDeletionRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message SingleInventoryDebitSheetItemsDeletionRpcResponse {
  bool isDeleted = 1;
  string errorMessage = 2;
}

message SingleInventoryDebitSheetUpdateRpcRequest {
  int32 inventoryDebitSheetId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string code = 4;
  int32 warehouseId = 5;
  bool isWarehouseIdSet = 6;
  string warehouseName = 7;
  bool isWarehouseNameSet = 8;
  string destination = 9;
  bool isDestinationSet = 10;
  int32 applyOpId = 11;
  bool isApplyOpIdSet = 12;
  string applyOpName = 13;
  bool isApplyOpNameSet = 14;
  int32 outWarehouseOpId = 15;
  bool isOutWarehouseOpIdSet = 16;
  string outWarehouseOpName = 17;
  bool isOutWarehouseOpNameSet = 18;
  int64 preOutDate = 19;
  bool isPreOutDateSet = 20;
  int64 outDate = 21;
  bool isOutDateSet = 22;
  int32 pickOpId = 23;
  bool isPickOpIdSet = 24;
  string pickOpName = 25;
  bool isPickOpNameSet = 26;
  InventoryDebitSheetType outWarehouseType = 27;
  InventoryDebitSheetApproveStatus approveStatus = 28;
  int32 damageReasonId = 29;
  bool isDamageReasonIdSet = 30;
  string damageReason = 31;
  bool isDamageReasonSet = 32;
  int32 returnReasonId = 33;
  bool isReturnReasonIdSet = 34;
  string returnReason = 35;
  bool isReturnReasonSet = 36;
  InventoryDebitSheetStatus status = 37;
  string note = 38;
  bool isNoteSet = 39;
  //  int64 updatedAt = 40;
  int32 destinationId = 41;
  bool isDestinationIdSet = 42;
  string guid = 43;
  bool isGuidSet = 44;
  int32 approveOpId = 45;
  bool isApproveOpIdSet = 46;
  string approveOpName = 47;
  bool isApproveOpNameSet = 48;
  int64 approveDate = 49;
  bool isApproveDateSet = 50;
  int32 genSource = 51;
  bool isGenSourceSet = 52;
}

message SingleInventoryDebitSheetUpdateRpcResponse {
  bool isUpdated = 1;
}
message CreditSplitRecordsQueryRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int64 operationDateLowerBound = 3;
  int64 operationDateUpperBound = 4;
  repeated int32 warehouseIds = 5;
}

message DebitSplitRecordsGetByIdsRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 ids = 3;
}

message SingleCreditSplitRecordsQueryResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  string code = 5;
  int32 warehouseId = 6;
  int32 blockId = 7;
  int32 areaId = 9;
  string sumPrice = 10;
  string price = 11;
  string creditBatch = 12;
  string debitBatch = 13;
  int32 debitRecordId = 14;
  int32 skuId = 15;
  string creditQuantity = 16;
  int64 creditDate = 17;
  int32 operatorId = 18;
  string operatorName = 19;
}

message DebitSplitRecordsQueryResponse {
  repeated SingleDebitSplitRecordsQueryResponse records = 1;
}

message SingleDebitSplitRecordsQueryResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  string code = 5;
  int32 warehouseId = 6;
  int32 blockId = 7;
  int32 areaId = 8;
  string sumPrice = 9;
  string price = 10;
  string creditBatch = 11;
  string debitBatch = 12;
  int32 skuId = 13;
  string debitQuantity = 14;
  int64 debitDate = 15;
  int32 operatorId = 16;
  string operatorName = 17;
}

message CreditSplitRecordsQueryResponse {
  repeated SingleCreditSplitRecordsQueryResponse records = 1;
}

message RelationsGetByPidsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 relationPids = 3;
}

message RelationsGetByOrderDetailIdsAndTypeRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 orderDetailIds = 3;
  CStockRelationType type = 4;
}


message RelationsGetByPidsRpcResponse {
  repeated SingleCStockRelationRpcResponse relations = 1;
}

message StocksQueryRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int64 time = 3;
  bool shouldFilterWarehouses = 4;
  repeated int32 warehouseIds = 5;
  bool shouldFilterAreas = 6;
  repeated int32 areaIds = 7;
  bool shouldFilterBlocks = 8;
  repeated int32 blockIds = 9;
  bool shouldFilterSkus = 10;
  repeated int32 skuIds = 11;
}

message GetStockByRelationIdsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool shouldFilterClientId = 3;
  repeated int32 relationIds = 4;
}

message RecalculateStocksAtSpecifiedTimeByOperationTimeRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool shouldFilterClientId = 3;
  int64 time = 4;
}

message StocksQueryAllClientRpcRequest {
  int32 enterpriseId = 1;
  int64 time = 2;
  bool shouldFilterWarehouses = 3;
  repeated int32 warehouseIds = 4;
  bool shouldFilterAreas = 5;
  repeated int32 areaIds = 6;
  bool shouldFilterBlocks = 7;
  repeated int32 blockIds = 8;
  bool shouldFilterSkus = 9;
  repeated int32 skuIds = 10;
  bool shouldFilterClientIds = 11;
  repeated int32 clientIds = 12;
}

message StocksQueryRpcResponse {
  repeated SingleCStockRpcResponse stocks = 1;
}

message CleanedUpStocksQueryRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool shouldFilterCleanedUpDateByLowerBound = 3;
  int64 cleanedUpDateLowerBound = 4;
  bool shouldFilterCleanedUpDateByUpperBound = 5;
  int64 cleanedUpDateUpperBound = 6;
  bool shouldFilterStorageDateByLowerBound = 7;
  int64 storageDateLowerBound = 8;
  bool shouldFilterStorageDateByUpperBound = 9;
  int64 storageDateUpperBound = 10;
  bool shouldFilterWarehouses = 11;
  repeated int32 warehouseIds = 12;
  bool shouldFilterAreas = 13;
  repeated int32 areaIds = 14;
  bool shouldFilterBlocks = 15;
  repeated int32 blockIds = 16;
  bool shouldFilterSkus = 17;
  repeated int32 skuIds = 18;
}

message CleanedUpStocksQueryRpcResponse {
  repeated SingleCStockRpcResponse stocks = 1;
}

message StocksRecalculationRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int64 time = 3;
  repeated int32 relationPids = 4;
  int32 decimalPlace = 5;
}

message AllClientStocksRecalculationRpcRequest {
  int32 enterpriseId = 1;
  int64 time = 2;
  repeated int32 relationPids = 3;
  int32 decimalPlace = 4;
}

message StocksRecalculationRpcResponse {
  repeated SingleRecalculatedStockRpcResponse recalculatedStocks = 1;
}

message SingleRecalculatedStockRpcResponse {
  int32 pid = 1;
  string quantity = 2;
  string totalPrice = 3;
}

message RelationsBulkAlteringRpcRequest {
  int32 source = 1;
  int32 operatorId = 2;
  string operatorName = 3;
  int32 enterpriseId = 4;
  // int32 clientId = 5;
  // 限制同仓库,防止搜寻盘库明细的数据量过大
  repeated int32 warehouseIds = 6;
  repeated SingleCreditRelationAlteringRpcRequest creditAlterings = 7;
  repeated SingleDebitReplacementRpcRequest debitReplacings = 8;
  repeated SingleDebitRelationQuantityAlteringRpcRequest debitAlterings = 9;
  int32 decimalPlace = 10;
  repeated int32 removeRelationIds = 11;
}

message SingleCreditRelationAlteringRpcRequest {
  int32 relationId = 1;
  string quantity = 2;
  string totalPrice = 3;
  int32 clientId = 4;
  bool isFullDebited = 5;
  string price = 6;
}

message SingleDebitRelationQuantityAlteringRpcRequest {
  int32 relationId = 1;
  string quantity = 2;
  string totalPrice = 3;
  int32 clientId = 4;
  bool isFullDebited = 5;
  string price = 6;
}

message SingleDebitReplacementRpcRequest {
  int32 relationIdToReplace = 1;
  int32 stockIdToReplaceWith = 2;
  string quantity = 3;
  int32 clientId = 4;
  bool isFullDebited = 5;
}

enum RelationsBulkAlteringFailure {
  UNKNOWN_RELATION_BULK_ALTERING_FAILURE = 0;
  // relation id只能出现一次,不然有内在逻辑矛盾
  CONFLICTING_RELATIONS_SPECIFIED_BULK_ALTERING_FAILURE = 1;
  // specified stock does not exist
  SPECIFIED_STOCK_DOES_NOT_EXIT_BULK_ALTERING_FAILURE = 2;
  // 指定的流水与指定调整的逻辑不匹配,如入库指定了非入库流水、出库指定了非出库流水、仓库对不上等
  INCORRECT_SPECIFIED_RELATIONS_BULK_ALTERING_FAILURE = 3;
  // 可用库存不足
  INSUFFICIENT_STOCK_BULK_ALTERING_FAILURE = 4;
}

message RelationsBulkAlteringRpcResponse {
  bool isSuccessful = 1;
  RelationsBulkAlteringFailure failure = 2;
  string errorMessage = 3;
  repeated SingleCStockRelationRpcResponse relations = 4;
  repeated int32 insufficientStockIds = 5;
}

message StockRelationsBulkDeletionRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 debitRelationIds = 3;
  int32 decimalPlace = 4;
}

message DeleteStockRelationsByIdsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 ids = 2;
}

message DeleteStockRelationsByIdsRpcResponse {
  bool isDeleted = 1;
}

enum StockRelationsBulkDeletionFailure {
  UNKNOWN_STOCK_RELATIONS_BULK_DELETION_FAILURE = 0;
  INCORRECT_SPECIFIED_DEBIT_RELATIONS_STOCK_RELATIONS_BULK_DELETION_FAILURE = 1;
  RELATION_TO_DELETE_HAS_FOLLOWING_CORRECTIONS_STOCK_RELATIONS_BULK_DELETION_FAILURE = 2;
}

message StockRelationsBulkDeletionRpcResponse {
  bool isSuccessful = 1;
  StockRelationsBulkDeletionFailure failure = 2;
  string errorMessage = 3;
}

message SubsequentRelationsRecalculationAndUpdateRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated SingleAncestorRelationUpdateRpcRequest updates = 3;
  int32 decimalPlace = 4;
  int32 updatedBy = 5;
  int32 updateSource = 6;
}

message FullDebitedRecalculateRelationsUpdateRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated SingleAncestorRelationUpdateRpcRequest updates = 3;
  int32 decimalPlace = 4;
  int32 updatedBy = 5;
  int32 updateSource = 6;
}

message SingleAncestorRelationUpdateRpcRequest {
  int32 relationId = 1;
  bool shouldUpdateQuantity = 2;
  string quantity = 3;
  bool shouldUpdateTotalPrice = 4;
  string totalPrice = 5;
  bool shouldUpdatePrice = 6;
  string price = 7;
}

enum SubsequentRelationsRecalculationAndUpdateFailure {
  UNKNOWN_SUBSEQUENT_RELATIONS_RECALCULATION_AND_UPDATE_FAILURE = 0;
  SPECIFIED_AID_DOES_NOT_MATCH_SUBSEQUENT_RELATIONS_RECALCULATION_AND_UPDATE_FAILURE = 1;
  INCORRECT_NUMBER_OR_NEGATIVE_QUANTITY_OR_NEGATIVE_PRICE_SUBSEQUENT_RELATIONS_RECALCULATION_AND_UPDATE_FAILURE = 2;
  INSUFFICIENT_STOCK_SUBSEQUENT_RELATIONS_RECALCULATION_AND_UPDATE_FAILURE = 3;
}
enum CreditStockRelationsBulkDeleteFailure {
  UNKNOWN_CREDIT_STOCK_RELATIONS_BULK_DELETE_FAILURE = 0;
  NOT_ALLOWED_DELETE_CREDIT_STOCK_RELATIONS_BULK_DELETE_FAILURE = 1;
}

message CreditStockRelationsBulkDeleteRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 creditRelationIds = 3;
}

message CreditStockRelationsBulkDeleteRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  CreditStockRelationsBulkDeleteFailure failure = 3;
}

message SubsequentRelationsRecalculationAndUpdateRpcResponse {
  bool isSuccessful = 1;
  SubsequentRelationsRecalculationAndUpdateFailure failure = 2;
  string errorMessage = 3;
}

message FullDebitedRecalculateRelationsUpdateRpcResponse {
  bool isSuccessful = 1;
  SubsequentRelationsRecalculationAndUpdateFailure failure = 2;
  string errorMessage = 3;
}

message SingleInventoryDebitSheetItemGetByIdRpcRequest {
  int32 inventoryDebitSheetId = 1;
  int32 id = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
}

message SingleInventoryDebitSheetItemGetByIdRpcResponse {
  SingleInventoryDebitSheetItemRpcResponse singleInventoryDebitSheetItemRpcResponse = 1;
}

message InventoryDebitSheetItemsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message InventoryDebitSheetItemsByIdsRpcResponse {
  repeated SingleInventoryDebitSheetItemRpcResponse response = 1;
}

message SingleInventoryDebitSheetItemRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 outWarehouseOrderId = 4;
  int32 skuId = 5;
  string skuCode = 6;
  string skuName = 7;
  string skuAlias = 8;
  string skuUnit = 9;
  string skuSpecification = 10;
  string skuSpecificationUnit = 11;
  string categoryName = 12;
  int32 supplierSourceId = 13;
  string supplierSource = 14;
  string preOutQuantity = 15;
  string realOutQuantity = 16;
  int64 productDate = 17;
  int64 expirationDate = 18;
  string wblockId = 19;
  string wblockCode = 20;
  string wblockName = 21;
  int32 purchasePriceVersionId = 22;
  string purchasePriceVersionCode = 23;
  string batch = 24;
  int32 wstockId = 25;
  InventoryDebitSheetItemStatus status = 26;
  int64 createdAt = 27;
  int64 updatedAt = 28;
  int64 deletedAt = 29;
  string guid = 30;
}

message InventoryDebitSheetItemsBySheetIdsRpcRequest {
  int32 enterpriseId = 1;
  bool isEnterpriseIdSet = 2;
  repeated int32 clientIds = 3;
  bool isClientIdsSet = 4;
  repeated int32 debitSheetIds = 5;
  bool isDebitSheetIdsSet = 6;
}

message InventoryDebitSheetItemsBySheetIdsRpcResponse {
  repeated SingleInventoryDebitSheetItemRpcResponse singleInventoryDebitSheetItemRpcResponse = 1;
}

message InventoryDebitSheetItemsUpdateRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 outWarehouseOrderId = 4;
  repeated SingleInventoryDebitSheetItemUpdateRpcRequest singleInventoryDebitItemUpdateRpcRequest = 3;
}

message SingleInventoryDebitSheetItemUpdateRpcRequest {
  int32 id = 1;
  int32 skuId = 3;
  bool isSkuIdSet = 4;
  string preOutQuantity = 5;
  bool isPreOutQuantitySet = 6;
  int64 updatedAt = 7;
  string realOutQuantity = 8;
  bool isRealOutQuantitySet = 9;
}

message InventoryDebitSheetItemsUpdateRpcResponse {
  bool isUpdated = 1;
}

message InventoryDebitSheetItemsCreationRpcRequest {
  int32 outWarehouseOrderId = 2;
  int32 enterpriseId = 4;
  int32 clientId = 3;
  repeated SingleInventoryDebitSheetItemCreationRpcRequest singleInventoryDebitSheetItemCreationRpcRequest = 1;
}

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

message InventoryDebitSheetItemsDeletionByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}
message InventoryDebitSheetItemsDeletionByIdsRpcResponse {
  bool isDeleted = 1;
  string errorMessage = 2;
}
//------------end
message SingleCreditRpcRequest {
  int32 detailId = 1;
  int32 debitDetailId = 2;
  string debitDetailGuid = 26;
  string detailGuid = 3;
  int32 skuId = 4;
  int32 blockId = 5;
  int32 areaId = 6;
  string produceUnit = 7;
  int64 productDate = 8;
  int64 expirationDate = 9;
  int32 cableTicket = 10;
  string quantity = 11;
  string price = 12;
  string sumPrice = 13;
  int32 purchasePriceId = 14;
  bool isFullDebited = 15;
  bool hasProduceUnit = 16;
  bool hasCableTicket = 17;
  string purchasePriceVerCode = 18;
  int32 purchasePriceVerId = 19;
  string maxStock = 20;
  string minStock = 21;
  string maxWarnStock = 22;
  string minWarnStock = 23;
  int32 inWarehouseSourceId = 24;
  string inWarehouseSource = 25;
}

message SingleBatchCreditRpcRequest {
  int32 sheetId = 1;
  int32 detailId = 2;
  string detailGuid = 3;
  int32 debitDetailId = 4;
  string debitDetailGuid = 26;
  int32 warehouseId = 5;
  int32 skuId = 6;
  int32 blockId = 7;
  int32 areaId = 8;
  string produceUnit = 9;
  int64 productDate = 10;
  int64 expirationDate = 11;
  int32 cableTicket = 12;
  string quantity = 13;
  string price = 14;
  string sumPrice = 15;
  int32 purchasePriceId = 16;
  bool isFullDebited = 17;
  bool hasProduceUnit = 18;
  bool hasCableTicket = 19;
  string purchasePriceVerCode = 20;
  int32 purchasePriceVerId = 21;
  string maxStock = 22;
  string minStock = 23;
  string maxWarnStock = 24;
  string minWarnStock = 25;
  int64 processedAt = 27;
  int32 inWarehouseSourceId = 28;
  string inWarehouseSource = 29;
}

message CreditRpcRequest {
  int32 creator = 1;
  int32 source = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 warehouseId = 5;
  CStockRelationType type = 6;
  repeated SingleCreditRpcRequest credits = 7;
  int32 decimalPlace = 8;
  int64 processedAt = 9;
  int32 orderId = 10;
}

message BatchCreditRpcRequest {
  int32 creator = 1;
  int32 source = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  CStockRelationType type = 5;
  repeated SingleBatchCreditRpcRequest credits = 6;
  int32 decimalPlace = 7;
}

message SingleBatchCreditItemRpcRequest {
  int32 detailId = 1;
  string detailGuid = 2;
  int32 skuId = 3;
  int32 blockId = 4;
  int32 areaId = 20;
  string produceUnit = 5;
  int64 productDate = 6;
  int64 expirationDate = 7;
  int32 cableTicket = 8;
  string quantity = 9;
  string price = 10;
  string sumPrice = 11;
  int32 purchasePriceId = 12;
  bool isFullDebited = 13;
  bool hasProduceUnit = 14;
  bool hasCableTicket = 15;
  string purchasePriceVerCode = 18;
  int32 purchasePriceVerId = 19;
}

message SingleModifyInventoryCreditRpcRequest {
  int32 detailId = 1;
  int32 skuId = 2;
  int32 relationId = 3;
  // 数量增减量
  int32 quantity = 5;
}

message ModifyInventoryCreditRpcRequest {
  int32 creator = 1;
  int32 source = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  repeated SingleModifyInventoryCreditRpcRequest modifyInventoryCredit = 5;
  int32 decimalPlace = 6;
}


message ModifyInventoryCreditRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  ClientModifyInventoryCreditFailure failure = 3;
  repeated SingleCStockRelationRpcResponse relations = 4;
  repeated SingleCStockRpcResponse stocks = 5;
}


message SingleModifyInventoryDebitRpcRequest {
  int32 detailId = 1;
  int32 skuId = 2;
  int32 relationId = 3;
  // 数量增减量
  int32 quantity = 5;
}

message ModifyInventoryDebitRpcRequest {
  int32 creator = 1;
  int32 source = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  repeated SingleModifyInventoryCreditRpcRequest modifyInventoryDebit = 5;
  int32 decimalPlace = 6;
}


message ModifyInventoryDebitRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  ClientModifyInventoryDebitFailure failure = 3;
  repeated SingleCStockRelationRpcResponse relations = 4;
  repeated SingleCStockRpcResponse stocks = 5;
}


message BatchCreditRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  ClientInventoryCreditFailure failure = 3;
  repeated SingleCStockRelationRpcResponse relations = 4;
  repeated SingleCStockRpcResponse stocks = 5;
}


message CreditRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  ClientInventoryCreditFailure failure = 3;
  repeated SingleCStockRelationRpcResponse relations = 4;
  repeated SingleCStockRpcResponse stocks = 5;
}

message SingleDebitRpcRequest {
  int32 wstockId = 1;
  int32 detailId = 2;
  string detailGuid = 3;
  int32 skuId = 4;
  //出库的所有数量填负数
  string quantity = 5;
  bool isFullDebited = 6;
}

message DebitRpcRequest {
  int32 creator = 1;
  int32 source = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 warehouseId = 5;
  CStockRelationType type = 6;
  repeated SingleDebitRpcRequest debits = 7;
  int32 decimalPlace = 8;
  int64 processedAt = 9;
}

message DebitRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  ClientInventoryDebitFailure failure = 3;
  // 返回新增的流水及剩下的库存
  repeated SingleCStockRelationRpcResponse relations = 4;
  repeated SingleCStockRpcResponse stocks = 5;
}

message SingleCStockRelationRpcResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 warehouseId = 5;
  int32 orderDetailId = 6;
  string orderDetailGuid = 7;
  int32 skuId = 8;
  int32 wBlockId = 9;
  int32 wStockId = 10;
  string produceUnit = 11;
  int64 productDate = 12;
  int64 expirationDate = 13;
  int32 cableTicket = 14;
  string quantity = 15;
  int32 purchasePriceVersionId = 17;
  int32 purchasePriceId = 18;
  string purchasePriceVersionGuid = 19;
  CStockRelationType type = 20;
  CStockRelationStatus status = 21;
  int64 processedAt = 22;
  int64 createdAt = 23;
  int64 updatedAt = 24;
  bool isDeleted = 25;
  int64 operationTime = 26;
  string sumPrice = 27;
  string price = 28;
  int32 pId = 29;
  int32 aId = 30;
  bool isFullDebited = 31;
  string batch = 32;
  int32 base = 33;
}

message SingleMoveStockItemRpcRequest {
  int32 moveOutWStockId = 1;
  string moveOutQuantity = 2;
  string moveInQuantity = 3;
  int32 moveInWarehouseId = 4;
  int32 moveInWAreaId = 6;
  int32 moveInWBlockId = 7;
}

message MoveStockRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  SingleMoveStockItemRpcRequest item = 4;
  int32 decimalPlace = 5;
  int64 processedAt = 6;
  int32 creator = 7;
  int32 source = 8;
  int32 operatorId = 9;
  string operatorName = 10;
}

message MoveStockRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  ClientInventoryStockMoveFailure failure = 3;
  SingleCStockRelationRpcResponse debitRelation = 4;
  SingleCStockRelationRpcResponse creditRelation = 5;
  SingleCStockRpcResponse stock = 6;
  SingleStockMoveCreditRpcResponse creditRecord = 7;
  SingleStockMoveDebitRpcResponse debitRecord = 8;
}


enum ClientInventoryStockMoveFailure {
  UNKNOWN_STOCK_MOVE_FAILURE = 0;
  SPECIFIED_WSTOCK_DOES_NOT_EXIST_STOCK_MOVE_FAILURE = 1;
  // 剩余库存不足
  INSUFFICIENT_STOCK_STOCK_MOVE_FAILURE = 2;
  // 出库非负数或入库非正数
  NEGATIVE_CREDIT_QUANTITY_OR_POSITIVE_DEBIT_QUANTITY_STOCK_MOVE_FAILURE = 3;
}

message SingleSplitStockItemRpcRequest {
  int32 stockId = 1;
  string debitQuantity = 2;
  int32 creditSkuId = 3;
  int32 debitSkuId = 4;
  int32 creditWarehouseId = 5;
  int32 creditWAreaId = 6;
  int32 creditWBlockId = 7;
  string creditQuantity = 8;
}

message SplitStockRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  SingleSplitStockItemRpcRequest item = 3;
  int32 decimalPlace = 4;
  string creator = 5;
  int32 source = 6;
  int64 processedAt = 7;
  int32 operatorId = 8;
  string operatorName = 9;
  int32 warehouseId = 10;
}


enum  ClientInventorySpitFailure {
  UNKNOWN_SPIT_FAILURE = 0;
  // 出库时剩余库存不足
  INSUFFICIENT_CURRENT_STOCK_SPLIT_FAILURE = 1;
  // 当时有库存,但出了之后剩余库存不足以给下个出库使用
  INSUFFICIENT_STOCK_FOR_FUTURE_SPLIT_FAILURE = 2;
  // 指定出库的批次不存在,非调用方逻辑严重错误时不会发生
  SPECIFIED_WSTOCK_DOES_NOT_EXIST_SPLIT_FAILURE = 3;
  // 出库数量为非负数
  NEGATIVE_CREDIT_QUANTITY_OR_POSITIVE_DEBIT_QUANTITY_SPIT_FAILURE = 4;
}

message SplitStockRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  ClientInventorySpitFailure failure = 3;
  int32 splitDebitId = 4;
  int32 splitCreditId = 5;
  SingleCStockRpcResponse stock = 6;
  SingleCStockRelationRpcResponse debitRelation = 7;
  SingleCStockRelationRpcResponse creditRelation = 8;
}

message SingleCorrectStockRpcRequest {
  int32 stockId = 1;
  string correctedDelta = 2;
}

message SingleSkuCorrectStockRpcRequest {
  int32 skuId = 1;
  int32 detailId = 2;
  string detailGuid = 3;
  string correctedQuantity = 4;
  repeated SingleCorrectStockRpcRequest corrections = 5;
}

message CorrectStocksRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  repeated SingleSkuCorrectStockRpcRequest skuStockCorrections = 4;
  int32 decimalPlace = 5;
  int32 creator = 6;
  int32 source = 7;
  int64 processedAt = 8;
}

message CorrectStocksRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  ClientInventoryCorrectionFailure failure = 3;
  repeated SingleCStockRelationRpcResponse relations = 4;
}




//仓库 ------start------
enum WarehouseType {
  WAREHOUSE_TYPE_UNKNOW = 0;
  SUPPLIER = 1;
  WAREHOUSE = 2;
  CLIENT_SUPPLIER = 3;
}

enum WarehouseStatus {
  WAREHOUSE_STATUS_UNKNOW = 0;
  SHOWN = 1;
  HIDDEN = 2;
  DISABLED = 3;
}

message SingleWarehouseRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string email = 4;
  string code = 5;
  WarehouseType type = 6;
  string name = 7;
  string contact = 8;
  string phone = 9;
  string note = 10;
  string country = 11;
  string province = 12;
  string city = 13;
  string area = 14;
  string address = 15;
  WarehouseStatus status = 16;
  int64 createdAt = 17;
  int64 updatedAt = 18;
  bool isDeleted = 19;
  string guid = 20;
}

message SingleWarehouseGetRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message SingleWarehouseGetRpcResponse {
  SingleWarehouseRpcResponse response = 1;
}

message WarehousesGetRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  bool includeDeleted = 4;
}

message WarehousesGetRpcResponse {
  repeated SingleWarehouseRpcResponse responses = 1;
}

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

message WarehousesGetByEnterpriseIdRpcResponse {
  repeated SingleWarehouseRpcResponse response = 1;
}

message WarehousesGetAllRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool includeDeleted = 3;
}

message WarehousesGetAllRpcResponse {
  repeated SingleWarehouseRpcResponse responses = 1;
}

message SingleWarehouseCreateRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  string email = 3;
  string code = 4;
  int32 type = 5;
  string name = 6;
  string contact = 7;
  string phone = 8;
  string note = 9;
  string country = 10;
  string province = 11;
  string city = 12;
  string area = 13;
  string address = 14;
  int32 status = 15;
  string guid = 17;
}

message SingleWarehouseCreateRpcResponse {
  bool isCreated = 1;
  int32 warehouseId = 2;
}

message SingleWarehouseUpdateRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string email = 4;
  bool isEmailSet = 5;
  string code = 6;
  bool isCodeSet = 7;
  int32 type = 8;
  bool isTypeSet = 9;
  string name = 10;
  bool isNameSet = 11;
  string contact = 12;
  bool isContactSet = 13;
  string phone = 14;
  bool isPhoneSet = 15;
  string note = 16;
  bool isNoteSet = 17;
  string country = 18;
  bool isCountrySet = 19;
  string province = 20;
  bool isProvinceSet = 21;
  string city = 22;
  bool isCitySet = 23;
  string area = 24;
  bool isAreaSet = 25;
  string address = 26;
  bool isAddressSet = 27;
  int32 status = 28;
  bool isStatusSet = 29;
  string guid = 30;
  int64 timeAt = 31;
  int32 source = 32;
  int32 updater = 33;
}

message SingleWarehouseUpdateRpcResponse {
  bool isUpdated = 1;
}

message SingleWarehouseStatusChangeRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 status = 4;
  int32 source = 5;
  int32 updater = 6;
}

message SingleWarehouseStatusChangeRpcResponse {
  bool isUpdated = 1;
}

message WarehousesDeleteRpcRequest {
  int32 source = 1;
  int32 deleter = 2;
  repeated int32 ids = 3;
  int32 enterpriseId = 4;
  int32 clientId = 5;
}

message GetAllSuppliersRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool includeStallId = 3;
  int32 stallId = 4;
  bool includeDeleted = 5;
}

message SingleSupplierRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 stallId = 4;
  string email = 5;
  string code = 6;
  WarehouseType type = 7;
  string name = 8;
  string contact = 9;
  string phone = 10;
  string note = 11;
  string country = 12;
  string province = 13;
  string city = 14;
  string area = 15;
  string address = 16;
  WarehouseStatus status = 17;
  int64 createdAt = 18;
  int64 updatedAt = 19;
  bool isDeleted = 20;
  string guid = 21;
}

message GetAllSuppliersRpcResponse {
  repeated SingleSupplierRpcResponse responses = 1;
}

message GetSupplierByIdRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 id = 3;
}

message GetSupplierByIdRpcResponse {
  SingleSupplierRpcResponse response = 1;
}

message GetSuppliersByIdsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 ids = 3;
  bool includeDeleted = 4;
}

message GetSuppliersByIdsRpcResponse {
  repeated SingleSupplierRpcResponse responses = 1;
}

message GetSupplierByNameRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool includeStallId = 3;
  int32 stallId = 4;
  string name = 5;
}

message GetSupplierByNameRpcResponse {
  repeated SingleSupplierRpcResponse responses = 1;
}

message CreateSupplierRpcRequest {
  SingleCreateSupplierRpcRequest request = 1;
}

message SingleCreateSupplierRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 stallId = 3;
  string name = 4;
}

message CreateSupplierRpcResponse {
  bool isCreated = 1;
}

message CreateSuppliersRpcRequest {
  repeated SingleCreateSupplierRpcRequest request = 1;
}

message CreateSuppliersRpcResponse {
  bool isCreated = 1;
}

message UpdateSupplierRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string name = 4;
}

message UpdateSupplierRpcResponse {
  bool isUpdated = 4;
}

message DeleteSuppliersByIdsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 ids = 3;
}

message DeleteSuppliersByIdsRpcResponse {
  bool isDeleted = 1;
}

message WarehousesDeleteRpcResponse {
  bool isDeleted = 1;
}

message GetWarehousesByConditionRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 9;
  repeated int32 ids = 2;
  bool shouldFilterIds = 3;
  repeated string codes = 4;
  bool shouldFilterCodes = 5;
  repeated string names = 6;
  bool shouldFilterNames = 7;
  bool includeDeleted = 8;
  int32 type = 10;
  bool shouldFilterType = 11;
}

message GetWarehousesByConditionRpcResponse {
  repeated SingleWarehouseRpcResponse responses = 1;
}


//仓库 ------end------

//库区 ------start------

enum AreaType {
  AREA_TYPE_UNSET = 0;
  AREA_TYPE_UNORMAL = 1;
  AREA_TYPE_UABNORMAL = 2;
}

enum AreaStatus {
  AREA_STATUS_UNKNOWN_AREA_STATUS = 0;
  AREA_STATUS_DISPLAY = 1;
  AREA_STATUS_HIDE = 2;
}

message SingleAreaGetRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  bool includeDeleted = 5;
}

message GetAreasRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool includeDeleted = 3;
}

message GetAreasRpcResponse {
  repeated SingleAreaRpcResponse responses = 2;
}

message AreasGetByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  bool includeDeleted = 5;
}

message GetAreasByWarehouseIdsRpcRequest {
  int32 enterpriseId = 2;
  int32 clientId = 3;
  repeated  int32 warehouseId = 4;
  bool includeDeleted = 5;
}

message GetAreasByWarehouseIdsRpcResponse {
  repeated SingleAreaRpcResponse responses = 2;
}

message AllAreasGetRpcRequest {
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  bool includeDeleted = 5;
}

message SingleAreaRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  string code = 5;
  string name = 6;
  string description = 7;
  AreaType type = 8;
  AreaStatus status = 9;
  string note = 10;
  int64 createdAt = 11;
  int64 updatedAt = 12;
  bool isDeleted = 13;
  string guid = 14;
}

message SingleAreaGetRpcResponse {
  SingleAreaRpcResponse response = 1;
}

message AreasGetByIdsRpcResponse {
  int32 count = 1;
  repeated SingleAreaRpcResponse responses = 2;
}

message AllAreasGetRpcResponse {
  int32 count = 1;
  repeated SingleAreaRpcResponse responses = 2;
}


message SingleAreaCreateRpcRequest {
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  string code = 5;
  string name = 6;
  string description = 7;
  AreaType type = 8;
  AreaStatus status = 9;
  string note = 10;
  string guid = 14;
  int32 creator = 15;
  int32 creationSource = 16;
}

message SingleAreaCreateRpcResponse {
  bool isCreated = 1;
  int32 id = 2;
  string errorMessage = 3;
}

message SingleAreaUpdateRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  string code = 5;
  bool isCodeSet = 6;
  string name = 7;
  bool isNameSet = 8;
  string description = 9;
  bool isDescriptionSet = 10;
  AreaType type = 11;
  bool isTypeSet = 12;
  AreaStatus status = 13;
  string note = 14;
  int32 updator = 15;
  int32 updationSource = 16;
}

message SingleAreaUpdateRpcResponse {
  bool isUpdated = 1;
  string errorMessage = 2;
}

message AreasBulkDeleteRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 deleter = 5;
  int32 deletionSource = 6;
}

message AreasBulkDeleteRpcResponse {
  bool isDeleted = 1;
  string errorMessage = 2;
}

//库区 ------end-------

//库位 ------start------
enum BlockType {
  BLOCK_TYPE_UNKNOW = 0;
  BLOCK_NORMAL = 1;
  BLOCK_ABNORMAL = 2;
}

enum BlockStatus {
  BLOCK_STATUS_UNKNOW = 0;
  BLOCK_SHOWN = 1;
  BLOCK_HIDDEN = 2;
  BLOCK_DISABLED = 3;
}

message SingleBlockRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 areaId = 5;
  string code = 6;
  string name = 7;
  int32 isNormal = 8;
  BlockType type = 9;
  BlockStatus status = 10;
  string description = 11;
  string note = 12;
  int64 createdAt = 13;
  int64 updatedAt = 14;
  bool isDeleted = 15;
  string guid = 16;
}

message GetBlockRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool includeDeleted = 3;
}

message GetBlockRpcResponse {
  repeated SingleBlockRpcResponse response = 1;
}

message SingleBlockGetByIdRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 areaId = 5;
}

message SingleBlockGetByIdRpcResponse {
  SingleBlockRpcResponse response = 1;
}

message BlocksGetByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 areaId = 5;
  bool includeDeleted = 6;
}

message GetBlockByWarehouseIdsRpcRequest {
  int32 enterpriseId = 2;
  int32 clientId = 3;
  repeated int32 warehouseId = 4;
}

message GetBlockByWarehouseIdsRpcResponse {
  repeated SingleBlockRpcResponse responses = 1;
}

message BlocksGetByIdsRpcResponse {
  repeated SingleBlockRpcResponse responses = 1;
}

message BlocksGetAllRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  int32 areaId = 4;
  bool includeDeleted = 5;
}

message BlocksGetAllRpcResponse {
  repeated SingleBlockRpcResponse responses = 1;
}

message SingleBlockCreateRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  int32 areaId = 4;
  string code = 5;
  string name = 6;
  int32 isNormal = 7;
  int32 type = 8;
  int32 status = 9;
  string description = 10;
  string note = 11;
  string guid = 12;
  int32 source = 13;
  int32 creator = 14;
}

message SingleBlockCreateRpcResponse {
  bool isCreated = 1;
  int32 blockId = 2;
}

message SingleBlockUpdateRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 areaId = 5;
  string code = 6;
  string name = 7;
  int32 isNormal = 8;
  int32 type = 9;
  int32 status = 10;
  int32 source = 11;
  int32 updater = 12;
}

message SingleBlockUpdateRpcResponse {
  bool isUpdated = 1;
}

message SingleBlockDeleteRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 areaId = 5;
  int32 source = 6;
  int32 deleter = 7;
}

message SingleBlockDeleteRpcResponse {
  bool isDeleted = 1;
}

message BlocksDeleteRpcRequest {
  repeated int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 areaId = 5;
  int32 source = 6;
  int32 deleter = 7;
}

message BlocksDeleteRpcResponse {
  bool isDeleted = 1;
}

message BlocksGetByClientIdRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool includeDeleted = 3;
}

message BlocksGetByClientIdRpcResponse {
  repeated SingleBlockRpcResponse responses = 1;
}

message CBlocksGetByIdsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool includeDeleted = 3;
  repeated int32 ids = 4;
}

message CBlocksGetByIdsRpcResponse {
  repeated SingleBlockRpcResponse responses = 1;
}
//库位 ------end------

//入库 ------start------
enum InventoryCreditSheetType {
  INVENTORY_CREDIT_SHEET_TYPE_UNKNOWN = 0;
  SYNC_ORDER = 1;
  REPLENISHMENT = 2;
  PURCHASE = 3;
  ALLOCATION = 4;
  SYNC_REPLENISHMENT = 5;
  OTHER = 9;
}

enum InventoryCreditSheetStatus {
  INVENTORY_CREDIT_SHEET_STATUS_UNKNOWN = 0;
  INVENTORY_CREDIT_SHEET_SHOWN = 1;
  INVENTORY_CREDIT_SHEET_HIDDEN = 2;
  INVENTORY_CREDIT_SHEET_DISABLED = 3;
}

enum ApproveStatus {
  APPROVE_STATUS_UNKNOWN = 0;
  UNAPPROVED = 1;
  APPROVED = 3;
}

enum GenSource {
  GENSOURCE_UNKNOWN = 0;
  SOURCE_CREATED = 1;
  SOURCE_SYNC_ORDER = 2;
  SOURCE_SYNC_REPLENISHMENT = 3;
}

enum UnReadMark {
  READ = 0;
  UNREAD = 1;
}

enum CableTicket {
  CABLE_TICKET_UNKNOW = 0;
  YES = 1;
  NO = 3;
}

enum Base {
  BASE_UNKNOW = 0;
  DEBIT = -1;
  CREDIT = 1;
}

enum IsFullDebited {
  FALSE = 0;
  TRUE = 1;
}

enum CreditSheetStatus {
  CRIDITSHEET_STATUS_UNKNOW = 0;
  CRIDITSHEET_SHOWN = 1;
  CRIDITSHEET_HIDDEN = 2;
  CRIDITSHEET_DISABLED = 3;
}

message SingleInventoryCreditSheetItemRpcResponse {
  int32 inventoryCreditSheetItemId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 InWarehouseOrderId = 4;
  int32 skuId = 5;
  string skuCode = 6;
  string skuName = 7;
  string skuAlias = 8;
  string skuUnit = 9;
  string skuSpecification = 10;
  string skuSpecificationUnit = 11;
  string categoryName = 12;
  string prePurchaseQuantity = 13;
  string realPurchaseQuantity = 14;
  string realInStock = 15;
  int32 purchasePriceVersionId = 16;
  string purchasePriceVersionCode = 17;
  string produceUnit = 18;
  int64 productDate = 19;
  int64 expirationDate = 20;
  string shelfLife = 21;
  string wblockId = 22;
  string wblockCode = 23;
  string wblockName = 24;
  int64 createdAt = 25;
  int64 updatedAt = 26;
  bool isDeleted = 27;
  int32 cableTicket = 28;
  string taxRate = 29;
  int32 replenishId = 30;
  string inWarehouseOrderGuid = 31;
  string guid = 32;
  int32 orderDetailId = 33;
  int32 increment = 34;
  bool isInWarehouse = 35;
  int64 storeDate = 36;
  string sumPrice = 37;
  string temperature = 38;
  string price = 39;
}

message SingleInventoryCreditSheetItemGetByIdRpcRequest {
  int32 inventoryCreditSheetId = 1;
  int32 inventoryCreditSheetItemId = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
}

message SingleInventoryCreditSheetItemGetByIdRpcResponse {
  SingleInventoryCreditSheetItemRpcResponse response = 1;
}

enum InventoryDebitSheetType {
  UNKNOWN_DEBIT_TYPE = 0;
  ORDER_DEBIT_TYPE = 1;
  LOSS_STOCK_DEBIT_TYPE = 2;
  RETURN_ORDER_DEBIT_TYPE = 3;
  ALLOCATION_DEBIT_TYPE = 4;
  OTHER_DEBIT_TYPE = 9;
}

enum InventoryDebitSheetStatus {
  INVENTORY_DEBIT_SHEET_STATUS_UNKNOWN = 0;
  INVENTORY_DEBIT_SHEET_SHOWN = 1;
  INVENTORY_DEBIT_SHEET_HIDDEN = 2;
  INVENTORY_DEBIT_SHEET_DISABLED = 3;
}

enum InventoryDebitSheetApproveStatus {
  INVENTORY_DEBIT_SHEET_UNKNOWN = 0;
  INVENTORY_DEBIT_SHEET_NO_APPROVAL = 1;
  INVENTORY_DEBIT_SHEET_IN_EXAMINATION_AND_APPROVAL = 2;
  INVENTORY_DEBIT_SHEET_PASS = 3;
  INVENTORY_DEBIT_SHEET_REFUSE = 4;
}

enum OutWarehouseSource{
  MANUAL_CREATION = 0; //手动创建
  RETURN_UPDATE = 1; //退货更新
  ORDER_FULFILLMENT = 2; //订单满进满出
  SELF_PROCUREMENT_FULFILLMENT = 3; //自采满进满出
  TRANSFER_FULFILLMENT = 4; //调拨满进满出
  REPLENISHMENT_FULFILLMENT = 5; //补货满进满出
  OTHER_FULFILLMENT = 6; //其它满进满出
  OUTBOUND_ADJUSTMENT = 7; //出库调整
}

message SingleInventoryDebitSheetRpcResponse {
  int32 inventoryDebitSheetId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string code = 4;
  int32 warehouseId = 5;
  string warehouseName = 6;
  string destination = 7;
  int32 applyOpId = 8;
  string applyOpName = 9;
  int32 outWarehouseOpId = 10;
  string outWarehouseOpName = 11;
  int64 preOutDate = 12;
  int64 outDate = 13;
  int32 pickOpId = 14;
  string pickOpName = 15;
  InventoryDebitSheetType outWarehouseType = 16;
  InventoryDebitSheetApproveStatus approveStatus = 17;
  int32 damageReasonId = 18;
  string damageReason = 19;
  int32 returnReasonId = 20;
  string returnReason = 21;
  InventoryDebitSheetStatus status = 22;
  string note = 23;
  int64 createdAt = 24;
  int64 updatedAt = 25;
  int64 deletedAt = 26;
  int32 destinationId = 27;
  string guid = 28;
  int32 approveOpId = 29;
  string approveOpName = 30;
  int64 approveDate = 31;
  int32 genSource = 32;
}

message SingleInventoryDebitSheetGetByIdRpcRequest {
  int32 inventoryDebitSheetId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message SingleInventoryDebitSheetGetByIdRpcResponse {
  SingleInventoryDebitSheetRpcResponse response = 1;
}

message InventoryDebitSheetsGetByIdsRpcRequest {
  repeated int32 inventoryDebitSheetIds = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message InventoryDebitSheetsGetByIdsRpcResponse {
  repeated SingleInventoryDebitSheetRpcResponse response = 1;
}

message InventoryDebitSheetByOrderIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  bool includeDeleted = 5;
}

message InventoryDebitSheetByOrderIdsRpcResponse {
  repeated SingleInventoryDebitSheetRpcResponse responses = 1;
}

message InventoryDebitSheetsByConditionsRpcRequest {
  InventoryDebitSheetApproveStatus approveStatus = 1;
  bool isInventoryDebitSheetApproveStatusSet = 2;
  string outDateLowerBound = 3;
  bool isOutDateLowerBoundSet = 4;
  string outDateUpperBound = 5;
  bool isOutDateUpperBoundSet = 6;
  InventoryDebitSheetType outWarehouseType = 7;
  bool isInventoryDebitSheetTypeSet = 8;
  int32 warehouseId = 9;
  bool isWarehouseIdSet = 10;
  int32 pz = 11;
  int32 pn = 12;
  string keyword = 13;
  bool isKeywordSet = 14;
  int32 enterpriseId = 15;
  repeated int32 clientIds = 16;
  bool isClientIdSet = 17;
}

message QueryInventoryDebitSheetsByConditionsRpcRequest {
  InventoryDebitSheetApproveStatus approveStatus = 1;
  bool isInventoryDebitSheetApproveStatusSet = 2;
  int64 startDate = 3;
  bool isStartDateSet = 4;
  int64 endDate = 5;
  bool isEndDateSet = 6;
  InventoryDebitSheetType outWarehouseType = 7;
  bool isInventoryDebitSheetTypeSet = 8;
  repeated int32 warehouseIds = 9;
  bool isWarehouseIdsSet = 10;
  bool isIdsSet = 11;
  repeated int32 ids = 12;
  int32 enterpriseId = 13;
  repeated int32 clientIds = 14;
  bool isClientIdSet = 15;
  bool includeDeleted = 16;
  bool shouldFilterDestinationIds = 17;
  repeated int32 destinationIds = 18;
  bool shouldFilterOutWarehouseTypes = 19;
  repeated InventoryDebitSheetType outWarehouseTypes = 20;
}


message InventoryDebitSheetsByConditionsRpcResponse {
  repeated SingleInventoryDebitSheetRpcResponse response = 1;
}

message SingleInventoryDebitSheetItemCreationRpcRequest {
  int32 skuId = 1;
  bool IsSkuIdSet = 2;
  string skuCode = 3;
  bool isSkuCodeSet = 4;
  string skuName = 5;
  bool isSkuNameSet = 6;
  string skuAlias = 7;
  bool isSkuAliasSet = 8;
  string skuUnit = 9;
  bool isSkuUnitSet = 10;
  string skuSpecification = 11;
  bool isSkuSpecificationSet = 12;
  string skuSpecificationUnit = 13;
  bool isSkuSpecificationUnitSet = 14;
  string categoryName = 15;
  bool isCategoryNameSet = 16;
  int32 supplierSourceId = 17;
  bool isSupplierSourceIdSet = 18;
  string supplierSource = 19;
  bool isSupplierSourceSet = 20;
  string preOutQuantity = 21;
  bool isPreOutQuantitySet = 22;
  string realOutQuantity = 23;
  bool isRealOutQuantitySet = 24;
  int64 productDate = 25;
  bool isProductDateSet = 26;
  int64 expirationDate = 27;
  bool isExpirationDateSet = 28;
  string wblockId = 29;
  bool isWblockIdSet = 30;
  string wblockCode = 31;
  bool isWblockCodeSet = 32;
  string wblockName = 33;
  bool isWblockNameSet = 34;
  int32 purchasePriceVersionId = 35;
  bool isPurchasePriceVersionIdSet = 36;
  string purchasePriceVersionCode = 37;
  bool isPurchasePriceVersionCodeSet = 38;
  string batch = 39;
  bool isBatchSet = 40;
  int32 wstockId = 41;
  bool isWstockIdSet = 42;
  InventoryDebitSheetItemStatus status = 43;
  string guid = 44;
}

message BatchCreateInventoryDebitSheetRpcRequest {
  repeated SingleInventoryDebitSheetCreationRpcRequest creations = 1;
}

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

message SingleInventoryDebitSheetCreationRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  string code = 3;
  int32 warehouseId = 4;
  string warehouseName = 5;
  bool isWarehouseNameSet = 6;
  string destination = 7;
  bool isDestinationSet = 8;
  int32 applyOpId = 9;
  string applyOpName = 10;
  bool isApplyOpNameSet = 11;
  int32 outWarehouseOpId = 12;
  bool isOutWarehouseOpIdSet = 13;
  string outWarehouseOpName = 14;
  bool isOutWarehouseOpNameSet = 15;
  int64 preOutDate = 16;
  bool isPreOutDateSet = 17;
  int64 outDate = 18;
  bool isOutDateSet = 19;
  int32 pickOpId = 20;
  bool isPickOpIdSet = 21;
  string pickOpName = 22;
  bool isPickOpNameSet = 23;
  InventoryDebitSheetType outWarehouseType = 24;
  InventoryDebitSheetApproveStatus approveStatus = 25;
  int32 damageReasonId = 26;
  bool isDamageReasonIdSet = 27;
  string damageReason = 28;
  bool isDamageReasonSet = 29;
  int32 returnReasonId = 30;
  bool isReturnReasonIdSet = 31;
  string returnReason = 32;
  bool isReturnReasonSet = 33;
  InventoryDebitSheetStatus status = 34;
  string note = 35;
  bool isNoteSet = 36;
  int32 destinationId = 39;
  bool isDestinationIdSet = 40;
  string guid = 41;
  int32 approveOpId = 42;
  bool isApproveOpIdSet = 43;
  string approveOpName = 44;
  bool isApproveOpNameSet = 45;
  int64 approveDate = 46;
  bool isApproveDateSet = 47;
  int32 genSource = 48;
  bool isGenSourceSet = 49;
  int32 outWarehouseSource = 51;
  bool isOutWarehouseSourceSet = 52;
  repeated SingleInventoryDebitSheetItemCreationRpcRequest inventoryDebitSheetItemCreationRpcRequest = 50;
}

message SingleInventoryDebitSheetCreationRpcResponse {
  bool isCreated = 1;
  int32 id = 2;
  string isSuccessful = 3;
}

message SingleInventoryDebitSheetDeleteRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message SingleInventoryDebitSheetDeleteRpcResponse {
  bool isDeleted = 1;
  string errorMessage = 2;
}

message SingleInventoryCreditSheetRpcResponse {
  int32 inventoryCreditSheetId = 1;
  int32 approveStatus = 2;
  string code = 21;
  int64 storeDate = 22;
  int32 orderId = 23;
  string orderCode = 24;
  int64 deliveryDate = 25;
  int64 applyDate = 26;
  int32 approveOpId = 27;
  string approveOpName = 28;
  int64 approveDate = 29;
  int32 genSource = 30;
  int32 status = 31;
  int64 createdAt = 32;
  int64 updatedAt = 33;
  string credentialImgs = 34;
  int32 enterpriseId = 35;
  int32 clientId = 36;
  int32 warehouseId = 3;
  string warehouseName = 4;
  int32 stallId = 5;
  int64 preStoreDate = 6;
  int32 applyOpId = 7;
  string applyOpName = 8;
  string inWarehouseOpName = 9;
  string inWarehouseSource = 10;
  int32 inWarehouseSourceId = 11;
  InventoryCreditSheetType inWarehouseType = 12;
  string note = 13;
  string purchaseOpName = 14;
  string guid = 15;
}

message SingleInventoryCreditSheetGetByIdRpcRequest {
  int32 inventoryCreditSheetId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message SingleInventoryCreditSheetGetByIdRpcResponse {
  SingleInventoryCreditSheetRpcResponse response = 1;
}

message InventoryCreditItemCreationRpcRequest {
  int32 skuId = 1;
  string quarantineCertificates = 2;
  int64 expirationDate = 3;
  string produceUnit = 4;
  int64 productDate = 5;
  int32 blockId = 6;
  bool isFullDebited = 7;
  string price = 8;
  int32 quantity = 9;
  string guid = 10;
}

message InventoryCreditItemUpdateRpcRequest {
  int32 detailId = 1;
  int32 skuId = 2;
  string quarantineCertificates = 3;
  int64 expirationDate = 4;
  string produceUnit = 5;
  int64 productDate = 6;
  int32 blockId = 7;
  int32 areaId = 8;
  bool isFullDebited = 9;
  string price = 10;
  string quantity = 11;
  CableTicket cableTicket = 12;
}

message SingleInventoryCreditSheetCreateRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  string warehouseName = 4;
  int32 stallId = 5;
  int64 preStoreDate = 6;
  int32 applyOpId = 7;
  string applyOpName = 8;
  string inWarehouseOpName = 9;
  string inWarehouseSource = 10;
  int32 inWarehouseSourceId = 11;
  InventoryCreditSheetType inWarehouseType = 12;
  string note = 13;
  string purchaseOpName = 14;
  string guid = 15;
  repeated InventoryCreditItemCreationRpcRequest inventoryCreditItems = 16;
  int32 source = 17;
  int32 creator = 18;
}

message SingleInventoryCreditSheetCreateRpcResponse {
  bool isCreated = 1;
  int32 InWarehouseOrderId = 2;
}

message SingleInventoryCreditSheetUpdateRpcRequest {
  int32 creditSheetsId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 applyOpId = 4;
  string applyOpName = 5;
  int32 warehouseId = 6;
  bool isWarehouseIdSet = 7;
  string warehouseName = 8;
  bool isWarehouseNameSet = 9;
  int32 stallId = 10;
  bool isStallIdSet = 11;
  string inWarehouseOpName = 12;
  bool isInWarehouseOpNameSet = 13;
  string inWarehouseSource = 14;
  bool isInWarehouseSourceSet = 15;
  int32 inWarehouseSourceId = 16;
  bool isInWarehouseSourceIdSet = 17;
  int32 inWarehouseType = 18;
  bool isInWarehouseTypeSet = 19;
  string note = 20;
  bool isNoteSet = 21;
  string purchaseOpName = 22;
  bool isPurchaseOpNameSet = 23;
  int64 storeDate = 24;
  bool isStoreDateSet = 25;
  repeated InventoryCreditItemCreationRpcRequest inventoryCreditItemCreationRpcRequest = 26;
  repeated InventoryCreditItemUpdateRpcRequest inventoryCreditItemUpdateRpcRequest = 27;
  repeated int32 deleteIds = 28;
  int32 source = 29;
  int32 updater = 30;
  bool isOrderId = 31;
  bool isOrderCode = 32;
  int32 orderId = 33;
  string orderCode = 34;
}

message SingleInventoryCreditSheetUpdateRpcResponse {
  bool isUpdated = 1;
}

message SingleInventoryCreditSheetCompleteRpcRequest {
  int32 creditSheetsId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 applyOpId = 4;
  string applyOpName = 5;
  int32 approveOpId = 6;
  string approveOpName = 7;
  ApproveStatus approveStatus = 8;
  int32 warehouseId = 9;
  bool isWarehouseIdSet = 10;
  string warehouseName = 11;
  bool isWarehouseNameSet = 12;
  int32 stallId = 13;
  bool isStallIdSet = 14;
  string inWarehouseOpName = 15;
  bool isInWarehouseOpNameSet = 16;
  string inWarehouseSource = 17;
  bool isInWarehouseSourceSet = 18;
  int32 inWarehouseSourceId = 19;
  bool isInWarehouseSourceIdSet = 20;
  int32 inWarehouseType = 21;
  bool isInWarehouseTypeSet = 22;
  string note = 23;
  bool isNoteSet = 24;
  string purchaseOpName = 25;
  bool isPurchaseOpNameSet = 26;
  int64 storeDate = 27;
  bool isStoreDateSet = 28;
  repeated InventoryCreditItemUpdateRpcRequest inventoryCreditItems = 29;
  int32 source = 30;
  int32 updater = 31;
}

message SingleInventoryCreditSheetCompleteRpcResponse {
  bool isUpdated = 1;
}

message InventoryCreditSheetsCompleteRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 approveOpId = 4;
  string approveOpName = 5;
}

message InventoryCreditSheetsCompleteRpcResponse {
  bool isComplete = 1;
}

message SingleInventoryCreditSheetDeleteRpcRequest {
  int32 creditSheetId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 source = 4;
  int32 deleter = 5;
}

message SingleInventoryCreditSheetDeleteRpcResponse {
  bool isDeleted = 1;
}

message SingleInventoryCreditSheetItemDeleteRpcRequest {
  int32 creditSheetId = 1;
  int32 creditSheetItemId = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 source = 5;
  int32 deleter = 6;
}

message SingleInventoryCreditSheetItemDeleteRpcResponse {
  bool isDeleted = 1;
}

message InventoryCreditSheetByOrderIdsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 clientIds = 2;
  repeated int32 orderIds = 3;
}

message InventoryCreditSheetByOrderIdsRpcResponse {
  repeated SingleInventoryCreditSheetRpcResponse responses = 1;
}

message InventoryCreditSheetItemsByCreditIdsRpcRequest {
  int32 enterpriseId = 1;
  bool isClientIdsSet = 4;
  repeated int32 clientIds = 2;
  repeated int32 ids = 3;
}

message InventoryCreditSheetItemsByCreditIdsRpcResponse {
  repeated SingleInventoryCreditSheetItemRpcResponse responses = 1;
}

message InventoryCreditSheetsByConditionsRpcRequest {
  int32 enterpriseId = 1;
  bool isClientIdsSet = 17;
  repeated int32 clientIds = 2;
  bool isStartAtSet = 3;
  string startAt = 4;
  bool isEndAtSet = 5;
  string endAt = 6;
  bool isApproveStatusSet = 7;
  ApproveStatus approveStatus = 8;
  bool isInventoryCreditSheetTypeSet = 9;
  InventoryCreditSheetType  inWarehouseType = 10;
  bool isWarehouseIdSet = 11;
  int32 warehouseId = 12;
  bool isKeywordSet = 13;
  string keyword = 14;
  bool shouldFilterInWarehouseTypes = 18;
  repeated InventoryCreditSheetType inWarehouseTypes = 19;
  bool shouldFilterStallIds = 20;
  repeated int32 stallIds = 21;
}

message InventoryCreditSheetsByConditionsRpcResponse {
  repeated SingleInventoryCreditSheetRpcResponse responses = 1;
}

message InventoryCreditSheetAndItemsByCreditIdRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 creditId = 3;
  repeated int32 clientIds = 4;
}

message InventoryCreditSheetAndItemsByCreditIdRpcResponse {
  SingleInventoryCreditSheetRpcResponse SingleInventoryCreditSheetResponses = 1;
  repeated SingleInventoryCreditSheetItemRpcResponse SingleInventoryCreditSheetItemResponses = 2;
}

message InventoryCreditSheetAndItemsCreationRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 applyOpId = 17;
  string applyOpName = 3;
  bool isInWarehouseOpNameSet = 4;
  string inWarehouseOpName = 5;
  string inWarehouseSource = 6;
  int32 inWarehouseSourceId = 18;
  InventoryCreditSheetType inWarehouseType = 7;
  bool isNoteSet = 8;
  string note = 9;
  int64 preStoreDate = 10;
  bool isPurchaseOpNameSet = 11;
  string purchaseOpName = 12;
  int32 stallId = 13;
  int32 warehouseId = 14;
  string warehouseName = 16;
  repeated SingleInventoryCreditSheetItemCreationRpcRequest singleInventoryCreditSheetItemCreationRpcRequest = 15;
  string guid = 19;
}

message InventoryCreditSheetAndItemsV2CreationRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 applyOpId = 17;
  string applyOpName = 3;
  bool isInWarehouseOpNameSet = 4;
  string inWarehouseOpName = 5;
  string inWarehouseSource = 6;
  int32 inWarehouseSourceId = 18;
  InventoryCreditSheetType inWarehouseType = 7;
  bool isNoteSet = 8;
  string note = 9;
  int64 preStoreDate = 10;
  bool isPurchaseOpNameSet = 11;
  string purchaseOpName = 12;
  int32 stallId = 13;
  int32 warehouseId = 14;
  string warehouseName = 16;
  repeated SingleInventoryCreditSheetItemV2CreationRpcRequest singleInventoryCreditSheetItemCreationRpcRequest = 15;
  string guid = 19;
}

message SingleInventoryCreditSheetItemCreationRpcRequest {
  int64 expirationDate = 1;
  string price = 2;
  string produceUnit = 3;
  int64 productDate = 4;
  int32 quantity = 5;
  int32 wblockId = 6;
  bool isIsFullDebitedSet = 7;
  bool isFullDebited = 8;
  string quarantineCertificates = 9;
  int32 skuId = 10;
  string guid = 11;
  string shelfLife = 12;
  string sumPrice = 13;
}

message SingleInventoryCreditSheetItemV2CreationRpcRequest {
  int64 expirationDate = 1;
  string price = 2;
  string produceUnit = 3;
  int64 productDate = 4;
  string quantity = 5;
  int32 wblockId = 6;
  bool isIsFullDebitedSet = 7;
  bool isFullDebited = 8;
  string quarantineCertificates = 9;
  int32 skuId = 10;
  string guid = 11;
  string shelfLife = 12;
  string sumPrice = 13;
}

message InventoryCreditSheetAndItemsCreationRpcResponse {
  int32 inWarehouseOrderId = 1;
  repeated int32 inventoryCreditSheetItemIds = 2;
}

message InventoryCreditSheetItemsCreationRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 inventoryCreditSheetId = 3;
  repeated SingleInventoryCreditSheetItemCreationRpcRequest singleInventoryCreditSheetItemCreationRpcRequest = 4;
}

message InventoryCreditSheetItemsCreationRpcResponse {
  repeated int32 inventoryCreditSheetItemIds = 1;
}

message InventoryCreditSheetUpdateByIdRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool isInWarehouseOpNameSet = 20;
  string inWarehouseOpName = 3;
  bool isInWarehouseSourceSet = 21;
  string inWarehouseSource = 4;
  bool isInWarehouseSourceIdSet = 22;
  int32 inWarehouseSourceId = 5;
  bool isNoteSet = 24;
  string note = 6;
  bool isInWarehouseTypeSet = 23;
  InventoryCreditSheetType inWarehouseType = 7;
  int64 preStoreDate = 8;
  bool isPurchaseOpNameSet = 25;
  string purchaseOpName = 9;
  bool isStallIdSet = 19;
  int32 stallId = 10;
  bool isWarehouseIdSet = 17;
  int32 warehouseId = 11;
  bool isWarehouseNameSet = 18;
  string warehouseName = 12;
  bool isStoreDateSet = 26;
  int64 storeDate = 13;
  int32 creditSheetsId = 14;
  int32 applyOpId = 15;
  string applyOpName = 16;
  bool isOrderId = 27;
  bool isOrderCode = 28;
  int32 orderId = 29;
  string orderCode = 30;
  bool isDeliveryDate = 31;
  int64 deliveryDate = 32;
}

message InventoryCreditSheetUpdateByIdRpcResponse {
  bool isUpdated = 1;
}

message InventoryCreditSheetItemsUpdateByCreditIdRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 creditSheetId = 3;
  repeated SingleInventoryCreditSheetItemUpdateByCreditIdRpcRequest singleInventoryCreditSheetItemUpdateByCreditIdRpcRequest = 4;
}

message BatchUpdateInventoryCreditSheetItemsByIdsRpcRequest {
  int32 enterpriseId = 1;
  repeated SingleInventoryCreditSheetItemUpdateByCreditIdRpcRequest singleInventoryCreditSheetItemUpdateByCreditIdRpcRequest = 4;
}

message SingleInventoryCreditSheetItemUpdateByCreditIdRpcRequest {
  bool isExpirationDateSet = 11;
  int64 expirationDate = 1;
  bool isIsFullDebitedSet = 12;
  bool isFullDebited = 2;
  bool isPriceSet = 13;
  string price = 3;
  bool isProduceUnitSet = 14;
  string produceUnit = 4;
  bool isProductDateSet = 15;
  int64 productDate = 5;
  bool isQuantitySet = 16;
  string quantity = 6;
  bool isWblockIdSet = 17;
  int32 wblockId = 7;
  bool isQuarantineCertificatesSet = 18;
  string quarantineCertificates = 8;
  int32 detailId = 9;
  int32 skuId = 10;
  string shelfLife = 19;
  string sumPrice = 20;
  int32 orderDetailId = 21;
  bool isSetOrderDetailId = 22;
  bool isReceiveQuantitySet = 23;
  string receiveQuantity = 24;
}

message InventoryCreditSheetItemsUpdateByCreditIdRpcResponse {
  bool isUpdated = 1;
}

message BatchUpdateInventoryCreditSheetItemsByIdsRpcResponse {
  bool isUpdated = 1;
}

message InventoryCreditSheetStatisticsByConditionsRpcRequest {
  InventoryCreditSheetsByConditionsRpcRequest conditionsRequest = 1;
}

message InventoryCreditSheetStatisticsByConditionsRpcResponse {
  int64 inWarehouseOrder = 1;
  int64 inWarehouseOrderSumPrice = 2;
  int64 notInWarehouseOrder = 3;
  int64 notInWarehouseOrderSumPrice = 4;
  int64 replenishmentInWarehouseOrderSumPrice = 5;
}

message SingleInventoryCreditSheetDeletionByIdRpcRequest {
  int32 creditSheetId = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int64 deleteAt = 4;
}

message SingleInventoryCreditSheetDeletionByIdRpcResponse {
  bool isDeleted = 1;
}

message InventoryCreditSheetItemsDeletionByIdsRpcRequest {
  repeated int32 creditSheetItemIds = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int64 deleteAt = 4;
}

message InventoryCreditSheetItemsDeletionByIdsRpcResponse {
  bool isDeleted = 1;
}


message GetInventoryCreditSheetDetailsByOrderDetailIdsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 orderDetailIds = 2;
  int32 clientId = 3;
}

message GetInventoryCreditSheetDetailsByOrderDetailIdsRpcResponse {
  repeated SingleInventoryCreditSheetItemRpcResponse responses = 1;
}



//入库 ------end------

//拆箱 --------start-----------

enum SplitStockOutWarehouseDetailStatus {
  SPLIT_OUT_WAREHOUSE_STATUS_UNKNOWN = 0;
  SPLIT_OUT_WAREHOUSE_STATUS_DISPLAY = 1;
  SPLIT_OUT_WAREHOUSE_STATUS_HIDE = 2;
  SPLIT_OUT_WAREHOUSE_STATUS_OUT = 3;
}

enum SplitStockINWarehouseDetailStatus {
  SPLIT_IN_WAREHOUSE_STATUS_UNKNOWN = 0;
  SPLIT_IN_WAREHOUSE_STATUS_DISPLAY = 1;
  SPLIT_IN_WAREHOUSE_STATUS_HIDE = 2;
  SPLIT_IN_WAREHOUSE_STATUS_IN = 3;
}

enum SplitRecordCreationFailure {
  UNKNOWN_SPLIT_RECORD_CREATION_FAILURE = 0;
  STOCK_COUNT_OVERFLOW_SPLIT_RECORD_CREATION_FAILURE = 1;
}

message LegacyCreateSplitRecordRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  int32 skuIdBeforeSplitting = 4;
  string splitQuantity = 5;
  int32 skuIdAfterSplitting = 6;
  string stockQuantityAfterSplitting = 7;
  int32 blockIdAfterSplitting = 8;
  int32 areaIdAfterSplitting = 9;
  int32 operatorId = 10;
  string operatorName = 11;
}

message LegacyCreateSplitRecordRpcResponse {
  bool isCreated = 1;
  int32 splitOutWarehouseDetailId = 2;
  string errorMessage = 3;
  SplitRecordCreationFailure failureStatus = 4;
}

//库存
enum CStockStatus {
  STOCK_STATUS_UNKNOWN_STATUS = 0;
  STOCK_STATUS_DISPLAY = 1;
  STOCK_STATUS_HIDE = 2;
}

enum StockDebitedType {
  STOCK_DEBITED_TYPE_UN_FULL_DEBITED = 0;
  STOCK_DEBITED_TYPE_FULL_DEBITED = 1;
}

message SingleUpdateStockRpcRequest {
  int32 id = 1;
  bool shouldUpdateInWarehouseSourceId = 2;
  int32 inWarehouseSourceId = 3;
  bool shouldUpdateInWarehouseSource = 4;
  string inWarehouseSource = 5;
}

message StocksUpdateRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated SingleUpdateStockRpcRequest stocks = 3;
}

message StocksUpdateRpcResponse {
  bool isUpdated = 1;
}

message SingleStockGetRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  bool includeDeleted = 5;
}


message SingleCStockRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 areaId = 5;
  int32 blockId = 6;
  int32 skuId = 7;
  bool hasProductDate = 34;
  bool hasExpirationDate = 35;
  int64 productDate = 8;
  int64 expirationDate = 9;
  CStockStatus status = 10;
  int32 purchasePriceVersionId = 11;
  int32 purchasePriceId = 12;
  string batch = 13;
  int32 inWarehouseSourceId = 14;
  string inWarehouseSource = 15;
  int64 storageDate = 16;
  bool isCleanedUp = 41;
  string currentStock = 18;
  string maxStock = 19;
  string minStock = 20;
  string maxWarnStock = 21;
  string minWarnStock = 22;
  string taxRate = 23;
  string guid = 24;
  bool isFullDebited = 25;
  string price = 26;
  string sumPrice = 27;
  int32 relationId = 28;
  int32 aid = 29;
  int64 createdAt = 30;
  int64 updatedAt = 31;
  bool isDeleted = 33;
}

message SingleStockGetRpcResponse {
  SingleCStockRpcResponse response = 1;
}

message SingleStockUpdateRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 areaId = 5;
  bool isAreaIdSet = 6;
  int32 blockId = 7;
  bool isBlockIdSet = 8;
  int32 skuId = 9;
  int64 productDate = 10;
  bool isProductDateSet = 11;
  int64 expirationDate = 12;
  bool isExpirationDateSet = 13;
  CStockStatus status = 14;
  bool isStatusSet = 15;
  int32 purchasePriceVersionId = 16;
  bool isPurchasePriceVersionIdSet = 17;
  int32 purchasePriceId = 18;
  bool isPurchasePriceIdSet = 19;
  string batch = 20;
  bool isBatchSet = 21;
  int64 storageDate = 22;
  bool isStorageDateSet = 23;
  string currentStock = 24;
  bool isCurrentStockSet = 25;
  string taxRate = 26;
  bool isTaxRateSet = 27;
  StockDebitedType isFullDebited = 28;
  bool isDebitedSet = 29;
  int32 updator = 30;
  int32 updationSource = 31;
}

message SingleStockUpdateRpcResponse {
  bool isUpdated = 1;
  string errorMessage = 2;
}

message SingleSkuStockUpdateRpcRequest {
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 skuId = 5;
  string sumStock = 6;
  bool isSumStockSet = 7;
  string minStock = 8;
  bool isMinStockSet = 9;
  string maxStock = 10;
  bool isMaxStockSet = 11;
  string minWarnStock = 12;
  bool isMinWarnStockSet = 13;
  string maxWarnStock = 14;
  bool isMaxWarnStockSet = 15;
  int32 updator = 16;
  int32 updationSource = 17;
}

message SingleSkuStockUpdateRpcResponse {
  bool isUpdated = 1;
  string errorMessage = 2;
}

//移库
enum MoveStockFailure {
  UNKNOWN_MOVE_STOCK_FAILURE = 0;
  MOVE_STOCK_QUANTITY_OVERFLOW_FAILURE = 1;
}

enum MoveStockOutWarehouseDetailStatus {
  UNKNOWN_MOVE_STOCK_OUT_WAREHOUSE_DETAIL = 0;
  DISPLAY_MOVE_STOCK_OUT_WAREHOUSE_DETAIL = 1;
  HIDE_MOVE_STOCK_OUT_WAREHOUSE_DETAIL = 2;
  DELETE_MOVE_STOCK_OUT_WAREHOUSE_DETAIL = 3;
  COMPLETE_MOVE_STOCK_OUT_WAREHOUSE_DETAIL = 4;
}

enum SplitStockOutWarehouseDetailsStatus {
  UNKNOWN_SPLIT_STOCK_OUT_WAREHOUSE_DETAIL = 0;
  DISPLAY_SPLIT_STOCK_OUT_WAREHOUSE_DETAIL = 1;
  HIDE_SPLIT_STOCK_OUT_WAREHOUSE_DETAIL = 2;
  DELETE_SPLIT_STOCK_OUT_WAREHOUSE_DETAIL = 3;
  COMPLETE_SPLIT_STOCK_OUT_WAREHOUSE_DETAIL = 4;
}

enum MoveStockInWarehouseDetailStatus {
  UNKNOWN_MOVE_STOCK_IN_WAREHOUSE_DETAIL = 0;
  DISPLAY_MOVE_STOCK_IN_WAREHOUSE_DETAIL = 1;
  HIDE_MOVE_STOCK_IN_WAREHOUSE_DETAIL = 2;
  DELETE_MOVE_STOCK_IN_WAREHOUSE_DETAIL = 3;
  COMPLETE_MOVE_STOCK_IN_WAREHOUSE_DETAIL = 4;
}

message LegacyMoveStockRpcRequest {
  int32 stockIdBeforeMoving = 1;
  string stockMovingQuantity = 2;
  int32 areaIdAfterMoving = 3;
  int32 blockIdAfterMoving = 4;
  int32 operator = 5;
  int32 operationSource = 6;
  string operatorName = 7;
  int32 enterpriseId = 8;
  int32 clientId = 9;
  int32 warehouseId = 10;
}

message LegacyMoveStockRpcResponse {
  bool isSuccessful = 1;
  string errorMessage = 2;
  MoveStockFailure failureStatus = 3;
}

message SingleSkuStockGetRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  int32 skuId = 4;
  bool includeDeleted = 5;
}

message SingleSkuStockRpcResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 warehouseId = 5;
  int32 skuId = 6;
  string sumStock = 7;
  string minStock = 8;
  string maxStock = 9;
  string minWarnStock = 10;
  string maxWarnStock = 11;
  int64 createdAt = 12;
  int64 updatedAt = 13;
  bool isDeleted = 14;
}

message SingleSkuStockGetRpcResponse {
  SingleSkuStockRpcResponse response = 1;
}

//项目点
message GetClientsByCodesRpcRequest {
  repeated string codes = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetClientsByConditionsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 ids = 2;
  repeated int32 parentIds = 3;
  repeated int32 regionIds = 4;
  repeated int32 signingRegionIds = 5;
  repeated string MTIds = 6;
  repeated string ELMIds = 7;
  repeated string DYIds = 8;
  repeated string QBIds = 9;
  string keyword = 10;
  string name = 11;
  string code = 12;
  ClientStatus status = 13;
  ClientType type = 14;
  bool includeDeleted = 15;
  bool shouldFilterIds = 16;
  bool shouldFilterParentIds = 17;
  bool shouldFilterRegionIds = 18;
  bool shouldFilterSigningRegionIds = 19;
  bool shouldFilterMTIds = 20;
  bool shouldFilterELMIds = 21;
  bool shouldFilterDYIds = 22;
  bool shouldFilterQBIds = 23;
  bool shouldFilterKeyword = 24;
  bool shouldFilterName = 25;
  bool shouldFilterCode = 26;
  bool shouldFilterStatus = 27;
  bool shouldFilterType = 28;
  bool shouldFilterCodes = 29;
  repeated string codes = 30;
}

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

message GetClientsByCodesRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}

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


message GetStallsByCodesRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}

message GetStallsByMoneyCodesRpcRequest {
  repeated string codes = 1;
  bool includeDeleted = 2;
}

message GetStallsByMoneyCodesRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}

message GetAllStallsWithMoneyCodeRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterEnterpriseId = 2;
  bool includeDeleted = 3;
}

message GetClientsByEnterpriseIdRpcRequest {
  int32 enterpriseId = 1;
  bool includeDeleted = 2;
  repeated int32 ids = 3;
  bool shouldFilterIds = 4;
}

message SingleClientRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 parentId = 3;
  int32 routeId = 4;
  string code = 5;
  string name = 6;
  string email = 7;
  string operatorName = 8;
  string phone = 9;
  string country = 10;
  string province = 11;
  string city = 12;
  string area = 13;
  string address = 14;
  int64 receiveTimeStart = 15;
  int64 receiveTimeEnd = 16;
  int32 routeSort = 17;
  string note = 18;
  int32 status = 19;
  int64 createdAt = 20;
  int64 updatedAt = 21;
  int64 deletedAt = 22;
  int32 groupId = 23;
  string groupName = 24;
  string areaManager = 25;
  bool isMaster = 26;
  bool isBOM = 27;
  string etag = 28;
  string profitRate = 29;
  string pickTermName = 30;
  int32 sortingTeamId = 31;
  int32 advancePaymentId = 32;
  bool permitAdvancePayment = 33;
  bool canManageStockByWechat = 34;
  bool canManageStockByWechatIsNull = 46;
  int32 allowedPaid = 35;
  int32 warehouseId = 36;
  bool isSetOrderTime = 37;
  bool isSetOrderTimeIsNull = 47;
  string orderTimeConfigJson = 38;
  int64 scheduledStartDate = 39;
  int64 scheduledEndDate = 40;
  int32 scheduledAdvanceLenth = 41;
  bool hasScheduledOrder = 42;
  bool hasScheduledOrderIsNull = 48;
  int32 scheduledDeadline = 43;
  int32 creationSource = 44;
  bool isSNSShoppingClient = 45;
  bool isSNSShoppingClientIsNull = 49;
  int32 enterpriseOperatorId = 50;
  string fireSafetyCertificateInfo = 51;
  string foodHygieneLicenseInfo = 52;
  string businessLicenseInfo = 53;
  string IDCardInfo = 54;
  bool isOrderCashRegister = 55;
  string MTId = 56;
  string ELMId = 57;
  string DYId = 58;
  string QBId = 59;
  string QBPassword = 60;
  int32 signingRegionId = 61;
  string signingRegionAddress = 64;
  int32 regionId = 62;
  ClientType type = 63;
  string QBName = 65;
  CustomerSource customerSource = 66;
  bool isDelivery = 67;
}

enum CustomerSource {
  INTERIOR = 0;
  WITHOUT = 1;
}

message GetClientsByEnterpriseIdRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}


enum InventoryDebitSheetItemStatus {
  INVENTORY_DEBIT_SHEET_ITEM_STATUS_UNKNOWN = 0;
  INVENTORY_DEBIT_SHEET_ITEM_SHOWN = 1;
  INVENTORY_DEBIT_SHEET_ITEM_HIDDEN = 2;
  INVENTORY_DEBIT_SHEET_ITEM_DISABLED = 3;
}

enum CheckWarehouseOrderType {
  CHECK_WAREHOUSE_ORDER_NOT_COMPLETE = 0;
  CHECK_WAREHOUSE_ORDER_NORMAL = 1;
  CHECK_WAREHOUSE_ORDER_PROFIT_OR_LOSS = 2;
}

message SingleInventoryCreditCreation {
  string code = 1;
  string guid = 2;
  int32 warehouseId = 3;
  int32 clientId = 4;
  string inWarehouseSource = 5;
  int64 preStoreDate = 6;
  int64 storeDate = 7;
  int32 orderId = 8;
  string orderCode = 9;
  int64 deliveryDate = 10;
  int32 applyOpId = 11;
  string applyOpName = 12;
  int64 applyDate = 13;
  int32 approveOpId = 14;
  string approveOpName = 15;
  int64 approveDate = 16;
  GenSource genSource = 17;
  InventoryCreditSheetType inWarehouseType = 18;
  ApproveStatus approveStatus = 19;
  InventoryCreditSheetStatus status = 20;
  int32 inWarehouseSourceId = 21;
  string inWarehouseOpName = 22;
  int32 unReadMark = 23;
  int32 stallId = 24;
}

message SingleInventoryCreditItemCreation {
  string guid = 1;
  int32 warehouseId = 2;
  int32 wblockId = 3;
  string wblockCode = 4;
  string wblockName = 5;
  int32 clientId = 6;
  int32 skuId = 7;
  string realInStock = 8;
  int32 cableTicket = 9;
  int32 orderDetailId = 10;
  int32 increment = 11;
  int32 inWarehouseOrderId = 12;
  string inWarehouseOrderGuid = 13;
  string inWarehouseOrderCode = 14;
  string temperature = 15;
  string sumPrice = 16;
  int64 storeDate = 17;
  bool isInWarehouse = 18;
}

message SingleInventoryDebitCreation {
  string code = 1;
  string guid = 2;
  int32 warehouseId = 3;
  int32 clientId = 4;
  string destination = 5;
  int32 applyOpId = 6;
  string applyOpName = 7;
  int32 outWarehouseOpId = 8;
  string outWarehouseOpName = 9;
  int64 preOutDate = 10;
  int64 outDate = 11;
  int32 pickOpId = 12;
  string pickOpName = 13;
  InventoryDebitSheetType outWarehouseType = 14;
  ApproveStatus approveStatus = 15;
  InventoryDebitSheetStatus status = 16;
  int32 destinationId = 17;
  int32 approveOpId = 18;
  string approveOpName = 19;
  int64 approveDate = 20;
}

message SingleInventoryDebitItemCreation {
  int32 clientId = 1;
  string guid = 2;
  int32 outWarehouseOrderId = 3;
  string outWarehouseOrderCode = 4;
  string preOutQuantity = 5;
  string realOutQuantity = 6;
  InventoryDebitSheetItemStatus status = 7;
  int32 skuId = 8;
  string batch = 9;
}

message SingleInventoryCheckWarehouseOrderDetailCreation {
  string guid = 1;
  int32 clientId = 2;
  int32 checkWarehouseOrderId = 3;
  int32 wstockId = 4;
  int32 skuId = 5;
  string skuCode = 6;
  string skuName = 7;
  int32 skuType = 8;
  string skuAlias = 9;
  string skuUnit = 10;
  string skuSpecification = 11;
  string skuSpecificationUnit = 12;
  string categoryName = 13;
  string parentCategoryName = 14;
  string wblockCode = 15;
  string wblockName = 16;
  string stock = 17;
  string stockTaking = 18;
  string stockLoss = 19;
  int64 productDate = 20;
  int64 expirationDate = 21;
  string skuLoss = 22;
}

message SinglePurchasePriceVersionCreation {
  string guid = 1;
  int32 clientId = 2;
  string code = 3;
  int32 skuId = 4;
  string orderCode = 5;
  string price = 6;
}

message SingleStockCreation {
  int32 clientId = 1;
  string guid = 2;
  string batch = 3;
  string priceVersionCode = 4;
  int32 warehouseId = 5;
  int32 wareaId = 6;
  int32 wblockId = 7;
  int32 skuId = 8;
  int64 productDate = 9;
  int64 expirationDate = 10;
  CStockStatus status = 11;
  int32 purchasePriceVersionId = 12;
  int32 purchasePriceId = 13;
  int64 storageDate = 14;
  int32 inWarehouseSourceId = 15;
  string inWarehouseSource = 16;
  bool isFullDebited = 17;
  string currentStock = 18;
}

message SingleInventoryRelationCreation {
  int32 clientId = 1;
  string guid = 2;
  int32 warehouseId = 3;
  int32 orderDetailId = 4;
  string orderDetailGuid = 5;
  int32 skuId = 6;
  int32 wblockId = 7;
  int32 wstockId = 8;
  int64 productDate = 9;
  int64 expirationDate = 10;
  int32 cableTicket = 11;
  string quantity = 12;
  int32 base = 13;
  int32 purchasePriceVersionId = 14;
  int32 purchasePriceId = 15;
  string purchasePriceVersionGuid = 16;
  string batch = 17;
  CStockRelationType type = 18;
  CStockRelationStatus status = 19;
  int64 processedAt = 20;
  int64 operationTime = 21;
  bool isFullDebited = 22;
}

message SingleInventoryCreditItemUpdater {
  int32 id = 13;
  bool shouldUpdateRealInStock = 1;
  string realInStock = 2;
  bool shouldUpdateIncrement = 3;
  int32 increment = 4;
  bool shouldUpdateTemperature = 5;
  string temperature = 6;
  bool shouldUpdateSumPrice = 7;
  string sumPrice = 8;
  bool shouldUpdateStoreDate = 9;
  int64 storeDate = 10;
  bool shouldUpdateIsInWarehouse = 11;
  bool isInWarehouse = 12;
}


message SingleInventoryDebitItemUpdater {
  int32 id = 1;
  bool shouldUpdateRealOutQuantity = 2;
  string realOutQuantity = 3;
}

message SingleInventoryCheckWarehouseOrderUpdater {
  int32 id = 1;
  bool shouldUpdateType = 2;
  CheckWarehouseOrderType type = 3;
}

message SingleInventoryCheckWarehouseOrderDetailUpdater {
  int32 id = 1;
  bool shouldUpdateStockLoss = 2;
  string stockLoss = 3;
  bool shouldUpdateStock = 4;
  string stock = 5;
}

message SingleStockUpdater {
  int32 id = 1;
  bool shouldUpdateProductDate = 2;
  int64 productDate = 3;
  bool shouldUpdateExpirationDate = 4;
  int64 expirationDate = 5;
  bool shouldUpdateStorageDate = 6;
  int64 storageDate = 7;
  bool shouldUpdateCurrentStock = 8;
  string currentStock = 9;
}

message SingleInventoryRelationUpdater {
  int32 id = 1;
  bool shouldUpdateQuantity = 2;
  string quantity = 3;
  bool shouldUpdateOperationTime = 4;
  int64 operationTime = 5;
}

message SinglePurchasePriceVersionUpdater {
  int32 id = 1;
  bool shouldUpdatePrice = 2;
  string price = 3;
}

message BulkCreateAndModifyInventoryCreditsRpcRequest {
  int32 enterpriseId = 1;
  int32 operatorId = 2;
  string operatorName = 3;
  repeated SingleInventoryCreditCreation credits = 4;
  repeated SingleInventoryCreditItemCreation creditItems = 5;
  repeated SingleInventoryDebitCreation debits = 6;
  repeated SingleInventoryDebitItemCreation debitItems = 7;
  repeated SingleInventoryCheckWarehouseOrderDetailCreation checkWarehouseOrderDetails = 9;
  repeated SinglePurchasePriceVersionCreation purchasePriceVersions = 10;
  repeated SingleStockCreation stocks = 11;
  repeated SingleInventoryRelationCreation relations = 12;
  repeated SingleInventoryCreditItemUpdater creditItemUpdaters = 13;
  repeated SingleInventoryDebitItemUpdater debitItemUpdaters = 20;
  repeated SingleInventoryCheckWarehouseOrderUpdater checkWarehouseOrderUpdaters = 19;
  repeated SingleInventoryCheckWarehouseOrderDetailUpdater checkWarehouseOrderDetailUpdaters = 14;
  repeated SingleStockUpdater stockUpdaters = 15;
  repeated SingleInventoryRelationUpdater relationUpdaters = 16;
  repeated SinglePurchasePriceVersionUpdater purchasePriceVersionUpdaters = 17;
  repeated int32 deleteRelationIds = 18;
}

message BulkCreateAndModifyInventoryCreditsRpcResponse {
  bool isSuccessful = 1;
  repeated int32 createdCreditIds = 2;
  repeated int32 createdCreditItemIds = 3;
  repeated int32 createdDebitIds = 4;
  repeated int32 createdDebitItemIds = 5;
  repeated int32 createdCheckWarehouseOrderDetailIds = 6;
  repeated int32 createdPurchasePriceVersionsIds = 7;
  repeated int32 createdStockIds = 8;
  repeated int32 createdRelationIds = 9;
}


message SingleCheckWarehouseOrderDetailResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 checkWarehouseOrderId = 5;
  int32 wStockId = 6;
  int32 skuId = 7;
  string skuCode = 8;
  string skuName = 9;
  int32 skuType = 10;
  string skuAlias = 11;
  string skuUnit = 12;
  string skuSpecification = 13;
  string skuSpecificationUnit = 14;
  string categoryName = 15;
  string parentCategoryName = 16;
  string wAreaCode = 17;
  string wAreaName = 18;
  string wBlockCode = 19;
  string wBlockName = 20;
  string stock = 21;
  int32 purchasePriceVersionId = 22;
  string purchasePriceVersionCode = 23;
  string batch = 24;
  int64 storageDate = 25;
  string stockTaking = 26;
  string stockLoss = 27;
  int64 productDate = 28;
  int64 expirationDate = 29;
  int64 createdAt = 30;
  int64 updatedAt = 31;
  string skuLoss = 32;
  int64 wsDate = 33;
}

message  SingleStockMoveCreditRpcResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  string code = 5;
  int32 warehouseId = 6;
  int32 moveStockOutWarehouseDetailId = 7;
  int32 operatorId = 8;
  string operatorName = 9;
  int64 storeDate = 10;
  int32 skuId = 11;
  string realInQuantity = 12;
  int32 purchasePriceVersionId = 13;
  int32 status = 14;
  int64 createdAt = 15;
  int64 updatedAt = 16;
  bool isDeleted = 17;
}

message  SingleStockMoveDebitRpcResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  string code = 5;
  int32 warehouseId = 6;
  int32 operatorId = 7;
  string operatorName = 8;
  int64 outDate = 9;
  int32 skuId = 10;
  string realOutQuantity = 11;
  int32 purchasePriceVersionId = 12;
  int32 status = 13;
  int64 createdAt = 14;
  int64 updatedAt = 15;
  bool isDeleted = 16;
}

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

message GetClientsByIdsRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}

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

message GetClientByIdRpcResponse {
  SingleClientRpcResponse client = 1;
}

message GetClientsByParentIdsRpcRequest {
  repeated int32  parentIds = 1;
  int32  enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetClientsByConditionsRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}

message GetClientsByParentIdsRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}

message GetStallsByClientIdRpcRequest {
  int32 clientId = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetStallsByClientIdRpcResponse {
  repeated SingleClientRpcResponse stalls = 1;
}

message UpdateClientsStatusByIdsRpcRequest {
  repeated int32  ids = 1;
  int32 enterpriseId = 2;
  ClientStatus status = 3;
}

message UpdateClientByIdRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  string country = 3;
  bool shouldCountry = 4;
  string province = 5;
  bool shouldProvince = 6;
  string city = 7;
  bool shouldCity = 8;
  string area = 9;
  bool shouldArea = 10;
  string address = 11;
  bool shouldAddress = 12;
}

message UpdateClientByIdRpcResponse {
  bool isUpdated = 1;
}

message UpdateClientsStatusByIdsRpcResponse {
  bool isUpdated = 1;
}

message ClientsGetByCreationSourceRpcRequest {
  bool isEnterpriseIdsSet = 1;
  repeated int32 enterpriseIds = 2;
  ClientCreationSource creationSource = 3;
}

message GetPClientsByIdsRpcRequest {
  repeated int32  ids = 1;
  bool shouldId = 4;
  int32  enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetStallsByIdsRpcRequest {
  repeated int32  ids = 1;
  bool shouldId = 4;
  int32  enterpriseId = 2;
  bool includeDeleted = 3;
}


message GetStallsByIdsRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}

message GetClientsByParentIdsAndIdsRpcRequest {
  repeated int32  ids = 1;
  bool shouldFilterId = 2;
  int32  enterpriseId = 3;
  bool includeDeleted = 4;
  repeated int32  parentIds = 5;
  bool shouldFilterParentId = 6;
}

message GetClientsByParentIdsAndIdsRpcResponse{
  repeated SingleClientRpcResponse clients = 1;
}

message GetPClientsByIdsRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}


message SingleDetailsCreationRpcRequest {
  int32 wstockId = 5;
  int32 skuId = 6;
  int32 checkWarehouseOrderId = 7;
  string stock = 34;
  string skuLoss = 52;
  string stockTaking = 8;
  bool isStockTaking = 10;
  string stockLoss = 9;
  bool isStockLoss = 11;
}

message SingleInventoryCheckSheetCreationsRpcRequest {
  int32 guid = 1;
  int32 warehouseId = 2;
  string code = 3;
  int64 wsDate = 4;
  CheckWarehouseOrderStatus status = 5;
  CheckWarehouseOrderType type = 6;
  int32 applyOpId = 7;
  string applyOpName = 8;
  repeated SingleDetailsCreationRpcRequest request = 9;
}

message InventoryCheckSheetsCreationRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated SingleInventoryCheckSheetCreationsRpcRequest inventoryCheckSheetCreationsRpcRequest = 3;
}

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

message ClientsGetByCreationSourceRpcResponse {
  repeated SingleClientRpcResponse clients = 1;
}

enum ClientCreationSource {
  UNKNOWN_CLIENT_CREATION_SOURCE = 0;
  ENTERPRISE_CLIENT_CREATION_SOURCE = 1;
  MALL_CLIENT_CREATION_SOURCE = 2;
}

enum ClientStatus {
  UN_KNOW = 0;
  ENABLE = 1;
  DISABLE = 3;
}

enum ClientBindStatus {
  UNKNOWN_CLIENT_BIND_STATUS = 0;
  INCOMPLETE_CLIENT_BIND_STATUS = 1;
  COMPLETE_CLIENT_BIND_STATUS = 2;
}

message OutWarehouseOrderGetAllRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterStallIds = 2;
  repeated int32 stallIds = 3;
  bool shouldFilterCreatedAtLowerBound = 4;
  int64 createdAtLowerBound = 5;
  bool shouldFilterCreatedAtUpperBound = 6;
  int64 createdAtUpperBound = 7;
  bool includeDeleted = 8;
}

message OutWarehouseOrderGetAllRpcResponse {
  repeated SingleOutWarehouseOrderRpcResponse outWarehouseOrders = 1;
}

message SingleOutWarehouseOrderRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string code = 4;
  int32 warehouseId = 5;
  string warehouseName = 6;
  string destination = 7;
  int32 applyOpId = 8;
  string applyOpName = 9;
  int32 outWarehouseOpId = 10;
  string outWarehouseOpName = 11;
  int64 preOutDate = 12;
  int64 outDate = 13;
  int32 pickOpId = 14;
  string pickOpName = 15;
  int32 outWarehouseType = 16;
  int32 approveStatus = 17;
  int32 damageReasonId = 18;
  string damageReason = 19;
  int32 returnReasonId = 20;
  string returnReason = 21;
  int32 status = 22;
  string note = 23;
  int64 createdAt = 24;
  int64 updatedAt = 25;
  int64 deletedAt = 26;
  int32 destinationId = 27;
  string guid = 28;
  int32 approveOpId = 29;
  string approveOpName = 30;
  int64 approveDate = 31;
  int32 genSource = 32;
  repeated SingleOutWarehouseOrderDetailRpcResponse outWarehouseOrderDetails = 33;
}

message SingleOutWarehouseOrderDetailRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 outWarehouseOrderId = 4;
  int32 skuId = 5;
  string skuCode = 6;
  string skuName = 7;
  string skuAlias = 8;
  string skuUnit = 9;
  string skuSpecification = 10;
  string skuSpecificationUnit = 11;
  string categoryName = 12;
  int32 supplierSourceId = 13;
  string supplierSource = 14;
  string preOutQuantity = 15;
  string realOutQuantity = 16;
  int64 productDate = 17;
  int64 expirationDate = 18;
  string wblockId = 19;
  string wblockCode = 20;
  string wblockName = 21;
  int32 purchasePriceVersionId = 22;
  string purchasePriceVersionCode = 23;
  string batch = 24;
  int32 wstockId = 25;
  int32 status = 26;
  int64 createdAt = 27;
  int64 updatedAt = 28;
  int64 deletedAt = 29;
  string guid = 30;
  repeated SingleCStockRelationRpcResponse stockRelations = 31;
}

message StockRelationsGetByOrderDetailIdsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 orderDetailIds = 2;
}

message StockRelationsGetByOrderDetailIdsRpcResponse {
  repeated SingleCStockRelationRpcResponse stockRelations = 1;
}

message GetStocksByIdsRpcRequest {
  repeated int32  ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  bool includeDeleted = 4;
}

message GetStocksByIdsRpcResponse {
  repeated SingleCStockRpcResponse response = 1;
}

message GetStockRelationsByConditionRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool isOrderDetailIdSet = 3;
  repeated int32 orderDetailId = 4;
  bool isCStockRelationStatusSet = 5;
  repeated  CStockRelationStatus statuses = 6;
  bool isCStockRelationTypeSet = 10;
  repeated CStockRelationType types = 7;
  bool isStockIdSet = 9;
  repeated int32 stockIds = 8;
  bool shouldFilterProcessedAt = 11;
  int64 processedAt = 12;
}
message GetStockRelationsByConditionExcludeClientRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  bool isOrderDetailIdSet = 3;
  repeated int32 orderDetailId = 4;
  bool isCStockRelationStatusSet = 5;
  repeated  CStockRelationStatus statuses = 6;
  bool isCStockRelationTypeSet = 10;
  repeated CStockRelationType types = 7;
  bool isStockIdSet = 9;
  repeated int32 stockIds = 8;
  bool isClientIdSet = 11;
}

message GetStockRelationsByConditionRpcResponse {
  repeated SingleCStockRelationRpcResponse relations = 1;
}

message GetStockRelationsByConditionExcludeClientRpcResponse {
  repeated SingleCStockRelationRpcResponse relations = 1;
}

message InventoryCheckSheetAndItemsCreationRpcRequest {
  int32 guid = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  string code = 6;
  int64 wsDate = 9;
  CheckWarehouseOrderStatus status = 11;
  CheckWarehouseOrderType type = 12;
  int32 applyOpId = 13;
  string applyOpName = 14;
  repeated SingleInventoryCheekSheetDetailsCreationRpcRequest request = 15;

}

message InventoryCheckSheetAndItemsCreationRpcResponse {
  bool isCreated = 1;
  int32 id = 2;
  string isSuccessful = 3;
}

//-----------start盘库单----------
message SingInventoryCheckSheetByIdRpcRequest{
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}


message SingInventoryCheckSheetByIdRpcResponse{
  SingleInventoryCheckSheetResponse response = 1;
}

message GetInventoryCheckSheetsByIdsRpcRequest {
  repeated int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message GetInventoryCheckSheetsByIdsRpcResponse {
  repeated SingleInventoryCheckSheetResponse response = 1;
}

message SingleInventoryCheckSheetCreationRpcRequest {
  int32 guid = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  string code = 6;
  int64 wsDate = 9;
  CheckWarehouseOrderStatus status = 11;
  CheckWarehouseOrderType type = 12;
  int32 applyOpId = 13;
  string applyOpName = 14;
}

message  SingleInventoryCheckSheetCreationRpcResponse {
  bool isCreated = 1;
  int32 id = 2;
  string isSuccessful = 3;
}

message InventoryCheckSheetsByConditionsRpcRequest {
  string dateLowerBound = 1;
  bool isDateLowerBoundSet = 2;
  string dateUpperBound = 3;
  bool isDateUpperBoundSet = 4;
  CheckWarehouseOrderStatus status = 5;
  bool isCheckWarehouseOrderStatusSet = 10;
  int32 warehouseId = 6;
  bool isWarehouseIdSet = 9;
  int32 enterpriseId = 7;
  int32 clientId = 8;
}

message SingleInventoryCheckSheetResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 warehouseId = 5;
  string warehouseName = 6;
  string code = 7;
  int32 checkWarehouseOpId = 8;
  string checkWarehouseOpName = 9;
  int64 wsDate = 10;
  string note = 11;
  CheckWarehouseOrderStatus status = 12;
  int64 createdAt = 13;
  int64 updatedAt = 14;
  bool isDeleted = 15;
  int64 deletedAt = 16;
  CheckWarehouseOrderType type = 17;
  int32 applyOpId = 18;
  string applyOpName = 19;
  int64 checkedDate = 20;
  int32 approveOpId = 21;
  string approveOpName = 22;
  int64 approveDate = 23;
}

message InventoryCheckSheetsByConditionsRpcResponse {
  repeated  SingleInventoryCheckSheetResponse response = 1;
}

message InventoryCheckSheetUpdateRpcRequest {
  int32 id = 5;
  int32 enterpriseId = 1;
  int32 clientId = 2;
  CheckWarehouseOrderStatus status = 3;
  bool isCheckWarehouseOrderTypeSet = 6;
  CheckWarehouseOrderType type = 4;
}

message InventoryCheckSheetUpdateRpcResponse {
  bool isUpdated = 1;
}

message GetInventoryCheckSheetsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int64 wsDate = 3;
  int32 warehouseId = 4;
  CheckWarehouseOrderStatus status = 5;
  bool includeDeleted = 6;
}

message GetInventoryCheckSheetsRpcResponse {
  repeated SingleInventoryCheckSheetResponse singleInventoryCheckSheetResponse = 1;
}

message SingleInventoryCheekSheetDetailsCreationRpcRequest {
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 wstockId = 5;
  int32 skuId = 6;
  int32 checkWarehouseOrderId = 7;
  string stock = 34;
  string skuLoss = 52;
  string stockTaking = 8;
  bool isStockTaking = 10;
  string stockLoss = 9;
  bool isStockLoss = 11;
}
message InventoryCheekSheetDetailsCreationRpcRequest {
  repeated SingleInventoryCheekSheetDetailsCreationRpcRequest request = 1;
}

message InventoryCheekSheetDetailsCreationRpcResponse {
  bool isCreated = 1;
  int32 id = 2;
  string isSuccessful = 3;
}

message SingleInventoryCheckSheetItemResponse {
  int32 id = 1;
  string guid = 2;
  int32 enterpriseId = 3;
  int32 clientId = 4;
  int32 checkWarehouseOrderId = 5;
  int32 wStockId = 6;
  int32 skuId = 7;
  string skuCode = 8;
  string skuName = 9;
  int32 skuType = 10;
  string skuAlias = 11;
  string skuUnit = 12;
  string skuSpecification = 13;
  string skuSpecificationUnit = 14;
  string categoryName = 15;
  string parentCategoryName = 16;
  string wareaCode = 17;
  string wareaName = 18;
  string wblockCode = 19;
  string wblockName = 20;
  string stock = 21;
  int32 purchasePriceVersionId = 22;
  string purchasePriceVersionCode = 23;
  string batch = 24;
  int64 storageDate = 25;
  string stockTaking = 26;
  string stockLoss = 27;
  int64 productDate = 28;
  int64 expirationDate = 29;
  int64 createdAt = 30;
  int64 updatedAt = 31;
  bool isDeleted = 32;
  int64 deletedAt = 33;
  string skuLoss = 34;
}

message SingleGetInventoryCheckSheetItemByIdRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message SingleGetInventoryCheckSheetItemByIdRpcResponse {
  SingleInventoryCheckSheetItemResponse singleCheckWarehouseOrderDetailResponse = 1;
}

message GetInventoryCheckSheetItemsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  bool includeDeleted = 4;
}

message GetInventoryCheckSheetItemsByIdsRpcResponse {
  repeated SingleInventoryCheckSheetItemResponse response = 1;
}

message SingleInventoryCheckSheetItemsUpdateRpcRequest {
  int32 id = 1;
  string stock = 2;
  bool isStock = 3;
  string  stockTaking = 4;
  bool isStockTaking = 6;
  string stockLoss = 5;
  bool isStockLoss = 7;
}

message InventoryCheckSheetItemsUpdateRpcRequest {
  int32 enterpriseId = 2;
  int32 clientId = 3;
  bool includeDeleted = 4;
  repeated SingleInventoryCheckSheetItemsUpdateRpcRequest requests = 1;
  bool isRequests = 5;
}

message InventoryCheckSheetItemsUpdateRpcResponse {
  bool isUpdated = 1;
}

message BatchCreateInventoryCheckSheetItemsRpcRequest {
  repeated SingleInventoryCheekSheetDetailsCreationRpcRequest request = 15;
}

message BatchCreateInventoryCheckSheetItemsRpcResponse {
  repeated int32 ids = 1;
  bool isCreated = 2;
  string isSuccessful = 3;
}

message InventoryCheckSheetItemsBySheetIdsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 checkWarehouseOrderId = 3;
  bool includeDeleted = 4;
}

message  InventoryCheckSheetItemsBySheetIdsRpcResponse {
  repeated SingleInventoryCheckSheetItemResponse response = 1;
}


message GetInventoryCheckSheetItemsByInventoryCheekSheetIdsRpcResponse {
  repeated SingleInventoryCheckSheetItemResponse response = 1;
}

message GetInventoryCheckSheetItemsByInventoryCheekSheetIdsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 checkWarehouseOrderId = 3;
  bool includeDeleted = 4;
}

message DeleteInventoryCheckSheetItemsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message DeleteInventoryCheckSheetItemsByIdsRpcResponse {
  bool isDeleted = 1;
  string errorMessage = 2;
}


message InventoryCheckSheetItemBySheetIdRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 checkWarehouseOrderId = 3;
  bool includeDeleted = 4;
}

message  InventoryCheckSheetItemBySheetIdRpcResponse {
  repeated SingleInventoryCheckSheetItemResponse response = 1;
}

message GetMostRecentCorrectionDetailsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 warehouseId = 2;
  repeated int32 skuIds = 3;
  int64 date = 4;
}

message SingleMostRecentCorrectionDetailRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 warehouseId = 4;
  int32 sheetId = 5;
  int32 skuId = 6;
  int64 time = 7;
  string stock = 8;
  string delta = 9;
  int32 stockId = 10;
}

message GetMostRecentCorrectionDetailsRpcResponse {
  repeated SingleMostRecentCorrectionDetailRpcResponse response = 1;
}

message SingleMoveStockOutWarehouseDetailResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string code = 4;
  int32 warehouseId = 5;
  int32 operatorId = 6;
  string operatorName = 7;
  int64 outDate = 8;
  int32 skuId = 9;
  string realOutQuantity = 10;
  int32 purchasePriceVersionId = 11;
  MoveStockOutWarehouseDetailStatus status = 12;
  int64 createdAt = 13;
  int64 updatedAt = 14;
  string guid = 15;
}

message GetMoveStockOutWarehouseDetailsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  bool includeDeleted = 4;
}

message GetMoveStockOutWarehouseDetailsByIdsRpcResponse {
  repeated SingleMoveStockOutWarehouseDetailResponse response = 1;
}

//拆箱

message SingleSplitStockOutWarehouseDetailResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string code = 4;
  int32 warehouseId = 5;
  int32 operatorId = 6;
  string operatorName = 7;
  int64 outDate = 8;
  int32 skuId = 9;
  string realOutQuantity = 10;
  int32 purchasePriceVersionId = 11;
  SplitStockOutWarehouseDetailsStatus status = 12;
  int64 createdAt = 13;
  int64 updatedAt = 14;
  string guid = 15;
}

message GetSplitStockOutWarehouseDetailsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  bool includeDeleted = 4;
  int32 warehouseId = 5;
  bool IsWarehouseIdSet = 6;
}

message GetSplitStockOutWarehouseDetailsByIdsRpcResponse {
  repeated SingleSplitStockOutWarehouseDetailResponse response = 1;
}
message StockRelationsGetByProcessedAtBoundRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterClientId = 2;
  repeated int32 clientIds = 3;
  bool shouldFilterWarehouseId = 4;
  repeated int32 warehouseIds = 5;
  int64 startDate = 6;
  int64 endDate = 7;
}

message StockRelationsGetByProcessedAtBoundRpcResponse {
  repeated SingleCStockRelationRpcResponse relations = 1;
}

message InventoryCreditItemsGetByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  bool shouldFilterClientIds = 3;
  repeated int32 clientIds = 4;
}
message InventoryCreditItemsGetByOrderDetailIdsRpcRequest {
  repeated int32 orderDetailIds = 1;
  int32 enterpriseId = 2;
}

message InventoryCreditItemsGetByIdsRpcResponse {
  repeated SingleInventoryCreditSheetItemRpcResponse responses = 1;
}
message InventoryCreditItemsGetByOrderDetailIdsRpcResponse {
  repeated SingleInventoryCreditSheetItemRpcResponse responses = 1;
}

message InventoryDebitSheetItemsGetByIdsV2RpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
}
message InventoryDebitSheetItemsGetByIdsV2RpcResponse {
  repeated SingleInventoryDebitSheetItemRpcResponse response = 1;
}

message InventoryCreditSheetsGetByIdsRpcRequest {
  int32 enterpriseId = 1;
  repeated int32 ids = 2;
}

message InventoryCreditSheetsGetByIdsRpcResponse {
  repeated SingleInventoryCreditSheetRpcResponse response = 1;
}

message InventoryDebitSheetsGetByIdsV2RpcRequest {
  int32 enterpriseId = 1;
  repeated int32 ids = 2;
}

message InventoryDebitSheetsGetByIdsV2RpcResponse {
  repeated SingleInventoryDebitSheetRpcResponse response = 1;
}
message GetStocksByConditionsRpcRequest {
  int32 enterpriseId = 1;
  int64 time = 2;
  bool shouldFilterWarehouses = 3;
  repeated int32 warehouseIds = 4;
  bool shouldFilterClients = 5;
  repeated int32 clientIds = 6;
}

message GetStocksByConditionsRpcResponse {
  repeated SingleCStockRpcResponse stocks = 1;
}

message GetStockRelationsByConditionsRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterWarehouses = 2;
  repeated int32 warehouseIds = 3;
  bool shouldFilterClients = 4;
  repeated int32 clientIds = 5;
  int64 startDate = 6;
  int64 endDate = 7;
}

message GetStockRelationsByConditionsRpcResponse {
  repeated SingleCStockRelationRpcResponse relations = 1;
}

message StocksGetByConditionRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterClientIds = 2;
  repeated int32 clientIds = 3;
  bool shouldFilterExpirationDate = 4;
  int64 expirationDate = 5;
  bool shouldFilterMinWarnStock = 6;
  bool shouldFilterMaxWarnStock = 7;
  bool includeDeleted = 8;
}

message StocksGetByConditionRpcResponse {
  repeated SingleCStockRpcResponse stocks = 1;
}

message GetInventoryCheckSheetItemsBySheetIdAndSkuIdRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 checkWarehouseOrderId = 3;
  int32 skuId = 4;
  bool includeDeleted = 5;
}

message GetInventoryCheckSheetItemsBySheetIdAndSkuIdRpcResponse {
  repeated SingleInventoryCheckSheetItemResponse response = 1;
}

message SingleClientInventoryOperationRecordRpcResponse{
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 sourceId = 4;
  CStockRelationType sourceType = 5;
  string originalSheetJson = 6;
  string revisedSheetJson = 7;
  string originalDetailJson = 8;
  string revisedDetailJson = 9;
  ClientInventoryOperationRecordType type = 10;
  int32 status = 11;
  string operator = 12;
  int32 creationSource = 13;
  int32 createdBy = 14;
  int64 createdAt = 15;
  int32 updatedBy = 16;
  int64 updatedAt = 17;
  int32 updateSource = 18;
}

message GetClientInventoryOperationRecordsByConditionRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 sourceIds = 3;
  int32 sourceType = 4;
}

message GetClientInventoryOperationRecordsByConditionRpcResponse {
  repeated SingleClientInventoryOperationRecordRpcResponse response = 1;
}


enum ClientInventoryOperationRecordType {
  CLIENT_INWAREHOUSEORDERS_CREATE = 0;//项目点入库单自建
  CLIENT_INWAREHOUSEORDERS_UPDATE_SKU = 1;//项目点入库单更新
  CLIENT_INWAREHOUSEORDERS_REPLENISHMENT = 2;//项目点入库单补货
  CLIENT_INWAREHOUSEORDERS_COMPLETE = 3;//项目点入库单完成
  CLIENT_INWAREHOUSEORDERS_ALTER = 4;//项目点入库单调整
  CLIENT_TRACEABILITY_CREATE = 5;//项目点溯源单据创建
  CLIENT_TRACEABILITY_UPDATE = 6;//项目点溯源单据修改
  CLIENT_TRACEABILITY_DELETE = 7;//项目点溯源单据删除
  CLIENT_INWAREHOUSEORDERS_DELETD_SKU = 8;//项目点入库单调整
  CLIENT_INWAREHOUSEORDERS_UPDATE_CREATE = 9;
  CLIENT_INWAREHOUSEORDERS_CREATE_SKU = 10;
}

message CreateClientInventoryOperationRecordRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 sourceId = 3;
  int32 sourceType = 4;
  string originalSheetJson = 5;
  bool shouldFilterOriginalSheetJson = 18;
  string revisedSheetJson = 6;
  bool shouldFilterRevisedSheetJson = 19;
  string originalDetailJson = 7;
  bool shouldFilterOriginalDetailJson = 20;
  string revisedDetailJson = 8;
  bool shouldFilterRevisedDetailJson = 21;
  int32 type = 9;
  int32 status = 10;
  string operator = 11;
  int32 creationSource = 12;
  int32 createdBy = 13;
  int64 createdAt = 14;
  int32 updatedBy = 15;
  int64 updatedAt = 16;
  int32 updateSource = 17;
}

message CreateClientInventoryOperationRecordRpcResponse {
  int32 id = 1;
  bool isCreate = 2;
}

message SingleCreateClientInventoryOperationRecordRpcRequest {
  string originalSheetJson = 1;
  bool shouldFilterOriginalSheetJson = 2;
  string revisedSheetJson = 3;
  bool shouldFilterRevisedSheetJson = 4;
  string originalDetailJson = 5;
  bool shouldFilterOriginalDetailJson = 6;
  string revisedDetailJson = 7;
  bool shouldFilterRevisedDetailJson = 8;
  int32 sourceId = 9;
}

message CreateClientInventoryOperationRecordsRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 sourceType = 4;
  int32 type = 5;
  int32 status = 6;
  string operator = 7;
  int32 creationSource = 8;
  int32 createdBy = 9;
  int64 createdAt = 10;
  int32 updatedBy = 11;
  int64 updatedAt = 12;
  int32 updateSource = 13;
  repeated SingleCreateClientInventoryOperationRecordRpcRequest singleCreateClientInventoryOperationRecord = 14;
}

message CreateClientInventoryOperationRecordsRpcResponse {
  int32 id = 1;
  bool isCreate = 2;
}



message CompleteInventoryDebitSheetAndItemsRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  InventoryDebitSheetApproveStatus approveStatus = 3;
  int64 outDate = 4;
  int32 approveOpId = 5;
  string approveOpName = 6;
  int64 approveDate = 7;
  bool shouldUpdateDestinationId = 8;
  int32 destinationId = 9;
  bool shouldUpdateDestination = 10;
  string destination = 12;
  bool shouldUpdateOutWarehouseOpName = 13;
  string outWarehouseOpName = 14;
  bool shouldUpdateNote = 15;
  string note = 16;
  bool shouldUpdatePickOpName = 17;
  string pickOpName = 18;
  bool shouldUpdateOutWarehouseType = 19;
  InventoryDebitSheetType outWarehouseType = 20;
  bool shouldUpdateDamageReasonId = 21;
  int32 damageReasonId = 22;
  bool shouldUpdateDamageReason = 23;
  string damageReason = 24;
  bool shouldUpdateReturnReasonId = 25;
  int32 returnReasonId = 26;
  bool shouldUpdateReturnReason = 27;
  string returnReason = 28;
  bool shouldUpdateApplyOpId = 29;
  int32 applyOpId = 30;
  bool shouldUpdateApplyOpName = 31;
  string applyOpName = 32;
  repeated CompleteInventoryDebitSheetItem items = 33;
}

message CompleteInventoryDebitSheetItem {
  int32 id = 1;
  string realOutQuantity = 2;
}

message CompleteInventoryDebitSheetAndItemsRpcResponse {
  bool isUpdated = 1;
}

message InventoryDebitSheetsDeleteByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message InventoryDebitSheetsDeleteByIdsRpcResponse {
  bool isDeleted = 1;
}

message UpdateStockRelationNotInWarehouseRpcRequest {
  int32 relationId = 1;
  int32 enterpriseId = 2;
  bool needUpdateQuantity = 3;
  string quantity = 4;
  bool needUpdatePrice = 5;
  string price = 6;
  bool needUpdateSumPrice = 7;
  string sumPrice = 8;
}

message UpdateStockRelationNotInWarehouseRpcResponse {
  bool isUpdated = 1;
}

message GetPaginatedBatchTraceAbilityByConditionRpcRequest{
  int32 enterpriseId = 1;
  int32 pn = 2;
  int32 pz = 3;
  int64 startAt = 4;
  int64 endAt = 5;
  repeated int32 warehouseIds = 6;
  repeated int32 supplierIds = 7;
  repeated int32 stallIds = 8;
  repeated int32 skuIds = 9;
  int32 clientId = 10;
  string skuKeyword = 11;
  string purchaseSource = 12;
}

message GetPaginatedBatchTraceAbilityByConditionRpcResponse{
  int32 count = 1;
  repeated SingleBatchTraceAbilityRpcResponse responses = 2;
}

message SingleBatchTraceAbilityRpcResponse{
  int32 id = 1;
  int64 storageDate = 2;
  string batch = 3;
  int32 warehouseId = 4;
  string warehouseName = 5;
  int32 inWarehouseSourceId = 6;
  string inWarehouseSource = 7;
  int32 stallId = 8;
  string stallName = 9;
  int32 skuId = 10;
  string skuName = 11;
}
message GetPaginatedInventoryPurchaseSourcesByConditionRpcRequest{
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 pn = 3;
  int32 pz = 4;
  string keyword = 5;
}

message GetPaginatedInventoryPurchaseSourcesByConditionRpcResponse{
  int32 count = 1;
  repeated SinglePurchaseSourceRpcResponse responses = 2;
}

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

message GetTraceAbilitiesByStockIdRpcRequest{
  int32 enterpriseId = 1;
  int32 stockId = 2;
  int32 sourceType = 3;
}

message GetTraceAbilitiesByStockIdRpcResponse{
  repeated SingleTraceAbilityRpcResponse traceAbilities = 1;
}

message SingleTraceAbilityRpcResponse{
  int32 traceabilityId = 1 ;
  int32 creationSource = 2 ;
  string supplierName = 3 ;
  int64 productionDate = 4 ;
  string code = 5 ;
  string country = 6 ;
  string province = 7 ;
  string city = 8 ;
  repeated SingleTraceAbilityImageUrlRpcResponse imageUrls = 9 ;
}

message SingleTraceAbilityImageUrlRpcResponse{
  int32 imageId = 1;
  string image = 2;
}

message GetBatchTraceRelationsByStockIdRpcRequest{
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 stockId = 3;
}

message GetBatchTraceRelationsByStockIdRpcResponse{
  repeated SingleBatchTraceRelationRpcResponse batchTraceRelations = 1;
}

message SingleBatchTraceRelationRpcResponse{
  int32 id = 1;
  int32 stockId = 2;
  int32 aid = 3;
  int32 pid = 4;
  string quantity = 5;
  string sumPrice = 6;
  string price = 7;
  int32 warehouseId = 8;
  string warehouseName = 9;
  CStockRelationType type = 10;
  int64 processedAt = 11;
  string sheetCode = 12;
  int32 sheetId = 13;
  string sheetType = 14;
  string destination = 15;
}

message GetInWarehouseSourceByStockIdsRpcRequest{
  int32 enterpriseId = 1;
  int32 clientId = 2;
  repeated int32 stockId = 3;
}

message GetInWarehouseSourceByStockIdsRpcResponse{
  repeated GetInWarehouseSourceByStockIdsSingleRpcResponse inWarehouseSources = 1;
}

message GetInWarehouseSourceByStockIdsSingleRpcResponse{
  int32  stockId = 1;
  string inWarehouseSource = 2;
}

message SingleDamageReasonRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string name = 4;
  int32 status = 5;
  string note = 6;
  int64 createdAt = 7;
  int64 updatedAt = 8;
  int64 deletedAt = 9;
  string guid = 10;
}

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

message GetDamageReasonByIdRpcResponse {
  SingleDamageReasonRpcResponse response = 1;
}

message GetDamageReasonsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
}

message GetDamageReasonsByIdsRpcResponse {
  repeated SingleDamageReasonRpcResponse responses = 1;
}

message GetAllDamageReasonsRpcRequest {
  int32 enterpriseId = 1;
}

message GetAllDamageReasonsRpcResponse {
  repeated SingleDamageReasonRpcResponse responses = 1;
}

message DamageReasonCreation{
  bool shouldCreateClientId = 1;
  int32 clientId = 2;
  string name = 3;
  int32 status = 4;
  bool shouldCreateNote = 5;
  string note = 6;
  string guid = 7;
}

message CreateDamageReasonRpcRequest {
  DamageReasonCreation creation = 1;
  int32 enterpriseId = 2;
}

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

message BatchCreateDamageReasonsRpcRequest {
  repeated DamageReasonCreation creations = 1;
  int32 enterpriseId = 2;
}

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

message DamageReasonModification {
  int32 id = 1;
  bool shouldUpdateClientId = 2;
  int32 clientId = 3;
  bool shouldUpdateName = 4;
  string name = 5;
  bool shouldUpdateStatus = 6;
  int32 status = 7;
  bool shouldUpdateNote = 8;
  string note = 9;
  bool shouldUpdateGuid = 10;
  string guid = 11;
}

message UpdateDamageReasonRpcRequest {
  DamageReasonModification modification = 1;
  int32 enterpriseId = 2;
}

message UpdateDamageReasonRpcResponse {
  bool isUpdated = 1;
}

message BatchUpdateDamageReasonsRpcRequest {
  repeated DamageReasonModification modifications = 1;
  int32 enterpriseId = 2;
}

message BatchUpdateDamageReasonsRpcResponse {
  bool isUpdated = 1;
}

message DeleteDamageReasonsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
}

message DeleteDamageReasonsRpcResponse {
  bool isDeleted = 1;
}

message SingleReturnReasonRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string name = 4;
  int32 status = 5;
  string note = 6;
  int64 createdAt = 7;
  int64 updatedAt = 8;
  int64 deletedAt = 9;
  string guid = 10;
}

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

message GetReturnReasonByIdRpcResponse {
  SingleReturnReasonRpcResponse response = 1;
}

message GetReturnReasonsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
}

message GetReturnReasonsByIdsRpcResponse {
  repeated SingleReturnReasonRpcResponse responses = 1;
}

message GetAllReturnReasonsRpcRequest {
  int32 enterpriseId = 1;
}

message GetAllReturnReasonsRpcResponse {
  repeated SingleReturnReasonRpcResponse responses = 1;
}

message ReturnReasonCreation{
  bool shouldCreateClientId = 1;
  int32 clientId = 2;
  string name = 3;
  int32 status = 4;
  bool shouldCreateNote = 5;
  string note = 6;
  string guid = 7;
}

message CreateReturnReasonRpcRequest {
  ReturnReasonCreation creation = 1;
  int32 enterpriseId = 2;
}

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

message BatchCreateReturnReasonsRpcRequest {
  repeated ReturnReasonCreation creations = 1;
  int32 enterpriseId = 2;
}

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

message ReturnReasonModification {
  int32 id = 1;
  bool shouldUpdateClientId = 2;
  int32 clientId = 3;
  bool shouldUpdateName = 4;
  string name = 5;
  bool shouldUpdateStatus = 6;
  int32 status = 7;
  bool shouldUpdateNote = 8;
  string note = 9;
  bool shouldUpdateGuid = 10;
  string guid = 11;
}

message UpdateReturnReasonRpcRequest {
  ReturnReasonModification modification = 1;
  int32 enterpriseId = 2;
}

message UpdateReturnReasonRpcResponse {
  bool isUpdated = 1;
}

message BatchUpdateReturnReasonsRpcRequest {
  repeated ReturnReasonModification modifications = 1;
  int32 enterpriseId = 2;
}

message BatchUpdateReturnReasonsRpcResponse {
  bool isUpdated = 1;
}

message DeleteReturnReasonsByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
}

message DeleteReturnReasonsRpcResponse {
  bool isDeleted = 1;
}

message ReplenishmentFormOrdersUpdateRpcRequest {
  repeated SingleReplenishmentCreditSheetCreateRpcRequest creations = 1;
}

message SingleReplenishmentCreditSheetCreateRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  string warehouseName = 4;
  string inWarehouseOpName = 5;
  string inWarehouseSource = 6;
  int64 preStoreDate = 7;
  int64 storeDate = 8;
  int32 orderId = 9;
  string orderCode = 10;
  int64 deliveryDate = 11;
  int32 applyOpId = 12;
  string applyOpName = 13;
  string note = 15;
  GenSource genSource = 16;
  InventoryCreditSheetType inWarehouseType = 17;
  int32 inWarehouseSourceId = 19;
  string guid = 20;
  int32 stallId = 21;
  repeated ReplenishmentCreditItemCreationRpcRequest creditItems = 24;
}

message ReplenishmentCreditItemCreationRpcRequest {
  int32 skuId = 1;
  string quantity = 2;
  int32 replenishId = 3;
  int32 blockId = 4;
  int64 productDate = 5;
  int64 expirationDate = 6;
  string price = 7;
  int32 purchasePriceId = 8;
  string sumPrice = 9;
}

message ReplenishmentFormOrdersUpdateRpcResponse {
  bool isCreated = 1;
}

message SingleAllocationWarehouseOrderRefRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 outWarehouseOrderId = 3;
  int32 inWarehouseOrderId = 4;
  int32 outWarehouseOrderDetailId = 5;
  int32 inWarehouseOrderDetailId = 6;
  int32 outWarehouseOrderRelationId = 7;
  int32 inWarehouseOrderRelationId = 8;
  int32 skuId = 9;
  AllocationWarehouseOrderTypeEnum type = 10;
  int64 createdAt = 11;
  int32 creationSource = 12;
  int32 createdBy = 13;
  int64 updateAt = 14;
  int32 updateSource = 15;
  int32 updatedBy = 16;
}

enum AllocationWarehouseOrderTypeEnum {
  UNKNOWN = 0;
  OUT_TO_IN = 1; //出库到入库
  IN_TO_OUT = 2; //入库到出库
}

message GetAllocationWarehouseOrderRefsByConditionRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterOutWarehouseOrderIds = 2;
  repeated int32 outWarehouseOrderIds = 3;
  bool shouldFilterInWarehouseOrderIds = 4;
  repeated int32 inWarehouseOrderIds = 5;
  bool shouldFilterOutWarehouseOrderDetailIds = 6;
  repeated int32 outWarehouseOrderDetailIds = 7;
  bool shouldFilterInWarehouseOrderDetailIds = 8;
  repeated int32 inWarehouseOrderDetailIds = 9;
  bool shouldFilterOutWarehouseOrderRelationIds = 10;
  repeated int32 outWarehouseOrderRelationIds = 11;
  bool shouldFilterInWarehouseOrderRelationIds = 12;
  repeated int32 inWarehouseOrderRelationIds = 13;
  bool shouldFilterSkuIds = 14;
  repeated int32 skuIds = 15;
  bool shouldFilterType = 16;
  AllocationWarehouseOrderTypeEnum type = 17;
}

message GetAllocationWarehouseOrderRefsByConditionRpcResponse {
  repeated SingleAllocationWarehouseOrderRefRpcResponse responses = 1;
}

message AllocationWarehouseOrderRefCreation {
  int32 outWarehouseOrderId = 1;
  int32 inWarehouseOrderId = 2;
  int32 outWarehouseOrderDetailId = 3;
  int32 inWarehouseOrderDetailId = 4;
  bool shouldCreateOutWarehouseOrderRelationId = 5;
  int32 outWarehouseOrderRelationId = 6;
  bool shouldCreateInWarehouseOrderRelationId = 7;
  int32 inWarehouseOrderRelationId = 8;
  int32 skuId = 9;
  AllocationWarehouseOrderTypeEnum type = 10;
}

message BatchCreateAllocationWarehouseOrderRefsRpcRequest {
  repeated AllocationWarehouseOrderRefCreation creations = 1;
  int32 enterpriseId = 2;
  int32 createdBy = 3;
  int32 creationSource = 4;
}

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

message AllocationWarehouseOrderRefModification {
  int32 id = 1;
  bool shouldUpdateOutWarehouseOrderId = 2;
  int32 outWarehouseOrderId = 3;
  bool shouldUpdateInWarehouseOrderId = 4;
  int32 inWarehouseOrderId = 5;
  bool shouldUpdateOutWarehouseOrderDetailId = 6;
  int32 outWarehouseOrderDetailId = 7;
  bool shouldUpdateInWarehouseOrderDetailId = 8;
  int32 inWarehouseOrderDetailId = 9;
  bool shouldUpdateOutWarehouseOrderRelationId = 10;
  int32 outWarehouseOrderRelationId = 11;
  bool shouldUpdateInWarehouseOrderRelationId = 12;
  int32 inWarehouseOrderRelationId = 13;
  bool shouldUpdateSkuId = 14;
  int32 skuId = 15;
  bool shouldUpdateType = 16;
  AllocationWarehouseOrderTypeEnum type = 17;
}

message BatchUpdateAllocationWarehouseOrderRefsRpcRequest {
  repeated AllocationWarehouseOrderRefModification modifications = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  int32 updateSource = 4;
}

message BatchUpdateAllocationWarehouseOrderRefsRpcResponse {
  bool isUpdated = 1;
}

message InventoryCheckSheetDeleteByIdRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
}

message InventoryCheckSheetDeleteByIdRpcResponse {
  bool isDeleted = 1;
}

message PurchasePriceVersionsCreationRpcRequest {
  repeated SinglePurchasePriceVersionCreationRpcRequest creations = 1;
}

message SinglePurchasePriceVersionCreationRpcRequest {
  int32 enterpriseId = 1;
  int32 clientId = 2;
  string orderCode = 4;
  int32 skuId = 5;
  string price = 6;
  string guid = 7;
  string base = 8;
}

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

message PurchasePriceVersionsGetByConditionRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterClientId = 2;
  int32 clientId = 3;
  bool shouldFilterCodes = 4;
  repeated string codes = 5;
  bool shouldFilterOrderCodes = 6;
  repeated string orderCodes = 7;
  bool shouldFilterSkuIds = 8;
  repeated int32 skuIds = 9;
  bool shouldFilterPrices = 10;
  repeated string prices = 11;
  bool shouldFilterGuids = 12;
  repeated string guids = 13;
  bool shouldFilterBases = 14;
  repeated string bases = 15;
  bool includeDeleted = 16;
}

message PurchasePriceVersionsGetByConditionRpcResponse {
  repeated SinglePurchasePriceVersionRpcResponse responses = 1;
}

message SinglePurchasePriceVersionRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  string code = 4;
  int32 skuId = 5;
  string orderCode = 6;
  string price = 7;
  int64 createdAt = 8;
  int64 updatedAt = 9;
  bool isDeleted = 10;
  string guid = 11;
  string base = 12;
}

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

message PurchasePriceVersionsGetByIdsRpcResponse {
  repeated SinglePurchasePriceVersionRpcResponse responses = 1;
}

enum SynchronizationType {
  UNKNOWN_SYNCHRONIZATION_TYPE = 0;
  LAG_SYNCHRONIZATION = 1000002;
}

message CStockRelationCreation{
  string guid = 1;
  int32 clientId = 2;
  int32 warehouseId = 3;
  int32 orderDetailId = 4;
  string orderDetailGuid = 5;
  int32 skuId = 6;
  bool shouldCreateWblockId = 7;
  int32 wblockId = 8;
  bool shouldCreateWstockId = 9;
  int32 wstockId = 10;
  bool shouldCreateProduceUnit = 11;
  string produceUnit = 12;
  bool shouldCreateProductDate = 13;
  int64 productDate = 14;
  bool shouldCreateExpirationDate = 15;
  int64 expirationDate = 16;
  int32 cableTicket = 17;
  string quantity = 18;
  string batch = 19;
  int32 aid = 20;
  int32 pid = 21;
  string sumPrice = 22;
  string price = 23;
  string stock = 24;
  int32 base = 25;
  int32 purchasePriceVersionId = 26;
  int32 purchasePriceId = 27;
  string purchasePriceVersionGuid = 28;
  CStockRelationType type = 29;
  CStockRelationStatus status = 30;
  bool shouldCreateProcessedAt = 31;
  int64 processedAt = 32;
  bool shouldCreateOperationTime = 33;
  int64 operationTime = 34;
  bool isFullDebited = 35;
}

message BatchCreateCStockRelationsRpcRequest {
  repeated CStockRelationCreation creations = 1;
  int32 enterpriseId = 2;
}

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

message CreateClientsRpcRequest {
  int32 enterpriseId = 1;
  repeated SingleClientCreationRpcRequest creations = 2;
  int32 creationSource = 3;
}

message DataPushClientsRpcRequest {
  int32 enterpriseId = 1;
  SingleCreateClientsRpcRequest creation = 2;
  int32 creationSource = 3;
  string op = 4;
}

message SingleCreateClientsRpcRequest {
  string code = 1;
  string name = 2;
  bool shouldName = 3;
  string contractSubjectInfo = 4;
  bool shouldContractSubjectInfo = 5;
  string status = 6;
  bool shouldStatus = 7;
  string province = 8;
  bool shouldProvince = 9;
  string city = 10;
  bool shouldCity = 11;
  string area = 12;
  bool shouldArea = 13;
  string address = 14;
  bool shouldAddress = 15;
  int64 receiveTimeStart = 16;
  bool shouldReceiveTimeStart = 17;
  int64 receiveTimeEnd = 18;
  bool shouldReceiveTimeEnd = 19;
  string operatorName = 20;
  bool shouldOperatorName = 21;
  string phone = 22;
  bool shouldPhone = 23;
  int32 parentId = 24;
  int32 id = 25;
}

message SingleClientCreationRpcRequest {
  string code = 1;
  int32 parentId = 2;
  string name = 3;
  bool isSetETag = 4;
  string eTag = 5;
  bool isSetPickTermName = 6;
  string pickTermName = 7;
  string province = 8;
  string country = 9;
  string city = 10;
  string area = 11;
  string address = 12;
  string operatorName = 13;
  string areaManager = 14;
  string phone = 15;
  bool isSetAreaPhone = 16;
  string areaPhone = 17;
  int32 enterpriseOperatorId = 18;
  string profitRate = 19;
  bool isSetRemark = 20;
  string remark = 21;
  int32 status = 22;
  bool isMaster = 23;
  bool isBom = 24;
  bool isSetReceiveTime = 25;
  int64 receiveTimeStart = 26;
  int64 receiveTimeEnd = 27;
  string email = 28;
  string routeSort = 29;
  string note = 30;
  int32 groupId = 31;
  string groupName = 32;
  int32 sortingTeamId = 33;
  int32 advancePaymentId = 34;
  string permitAdvancePayment = 35;
  string canManageStockByWechat = 36;
  bool allowedPaid = 37;
  int32 warehouseId = 38;
  bool isSetOrderTime = 39;
  string orderTimeConfigJson = 40;
  int64 scheduledStartDate = 41;
  int64 scheduledEndDate = 42;
  string scheduledAdvanceLenth = 43;
  bool hasScheduledOrder = 44;
  int32 scheduledDeadline = 45;
  bool isSNSShoppingClient = 46;
  bool isEnableAutoSync = 47;
  string deviceNumber = 48;
  string contractSubjectInfo = 49;
  string fireSafetyCertificateInfo = 50;
  string foodHygieneLicenseInfo = 51;
  string businessLicenseInfo = 52;
  string IDCardInfo = 53;
  bool isOrderCashRegister = 54;
  string MTId = 55;
  string ELMId = 56;
  string DYId = 57;
  string QBId = 58;
  string QBPassword = 59;
  int32 signingRegionId = 60;
  string signingRegionAddress = 64;
  int32 regionId = 61;
  ClientType type = 62;
  bool isSetType = 63;
  string QBName = 65;
}

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

message DataPushClientsRpcResponse {
  bool isSuccessful = 1;
  int32 id = 2;
}

message BatchUpdateClientsRpcRequest {
  int32 enterpriseId = 1;
  repeated SingleClientUpdateRpcRequest updates = 2;
}

message SingleClientUpdateRpcRequest {
  int32 id = 1;
  bool needUpdateName = 2;
  string name = 3;
  bool needUpdateETag = 4;
  string eTag = 5;
  bool needUpdatePickTermName = 6;
  string pickTermName = 7;
  bool needUpdateAddress = 8;
  string province = 9;
  string city = 10;
  string area = 11;
  string address = 12;
  bool needUpdateOperatorName = 13;
  string operatorName = 14;
  bool needUpdateAreaManager = 15;
  string areaManager = 16;
  bool needUpdatePhone = 17;
  string phone = 18;
  bool needUpdateAreaPhone = 19;
  string areaPhone = 20;
  bool needUpdateEnterpriseOperatorId = 21;
  int32 enterpriseOperatorId = 22;
  bool needUpdateProfitRate = 23;
  string profitRate = 24;
  bool needUpdateRemark = 25;
  string remark = 26;
  bool needUpdateReceiveTime = 27;
  int64 receiveTimeStart = 28;
  int64 receiveTimeEnd = 29;
  bool needUpdateGroupId = 30;
  int32 groupId = 31;
  string fireSafetyCertificateInfo = 32;
  string foodHygieneLicenseInfo = 33;
  string businessLicenseInfo = 34;
  string IDCardInfo = 35;
  bool isOrderCashRegister = 36;
  string MTId = 37;
  string ELMId = 38;
  string DYId = 39;
  string QBId = 40;
  string QBPassword = 41;
  int32 signingRegionId = 42;
  string signingRegionAddress = 58;
  int32 regionId = 43;
  ClientType type = 44;
  bool needUpdateFireSafetyCertificateInfo = 45;
  bool needUpdateFoodHygieneLicenseInfo = 46;
  bool needUpdateBusinessLicenseInfo = 47;
  bool needUpdateIDCardInfo = 48;
  bool needUpdateIsOrderCashRegister = 49;
  bool needUpdateMTId = 50;
  bool needUpdateELMId = 51;
  bool needUpdateDYId = 52;
  bool needUpdateQBId = 53;
  bool needUpdateQBPassword = 54;
  bool needUpdateSigningRegionId = 55;
  bool needUpdateSigningRegionAddress = 59;
  bool needUpdateRegionId = 56;
  bool needUpdateType = 57;
  bool needUpdateCode = 60;
  string code = 61;
  bool needUpdateQBName = 64;
  string QBName = 65;
}

enum ClientType {
  UNKNOWN_CLIENT_TYPE = 0;
  FRANCHISEE_CLIENT_TYPE = 1;
  DIRECT_SALE_CLIENT_TYPE = 2;
}


message BatchUpdateClientsRpcResponse {
  bool isSuccessful = 1;
}

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

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

message GetStallMaxCodeByPrefixAndLengthRpcResponse{
  string maxCode = 1;
}

message GetClientMaxCodeByPrefixAndLengthRpcResponse{
  string maxCode = 1;
}

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

message GetStallsByEnterpriseIdRpcResponse {
  repeated SingleClientRpcResponse responses = 1;
}

message SingleClientTableCodeRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 clientId = 3;
  int32 stallId = 4;
  string code = 5;
  string name = 6;
  string url = 7;
  int32 createdBy = 8;
  int64 createdAt = 9;
  int32 creationSource = 10;
  int32 updatedBy = 11;
  int64 updatedAt = 12;
  int32 updateSource = 13;
  bool isDeleted = 14;
}

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

message GetClientTableCodeByIdRpcResponse {
  SingleClientTableCodeRpcResponse response = 1;
}

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

message GetClientTableCodesByIdsRpcResponse {
  repeated SingleClientTableCodeRpcResponse responses = 1;
}

message QueryClientTableCodesByConditionRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterClientIds = 2;
  repeated int32 clientIds = 3;
  bool shouldFilterStallIds = 4;
  repeated int32 stallIds = 5;
  bool shouldFilterCode = 6;
  string code = 7;
  bool shouldFilterName = 8;
  string name = 9;
  bool includeDeleted = 10;
}

message QueryClientTableCodesByConditionRpcResponse {
  repeated SingleClientTableCodeRpcResponse responses = 1;
}

message ClientTableCodeCreation{
  int32 clientId = 1;
  int32 stallId = 2;
  string code = 3;
  string name = 4;
  string url = 5;
}

message CreateClientTableCodeRpcRequest {
  ClientTableCodeCreation creation = 1;
  int32 enterpriseId = 2;
  int32 createdBy = 3;
  int32 creationSource = 4;
}

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

message BatchCreateClientTableCodesRpcRequest {
  repeated ClientTableCodeCreation creations = 1;
  int32 enterpriseId = 2;
  int32 createdBy = 3;
  int32 creationSource = 4;
}

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

message ClientTableCodeModification {
  int32 id = 1;
  bool shouldUpdateClientId = 2;
  int32 clientId = 3;
  bool shouldUpdateStallId = 4;
  int32 stallId = 5;
  bool shouldUpdateCode = 6;
  string code = 7;
  bool shouldUpdateName = 8;
  string name = 9;
  bool shouldUpdateUrl = 10;
  string url = 11;
}

message UpdateClientTableCodeRpcRequest {
  ClientTableCodeModification modification = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  int32 updateSource = 4;
}

message UpdateClientTableCodeRpcResponse {
  bool isUpdated = 1;
}

message BatchUpdateClientTableCodesRpcRequest {
  repeated ClientTableCodeModification modifications = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  int32 updateSource = 4;
}

message BatchUpdateClientTableCodesRpcResponse {
  bool isUpdated = 1;
}

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

message DeleteClientTableCodesRpcResponse {
  bool isDeleted = 1;
}