afa7ac066f3cbe961c42e426f8622d3a2cbe6be4.svn-base 141 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
/**
 * Copyright © 2015-2018 ODM All rights reserved.
 */
package com.thinkgem.jeesite.modules.reg.web.base;
//-----------------------------------------
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.reg.dao.bus.RegBusZdjbxxrelationywhDao;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdbhqk;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdjbxx;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZrz;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusJsydsyq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusNydsyq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusQlr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusTdsyq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusYwr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusZdjbxxRelationYwh;
import com.thinkgem.jeesite.modules.reg.entity.qjxt.BdcZdxx;
import com.thinkgem.jeesite.modules.reg.service.base.RegBasePersonService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdbhqkService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdjbxxService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZrzService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusHisBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusJsydsyqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusNydsyqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusQlrService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusTdsyqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusYwrService;
import com.thinkgem.jeesite.modules.reg.service.qjxt.BdcQlrxxService;
import com.thinkgem.jeesite.modules.reg.service.qjxt.BdcZdxxService;
import com.thinkgem.jeesite.modules.sys.entity.Dict;
import com.thinkgem.jeesite.modules.sys.service.DictService;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;
import com.thinkgem.jeesite.modules.title.po.ZdjbxxDto;

/**
 * 宗地基本信息表单维护Controller
 * @author xuyg
 * @version 2015-10-12
 */
@Controller
@RequestMapping(value = "${adminPath}/reg/base/regBaseZdjbxx")
public class RegBaseZdjbxxController extends BaseController {

	@Autowired
	private RegBaseZdjbxxService regBaseZdjbxxService;

	@Autowired
	private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
	 
	@Autowired
	private RegBusZdjbxxrelationywhDao regBusZdjbxxrelationywhDao;	
	@Autowired
	private RegBaseZdbhqkService regBaseZdbhqkService;
	
	@Autowired
	private RegBusQlrService regBusQlrService;
	@Autowired
	private RegBusYwrService regBusYwrService;
	
	@Autowired
	private RegBasePersonService regBasePersonService;
	@Autowired
	private RegBusJsydsyqService regBusJsydsyqService;
	@Autowired
	private RegBusTdsyqService regBusTdsyqService;
	@Autowired
	private RegBaseZrzService regBaseZrzService;
	@Autowired
	private DictService dictService;
	@Autowired
	private RegBusNydsyqService regBusNydsyqService;
	@Autowired
	private RegBusHisBdcqzsdjxxService regBusHisBdcqzsdjxxService;
	@Autowired
	private BdcZdxxService bdczdxxService;
	@Autowired
	private BdcQlrxxService bdcQlrxxService;
	
