ebf746dfc43dbe2480c90282f3edca289dfaaa5e.svn-base
90.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
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
package com.thinkgem.jeesite.modules.reg.web.httprest.httpRestService;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.activiti.engine.HistoryService;
import org.activiti.engine.impl.variable.DateType;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.JsonParser.Feature;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.druid.support.json.JSONUtils;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.exception.BussException;
import com.thinkgem.jeesite.common.service.ServiceException;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.IdGen;
import com.thinkgem.jeesite.common.utils.JsonUtil;
import com.thinkgem.jeesite.modules.act.entity.Act;
import com.thinkgem.jeesite.modules.act.service.ActProcessService;
import com.thinkgem.jeesite.modules.act.web.ActTaskController;
import com.thinkgem.jeesite.modules.reg.dao.bus.RegBusBdcqzsdjxxDao;
import com.thinkgem.jeesite.modules.reg.dao.bus.RegBusFdcq2Dao;
import com.thinkgem.jeesite.modules.reg.dao.bus.RegBusSlsqDao;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseH;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBasePerson;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdjbxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusFdcq2;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusJsydsyq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusCfdj;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusDyaq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusQlr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusRights;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSjchild;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSjmain;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSlsq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusYgdj;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusYwr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusYydj;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseHService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBasePersonService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdjbxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusCfdjService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusDyaqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusFdcq2Service;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusJsydsyqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusQlrService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusRightsService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusSjmainService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusSlsqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusYgdjService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusYwrService;
import com.thinkgem.jeesite.modules.reg.utils.RegUtils;
import com.thinkgem.jeesite.modules.reg.web.httprest.utils.DatatypeUtil;
import com.thinkgem.jeesite.modules.reg.web.httprest.utils.FTPUtil;
import com.thinkgem.jeesite.modules.reg.web.httprest.utils.SysUtil;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.entity.config.SysUserConfig;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import com.thinkgem.jeesite.modules.ycsl.entity.ywzt.YcslYwzt;
import com.thinkgem.jeesite.modules.ycsl.service.ywzt.YcslYwztService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusYydjService;
@Service
public class HttpRestToService {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private RegBusQlrService regBusQlrService;
@Autowired
private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
@Autowired
private RegBusRightsService regBusRightsService;
@Autowired
private RegBaseHService regBaseHService;
@Autowired
private RegBusFdcq2Service regBusFdcq2Service;
@Autowired
private RegBusYydjService regBusYydjService;
@Autowired
private RegBusCfdjService regBusCfdjService;
@Autowired
private RegBusDyaqService regBusDyaqService;
@Autowired
private RegBusSlsqService regBusSlsqService;
@Autowired
private RegBusYwrService regBusYwrService;
@Autowired
private RegBusSlsqDao regBusSlsqDao;
@Autowired
private RegBusFdcq2Dao regBusFdcq2Dao;
@Autowired
private RegBasePersonService regBasePersonService;
@Autowired
private RegBaseZdjbxxService regBaseZdjbxxService;
@Autowired
private RegBusSjmainService regBusSjmainService;
@Autowired
private RegBusJsydsyqService regBusJsydsyqService;
@Autowired
private ActProcessService actProcessService;
@Autowired
private HistoryService historyService;
@Autowired
private YcslYwztService ycslYwztService;
@Autowired
private RegBusYgdjService regBusYgdjService;
/**
* 通过权利人查询返回房屋信息 请求方法:jtcyfwxx 2018-11-11
*/
public Map returnfwinfo(String qlrmc, String zjh, String zjzl) {
Map<String, Object> map = new HashMap<String, Object>();
String fwzlstr = "";
String cqzhstr = "";
String fwztstr = "";
// 查出此权利人对应的业务号
RegBusQlr qlrinfo = new RegBusQlr();
qlrinfo.setQlrmc(qlrmc.trim());
qlrinfo.setZjh(zjh.trim());
qlrinfo.setZjzl(zjzl.trim());
qlrinfo.setQszt("1");
List<String> ywhStrList = regBusQlrService.findryywh(qlrinfo);
if (ywhStrList.size() > 0) {
for (int i = 0; i < ywhStrList.size(); i++) {
String ywh = ywhStrList.get(i);
// 如果有人员信息,查出此人相关的房屋信息
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setYwh(ywh);
djxx.setIslogout("0");
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx);
if (djxxlist.size() > 0) {
djxx = djxxlist.get(0);
// 查询房屋状态
RegBaseH regbaseh = regBaseHService.getIslogout(djxx.getBdcdyh());
if (!"0".equals(regbaseh.getIschafeng())) {
fwztstr = fwztstr + "已查封;";
}
if (!"0".equals(regbaseh.getIsyiyi())) {
fwztstr = fwztstr + "已异议;";
}
if (!"0".equals(regbaseh.getIsdiya())) {
fwztstr = fwztstr + "已抵押";
}
if ("0".equals(regbaseh.getIsdiya()) && "0".equals(regbaseh.getIsyiyi())
&& "0".equals(regbaseh.getIschafeng())) {
fwztstr = "正常";
}
if (StringUtils.isNotBlank(fwzlstr)) {
fwzlstr = fwzlstr + ";";
}
if (StringUtils.isNotBlank(cqzhstr)) {
cqzhstr = cqzhstr + ";";
}
fwzlstr = fwzlstr + djxx.getZl();
cqzhstr = cqzhstr + djxx.getBdcqzh();
}
}
map.put("zl", fwzlstr);
map.put("cqzh", cqzhstr);
map.put("fwzt", fwztstr);
} else {
map = null;
}
return map;
}
/**
* 根据不不动产单元号返回不动产证号
*
* @param rights
* @return
* @throws JsonParseException
* @throws JsonMappingException
* @throws IOException
*/
public String bdcdjxxcqzh(RegBusRights rights) throws JsonParseException, JsonMappingException, IOException {
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setBdcdyh(rights.getBdcdyh());
if (StringUtils.isNotBlank(rights.getSsouyq())) {
djxx.setYwh(rights.getSsouyq());
}
if (StringUtils.isNotBlank(rights.getXsouyq())) {
djxx.setYwh(rights.getXsouyq());
}
List<RegBusBdcqzsdjxx> djxxlst = regBusBdcqzsdjxxService.findList(djxx);
if (djxxlst.size() <= 0) {
throw new ServiceException("该不动产单元登记信息不动产证号为空");
}
String cqzh = djxxlst.get(0).getBdcqzh().toString();
return cqzh;
}
/**
* 业务办理前信息验证
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public Map yzbdcxx(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
Map resmap = Maps.newHashMap();
ObjectMapper mapper = new ObjectMapper();
Map json = mapper.readValue(jsonstr, Map.class);
Map<String, String> data = json.get("data") == null ? Maps.newHashMap() : (Map) json.get("data");
if (data == null || data.size() <= 0) {
throw new ServiceException("节点data不能为空");
}
String bdcdyh = data.get("bdcdyh").toString();
String bdccqzh = data.get("cqzh").toString();
// 定义装载报文信息对象
Map<String, Object> maphead = new HashMap<String, Object>();
Map<String, Object> mapzt = new HashMap<String, Object>();
ArrayList<Map> Listyzxx = new ArrayList<Map>();
Map<String, Object> mapjtcyzxx = new HashMap<String, Object>();
// 业务信息获取
String msg = "";
RegBusRights regBusRights = regBusRightsService.getByBdcdyh(bdcdyh);
RegBaseH regbaseh = regBaseHService.getdy(data.get("bdcdyh").toString());
if (regbaseh != null && regBusRights != null) {
// 返回证号
bdccqzh = bdcdjxxcqzh(regBusRights);
mapzt.put("bdcdyh", regbaseh.getBdcdyh());
mapzt.put("cqzh", bdccqzh);
if ("0".equals(regbaseh.getIschafeng())) {
mapzt.put("sfcf", "0");
} else {
mapzt.put("sfcf", "1");
msg = msg + "已查封";
}
if (StringUtils.isNotBlank(regBusRights.getXtxq()) || StringUtils.isNotBlank(regBusRights.getStxq())) {
mapzt.put("sfdy", "1");
msg = msg + "已抵押";
} else {
mapzt.put("sfdy", "0");
}
if ("0".equals(regbaseh.getIsyiyi())) {
mapzt.put("sfyy", "0");
} else {
mapzt.put("sfyy", "1");
msg = msg + "已异议";
}
if (StringUtils.isNotBlank(regBusRights.getXsouyq())) {
mapzt.put("sfyg", "1");
msg = msg + "已预告";
} else {
mapzt.put("sfyg", "0");
}
if (validateExistsBuss(bdcdyh) || !"0".equals(regbaseh.getIschafeng()) || !"0".equals(regbaseh.getIsyiyi())
|| "0".equals(regbaseh.getRights()) || StringUtils.isNotBlank(regBusRights.getStxq())) {
mapzt.put("sfsd", "1");
msg = msg + "已锁定";
} else {
mapzt.put("sfsd", "0");
}
if ("3".equals(regbaseh.getRights())) {
mapzt.put("sfzx", "1");
msg = msg + "已注销";
} else {
mapzt.put("sfzx", "0");
}
if (msg.length() <= 0) {
msg = "成功";
}
maphead.put("regioncode", "0000");
maphead.put("msg", msg);
} else {
maphead.put("regioncode", "1000");
maphead.put("msg", "该不动产单元不存在或未办理相关登记!");
}
// 组装head
resmap.put("head", maphead);
// 组装jtcyzxx
Listyzxx.add(mapzt);
mapjtcyzxx.put("yzxx", Listyzxx);
// 组装data
resmap.put("data", mapjtcyzxx);
return resmap;
}
/**
* 成员方信息查询
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public Map jtcyfwxx(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
Map resdata = Maps.newHashMap();
ObjectMapper mapper = new ObjectMapper();
Map json = mapper.readValue(jsonstr, Map.class);
Map<String, String> data = json.get("data") == null ? Maps.newHashMap() : (Map) json.get("data");
if (data == null || data.size() <= 0) {
throw new ServiceException("节点data不能为空");
}
List<Map> jtcyxxlst = (List<Map>) (data.get("jtcyxx") == null ? Lists.newArrayList() : data.get("jtcyxx"));
if (jtcyxxlst == null || jtcyxxlst.size() <= 0) {
throw new ServiceException("节点jtcyxx不能为空");
}
// 获取信息
Map<String, Object> mapjtcyzxx = new HashMap<String, Object>();
ArrayList<Map> Listyzxx = new ArrayList<Map>();
for (int i = 0; i < jtcyxxlst.size(); i++) {
// 定义装载报文信息对象
Map<String, Object> mapzt = new HashMap<String, Object>();
Map<String, String> jtcyxx = jtcyxxlst.get(i) == null ? Maps.newHashMap() : jtcyxxlst.get(i);
String qlrmc = jtcyxx.get("jtcymc") == null ? "" : jtcyxx.get("jtcymc");
if (StringUtils.isBlank(qlrmc)) {
throw new ServiceException("权利人不能为空");
}
String zjzl = jtcyxx.get("jtcysfzjzl") == null ? "" : jtcyxx.get("jtcysfzjzl");
if (StringUtils.isBlank(zjzl)) {
throw new ServiceException("证件种类不能为空");
}
String zjh = jtcyxx.get("jtcyzjh") == null ? "" : jtcyxx.get("jtcyzjh");
if (StringUtils.isBlank(zjh)) {
throw new ServiceException("证件号不能为空");
}
// 获取返回结果集
String zl = "";
String cqzh = "";
String fwzt = "";
Map<String, Object> mapinfo = returnfwinfo(qlrmc, zjh, zjzl);
if (mapinfo != null) {
zl = mapinfo.get("zl").toString();
cqzh = mapinfo.get("cqzh").toString();
fwzt = mapinfo.get("fwzt").toString();
// 组装报文结果集
mapzt.put("jtcyid", jtcyxx.get("jtcyid").toString());
mapzt.put("gxrid", jtcyxx.get("gxrid").toString());
mapzt.put("jtcymc", qlrmc);
mapzt.put("jtcysfzjzl", zjzl);
mapzt.put("jtcyzjh", zjh);
mapzt.put("cqzh", cqzh);
mapzt.put("fwzl", zl);
mapzt.put("fwzt", fwzt);
// 组装jtcyzxx
Listyzxx.add(mapzt);
}
}
resdata.put("jtcyxx", Listyzxx);
return resdata;
}
/**
* 成员方信息查询
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public Map djxx(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
Map<String, Object> resdata = Maps.newHashMap();
ObjectMapper mapper = new ObjectMapper();
Map json = mapper.readValue(jsonstr, Map.class);
Map<String, String> data = json.get("data") == null ? Maps.newHashMap() : (Map) json.get("data");
if (data == null || data.size() <= 0) {
throw new ServiceException("节点data不能为空");
}
String bdcdyhs = data.get("bdcdyh").toString();
String proid = data.get("proid").toString();
if (StringUtils.isBlank(bdcdyhs)) {
throw new ServiceException("不动产单元号不能为空");
}
String cqzh = data.get("cqzh").toString();
// 如果是多不动产单元的话
Map<String, Object> mapallcqxx = new HashMap<String, Object>();
ArrayList<Map> Listcqxx = new ArrayList<Map>();
String[] bdcdyhinfo = bdcdyhs.split(";");
for (String bdcdyh : bdcdyhinfo) {
// 定义装载报文信息对象
Map<String, Object> mapcqxx = new HashMap<String, Object>();
// 查询登记信息,返回登记信息对象
RegBusBdcqzsdjxx djxxinfo = bdcqsdjxx(bdcdyh);
if (djxxinfo == null) {
throw new ServiceException("该不动产单元在系统中登记信息为空");
}
String ywh = djxxinfo.getYwh();
// 根据登记信息结果获取业务号,结合单元号获取权属信息
mapcqxx = fdcq2map(djxxinfo, ywh, proid);
if (mapcqxx.size() <= 0) {
throw new ServiceException("该不动产单元在系统中产权信息为空");
}
// 根据登记信息结果获取业务号,结合单元号获取权利人信息
List qlrinfolist = qlrlist(djxxinfo, bdcdyh, ywh);
if (qlrinfolist.size() <= 0) {
throw new ServiceException("该不动产单元在系统中权利人信息为空");
}
// 根据登记信息结果获取业务号,结合单元号获取抵押权信息
List dyinfolist = dylist(bdcdyh);
// 根据登记信息结果获取业务号,结合单元号获取查封信息
List cfinfolist = cflist(bdcdyh, ywh);
// 根据登记信息结果获取业务号,结合单元号获取异议信息
List yyinfolist = yylist(bdcdyh, ywh);
// 锁定信息组装
List sdxxlist = new ArrayList<>();
if (yyinfolist.size() > 0 || cfinfolist.size() > 0) {
sdxxlist = sdxxlist(bdcdyh, cfinfolist, yyinfolist);
}
mapcqxx.put("gxrxx", qlrinfolist);
mapcqxx.put("dyaqxx", dyinfolist);
mapcqxx.put("cfxx", cfinfolist);
mapcqxx.put("yyxx", yyinfolist);
mapcqxx.put("sdxx", sdxxlist);
Listcqxx.add(mapcqxx);
mapallcqxx.put("cqxx", Listcqxx);
}
resdata.put("data", mapallcqxx);
return resdata;
}
/**
* 收件信息
*
* @param data
* @return
* @throws JsonParseException
* @throws JsonMappingException
* @throws IOException
*/
@Transactional(readOnly = false)
public Map deleteYcslxx(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
String flag = "0";
ObjectMapper mapper = new ObjectMapper();
mapper.configure(Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);
mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
mapper.configure(Feature.ALLOW_SINGLE_QUOTES, true);
mapper.configure(Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);
mapper.configure(Feature.INTERN_FIELD_NAMES, true);
mapper.configure(Feature.CANONICALIZE_FIELD_NAMES, true);
Map json = mapper.readValue(jsonstr, Map.class);
Map<String, String> head = json.get("head") == null ? Maps.newHashMap() : (Map) json.get("head");
Map<String, String> data = json.get("data") == null ? Maps.newHashMap() : (Map) json.get("data");
if (data == null || data.size() <= 0) {
throw new ServiceException("节点data[申请信息]不能为空");
}
String bdcdyh = getValueByMap(data, "bdcdyh", "");
String czbz = getValueByMap(data, "czbz", "");
String proid = getValueByMap(data, "proid", "");
String yj = getValueByMap(data, "yj", "");
if (StringUtils.isBlank(proid) && StringUtils.isBlank(bdcdyh) && StringUtils.isBlank(czbz)) {
throw new ServiceException("节点【proid】或【bdcdyh】或【czbz】不能为空");
}
deleteYcslxxROLTA(proid, czbz, yj);
Map res_data = Maps.newHashMap();
res_data.put("proid", proid);
res_data.put("msg", "success");
return res_data;
}
public void deleteYcslxxROLTA(String proid, String czbz, String yj)
throws JsonParseException, JsonMappingException, IOException {
RegBusSlsq slsqinfo = new RegBusSlsq();
slsqinfo.setProid(proid);
List<RegBusSlsq> slsqlst = regBusSlsqService.findList(slsqinfo);
if (slsqlst == null || slsqlst.size() <= 0) {
return;
// throw new ServiceException("系统未找到业务申请信息!");
}
if (!"2".equals(czbz)) {
throw new ServiceException("不动产登记系统仅开通受理删除功能!");
}
RegBusSlsq slsq = slsqlst.get(0);
if (StringUtils.isBlank(slsq.getYwh())) {
throw new ServiceException("不动产登记系统业务申请信息中业务号不能为空 !");
}
if (!"reg_start".equals(slsq.getTaskdefkey())) {
throw new ServiceException("该业务不在受理环节,不能进行退件删除!");
}
// 开始删除各个业务表信息
// 权利人、义务人信息表
RegBusQlr regBusQlr = new RegBusQlr();
regBusQlr.setYwh(slsq.getYwh());
List<RegBusQlr> findList = regBusQlrService.findList_1(regBusQlr);
int regBusQlrCount = findList.size();
if (regBusQlrCount > 0) {
for (int i = 0; i < regBusQlrCount; i++) {
regBusQlr = findList.get(i);
regBusQlrService.delete(regBusQlr);
}
}
// 义务人信息
RegBusYwr regBusYwr = new RegBusYwr();
regBusYwr.setYwh(slsq.getYwh());
List<RegBusYwr> findList2 = regBusYwrService.findList(regBusYwr);
int regBusYwrCount = findList2.size();
if (regBusYwrCount > 0) {
for (int i = 0; i < regBusYwrCount; i++) {
regBusYwr = findList2.get(i);
regBusYwrService.delete(regBusYwr);
}
}
// 收件主子表【可能还没有添加,需要判断】
RegBusSjmain regBusSjmain = new RegBusSjmain();
regBusSjmain.setYwh(slsq.getYwh());
List<RegBusSjmain> findList4 = regBusSjmainService.findList(regBusSjmain);
int regBusSjmainCount = findList4.size();
if (regBusSjmainCount > 0) {
for (int i = 0; i < regBusSjmainCount; i++) {
RegBusSjmain regBusSjmain2 = findList4.get(i);
regBusSjmainService.delete(regBusSjmain2);
}
}
// 已登记信息表【可能还没有添加,需要判断】
RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
if (StringUtils.isNotBlank(slsq.getYwh())) {
regBusBdcqzsdjxx.setYwh(slsq.getYwh());
List<RegBusBdcqzsdjxx> djxxlst = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
for (RegBusBdcqzsdjxx djxx : djxxlst) {
regBusBdcqzsdjxxService.delete(djxx);
}
}
// 各种权属表
// 房地产权
RegBusFdcq2 regBusFdcq2 = new RegBusFdcq2();
regBusFdcq2.setYwh(slsq.getYwh());
List<RegBusFdcq2> findList11 = regBusFdcq2Service.findList(regBusFdcq2);
int regBusFdcq2Count = findList11.size();
if (regBusFdcq2Count == 1) {
for (int i = 0; i < regBusFdcq2Count; i++) {
regBusFdcq2 = findList11.get(i);
regBusFdcq2Service.deletefdcq2(regBusFdcq2);
}
}
actProcessService.deleteProcIns(slsq.getProcInsId(), yj);
historyService.deleteHistoricProcessInstance(slsq.getProcInsId());
regBusSlsqService.delete(slsq);
}
/**
* 一窗采集信息推送到不动产审核节点
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public Map shxx(String jsonstr) throws Exception {
Map resdata = Maps.newHashMap();
ObjectMapper mapper = new ObjectMapper();
mapper.configure(Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);
mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
mapper.configure(Feature.ALLOW_SINGLE_QUOTES, true);
mapper.configure(Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);
mapper.configure(Feature.INTERN_FIELD_NAMES, true);
mapper.configure(Feature.CANONICALIZE_FIELD_NAMES, true);
Map json = mapper.readValue(jsonstr, Map.class);
System.out.println(json.get("head"));
Map<String, String> head = json.get("head") == null ? Maps.newHashMap() : (Map) json.get("head");
Map<String, String> data = json.get("data") == null ? Maps.newHashMap() : (Map) json.get("data");
resdata.put("proid", data.get("proid"));
resdata.put("msg", "success");
// try{
// 一窗受理退件判断更新还是新增
// 根据proid查询受理受理申请表
RegBusSlsq regBusSlsq = new RegBusSlsq();
regBusSlsq.setProid(data.get("proid").toString());
List<RegBusSlsq> slsqlst = regBusSlsqService.findList(regBusSlsq);
// 必须是柜台受理环节
if (slsqlst.size() > 0) {
regBusSlsq = slsqlst.get(0);
if ("reg_start".equals(regBusSlsq.getTaskdefkey())) {
shxxUpdateROLTA(data, regBusSlsq);
} else {
throw new ServiceException("当前业务已存在受理信息,不能重复受理");
}
} else {
shxxROLTA(data);
}
YcslYwzt ywzt = new YcslYwzt();
ywzt.setYwzt(regBusSlsq.getTaskdefkey());
ywzt.setYwh(regBusSlsq.getYwh());
ywzt.setProid(regBusSlsq.getProid());
ywzt.setXtmc("bdcdj");
ywzt.setYwztmc(DatatypeUtil.getYwztMc(ywzt.getYwzt()));
ycslYwztService.save(ywzt);
/***
* }catch(Exception e){ resdata.put("proid",data.get("proid"));
* resdata.put("msg","false"); throw e; }
***/
return resdata;
}
/**
* 审核信息
*
* @param data
* @return
* @throws JsonParseException
* @throws JsonMappingException
* @throws IOException
*/
@Transactional(readOnly = false)
public void shxxROLTA(Map<String, String> data) throws JsonParseException, JsonMappingException, IOException {
if (data == null || data.size() <= 0) {
throw new ServiceException("节点data[申请信息]不能为空");
}
String maxYwh = regBusSlsqDao.findMaxYwh();
String ywh = RegUtils.getNextYwh(maxYwh);
String cjsj_str = getValueByMap(data, "cjsj", "");
String sqbz = getValueByMap(data, "bz", "");
if (StringUtils.isBlank(cjsj_str)) {
throw new ServiceException("节点data[申请信息]中创建时间[cjsj]不能为空");
}
if (!DatatypeUtil.isDate(cjsj_str)) {
throw new ServiceException("节点data[申请信息]中创建时间[cjsj]格式错误,建议格式 yyyy-MM-dd");
}
Date cjsj = DateUtils.parseDate(cjsj_str);
String cjr = getValueByMap(data, "cjr", "");
if (StringUtils.isBlank(cjr)) {
throw new ServiceException("节点data[申请信息]中创建人[cjr]不能为空");
}
User localUser = getUserByName(cjr);
if (localUser == null || localUser.getId() == null) {
throw new ServiceException("节点data[申请信息]中创建人[cjr]对应的用户未找到");
}
List<Map> bdcxxlst = (List<Map>) (data.get("bdcxx") == null ? Lists.newArrayList() : data.get("bdcxx"));
if (bdcxxlst == null || bdcxxlst.size() <= 0) {
throw new ServiceException("节点bdcxx[不动产信息]不能为空");
}
Map bdcxxMap = bdcxxlst.get(0);
List<Map> htxxlst = (List<Map>) (data.get("htxx") == null ? Lists.newArrayList() : data.get("htxx"));
if (htxxlst == null || htxxlst.size() <= 0) {
throw new ServiceException("节点htxx[合同信息]不能为空");
}
Map htxxmap = htxxlst.get(0);
List<Map> gxrxxlst = (List<Map>) (data.get("gxrxx") == null ? Lists.newArrayList() : data.get("gxrxx"));
if (gxrxxlst == null || gxrxxlst.size() <= 0) {
throw new ServiceException("节点gxrxx[关系人信息]不能为空");
}
List<Map> sjclxxlst = (List<Map>) (data.get("sjclxx") == null ? Lists.newArrayList() : data.get("sjclxx"));
if (sjclxxlst == null || sjclxxlst.size() <= 0) {
throw new ServiceException("节点sjclxx[收件信息]不能为空");
}
// 不动产权证号
String bdcdyh = getValueByMap(bdcxxMap, "bdcdyh", "");
if (StringUtils.isBlank(bdcdyh)) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]不能为空");
}
// 判断当前不动产单元号是否有业务办理
if (validateExistsBuss(bdcdyh)) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]存在正在办理的业务");
}
RegBaseH regbaseh = regBaseHService.getIslogout(bdcdyh);
if (regbaseh == null || regbaseh.getId() == null) {
throw new ServiceException("系统未找到不动产单元号[bdcdyh]对应的户基本信息");
}
RegBusRights regBusRights = regBusRightsService.getByBdcdyh(bdcdyh);
if (!"0".equals(regbaseh.getIsyiyi())) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]处于异议状态");
}
if (!"0".equals(regbaseh.getIschafeng())) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]处于查封状态");
}
if ("0".equals(regbaseh.getRights())) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]处于无权利状态");
}
if (StringUtils.isNotBlank(regBusRights.getStxq())) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]处于抵押状态");
}
String fybh = getValueByMap(bdcxxMap, "fybh", "");
if (StringUtils.isBlank(fybh)) {
throw new ServiceException("不动产信息[bdcxx]中房源编号[fybh]不能为空");
}
String jgrq = getValueByMap(bdcxxMap, "jgsj", "");
if (StringUtils.isBlank(jgrq)) {
throw new ServiceException("不动产信息[bdcxx]中竣工时间[jgsj]不能为空");
}
if (!DatatypeUtil.isDate(jgrq)) {
throw new ServiceException("不动产信息[bdcxx]中竣工时间[jgsj]格式错误,建议格式 yyyy-MM-dd");
}
String fwyt = getValueByMap(bdcxxMap, "fwyt", "");
if (StringUtils.isBlank(fwyt)) {
throw new ServiceException("不动产信息[bdcxx]中房屋用途[fwyt]不能为空");
}
String fwjg = getValueByMap(bdcxxMap, "fwjg", "");
if (StringUtils.isBlank(fwjg)) {
throw new ServiceException("不动产信息[bdcxx]中房屋结构[fwjg]不能为空");
}
String fwxz = getValueByMap(bdcxxMap, "fwxz", "");
if (StringUtils.isBlank(fwxz)) {
throw new ServiceException("不动产信息[bdcxx]中房屋性质[fwxz]不能为空");
}
String zcs = getValueByMap(bdcxxMap, "zcs", "0");
if (StringUtils.isBlank(zcs)) {
throw new ServiceException("不动产信息[bdcxx]中总层数[zcs]不能为空");
}
if (!DatatypeUtil.isInteger(zcs)) {
throw new ServiceException("不动产信息[bdcxx]中总层数[zcs]格式错误");
}
int zcs_int = Integer.parseInt(zcs);
String djxxbz = getValueByMap(bdcxxMap, "bz", "");
String djxl = getValueByMap(data, "sqlxdm", "").trim().substring(0, 3);
String djdl = (Integer.parseInt(djxl.substring(0, 1)) - 1) + "00";
String zl = getValueByMap(bdcxxMap, "zl", "");
String qllx = "4";
List ywrlst = Lists.newArrayList();
List qlrlst = Lists.newArrayList();
saveFjFiles(cjsj_str, cjsj, sjclxxlst, ywh);
List<Integer> ywr_sxh_s = Lists.newArrayList();
List<Integer> qlr_sxh_s = Lists.newArrayList();
List<String> qlrmc_s = Lists.newArrayList();
RegBusQlr first_qlr = new RegBusQlr();
String qlr_gyfs = "";
for (Map rxrmap : gxrxxlst) {
if (rxrmap == null) {
continue;
}
String gxrmc = getValueByMap(rxrmap, "gxrmc", "");
String gxrlx = getValueByMap(rxrmap, "gxrlx", "");
String gxrzjzl = getValueByMap(rxrmap, "gxrsfzjzl", "");
String gxrzjh = getValueByMap(rxrmap, "gxrzjh", "");
if (StringUtils.isBlank(gxrmc.trim())) {
throw new ServiceException("关系人信息[gxrxx]的关系人姓名[gxrmc]不能为空");
}
if (StringUtils.isBlank(gxrlx.trim())) {
throw new ServiceException("关系人信息[gxrxx]的关系人类型[gxrlx]不能为空");
}
if (StringUtils.isBlank(gxrzjzl.trim())) {
throw new ServiceException("关系人信息[gxrxx]的关系人身份证件种类[gxrsfzjzl]不能为空");
}
if (StringUtils.isBlank(gxrzjh.trim())) {
throw new ServiceException("关系人信息[gxrxx]的关系人证件号[gxrzjh]不能为空");
}
String gyqk = getValueByMap(rxrmap, "gyqk", "");
String gyfs = getValueByMap(rxrmap, "gyfs", "");
if (StringUtils.isBlank(gyfs)) {
throw new ServiceException("关系人信息[gxrxx]的共有方式[gyfs]不能为空");
}
if (!DatatypeUtil.validateGyqk(gyfs, gyqk)) {
throw new ServiceException("关系人信息[gxrxx]的共有方式[gyfs]与共有情况[gyqk]不匹配");
}
String gxrlxdh = getValueByMap(rxrmap, "gxrlxdh", "");
String gxrtxdz = getValueByMap(rxrmap, "gxrtxdz", "");
String qlbl = getValueByMap(rxrmap, "qlbl", "");
RegBasePerson person = new RegBasePerson();
person.setRymc(gxrmc);
person.setZjzl(gxrzjzl);//
person.setZjh(gxrzjh);//
getPerson(person);
person.setDh(gxrlxdh);//
person.setDz(gxrtxdz);//
person.setDlrymc(getValueByMap(rxrmap, "gxrfddbr", ""));//
person.setDlrydh(getValueByMap(rxrmap, "gxrdlrdh", ""));//
person.setDljg(getValueByMap(rxrmap, "gxrfddbr", ""));//
// 1 个人 2 企业
person.setRylx("1");//
person.setIsaudit("2");//
person.setCreateBy(localUser);
person.setCreateDate(new Date());
person.setUpdateBy(localUser);
person.setUpdateDate(new Date());
person.setRemarks("一窗受理");//
person.setDelFlag("0");
// 发证机构 未找到,默认 汉中市不动产登记局
person.setFzjg("汉中市不动产登记局");//
person.setIdimgpers(null);//
person.setGj("142");//
// 户籍所在省市 未传输 暂为空
person.setHjszss("");//
person.setXb("");//
person.setBz("");//
person.setYb("");//
person.setGzdw("");//
person.setDzyj("");//
// 所属行业 未传输 空
person.setSshy("");//
regBasePersonService.save(person);
String sxh = getValueByMap(rxrmap, "sxh", "");
Integer int_sxh = null;
if (DatatypeUtil.isInteger(sxh)) {
int_sxh = Integer.parseInt(sxh);
} else {
throw new ServiceException("关系人信息[gxrxx]的顺序号[sxh]格式错误,必须为正整数");
}
switch (gxrlx) {
case "ywr":
RegBusYwr ywr = new RegBusYwr();
if (ywr_sxh_s.contains(int_sxh)) {
throw new ServiceException("关系人信息[gxrxx]的义务人顺序号[sxh]错误,内容重复");
}
ywr_sxh_s.add(int_sxh);
ywr.setYwh(ywh);
ywr.setBdcdyh(bdcdyh);
ywr.setSxh(sxh);
ywr.setQlrmc(person.getRymc());
ywr.setPcode(person.getPcode());
ywr.setZjzl(person.getZjzl());//
ywr.setZjh(person.getZjh());//
ywr.setDh(person.getDh());//
ywr.setDz(person.getDz());//
// 1 个人 2 企业
ywr.setQlrlx(person.getRylx());//
ywr.setQlbl(qlbl);//
ywr.setGyfs(gyfs);//
ywr.setGyqk(gyqk);//
ywr.setDlrmc(getValueByMap(rxrmap, "gxrfddbr", ""));//
ywr.setDlrdh(getValueByMap(rxrmap, "gxrdlrdh", ""));//
ywr.setDljgmc(getValueByMap(rxrmap, "gxrfddbr", ""));//
ywr.setQllx(qllx);//
// 发证机构 未找到,默认 汉中市不动产登记局
ywr.setFzjg("汉中市不动产登记局");//
ywr.setRemarks("一窗受理");//
ywr.setQszt("0");//
ywr.setGj("142");
ywr.setSfczr("1");//
ywr.setYsdm("6003000000");//
ywr.setCreateBy(localUser);
ywr.setCreateDate(new Date());
ywr.setUpdateBy(localUser);
ywr.setUpdateDate(new Date());
ywr.setDelFlag("0");
// 户籍所在省市 未传输 暂为空
ywr.setHjszss("");//
ywr.setFddbrfzr("");//
ywr.setFddbrfzrdh("");//
ywr.setXb("");//
ywr.setYb("");//
ywr.setGzdw("");//
ywr.setDzyj("");//
ywr.setBz("");//
// 所属行业 未传输 空
ywr.setSshy("");//
// 不动产权证号,登簿后回填
ywr.setBdcqzh("");
regBusYwrService.save(ywr);
ywrlst.add(ywr);
break;
case "qlr":
RegBusQlr qlr = new RegBusQlr();
if (qlr_sxh_s.contains(int_sxh)) {
throw new ServiceException("关系人信息[gxrxx]的权利人顺序号[sxh]错误,内容重复");
}
if (!"".equals(qlr_gyfs) && !qlr_gyfs.equals(gyfs)) {
throw new ServiceException("关系人信息[gxrxx]的权利人共有方式[gyfs]不一致");
}
qlr_gyfs = gyfs;
qlr.setQllx(qllx);//
qlr.setYwh(ywh);//
qlr.setBdcdyh(bdcdyh);//
qlr.setSxh(int_sxh);//
qlr.setQlrmc(person.getRymc());//
qlr.setPcode(person.getPcode());//
qlr.setZjzl(person.getZjzl());//
qlr.setZjh(person.getZjh());//
qlr.setGyfs(gyfs);//
qlr.setGyqk(gyqk);//
qlr.setDh(person.getDh());//
qlr.setDz(person.getDz());//
qlr.setQlbl(qlbl);//
qlr.setDlrmc(getValueByMap(rxrmap, "gxrfddbr", ""));//
qlr.setDlrdh(getValueByMap(rxrmap, "gxrdlrdh", ""));//
qlr.setDljgmc(getValueByMap(rxrmap, "gxrfddbr", ""));//
qlr.setYsdm("6003000000");//
// 1 个人 2 企业
qlr.setQlrlx("1");//
qlr.setQszt("0");//
// 发证机构 未找到,默认 汉中市不动产登记局
qlr.setFzjg("汉中市不动产登记局");//
qlr.setGj("142");//
qlr.setSfczr("1");//
qlr.setRemarks("一窗受理");//
qlr.setCreateBy(localUser);
qlr.setCreateDate(new Date());
qlr.setUpdateBy(localUser);
qlr.setUpdateDate(new Date());
qlr.setDelFlag("0");
// 不动产权证号,登簿后回填
qlr.setBdcqzh("");
qlr.setFddbrfzr("");//
qlr.setFddbrfzrdh("");//
qlr.setBz("");//
qlr.setYb("");//
qlr.setGzdw("");//
qlr.setDzyj("");//
qlr.setHjszss("");//
qlr.setXb("");//
// 所属行业 未传输 空
qlr.setSshy("");//
regBusQlrService.save(qlr);
// 取出第一权利人
if ("1".equals(getValueByMap(rxrmap, "sxh", ""))) {
first_qlr = qlr;
}
qlrmc_s.add(person.getRymc());
qlrlst.add(qlr);
break;
default:
throw new ServiceException("节点gxrxx中的字段gxrlx格式错误");
}
}
// 验证义务人、权利人顺序号
if (!DatatypeUtil.validateSxh(ywr_sxh_s)) {
throw new ServiceException("关系人信息[gxrxx]的义务人顺序号[sxh]错误,顺序号不连续");
}
if (!DatatypeUtil.validateSxh(qlr_sxh_s)) {
throw new ServiceException("关系人信息[gxrxx]的权利人顺序号[sxh]错误,顺序号不连续");
}
// 单独共有时,只能有一个权利人
if ("0".equals(qlr_gyfs) && qlr_sxh_s.size() > 1) {
throw new ServiceException("关系人信息[gxrxx]的存在多个权利人,共有方式[gyfs]错误");
} else if (!"0".equals(qlr_gyfs) && qlr_sxh_s.size() <= 1) {
throw new ServiceException("关系人信息[gxrxx]的存在单个权利人,共有方式[gyfs]错误");
}
String dyh = getValueByMap(bdcxxMap, "dyh", "");
if (StringUtils.isBlank(dyh)) {
throw new ServiceException("不动产信息[bdcxx]中单元号[dyh]不能为空");
}
String cx = getValueByMap(bdcxxMap, "cx", "0");
String cgzk = getValueByMap(bdcxxMap, "cgzk", "0");
// 更新户信息
regbaseh.setFybh(fybh);
regbaseh.setBtfwbm(fybh);
regbaseh.setDyh(dyh);
regbaseh.setCgzk(cgzk);
regbaseh.setCx(cx);
regBaseHService.save(regbaseh);
RegBaseZdjbxx zdjbxx = new RegBaseZdjbxx();
zdjbxx.setZddm(bdcdyh.substring(0, 19));
zdjbxx.setIslogout("0");
List<RegBaseZdjbxx> zdjbxxlst = regBaseZdjbxxService.findList(zdjbxx);
if (zdjbxxlst == null || zdjbxxlst.size() <= 0) {
throw new ServiceException("系统未找到不动产单元号[bdcdyh]对应的宗地基本信息");
}
zdjbxx = zdjbxxlst.get(0);
RegBusBdcqzsdjxx dj = new RegBusBdcqzsdjxx();
dj.setBdcdyh(bdcdyh);
dj.setIslogout("01");
dj.setDbsj("NOTNULL");
dj.setRights("1");
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findhttpList(dj);
if (djxxlist.size() > 0) {
dj = djxxlist.get(0);
} else {
throw new ServiceException("系统未找到不动产单元号[bdcdyh]对应的不动产权证书登记信息");
}
RegBusJsydsyq jsydsyq = getJsydsyq(bdcdyh);
String htdj = getValueByMap(htxxmap, "htdj", "");
if (StringUtils.isBlank(htdj)) {
throw new ServiceException("合同信息[htxx]中合同单价[htdj]不能为空");
}
String scqdfwfs = getValueByMap(bdcxxMap, "scqdfwfs", "");
String htdjrq = getValueByMap(htxxmap, "htdjrq", "");
String htbarq = getValueByMap(htxxmap, "htbarq", "");
if (StringUtils.isBlank(htdjrq) && StringUtils.isBlank(htbarq)) {
throw new ServiceException("合同信息[htxx]中合同签订日期[htdjrq]和合同备案日期[htbarq]不能同时为空不能为空");
}
String cb = getValueByMap(bdcxxMap, "cb", "");
String fwszdswjg = getValueByMap(bdcxxMap, "fwszdswjg", "");
String ssqsjnsj = getValueByMap(bdcxxMap, "ssqsjnsj", "");
String ssqsje = getValueByMap(bdcxxMap, "ssqsje", "");
RegBusFdcq2 fdcq2 = new RegBusFdcq2();
fdcq2.setHtdj(htdj);
fdcq2.setScqdfwfs(scqdfwfs);
fdcq2.setHtdjrq(htdjrq);
fdcq2.setHtbarq(htbarq);
fdcq2.setCb(cb);
fdcq2.setFwszdswjg(fwszdswjg);
fdcq2.setSsqsje(ssqsje);
fdcq2.setSsqsjnsj(ssqsjnsj);
if (jsydsyq != null) {
fdcq2.setTdsyjssj(jsydsyq.getSyqjssj());
fdcq2.setTdsyqssj(jsydsyq.getSyqqssj());
}
fdcq2.setJgsj(jgrq);
fdcq2.setDjlx(djdl);//
fdcq2.setDjyy("转移登记");//
fdcq2.setFdzl(zl);//
fdcq2.setTdsyqr(StringUtils.join(qlrmc_s, ";"));
fdcq2.setGhyt(fwyt);
fdcq2.setFwxz(fwxz);
fdcq2.setFwjg(fwjg);
fdcq2.setZcs(zcs_int);
fdcq2.setYbdcqzh(dj.getBdcqzh());//
fdcq2.setQxdm(Global.getAreaCode());
// 宗地分摊方式 1共用
fdcq2.setZdftfs("1");
fdcq2.setDjjg(null);//
fdcq2.setDbr(null);//
fdcq2.setDjsj(null);//
fdcq2.setFj(null);//
fdcq2.setQszt("0");//
fdcq2.setCqly(null);//
fdcq2.setYwxl(qllx);//
fdcq2.setHtbh(getValueByMap(htxxmap, "htbh", ""));
fdcq2.setCreateBy(localUser);
fdcq2.setCreateDate(new Date());
fdcq2.setUpdateBy(localUser);
fdcq2.setUpdateDate(new Date());
fdcq2.setRemarks("一窗受理");//
fdcq2.setDelFlag("0");
fdcq2.setDytdmj(0d);//
fdcq2.setFttdmj(regbaseh.getFttdmj());//
fdcq2.setFdcjyjg(Double.parseDouble(getValueByMap(htxxmap, "pgjg", "0")));//
fdcq2.setJzmj(Double.parseDouble(getValueByMap(bdcxxMap, "jzmj", "0")));//
fdcq2.setZyjzmj(Double.parseDouble(getValueByMap(bdcxxMap, "tnmj", "0")));//
fdcq2.setFtjzmj(fdcq2.getJzmj() - fdcq2.getZyjzmj());//
fdcq2.setYtmc(DictUtils.getDictLabel(getValueByMap(htxxmap, "fwyt", ""), "reg_bus_fwyt", ""));//
fdcq2.setFwxzmc(DictUtils.getDictLabel(getValueByMap(htxxmap, "fwxz", ""), "reg_bus_fwxz", ""));//
fdcq2.setSzc(getValueByMap(bdcxxMap, "szc", ""));//
fdcq2.setQlxz(zdjbxx.getQlxz());//
fdcq2.setZdmj(zdjbxx.getZdmj());//
fdcq2.setId(IdGen.uuid());//
fdcq2.setYsdm("6002030100");//
fdcq2.setBdcdyh(bdcdyh);//
fdcq2.setYwh(ywh);//
fdcq2.setQllx("4");//
// 不动产权证号,登簿后回填
fdcq2.setBdcqzh("");//
regBusFdcq2Dao.insert(fdcq2);
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setIsprint("0");//
djxx.setRights("1");//
djxx.setCreateBy(localUser);
djxx.setCreateDate(new Date());
djxx.setUpdateBy(localUser);
djxx.setUpdateDate(new Date());
djxx.setRemarks("一窗受理");//
djxx.setDelFlag("0");
djxx.setOldid(dj.getId());//
djxx.setYwh(ywh);//
djxx.setBdcqzbh(null);//
djxx.setYsxlh(null);//
djxx.setDbsj(null);//
djxx.setQlrmc(first_qlr.getQlrmc());//
djxx.setGyqk(DictUtils.getDictLabel(qlr_gyfs, "reg_bus_gyfs", ""));//
djxx.setZl(zl);//
djxx.setZddm(zdjbxx.getZddm());//
djxx.setBdcdyh(bdcdyh);//
djxx.setQllx("4");//
djxx.setQlxz(DictUtils.getDictLabel(fdcq2.getQlxz(), "reg_bus_qlxz", "") + "/"
+ DictUtils.getDictLabel(fdcq2.getFwxz(), "reg_bus_fwxz", ""));
djxx.setYt(zdjbxx.getYt() + "/" + DictUtils.getDictLabel(fdcq2.getGhyt(), "reg_bus_fwyt", ""));
djxx.setMj(regbaseh.getScjzmj() + "");
// 一窗受理未传输, 暂空
djxx.setSyqx(null);//
StringBuffer sb = new StringBuffer();
sb.append("分摊土地使用权面积:").append(RegUtils.replaceNull(regbaseh.getFttdmj())).append(";").append("房屋结构:")
.append(RegUtils.replaceNull(DictUtils.getDictLabel(fdcq2.getFwjg(), "reg_bus_fwjg", ""))).append(";")
.append("专有建筑面积:").append(RegUtils.replaceNull(fdcq2.getZyjzmj())).append(";").append("分摊建筑面积:")
.append(fdcq2.getFtjzmj()).append(";").append("房屋总层数:").append(RegUtils.replaceNull(fdcq2.getZcs()))
.append(";").append("所在层数:").append(RegUtils.replaceNull(fdcq2.getSzc())).append(";").append("房屋竣工时间:")
.append(RegUtils.replaceNull(fdcq2.getJgsj())).append(";").append("共有情况:")
.append(RegUtils.replaceNull(djxx.getGyqk())).append(";");
djxx.setQlqtzk(sb.toString());//
djxx.setFj(djxxbz);//
djxx.setDydjxx(null);//
djxx.setJcdydjxx(null);//
djxx.setCfqk(null);//
djxx.setJccf(null);//
djxx.setTh(null);//
djxx.setPwh(null);//
djxx.setHbjk(null);//
djxx.setHbhth(null);//
djxx.setFzsj(null);//
djxx.setZzsj(null);//
djxx.setDjlx(djxl);//
djxx.setStatus("2");//
djxx.setIslogout("0");//
djxx.setIsfdsj(0);//
djxx.setIshistory("0");//
// 不动产权证号,登簿后回填
djxx.setBdcqzh("");//
regBusBdcqzsdjxxService.save(djxx);
RegBusSlsq slsq = new RegBusSlsq();
slsq.setYsdm("2004010000");//
slsq.setSlsj(cjsj);
slsq.setSlry(cjr);//
slsq.setBz(sqbz);
slsq.setYwh(ywh);//
slsq.setDjxl(djxl);//
slsq.setDjdl(djdl);//
slsq.setSqzsbs(0);//
slsq.setSqfbcz(data.get("sffbcz") == null ? 0 : Integer.parseInt(data.get("sffbcz").toString()));//
slsq.setQxdm(Global.getAreaCode());//
slsq.setZl(zl);//
slsq.setTzrxm(first_qlr.getQlrmc());//
slsq.setTzfs("");//
slsq.setTzrdh(first_qlr.getDh());//
slsq.setTzryddh(first_qlr.getDh());//
slsq.setTzrdzyj("");//
slsq.setSfwtaj("0");//
slsq.setJssj(new Date());//
slsq.setAjzt("");//
slsq.setBz(getValueByMap(data, "bz", ""));//
slsq.setProcInsId("");//
slsq.setTaskdefkey("reg_start");//
slsq.setFjinfo("");//
slsq.setStr("");//
slsq.setIsgs("0");//
slsq.setIslock("0");//
slsq.setFybh(getValueByMap(bdcxxMap, "fybh", ""));
// 创建人 暂定空
slsq.setCreateby(localUser.getId());
slsq.setCreateDate(new Date());//
// 创建人 暂定空
slsq.setUpdateBy(localUser);
slsq.setUpdateDate(new Date());
slsq.setRemarks("99");//
slsq.setDelFlag("0");//
slsq.setProid(getValueByMap(data, "proid", ""));
// slsq.setBdcqzh();//未办证,不赋值
regBusSlsqService.save(slsq);
commimtslsq(slsq);
}
public void saveFjFiles(String cjsj_str, Date cjsj, List<Map> sjclxxlst, String ywh) {
// 获取收件信息
// 插入收件主表
RegBusSjmain sjmain = new RegBusSjmain();
int bz = 0;
int i = 0;
for (Map sjmap : sjclxxlst) {
i++;
if (sjmap == null) {
continue;
}
String sjsj_date = getValueByMap(sjmap, "sjrq", "");
String sjr = getValueByMap(sjmap, "sjr", "");
String cllx = getValueByMap(sjmap, "cllx", "");
String clmc = getValueByMap(sjmap, "clmc", "");
String fs = getValueByMap(sjmap, "fs", "");
String ys = getValueByMap(sjmap, "ys", "");
String fjlj = getValueByMap(sjmap, "sjcllj", "");
String local_file = "";
User user = getUserByName(sjr);
if (user == null || user.getId() == null) {
throw new ServiceException("节点Sjclxx[收件材料信息]中收件人[sjr]对应的用户未找到");
}
if (!DatatypeUtil.isDate(sjsj_date)) {
throw new ServiceException("节点Sjclxx[收件材料信息]中收件人[sjr]对应的用户未找到");
}
if (!DatatypeUtil.isInteger(fs)) {
throw new ServiceException("节点Sjclxx[收件材料信息]中份数[fs]格式错误");
}
if (!DatatypeUtil.isInteger(ys)) {
throw new ServiceException("节点Sjclxx[收件材料信息]中页数[ys]格式错误");
}
Date sjsj = DateUtils.parseDate(cjsj_str);
if (bz == 0) {
sjmain.setYwh(ywh);
sjmain.setYsdm("2004020000");
sjmain.setSjsj(cjsj);
sjmain.setCreateBy(user);
sjmain.setUpdateBy(user);
regBusSjmainService.save(sjmain);
bz = 1;
}
RegBusSjchild sjchild = new RegBusSjchild();
sjchild.setMainid(sjmain.getId());
sjchild.setSjlx(cllx);
sjchild.setSjmc(DictUtils.getDictValue(clmc, "reg_bus_fwsjmc_zy", ""));
// 收件用链接
logger.info("fjlj=={}", fjlj);
String[] fileNameArray = fjlj.split(";");
String localFilePath = "";
logger.info("fileNameArray length=={}", fileNameArray.length);
for (int j = 0; j < fileNameArray.length; j++) {
String ftpFilePath = fileNameArray[j];
ftpFilePath = ftpFilePath.replace("store://fileStore1", "/fileCenter/content/");
String hzname = ftpFilePath.substring(
ftpFilePath.substring(0, ftpFilePath.length() - 1).lastIndexOf(".") + 1, ftpFilePath.length());
String fileName = DatatypeUtil.randomName(hzname);
// 方式一 把图片下载到本地 读取本地 缺少用户
String creater = user.getId();
String filepath = "/userfiles/" + creater + "/files/reg/bus/regBusSjmain/" + ywh.substring(0, 4) + "/"
+ ywh.substring(4, 6) + "/" + ywh;
localFilePath = Global.getUserfilesBaseDir() + filepath;
// 拼接文件路径
local_file = local_file + "|/ODM/" + filepath + File.separator + fileName;
// 获取
FTPUtil ftp = new FTPUtil(SysUtil.IMAGE_FTP_IP, SysUtil.IMAGE_FTP_PORT, SysUtil.IMAGE_FTP_USERNAME,
SysUtil.IMAGE_FTP_USERPWD, SysUtil.FILE_FTP_DEFAULTDIREECTORY);
// ftp.getFilesNameByPath("WORK_FLOW_STUFF/2020/08/04/484H4019AQF33001/房屋登记机构所需的其他必要材料");
ftp.downFileByPath(ftpFilePath, localFilePath, fileName, true);
}
sjchild.setSjfj(local_file);
sjchild.setCreateDate(sjsj);
sjchild.setYs(Integer.parseInt(ys));
sjchild.setSjsl(Integer.parseInt(fs));
sjchild.setSort(i);
sjchild.setCreateBy(user);
sjchild.setUpdateBy(user);
regBusSjmainService.savesjchild(sjchild);
}
}
/**
* 审核信息,更新
*
* @param data
* @return
* @throws JsonParseException
* @throws JsonMappingException
* @throws IOException
*/
@Transactional(readOnly = false)
public void shxxUpdateROLTA(Map<String, String> data, RegBusSlsq regBusSlsq)
throws JsonParseException, JsonMappingException, IOException {
if (regBusSlsq == null) {
throw new ServiceException("受理信息为空");
}
if (data == null || data.size() <= 0) {
throw new ServiceException("节点data[申请信息]不能为空");
}
String cjsj_str = getValueByMap(data, "cjsj", "");
String sqbz = getValueByMap(data, "bz", "");
if (StringUtils.isBlank(cjsj_str)) {
throw new ServiceException("节点data[申请信息]中创建时间[cjsj]不能为空");
}
if (!DatatypeUtil.isDate(cjsj_str)) {
throw new ServiceException("节点data[申请信息]中创建时间[cjsj]格式错误,建议格式 yyyy-MM-dd");
}
Date cjsj = DateUtils.parseDate(cjsj_str);
String cjr = getValueByMap(data, "cjr", "");
if (StringUtils.isBlank(cjr)) {
throw new ServiceException("节点data[申请信息]中创建人[cjr]不能为空");
}
User localUser = getUserByName(cjr);
if (localUser == null || localUser.getId() == null) {
throw new ServiceException("节点data[申请信息]中创建人[cjr]对应的用户未找到");
}
List<Map> bdcxxlst = (List<Map>) (data.get("bdcxx") == null ? Lists.newArrayList() : data.get("bdcxx"));
if (bdcxxlst == null || bdcxxlst.size() <= 0) {
throw new ServiceException("节点bdcxx[不动产信息]不能为空");
}
Map bdcxxMap = bdcxxlst.get(0);
List<Map> htxxlst = (List<Map>) (data.get("htxx") == null ? Lists.newArrayList() : data.get("htxx"));
if (htxxlst == null || htxxlst.size() <= 0) {
throw new ServiceException("节点htxx[合同信息]不能为空");
}
Map htxxmap = htxxlst.get(0);
List<Map> gxrxxlst = (List<Map>) (data.get("gxrxx") == null ? Lists.newArrayList() : data.get("gxrxx"));
if (gxrxxlst == null || gxrxxlst.size() <= 0) {
throw new ServiceException("节点gxrxx[关系人信息]不能为空");
}
List<Map> sjclxxlst = (List<Map>) (data.get("sjclxx") == null ? Lists.newArrayList() : data.get("sjclxx"));
if (sjclxxlst == null || sjclxxlst.size() <= 0) {
throw new ServiceException("节点sjclxx[收件信息]不能为空");
}
// 不动产权证号
String bdcdyh = getValueByMap(bdcxxMap, "bdcdyh", "");
if (StringUtils.isBlank(bdcdyh)) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]不能为空");
}
RegBaseH regbaseh = regBaseHService.getIslogout(bdcdyh);
if (regbaseh == null || regbaseh.getId() == null) {
throw new ServiceException("系统未找到不动产单元号[bdcdyh]对应的户基本信息");
}
RegBusRights regBusRights = regBusRightsService.getByBdcdyh(bdcdyh);
if (!"0".equals(regbaseh.getIsyiyi())) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]处于异议状态");
}
if (!"0".equals(regbaseh.getIschafeng())) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]处于查封状态");
}
if ("0".equals(regbaseh.getRights())) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]处于无权利状态");
}
if (StringUtils.isNotBlank(regBusRights.getStxq())) {
throw new ServiceException("不动产信息[bdcxx]中不动产单元号[bdcdyh]处于抵押状态");
}
String fybh = getValueByMap(bdcxxMap, "fybh", "");
if (StringUtils.isBlank(fybh)) {
throw new ServiceException("不动产信息[bdcxx]中房源编号[fybh]不能为空");
}
String jgrq = getValueByMap(bdcxxMap, "jgsj", "");
if (StringUtils.isBlank(jgrq)) {
throw new ServiceException("不动产信息[bdcxx]中竣工时间[jgsj]不能为空");
}
if (!DatatypeUtil.isDate(jgrq)) {
throw new ServiceException("不动产信息[bdcxx]中竣工时间[jgsj]格式错误,建议格式 yyyy-MM-dd");
}
String fwyt = getValueByMap(bdcxxMap, "fwyt", "");
if (StringUtils.isBlank(fwyt)) {
throw new ServiceException("不动产信息[bdcxx]中房屋用途[fwyt]不能为空");
}
String fwjg = getValueByMap(bdcxxMap, "fwjg", "");
if (StringUtils.isBlank(fwjg)) {
throw new ServiceException("不动产信息[bdcxx]中房屋结构[fwjg]不能为空");
}
String fwxz = getValueByMap(bdcxxMap, "fwxz", "");
if (StringUtils.isBlank(fwxz)) {
throw new ServiceException("不动产信息[bdcxx]中房屋性质[fwxz]不能为空");
}
String zcs = getValueByMap(bdcxxMap, "zcs", "0");
if (StringUtils.isBlank(zcs)) {
throw new ServiceException("不动产信息[bdcxx]中总层数[zcs]不能为空");
}
if (!DatatypeUtil.isInteger(zcs)) {
throw new ServiceException("不动产信息[bdcxx]中总层数[zcs]格式错误");
}
int zcs_int = Integer.parseInt(zcs);
String djxxbz = getValueByMap(bdcxxMap, "bz", "");
String ywh = regBusSlsq.getYwh();
if (StringUtils.isBlank(ywh)) {
throw new ServiceException("受理申请[ywh:业务号]信息不能为空");
}
String djxl = getValueByMap(data, "sqlxdm", "").trim().substring(0, 3);
String djdl = (Integer.parseInt(djxl.substring(0, 1)) - 1) + "00";
String zl = getValueByMap(bdcxxMap, "zl", "");
String qllx = "4";
List ywrlst = Lists.newArrayList();
List qlrlst = Lists.newArrayList();
// 清空该业务对应的权利人表,义务人表信息
if (StringUtils.isNotBlank(ywh)) {
// 权利人信息删除
regBusQlrService.deleteywh(ywh);
// 义务人信息删除
RegBusYwr regBusYwr = new RegBusYwr();
regBusYwr.setYwh(ywh);
regBusYwrService.deleteywr(regBusYwr);
// 删除附件
RegBusSjmain main = new RegBusSjmain();
main.setYwh(ywh);
List<RegBusSjmain> mainLst = regBusSjmainService.findByYwh(ywh);
for (RegBusSjmain m : mainLst) {
regBusSjmainService.deletesjchild(m);
regBusSjmainService.delete(m);
}
}
saveFjFiles(cjsj_str, cjsj, sjclxxlst, ywh);
List<Integer> ywr_sxh_s = Lists.newArrayList();
List<Integer> qlr_sxh_s = Lists.newArrayList();
List<String> qlrmc_s = Lists.newArrayList();
RegBusQlr first_qlr = new RegBusQlr();
String qlr_gyfs = "";
for (Map rxrmap : gxrxxlst) {
if (rxrmap == null) {
continue;
}
String gxrmc = getValueByMap(rxrmap, "gxrmc", "");
String gxrlx = getValueByMap(rxrmap, "gxrlx", "");
String gxrzjzl = getValueByMap(rxrmap, "gxrsfzjzl", "");
String gxrzjh = getValueByMap(rxrmap, "gxrzjh", "");
if (StringUtils.isBlank(gxrmc.trim())) {
throw new ServiceException("关系人信息[gxrxx]的关系人姓名[gxrmc]不能为空");
}
if (StringUtils.isBlank(gxrlx.trim())) {
throw new ServiceException("关系人信息[gxrxx]的关系人类型[gxrlx]不能为空");
}
if (StringUtils.isBlank(gxrzjzl.trim())) {
throw new ServiceException("关系人信息[gxrxx]的关系人身份证件种类[gxrsfzjzl]不能为空");
}
if (StringUtils.isBlank(gxrzjh.trim())) {
throw new ServiceException("关系人信息[gxrxx]的关系人证件号[gxrzjh]不能为空");
}
String gyqk = getValueByMap(rxrmap, "gyqk", "");
String gyfs = getValueByMap(rxrmap, "gyfs", "");
if (StringUtils.isBlank(gyfs)) {
throw new ServiceException("关系人信息[gxrxx]的共有方式[gyfs]不能为空");
}
if (!DatatypeUtil.validateGyqk(gyfs, gyqk)) {
throw new ServiceException("关系人信息[gxrxx]的共有方式[gyfs]与共有情况[gyqk]不匹配");
}
String gxrlxdh = getValueByMap(rxrmap, "gxrlxdh", "");
String gxrtxdz = getValueByMap(rxrmap, "gxrtxdz", "");
String qlbl = getValueByMap(rxrmap, "qlbl", "");
RegBasePerson person = new RegBasePerson();
person.setRymc(gxrmc);
person.setZjzl(gxrzjzl);//
person.setZjh(gxrzjh);//
getPerson(person);
person.setDh(gxrlxdh);//
person.setDz(gxrtxdz);//
person.setDlrymc(getValueByMap(rxrmap, "gxrfddbr", ""));//
person.setDlrydh(getValueByMap(rxrmap, "gxrdlrdh", ""));//
person.setDljg(getValueByMap(rxrmap, "gxrfddbr", ""));//
// 1 个人 2 企业
person.setRylx("1");//
person.setIsaudit("2");//
person.setCreateBy(localUser);
person.setCreateDate(new Date());
person.setUpdateBy(localUser);
person.setUpdateDate(new Date());
person.setRemarks("一窗受理");//
person.setDelFlag("0");
// 发证机构 未找到,默认 汉中市不动产登记局
person.setFzjg("汉中市不动产登记局");//
person.setIdimgpers(null);//
person.setGj("142");//
// 户籍所在省市 未传输 暂为空
person.setHjszss("");//
person.setXb("");//
person.setBz("");//
person.setYb("");//
person.setGzdw("");//
person.setDzyj("");//
// 所属行业 未传输 空
person.setSshy("");//
regBasePersonService.save(person);
String sxh = getValueByMap(rxrmap, "sxh", "");
Integer int_sxh = null;
if (DatatypeUtil.isInteger(sxh)) {
int_sxh = Integer.parseInt(sxh);
} else {
throw new ServiceException("关系人信息[gxrxx]的顺序号[sxh]格式错误,必须为正整数");
}
switch (gxrlx) {
case "ywr":
RegBusYwr ywr = new RegBusYwr();
if (ywr_sxh_s.contains(int_sxh)) {
throw new ServiceException("关系人信息[gxrxx]的义务人顺序号[sxh]错误,内容重复");
}
ywr_sxh_s.add(int_sxh);
ywr.setYwh(ywh);
ywr.setBdcdyh(bdcdyh);
ywr.setSxh(sxh);
ywr.setQlrmc(person.getRymc());
ywr.setPcode(person.getPcode());
ywr.setZjzl(person.getZjzl());//
ywr.setZjh(person.getZjh());//
ywr.setDh(person.getDh());//
ywr.setDz(person.getDz());//
// 1 个人 2 企业
ywr.setQlrlx(person.getRylx());//
ywr.setQlbl(qlbl);//
ywr.setGyfs(gyfs);//
ywr.setGyqk(gyqk);//
ywr.setDlrmc(getValueByMap(rxrmap, "gxrfddbr", ""));//
ywr.setDlrdh(getValueByMap(rxrmap, "gxrdlrdh", ""));//
ywr.setDljgmc(getValueByMap(rxrmap, "gxrfddbr", ""));//
ywr.setQllx(qllx);//
// 发证机构 未找到,默认 汉中市不动产登记局
ywr.setFzjg("汉中市不动产登记局");//
ywr.setRemarks("一窗受理");//
ywr.setQszt("0");//
ywr.setGj("142");
ywr.setSfczr("1");//
ywr.setYsdm("6003000000");//
ywr.setCreateBy(localUser);
ywr.setCreateDate(new Date());
ywr.setUpdateBy(localUser);
ywr.setUpdateDate(new Date());
ywr.setDelFlag("0");
// 户籍所在省市 未传输 暂为空
ywr.setHjszss("");//
ywr.setFddbrfzr("");//
ywr.setFddbrfzrdh("");//
ywr.setXb("");//
ywr.setYb("");//
ywr.setGzdw("");//
ywr.setDzyj("");//
ywr.setBz("");//
// 所属行业 未传输 空
ywr.setSshy("");//
// 不动产权证号,登簿后回填
ywr.setBdcqzh("");
regBusYwrService.save(ywr);
ywrlst.add(ywr);
break;
case "qlr":
RegBusQlr qlr = new RegBusQlr();
if (qlr_sxh_s.contains(int_sxh)) {
throw new ServiceException("关系人信息[gxrxx]的权利人顺序号[sxh]错误,内容重复");
}
if (!"".equals(qlr_gyfs) && !qlr_gyfs.equals(gyfs)) {
throw new ServiceException("关系人信息[gxrxx]的权利人共有方式[gyfs]不一致");
}
qlr_gyfs = gyfs;
qlr.setQllx(qllx);//
qlr.setYwh(ywh);//
qlr.setBdcdyh(bdcdyh);//
qlr.setSxh(int_sxh);//
qlr.setQlrmc(person.getRymc());//
qlr.setPcode(person.getPcode());//
qlr.setZjzl(person.getZjzl());//
qlr.setZjh(person.getZjh());//
qlr.setGyfs(gyfs);//
qlr.setGyqk(gyqk);//
qlr.setDh(person.getDh());//
qlr.setDz(person.getDz());//
qlr.setQlbl(qlbl);//
qlr.setDlrmc(getValueByMap(rxrmap, "gxrfddbr", ""));//
qlr.setDlrdh(getValueByMap(rxrmap, "gxrdlrdh", ""));//
qlr.setDljgmc(getValueByMap(rxrmap, "gxrfddbr", ""));//
qlr.setYsdm("6003000000");//
// 1 个人 2 企业
qlr.setQlrlx("1");//
qlr.setQszt("0");//
// 发证机构 未找到,默认 汉中市不动产登记局
qlr.setFzjg("汉中市不动产登记局");//
qlr.setGj("142");//
qlr.setSfczr("1");//
qlr.setRemarks("一窗受理");//
qlr.setCreateBy(localUser);
qlr.setCreateDate(new Date());
qlr.setUpdateBy(localUser);
qlr.setUpdateDate(new Date());
qlr.setDelFlag("0");
// 不动产权证号,登簿后回填
qlr.setBdcqzh("");
qlr.setFddbrfzr("");//
qlr.setFddbrfzrdh("");//
qlr.setBz("");//
qlr.setYb("");//
qlr.setGzdw("");//
qlr.setDzyj("");//
qlr.setHjszss("");//
qlr.setXb("");//
// 所属行业 未传输 空
qlr.setSshy("");//
regBusQlrService.save(qlr);
// 取出第一权利人
if ("1".equals(getValueByMap(rxrmap, "sxh", ""))) {
first_qlr = qlr;
}
qlrmc_s.add(person.getRymc());
qlrlst.add(qlr);
break;
default:
throw new ServiceException("节点gxrxx中的字段gxrlx格式错误");
}
}
// 验证义务人、权利人顺序号
if (!DatatypeUtil.validateSxh(ywr_sxh_s)) {
throw new ServiceException("关系人信息[gxrxx]的义务人顺序号[sxh]错误,顺序号不连续");
}
if (!DatatypeUtil.validateSxh(qlr_sxh_s)) {
throw new ServiceException("关系人信息[gxrxx]的权利人顺序号[sxh]错误,顺序号不连续");
}
// 单独共有时,只能有一个权利人
if ("0".equals(qlr_gyfs) && qlr_sxh_s.size() > 1) {
throw new ServiceException("关系人信息[gxrxx]的存在多个权利人,共有方式[gyfs]错误");
} else if (!"0".equals(qlr_gyfs) && qlr_sxh_s.size() <= 1) {
throw new ServiceException("关系人信息[gxrxx]的存在单个权利人,共有方式[gyfs]错误");
}
String dyh = getValueByMap(bdcxxMap, "dyh", "");
if (StringUtils.isBlank(dyh)) {
throw new ServiceException("不动产信息[bdcxx]中单元号[dyh]不能为空");
}
String cx = getValueByMap(bdcxxMap, "cx", "0");
String cgzk = getValueByMap(bdcxxMap, "cgzk", "0");
// 更新户信息
regbaseh.setFybh(fybh);
regbaseh.setBtfwbm(fybh);
regbaseh.setDyh(dyh);
regbaseh.setCgzk(cgzk);
regbaseh.setCx(cx);
regBaseHService.save(regbaseh);
RegBaseZdjbxx zdjbxx = new RegBaseZdjbxx();
zdjbxx.setZddm(bdcdyh.substring(0, 19));
zdjbxx.setIslogout("0");
List<RegBaseZdjbxx> zdjbxxlst = regBaseZdjbxxService.findList(zdjbxx);
if (zdjbxxlst == null || zdjbxxlst.size() <= 0) {
throw new ServiceException("系统未找到不动产单元号[bdcdyh]对应的宗地基本信息");
}
zdjbxx = zdjbxxlst.get(0);
RegBusBdcqzsdjxx dj = new RegBusBdcqzsdjxx();
dj.setBdcdyh(bdcdyh);
dj.setIslogout("01");
dj.setDbsj("NOTNULL");
dj.setRights("1");
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findhttpList(dj);
if (djxxlist.size() > 0) {
dj = djxxlist.get(0);
} else {
throw new ServiceException("系统未找到不动产单元号[bdcdyh]对应的不动产权证书登记信息");
}
RegBusJsydsyq jsydsyq = getJsydsyq(bdcdyh);
RegBusFdcq2 fdcq2 = new RegBusFdcq2();
fdcq2.setYwh(regBusSlsq.getYwh());
fdcq2.setBdcdyh(bdcdyh);
List<RegBusFdcq2> fdcq2lst = regBusFdcq2Service.findList(fdcq2);
if (fdcq2lst.size() > 0) {
fdcq2 = fdcq2lst.get(0);
if (jsydsyq != null) {
fdcq2.setTdsyjssj(jsydsyq.getSyqjssj());
fdcq2.setTdsyqssj(jsydsyq.getSyqqssj());
}
fdcq2.setJgsj(jgrq);
fdcq2.setDjlx(djdl);//
fdcq2.setDjyy("转移登记");//
fdcq2.setFdzl(zl);//
fdcq2.setTdsyqr(StringUtils.join(qlrmc_s, ";"));
fdcq2.setGhyt(fwyt);
fdcq2.setFwxz(fwxz);
fdcq2.setFwjg(fwjg);
fdcq2.setZcs(zcs_int);
fdcq2.setYbdcqzh(dj.getBdcqzh());//
fdcq2.setQxdm(Global.getAreaCode());
// 宗地分摊方式 1共用
fdcq2.setZdftfs("1");
fdcq2.setDjjg(null);//
fdcq2.setDbr(null);//
fdcq2.setDjsj(null);//
fdcq2.setFj(null);//
fdcq2.setQszt("0");//
fdcq2.setCqly(null);//
fdcq2.setYwxl(qllx);//
fdcq2.setHtbh(getValueByMap(htxxmap, "htbh", ""));
fdcq2.setCreateBy(localUser);
fdcq2.setCreateDate(new Date());
fdcq2.setUpdateBy(localUser);
fdcq2.setUpdateDate(new Date());
fdcq2.setRemarks("一窗受理");//
fdcq2.setDelFlag("0");
fdcq2.setDytdmj(0d);//
fdcq2.setFttdmj(regbaseh.getFttdmj());//
fdcq2.setFdcjyjg(Double.parseDouble(getValueByMap(htxxmap, "pgjg", "0")));//
fdcq2.setJzmj(Double.parseDouble(getValueByMap(bdcxxMap, "jzmj", "0")));//
fdcq2.setZyjzmj(Double.parseDouble(getValueByMap(bdcxxMap, "tnmj", "0")));//
fdcq2.setFtjzmj(fdcq2.getJzmj() - fdcq2.getZyjzmj());//
fdcq2.setYtmc(DictUtils.getDictLabel(getValueByMap(htxxmap, "fwyt", ""), "reg_bus_fwyt", ""));//
fdcq2.setFwxzmc(DictUtils.getDictLabel(getValueByMap(htxxmap, "fwxz", ""), "reg_bus_fwxz", ""));//
fdcq2.setSzc(getValueByMap(bdcxxMap, "szc", ""));//
fdcq2.setQlxz(zdjbxx.getQlxz());//
fdcq2.setZdmj(zdjbxx.getZdmj());//
fdcq2.setId(IdGen.uuid());//
fdcq2.setYsdm("6002030100");//
fdcq2.setBdcdyh(bdcdyh);//
fdcq2.setYwh(ywh);//
fdcq2.setQllx("4");//
// 不动产权证号,登簿后回填
fdcq2.setBdcqzh("");//
regBusFdcq2Service.save(fdcq2);
} else {
if (jsydsyq != null) {
fdcq2.setTdsyjssj(jsydsyq.getSyqjssj());
fdcq2.setTdsyqssj(jsydsyq.getSyqqssj());
}
fdcq2.setJgsj(jgrq);
fdcq2.setDjlx(djdl);//
fdcq2.setDjyy("转移登记");//
fdcq2.setFdzl(zl);//
fdcq2.setTdsyqr(StringUtils.join(qlrmc_s, ";"));
fdcq2.setGhyt(fwyt);
fdcq2.setFwxz(fwxz);
fdcq2.setFwjg(fwjg);
fdcq2.setZcs(zcs_int);
fdcq2.setYbdcqzh(dj.getBdcqzh());//
fdcq2.setQxdm(Global.getAreaCode());
// 宗地分摊方式 1共用
fdcq2.setZdftfs("1");
fdcq2.setDjjg(null);//
fdcq2.setDbr(null);//
fdcq2.setDjsj(null);//
fdcq2.setFj(null);//
fdcq2.setQszt("0");//
fdcq2.setCqly(null);//
fdcq2.setYwxl(qllx);//
fdcq2.setHtbh(getValueByMap(htxxmap, "htbh", ""));
fdcq2.setCreateBy(localUser);
fdcq2.setCreateDate(new Date());
fdcq2.setUpdateBy(localUser);
fdcq2.setUpdateDate(new Date());
fdcq2.setRemarks("一窗受理");//
fdcq2.setDelFlag("0");
fdcq2.setDytdmj(0d);//
fdcq2.setFttdmj(regbaseh.getFttdmj());//
fdcq2.setFdcjyjg(Double.parseDouble(getValueByMap(htxxmap, "pgjg", "0")));//
fdcq2.setJzmj(Double.parseDouble(getValueByMap(bdcxxMap, "jzmj", "0")));//
fdcq2.setZyjzmj(Double.parseDouble(getValueByMap(bdcxxMap, "tnmj", "0")));//
fdcq2.setFtjzmj(fdcq2.getJzmj() - fdcq2.getZyjzmj());//
fdcq2.setYtmc(DictUtils.getDictLabel(getValueByMap(htxxmap, "fwyt", ""), "reg_bus_fwyt", ""));//
fdcq2.setFwxzmc(DictUtils.getDictLabel(getValueByMap(htxxmap, "fwxz", ""), "reg_bus_fwxz", ""));//
fdcq2.setSzc(getValueByMap(bdcxxMap, "szc", ""));//
fdcq2.setQlxz(zdjbxx.getQlxz());//
fdcq2.setZdmj(zdjbxx.getZdmj());//
fdcq2.setId(IdGen.uuid());//
fdcq2.setYsdm("6002030100");//
fdcq2.setBdcdyh(bdcdyh);//
fdcq2.setYwh(ywh);//
fdcq2.setQllx("4");//
// 不动产权证号,登簿后回填
fdcq2.setBdcqzh("");//
regBusFdcq2Dao.insert(fdcq2);
}
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setYwh(regBusSlsq.getYwh());
List<RegBusBdcqzsdjxx> djxxlst = regBusBdcqzsdjxxService.findList(djxx);
if (djxxlst.size() > 0) {
djxx = djxxlst.get(0);
djxx.setIsprint("0");//
djxx.setRights("1");//
djxx.setCreateBy(localUser);
djxx.setCreateDate(new Date());
djxx.setUpdateBy(localUser);
djxx.setUpdateDate(new Date());
djxx.setRemarks("一窗受理");//
djxx.setDelFlag("0");
djxx.setOldid(dj.getId());//
djxx.setBdcqzbh(null);//
djxx.setYsxlh(null);//
djxx.setDbsj(null);//
djxx.setQlrmc(first_qlr.getQlrmc());//
djxx.setGyqk(DictUtils.getDictLabel(qlr_gyfs, "reg_bus_gyfs", ""));//
djxx.setZl(zl);//
djxx.setZddm(zdjbxx.getZddm());//
djxx.setBdcdyh(bdcdyh);//
djxx.setQlxz(DictUtils.getDictLabel(fdcq2.getQlxz(), "reg_bus_qlxz", "") + "/"
+ DictUtils.getDictLabel(fdcq2.getFwxz(), "reg_bus_fwxz", ""));
djxx.setYt(zdjbxx.getYt() + "/" + DictUtils.getDictLabel(fdcq2.getGhyt(), "reg_bus_fwyt", ""));
djxx.setMj(regbaseh.getScjzmj() + "");
// 一窗受理未传输, 暂空
djxx.setSyqx(null);//
StringBuffer sb = new StringBuffer();
sb.append("分摊土地使用权面积:").append(RegUtils.replaceNull(regbaseh.getFttdmj())).append(";").append("房屋结构:")
.append(RegUtils.replaceNull(DictUtils.getDictLabel(fdcq2.getFwjg(), "reg_bus_fwjg", "")))
.append(";").append("专有建筑面积:").append(RegUtils.replaceNull(fdcq2.getZyjzmj())).append(";")
.append("分摊建筑面积:").append(fdcq2.getFtjzmj()).append(";").append("房屋总层数:")
.append(RegUtils.replaceNull(fdcq2.getZcs())).append(";").append("所在层数:")
.append(RegUtils.replaceNull(fdcq2.getSzc())).append(";").append("房屋竣工时间:")
.append(RegUtils.replaceNull(fdcq2.getJgsj())).append(";").append("共有情况:")
.append(RegUtils.replaceNull(djxx.getGyqk())).append(";");
djxx.setQlqtzk(sb.toString());//
djxx.setFj(djxxbz);//
djxx.setDydjxx(null);//
djxx.setJcdydjxx(null);//
djxx.setCfqk(null);//
djxx.setJccf(null);//
djxx.setTh(null);//
djxx.setPwh(null);//
djxx.setHbjk(null);//
djxx.setHbhth(null);//
djxx.setFzsj(null);//
djxx.setZzsj(null);//
djxx.setDjlx(djxl);//
djxx.setStatus("2");//
djxx.setIslogout("0");//
djxx.setIsfdsj(0);//
djxx.setIshistory("0");//
// 不动产权证号,登簿后回填
djxx.setBdcqzh("");//
regBusBdcqzsdjxxService.save(djxx);
} else {
djxx.setIsprint("0");//
djxx.setRights("1");//
djxx.setCreateBy(localUser);
djxx.setCreateDate(new Date());
djxx.setUpdateBy(localUser);
djxx.setUpdateDate(new Date());
djxx.setRemarks("一窗受理");//
djxx.setDelFlag("0");
djxx.setOldid(dj.getId());//
djxx.setYwh(ywh);//
djxx.setBdcqzbh(null);//
djxx.setYsxlh(null);//
djxx.setDbsj(null);//
djxx.setQlrmc(first_qlr.getQlrmc());//
djxx.setGyqk(DictUtils.getDictLabel(qlr_gyfs, "reg_bus_gyfs", ""));//
djxx.setZl(zl);//
djxx.setZddm(zdjbxx.getZddm());//
djxx.setBdcdyh(bdcdyh);//
djxx.setQllx("4");//
djxx.setQlxz(DictUtils.getDictLabel(fdcq2.getQlxz(), "reg_bus_qlxz", "") + "/"
+ DictUtils.getDictLabel(fdcq2.getFwxz(), "reg_bus_fwxz", ""));
djxx.setYt(zdjbxx.getYt() + "/" + DictUtils.getDictLabel(fdcq2.getGhyt(), "reg_bus_fwyt", ""));
djxx.setMj(regbaseh.getScjzmj() + "");
// 一窗受理未传输, 暂空
djxx.setSyqx(null);//
StringBuffer sb = new StringBuffer();
sb.append("分摊土地使用权面积:").append(RegUtils.replaceNull(regbaseh.getFttdmj())).append(";").append("房屋结构:")
.append(RegUtils.replaceNull(DictUtils.getDictLabel(fdcq2.getFwjg(), "reg_bus_fwjg", "")))
.append(";").append("专有建筑面积:").append(RegUtils.replaceNull(fdcq2.getZyjzmj())).append(";")
.append("分摊建筑面积:").append(fdcq2.getFtjzmj()).append(";").append("房屋总层数:")
.append(RegUtils.replaceNull(fdcq2.getZcs())).append(";").append("所在层数:")
.append(RegUtils.replaceNull(fdcq2.getSzc())).append(";").append("房屋竣工时间:")
.append(RegUtils.replaceNull(fdcq2.getJgsj())).append(";").append("共有情况:")
.append(RegUtils.replaceNull(djxx.getGyqk())).append(";");
djxx.setQlqtzk(sb.toString());//
djxx.setFj(djxxbz);//
djxx.setDydjxx(null);//
djxx.setJcdydjxx(null);//
djxx.setCfqk(null);//
djxx.setJccf(null);//
djxx.setTh(null);//
djxx.setPwh(null);//
djxx.setHbjk(null);//
djxx.setHbhth(null);//
djxx.setFzsj(null);//
djxx.setZzsj(null);//
djxx.setDjlx(djxl);//
djxx.setStatus("2");//
djxx.setIslogout("0");//
djxx.setIsfdsj(0);//
djxx.setIshistory("0");//
// 不动产权证号,登簿后回填
djxx.setBdcqzh("");//
regBusBdcqzsdjxxService.save(djxx);
}
regBusSlsq.setYsdm("2004010000");//
regBusSlsq.setSqfbcz(data.get("sffbcz") == null ? 0 : Integer.parseInt(data.get("sffbcz").toString()));//
regBusSlsq.setSlry(cjr);//
regBusSlsq.setSlsj(cjsj);
regBusSlsq.setZl(zl);//
regBusSlsq.setTaskdefkey("reg_start");//
regBusSlsq.setTzrdh(first_qlr.getDh());//
regBusSlsq.setTzryddh(first_qlr.getDh());//
regBusSlsq.setJssj(new Date());//
regBusSlsq.setBz(sqbz);
regBusSlsq.setTzrxm(first_qlr.getQlrmc());//
regBusSlsq.setFybh(getValueByMap(bdcxxMap, "fybh", ""));
regBusSlsq.setUpdateBy(localUser);
regBusSlsq.setUpdateDate(new Date());
regBusSlsq.setDelFlag("0");//
regBusSlsq.setProid(getValueByMap(data, "proid", ""));
Map maptaskact = Maps.newHashMap();
maptaskact.put("procInsId", regBusSlsq.getProcInsId());
Map<String, Object> taskmap = regBusSlsqService.taskactinfo(maptaskact);
Act act = regBusSlsq.getAct();
if (act == null) {
act = new Act();
regBusSlsq.setAct(act);
}
act.setFlag("yes");
act.setTaskId(taskmap.get("ID_").toString());
act.setTaskName(taskmap.get("NAME_").toString());
act.setTaskDefKey(taskmap.get("TASK_DEF_KEY_").toString());
act.setProcInsId(regBusSlsq.getProcInsId());
act.setProcDefId(taskmap.get("PROC_DEF_ID_").toString());
regBusSlsqService.save(regBusSlsq);
}
/**
* 流程自动启动从受理环节自动提交到审核环节 2018-10-18
*/
public void commimtslsq(RegBusSlsq slsq) {
// 提交初审
slsq.setTaskdefkey("reg_audit");
slsq.setSlsj(new Date());
Map maptaskact = Maps.newHashMap();
maptaskact.put("procInsId", slsq.getProcInsId());
Map<String, Object> taskmap = regBusSlsqService.taskactinfo(maptaskact);
Act act = slsq.getAct();
if (act == null) {
act = new Act();
slsq.setAct(act);
}
act.setFlag("yes");
act.setTaskId(taskmap.get("ID_").toString());
act.setTaskName(taskmap.get("NAME_").toString());
act.setTaskDefKey(taskmap.get("TASK_DEF_KEY_").toString());
act.setProcInsId(slsq.getProcInsId());
act.setProcDefId(taskmap.get("PROC_DEF_ID_").toString());
regBusSlsqService.save(slsq);
// regBusSlsqService.auditSave(slsq);
}
private String getValueByMap(Map map, String key, String value) {
return map.get(key) == null ? value : map.get(key).toString();
}
/***
* @Title: getpcode @Description: 获取并生成业务号 @param @return 设定文件 @return String
* 返回类型 @throws
*/
private String getpcode() {
String pCode = "1000000";
pCode = RegUtils.getHMaxFwbm(regBasePersonService.getHMaxPCode());// 没有的时候返回100000,然后+1最为第一笔
return pCode;
}
/**
* 一窗受理接口系统查询最后一笔有效的房屋所有权信息
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public RegBusBdcqzsdjxx bdcqsdjxx(String bdcdyh) throws JsonParseException, JsonMappingException, IOException {
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setBdcdyh(bdcdyh);
djxx.setIslogout("01");
djxx.setDbsj("NOTNULL");
djxx.setRights("1");
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findhttpList(djxx);
if (djxxlist.size() > 0) {
djxx = djxxlist.get(0);
} else {
djxx = null;
}
return djxx;
}
/**
* 一窗受理接口系统查询房屋所有权权属信息
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public Map fdcq2map(RegBusBdcqzsdjxx djxxinfo, String ywh, String proid)
throws JsonParseException, JsonMappingException, IOException {
Map<String, Object> fdcq2map = new HashMap<String, Object>();
// 查询权属信息
RegBaseH regbaseh = regBaseHService.getdy(djxxinfo.getBdcdyh());
RegBusFdcq2 fdcq2 = new RegBusFdcq2();
fdcq2.setBdcdyh(djxxinfo.getBdcdyh());
fdcq2.setYwh(ywh);
List<RegBusFdcq2> fdcq2list = regBusFdcq2Service.findList(fdcq2);
if (fdcq2list.size() > 0 && regbaseh != null) {
fdcq2 = fdcq2list.get(0);
// 查询宗地信息
RegBaseZdjbxx zdxx = new RegBaseZdjbxx();
zdxx.setZddm(djxxinfo.getBdcdyh().substring(0, 19));
zdxx.setIslogout("0");
List<RegBaseZdjbxx> zdlst = regBaseZdjbxxService.findList(zdxx);
if (zdlst.size() > 0) {
zdxx = zdlst.get(0);
fdcq2map.put("zdzhyt", "071");
fdcq2map.put("zdzhqlxz", zdxx.getQlxz());
fdcq2map.put("zdzhmj", zdxx.getZdmj());
}
fdcq2map.put("bdcdyh", djxxinfo.getBdcdyh());
fdcq2map.put("cqzh", djxxinfo.getBdcqzh());
fdcq2map.put("proid", proid);
fdcq2map.put("bdclx", "TDFW");
if (fdcq2.getGhyt().length() == 3 && fdcq2.getGhyt().startsWith("80")) {
fdcq2map.put("dzwyt", "80");
} else {
fdcq2map.put("dzwyt", fdcq2.getGhyt());
}
fdcq2map.put("zl", djxxinfo.getZl());
fdcq2map.put("dzwmj", djxxinfo.getMj());
fdcq2map.put("xzqhszdm", Global.getAreaCode());
fdcq2map.put("jdxzdm", "");
fdcq2map.put("fwxz", fdcq2.getFwxz());
fdcq2map.put("fwjg", fdcq2.getFwjg());
fdcq2map.put("szc", fdcq2.getSzc());
fdcq2map.put("zcs", fdcq2.getZcs());
fdcq2map.put("wlc", regbaseh.getSjcs());
fdcq2map.put("fwlx", regbaseh.getFwlx());
fdcq2map.put("szmyc", fdcq2.getSzc());
fdcq2map.put("cg", "0");
fdcq2map.put("zrzh", regbaseh.getZrzh());
fdcq2map.put("dyh", "无");
fdcq2map.put("fjh", regbaseh.getShbw());
fdcq2map.put("jzmj", regbaseh.getScjzmj());
fdcq2map.put("tnmj", regbaseh.getSctnjzmj());
fdcq2map.put("cx", "");
fdcq2map.put("jgsj", fdcq2.getJgsj());
if (StringUtils.isNotBlank(fdcq2.getJgsj())) {
fdcq2map.put("jznf", fdcq2.getJgsj().substring(0, 4));
} else {
fdcq2map.put("jznf", "");
}
fdcq2map.put("bz", djxxinfo.getFj());
fdcq2map.put("bdcdybh", "");
} else {
fdcq2map = null;
}
return fdcq2map;
}
/**
* 一窗受理接口系统查询房屋所有权利人信息
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public List qlrlist(RegBusBdcqzsdjxx djxx, String bdcdyh, String ywh)
throws JsonParseException, JsonMappingException, IOException {
ArrayList<Map> qlrinfoList = new ArrayList<Map>();
Map<String, Object> map = new HashMap<String, Object>();
// 查询权利人信息
RegBusQlr qlr = new RegBusQlr();
qlr.setYwh(ywh);
List<RegBusQlr> qlrlist = regBusQlrService.findListSxh(qlr);
if (qlrlist.size() > 0) {
for (int i = 0; i < qlrlist.size(); i++) {
Map<String, Object> qlrmap = new HashMap<String, Object>();
qlr = qlrlist.get(i);
qlrmap.put("gxrmc", qlr.getQlrmc());
qlrmap.put("gxrsfzjzl", qlr.getZjzl());
qlrmap.put("gxrzjh", qlr.getZjh());
qlrmap.put("gxrtxdz", qlr.getDz());
qlrmap.put("gxrlxdh", qlr.getDh());
qlrmap.put("qlbl", qlr.getQlbl());
qlrmap.put("gxrlx", qlr.getQlrlx());
qlrmap.put("gyfs", qlr.getGyfs());
qlrmap.put("sxh", qlr.getSxh());
qlrmap.put("scqdfwsj", djxx.getDbsj());
// 查询产权信息
RegBusFdcq2 fdcq2 = new RegBusFdcq2();
fdcq2.setBdcdyh(bdcdyh);
fdcq2.setYwh(ywh);
List<RegBusFdcq2> fdcq2list = regBusFdcq2Service.findList(fdcq2);
if (fdcq2list.size() > 0 && fdcq2 != null) {
fdcq2 = fdcq2list.get(0);
qlrmap.put("scqdfwfs", fdcq2.getCqly());
}
qlrmap.put("gxrfddbr", "");
qlrmap.put("gxrfddbrzjzl", "");
qlrmap.put("gxrfddbrzjh", "");
qlrmap.put("gxrdlr", "");
qlrmap.put("gxrdlrsfzjzl", "");
qlrmap.put("gxrdlrzjh", "");
qlrmap.put("gxrdlrdh", "");
qlrmap.put("bz", "");
qlrinfoList.add(qlrmap);
}
}
return qlrinfoList;
}
/**
* 一窗受理接口系统查询房屋所有异议登记信息
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public List yylist(String bdcdyh, String ywh) throws JsonParseException, JsonMappingException, IOException {
ArrayList<Map> yyList = new ArrayList<Map>();
Map<String, Object> yymap = new HashMap<String, Object>();
// 判断其是否已经有在在做的异议登记业务并且是未发证的
RegBusBdcqzsdjxx regBusBdcqzsdjxxnew = new RegBusBdcqzsdjxx();
regBusBdcqzsdjxxnew.setBdcdyh(bdcdyh);
regBusBdcqzsdjxxnew.setIslogout("0");// 未注销
regBusBdcqzsdjxxnew.setDjlx("703");
regBusBdcqzsdjxxnew.setRights("1");
List<RegBusBdcqzsdjxx> regBusBdcqzsdjxxlistnew = regBusBdcqzsdjxxService.findzyList(regBusBdcqzsdjxxnew);
if (regBusBdcqzsdjxxlistnew.size() > 0) {
regBusBdcqzsdjxxnew = regBusBdcqzsdjxxlistnew.get(0);
// 获取异议登记的信息
RegBusYydj yydj = new RegBusYydj();
yydj.setYwh(regBusBdcqzsdjxxnew.getYwh());
yydj.setBdcdyh(bdcdyh);
List<RegBusYydj> listYydj = regBusYydjService.findList(yydj);
if (listYydj != null && listYydj.size() > 0) {
yydj = listYydj.get(0);
yymap.put("bdcdybh", "");
yymap.put("bdcdyh", bdcdyh);
yymap.put("yysx ", yydj.getYysx());
yymap.put("djsj", "");
yymap.put("fj", yydj.getFj());
yyList.add(yymap);
}
}
return yyList;
}
/**
* 一窗受理接口系统查询房屋所有查封登记信息
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public List cflist(String bdcdyh, String ywh) throws JsonParseException, JsonMappingException, IOException {
ArrayList<Map> cfList = new ArrayList<Map>();
Map<String, Object> map = new HashMap<String, Object>();
// 判断其是否已经有在在做的异议登记业务并且是未发证的
RegBusBdcqzsdjxx regBusBdcqzsdjxxnew = new RegBusBdcqzsdjxx();
regBusBdcqzsdjxxnew.setBdcdyh(bdcdyh);
regBusBdcqzsdjxxnew.setIslogout("0");// 未注销
regBusBdcqzsdjxxnew.setDjlx("905");
List<RegBusBdcqzsdjxx> regBusBdcqzsdjxxlistnew = regBusBdcqzsdjxxService
.findhttpCfdjxxList(regBusBdcqzsdjxxnew);
if (regBusBdcqzsdjxxlistnew.size() > 0) {
for (int i = 0; i < regBusBdcqzsdjxxlistnew.size(); i++) {
Map<String, Object> cfmap = new HashMap<String, Object>();
regBusBdcqzsdjxxnew = regBusBdcqzsdjxxlistnew.get(i);
// 获取异议登记的信息
RegBusCfdj cfdj = new RegBusCfdj();
cfdj.setYwh(regBusBdcqzsdjxxnew.getYwh());
cfdj.setBdcdyh(bdcdyh);
List<RegBusCfdj> listCfdj = regBusCfdjService.findList(cfdj);
if (listCfdj != null && listCfdj.size() > 0) {
cfdj = listCfdj.get(0);
cfmap.put("bdcdybh", "");
cfmap.put("bdcdyh", bdcdyh);
cfmap.put("cfjg", cfdj.getCfjg());
cfmap.put("cflx", cfdj.getCflx());
cfmap.put("cfwh", cfdj.getCfwh());
cfmap.put("cfkssj", DateUtils.formatDate(cfdj.getCfqssj(), "yyyy/MM/dd HH:mm:ss"));
cfmap.put("cfjssj", DateUtils.formatDate(cfdj.getCfjssj(), "yyyy/MM/dd HH:mm:ss"));
cfmap.put("djsj", "");
cfmap.put("fj", cfdj.getFj());
cfList.add(cfmap);
}
}
}
return cfList;
}
/**
* 一窗受理接口系统查询房屋所有抵押登记信息
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public List dylist(String bdcdyh) throws JsonParseException, JsonMappingException, IOException {
ArrayList<Map> dylist = new ArrayList<Map>();
Map<String, Object> dymap = new HashMap<String, Object>();
RegBusRights rights = new RegBusRights();
rights.setBdcdyh(bdcdyh);
List<RegBusRights> rightlist = regBusRightsService.findList(rights);
if (rightlist.size() > 0) {
rights = rightlist.get(0);
}
if (rights != null) {
String ywh = "";
if (StringUtils.isNotBlank(rights.getXtxq())) {
ywh = rights.getXtxq();
}
if (StringUtils.isNotBlank(rights.getStxq())) {
ywh = rights.getStxq();
}
if (StringUtils.isNotBlank(ywh)) {
RegBusDyaq dyaq = new RegBusDyaq();
dyaq.setBdcdyh(bdcdyh);
dyaq.setYwh(ywh);
List<RegBusDyaq> dyaqlist = regBusDyaqService.findList(dyaq);
if (dyaqlist.size() > 0) {
dyaq = dyaqlist.get(0);
dymap.put("bdcdybh", "");
dymap.put("bdcdyh", bdcdyh);
dymap.put("bdcdjzmh", dyaq.getBdcdjzmh());
dymap.put("dyqr", dyaq.getDyqr());
if ("2".equals(dyaq.getDyfs())) {
dymap.put("dyje", dyaq.getZgzqse());
} else {
dymap.put("dyje", dyaq.getDbze());
}
dymap.put("dykssj", DateUtils.formatDate(dyaq.getZwlxqssj(), "yyyy/MM/dd HH:mm:ss"));
dymap.put("dyjssj", DateUtils.formatDate(dyaq.getZwlxjssj(), "yyyy/MM/dd HH:mm:ss"));
dymap.put("djsj", "");
dymap.put("fj", dyaq.getFj());
dylist.add(dymap);
}
}
}
return dylist;
}
/**
* 锁定信息
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
public List sdxxlist(String bdcdyh, List cflist, List yylist)
throws JsonParseException, JsonMappingException, IOException {
ArrayList<Map> sdxxlist = new ArrayList<Map>();
Map<String, Object> sdxxmap = new HashMap<String, Object>();
if (cflist.size() > 0) {
Map<String, Object> cfmap = (Map<String, Object>) cflist.get(0);
if (cfmap.size() > 0) {
sdxxmap.put("bdcdybh", "");
sdxxmap.put("bdcdyh", bdcdyh);
sdxxmap.put("sdyy", "房屋已查封");
sdxxmap.put("sdr", cfmap.get("cfjg"));
sdxxmap.put("sdsj", cfmap.get("cfkssj"));
}
} else {
if (yylist.size() > 0) {
Map<String, Object> yymap = (Map<String, Object>) yylist.get(0);
if (yymap.size() > 0) {
sdxxmap.put("bdcdybh", "");
sdxxmap.put("bdcdyh", bdcdyh);
sdxxmap.put("sdyy", "房屋已异议");
sdxxmap.put("sdr", "");
sdxxmap.put("sdsj", "");
}
}
}
sdxxlist.add(sdxxmap);
return sdxxlist;
}
/**
* 根据传入的证件类型 、号码、姓名 获取person
*/
private void getPerson(RegBasePerson person) {
List<RegBasePerson> personLst = regBasePersonService.findListqy(person);
if (personLst == null || personLst.size() <= 0) {
String pcode = getpcode();
person.setPcode(pcode);//
} else {
person = personLst.get(0);
}
}
/**
* 判断不动产单元号是否有正在办理的业务 存在 true 不存在 false
*/
private Boolean validateExistsBuss(String bdcdyh) {
RegBusBdcqzsdjxx temp = new RegBusBdcqzsdjxx();
temp.setBdcdyh(bdcdyh);
temp.setFzsj("ISNULL");
temp.setIslogout("02");
List<RegBusBdcqzsdjxx> listdjxxsd = regBusBdcqzsdjxxService.findSelectedList(temp);
if (listdjxxsd != null && listdjxxsd.size() > 0) {
return true;
}
return false;
}
private RegBusJsydsyq getJsydsyq(String bdcdyh) {
// 通过当前办理业务的单元号截取后去登记信息表中查找最后一位登记信息,再通过业务号去权利人表里找权利人信息,即
RegBusBdcqzsdjxx regBusBdcqzsdjxx_1 = new RegBusBdcqzsdjxx();
String bdcdyh_1 = bdcdyh.substring(0, 19) + "W";// 查找土地最后一笔业务
regBusBdcqzsdjxx_1.setBdcdyh(bdcdyh_1);
regBusBdcqzsdjxx_1.setIslogout("0");// 未注销
regBusBdcqzsdjxx_1.setDbsj("NOTNULL");// 已登簿
regBusBdcqzsdjxx_1.setRights("3");
List<RegBusBdcqzsdjxx> regBusBdcqzsdjxxlist = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx_1);
if (regBusBdcqzsdjxxlist.size() > 0) {
regBusBdcqzsdjxx_1 = regBusBdcqzsdjxxlist.get(0);
}
RegBusJsydsyq regBusJsydsyq = new RegBusJsydsyq();
regBusJsydsyq.setZddm(regBusBdcqzsdjxx_1.getZddm());
regBusJsydsyq.setDjlx("100");
List<RegBusJsydsyq> regBusJsydsyqlist = regBusJsydsyqService.findList(regBusJsydsyq);
if (regBusJsydsyqlist != null && regBusJsydsyqlist.size() > 0) {
return regBusJsydsyqlist.get(0);
}
return null;
}
private User getUserByName(String name) {
User user = UserUtils.getByLoginName(name);
if (user == null) {
user = new User("c16ac26c9bbf4bf8ab7432a8db04ea46");
}
return user;
}
public static void main(String[] args) {
System.out.println(DatatypeUtil.randomName("jpg"));
}
public List getfcxx(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
Map json = JsonUtil.fromJson(jsonstr, Map.class);
List list = (List) json.get("qlrList");
if (!json.containsKey("qlrList") && !json.containsKey("SPFHTH")) {
throw new BussException("请求参数有误");
}
List<Map> djxxList = regBusBdcqzsdjxxService.queryDjxxByQlrs(json);
List resList = Lists.newArrayList();
for (Map djxx : djxxList) {
Map djxx_map = Maps.newHashMap();
djxx_map.put("bdcdyh", djxx.get("BDCDYH"));
djxx_map.put("SPFHTH", djxx.get("FDCQ_HTBH") == null ? djxx.get("YGDJ_HTBH") : djxx.get("FDCQ_HTBH"));
djxx_map.put("fzrq", djxx.get("FZSJ"));
resList.add(djxx_map);
}
return resList;
}
public List getfzsj(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
Map json = JsonUtil.fromJson(jsonstr, Map.class);
json.put("rights", '1');
List<Map> djxxList = regBusBdcqzsdjxxService.queryBdcLsxxByQlrs(json);
List resList = Lists.newArrayList();
for (Map djxx : djxxList) {
Map djxx_map = Maps.newHashMap();
djxx_map.put("bdcdyh", djxx.get("BDCDYH"));
djxx_map.put("SPFHTH", djxx.get("FDCQ_HTBH") == null ? djxx.get("YGDJ_HTBH") : djxx.get("FDCQ_HTBH"));
djxx_map.put("fzrq", djxx.get("FZSJ"));
djxx_map.put("dbsj", djxx.get("DBSJ"));
resList.add(djxx_map);
}
return resList;
}
public void hookFybh(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
// TODO Auto-generated method stub
Map map = Maps.newHashMap();
Map maps = Maps.newHashMap();
Map json = JsonUtil.fromJson(jsonstr, Map.class);
String bdcdyh = json.containsKey("bdcdyh") && json.get("bdcdyh")!= null ? json.get("bdcdyh").toString():"无";
String fybh = json.containsKey("fybh") && json.get("fybh")!= null ? json.get("fybh").toString():"";
RegBaseH regBaseH = new RegBaseH();
regBaseH.setBdcdyh(bdcdyh);
regBaseH.setRights("012");
List<RegBaseH> list = regBaseHService.findAllList(regBaseH);
if(list== null || list.size()<=0) {
return;
}
regBaseH = list.get(0);
RegBaseH h = regBaseHService.get(regBaseH.getId());
h.setFybh(fybh);
h.setBtfwbm(fybh);
regBaseHService.save(h);
}
public void removeFybh(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
// TODO Auto-generated method stub
Map map = Maps.newHashMap();
Map maps = Maps.newHashMap();
Map json = JsonUtil.fromJson(jsonstr, Map.class);
String bdcdyh = json.containsKey("bdcdyh") && json.get("bdcdyh")!= null ? json.get("bdcdyh").toString():"无";
String fybh = json.containsKey("fybh") && json.get("fybh")!= null ? json.get("fybh").toString():"";
RegBaseH regBaseH = new RegBaseH();
regBaseH.setBdcdyh(bdcdyh);
regBaseH.setRights("012");
List<RegBaseH> list = regBaseHService.findAllList(regBaseH);
if(list== null || list.size()<=0) {
return;
}
regBaseH = list.get(0);
RegBaseH h = regBaseHService.get(regBaseH.getId());
h.setFybh("");
h.setBtfwbm("");
regBaseHService.save(h);
}
public Map getJyjgByCqzh(String jsonstr) throws JsonParseException, JsonMappingException, IOException {
// TODO Auto-generated method stub
Map map = Maps.newHashMap();
Map json = JsonUtil.fromJson(jsonstr, Map.class);
String cqzh = json.containsKey("CQZH") && json.get("CQZH")!= null ? json.get("CQZH").toString():"";
if (StringUtils.isEmpty(cqzh)) {
throw new BussException("请求参数有误");
}
Map params = Maps.newHashMap();
params.put("cqzh", cqzh);
List<Map> jyjgList = regBusBdcqzsdjxxService.queryJyjgByCqzh(params);
if(jyjgList != null && jyjgList.size() > 0) {
Map jyjg_map = jyjgList.get(0);
BigDecimal jyjg = jyjg_map.containsKey("FDCJYJG")&&jyjg_map.get("FDCJYJG")!= null? (new BigDecimal(jyjg_map.get("FDCJYJG").toString())).multiply(new BigDecimal("10000")):null;
map.put("scqdfwcb", jyjg == null?"": jyjg.toString());
map.put("scqdfwfs", DictUtils.getDictLabel(jyjg_map.get("CQLY").toString(), "reg_bus_cqly", ""));
}
return map;
}
public void getQxgx(String jsonstr) {
Map json = JsonUtil.fromJson(jsonstr, Map.class);
String bdcdyh = json.containsKey("bdcdyh") && json.get("bdcdyh")!= null ? json.get("bdcdyh").toString():"无";
String qfxh = json.containsKey("qfbh") && json.get("qfbh")!= null ? json.get("qfbh").toString():"";
String xfxh = json.containsKey("xfbh") && json.get("xfbh")!= null ? json.get("xfbh").toString():"";
RegBaseH h = new RegBaseH();
h.setBdcdyh(bdcdyh);
List<RegBaseH> list = regBaseHService.findAllList(h);
if(list== null || list.size()<=0) {
throw new BussException("信息有误");
}
for(int i =0 ;i<list.size();i++) {
h = list.get(i);
h.setFybh(xfxh);
h.setBtfwbm(xfxh);
regBaseHService.save(h);
}
}
}