	@ModelAttribute
	public RegBaseZdjbxx get(@RequestParam(required=false) String id) {
		RegBaseZdjbxx entity = null;
		if (StringUtils.isNotBlank(id)){
			entity = regBaseZdjbxxService.get(id);
		}
		if (entity == null){
			entity = new RegBaseZdjbxx();
		}
		return entity;
	}


	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = {"list", ""})
	public String list(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		Page<RegBaseZdjbxx> page = new Page<RegBaseZdjbxx>();
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("djlx", request.getParameter("djlx"));
			if(request.getParameter("djlx").equals("202")){
				regBaseZdjbxx.setQllx("1");
			}else if(request.getParameter("djlx").equals("201")){
				regBaseZdjbxx.setQllx("3");
			}else if(request.getParameter("djlx").equals("203")){
				regBaseZdjbxx.setQllx("7");
			}else if(request.getParameter("djlx").equals("204")){
				regBaseZdjbxx.setQllx("5");
			}else if(request.getParameter("djlx").equals("208")){
				regBaseZdjbxx.setQllx("9");
			}
		}
		
		if("1".equals(request.getParameter("bz"))){
			model.addAttribute("bz", request.getParameter("bz"));
			regBaseZdjbxx.setQllx("19");
		}else{
			regBaseZdjbxx.setIslogout("3");
			regBaseZdjbxx.setIsaudit("99");
		}
		if(StringUtils.isNotBlank(request.getParameter("syq"))){
			model.addAttribute("syq", request.getParameter("syq"));
		}
		page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx);
		model.addAttribute("page", page);
		if(StringUtils.isNotBlank(request.getParameter("YWH"))){
			model.addAttribute("YWH", request.getParameter("YWH"));
		}
		if(StringUtils.isNotBlank(request.getParameter("BCDYH"))){
			model.addAttribute("BCDYH", request.getParameter("BCDYH"));
		}
		if(StringUtils.isNotBlank(request.getParameter("flag"))){
			model.addAttribute("flag", request.getParameter("flag"));
		}
		if(StringUtils.isNotBlank(request.getParameter("isNyd"))){
			model.addAttribute("isNyd", request.getParameter("isNyd"));
		}
		return "modules/reg/base/regBaseZdjbxxList";
	}

	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "alllist")
	public String alllist(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		regBaseZdjbxx.setIslogout("13");
		Page<RegBaseZdjbxx> page = new Page<RegBaseZdjbxx>();
		page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx);
		model.addAttribute("page", page);
		return "modules/reg/base/regBaseZdjbxxAllList";
	}
	
	/***
	* @Title: fwlinklist 
	* @Description: 宗地房屋关联选择信息
	* @param @param regBaseZdjbxx
	* @param @param request
	* @param @param response
	* @param @param model
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "fwlinklist")
	public String fwlinklist(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		String cxmid = request.getParameter("CXMID");//当前项目ID
		//选择宗地基本信息的条件是,如果XMID已经有了而且不是当前传过来的XMID,说明已经此宗地已经有项目了,就要过滤出去
		regBaseZdjbxx.setXmid(cxmid);
		regBaseZdjbxx.setIslogout("0");
		regBaseZdjbxx.setIschafeng("0");
		Page<RegBaseZdjbxx> page = new Page<RegBaseZdjbxx>(); 
		page = regBaseZdjbxxService.findFwlinkPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx);
		model.addAttribute("page", page);
		if(StringUtils.isNotBlank(request.getParameter("YWH"))){
			model.addAttribute("YWH", request.getParameter("YWH"));
		} 
		if(StringUtils.isNotBlank(cxmid)){
			model.addAttribute("XMID", cxmid);
		} 
		return "modules/reg/base/regBaseZdjbxxFwlinkList";
	}

	
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "choiceList")
	public String choiceList(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		//String djlx = request.getParameter("DJLX");
		Page<RegBaseZdjbxx> page = new Page<RegBaseZdjbxx>();
		//if(djlx.equals("405") || djlx.equals("406") || djlx.equals("407")){
		//	page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx);
		//}else{
			//if(StringUtils.isNotBlank(request.getParameter("ZDXXXZ"))){
			List<String> dbedZddms = new ArrayList<String>();
			dbedZddms = regBusBdcqzsdjxxService.getDbedZddm();
			regBaseZdjbxx.setIslogout("0");
			page = regBaseZdjbxxService.findChoicePage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx, dbedZddms);
			//model.addAttribute("ZDXXXZ", "1");
			//}  
		//}
		model.addAttribute("page", page);
		if(StringUtils.isNotBlank(request.getParameter("YWH"))){
			model.addAttribute("YWH", request.getParameter("YWH"));
		}
		return "modules/reg/base/regBaseZdjbxxChoiceList";
	}
	
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "booklist")
	public String booklist(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		regBaseZdjbxx.setIslogout("13");
		Page<RegBaseZdjbxx> page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx); 
		model.addAttribute("page", page);
		return "modules/reg/report/regReportTdbooklist";
	} 

	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "search")
	@ResponseBody
	public ModelMap search(RegBaseZdjbxx regBaseZdjbxx,HttpServletRequest request, Model model) {
		String zddmvalue = request.getParameter("zddmvalue");
		String bdcdyhvalue=request.getParameter("bdcdyhvalue");
		String qlrvalue=request.getParameter("qlrvalue");
		String f="0";
		ModelMap modelMap = new ModelMap();
		if(StringUtils.isNotBlank(zddmvalue)||StringUtils.isNotBlank(bdcdyhvalue)||StringUtils.isNotBlank(qlrvalue)){
			regBaseZdjbxx.setIslogout("0");
			regBaseZdjbxx.setZddm(zddmvalue);	
			regBaseZdjbxx.setBdcdyh(bdcdyhvalue);	
			regBaseZdjbxx.setQlrxm(qlrvalue);	
		    List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxx);
			for(int i=0;i<findList.size();i++){
				regBaseZdjbxx = findList.get(0);
			}	
			if(findList.size()>0) f="1";
		}
		if(f=="1")
		{
			model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
	        modelMap.put("data", regBaseZdjbxx);			
		}
		else
		{ modelMap.put("data", "1");}
	
	    return modelMap;
        
 }
	/**
	* @Title: listView 
	* @Description: 土地选择面板-需要根据坐落的不同进行筛选 
	* @param @param regBaseZdjbxx
	* @param @param request
	* @param @param response
	* @param @param model
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "listView")
	public String listView(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		String xzqxStr = request.getParameter("xzqx");
		String djqStr = request.getParameter("djq");
		String djzqStr = request.getParameter("djzq");
		if("0".equals(xzqxStr)){
			xzqxStr = "";
		}
		if("0".equals(djqStr)){
			djqStr = "";
		}
		if("0".equals(djzqStr)){
			djzqStr = "";
		}
		//行政区县不为空时
		if(StringUtils.isNotBlank(xzqxStr)){
			//地籍区为空时,就说明只选择了行政区县做为查询条件
			if(StringUtils.isBlank(djqStr)){
				regBaseZdjbxx.setZddm(xzqxStr);
				//model.addAttribute("choiceinfo", DictUtils.getDictLabel(xzqxStr, "reg_bus_xq", ""));
			}else{
				//地籍区不为空时,地籍子区为空时,就说明选择了行政区县和地籍区做为查询条件
				if(StringUtils.isBlank(djzqStr)){
					regBaseZdjbxx.setZddm(djqStr);
					//model.addAttribute("choiceinfo", DictUtils.getDictLabel(djqStr, "reg_bus_djq", ""));
				}else{
					//地籍子区也不为空时,就说明选择了行政区县和地籍区以及地籍子区做为查询条件
					regBaseZdjbxx.setZddm(djzqStr);
					//model.addAttribute("choiceinfo", DictUtils.getDictLabel(djqStr, "reg_bus_djzq", ""));
				}
			}
		}
		String ywhStr = request.getParameter("ywh");
		if(StringUtils.isNotBlank(ywhStr)){
			model.addAttribute("YWH", ywhStr);
		}
		regBaseZdjbxx.setIslogout("0");
		//土地登记簿使用
		if(StringUtils.isNotBlank(request.getParameter("tdbook"))){
			model.addAttribute("tdbook", "1");
		}
		Page<RegBaseZdjbxx> page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx); 
		model.addAttribute("page", page);
		model.addAttribute("zdcount", page.getList().size());
		return "modules/reg/base/regBaseZdjbxxListView";
	}


	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "form")
	public String form(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		Dict dict = new Dict();
		//根据宗地代码查看一条宗地信息,只能是VIEWS时查看【要不然save时没有验证通过返回FORM时就会根据已选的宗地代码查出宗地信息】
		if(StringUtils.isNotBlank(regBaseZdjbxx.getZddm()) && StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			RegBaseZdjbxx regBaseZdjbxxtmp = new RegBaseZdjbxx();
			regBaseZdjbxxtmp.setZddm(regBaseZdjbxx.getZddm());
			regBaseZdjbxxtmp.setIslogout("13");
			List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxxtmp);
			for(int i=0;i<findList.size();i++){
				regBaseZdjbxx = findList.get(0);
			}
		}
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("djlx",request.getParameter("djlx"));
			if(request.getParameter("djlx").equals("201")){//201国有建设用地使用权初始登记
				regBaseZdjbxx.setTdsyqdm("G");
				regBaseZdjbxx.setQllx("3");
				dict.setValue("3");
			}
			//203集体建设用地使用权初始登记  || 204宅基地使用权首次登记 
			else if(request.getParameter("djlx").equals("203") || request.getParameter("djlx").equals("204")){
				regBaseZdjbxx.setTdsyqdm("J");
				regBaseZdjbxx.setQllx("7");
				dict.setValue("7");
				if(request.getParameter("djlx").equals("204")){
					regBaseZdjbxx.setQllx("5");
					regBaseZdjbxx.setYt("住宅");
					regBaseZdjbxx.setQlxz("203");
					dict.setValue("5");
				}
			}else if(request.getParameter("djlx").equals("202")){// 202 集体土地所有权首次登记
				regBaseZdjbxx.setTdsyqdm("J");
				regBaseZdjbxx.setQllx("1");
			}else if(request.getParameter("djlx").equals("208")){// 208 土地承包经营权首次登记
				regBaseZdjbxx.setTdsyqdm("J");
				regBaseZdjbxx.setZdtzm("D");
				regBaseZdjbxx.setQllx("9");
			}else if(request.getParameter("djlx").equals("218")){// 218 国有农用地首次登记
				regBaseZdjbxx.setTdsyqdm("G");
				regBaseZdjbxx.setZdtzm("N");
				regBaseZdjbxx.setQllx("23");
			}
		}
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		dict.setType("reg_bus_tdyt");
		List<String> ytList = dictService.findTdytList(dict);
		model.addAttribute("ytList", ytList);
		//传递要素代码
		if(StringUtils.isNotBlank(request.getParameter("YSDM"))){
			model.addAttribute("YSDM",request.getParameter("YSDM"));
		}
		//业务号
		if(StringUtils.isNotBlank(request.getParameter("YWH"))){
			model.addAttribute("YWH",request.getParameter("YWH"));
		}
		//是否属于林地
		if(StringUtils.isNotBlank(request.getParameter("isld"))){
			model.addAttribute("isld",request.getParameter("isld"));
		}
		//是否属于农用地
		if(StringUtils.isNotBlank(request.getParameter("isNyd"))){
			model.addAttribute("isNyd",request.getParameter("isNyd"));
		}
		//变更类型时,控制宗地基本信息页面上的显示情况
		if(StringUtils.isNotBlank(request.getParameter("SXBGLX"))){
			model.addAttribute("SXBGLX", request.getParameter("SXBGLX"));
		}
		if(StringUtils.isNotBlank(request.getParameter("qjcx"))){
			model.addAttribute("qjcx", request.getParameter("qjcx"));
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		if(StringUtils.isNotBlank(request.getParameter("update"))){
			model.addAttribute("update", request.getParameter("update"));
		}
		if(StringUtils.isNotBlank(request.getParameter("flagym"))){
			model.addAttribute("flagym", request.getParameter("flagym"));
		}
		if(StringUtils.isNotBlank(request.getParameter("flag"))){
			model.addAttribute("flag", request.getParameter("flag"));
		}
		if(StringUtils.isNotBlank(request.getParameter("syq"))){
			model.addAttribute("syq", request.getParameter("syq"));
		}
		if(StringUtils.isNotBlank(request.getParameter("bz"))){
			model.addAttribute("bz", request.getParameter("bz"));
		}
		//柜台受理以后传参,不显示宗地信息列表
		if(StringUtils.isNotBlank(request.getParameter("flagym"))){
			if(request.getParameter("flagym").equals("1")){
				return "modules/reg/base/regBaseZdjbxxscForm";
			}else {
				return "modules/reg/base/regBaseZdjbxxForm";
			}
		}else {
			return "modules/reg/base/regBaseZdjbxxForm";
		}
	}
	

	/**
	 * 土地转移登记宗地基本信息from
	 * @param regBaseZdjbxx
	 * @param model
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "zyform")
	public String zyform(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		Dict dict = new Dict();
		String jid = "";
		String xg = request.getParameter("xg");
		if(StringUtils.isNotBlank(xg)){
			String ids = request.getParameter("ids");
			model.addAttribute("ids", ids);
			RegBusJsydsyq jsyd = regBusJsydsyqService.get(ids);
			RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
			djxx.setYwh(jsyd.getYwh());
			djxx.setBdcdyh(jsyd.getBdcdyh());
			djxx.setIslogout("0");
			List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx);
			if(djxxlist.size() > 0){
				djxx = djxxlist.get(0);
				jid = djxx.getOldid();
			}
		}else{
			jid = request.getParameter("jid");
		}
		String DJLX = request.getParameter("DJLX");
		String YWH = request.getParameter("YWH");
		//根据旧jid获取登记信息 获取宗地代码
		RegBusBdcqzsdjxx djxx =  regBusBdcqzsdjxxService.get(jid);
//		//删除已经存在的土地信息
//		RegBaseZdjbxx zdxx = new RegBaseZdjbxx();
//		zdxx.setZddm(djxx.getZddm());
//		zdxx.setIslogout("3");
//		List<RegBaseZdjbxx> zdxxlist = regBaseZdjbxxService.findList(zdxx);
//		if(zdxxlist.size() > 0){
//			zdxx = zdxxlist.get(0);
//			regBaseZdjbxxService.deleteRegBaseZdjbxx(zdxx);
//			regBaseZdbhqkService.deleteywh(YWH);
//		}
		
		model.addAttribute("xg", xg);
		model.addAttribute("YWH", YWH);
		model.addAttribute("zddm", djxx.getZddm());
		model.addAttribute("jid",jid);
		model.addAttribute("DJLX",DJLX);
		RegBaseZdjbxx zdjbxx = new RegBaseZdjbxx();
		zdjbxx.setZddm(djxx.getZddm());
		if(StringUtils.isNotBlank(xg)){
			zdjbxx.setIslogout("3");
		}else{
			zdjbxx.setIslogout("0");
		}
		List<RegBaseZdjbxx> zdjbxxlist = regBaseZdjbxxService.findList(zdjbxx);
		if(zdjbxxlist.size() > 0){
			regBaseZdjbxx = zdjbxxlist.get(0);
		}
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("djlx",request.getParameter("djlx"));
			if(request.getParameter("djlx").equals("201")){//201国有建设用地使用权初始登记
				regBaseZdjbxx.setTdsyqdm("G");
				regBaseZdjbxx.setQllx("3");
				dict.setValue("3");
			}
			//203集体建设用地使用权初始登记  || 204宅基地使用权首次登记 
			else if(request.getParameter("djlx").equals("203") || request.getParameter("djlx").equals("204")){
				regBaseZdjbxx.setTdsyqdm("J");
				regBaseZdjbxx.setQllx("7");
				dict.setValue("7");
				if(request.getParameter("djlx").equals("204")){
					regBaseZdjbxx.setQllx("5");
					regBaseZdjbxx.setYt("住宅");
					regBaseZdjbxx.setQlxz("203");
					dict.setValue("5");
				}
			}else if(request.getParameter("djlx").equals("202")){// 202 集体土地所有权首次登记
				regBaseZdjbxx.setTdsyqdm("J");
				regBaseZdjbxx.setQllx("1");
			}
		}
		regBaseZdjbxx.setZddm(djxx.getZddm());
		regBaseZdjbxx.setYt(DictUtils.getDictValue(djxx.getYt(), "reg_bus_tdyt", ""));
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		dict.setType("reg_bus_tdyt");
		List<String> ytList = dictService.findTdytList(dict);
		model.addAttribute("ytList", ytList);
		return "modules/reg/base/regBaseZdjbxxtdzyForm";
	}
	
	/**
	 * 土地转移登记宗地信息保存(包含有国有农用地转移登记)
	 * @param regBaseZdjbxx
	 * @param model
	 * @param redirectAttributes
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "tdzysave")
	public synchronized String tdzysave(RegBaseZdjbxx regBaseZdjbxx, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		String jid = request.getParameter("jid");
		String xg = request.getParameter("xg");
		String DJLX = request.getParameter("DJLX");
		if (!beanValidator(model, regBaseZdjbxx)){
			return form(regBaseZdjbxx, model, request);
		}
		String ywhStr = request.getParameter("YWH");
		RegBaseZdjbxx zdjbxx = new RegBaseZdjbxx();
		zdjbxx.setZddm(regBaseZdjbxx.getZddm());
		zdjbxx.setIslogout("0");
		List<RegBaseZdjbxx> zdlist = regBaseZdjbxxService.findList(zdjbxx);
		if(zdlist.size() > 0){
			zdjbxx = zdlist.get(0);
			String Oldzdid = zdjbxx.getId();
			RegBaseZdjbxx zdjbxxnew = new RegBaseZdjbxx();
			zdjbxxnew = zdjbxx;
			zdjbxxnew.setId("");
			zdjbxxnew.setQlxz(regBaseZdjbxx.getQlxz());
			zdjbxxnew.setYt(DictUtils.getDictLabel(regBaseZdjbxx.getYt(), "reg_bus_tdyt", ""));
			zdjbxxnew.setYtmc(DictUtils.getDictLabel(regBaseZdjbxx.getYt(), "reg_bus_tdyt", ""));
			zdjbxxnew.setZdt(regBaseZdjbxx.getZdt());
			zdjbxxnew.setIslogout("3");
			RegBaseZdjbxx zdjbxxold = new RegBaseZdjbxx();
			zdjbxxold.setZddm(regBaseZdjbxx.getZddm());
			zdjbxxold.setIslogout("3");
			List<RegBaseZdjbxx> zdlistold = regBaseZdjbxxService.findList(zdjbxxold);
			if(zdlistold.size() > 0){
				zdjbxxnew.setId(zdlistold.get(0).getId());
			}
			zdjbxxnew.setYsdm("6001010000");
			zdjbxxnew.setDj(regBaseZdjbxx.getDj());
			zdjbxxnew.setRjl(regBaseZdjbxx.getRjl());
			regBaseZdjbxxService.save(zdjbxxnew);
			//宗地变化情况表
			RegBaseZdbhqk bhqk = new RegBaseZdbhqk();
			bhqk.setZddm(regBaseZdjbxx.getZddm());
			bhqk.setYwh(ywhStr);
			bhqk.setZdid(zdjbxxnew.getId());
			bhqk.setOldzdid(Oldzdid);
			bhqk.setBhyy(DictUtils.getDictLabel(DJLX, "reg_bus_djxl",""));
			bhqk.setBhnr(DictUtils.getDictLabel(DJLX, "reg_bus_djxl",""));
			bhqk.setDjsj(new Date());
			RegBaseZdbhqk bhqknew = new RegBaseZdbhqk();
			bhqknew.setZddm(regBaseZdjbxx.getZddm());
			bhqknew.setYwh(ywhStr);
			List<RegBaseZdbhqk> bhqknewlist = regBaseZdbhqkService.findList(bhqknew);
			if(bhqknewlist.size() > 0){
				bhqknew = bhqknewlist.get(0);
				bhqk.setId(bhqknew.getId());
			}
			regBaseZdbhqkService.save(bhqk);
		}
		addMessage(redirectAttributes, "保存宗地基本信息成功");
		String views = "";
		System.out.println(request.getParameter("ids"));
		if("305".equals(DJLX)){
			if(StringUtils.isNotBlank(xg)){
				views = "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/editchangeform?qlxz="+regBaseZdjbxx.getQlxz()+"zddm="+regBaseZdjbxx.getZddm()+"&YSDM=6001010000&WO=1&YWH="+ywhStr+"&djlx="+DJLX+"&jid="+jid+"&ids="+request.getParameter("ids");
			}else{
				views = "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/nextHousetdzydjForm?qlxz="+regBaseZdjbxx.getQlxz()+"zddm="+regBaseZdjbxx.getZddm()+"&YSDM=6001010000&WO=1&YWH="+ywhStr+"&djlx="+DJLX+"&jid="+jid;
			}
		}
		if("306".equals(DJLX)){
			if(StringUtils.isNotBlank(xg)){
				views = "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/jteditchangeform?qlxz="+regBaseZdjbxx.getQlxz()+"zddm="+regBaseZdjbxx.getZddm()+"&YSDM=6001010000&WO=1&YWH="+ywhStr+"&djlx="+DJLX+"&jid="+jid+"&ids="+request.getParameter("ids");
			}else{
				views = "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/nextHousetdzydjForm?qlxz="+regBaseZdjbxx.getQlxz()+"zddm="+regBaseZdjbxx.getZddm()+"&YSDM=6001010000&WO=1&YWH="+ywhStr+"&djlx="+DJLX+"&jid="+jid;
			}
		}
		if("307".equals(DJLX)){
			if(StringUtils.isNotBlank(xg)){
				views = "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/zjdeditchangeform?qlxz="+regBaseZdjbxx.getQlxz()+"zddm="+regBaseZdjbxx.getZddm()+"&YSDM=6001010000&WO=1&YWH="+ywhStr+"&djlx="+DJLX+"&jid="+jid+"&ids="+request.getParameter("ids");
			}else{
				views = "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/nextHousetdzydjForm?qlxz="+regBaseZdjbxx.getQlxz()+"zddm="+regBaseZdjbxx.getZddm()+"&YSDM=6001010000&WO=1&YWH="+ywhStr+"&djlx="+DJLX+"&jid="+jid;
			}
		}
		if("309".equals(DJLX)){
			views = "redirect:"+Global.getAdminPath()+"/reg/bus/regBusNydsyq/gynydzydjForm?qlxz="+regBaseZdjbxx.getQlxz()+"zddm="+regBaseZdjbxx.getZddm()+"&YSDM=6001010000&WO=1&YWH="+ywhStr+"&djlx="+DJLX+"&jid="+jid+"&xg="+xg;
		}
		return views;
	}
	
	
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "oneOfAllForm")
	public String oneOfAllForm(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		return "modules/reg/base/regBaseZdjbxxOneOfAllForm";
	}
	
	@ResponseBody
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "save")
	public ModelMap save(RegBaseZdjbxx regBaseZdjbxx, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		ModelMap modelmap = new ModelMap();
		String tempBdcdyh="";
		int dyhcfbj = 0;
		String dyhcf = "";
		
		String ywhStr = request.getParameter("YWH");
		String flag = request.getParameter("flag");
		String djlx = request.getParameter("djlx");
		String syq = request.getParameter("syq");
		String isNyd = request.getParameter("isNyd");

		//通过宗地初步代码给行政区、地籍区和地籍子区三个字段赋值
		/*String zddmStr = regBaseZdjbxx.getZddm();
		if(StringUtils.isNotBlank(zddmStr) && zddmStr.length() == 12){
			regBaseZdjbxx.setSeachprov(zddmStr.substring(0, 6));
			regBaseZdjbxx.setSeachcity(zddmStr.substring(0, 9));
			regBaseZdjbxx.setSeachdistrict(zddmStr.substring(0, 12));
			regBaseZdjbxx.setIsaudit("0");
		}*/
		
		//如果是新增的实体
		//if("0".equals(request.getParameter("op"))){
			//构造宗地号
			/*String maxZddmSxh = regBaseZdjbxxService.findMaxZddmByDistrict(regBaseZdjbxx.getZddm());//使用当前宗地代码
			String ruleCode = regBaseZdjbxx.getZddm() + regBaseZdjbxx.getTdsyqdm() + regBaseZdjbxx.getZdtzm();
			String nextZddm = getNextZddm(maxZddmSxh, ruleCode);*/
			//宗地代码跟不动产单元号同时生成
			/*regBaseZdjbxx.setZddm(nextZddm);
			regBaseZdjbxx.setBdcdyh(nextZddm + "W00000000");*/
			dyhcf = regBaseZdjbxx.getBdcdyh();
			regBaseZdjbxx.setIslogout("3");//暂时保存无效状态,登簿回写有效
			regBaseZdjbxx.setIsdiya("0");
			regBaseZdjbxx.setIsyiyi("0");
			regBaseZdjbxx.setIschafeng("0");
		//}
		
		//检查不动产单元号是否有重复,有的话不能审核给提示
		//检查不动产单元号是否有重复,有的话不能审核给提示
		RegBusHisBdcqzsdjxx hisdjxx = new RegBusHisBdcqzsdjxx();
		hisdjxx.setBdcdyh(dyhcf);
		List<RegBusHisBdcqzsdjxx> hisdjxxcfjclist = regBusHisBdcqzsdjxxService.findhisdyhcflist(hisdjxx);
		
		RegBusBdcqzsdjxx djxxcfjc = new RegBusBdcqzsdjxx();
		djxxcfjc.setBdcdyh(dyhcf);
		List<RegBusBdcqzsdjxx> djxxcfjclist = regBusBdcqzsdjxxService.finddyhcflist(djxxcfjc);
		
		RegBaseZdjbxx zdjbxxcf = new RegBaseZdjbxx();
		zdjbxxcf.setBdcdyh(dyhcf);
		List<RegBaseZdjbxx> findListdyhcf = regBaseZdjbxxService.findListdyhcf(zdjbxxcf);
		
		if(findListdyhcf.size()>0 || djxxcfjclist.size() > 0 || hisdjxxcfjclist.size() > 0){
			dyhcfbj = 1;
		}else{
			dyhcfbj = 0;
		}

		//属性变更类型时,控制宗地基本信息页面上的显示情况;还有就是插入变更业务与证书信息关系表,同时需要在初审通过后更新当前土地状态
		if(StringUtils.isNotBlank(request.getParameter("SXBGLX"))){
			model.addAttribute("SXBGLX", request.getParameter("SXBGLX"));
			RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
			regBusBdcqzsdjxx.setBdcdyh(regBaseZdjbxx.getBdcdyh());
			List<RegBusBdcqzsdjxx> findListRela = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
			if(findListRela.size()>0){
				regBusBdcqzsdjxx = findListRela.get(0);
			}
			RegBusBdcqzsdjxx regBusBdcqzsdjxxNew = new RegBusBdcqzsdjxx();
			regBusBdcqzsdjxxNew.setYwh(ywhStr);
			regBusBdcqzsdjxxNew.setBdcqzh(regBusBdcqzsdjxx.getBdcqzh());//TODO 这里的顺序号需要获取当前证书信息表中最大的顺序号
			regBusBdcqzsdjxxNew.setBdcqzbh(regBusBdcqzsdjxx.getBdcqzbh());//TODO 这里的顺序号需要获取当前证书信息表中最大的顺序号
			regBusBdcqzsdjxxNew.setZl(regBusBdcqzsdjxx.getZl());
			regBusBdcqzsdjxxNew.setQllx(regBusBdcqzsdjxx.getQllx());
			regBusBdcqzsdjxxNew.setQlxz(regBusBdcqzsdjxx.getQlxz());
			regBusBdcqzsdjxxNew.setYt(regBusBdcqzsdjxx.getYt());
			regBusBdcqzsdjxxNew.setMj(regBaseZdjbxx.getZdmj()+"");//这里是变更项:新的宗地面积
			regBusBdcqzsdjxxNew.setZl(regBusBdcqzsdjxx.getZl());
			regBusBdcqzsdjxxNew.setZl(regBusBdcqzsdjxx.getZl());
			regBusBdcqzsdjxxNew.setBdcdyh(regBaseZdjbxx.getZddm());
			//开始赋值[权利人|共有情况]
			regBusBdcqzsdjxxNew.setQlrmc(regBusBdcqzsdjxx.getQlrmc());
			regBusBdcqzsdjxxNew.setGyqk(regBusBdcqzsdjxx.getGyqk());
			regBusBdcqzsdjxxService.save(regBusBdcqzsdjxxNew);
			tempBdcdyh=regBusBdcqzsdjxxNew.getBdcdyh();
		}
		
		/*regBaseZdjbxx.setYsdm("6001010000");
		regBaseZdjbxx.setYtmc(regBaseZdjbxx.getYt());*/
		if("201".equals(djlx) || "203".equals(djlx) || "204".equals(djlx)){
				regBaseZdjbxxService.save(regBaseZdjbxx);
				tempBdcdyh=regBaseZdjbxx.getBdcdyh();
				addMessage(redirectAttributes, "保存宗地基本信息成功");
		}else{
			regBaseZdjbxxService.save(regBaseZdjbxx);
			tempBdcdyh=regBaseZdjbxx.getBdcdyh();
			addMessage(redirectAttributes, "保存宗地基本信息成功");
		}
		return modelmap;
		//return "redirect:"+Global.getAdminPath()+"/reg/base/regBaseZdjbxx/list?BCDYH="+tempBdcdyh+"&flag="+flag+"&djlx="+djlx+"&syq="+syq+"&isNyd="+isNyd;
	}

	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "qjcxsave")
	public synchronized String qjcxsave(RegBaseZdjbxx regBaseZdjbxx, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		//regBaseZdjbxxService.save(regBaseZdjbxx);
		model.addAttribute("MJDW", DictUtils.getDictLabel(regBaseZdjbxx.getMjdw(), "reg_bus_mjdw", ""));
		return "";
	}
	
	/**
	 * 土地使用权分割
	 * @param regBaseZdjbxx
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "divisionlist")
	public String divisionList(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		String zddm = request.getParameter("ZDDM");
		String ywh = request.getParameter("YWH");
		if(StringUtils.isNotBlank(zddm)){
			regBaseZdjbxx.setZddm(zddm);
			regBaseZdjbxx.setIslogout("1");//刚生成的状态还没有生效,所以按照注销状态查询
		}
		
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH", ywh);
		}
		
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("djlx", request.getParameter("djlx"));
		}
		if(StringUtils.isNotBlank(request.getParameter("IsMeger"))){
			model.addAttribute("IsMeger", request.getParameter("IsMeger"));
		}
		if(StringUtils.isNotBlank(request.getParameter("mergerids"))){
			model.addAttribute("mergerids", request.getParameter("mergerids"));
		}
		if(StringUtils.isNotBlank(request.getParameter("ZDDM"))){
			model.addAttribute("ZDDM", request.getParameter("ZDDM"));
		}
		Page<RegBaseZdjbxx> page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx); 
		model.addAttribute("page", page);

		return "modules/reg/base/regBaseZdjbxxDivisionList";
	}
	
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "propertylist")
	public String propertylist(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		String zddm = request.getParameter("ZDDM");
		String ywh = request.getParameter("YWH");
		if(StringUtils.isNotBlank(zddm)){
			regBaseZdjbxx.setZddm(zddm);
			regBaseZdjbxx.setIslogout("1");//刚生成的状态还没有生效,所以按照注销状态查询
		}
		
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH", ywh);
		}
		
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("djlx", request.getParameter("djlx"));
		}
		if(StringUtils.isNotBlank(request.getParameter("IsMeger"))){
			model.addAttribute("IsMeger", request.getParameter("IsMeger"));
		}
		Page<RegBaseZdjbxx> page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx); 
		model.addAttribute("page", page);

		return "modules/reg/base/regBaseZdjbxxPropertyList";
	}
	
	/**
	 * 土地分割
	 * @param regBaseZdjbxx
	 * @param model
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "divisionform")
	public String divisionForm(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		//根据宗地代码查看一条宗地信息,只能是VIEWS时查看【要不然save时没有验证通过返回FORM时就会根据已选的宗地代码查出宗地信息】
		if(StringUtils.isNotBlank(regBaseZdjbxx.getZddm()) && StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			regBaseZdjbxx.setIslogout("13");
			List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxx);
			for(int i=0;i<findList.size();i++){
				regBaseZdjbxx = findList.get(0);
			}
		}
		
		String ywh = request.getParameter("YWH");
		String oldywid = request.getParameter("oldywid");
		String optype = request.getParameter("optype");
		String rights = request.getParameter("rights");
		if(StringUtils.isNotBlank(request.getParameter("YSDM"))){
			model.addAttribute("YSDM",request.getParameter("YSDM"));
		}
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH",ywh);
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		RegBusBdcqzsdjxx entity = new RegBusBdcqzsdjxx();
		if(StringUtils.isNotBlank(optype)){
			RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
			RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
			if(rights != null){
				if(rights.equals("suoy")){
					RegBusTdsyq regBustdsyq = new RegBusTdsyq();
					regBustdsyq = regBusTdsyqService.get(oldywid);
					regBaseZdbhqk.setZddm(regBustdsyq.getZddm());
					regBusBdcqzsdjxx.setBdcdyh(regBustdsyq.getBdcdyh());
				}else if(rights.equals("shiy")){
					RegBusJsydsyq regBusJsydsyq = new RegBusJsydsyq();
					regBusJsydsyq = regBusJsydsyqService.get(oldywid);
					regBaseZdbhqk.setZddm(regBusJsydsyq.getZddm());
					regBusBdcqzsdjxx.setBdcdyh(regBusJsydsyq.getBdcdyh());
				}else if(rights.equals("cbjy")){
					RegBusNydsyq regBusNydsyq = new RegBusNydsyq();
					regBusNydsyq = regBusNydsyqService.get(oldywid);
					regBaseZdbhqk.setZddm(regBusNydsyq.getZddm());
					regBusBdcqzsdjxx.setBdcdyh(regBusNydsyq.getBdcdyh());
				}
			}
			
			regBaseZdbhqk.setYwh(ywh);
			List<RegBaseZdbhqk> listRegBaseZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqk);
			if(listRegBaseZdbhqk.size() == 1){
				regBaseZdbhqk = listRegBaseZdbhqk.get(0);
				regBaseZdjbxx = regBaseZdjbxxService.get(regBaseZdbhqk.getZdid());
			}
			regBusBdcqzsdjxx.setYwh(ywh);
			List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
			if(listRegBusBdcqzsdjxx.size() == 1){
				regBusBdcqzsdjxx = listRegBusBdcqzsdjxx.get(0);
				oldywid = regBusBdcqzsdjxx.getOldid();
			}
			model.addAttribute("OldZdId", regBaseZdbhqk.getZdid());
			model.addAttribute("optype", optype);
		}else {
			if(StringUtils.isNotBlank(oldywid)){
				entity = regBusBdcqzsdjxxService.get(oldywid);
				RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
				regBaseZdjbxxTemp.setZddm(entity.getZddm());
				regBaseZdjbxxTemp.setIslogout("0");//获取当前宗地基本信息中此宗地代码唯一一条有效数据
				List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
				if(listJbxx != null && listJbxx.size()>0){
					regBaseZdjbxxTemp = listJbxx.get(0);
					regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm());
					regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh());
					regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm());
					regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());
					regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());
					regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());
					regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());
					regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());
					regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());
					regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());
					regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());
					regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());
					regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());
					regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());
				}
			}
		}
		model.addAttribute("oldywid", oldywid);
		RegBusQlr regBusQlr = new RegBusQlr();
		if(StringUtils.isNotBlank(optype)){
			regBusQlr.setYwh(ywh);
		}else {
			regBusQlr.setYwh(entity.getYwh());
		}
		List<RegBusQlr> listRegBusQlr = regBusQlrService.findListSxh(regBusQlr);
		if(listRegBusQlr.size() > 0){
			regBusQlr = listRegBusQlr.get(0);
			regBaseZdjbxx.setQlrxm(regBusQlr.getQlrmc());
			regBaseZdjbxx.setZjlx(regBusQlr.getZjzl());
			regBaseZdjbxx.setSfzh(regBusQlr.getZjh());
		}
		
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("DJLX", request.getParameter("djlx"));
		}
		
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		
		return "modules/reg/base/regBaseZdjbxxDivisionForm";
	}
	
	/**
	 * 土地变更、更正form页面
	 * @param regBaseZdjbxx
	 * @param model
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "propertyform")
	public String propertyform(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		//根据宗地代码查看一条宗地信息,只能是VIEWS时查看【要不然save时没有验证通过返回FORM时就会根据已选的宗地代码查出宗地信息】
		if(StringUtils.isNotBlank(regBaseZdjbxx.getZddm()) && StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			regBaseZdjbxx.setIslogout("13");
			List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxx);
			for(int i=0;i<findList.size();i++){
				regBaseZdjbxx = findList.get(0);
			}
		}
		Dict dict = new Dict();
		String ywh = request.getParameter("YWH");
		String optype = request.getParameter("optype");
		String oldywid = request.getParameter("oldywid");
		String djlxStr = request.getParameter("djlx");
		String rights = request.getParameter("rights");
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		if(StringUtils.isNotBlank(optype)){
			RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
			if(rights != null){
				if(rights.equals("suoy")){
					RegBusTdsyq regBustdsyq = new RegBusTdsyq();
					regBustdsyq = regBusTdsyqService.get(oldywid);
					regBaseZdbhqk.setZddm(regBustdsyq.getZddm());
					regBusBdcqzsdjxx.setBdcdyh(regBustdsyq.getBdcdyh());
				}else if(rights.equals("shiy")){
					RegBusJsydsyq regBusJsydsyq = new RegBusJsydsyq();
					regBusJsydsyq = regBusJsydsyqService.get(oldywid);
					regBaseZdbhqk.setZddm(regBusJsydsyq.getZddm());
					regBusBdcqzsdjxx.setBdcdyh(regBusJsydsyq.getBdcdyh());
				}
			}
			regBaseZdbhqk.setYwh(ywh);
			List<RegBaseZdbhqk> listRegBaseZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqk);
			if(listRegBaseZdbhqk.size() == 1){
				regBaseZdbhqk = listRegBaseZdbhqk.get(0);
				regBaseZdjbxx = regBaseZdjbxxService.get(regBaseZdbhqk.getZdid());
			}
			regBusBdcqzsdjxx.setYwh(ywh);
			List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
			if(listRegBusBdcqzsdjxx.size() == 1){
				regBusBdcqzsdjxx = listRegBusBdcqzsdjxx.get(0);
				oldywid = regBusBdcqzsdjxx.getOldid();
			}
			model.addAttribute("OldZdId", regBaseZdbhqk.getOldzdid());
		}else {
			regBusBdcqzsdjxx.setYwh(ywh);
			List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
			if(listRegBusBdcqzsdjxx.size() == 1){
				//删除当前业务号下已经存在的登记信息
				RegBusBdcqzsdjxx regBusBdcqzsdjxxT = new RegBusBdcqzsdjxx();
				regBusBdcqzsdjxxT.setYwh(ywh);
				RegBaseZdbhqk regBaseZdbhqkT = new RegBaseZdbhqk();
				regBaseZdbhqkT.setYwh(ywh);
				List<RegBaseZdbhqk> listregBaseZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqkT);
				for(int i=0;i<listregBaseZdbhqk.size();i++){
					regBaseZdbhqkT = listregBaseZdbhqk.get(i);
					RegBaseZdjbxx regBaseZdjbxxtmp = new RegBaseZdjbxx();
					regBaseZdjbxxtmp = regBaseZdjbxxService.get(regBaseZdbhqkT.getZdid());
					regBaseZdjbxxService.delete(regBaseZdjbxxtmp);
				}
				regBusQlrService.deleteywh(ywh);
				regBusTdsyqService.deleteRegBusTdsyq(ywh);
				regBusJsydsyqService.deleteRegBusJsydsyq(ywh);
				regBusBdcqzsdjxxService.deletezyyg(regBusBdcqzsdjxxT);
			}
			
			if(StringUtils.isNotBlank(oldywid)){
				RegBusBdcqzsdjxx entity = regBusBdcqzsdjxxService.get(oldywid);
				RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
				regBaseZdjbxxTemp.setZddm(entity.getZddm());
				regBaseZdjbxxTemp.setIslogout("0");
				List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
				if(listJbxx.size() == 1){
					regBaseZdjbxxTemp = listJbxx.get(0);
					//完全赋值过来;然后后面就是修改宗地基本信息的值而不是新增,这里也可以按照实际需求,如果需要新增一块地也是可以的,比如当坐落发生变更时;
					//修改为新增一块地,可以是宗地代码不变,也可以改变;新增后 islogout = 1 ;登薄时生效,并把旧的宗地注销;当前宗地变化情况表对应的业务号
					//存上变更前地的ID
					regBaseZdjbxx.setYsdm(regBaseZdjbxxTemp.getYsdm());
					regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh()); 
					regBaseZdjbxx.setZddm(regBaseZdjbxxTemp.getZddm()); 
					regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm()); 
					regBaseZdjbxx.setZl(regBaseZdjbxxTemp.getZl()); 
					regBaseZdjbxx.setZdmj(regBaseZdjbxxTemp.getZdmj());		// 宗地面积
					regBaseZdjbxx.setMjdw(regBaseZdjbxxTemp.getMjdw());		// 面积单位
					regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());		// 用途
					regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());		// 等级
					regBaseZdjbxx.setJg(regBaseZdjbxxTemp.getJg());		// 价格
					regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());		// 权利类型
					regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());		// 权利性质
					regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());		// 权利设定方式
					regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());		// 容积率 by update 1231 xuyg
					regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());		// 建筑密度by update 1231 xuyg
					regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());		// 建筑限高by update 1231 xuyg
					regBaseZdjbxx.setZdszd(regBaseZdjbxxTemp.getZdszd());		// 宗地四至-东
					regBaseZdjbxx.setZdszn(regBaseZdjbxxTemp.getZdszn());		// 宗地四至-南
					regBaseZdjbxx.setZdszx(regBaseZdjbxxTemp.getZdszx());		// 宗地四至-西
					regBaseZdjbxx.setZdszb(regBaseZdjbxxTemp.getZdszb());		// 宗地四至-北
					regBaseZdjbxx.setZdt(regBaseZdjbxxTemp.getZdt());		// 宗地图
					regBaseZdjbxx.setTfh(regBaseZdjbxxTemp.getTfh());		// 图幅号
					regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());		// 地籍号
					regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());		// 档案号
					regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());		// 备注
					regBaseZdjbxx.setZt(regBaseZdjbxxTemp.getZt());		// 状态
					regBaseZdjbxx.setQlrxm(regBaseZdjbxxTemp.getQlrxm());   //权利人姓名
					regBaseZdjbxx.setZjlx(regBaseZdjbxxTemp.getZjlx()); //证件类型
					regBaseZdjbxx.setSfzh(regBaseZdjbxxTemp.getSfzh());    //身份证号
					regBaseZdjbxx.setSeachprov(regBaseZdjbxxTemp.getSeachprov()); //县级行政区
					regBaseZdjbxx.setSeachcity(regBaseZdjbxxTemp.getSeachcity()); //地籍区
					regBaseZdjbxx.setSeachdistrict(regBaseZdjbxxTemp.getSeachdistrict()); //地籍子区
					regBaseZdjbxx.setZb(regBaseZdjbxxTemp.getZb()); //坐标
					regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm()); //土地所有权代码
					regBaseZdjbxx.setIsaudit(regBaseZdjbxxTemp.getIsaudit());  //审核【宗地信息在新建时isaudit为0,如果审核了isaudit为1【测绘信息同时审核】;如果被引用{土地首次登记、属性变更、分割和合并}时,修改isaudit为2【测绘信息同时以引用】;】
					regBaseZdjbxx.setStatus(regBaseZdjbxxTemp.getStatus()); //当前土地业务状态 默认为0
					regBaseZdjbxx.setHistory(regBaseZdjbxxTemp.getHistory()); //标示区别是否历史信息录入
					regBaseZdjbxx.setIslogout(regBaseZdjbxxTemp.getIslogout()); //是否注销  分割合并后原数据注销
					regBaseZdjbxx.setChid(regBaseZdjbxxTemp.getChid()); //测绘ID
					regBaseZdjbxx.setXmid(regBaseZdjbxxTemp.getXmid()); //项目ID
					model.addAttribute("OldZdId", regBaseZdjbxxTemp.getId());
				}
			}
		}
		model.addAttribute("oldywid", oldywid);
		model.addAttribute("zdtzm", regBaseZdjbxx.getZdtzm());
		
		if(StringUtils.isNotBlank(djlxStr)){
			model.addAttribute("DJLX", djlxStr);
		}
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		if(StringUtils.isNotBlank(request.getParameter("YSDM"))){
			model.addAttribute("YSDM",request.getParameter("YSDM"));
		}
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH",ywh);
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		if(StringUtils.isNotBlank(request.getParameter("optype"))){
			model.addAttribute("optype", request.getParameter("optype"));
		}
		if(StringUtils.isNotBlank(request.getParameter("isFlagZrz"))){
			model.addAttribute("isFlagZrz", request.getParameter("isFlagZrz"));
		}
		if(regBaseZdjbxx.getQllx().equals("3") || regBaseZdjbxx.getQllx().equals("7")){
			dict.setValue("3");
		}else if(regBaseZdjbxx.getQllx().equals("5")){
			dict.setValue("5");
		}
		dict.setType("reg_bus_tdyt");
		List<String> ytList = dictService.findTdytList(dict);
		model.addAttribute("ytList", ytList);
		regBaseZdjbxx.setYt(DictUtils.getDictValue(regBaseZdjbxx.getYt(), "reg_bus_tdyt", ""));
		if("601".equals(djlxStr)){ //更正
			return "modules/reg/base/regBaseZdjbxxPropertyGzForm";
		}else{//属性变更
			return "modules/reg/base/regBaseZdjbxxPropertyForm";
		}
	}
	
	/**
	 * 土地承包经营权变更、更正form页面
	 * @param regBaseZdjbxx
	 * @param model
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "nydbgpropertyform")
	public String nydbgpropertyform(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		//根据宗地代码查看一条宗地信息,只能是VIEWS时查看【要不然save时没有验证通过返回FORM时就会根据已选的宗地代码查出宗地信息】
		if(StringUtils.isNotBlank(regBaseZdjbxx.getZddm()) && StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			regBaseZdjbxx.setIslogout("13");
			List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxx);
			for(int i=0;i<findList.size();i++){
				regBaseZdjbxx = findList.get(0);
			}
		}
		Dict dict = new Dict();
		String ywh = request.getParameter("YWH");//当前业务号
		String optype = request.getParameter("optype");
		String oldywid = request.getParameter("oldywid");//选择的已登记信息
		String djlxStr = request.getParameter("DJLX");
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		if(StringUtils.isNotBlank(optype)){
			RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
			regBaseZdbhqk.setYwh(ywh);
			List<RegBaseZdbhqk> listRegBaseZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqk);
			if(listRegBaseZdbhqk.size() == 1){
				regBaseZdbhqk = listRegBaseZdbhqk.get(0);
				regBaseZdjbxx = regBaseZdjbxxService.get(regBaseZdbhqk.getZdid());
			}
			model.addAttribute("OldZdId", regBaseZdbhqk.getOldzdid());
			if(StringUtils.isNotBlank(request.getParameter("xg"))){
				RegBusNydsyq nydbg = regBusNydsyqService.get(oldywid);
				RegBusBdcqzsdjxx regBusBdcqzsdjxxnew = new RegBusBdcqzsdjxx();
				regBusBdcqzsdjxxnew.setYwh(ywh);
				regBusBdcqzsdjxxnew.setBdcdyh(nydbg.getBdcdyh());
				List<RegBusBdcqzsdjxx> djxxnewlist = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxxnew);
				if(djxxnewlist.size() > 0){
					regBusBdcqzsdjxxnew = djxxnewlist.get(0);
				}
				RegBaseZdjbxx regBaseZdjbxxnew = new RegBaseZdjbxx();
				regBaseZdjbxxnew.setZddm(regBusBdcqzsdjxxnew.getZddm());
				if(StringUtils.isNotBlank(regBusBdcqzsdjxxnew.getFzsj())){
					regBaseZdjbxxnew.setIslogout("0");
				}else{
					regBaseZdjbxxnew.setIslogout("3");
				}
				List<RegBaseZdjbxx> listzd = regBaseZdjbxxService.findList(regBaseZdjbxxnew);
				if(listzd.size() > 0){
					regBaseZdjbxxnew = listzd.get(0);
				}
				model.addAttribute("regBaseZdjbxx", regBaseZdjbxxnew);
			}
			
		}else {
			regBusBdcqzsdjxx.setYwh(ywh);
			List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
			if(listRegBusBdcqzsdjxx.size() == 1 && StringUtils.isNotBlank(ywh)){
				//删除当前业务号下已经存在的登记信息
				RegBusBdcqzsdjxx regBusBdcqzsdjxxT = new RegBusBdcqzsdjxx();
				regBusBdcqzsdjxxT.setYwh(ywh);
				RegBaseZdbhqk regBaseZdbhqkT = new RegBaseZdbhqk();
				regBaseZdbhqkT.setYwh(ywh);
				List<RegBaseZdbhqk> listregBaseZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqkT);
				for(int i=0;i<listregBaseZdbhqk.size();i++){
					regBaseZdbhqkT = listregBaseZdbhqk.get(i);
					RegBaseZdjbxx regBaseZdjbxxtmp = new RegBaseZdjbxx();
					regBaseZdjbxxtmp = regBaseZdjbxxService.get(regBaseZdbhqkT.getZdid());
					regBaseZdjbxxService.delete(regBaseZdjbxxtmp);
				}
				regBusQlrService.deleteywh(ywh);
				regBusNydsyqService.deletenydzyywh(ywh);
				regBusBdcqzsdjxxService.deletezyyg(regBusBdcqzsdjxxT);
			}
			if(StringUtils.isNotBlank(oldywid)){
				//选择的已登记信息
				RegBusBdcqzsdjxx entity = regBusBdcqzsdjxxService.get(oldywid);
				RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
				regBaseZdjbxxTemp.setZddm(entity.getZddm());
				regBaseZdjbxxTemp.setIslogout("0");
				List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
				if(listJbxx.size() == 1){
					regBaseZdjbxxTemp = listJbxx.get(0);
					//完全赋值过来;然后后面就是修改宗地基本信息的值而不是新增,这里也可以按照实际需求,如果需要新增一块地也是可以的,比如当坐落发生变更时;
					//修改为新增一块地,可以是宗地代码不变,也可以改变;新增后 islogout = 1 ;登薄时生效,并把旧的宗地注销;当前宗地变化情况表对应的业务号
					//存上变更前地的ID
					regBaseZdjbxx.setYsdm(regBaseZdjbxxTemp.getYsdm());
					regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh()); 
					regBaseZdjbxx.setZddm(regBaseZdjbxxTemp.getZddm()); 
					regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm()); 
					regBaseZdjbxx.setZl(regBaseZdjbxxTemp.getZl()); 
					regBaseZdjbxx.setZdmj(regBaseZdjbxxTemp.getZdmj());		// 宗地面积
					regBaseZdjbxx.setMjdw(regBaseZdjbxxTemp.getMjdw());		// 面积单位
					regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());		// 用途
					regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());		// 等级
					regBaseZdjbxx.setJg(regBaseZdjbxxTemp.getJg());		// 价格
					regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());		// 权利类型
					regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());		// 权利性质
					regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());		// 权利设定方式
					regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());		// 容积率 by update 1231 xuyg
					regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());		// 建筑密度by update 1231 xuyg
					regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());		// 建筑限高by update 1231 xuyg
					regBaseZdjbxx.setZdszd(regBaseZdjbxxTemp.getZdszd());		// 宗地四至-东
					regBaseZdjbxx.setZdszn(regBaseZdjbxxTemp.getZdszn());		// 宗地四至-南
					regBaseZdjbxx.setZdszx(regBaseZdjbxxTemp.getZdszx());		// 宗地四至-西
					regBaseZdjbxx.setZdszb(regBaseZdjbxxTemp.getZdszb());		// 宗地四至-北
					regBaseZdjbxx.setZdt(regBaseZdjbxxTemp.getZdt());		// 宗地图
					regBaseZdjbxx.setTfh(regBaseZdjbxxTemp.getTfh());		// 图幅号
					regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());		// 地籍号
					regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());		// 档案号
					regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());		// 备注
					regBaseZdjbxx.setZt(regBaseZdjbxxTemp.getZt());		// 状态
					regBaseZdjbxx.setQlrxm(regBaseZdjbxxTemp.getQlrxm());   //权利人姓名
					regBaseZdjbxx.setZjlx(regBaseZdjbxxTemp.getZjlx()); //证件类型
					regBaseZdjbxx.setSfzh(regBaseZdjbxxTemp.getSfzh());    //身份证号
					regBaseZdjbxx.setSeachprov(regBaseZdjbxxTemp.getSeachprov()); //县级行政区
					regBaseZdjbxx.setSeachcity(regBaseZdjbxxTemp.getSeachcity()); //地籍区
					regBaseZdjbxx.setSeachdistrict(regBaseZdjbxxTemp.getSeachdistrict()); //地籍子区
					regBaseZdjbxx.setZb(regBaseZdjbxxTemp.getZb()); //坐标
					regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm()); //土地所有权代码
					regBaseZdjbxx.setIsaudit(regBaseZdjbxxTemp.getIsaudit());  //审核【宗地信息在新建时isaudit为0,如果审核了isaudit为1【测绘信息同时审核】;如果被引用{土地首次登记、属性变更、分割和合并}时,修改isaudit为2【测绘信息同时以引用】;】
					regBaseZdjbxx.setStatus(regBaseZdjbxxTemp.getStatus()); //当前土地业务状态 默认为0
					regBaseZdjbxx.setHistory(regBaseZdjbxxTemp.getHistory()); //标示区别是否历史信息录入
					regBaseZdjbxx.setIslogout(regBaseZdjbxxTemp.getIslogout()); //是否注销  分割合并后原数据注销
					regBaseZdjbxx.setChid(regBaseZdjbxxTemp.getChid()); //测绘ID
					regBaseZdjbxx.setXmid(regBaseZdjbxxTemp.getXmid()); //项目ID
					model.addAttribute("OldZdId", regBaseZdjbxxTemp.getId());
				}
			}
		}
		model.addAttribute("oldywid", oldywid);
		model.addAttribute("zdtzm", regBaseZdjbxx.getZdtzm());
		
		if(StringUtils.isNotBlank(djlxStr)){
			model.addAttribute("DJLX", djlxStr);
		}
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		if(StringUtils.isNotBlank(request.getParameter("YSDM"))){
			model.addAttribute("YSDM",request.getParameter("YSDM"));
		}
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH",ywh);
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		if(StringUtils.isNotBlank(request.getParameter("optype"))){
			model.addAttribute("optype", request.getParameter("optype"));
		}
		if(regBaseZdjbxx.getQllx().equals("3") || regBaseZdjbxx.getQllx().equals("7")){
			dict.setValue("3");
		}else if(regBaseZdjbxx.getQllx().equals("5")){
			dict.setValue("5");
		}
		dict.setType("reg_bus_tdyt");
		List<String> ytList = dictService.findTdytList(dict);
		model.addAttribute("ytList", ytList);
		return "modules/reg/base/regBaseZdjbxxnydbgPropertyForm";
	}
	
	/**
	* @Title: propertygmform 
	* @Description: 土地承包经营权更名 
	* @param @param regBaseZdjbxx
	* @param @param model
	* @param @param request
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "propertnydgmform")
	public String propertnydgmform(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		//业务号
		String ywh = request.getParameter("YWH");
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH",ywh);
			if(StringUtils.isBlank(request.getParameter("optye"))){
				RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
				regBusBdcqzsdjxx.setYwh(ywh);
				regBusBdcqzsdjxxService.deletezyyg(regBusBdcqzsdjxx);
				regBusNydsyqService.deletenydzyywh(ywh);
				regBusQlrService.deleteywh(ywh);
				RegBaseZdbhqk zdbhqk = new RegBaseZdbhqk();
				zdbhqk.setYwh(ywh);
				regBaseZdbhqkService.deletezdbhqk(zdbhqk);
				RegBusYwr ywr = new RegBusYwr();
				ywr.setYwh(ywh);
				regBusYwrService.deleteywr(ywr);
			}
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		String oldywid = request.getParameter("oldywid");
		if(StringUtils.isNotBlank(oldywid) && StringUtils.isBlank(request.getParameter("optye"))){
			model.addAttribute("oldywid", oldywid);
			RegBusBdcqzsdjxx entity = regBusBdcqzsdjxxService.get(oldywid);
			//获取宗地信息
			RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
			regBaseZdjbxxTemp.setZddm(entity.getZddm());
			regBaseZdjbxxTemp.setIslogout("0");
			List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
			if(listJbxx != null && listJbxx.size()>0){
				regBaseZdjbxxTemp = listJbxx.get(0);
				//完全赋值过来;然后后面就是修改宗地基本信息的值而不是新增,这里也可以按照实际需求,如果需要新增一块地也是可以的,比如当坐落发生变更时;
				//修改为新增一块地,可以是宗地代码不变,也可以改变;新增后 islogout = 1 ;登薄时生效,并把旧的宗地注销;当前宗地变化情况表对应的业务号
				//存上变更前地的ID
				regBaseZdjbxx.setYsdm(regBaseZdjbxxTemp.getYsdm());
				regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh()); 
				regBaseZdjbxx.setZddm(regBaseZdjbxxTemp.getZddm()); 
				regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm()); 
				regBaseZdjbxx.setZl(regBaseZdjbxxTemp.getZl()); 
				regBaseZdjbxx.setZdmj(regBaseZdjbxxTemp.getZdmj());		// 宗地面积
				regBaseZdjbxx.setMjdw(regBaseZdjbxxTemp.getMjdw());		// 面积单位
				regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());		// 用途
				regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());		// 等级
				regBaseZdjbxx.setJg(regBaseZdjbxxTemp.getJg());		// 价格
				regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());		// 权利类型
				regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());		// 权利性质
				regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());		// 权利设定方式
				regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());		// 容积率 by update 1231 xuyg
				regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());		// 建筑密度by update 1231 xuyg
				regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());		// 建筑限高by update 1231 xuyg
				regBaseZdjbxx.setZdszd(regBaseZdjbxxTemp.getZdszd());		// 宗地四至-东
				regBaseZdjbxx.setZdszn(regBaseZdjbxxTemp.getZdszn());		// 宗地四至-南
				regBaseZdjbxx.setZdszx(regBaseZdjbxxTemp.getZdszx());		// 宗地四至-西
				regBaseZdjbxx.setZdszb(regBaseZdjbxxTemp.getZdszb());		// 宗地四至-北
				regBaseZdjbxx.setZdt(regBaseZdjbxxTemp.getZdt());		// 宗地图
				regBaseZdjbxx.setTfh(regBaseZdjbxxTemp.getTfh());		// 图幅号
				regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());		// 地籍号
				regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());		// 档案号
				regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());		// 备注
				regBaseZdjbxx.setZt(regBaseZdjbxxTemp.getZt());		// 状态
				regBaseZdjbxx.setQlrxm(regBaseZdjbxxTemp.getQlrxm());   //权利人姓名
				regBaseZdjbxx.setSfzh(regBaseZdjbxxTemp.getSfzh());    //身份证号
				regBaseZdjbxx.setSeachprov(regBaseZdjbxxTemp.getSeachprov()); //县级行政区
				regBaseZdjbxx.setSeachcity(regBaseZdjbxxTemp.getSeachcity()); //地籍区
				regBaseZdjbxx.setSeachdistrict(regBaseZdjbxxTemp.getSeachdistrict()); //地籍子区
				regBaseZdjbxx.setZjlx(regBaseZdjbxxTemp.getZjlx()); //证件类型
				regBaseZdjbxx.setZb(regBaseZdjbxxTemp.getZb()); //坐标
				regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm()); //土地所有权代码
				regBaseZdjbxx.setIsaudit(regBaseZdjbxxTemp.getIsaudit());  //审核【宗地信息在新建时isaudit为0,如果审核了isaudit为1【测绘信息同时审核】;如果被引用{土地首次登记、属性变更、分割和合并}时,修改isaudit为2【测绘信息同时以引用】;】
				regBaseZdjbxx.setStatus(regBaseZdjbxxTemp.getStatus()); //当前土地业务状态 默认为0
				regBaseZdjbxx.setHistory(regBaseZdjbxxTemp.getHistory()); //标示区别是否历史信息录入
				regBaseZdjbxx.setIslogout(regBaseZdjbxxTemp.getIslogout()); //是否注销  分割合并后原数据注销
				regBaseZdjbxx.setChid(regBaseZdjbxxTemp.getChid()); //测绘ID
				regBaseZdjbxx.setXmid(regBaseZdjbxxTemp.getXmid()); //项目ID
				model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
			}
			//获取权利人信息列表
			Page<RegBusQlr> qlrpage = new Page<RegBusQlr>();
			List<RegBusQlr> qlrlist = new ArrayList<RegBusQlr>();
			RegBusQlr regBusQlr = new RegBusQlr();
			regBusQlr.setYwh(entity.getYwh());
			List<RegBusQlr> list = regBusQlrService.findList_1(regBusQlr);
			if(list != null && list.size()>0){
				for(int i=0;i<list.size();i++){
					regBusQlr = list.get(i);
					regBusQlr.setBdcdyh(entity.getBdcdyh());
					qlrlist.add(regBusQlr);
					qlrpage.setList(qlrlist);
				}
				model.addAttribute("qlrpage", qlrpage);//返回选择后的房屋列表
			}
			
			//获取选择的已登记信息的权属信息
			RegBusNydsyq nydsyq = new RegBusNydsyq();
			nydsyq.setYwh(entity.getYwh());
			nydsyq.setBdcdyh(entity.getBdcdyh());
			List<RegBusNydsyq> fdclist = regBusNydsyqService.findList(nydsyq);
			if(fdclist.size() > 0){
				nydsyq = fdclist.get(0);
				nydsyq.setYwh(ywh);
				nydsyq.setDjlx("300");//直接属性变更
				nydsyq.setDjyy("权利人更名");
				nydsyq.setDjjg(null);
				nydsyq.setDjsj(null);
				nydsyq.setDbr(null);
				nydsyq.setBdcdyh(null);
			}
			model.addAttribute("regBusNydsyq", nydsyq);//返回选择后的房屋列表
		}else if(StringUtils.isNotBlank(request.getParameter("optye"))){
			if (StringUtils.isNotBlank(request.getParameter("VIEWS"))) {
				model.addAttribute("VIEWS", "1");
			}
			// 初审以后的环节只能查看不能修改删除
			if (StringUtils.isNotBlank(request.getParameter("LISTVIEWS"))) {
				model.addAttribute("LISTVIEWS", "1");
			}
			//获取当前的权属信息
			RegBusNydsyq nydsyq  = regBusNydsyqService.get(oldywid);
			model.addAttribute("oldywid", oldywid);//权属信息id
			model.addAttribute("optye", "1");
			model.addAttribute("regBusNydsyq", nydsyq);//返回选择后的房屋列表
			//获取宗地信息
			RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
			regBaseZdjbxxTemp.setZddm(nydsyq.getZddm());
			regBaseZdjbxxTemp.setIslogout("0");
			List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
			if(listJbxx != null && listJbxx.size()>0){
				regBaseZdjbxxTemp = listJbxx.get(0);
				//完全赋值过来;然后后面就是修改宗地基本信息的值而不是新增,这里也可以按照实际需求,如果需要新增一块地也是可以的,比如当坐落发生变更时;
				//修改为新增一块地,可以是宗地代码不变,也可以改变;新增后 islogout = 1 ;登薄时生效,并把旧的宗地注销;当前宗地变化情况表对应的业务号
				//存上变更前地的ID
				model.addAttribute("regBaseZdjbxx", regBaseZdjbxxTemp);
				//获取当前登记信息
				RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
				djxx.setYwh(nydsyq.getYwh());
				djxx.setBdcdyh(nydsyq.getBdcdyh());
				List<RegBusBdcqzsdjxx> djxxlist =  regBusBdcqzsdjxxService.findList(djxx);
				if(djxxlist.size() > 0){
					djxx = djxxlist.get(0);
					//获取旧登记信息
					RegBusBdcqzsdjxx djxxold = regBusBdcqzsdjxxService.get(djxx.getOldid());
					//获取权利人信息列表
					Page<RegBusQlr> qlrpage = new Page<RegBusQlr>();
					List<RegBusQlr> qlrlist = new ArrayList<RegBusQlr>();
					RegBusQlr regBusQlr = new RegBusQlr();
					regBusQlr.setYwh(djxxold.getYwh());
					List<RegBusQlr> list = regBusQlrService.findList_1(regBusQlr);
					if(list != null && list.size()>0){
						for(int i=0;i<list.size();i++){
							regBusQlr = list.get(i);
							regBusQlr.setBdcdyh(nydsyq.getBdcdyh());
							qlrlist.add(regBusQlr);
							qlrpage.setList(qlrlist);
						}
						model.addAttribute("qlrpage", qlrpage);//返回选择后的房屋列表
					}
				}
			}
		}
		String djlxStr = request.getParameter("djlx");
		if(StringUtils.isNotBlank(djlxStr)){
			model.addAttribute("DJLX", djlxStr);
		}
		return "modules/reg/base/regBaseZdjbxxPropertnydGmForm";
	}
	
	
	/**
	* @Title: propertygmform 
	* @Description: 更名 
	* @param @param regBaseZdjbxx
	* @param @param model
	* @param @param request
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "propertygmform")
	public String propertygmform(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		//根据宗地代码查看一条宗地信息,只能是VIEWS时查看【要不然save时没有验证通过返回FORM时就会根据已选的宗地代码查出宗地信息】
		if(StringUtils.isNotBlank(regBaseZdjbxx.getZddm()) && StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxx);
			for(int i=0;i<findList.size();i++){
				regBaseZdjbxx = findList.get(0);
			}
		}
		//传递要素代码
		if(StringUtils.isNotBlank(request.getParameter("YSDM"))){
			model.addAttribute("YSDM",request.getParameter("YSDM"));
		}
		//业务号
		String ywh = request.getParameter("YWH");
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH",ywh);
			if(StringUtils.isBlank(request.getParameter("optype"))){
				RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
				regBusBdcqzsdjxx.setYwh(ywh);
				regBusBdcqzsdjxxService.deletezyyg(regBusBdcqzsdjxx);
				regBusJsydsyqService.deleteRegBusJsydsyq(ywh);
				regBusQlrService.deleteywh(ywh);
				RegBaseZdbhqk zdbhqk = new RegBaseZdbhqk();
				zdbhqk.setYwh(ywh);
				regBaseZdbhqkService.deletezdbhqk(zdbhqk);
				RegBusYwr ywr = new RegBusYwr();
				ywr.setYwh(ywh);
				regBusYwrService.deleteywr(ywr);
			}
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		String oldywid = request.getParameter("oldywid");
		
		if(StringUtils.isNotBlank(oldywid) && StringUtils.isBlank(request.getParameter("optype"))){
			model.addAttribute("oldywid", oldywid);
			RegBusBdcqzsdjxx entity = regBusBdcqzsdjxxService.get(oldywid);
			//获取宗地信息
			RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
			regBaseZdjbxxTemp.setZddm(entity.getZddm());
			regBaseZdjbxxTemp.setIslogout("0");
			List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
			if(listJbxx != null && listJbxx.size()>0){
				regBaseZdjbxxTemp = listJbxx.get(0);
				//完全赋值过来;然后后面就是修改宗地基本信息的值而不是新增,这里也可以按照实际需求,如果需要新增一块地也是可以的,比如当坐落发生变更时;
				//修改为新增一块地,可以是宗地代码不变,也可以改变;新增后 islogout = 1 ;登薄时生效,并把旧的宗地注销;当前宗地变化情况表对应的业务号
				//存上变更前地的ID
				regBaseZdjbxx.setYsdm(regBaseZdjbxxTemp.getYsdm());
				regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh()); 
				regBaseZdjbxx.setZddm(regBaseZdjbxxTemp.getZddm()); 
				regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm()); 
				regBaseZdjbxx.setZl(regBaseZdjbxxTemp.getZl()); 
				regBaseZdjbxx.setZdmj(regBaseZdjbxxTemp.getZdmj());		// 宗地面积
				regBaseZdjbxx.setMjdw(regBaseZdjbxxTemp.getMjdw());		// 面积单位
				regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());		// 用途
				regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());		// 等级
				regBaseZdjbxx.setJg(regBaseZdjbxxTemp.getJg());		// 价格
				regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());		// 权利类型
				regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());		// 权利性质
				regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());		// 权利设定方式
				regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());		// 容积率 by update 1231 xuyg
				regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());		// 建筑密度by update 1231 xuyg
				regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());		// 建筑限高by update 1231 xuyg
				regBaseZdjbxx.setZdszd(regBaseZdjbxxTemp.getZdszd());		// 宗地四至-东
				regBaseZdjbxx.setZdszn(regBaseZdjbxxTemp.getZdszn());		// 宗地四至-南
				regBaseZdjbxx.setZdszx(regBaseZdjbxxTemp.getZdszx());		// 宗地四至-西
				regBaseZdjbxx.setZdszb(regBaseZdjbxxTemp.getZdszb());		// 宗地四至-北
				regBaseZdjbxx.setZdt(regBaseZdjbxxTemp.getZdt());		// 宗地图
				regBaseZdjbxx.setTfh(regBaseZdjbxxTemp.getTfh());		// 图幅号
				regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());		// 地籍号
				regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());		// 档案号
				regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());		// 备注
				regBaseZdjbxx.setZt(regBaseZdjbxxTemp.getZt());		// 状态
				regBaseZdjbxx.setQlrxm(regBaseZdjbxxTemp.getQlrxm());   //权利人姓名
				regBaseZdjbxx.setSfzh(regBaseZdjbxxTemp.getSfzh());    //身份证号
				regBaseZdjbxx.setSeachprov(regBaseZdjbxxTemp.getSeachprov()); //县级行政区
				regBaseZdjbxx.setSeachcity(regBaseZdjbxxTemp.getSeachcity()); //地籍区
				regBaseZdjbxx.setSeachdistrict(regBaseZdjbxxTemp.getSeachdistrict()); //地籍子区
				regBaseZdjbxx.setZjlx(regBaseZdjbxxTemp.getZjlx()); //证件类型
				regBaseZdjbxx.setZb(regBaseZdjbxxTemp.getZb()); //坐标
				regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm()); //土地所有权代码
				regBaseZdjbxx.setIsaudit(regBaseZdjbxxTemp.getIsaudit());  //审核【宗地信息在新建时isaudit为0,如果审核了isaudit为1【测绘信息同时审核】;如果被引用{土地首次登记、属性变更、分割和合并}时,修改isaudit为2【测绘信息同时以引用】;】
				regBaseZdjbxx.setStatus(regBaseZdjbxxTemp.getStatus()); //当前土地业务状态 默认为0
				regBaseZdjbxx.setHistory(regBaseZdjbxxTemp.getHistory()); //标示区别是否历史信息录入
				regBaseZdjbxx.setIslogout(regBaseZdjbxxTemp.getIslogout()); //是否注销  分割合并后原数据注销
				regBaseZdjbxx.setChid(regBaseZdjbxxTemp.getChid()); //测绘ID
				regBaseZdjbxx.setXmid(regBaseZdjbxxTemp.getXmid()); //项目ID
				model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
				model.addAttribute("OldZdId", regBaseZdjbxxTemp.getId());
				model.addAttribute("BDCDYH", regBaseZdjbxx.getBdcdyh());
			}
			
			//获取权利人信息列表
			Page<RegBusQlr> qlrpage = new Page<RegBusQlr>();
			List<RegBusQlr> qlrlist = new ArrayList<RegBusQlr>();
			RegBusQlr regBusQlr = new RegBusQlr();
			regBusQlr.setYwh(entity.getYwh());
			List<RegBusQlr> list = regBusQlrService.findList_1(regBusQlr);
			if(list != null && list.size()>0){
				for(int i=0;i<list.size();i++){
					regBusQlr = list.get(i);
					regBusQlr.setBdcdyh(entity.getBdcdyh());
					qlrlist.add(regBusQlr);
					qlrpage.setList(qlrlist);
				}
				model.addAttribute("qlrpage", qlrpage);//返回选择后的房屋列表
			}
			
			//获取选择的已登记信息的权属信息
			RegBusJsydsyq jsydsyq = new RegBusJsydsyq();
			RegBusJsydsyq regBusJsydsyq = new RegBusJsydsyq();
			jsydsyq.setYwh(entity.getYwh());
			jsydsyq.setBdcdyh(entity.getBdcdyh());
			List<RegBusJsydsyq> fdclist = regBusJsydsyqService.findList(jsydsyq);
			if(fdclist.size() > 0){
				jsydsyq = fdclist.get(0);
				regBusJsydsyq.setQdjg(jsydsyq.getQdjg());
				regBusJsydsyq.setYwh(ywh);
				regBusJsydsyq.setBdcdyh(jsydsyq.getBdcdyh());
				regBusJsydsyq.setZddm(jsydsyq.getZddm());
				regBusJsydsyq.setSyqmj(jsydsyq.getSyqmj());
				regBusJsydsyq.setYsdm(jsydsyq.getYsdm());
				regBusJsydsyq.setQllx(jsydsyq.getQllx());
				regBusJsydsyq.setDjlx("300");//直接属性变更
				regBusJsydsyq.setDjyy("权利人更名");
				regBusJsydsyq.setSyqqssj(jsydsyq.getSyqqssj());
				regBusJsydsyq.setSyqjssj(jsydsyq.getSyqjssj());
				regBusJsydsyq.setQxdm(jsydsyq.getQxdm());
				regBusJsydsyq.setDjjg(jsydsyq.getDjjg());
				regBusJsydsyq.setFj(jsydsyq.getFj());
				regBusJsydsyq.setQszt(jsydsyq.getQszt());
				model.addAttribute("regBusJsydsyq", regBusJsydsyq);//返回选择后的房屋列表
			}
		}else if(StringUtils.isBlank(oldywid) && StringUtils.isNotBlank(request.getParameter("optype"))){
			if (StringUtils.isNotBlank(request.getParameter("VIEWS"))) {
				model.addAttribute("VIEWS", "1");
			}
			// 初审以后的环节只能查看不能修改删除
			if (StringUtils.isNotBlank(request.getParameter("LISTVIEWS"))) {
				model.addAttribute("LISTVIEWS", "1");
			}
			String ids = request.getParameter("ids");
			//获取选择的已登记信息的权属信息
			RegBusJsydsyq regBusJsydsyq = new RegBusJsydsyq();
			RegBusJsydsyq jsydsyq  = regBusJsydsyqService.get(ids);
			model.addAttribute("optype", "1");
			if(jsydsyq != null){
				regBusJsydsyq.setYwh(ywh);
				regBusJsydsyq.setBdcdyh(jsydsyq.getBdcdyh());
				regBusJsydsyq.setDbr(jsydsyq.getDbr());
				regBusJsydsyq.setDjsj(jsydsyq.getDjsj());
				regBusJsydsyq.setZddm(jsydsyq.getZddm());
				regBusJsydsyq.setSyqmj(jsydsyq.getSyqmj());
				regBusJsydsyq.setYsdm(jsydsyq.getYsdm());
				regBusJsydsyq.setQllx(jsydsyq.getQllx());
				regBusJsydsyq.setDjlx("300");//直接属性变更
				regBusJsydsyq.setDjyy("权利人更名");
				regBusJsydsyq.setSyqqssj(jsydsyq.getSyqqssj());
				regBusJsydsyq.setSyqjssj(jsydsyq.getSyqjssj());
				regBusJsydsyq.setQxdm(jsydsyq.getQxdm());
				regBusJsydsyq.setDjjg(jsydsyq.getDjjg());
				regBusJsydsyq.setFj(jsydsyq.getFj());
				regBusJsydsyq.setQszt(jsydsyq.getQszt());
				model.addAttribute("regBusJsydsyq", regBusJsydsyq);//返回选择后的房屋列表
			}
			//获取宗地信息
			RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
			regBaseZdjbxxTemp.setZddm(jsydsyq.getZddm());
			regBaseZdjbxxTemp.setIslogout("0");
			List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
			if(listJbxx != null && listJbxx.size()>0){
				regBaseZdjbxxTemp = listJbxx.get(0);
				//完全赋值过来;然后后面就是修改宗地基本信息的值而不是新增,这里也可以按照实际需求,如果需要新增一块地也是可以的,比如当坐落发生变更时;
				//修改为新增一块地,可以是宗地代码不变,也可以改变;新增后 islogout = 1 ;登薄时生效,并把旧的宗地注销;当前宗地变化情况表对应的业务号
				//存上变更前地的ID
				regBaseZdjbxx.setYsdm(regBaseZdjbxxTemp.getYsdm());
				regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh()); 
				regBaseZdjbxx.setZddm(regBaseZdjbxxTemp.getZddm()); 
				regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm()); 
				regBaseZdjbxx.setZl(regBaseZdjbxxTemp.getZl()); 
				regBaseZdjbxx.setZdmj(regBaseZdjbxxTemp.getZdmj());		// 宗地面积
				regBaseZdjbxx.setMjdw(regBaseZdjbxxTemp.getMjdw());		// 面积单位
				regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());		// 用途
				regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());		// 等级
				regBaseZdjbxx.setJg(regBaseZdjbxxTemp.getJg());		// 价格
				regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());		// 权利类型
				regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());		// 权利性质
				regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());		// 权利设定方式
				regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());		// 容积率 by update 1231 xuyg
				regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());		// 建筑密度by update 1231 xuyg
				regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());		// 建筑限高by update 1231 xuyg
				regBaseZdjbxx.setZdszd(regBaseZdjbxxTemp.getZdszd());		// 宗地四至-东
				regBaseZdjbxx.setZdszn(regBaseZdjbxxTemp.getZdszn());		// 宗地四至-南
				regBaseZdjbxx.setZdszx(regBaseZdjbxxTemp.getZdszx());		// 宗地四至-西
				regBaseZdjbxx.setZdszb(regBaseZdjbxxTemp.getZdszb());		// 宗地四至-北
				regBaseZdjbxx.setZdt(regBaseZdjbxxTemp.getZdt());		// 宗地图
				regBaseZdjbxx.setTfh(regBaseZdjbxxTemp.getTfh());		// 图幅号
				regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());		// 地籍号
				regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());		// 档案号
				regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());		// 备注
				regBaseZdjbxx.setZt(regBaseZdjbxxTemp.getZt());		// 状态
				regBaseZdjbxx.setQlrxm(regBaseZdjbxxTemp.getQlrxm());   //权利人姓名
				regBaseZdjbxx.setSfzh(regBaseZdjbxxTemp.getSfzh());    //身份证号
				regBaseZdjbxx.setSeachprov(regBaseZdjbxxTemp.getSeachprov()); //县级行政区
				regBaseZdjbxx.setSeachcity(regBaseZdjbxxTemp.getSeachcity()); //地籍区
				regBaseZdjbxx.setSeachdistrict(regBaseZdjbxxTemp.getSeachdistrict()); //地籍子区
				regBaseZdjbxx.setZjlx(regBaseZdjbxxTemp.getZjlx()); //证件类型
				regBaseZdjbxx.setZb(regBaseZdjbxxTemp.getZb()); //坐标
				regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm()); //土地所有权代码
				regBaseZdjbxx.setIsaudit(regBaseZdjbxxTemp.getIsaudit());  //审核【宗地信息在新建时isaudit为0,如果审核了isaudit为1【测绘信息同时审核】;如果被引用{土地首次登记、属性变更、分割和合并}时,修改isaudit为2【测绘信息同时以引用】;】
				regBaseZdjbxx.setStatus(regBaseZdjbxxTemp.getStatus()); //当前土地业务状态 默认为0
				regBaseZdjbxx.setHistory(regBaseZdjbxxTemp.getHistory()); //标示区别是否历史信息录入
				regBaseZdjbxx.setIslogout(regBaseZdjbxxTemp.getIslogout()); //是否注销  分割合并后原数据注销
				regBaseZdjbxx.setChid(regBaseZdjbxxTemp.getChid()); //测绘ID
				regBaseZdjbxx.setXmid(regBaseZdjbxxTemp.getXmid()); //项目ID
				model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
				model.addAttribute("OldZdId", regBaseZdjbxxTemp.getId());
				model.addAttribute("BDCDYH", regBaseZdjbxx.getBdcdyh());
				
				
				RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
				djxx.setYwh(jsydsyq.getYwh());
				djxx.setBdcdyh(jsydsyq.getBdcqzh());
				List<RegBusBdcqzsdjxx> djxxlist =  regBusBdcqzsdjxxService.findList(djxx);
				if(djxxlist.size() > 0){
					djxx = djxxlist.get(0);
					RegBusBdcqzsdjxx djxxold = regBusBdcqzsdjxxService.get(djxx.getOldid());
					//获取权利人信息列表
					Page<RegBusQlr> qlrpage = new Page<RegBusQlr>();
					List<RegBusQlr> qlrlist = new ArrayList<RegBusQlr>();
					RegBusQlr regBusQlr = new RegBusQlr();
					regBusQlr.setYwh(djxxold.getYwh());
					List<RegBusQlr> list = regBusQlrService.findList_1(regBusQlr);
					if(list != null && list.size()>0){
						for(int i=0;i<list.size();i++){
							regBusQlr = list.get(i);
							regBusQlr.setBdcdyh(jsydsyq.getBdcdyh());
							qlrlist.add(regBusQlr);
							qlrpage.setList(qlrlist);
						}
						model.addAttribute("qlrpage", qlrpage);//返回选择后的房屋列表
					}
				}
			}
		}
		String djlxStr = request.getParameter("djlx");
		if(StringUtils.isNotBlank(djlxStr)){
			model.addAttribute("DJLX", djlxStr);
		}
		return "modules/reg/base/regBaseZdjbxxPropertyGmForm";
	}
	
	/**
	* @Title: propertygmform 
	* @Description: 集体土地所有权更名 
	* @param @param regBaseZdjbxx
	* @param @param model
	* @param @param request
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "TdSyqpropertygmform")
	public String TdSyqpropertygmform(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		//根据宗地代码查看一条宗地信息,只能是VIEWS时查看【要不然save时没有验证通过返回FORM时就会根据已选的宗地代码查出宗地信息】
		if(StringUtils.isNotBlank(regBaseZdjbxx.getZddm()) && StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxx);
			for(int i=0;i<findList.size();i++){
				regBaseZdjbxx = findList.get(0);
			}
		}
		//传递要素代码
		if(StringUtils.isNotBlank(request.getParameter("YSDM"))){
			model.addAttribute("YSDM",request.getParameter("YSDM"));
		}
		//业务号
		String ywh = request.getParameter("YWH");
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH",ywh);
			if(StringUtils.isBlank(request.getParameter("optype"))){
				RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
				regBusBdcqzsdjxx.setYwh(ywh);
				regBusBdcqzsdjxxService.deletezyyg(regBusBdcqzsdjxx);
				RegBusTdsyq tdsyq = new RegBusTdsyq();
				tdsyq.setYwh(ywh);
				regBusTdsyqService.deleteRegBusTdsyq(tdsyq);
				regBusQlrService.deleteywh(ywh);
				RegBaseZdbhqk zdbhqk = new RegBaseZdbhqk();
				zdbhqk.setYwh(ywh);
				regBaseZdbhqkService.deletezdbhqk(zdbhqk);
				RegBusYwr ywr = new RegBusYwr();
				ywr.setYwh(ywh);
				regBusYwrService.deleteywr(ywr);
			}
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		String oldywid = request.getParameter("oldywid");
		
		if(StringUtils.isNotBlank(oldywid) && StringUtils.isBlank(request.getParameter("optype"))){
			model.addAttribute("oldywid", oldywid);
			RegBusBdcqzsdjxx entity = regBusBdcqzsdjxxService.get(oldywid);
			//获取宗地信息
			RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
			regBaseZdjbxxTemp.setZddm(entity.getZddm());
			regBaseZdjbxxTemp.setIslogout("0");
			List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
			if(listJbxx != null && listJbxx.size()>0){
				regBaseZdjbxxTemp = listJbxx.get(0);
				//完全赋值过来;然后后面就是修改宗地基本信息的值而不是新增,这里也可以按照实际需求,如果需要新增一块地也是可以的,比如当坐落发生变更时;
				//修改为新增一块地,可以是宗地代码不变,也可以改变;新增后 islogout = 1 ;登薄时生效,并把旧的宗地注销;当前宗地变化情况表对应的业务号
				//存上变更前地的ID
				regBaseZdjbxx.setYsdm(regBaseZdjbxxTemp.getYsdm());
				regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh()); 
				regBaseZdjbxx.setZddm(regBaseZdjbxxTemp.getZddm()); 
				regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm()); 
				regBaseZdjbxx.setZl(regBaseZdjbxxTemp.getZl()); 
				regBaseZdjbxx.setZdmj(regBaseZdjbxxTemp.getZdmj());		// 宗地面积
				regBaseZdjbxx.setMjdw(regBaseZdjbxxTemp.getMjdw());		// 面积单位
				regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());		// 用途
				regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());		// 等级
				regBaseZdjbxx.setJg(regBaseZdjbxxTemp.getJg());		// 价格
				regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());		// 权利类型
				regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());		// 权利性质
				regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());		// 权利设定方式
				regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());		// 容积率 by update 1231 xuyg
				regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());		// 建筑密度by update 1231 xuyg
				regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());		// 建筑限高by update 1231 xuyg
				regBaseZdjbxx.setZdszd(regBaseZdjbxxTemp.getZdszd());		// 宗地四至-东
				regBaseZdjbxx.setZdszn(regBaseZdjbxxTemp.getZdszn());		// 宗地四至-南
				regBaseZdjbxx.setZdszx(regBaseZdjbxxTemp.getZdszx());		// 宗地四至-西
				regBaseZdjbxx.setZdszb(regBaseZdjbxxTemp.getZdszb());		// 宗地四至-北
				regBaseZdjbxx.setZdt(regBaseZdjbxxTemp.getZdt());		// 宗地图
				regBaseZdjbxx.setTfh(regBaseZdjbxxTemp.getTfh());		// 图幅号
				regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());		// 地籍号
				regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());		// 档案号
				regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());		// 备注
				regBaseZdjbxx.setZt(regBaseZdjbxxTemp.getZt());		// 状态
				regBaseZdjbxx.setQlrxm(regBaseZdjbxxTemp.getQlrxm());   //权利人姓名
				regBaseZdjbxx.setSfzh(regBaseZdjbxxTemp.getSfzh());    //身份证号
				regBaseZdjbxx.setSeachprov(regBaseZdjbxxTemp.getSeachprov()); //县级行政区
				regBaseZdjbxx.setSeachcity(regBaseZdjbxxTemp.getSeachcity()); //地籍区
				regBaseZdjbxx.setSeachdistrict(regBaseZdjbxxTemp.getSeachdistrict()); //地籍子区
				regBaseZdjbxx.setZjlx(regBaseZdjbxxTemp.getZjlx()); //证件类型
				regBaseZdjbxx.setZb(regBaseZdjbxxTemp.getZb()); //坐标
				regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm()); //土地所有权代码
				regBaseZdjbxx.setIsaudit(regBaseZdjbxxTemp.getIsaudit());  //审核【宗地信息在新建时isaudit为0,如果审核了isaudit为1【测绘信息同时审核】;如果被引用{土地首次登记、属性变更、分割和合并}时,修改isaudit为2【测绘信息同时以引用】;】
				regBaseZdjbxx.setStatus(regBaseZdjbxxTemp.getStatus()); //当前土地业务状态 默认为0
				regBaseZdjbxx.setHistory(regBaseZdjbxxTemp.getHistory()); //标示区别是否历史信息录入
				regBaseZdjbxx.setIslogout(regBaseZdjbxxTemp.getIslogout()); //是否注销  分割合并后原数据注销
				regBaseZdjbxx.setChid(regBaseZdjbxxTemp.getChid()); //测绘ID
				regBaseZdjbxx.setXmid(regBaseZdjbxxTemp.getXmid()); //项目ID
				model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
				model.addAttribute("OldZdId", regBaseZdjbxxTemp.getId());
				model.addAttribute("BDCDYH", regBaseZdjbxx.getBdcdyh());
			}
			
			//获取权利人信息列表
			Page<RegBusQlr> qlrpage = new Page<RegBusQlr>();
			List<RegBusQlr> qlrlist = new ArrayList<RegBusQlr>();
			RegBusQlr regBusQlr = new RegBusQlr();
			regBusQlr.setYwh(entity.getYwh());
			List<RegBusQlr> list = regBusQlrService.findList_1(regBusQlr);
			if(list != null && list.size()>0){
				for(int i=0;i<list.size();i++){
					regBusQlr = list.get(i);
					regBusQlr.setBdcdyh(entity.getBdcdyh());
					qlrlist.add(regBusQlr);
					qlrpage.setList(qlrlist);
				}
				model.addAttribute("qlrpage", qlrpage);//返回选择后的房屋列表
			}
			//插入权属信息表
			RegBusTdsyq  Tdsyq = new RegBusTdsyq();
			RegBusTdsyq  regBusTdsyq = new RegBusTdsyq();
			Tdsyq.setYwh(entity.getYwh());
			Tdsyq.setBdcdyh(entity.getBdcdyh());
			List<RegBusTdsyq> syqList = regBusTdsyqService.findList(Tdsyq);
			if(syqList.size() > 0){
				Tdsyq = syqList.get(0);
				regBusTdsyq.setZddm(entity.getZddm());
				regBusTdsyq.setLdmj(Tdsyq.getLdmj());
				regBusTdsyq.setJsydmj(Tdsyq.getJsydmj());
				regBusTdsyq.setNydmj(Tdsyq.getNydmj());
				regBusTdsyq.setCdmj(Tdsyq.getCdmj());
				regBusTdsyq.setWlydmj(Tdsyq.getWlydmj());
				regBusTdsyq.setGdmj(Tdsyq.getGdmj());
				regBusTdsyq.setBdcqzh(null);
				regBusTdsyq.setDbr(null);
				regBusTdsyq.setDjsj(null);
				regBusTdsyq.setQtnydmj(Tdsyq.getQtnydmj());
				regBusTdsyq.setQszt("0");
				regBusTdsyq.setBdcdyh(entity.getBdcdyh());
				regBusTdsyq.setYsdm("6002010120"); 
				regBusTdsyq.setYwh(ywh);
				regBusTdsyq.setQxdm(Global.getAreaCode());
				regBusTdsyq.setDjlx(DictUtils.getDictValue("变更登记", "reg_bus_djlx",""));//登记类型
				regBusTdsyq.setMjdw(DictUtils.getDictLabel("1", "reg_bus_mjdw", ""));
				regBusTdsyq.setQllx(DictUtils.getDictLabel("1", "reg_bus_qllx", ""));
				model.addAttribute("regBusTdsyq", regBusTdsyq);//返回选择后的房屋列表
			}
		}else if(StringUtils.isBlank(oldywid) && StringUtils.isNotBlank(request.getParameter("optype"))){
			if (StringUtils.isNotBlank(request.getParameter("VIEWS"))) {
				model.addAttribute("VIEWS", "1");
			}
			// 初审以后的环节只能查看不能修改删除
			if (StringUtils.isNotBlank(request.getParameter("LISTVIEWS"))) {
				model.addAttribute("LISTVIEWS", "1");
			}
			String ids = request.getParameter("ids");
			//插入权属信息表
			RegBusTdsyq  Tdsyq = regBusTdsyqService.get(ids);
			RegBusTdsyq  regBusTdsyq = new RegBusTdsyq();
			model.addAttribute("optype", "1");
			if(Tdsyq != null){
				regBusTdsyq.setZddm(Tdsyq.getZddm());
				regBusTdsyq.setLdmj(Tdsyq.getLdmj());
				regBusTdsyq.setJsydmj(Tdsyq.getJsydmj());
				regBusTdsyq.setNydmj(Tdsyq.getNydmj());
				regBusTdsyq.setCdmj(Tdsyq.getCdmj());
				regBusTdsyq.setWlydmj(Tdsyq.getWlydmj());
				regBusTdsyq.setGdmj(Tdsyq.getGdmj());
				regBusTdsyq.setBdcqzh(Tdsyq.getBdcqzh());
				regBusTdsyq.setDbr(Tdsyq.getDbr());
				regBusTdsyq.setDjsj(Tdsyq.getDjsj());
				regBusTdsyq.setQtnydmj(Tdsyq.getQtnydmj());
				regBusTdsyq.setQszt("0");
				regBusTdsyq.setBdcdyh(Tdsyq.getBdcdyh());
				regBusTdsyq.setYsdm("6002010120"); 
				regBusTdsyq.setYwh(ywh);
				regBusTdsyq.setQxdm(Global.getAreaCode());
				regBusTdsyq.setDjlx(DictUtils.getDictValue("变更登记", "reg_bus_djlx",""));//登记类型
				regBusTdsyq.setMjdw(DictUtils.getDictLabel("1", "reg_bus_mjdw", ""));
				regBusTdsyq.setQllx(DictUtils.getDictLabel("1", "reg_bus_qllx", ""));
			}
			//获取宗地信息
			RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
			regBaseZdjbxxTemp.setZddm(Tdsyq.getZddm());
			regBaseZdjbxxTemp.setIslogout("0");
			List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
			if(listJbxx != null && listJbxx.size()>0){
				regBaseZdjbxxTemp = listJbxx.get(0);
				//完全赋值过来;然后后面就是修改宗地基本信息的值而不是新增,这里也可以按照实际需求,如果需要新增一块地也是可以的,比如当坐落发生变更时;
				//修改为新增一块地,可以是宗地代码不变,也可以改变;新增后 islogout = 1 ;登薄时生效,并把旧的宗地注销;当前宗地变化情况表对应的业务号
				//存上变更前地的ID
				regBaseZdjbxx.setYsdm(regBaseZdjbxxTemp.getYsdm());
				regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh()); 
				regBaseZdjbxx.setZddm(regBaseZdjbxxTemp.getZddm()); 
				regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm()); 
				regBaseZdjbxx.setZl(regBaseZdjbxxTemp.getZl()); 
				regBaseZdjbxx.setZdmj(regBaseZdjbxxTemp.getZdmj());		// 宗地面积
				regBaseZdjbxx.setMjdw(regBaseZdjbxxTemp.getMjdw());		// 面积单位
				regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());		// 用途
				regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());		// 等级
				regBaseZdjbxx.setJg(regBaseZdjbxxTemp.getJg());		// 价格
				regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());		// 权利类型
				regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());		// 权利性质
				regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());		// 权利设定方式
				regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());		// 容积率 by update 1231 xuyg
				regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());		// 建筑密度by update 1231 xuyg
				regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());		// 建筑限高by update 1231 xuyg
				regBaseZdjbxx.setZdszd(regBaseZdjbxxTemp.getZdszd());		// 宗地四至-东
				regBaseZdjbxx.setZdszn(regBaseZdjbxxTemp.getZdszn());		// 宗地四至-南
				regBaseZdjbxx.setZdszx(regBaseZdjbxxTemp.getZdszx());		// 宗地四至-西
				regBaseZdjbxx.setZdszb(regBaseZdjbxxTemp.getZdszb());		// 宗地四至-北
				regBaseZdjbxx.setZdt(regBaseZdjbxxTemp.getZdt());		// 宗地图
				regBaseZdjbxx.setTfh(regBaseZdjbxxTemp.getTfh());		// 图幅号
				regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());		// 地籍号
				regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());		// 档案号
				regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());		// 备注
				regBaseZdjbxx.setZt(regBaseZdjbxxTemp.getZt());		// 状态
				regBaseZdjbxx.setQlrxm(regBaseZdjbxxTemp.getQlrxm());   //权利人姓名
				regBaseZdjbxx.setSfzh(regBaseZdjbxxTemp.getSfzh());    //身份证号
				regBaseZdjbxx.setSeachprov(regBaseZdjbxxTemp.getSeachprov()); //县级行政区
				regBaseZdjbxx.setSeachcity(regBaseZdjbxxTemp.getSeachcity()); //地籍区
				regBaseZdjbxx.setSeachdistrict(regBaseZdjbxxTemp.getSeachdistrict()); //地籍子区
				regBaseZdjbxx.setZjlx(regBaseZdjbxxTemp.getZjlx()); //证件类型
				regBaseZdjbxx.setZb(regBaseZdjbxxTemp.getZb()); //坐标
				regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm()); //土地所有权代码
				regBaseZdjbxx.setIsaudit(regBaseZdjbxxTemp.getIsaudit());  //审核【宗地信息在新建时isaudit为0,如果审核了isaudit为1【测绘信息同时审核】;如果被引用{土地首次登记、属性变更、分割和合并}时,修改isaudit为2【测绘信息同时以引用】;】
				regBaseZdjbxx.setStatus(regBaseZdjbxxTemp.getStatus()); //当前土地业务状态 默认为0
				regBaseZdjbxx.setHistory(regBaseZdjbxxTemp.getHistory()); //标示区别是否历史信息录入
				regBaseZdjbxx.setIslogout(regBaseZdjbxxTemp.getIslogout()); //是否注销  分割合并后原数据注销
				regBaseZdjbxx.setChid(regBaseZdjbxxTemp.getChid()); //测绘ID
				regBaseZdjbxx.setXmid(regBaseZdjbxxTemp.getXmid()); //项目ID
				model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
				model.addAttribute("OldZdId", regBaseZdjbxxTemp.getId());
				model.addAttribute("BDCDYH", regBaseZdjbxx.getBdcdyh());
				
				//获取权利人信息列表
				Page<RegBusQlr> qlrpage = new Page<RegBusQlr>();
				List<RegBusQlr> qlrlist = new ArrayList<RegBusQlr>();
				RegBusQlr regBusQlr = new RegBusQlr();
				regBusQlr.setYwh(Tdsyq.getYwh());
				List<RegBusQlr> list = regBusQlrService.findList_1(regBusQlr);
				if(list != null && list.size()>0){
					for(int i=0;i<list.size();i++){
						regBusQlr = list.get(i);
						regBusQlr.setBdcdyh(Tdsyq.getBdcdyh());
						qlrlist.add(regBusQlr);
						qlrpage.setList(qlrlist);
					}
					model.addAttribute("qlrpage", qlrpage);//返回选择后的房屋列表
				}
			}
		}
		String djlxStr = request.getParameter("djlx");
		if(StringUtils.isNotBlank(djlxStr)){
			model.addAttribute("DJLX", djlxStr);
		}
		return "modules/reg/base/regBaseZdjbxxPropertyTdSyqGmForm";
	}
	
	/**
	 * 土地分割
	 * @param regBaseZdjbxx
	 * @param model
	 * @param redirectAttributes
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "divisionSave")
	public synchronized String divisionSave(RegBaseZdjbxx regBaseZdjbxx, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		if (!beanValidator(model, regBaseZdjbxx)){
			return form(regBaseZdjbxx, model, request);
		}
		String ywhStr = request.getParameter("YWH");
		String oldywid = request.getParameter("oldywid");
		String djlx = request.getParameter("DJLX");
		String OldZdId = request.getParameter("OldZdId");
		String optype = request.getParameter("optype");
		
		///通过宗地初步代码给行政区、地籍区和地籍子区三个字段赋值
		String zddmStr = regBaseZdjbxx.getZddm();
		if(StringUtils.isNotBlank(zddmStr)){
			regBaseZdjbxx.setSeachprov(zddmStr.substring(0, 6));
			regBaseZdjbxx.setSeachcity(zddmStr.substring(0, 9));
			regBaseZdjbxx.setSeachdistrict(zddmStr.substring(0, 12));
			/*String maxZddmSxh = regBaseZdjbxxService.findMaxZddmByDistrict(regBaseZdjbxx.getZddm());//使用当前宗地代码
			if(zddmStr.length() == 12){
				String ruleCode = regBaseZdjbxx.getZddm() + regBaseZdjbxx.getTdsyqdm() + regBaseZdjbxx.getZdtzm();
				String nextZddm = getNextZddm(maxZddmSxh, ruleCode);
				//宗地代码跟不动产单元号同时生成
				regBaseZdjbxx.setZddm(nextZddm);
				regBaseZdjbxx.setBdcdyh(nextZddm + "W00000000");
			}*/
		}
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		//删除当前业务号下已经存在的登记信息
		if(StringUtils.isNotBlank(optype)){
			RegBusBdcqzsdjxx regBusBdcqzsdjxxT = new RegBusBdcqzsdjxx();
			regBusBdcqzsdjxxT.setYwh(ywhStr);
			RegBaseZdbhqk regBaseZdbhqkT = new RegBaseZdbhqk();
			RegBaseZdjbxx regBaseZdjbxxtmp = new RegBaseZdjbxx();
			regBaseZdjbxxtmp = regBaseZdjbxxService.get(OldZdId);
			regBaseZdbhqkT.setYwh(ywhStr);
			regBaseZdbhqkT.setZddm(regBaseZdjbxxtmp.getZddm());
			List<RegBaseZdbhqk> listregBaseZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqkT);
			for(int i=0;i<listregBaseZdbhqk.size();i++){
				regBaseZdbhqkT = listregBaseZdbhqk.get(i);
				regBaseZdjbxxtmp = regBaseZdjbxxService.get(regBaseZdbhqkT.getZdid());
				regBaseZdjbxxService.delete(regBaseZdjbxxtmp);
				regBaseZdbhqkService.deletezdbhqk(regBaseZdbhqkT);
			}
			regBusBdcqzsdjxx.setYwh(ywhStr);
			regBusBdcqzsdjxx.setBdcdyh(regBaseZdjbxx.getBdcdyh());
			List<RegBusBdcqzsdjxx> lsitRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
			if(lsitRegBusBdcqzsdjxx.size() == 1){
				regBusBdcqzsdjxx = lsitRegBusBdcqzsdjxx.get(0);
				regBusBdcqzsdjxx.setYwh(ywhStr);
				regBusBdcqzsdjxx.setQlrmc(regBaseZdjbxx.getQlrxm());
				regBusBdcqzsdjxx.setZl(regBaseZdjbxx.getZl());
				regBusBdcqzsdjxx.setBdcdyh(regBaseZdjbxx.getBdcdyh());
				regBusBdcqzsdjxx.setQllx(regBaseZdjbxx.getQllx());
				regBusBdcqzsdjxx.setQlxz(DictUtils.getDictLabel(regBaseZdjbxx.getQlxz(), "reg_bus_qlxz", ""));
				regBusBdcqzsdjxx.setYt(regBaseZdjbxx.getYt());
				regBusBdcqzsdjxx.setMj(regBaseZdjbxx.getZdmj()+"");
				regBusBdcqzsdjxx.setTh(regBaseZdjbxx.getTfh());
				regBusBdcqzsdjxx.setZddm(regBaseZdjbxx.getZddm());
				regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
			}
		}else {
			regBusBdcqzsdjxx.setYwh(ywhStr);
			regBusBdcqzsdjxx.setQlrmc(regBaseZdjbxx.getQlrxm());
			regBusBdcqzsdjxx.setZl(regBaseZdjbxx.getZl());
			regBusBdcqzsdjxx.setBdcdyh(regBaseZdjbxx.getBdcdyh());
			regBusBdcqzsdjxx.setQllx(regBaseZdjbxx.getQllx());
			regBusBdcqzsdjxx.setQlxz(DictUtils.getDictLabel(regBaseZdjbxx.getQlxz(), "reg_bus_qlxz", ""));
			regBusBdcqzsdjxx.setYt(regBaseZdjbxx.getYt());
			regBusBdcqzsdjxx.setMj(regBaseZdjbxx.getZdmj()+"");
			regBusBdcqzsdjxx.setTh(regBaseZdjbxx.getTfh());
			regBusBdcqzsdjxx.setZddm(regBaseZdjbxx.getZddm());
			RegBusBdcqzsdjxx old = regBusBdcqzsdjxxService.get(oldywid);
			regBusBdcqzsdjxx.setBdcqzh(old.getBdcqzh());
			//regBusBdcqzsdjxx.setBdcqzbh(old.getBdcqzbh());
			//regBusBdcqzsdjxx.setYsxlh(old.getYsxlh());
			regBusBdcqzsdjxx.setOldid(old.getId());
			regBusBdcqzsdjxx.setGyqk(old.getGyqk());
			regBusBdcqzsdjxx.setSyqx(old.getSyqx());
			regBusBdcqzsdjxx.setDjlx(djlx);
			regBusBdcqzsdjxx.setStatus(old.getStatus());
			regBusBdcqzsdjxx.setIsfdsj(Integer.valueOf("0"));
			regBusBdcqzsdjxx.setIshistory(old.getIshistory());
			regBusBdcqzsdjxx.setIslogout("0");
			regBusBdcqzsdjxx.setIsprint("0");
			regBusBdcqzsdjxx.setRights(old.getRights());
			regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
			RegBaseZdjbxx regBaseZdjbxxtmp = regBaseZdjbxxService.getdy(old.getZddm());
			if(regBaseZdjbxxtmp != null){
				regBaseZdjbxx.setIsdiya(regBaseZdjbxxtmp.getIsdiya());
				regBaseZdjbxx.setIschafeng(regBaseZdjbxxtmp.getIschafeng());
				regBaseZdjbxx.setIsyiyi(regBaseZdjbxxtmp.getIsyiyi());
			}
			
			RegBusYwr regBusYwr = new RegBusYwr();
			regBusYwr.setYwh(old.getYwh());
			regBusYwr.setBdcdyh(old.getBdcdyh());
			List<RegBusYwr> findSxh = regBusYwrService.findListSxh(regBusYwr);
			if(findSxh.size() > 0){
				for (int i = 0; i < findSxh.size(); i++) {
					regBusYwr = findSxh.get(i);
					regBusYwr.setYwh(ywhStr);
					regBusYwr.setBdcdyh(regBaseZdjbxx.getBdcdyh());
					regBusYwr.setId(null);
					regBusYwr.setQszt("0");
					regBusYwrService.save(regBusYwr);
				}
			}
		}
		regBaseZdjbxx.setYsdm("6001010000");
		regBaseZdjbxx.setStatus("1");
		regBaseZdjbxx.setIsaudit("2");
		regBaseZdjbxx.setHistory("1");
		regBaseZdjbxx.setIslogout("3");//先不生效,登簙时生效,同时注销之前的宗地基本信息,可以通过宗地情况变化表里的OLDID
		regBaseZdjbxx.setYtmc(regBaseZdjbxx.getYt());
		regBaseZdjbxxService.save(regBaseZdjbxx);
		
		
		//宗地情况变化表-把已经选择出来的旧宗地基本信息保存起来 
		RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
		//如果没已有对象,那就新增
		regBaseZdbhqk.setDjsj(new Date());
		regBaseZdbhqk.setYwh(ywhStr);
		regBaseZdbhqk.setId(null);
		regBaseZdbhqk.setZddm(regBaseZdjbxx.getZddm());
		regBaseZdbhqk.setZdid(regBaseZdjbxx.getId());
		regBaseZdbhqkService.save(regBaseZdbhqk);
		
		if(djlx.equals("406")){
			return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/fgbgchangeform?ywh="+ywhStr+"&djxl="+djlx+"&zddm="+regBaseZdjbxx.getZddm()+"&oldywid="+oldywid+"&optype="+optype;
		}else if(djlx.equals("418")){
			return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusTdsyq/fgbgchangeform?ywh="+ywhStr+"&djxl="+djlx+"&zddm="+regBaseZdjbxx.getZddm()+"&oldywid="+oldywid+"&optype="+optype;
		}else{
			return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusNydsyq/fghbchangeform?ywh="+ywhStr+"&djxl="+djlx+"&zddm="+regBaseZdjbxx.getZddm()+"&oldywid="+oldywid+"&optype="+optype;
		}
	}
	
	/**
	 * 土地变更、更正
	 * @param regBaseZdjbxx
	 * @param model
	 * @param redirectAttributes
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "propertySave")
	public synchronized String propertySave(RegBaseZdjbxx regBaseZdjbxx, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		if (!beanValidator(model, regBaseZdjbxx)){
			return form(regBaseZdjbxx, model, request);
		}
		String ywhStr = request.getParameter("YWH");
		String oldywid = request.getParameter("oldywid");
		String djlx = request.getParameter("DJLX");
		String oldZdIdStr = request.getParameter("OldZdId");
		String optype = request.getParameter("optype");
		String isFlagZrz = request.getParameter("isFlagZrz");
		String ZDTZM = request.getParameter("ZDTZM");
		
		//通过宗地初步代码给行政区、地籍区和地籍子区三个字段赋值
		String zddmStr = regBaseZdjbxx.getZddm();
		if(StringUtils.isNotBlank(zddmStr)){
			regBaseZdjbxx.setSeachprov(zddmStr.substring(0, 6));
			regBaseZdjbxx.setSeachcity(zddmStr.substring(0, 9));
			regBaseZdjbxx.setSeachdistrict(zddmStr.substring(0, 12));
			/*String maxZddmSxh = regBaseZdjbxxService.findMaxZddmByDistrict(regBaseZdjbxx.getZddm());//使用当前宗地代码
			if(zddmStr.length() == 12 || !ZDTZM.equals(regBaseZdjbxx.getZdtzm())){
				String ruleCode = "";
				if(!ZDTZM.equals(regBaseZdjbxx.getZdtzm())){
					ruleCode = regBaseZdjbxx.getZddm().substring(0, 12) + regBaseZdjbxx.getTdsyqdm() + regBaseZdjbxx.getZdtzm();
				}else {
					ruleCode = regBaseZdjbxx.getZddm() + regBaseZdjbxx.getTdsyqdm() + regBaseZdjbxx.getZdtzm();
				}
				String nextZddm = getNextZddm(maxZddmSxh, ruleCode);*/
				//宗地代码跟不动产单元号同时生成
				/*regBaseZdjbxx.setZddm(nextZddm);
				regBaseZdjbxx.setBdcdyh(nextZddm + "W00000000");
			}*/
		}
		
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		regBusBdcqzsdjxx.setYwh(ywhStr);
		regBusBdcqzsdjxx.setBdcdyh(regBaseZdjbxx.getBdcdyh());
		List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
		if(listRegBusBdcqzsdjxx.size() == 1){
			regBusBdcqzsdjxx = listRegBusBdcqzsdjxx.get(0);
		}
		regBusBdcqzsdjxx.setQlrmc(regBaseZdjbxx.getQlrxm());
		regBusBdcqzsdjxx.setZl(regBaseZdjbxx.getZl());
		//然后把宗地代码先填入到不动产单元号里面,作为不动产单元号生成的备用信息,直到初审通过的那一刻才真正生成不动产单元号
		regBusBdcqzsdjxx.setQllx(regBaseZdjbxx.getQllx());
		regBusBdcqzsdjxx.setQlxz(DictUtils.getDictLabel(regBaseZdjbxx.getQlxz(), "reg_bus_qlxz", ""));
		regBusBdcqzsdjxx.setYt(DictUtils.getDictLabel(regBaseZdjbxx.getYt(), "reg_bus_tdyt", ""));
		regBusBdcqzsdjxx.setMj(regBaseZdjbxx.getZdmj()+"");
		regBusBdcqzsdjxx.setTh(regBaseZdjbxx.getTfh());
		regBusBdcqzsdjxx.setZddm(regBaseZdjbxx.getZddm());
		String flagZrz = "";
		if(StringUtils.isBlank(optype)){//首次保存,新增宗地数据
			RegBusBdcqzsdjxx old = regBusBdcqzsdjxxService.get(oldywid);
			String oldywh = old.getYwh();
			regBusBdcqzsdjxx.setOldid(old.getId());
			regBusBdcqzsdjxx.setGyqk(old.getGyqk());
			regBusBdcqzsdjxx.setDjlx(djlx);
			regBusBdcqzsdjxx.setStatus(old.getStatus());
			regBusBdcqzsdjxx.setIshistory(old.getIshistory());
			regBusBdcqzsdjxx.setBdcqzh(old.getBdcqzh());
			regBusBdcqzsdjxx.setBdcqzbh(old.getBdcqzbh());
			regBusBdcqzsdjxx.setYsxlh(old.getYsxlh());
			if(isFlagZrz.equals("0")){//该宗地已有楼栋建筑物存在,本次不繕证,带入上次证号
				flagZrz = "1";//宗地有建筑物,权属带入上次证号
			}
			regBusBdcqzsdjxx.setIsfdsj(Integer.valueOf("0"));
			regBusBdcqzsdjxx.setIslogout("0");
			regBusBdcqzsdjxx.setIsprint("0");
			regBusBdcqzsdjxx.setRights(old.getRights());
			regBusBdcqzsdjxx.setId(null);
			//属性变更新的宗地基本信息生成
			regBaseZdjbxx.setId(null);
			regBaseZdjbxx.setHistory("1");
			regBaseZdjbxx.setIslogout("3");//先不生效,登簙时生效,同时注销之前的宗地基本信息,可以通过宗地情况变化表里的OLDID
			
			RegBaseZdjbxx regBaseZdjbxxtmp = regBaseZdjbxxService.get(oldZdIdStr);
			regBaseZdjbxx.setIsaudit(regBaseZdjbxxtmp.getIsaudit());
			regBaseZdjbxx.setStatus(regBaseZdjbxxtmp.getStatus());
			regBaseZdjbxx.setIsdiya(regBaseZdjbxxtmp.getIsdiya());
			regBaseZdjbxx.setIschafeng(regBaseZdjbxxtmp.getIschafeng());
			regBaseZdjbxx.setIsyiyi(regBaseZdjbxxtmp.getIsyiyi());
			
			//TODO
			//查询权籍系统,保存变更更正后的权利人
//			bdcQlrxxService.insertqlrxx(regBaseZdjbxx.getBdcdyh(), ywhStr);
			
			RegBusQlr regBusOldQlr = new RegBusQlr();
			regBusOldQlr.setYwh(oldywh);//旧业务号
			List<RegBusQlr> findList_1 = regBusQlrService.findListSxh(regBusOldQlr);
			for(int i=0; i<findList_1.size(); i++){
				regBusOldQlr = findList_1.get(i);
				regBusOldQlr.setYwh(ywhStr);
				regBusOldQlr.setId(null);
				regBusOldQlr.setQszt("0");
				regBusQlrService.save(regBusOldQlr);
			}
			
			RegBusYwr regBusYwr = new RegBusYwr();
			regBusYwr.setYwh(old.getYwh());
			regBusYwr.setBdcdyh(old.getBdcdyh());
			List<RegBusYwr> findSxh = regBusYwrService.findListSxh(regBusYwr);
			if(findSxh.size() > 0){
				for (int i = 0; i < findSxh.size(); i++) {
					regBusYwr = findSxh.get(i);
					regBusYwr.setYwh(ywhStr);
					regBusYwr.setBdcdyh(regBaseZdjbxx.getBdcdyh());
					regBusYwr.setId(null);
					regBusYwr.setQszt("0");
					regBusYwrService.save(regBusYwr);
				}
			}
		}
		regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
		regBaseZdjbxx.setYt(DictUtils.getDictLabel(regBaseZdjbxx.getYt(), "reg_bus_tdyt", ""));
		regBaseZdjbxx.setYtmc(DictUtils.getDictLabel(regBaseZdjbxx.getYt(), "reg_bus_tdyt", ""));
		regBaseZdjbxxService.save(regBaseZdjbxx);
		addMessage(redirectAttributes, "保存宗地基本信息成功");
		
		//宗地情况变化表-把已经选择出来的旧宗地基本信息保存起来 
		RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
		regBaseZdbhqk.setYwh(ywhStr);
		List<RegBaseZdbhqk> findList = regBaseZdbhqkService.findList(regBaseZdbhqk);
		if(findList.size()>0){
			//当前业务号已经有值,更新就好了	
			regBaseZdbhqk = findList.get(0);
		}else{
			//如果没已有对象,那就新增
			regBaseZdbhqk.setDjsj(new Date());
			regBaseZdbhqk.setYwh(ywhStr);
			regBaseZdbhqk.setId(null);
		}
		regBaseZdbhqk.setZddm(regBaseZdjbxx.getZddm());
		regBaseZdbhqk.setZdid(regBaseZdjbxx.getId());
		regBaseZdbhqk.setOldzdid(oldZdIdStr);
		regBaseZdbhqkService.save(regBaseZdbhqk);
		if(djlx.equals("405") || djlx.equals("602")){
			return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/bgchangeform?ywh="+ywhStr+"&WO=1&djxl="+djlx+"&YSDM=6002020100&zddm="+regBaseZdjbxx.getZddm()+"&optype="+optype+"&flagZrz="+flagZrz;
		}else {
			return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusTdsyq/bgchangeform?ywh="+ywhStr+"&WO=1&djxl="+djlx+"&YSDM=6002020100&zddm="+regBaseZdjbxx.getZddm()+"&optype="+optype+"&flagZrz="+flagZrz;
		}
	}
	
	/**
	 * 土地变更、更正
	 * @param regBaseZdjbxx
	 * @param model
	 * @param redirectAttributes
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "nydbgpropertySave")
	public synchronized String nydbgpropertySave(RegBaseZdjbxx regBaseZdjbxx, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		if (!beanValidator(model, regBaseZdjbxx)){
			return form(regBaseZdjbxx, model, request);
		}
		String ywhStr = request.getParameter("YWH");
		String oldywid = request.getParameter("oldywid");//选择已登记信息id
		String djlx = request.getParameter("DJLX");
		String oldZdIdStr = request.getParameter("OldZdId");
		String optype = request.getParameter("optype");
		String ZDTZM = request.getParameter("ZDTZM");
		
		//通过宗地初步代码给行政区、地籍区和地籍子区三个字段赋值
		String zddmStr = regBaseZdjbxx.getZddm();
		if(StringUtils.isNotBlank(zddmStr)){
			regBaseZdjbxx.setSeachprov(zddmStr.substring(0, 6));
			regBaseZdjbxx.setSeachcity(zddmStr.substring(0, 9));
			regBaseZdjbxx.setSeachdistrict(zddmStr.substring(0, 12));
			String maxZddmSxh = regBaseZdjbxxService.findMaxZddmByDistrict(regBaseZdjbxx.getZddm());//使用当前宗地代码
			if(zddmStr.length() == 12 || !ZDTZM.equals(regBaseZdjbxx.getZdtzm())){
				String ruleCode = "";
				if(!ZDTZM.equals(regBaseZdjbxx.getZdtzm())){
					ruleCode = regBaseZdjbxx.getZddm().substring(0, 12) + regBaseZdjbxx.getTdsyqdm() + regBaseZdjbxx.getZdtzm();
				}else {
					ruleCode = regBaseZdjbxx.getZddm() + regBaseZdjbxx.getTdsyqdm() + regBaseZdjbxx.getZdtzm();
				}
				String nextZddm = getNextZddm(maxZddmSxh, ruleCode);
				//宗地代码跟不动产单元号同时生成
				regBaseZdjbxx.setZddm(nextZddm);
				regBaseZdjbxx.setBdcdyh(nextZddm + "W00000000");
			}
		}
		
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		regBusBdcqzsdjxx.setYwh(ywhStr);
		regBusBdcqzsdjxx.setBdcdyh(regBaseZdjbxx.getBdcdyh());
		List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
		if(listRegBusBdcqzsdjxx.size() == 1){
			regBusBdcqzsdjxx = listRegBusBdcqzsdjxx.get(0);
		}
		regBusBdcqzsdjxx.setQlrmc(regBaseZdjbxx.getQlrxm());
		regBusBdcqzsdjxx.setZl(regBaseZdjbxx.getZl());
		//然后把宗地代码先填入到不动产单元号里面,作为不动产单元号生成的备用信息,直到初审通过的那一刻才真正生成不动产单元号
		regBusBdcqzsdjxx.setQllx(regBaseZdjbxx.getQllx());
		regBusBdcqzsdjxx.setQlxz(DictUtils.getDictLabel(regBaseZdjbxx.getQlxz(), "reg_bus_qlxz", ""));
		regBusBdcqzsdjxx.setYt(regBaseZdjbxx.getYt());
		regBusBdcqzsdjxx.setMj(regBaseZdjbxx.getZdmj()+"");
		regBusBdcqzsdjxx.setTh(regBaseZdjbxx.getTfh());
		regBusBdcqzsdjxx.setZddm(regBaseZdjbxx.getZddm());
		if(StringUtils.isBlank(optype)){//首次保存,新增宗地数据
			RegBusBdcqzsdjxx old = regBusBdcqzsdjxxService.get(oldywid);
			String oldywh = old.getYwh();
			regBusBdcqzsdjxx.setOldid(old.getId());
			regBusBdcqzsdjxx.setGyqk(old.getGyqk());
			regBusBdcqzsdjxx.setDjlx(djlx);
			regBusBdcqzsdjxx.setRights("3");
			regBusBdcqzsdjxx.setStatus(old.getStatus());
			regBusBdcqzsdjxx.setIshistory(old.getIshistory());
			regBusBdcqzsdjxx.setBdcqzh(old.getBdcqzh());
			regBusBdcqzsdjxx.setBdcqzbh(old.getBdcqzbh());
			regBusBdcqzsdjxx.setYsxlh(old.getYsxlh());
			regBusBdcqzsdjxx.setIsfdsj(Integer.valueOf("0"));
			regBusBdcqzsdjxx.setIslogout("0");
			regBusBdcqzsdjxx.setIsprint("0");
			regBusBdcqzsdjxx.setBdcqzbh(null);
			regBusBdcqzsdjxx.setBdcqzh(null);
			regBusBdcqzsdjxx.setYsxlh(null);
			regBusBdcqzsdjxx.setId(null);
			//属性变更新的宗地基本信息生成
			regBaseZdjbxx.setId(null);
			regBaseZdjbxx.setHistory("1");
			regBaseZdjbxx.setIslogout("3");//先不生效,登簙时生效,同时注销之前的宗地基本信息,可以通过宗地情况变化表里的OLDID
			
			RegBaseZdjbxx regBaseZdjbxxtmp = regBaseZdjbxxService.get(oldZdIdStr);
			regBaseZdjbxx.setIsaudit(regBaseZdjbxxtmp.getIsaudit());
			regBaseZdjbxx.setStatus(regBaseZdjbxxtmp.getStatus());
			regBaseZdjbxx.setIsdiya(regBaseZdjbxxtmp.getIsdiya());
			regBaseZdjbxx.setIschafeng(regBaseZdjbxxtmp.getIschafeng());
			regBaseZdjbxx.setIsyiyi(regBaseZdjbxxtmp.getIsyiyi());
			regBaseZdjbxx.setYtmc(regBaseZdjbxx.getYt());
			RegBusQlr regBusOldQlr = new RegBusQlr();
			regBusOldQlr.setYwh(oldywh);//旧业务号
			List<RegBusQlr> findList_1 = regBusQlrService.findListSxh(regBusOldQlr);
			for(int i=0; i<findList_1.size(); i++){
				regBusOldQlr = findList_1.get(i);
				regBusOldQlr.setYwh(ywhStr);
				regBusOldQlr.setId(null);
				regBusOldQlr.setQszt("0");
				regBusQlrService.save(regBusOldQlr);
			}
			RegBusYwr regBusYwr = new RegBusYwr();
			regBusYwr.setYwh(old.getYwh());
			regBusYwr.setBdcdyh(old.getBdcdyh());
			List<RegBusYwr> findSxh = regBusYwrService.findListSxh(regBusYwr);
			if(findSxh.size() > 0){
				for (int i = 0; i < findSxh.size(); i++) {
					regBusYwr = findSxh.get(i);
					regBusYwr.setYwh(ywhStr);
					regBusYwr.setBdcdyh(regBaseZdjbxx.getBdcdyh());
					regBusYwr.setId(null);
					regBusYwr.setQszt("0");
					regBusYwrService.save(regBusYwr);
				}
			}
			regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
			regBaseZdjbxxService.save(regBaseZdjbxx);
			addMessage(redirectAttributes, "保存宗地基本信息成功");
		}else{
			regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
			regBaseZdjbxxService.save(regBaseZdjbxx);
			addMessage(redirectAttributes, "保存宗地基本信息成功");
		}
		//宗地情况变化表-把已经选择出来的旧宗地基本信息保存起来 
		RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
		regBaseZdbhqk.setYwh(ywhStr);
		List<RegBaseZdbhqk> findList = regBaseZdbhqkService.findList(regBaseZdbhqk);
		if(findList.size()>0){
			//当前业务号已经有值,更新就好了	
			regBaseZdbhqk = findList.get(0);
		}else{
			//如果没已有对象,那就新增
			regBaseZdbhqk.setDjsj(new Date());
			regBaseZdbhqk.setYwh(ywhStr);
			regBaseZdbhqk.setId(null);
		}
		regBaseZdbhqk.setZddm(regBaseZdjbxx.getZddm());
		regBaseZdbhqk.setZdid(regBaseZdjbxx.getId());
		regBaseZdbhqk.setOldzdid(oldZdIdStr);
		regBaseZdbhqkService.save(regBaseZdbhqk);
		return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusNydsyq/nydbgdjForm?YWH="+ywhStr+"&WO=1&DJLX="+djlx+"&YSDM=6002020100&zddm="+regBaseZdjbxx.getZddm()+"&optye="+optype+"&jid="+oldywid;
	}
	
	/***
	* @Title: nextMerger 
	* @Description: 土地合并宗地基本信息添加页面
	* @param @param regBaseZdjbxx
	* @param @param request
	* @param @param response
	* @param @param model
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = {"nextmerger"})
	public String nextMerger(RegBaseZdjbxx regBaseZdjbxx,HttpServletRequest request, HttpServletResponse response, Model model) {
		//根据宗地代码查看一条宗地信息,只能是VIEWS时查看【要不然save时没有验证通过返回FORM时就会根据已选的宗地代码查出宗地信息】
		if(StringUtils.isNotBlank(regBaseZdjbxx.getZddm()) && StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			regBaseZdjbxx.setIslogout("13");
			List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxx);
			for(int i=0;i<findList.size();i++){
				regBaseZdjbxx = findList.get(0);
			}
		}
		
		String ywh = request.getParameter("YWH");
		String ids = request.getParameter("ids");
		String djlx = request.getParameter("djlx");
		String optype = request.getParameter("optype");
		String rights = request.getParameter("rights");
		String idList[] = ids.split(";");
		if(StringUtils.isNotBlank(request.getParameter("YSDM"))){
			model.addAttribute("YSDM",request.getParameter("YSDM"));
		}
		if(StringUtils.isNotBlank(ywh)){
			model.addAttribute("YWH",ywh);
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		RegBusBdcqzsdjxx entity = new RegBusBdcqzsdjxx();
		if(StringUtils.isNotBlank(optype)){
			RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
			if(rights != null){
				if(rights.equals("suoy")){
					RegBusTdsyq regBustdsyq = new RegBusTdsyq();
					regBustdsyq = regBusTdsyqService.get(ids);
					regBaseZdbhqk.setZddm(regBustdsyq.getZddm());
					regBusBdcqzsdjxx.setBdcdyh(regBustdsyq.getBdcdyh());
				}else if(rights.equals("shiy")){
					RegBusJsydsyq regBusJsydsyq = new RegBusJsydsyq();
					regBusJsydsyq = regBusJsydsyqService.get(ids);
					regBaseZdbhqk.setZddm(regBusJsydsyq.getZddm());
					regBusBdcqzsdjxx.setBdcdyh(regBusJsydsyq.getBdcdyh());
				}else if(rights.equals("cbjy")){
					RegBusNydsyq regBusNydsyq = new RegBusNydsyq();
					regBusNydsyq = regBusNydsyqService.get(ids);
					regBaseZdbhqk.setZddm(regBusNydsyq.getZddm());
					regBusBdcqzsdjxx.setBdcdyh(regBusNydsyq.getBdcdyh());
				}
			}
			regBaseZdbhqk.setYwh(ywh);
			List<RegBaseZdbhqk> listRegBaseZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqk);
			if(listRegBaseZdbhqk.size() == 1){
				regBaseZdbhqk = listRegBaseZdbhqk.get(0);
				regBaseZdjbxx = regBaseZdjbxxService.get(regBaseZdbhqk.getZdid());
			}
			regBusBdcqzsdjxx.setYwh(ywh);
			List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
			if(listRegBusBdcqzsdjxx.size() == 1){
				regBusBdcqzsdjxx = listRegBusBdcqzsdjxx.get(0);
				ids = regBusBdcqzsdjxx.getOldid();
			}
			model.addAttribute("optype", optype);
		}else {
			regBusBdcqzsdjxx.setYwh(ywh);
			List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
			if(listRegBusBdcqzsdjxx.size() == 1){
				regBusBdcqzsdjxx = listRegBusBdcqzsdjxx.get(0);
				RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
				regBaseZdbhqk.setYwh(ywh);
				List<RegBaseZdbhqk> listregBaseZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqk);
				for(int i=0;i<listregBaseZdbhqk.size();i++){
					RegBaseZdbhqk regBaseZdbhqkT = listregBaseZdbhqk.get(i);
					RegBaseZdjbxx regBaseZdjbxxtmp = new RegBaseZdjbxx();
					regBaseZdjbxxtmp = regBaseZdjbxxService.get(regBaseZdbhqkT.getZdid());
					regBaseZdjbxxService.delete(regBaseZdjbxxtmp);
				}
				regBaseZdbhqkService.deletezdbhqk(regBaseZdbhqk);
				regBusQlrService.deleteywh(ywh);
				regBusJsydsyqService.deleteRegBusJsydsyq(ywh);
				regBusBdcqzsdjxxService.deletezyyg(regBusBdcqzsdjxx);
				regBusNydsyqService.deletenydzyywh(ywh);
			}
			entity = regBusBdcqzsdjxxService.get(idList[0]);
			RegBaseZdjbxx regBaseZdjbxxTemp = new RegBaseZdjbxx();
			regBaseZdjbxxTemp.setZddm(entity.getZddm());
			regBaseZdjbxxTemp.setIslogout("0");//获取当前宗地基本信息中此宗地代码唯一一条有效数据
			List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxxTemp);
			if(listJbxx != null && listJbxx.size()>0){
				regBaseZdjbxxTemp = listJbxx.get(0);
				regBaseZdjbxx.setZdtzm(regBaseZdjbxxTemp.getZdtzm());
				regBaseZdjbxx.setBdcdyh(regBaseZdjbxxTemp.getBdcdyh());
				regBaseZdjbxx.setTdsyqdm(regBaseZdjbxxTemp.getTdsyqdm());
				regBaseZdjbxx.setYt(regBaseZdjbxxTemp.getYt());
				regBaseZdjbxx.setDj(regBaseZdjbxxTemp.getDj());
				regBaseZdjbxx.setQllx(regBaseZdjbxxTemp.getQllx());
				regBaseZdjbxx.setQlxz(regBaseZdjbxxTemp.getQlxz());
				regBaseZdjbxx.setQlsdfs(regBaseZdjbxxTemp.getQlsdfs());
				regBaseZdjbxx.setRjl(regBaseZdjbxxTemp.getRjl());
				regBaseZdjbxx.setJzmd(regBaseZdjbxxTemp.getJzmd());
				regBaseZdjbxx.setJzxg(regBaseZdjbxxTemp.getJzxg());
				regBaseZdjbxx.setDjh(regBaseZdjbxxTemp.getDjh());
				regBaseZdjbxx.setDah(regBaseZdjbxxTemp.getDah());
				regBaseZdjbxx.setBz(regBaseZdjbxxTemp.getBz());
			}
		}
		RegBusQlr regBusQlr = new RegBusQlr();
		if(StringUtils.isNotBlank(optype)){
			regBusQlr.setYwh(ywh);
		}else {
			regBusQlr.setYwh(entity.getYwh());
		}
		List<RegBusQlr> listRegBusQlr = regBusQlrService.findListSxh(regBusQlr);
		if(listRegBusQlr.size() > 0){
			regBusQlr = listRegBusQlr.get(0);
			regBaseZdjbxx.setQlrxm(regBusQlr.getQlrmc());
			regBaseZdjbxx.setZjlx(regBusQlr.getZjzl());
			regBaseZdjbxx.setSfzh(regBusQlr.getZjh());
		}
		
		if(StringUtils.isNotBlank(djlx)){
			model.addAttribute("DJLX", djlx);
		}
		if(StringUtils.isNotBlank(ids)){
			model.addAttribute("ids", ids);
		}
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		
		return "modules/reg/base/regBaseZdjbxxMergerForm";
	}
	
	/***
	* @Title: mergerSave 
	* @Description: 土地合并宗地基本信息保存
	* @param @param regBaseZdjbxx
	* @param @param model
	* @param @param redirectAttributes
	* @param @param request
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "mergerSave")
	public synchronized String mergerSave(RegBaseZdjbxx regBaseZdjbxx, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		if (!beanValidator(model, regBaseZdjbxx)){
			return form(regBaseZdjbxx, model, request);
		}
		String ywhStr = request.getParameter("YWH");
		String djlx = request.getParameter("DJLX");
		String ids = request.getParameter("ids");
		String isList[] = ids.split(";");
		String optype = request.getParameter("optype");
		
		//通过宗地初步代码给行政区、地籍区和地籍子区三个字段赋值
		String zddmStr = regBaseZdjbxx.getZddm();
		if(StringUtils.isNotBlank(zddmStr)){
			regBaseZdjbxx.setSeachprov(zddmStr.substring(0, 6));
			regBaseZdjbxx.setSeachcity(zddmStr.substring(0, 9));
			regBaseZdjbxx.setSeachdistrict(zddmStr.substring(0, 12));
			String maxZddmSxh = regBaseZdjbxxService.findMaxZddmByDistrict(regBaseZdjbxx.getZddm());//使用当前宗地代码
			if(zddmStr.length() == 12){
				String ruleCode = regBaseZdjbxx.getZddm() + regBaseZdjbxx.getTdsyqdm() + regBaseZdjbxx.getZdtzm();
				String nextZddm = getNextZddm(maxZddmSxh, ruleCode);
				//宗地代码跟不动产单元号同时生成
				regBaseZdjbxx.setZddm(nextZddm);
				regBaseZdjbxx.setBdcdyh(nextZddm + "W00000000");
			}
		}
		
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		regBusBdcqzsdjxx.setYwh(ywhStr);
		regBusBdcqzsdjxx.setBdcdyh(regBaseZdjbxx.getBdcdyh());
		List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
		if(listRegBusBdcqzsdjxx.size() == 1){
			regBusBdcqzsdjxx = listRegBusBdcqzsdjxx.get(0);
		}
		regBusBdcqzsdjxx.setQlrmc(regBaseZdjbxx.getQlrxm());
		regBusBdcqzsdjxx.setZl(regBaseZdjbxx.getZl());
		//然后把宗地代码先填入到不动产单元号里面,作为不动产单元号生成的备用信息,直到初审通过的那一刻才真正生成不动产单元号
		regBusBdcqzsdjxx.setQllx(regBaseZdjbxx.getQllx());
		regBusBdcqzsdjxx.setQlxz(DictUtils.getDictLabel(regBaseZdjbxx.getQlxz(), "reg_bus_qlxz", ""));
		regBusBdcqzsdjxx.setYt(regBaseZdjbxx.getYt());
		regBusBdcqzsdjxx.setMj(regBaseZdjbxx.getZdmj()+"");
		regBusBdcqzsdjxx.setTh(regBaseZdjbxx.getTfh());
		regBusBdcqzsdjxx.setZddm(regBaseZdjbxx.getZddm());
		String oldywh = "";
		if(StringUtils.isBlank(optype)){//首次保存,新增宗地数据
			RegBusBdcqzsdjxx old = regBusBdcqzsdjxxService.get(isList[0]);
			oldywh = old.getYwh();
			regBusBdcqzsdjxx.setOldid(ids);
			regBusBdcqzsdjxx.setGyqk(old.getGyqk());
			regBusBdcqzsdjxx.setDjlx(djlx);
			regBusBdcqzsdjxx.setSyqx(old.getSyqx());
			regBusBdcqzsdjxx.setStatus(old.getStatus());
			regBusBdcqzsdjxx.setIsfdsj(Integer.valueOf("0"));
			regBusBdcqzsdjxx.setIshistory(old.getIshistory());
			regBusBdcqzsdjxx.setIslogout("0");
			regBusBdcqzsdjxx.setIsprint("0");
			regBusBdcqzsdjxx.setRights(old.getRights());
			
			//属性变更新的宗地基本信息生成
			regBaseZdjbxx.setStatus("1");
			regBaseZdjbxx.setIsaudit("2");
			regBaseZdjbxx.setHistory("1");
			regBaseZdjbxx.setIslogout("3");//先不生效,登簙时生效,同时注销之前的宗地基本信息,可以通过宗地情况变化表里的OLDID
			regBaseZdjbxx.setYtmc(regBaseZdjbxx.getYt());
			RegBaseZdjbxx regBaseZdjbxxtmp = regBaseZdjbxxService.getdy(old.getZddm());
			if(regBaseZdjbxxtmp != null){
				regBaseZdjbxx.setIsdiya(regBaseZdjbxxtmp.getIsdiya());
				regBaseZdjbxx.setIschafeng(regBaseZdjbxxtmp.getIschafeng());
				regBaseZdjbxx.setIsyiyi(regBaseZdjbxxtmp.getIsyiyi());
			}
			RegBusQlr regBusOldQlr = new RegBusQlr();
			regBusOldQlr.setYwh(oldywh);//旧业务号
			List<RegBusQlr> findList_1 = regBusQlrService.findListSxh(regBusOldQlr);
			for(int i=0; i<findList_1.size(); i++){
				regBusOldQlr = findList_1.get(i);
				regBusOldQlr.setYwh(ywhStr);
				regBusOldQlr.setId(null);
				regBusOldQlr.setQszt("0");
				regBusQlrService.save(regBusOldQlr);
			}
			RegBusYwr regBusYwr = new RegBusYwr();
			regBusYwr.setYwh(old.getYwh());
			regBusYwr.setBdcdyh(old.getBdcdyh());
			List<RegBusYwr> findSxh = regBusYwrService.findListSxh(regBusYwr);
			if(findSxh.size() > 0){
				for (int i = 0; i < findSxh.size(); i++) {
					regBusYwr = findSxh.get(i);
					regBusYwr.setYwh(ywhStr);
					regBusYwr.setBdcdyh(regBaseZdjbxx.getBdcdyh());
					regBusYwr.setId(null);
					regBusYwr.setQszt("0");
					regBusYwrService.save(regBusYwr);
				}
			}
		}
		regBaseZdjbxxService.save(regBaseZdjbxx);
		regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
		
		//宗地情况变化表-把已经选择出来的旧宗地基本信息保存起来 
		RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
		regBaseZdbhqk.setYwh(ywhStr);
		List<RegBaseZdbhqk> findList = regBaseZdbhqkService.findList(regBaseZdbhqk);
		if(findList.size()>0){
			//当前业务号已经有值,更新就好了	
			regBaseZdbhqk = findList.get(0);
		}else{
			//如果没已有对象,那就新增
			regBaseZdbhqk.setDjsj(new Date());
			regBaseZdbhqk.setYwh(ywhStr);
			regBaseZdbhqk.setId(null);
		}
		regBaseZdbhqk.setZddm(regBaseZdjbxx.getZddm());
		regBaseZdbhqk.setZdid(regBaseZdjbxx.getId());
		regBaseZdbhqkService.save(regBaseZdbhqk);
		
		if(djlx.equals("407")){
			return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusJsydsyq/hbbgchangeform?ywh="+ywhStr+"&djxl="+djlx+"&zddm="+regBaseZdjbxx.getZddm()+"&ids="+ids+"&optype="+optype;
		}else if(djlx.equals("419")){
			return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusTdsyq/hbbgchangeform?ywh="+ywhStr+"&djxl="+djlx+"&zddm="+regBaseZdjbxx.getZddm()+"&ids="+ids+"&optype="+optype;
		}else {
			return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusNydsyq/fghbchangeform?ywh="+ywhStr+"&djxl="+djlx+"&zddm="+regBaseZdjbxx.getZddm()+"&oldywid="+ids+"&optype="+optype;
		}
	}
	
	
	/**
	* @Title: save 
	* @Description: 负责宗地信息与业务号的关联信息插入
	* @param @param regBaseZdjbxx
	* @param @param model
	* @param @param redirectAttributes
	* @param @param request
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "relationYwh")
	public String relationYwh(Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		String ywhStr = request.getParameter("ywh");
		String zdjbxxidStr = request.getParameter("id");
		RegBusZdjbxxRelationYwh entity = new RegBusZdjbxxRelationYwh();
		//插入宗地信息与业务号的关联记录
		if(StringUtils.isNotBlank(zdjbxxidStr) && StringUtils.isNotBlank(ywhStr)){
			//首先判断当前业务号有没有已经关联的宗地信息
			entity.setYwh(ywhStr);
			List<RegBusZdjbxxRelationYwh> findListZdYwh = regBusZdjbxxrelationywhDao.findList(entity);
			if(findListZdYwh.size()>0){ 
				//已经有了关联,需要更新当前记录
				entity = findListZdYwh.get(0);
				entity.setZdjbxxid(zdjbxxidStr);//关键步骤;对新选择的宗地信息进行更新记录;
				entity.preUpdate();
				regBusZdjbxxrelationywhDao.update(entity);
			}else{
				entity.setZdjbxxid(zdjbxxidStr);
				entity.preInsert();//加入ID及其他公共字段的值
				regBusZdjbxxrelationywhDao.insert(entity);
			}
		}
		//登记簿选择时
		if(StringUtils.isNotBlank(request.getParameter("tdbook"))){
			model.addAttribute("tdbook", "1");
		}
		//通过宗地信息ID号获取这条宗地信息
		RegBaseZdjbxx regBaseZdjbxx = new RegBaseZdjbxx();
		regBaseZdjbxx = this.get(zdjbxxidStr);
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		return "modules/reg/base/regBaseZdjbxxChoiceView";
	}
	
	/**
	* @Title: getRelationYwh 
	* @Description: 获取宗地信息与业务号的关联信息 
	* @param @param model
	* @param @param redirectAttributes
	* @param @param request
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "getRelationYwh")
	public String getRelationYwh(Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		String ywhStr = request.getParameter("ywh");
		String zdjbxxidStr = "";
		RegBusZdjbxxRelationYwh entity = new RegBusZdjbxxRelationYwh();
		//插入宗地信息与业务号的关联记录
		if(StringUtils.isNotBlank(ywhStr)){
			entity.setYwh(ywhStr);
			List<RegBusZdjbxxRelationYwh> entityList = regBusZdjbxxrelationywhDao.findList(entity);
			//注意这里直接获取一个会有问题,因为选择宗地信息的时候可能会多次选择,每次选择都会产生一条关联记录;
			//解决方法:加一个正在使用字段 isuse;当每次选择的时候先通过宗地ID判断下,如果已经有了一条关联关系,就先delete掉;或者每次选择后直接就先delete;
			zdjbxxidStr = entityList.get(0).getZdjbxxid();
		}
		//通过宗地信息ID号获取这条宗地信息
		RegBaseZdjbxx regBaseZdjbxx = new RegBaseZdjbxx();
		regBaseZdjbxx = this.get(zdjbxxidStr);
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		return "modules/reg/base/regBaseZdjbxxChoiceView";
	}

	/**
	* @Title: getCurrentBdcqzbhStrNum 
	* @Description: 获取不动产权证编号
	* @param @param currentNum
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	private String getCurrentBdcqzbhStrNum(int currentNum) {
		String retStr = "";
		if(currentNum < 10){
	    	retStr = "6100000000"+ currentNum;
		}else if(currentNum < 100){
			retStr = "610000000"+ currentNum;
		}else if(currentNum < 1000){ 
	    	retStr = "61000000"+ currentNum;
		}else if(currentNum < 10000){
	    	retStr = "6100000"+ currentNum;
		}else if(currentNum < 100000){
	    	retStr = "610000"+ currentNum;
		}else if(currentNum < 1000000){ 
	    	retStr = "61000"+ currentNum;
		}else if(currentNum < 10000000){ 
	    	retStr = "6100"+ currentNum;
		}else{ 
	    	retStr = "610"+ currentNum;
		}
		return retStr;
	}

	/**
	* @Title: getCurrentBdcqzhStrNum 
	* @Description: 获取不动产权证号
	* @param @param currentNum
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	private String getCurrentBdcqzhStrNum(int currentNum) {
		String retStr = "";
		String yearStr = DateUtils.getYear();
		if(currentNum < 10){
	    	retStr = yearStr + "-000000"+ currentNum;
		}else if(currentNum < 100){
			retStr = yearStr + "-00000"+ currentNum;
		}else if(currentNum < 1000){ 
			retStr = yearStr + "-0000"+ currentNum;
		}else if(currentNum < 10000){
			retStr = yearStr + "-000"+ currentNum;
		}else if(currentNum < 100000){
			retStr = yearStr + "-00"+ currentNum;
		}else if(currentNum < 1000000){ 
			retStr = yearStr + "-0"+ currentNum;
		}else{
			retStr = yearStr + "-"+ currentNum;
		}
		return retStr;
	}

	/**
	* @Title: getNextZddm 
	* @Description: 获取下一个宗地代码
	* @param @param maxZddm
	* @param @param ruleCode
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	public synchronized String getNextZddm(String maxZddm, String ruleCode) {
		System.out.println(ruleCode);
		String nextZddm = ruleCode + "00001";
		//如果数据里的最大宗地代码不为空,就取出来进行处理;否则直接默认值
		if(StringUtils.isNotBlank(maxZddm)){
			int nextSerNum = Integer.parseInt(maxZddm) + 1;
			if (nextSerNum < 10) {
				nextZddm = ruleCode + "0000" + nextSerNum;
			}else if (nextSerNum < 100) {
				nextZddm = ruleCode + "000" + nextSerNum;
			}else if (nextSerNum < 1000) {
				nextZddm = ruleCode + "00" + nextSerNum;
			}else if (nextSerNum < 10000) {
				nextZddm = ruleCode + "0" + nextSerNum;
			}else {
				nextZddm = ruleCode + nextSerNum;
			}
		}
		return nextZddm;
	}
	
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "audit")
	@Transactional
	public String audit(RegBaseZdjbxx regBaseZdjbxx, RedirectAttributes redirectAttributes) {
		regBaseZdjbxx = regBaseZdjbxxService.get(regBaseZdjbxx.getId());
		//RegBaseChxx regBaseChxx = regBaseChxxService.get(regBaseZdjbxx.getChid());
		//设置宗地信息数据审核
		regBaseZdjbxx.setIsaudit("1");
		regBaseZdjbxxService.save(regBaseZdjbxx);
		/*  在宗地基本信息生成时,测绘算是已经被引用了,所以就不能再动了	
		//设置测绘数据审核
		regBaseChxx.setIsaudit("1");
		regBaseChxxService.save(regBaseChxx);
		*/
		addMessage(redirectAttributes, "宗地基本信息审核成功!");
		return "redirect:"+Global.getAdminPath()+"/reg/base/regBaseZdjbxx/?repage";
	}
	
	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "unaudit")
	@Transactional
	public String unaudit(RegBaseZdjbxx regBaseZdjbxx, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		String qjcx = request.getParameter("qjcx");
		regBaseZdjbxx = regBaseZdjbxxService.get(regBaseZdjbxx.getId());
		//RegBaseChxx regBaseChxx = regBaseChxxService.get(regBaseZdjbxx.getChid());
		//设置宗地信息数据反审核
		regBaseZdjbxx.setIsaudit("0");
		regBaseZdjbxxService.save(regBaseZdjbxx);
		/*  在宗地基本信息生成时,测绘算是已经被引用了,所以就不能再动了
		//设置测绘数据已经被审核
		regBaseChxx.setIsaudit("1");
		regBaseChxxService.save(regBaseChxx);
		*/
		addMessage(redirectAttributes, "宗地基本信息反审核成功!");
		if(StringUtils.isNotBlank(qjcx)){
			return "redirect:"+Global.getAdminPath()+"/reg/base/regBaseZdjbxx/alllist?bdcdyh="+regBaseZdjbxx.getBdcdyh();
		}else{
			return "redirect:"+Global.getAdminPath()+"/reg/base/regBaseZdjbxx/?repage";
		}
	}

	@RequiresPermissions("reg:base:regBaseZdjbxx:edit")
	@RequestMapping(value = "delete")
	public String delete(RegBaseZdjbxx regBaseZdjbxx, RedirectAttributes redirectAttributes, HttpServletRequest request) {
		String qjcx = request.getParameter("qjcx");
		String flag = request.getParameter("flag");
		String djlx = request.getParameter("djlx");
		String syq = request.getParameter("syq");
		String isNyd = request.getParameter("isNyd");
		regBaseZdjbxxService.delete(regBaseZdjbxx);
		addMessage(redirectAttributes, "删除宗地基本信息成功");
		if(StringUtils.isNotBlank(qjcx)){
			return "redirect:"+Global.getAdminPath()+"/reg/base/regBaseZdjbxx/alllist?isaudit=0";
		}else{
			return "redirect:"+Global.getAdminPath()+"/reg/base/regBaseZdjbxx/list?flag="+flag+"&djlx="+djlx+"&syq="+syq+"&isNyd="+isNyd;
		}
	}
	
	/**
	 * 土地查封宗地全部信息查询
	 * @param regBaseZdjbxx
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "selecttdcf")
	public String selecttdcf(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		regBaseZdjbxx.setIslogout("901");
		regBaseZdjbxx.setDelFlag("0");
		Page<RegBaseZdjbxx>   page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx);
		model.addAttribute("page", page);
		if(StringUtils.isNotBlank(request.getParameter("YWH"))){
			model.addAttribute("YWH", request.getParameter("YWH"));
		}
		return "modules/reg/bus/dialog/regBaseZdjbxxcfList";
	}

	/**
	 * 宗地信息查询
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "getInfo")
	@ResponseBody
	public ModelMap getInfo(HttpServletRequest request) {
		ModelMap modelMap = new ModelMap();
		String id = request.getParameter("id");
		RegBaseZdjbxx entity = null;
		if (StringUtils.isNotBlank(id)){
			entity = regBaseZdjbxxService.get(id);
			entity.setZdtzm(DictUtils.getDictLabel(entity.getZdtzm(),"reg_bus_zdtzm", ""));
			//共有宗地时,把没有做过任何房屋业务的土地放出来,或是有业务的给与提示“该宗地上的房屋已经办理也登记业务,不允许查封”
			RegBaseZrz zrz = new RegBaseZrz();
			zrz.setZddm(entity.getZddm());
			List<RegBaseZrz> zrzlist = regBaseZrzService.findList(zrz);
			//共有
			if(zrzlist.size() > 0){
				if("1".equals(zrzlist.get(0).getZdftfs())){
					RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
					djxx.setZddm(entity.getZddm());
					djxx.setIslogout("0");
					djxx.setDbsj("NOTNULL");
					djxx.setDjlx("901");
					List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx);
					if(djxxlist.size() > 0){
						 modelMap.put("bj", 1);
						 modelMap.put("msg", "此共有宗地上存在房屋已登记业务不能进行土地查封,请从房屋查封进行办理!");
					}
				}
			}
		}
		
        modelMap.put("data", entity);
        return modelMap;
	}	
	
	/**
	 * 国有农用地转移登记宗地基本信息from
	 * @param regBaseZdjbxx
	 * @param model
	 * @param request
	 * @return
	 */
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "nydzyform")
	public String nydzyform(RegBaseZdjbxx regBaseZdjbxx, Model model, HttpServletRequest request) {
		Dict dict = new Dict();
		String jid = "";
		String xg = request.getParameter("xg");
		if(StringUtils.isNotBlank(xg)){
			String ids = request.getParameter("jid");
			RegBusNydsyq nyd = regBusNydsyqService.get(ids);
			model.addAttribute("ids", ids);
			RegBusBdcqzsdjxx djxxnew = new RegBusBdcqzsdjxx();
			djxxnew.setYwh(nyd.getYwh());
			djxxnew.setBdcdyh(nyd.getBdcdyh());
			djxxnew.setIslogout("0");
			List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxxnew);
			if(djxxlist.size() > 0){
				djxxnew = djxxlist.get(0);
				jid = djxxnew.getOldid();
				model.addAttribute("DJLX",djxxnew.getDjlx());
				model.addAttribute("YWH",nyd.getYwh());
				model.addAttribute("xg", xg);
				model.addAttribute("zddm", djxxnew.getZddm());
				model.addAttribute("jid",nyd.getId());
			}
		}else{
			jid = request.getParameter("jid");
			model.addAttribute("jid",jid);
		}
		RegBusBdcqzsdjxx djxx =  regBusBdcqzsdjxxService.get(jid);
		if(StringUtils.isBlank(xg)){
			String DJLX = request.getParameter("DJLX");
			String YWH = request.getParameter("YWH");
			model.addAttribute("xg", xg);
			model.addAttribute("YWH", YWH);
			model.addAttribute("zddm", djxx.getZddm());
			model.addAttribute("DJLX",DJLX);
		}
		RegBaseZdjbxx zdjbxx = new RegBaseZdjbxx();
		zdjbxx.setZddm(djxx.getZddm());
		if(StringUtils.isNotBlank(xg)){
			zdjbxx.setIslogout("3");
		}else{
			zdjbxx.setIslogout("0");
		}
		List<RegBaseZdjbxx> zdjbxxlist = regBaseZdjbxxService.findList(zdjbxx);
		if(zdjbxxlist.size() > 0){
			regBaseZdjbxx = zdjbxxlist.get(0);
		}
		regBaseZdjbxx.setZddm(djxx.getZddm());
		model.addAttribute("regBaseZdjbxx", regBaseZdjbxx);
		dict.setValue("3");
		dict.setType("reg_bus_tdyt");
		List<String> ytList = dictService.findTdytList(dict);
		model.addAttribute("ytList", ytList);
		ytList.add(regBaseZdjbxx.getYt());
		return "modules/reg/base/regBaseZdjbxxnydzyForm";
	}
	
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "tdlslist")
	public String tdlslist(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		if(StringUtils.isNotBlank(request.getParameter("flag"))){
			model.addAttribute("flag", request.getParameter("flag"));
			if(request.getParameter("flag").equals("2")){//首次登记选择测绘信息
				regBaseZdjbxx.setIsaudit("1");//不显示已引用和未审核的数据
			}
		}
		regBaseZdjbxx.setIslogout("3");
		Page<RegBaseZdjbxx> page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx); 
		model.addAttribute("page", page);
		return "modules/reg/base/regBaseZdjbxxtdlsList";
	}
	
	@RequiresPermissions("reg:base:regBaseZdjbxx:view")
	@RequestMapping(value = "tdlist")
	public String tdlist(RegBaseZdjbxx regBaseZdjbxx, HttpServletRequest request, HttpServletResponse response, Model model) {
		if(StringUtils.isNotBlank(request.getParameter("flag"))){
			model.addAttribute("flag", request.getParameter("flag"));
			if(request.getParameter("flag").equals("2")){//首次登记选择测绘信息
				regBaseZdjbxx.setIsaudit("1");//不显示已引用和未审核的数据
			}
		}
        //-------------------------------
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("djlx", request.getParameter("djlx"));
			if(request.getParameter("djlx").equals("202")){
				regBaseZdjbxx.setQllx("1");
			}else if(request.getParameter("djlx").equals("201")){
				regBaseZdjbxx.setQllx("3");
			}else if(request.getParameter("djlx").equals("203")){
				regBaseZdjbxx.setQllx("7");
			}else if(request.getParameter("djlx").equals("204")){
				regBaseZdjbxx.setQllx("5");
			}else if(request.getParameter("djlx").equals("208")){
				regBaseZdjbxx.setQllx("9");
			}else if(request.getParameter("djlx").equals("218")){
				regBaseZdjbxx.setQllx("23");
			}
		}
		model.addAttribute("XQCODE", Global.getAreaCode());
		if(StringUtils.isNotBlank(request.getParameter("CHXXXZ"))){
			model.addAttribute("CHXXXZ", "1");
		}
		if(StringUtils.isNotBlank(request.getParameter("syq"))){
			model.addAttribute("syq", request.getParameter("syq"));
		}
		regBaseZdjbxx.setIslogout("3");
		Page<RegBaseZdjbxx> page = regBaseZdjbxxService.findPage(new Page<RegBaseZdjbxx>(request, response), regBaseZdjbxx); 
		model.addAttribute("page", page);
		return "modules/reg/base/regBaseZdjbxxtdList";
	}
}