c1800d39b3e91542ee87b72d7cf0f4f72665d638.svn-base
23.4 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
/**
* Copyright © 2015-2018 <a href="#">J-Site</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.reg.web.bus;
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.springframework.beans.BeanUtils;
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.servlet.mvc.support.RedirectAttributes;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseC;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseH;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseHbhqk;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBasePerson;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseSllm;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseSllmbhqk;
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.RegBusDyaq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusFdcq2;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisHouseBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisHouseQlr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisHouseYwr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisLqBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusLq;
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.RegBusYgdj;
import com.thinkgem.jeesite.modules.reg.service.base.RegBasePersonService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseSllmService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseSllmbhqkService;
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.RegBusHisHouseQlrService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusHisLqBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusLqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusQlrService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusRightsService;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;
/**
* 林权历史数据大表管理Controller
* @author lj
* @version 2017-04-15
*/
@Controller
@RequestMapping(value = "${adminPath}/reg/bus/regBusHisLqBdcqzsdjxx")
public class RegBusHisLqBdcqzsdjxxController extends BaseController {
@Autowired
private RegBusHisLqBdcqzsdjxxService regBusHisLqBdcqzsdjxxService;
@Autowired
private RegBaseSllmService regBaseSllmService;
@Autowired
private RegBaseZdjbxxService regBaseZdjbxxService;
@Autowired
private RegBusHisHouseQlrService regBusHisHouseQlrService;
@Autowired
private RegBusQlrService regBusQlrService;
@Autowired
private RegBasePersonService regBasePersonService;
@Autowired
private RegBusRightsService regBusRightsService;
@Autowired
private RegBaseSllmbhqkService regBaseSllmbhqkService;
@Autowired
private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
@Autowired
private RegBusLqService regBusLqService;
@ModelAttribute
public RegBusHisLqBdcqzsdjxx get(@RequestParam(required=false) String id) {
RegBusHisLqBdcqzsdjxx entity = null;
if (StringUtils.isNotBlank(id)){
entity = regBusHisLqBdcqzsdjxxService.get(id);
}
if (entity == null){
entity = new RegBusHisLqBdcqzsdjxx();
}
return entity;
}
@RequiresPermissions("reg:bus:regBusHisLqBdcqzsdjxx:view")
@RequestMapping(value = {"list", ""})
public String list(RegBusHisLqBdcqzsdjxx regBusHisLqBdcqzsdjxx, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isNotBlank(request.getParameter("ywh"))){
regBusHisLqBdcqzsdjxx.setYwh(request.getParameter("ywh"));
}
Page<RegBusHisLqBdcqzsdjxx> page = regBusHisLqBdcqzsdjxxService.findPage(new Page<RegBusHisLqBdcqzsdjxx>(request, response), regBusHisLqBdcqzsdjxx);
model.addAttribute("page", page);
if(StringUtils.isNotBlank(request.getParameter("WO"))){
if(request.getParameter("WO").equals("2")){
model.addAttribute("WO", "2");
}
}
return "modules/reg/bus/regBusHisLqBdcqzsdjxxList";
}
@RequiresPermissions("reg:bus:regBusHisLqBdcqzsdjxx:view")
@RequestMapping(value = "form")
public String form(RegBusHisLqBdcqzsdjxx regBusHisLqBdcqzsdjxx, Model model, HttpServletRequest request) {
//预先生成业务号,保存时再次验证
String ywh="";
if(StringUtils.isBlank(regBusHisLqBdcqzsdjxx.getYwh())){
ywh = "LSL"+getNextYwhs();
}else{
ywh = regBusHisLqBdcqzsdjxx.getYwh();
}
if(StringUtils.isNotBlank(request.getParameter("optype"))){
model.addAttribute("optype", "1");
model.addAttribute("YWH", regBusHisLqBdcqzsdjxx.getYwh());
}else{
regBusHisLqBdcqzsdjxx.setYwh(ywh);
model.addAttribute("YWH", regBusHisLqBdcqzsdjxx.getYwh());
}
if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
model.addAttribute("VIEWS", "1");
}
if(StringUtils.isNotBlank(request.getParameter("LMID"))){
RegBaseSllm regBaseSllm = regBaseSllmService.get(request.getParameter("LMID"));
RegBaseZdjbxx regBaseZdjbxx = regBaseZdjbxxService.get(regBaseSllm.getZdid());
//RegBaseChxx regBaseChxx = regBaseChxxService.get(regBaseZdjbxx.getChid());
if(regBaseZdjbxx!=null){
/*regBusHisLqBdcqzsdjxx.setChxxid(regBaseChxx.getId());
regBusHisLqBdcqzsdjxx.setChcode(regBaseChxx.getChcode());*/
regBusHisLqBdcqzsdjxx.setZdmj(regBaseZdjbxx.getZdmj());
regBusHisLqBdcqzsdjxx.setMjdw(regBaseZdjbxx.getMjdw());
regBusHisLqBdcqzsdjxx.setSeachcity(regBaseZdjbxx.getSeachcity());
regBusHisLqBdcqzsdjxx.setSeachdistrict(regBaseZdjbxx.getSeachdistrict());
regBusHisLqBdcqzsdjxx.setSeachprov(regBaseZdjbxx.getSeachprov());
regBusHisLqBdcqzsdjxx.setZdt(regBaseZdjbxx.getZdt());
regBusHisLqBdcqzsdjxx.setTfh(regBaseZdjbxx.getTfh());
regBusHisLqBdcqzsdjxx.setZl(regBaseZdjbxx.getZl());
regBusHisLqBdcqzsdjxx.setZdszd(regBaseZdjbxx.getZdszd());
regBusHisLqBdcqzsdjxx.setZdszn(regBaseZdjbxx.getZdszn());
regBusHisLqBdcqzsdjxx.setZdszx(regBaseZdjbxx.getZdszx());
regBusHisLqBdcqzsdjxx.setZdszb(regBaseZdjbxx.getZdszb());
regBusHisLqBdcqzsdjxx.setZddm(regBaseZdjbxx.getZddm());
regBusHisLqBdcqzsdjxx.setTdsyqdm(regBaseZdjbxx.getTdsyqdm());
regBusHisLqBdcqzsdjxx.setZdtzm(regBaseZdjbxx.getZdtzm());
regBusHisLqBdcqzsdjxx.setDjh(regBaseZdjbxx.getDjh());
regBusHisLqBdcqzsdjxx.setDah(regBaseZdjbxx.getDah());
regBusHisLqBdcqzsdjxx.setQllx(regBaseZdjbxx.getQllx());
regBusHisLqBdcqzsdjxx.setJg(regBaseZdjbxx.getJg());
regBusHisLqBdcqzsdjxx.setDj(regBaseZdjbxx.getDj());
regBusHisLqBdcqzsdjxx.setYt(regBaseZdjbxx.getYt());
regBusHisLqBdcqzsdjxx.setQlxz(regBaseZdjbxx.getQlxz());
regBusHisLqBdcqzsdjxx.setQlsdfs(regBaseZdjbxx.getQlsdfs());
regBusHisLqBdcqzsdjxx.setZt(regBaseZdjbxx.getZt());
regBusHisLqBdcqzsdjxx.setRemarks(regBaseZdjbxx.getRemarks());
if("11".equals(regBaseZdjbxx.getQllx())){
regBusHisLqBdcqzsdjxx.setQllx("36");
}else if("9".equals(regBaseZdjbxx.getQllx())){
regBusHisLqBdcqzsdjxx.setQllx("10");
}else{
regBusHisLqBdcqzsdjxx.setQllx(regBaseZdjbxx.getQllx());
}
regBusHisLqBdcqzsdjxx.setLmbm(regBaseSllm.getLmbm());
regBusHisLqBdcqzsdjxx.setZysz(regBaseSllm.getZysz());
regBusHisLqBdcqzsdjxx.setZs(regBaseSllm.getZs());
regBusHisLqBdcqzsdjxx.setLz(regBaseSllm.getLz());
regBusHisLqBdcqzsdjxx.setQy(regBaseSllm.getQy());
regBusHisLqBdcqzsdjxx.setLdsyqxz(regBaseSllm.getLdsyqxz());
regBusHisLqBdcqzsdjxx.setZlnd(regBaseSllm.getZlnd());
regBusHisLqBdcqzsdjxx.setLb(regBaseSllm.getLb());
regBusHisLqBdcqzsdjxx.setXb(regBaseSllm.getXb());
regBusHisLqBdcqzsdjxx.setXdm(regBaseSllm.getXdm());
regBusHisLqBdcqzsdjxx.setBdcdyh(regBaseSllm.getBdcdyh());
String sz = "四至:\n 东:"+regBaseZdjbxx.getZdszd()+";\n 南:"+regBaseZdjbxx.getZdszn()+";\n 西:"+regBaseZdjbxx.getZdszx()+";\n 北:"+regBaseZdjbxx.getZdszb();
regBusHisLqBdcqzsdjxx.setFj(sz);
regBusHisLqBdcqzsdjxx.setIsaudit("0");
}
regBaseSllm.setIsaudit("2");
regBaseSllmService.save(regBaseSllm);
}
regBusHisLqBdcqzsdjxxService.save(regBusHisLqBdcqzsdjxx);
model.addAttribute("QXCODE", Global.getAreaCode());
model.addAttribute("regBusHisLqBdcqzsdjxx", regBusHisLqBdcqzsdjxx);
return "modules/reg/bus/regBusHisLqBdcqzsdjxxForm";
}
@RequiresPermissions("reg:bus:regBusHisLqBdcqzsdjxx:edit")
@RequestMapping(value = "save")
public String save(RegBusHisLqBdcqzsdjxx regBusHisLqBdcqzsdjxx, Model model, RedirectAttributes redirectAttributes,HttpServletRequest request) {
if (!beanValidator(model, regBusHisLqBdcqzsdjxx)){
return form(regBusHisLqBdcqzsdjxx, model,request);
}
String optype="";
if(StringUtils.isNotBlank(request.getParameter("optype"))){
optype = request.getParameter("optype");
}
String lsbj = "";
if(StringUtils.isNotBlank(request.getParameter("lsbj"))){
lsbj = request.getParameter("lsbj");
}
if(null != regBusHisLqBdcqzsdjxx.getSyqqssj() && null != regBusHisLqBdcqzsdjxx.getSyqjssj()){
regBusHisLqBdcqzsdjxx.setSyqx(DateUtils.formatDate(regBusHisLqBdcqzsdjxx.getSyqqssj(), "yyyy年MM月dd日") + "起" +
DateUtils.formatDate(regBusHisLqBdcqzsdjxx.getSyqjssj(),"yyyy年MM月dd日")+"止;");
}
String qlqtzk = "发包方:"+regBusHisLqBdcqzsdjxx.getFbf()+";主要树种:"+regBusHisLqBdcqzsdjxx.getZysz()+";造林年代:"+
regBusHisLqBdcqzsdjxx.getZlnd()+"年;小地名:"+regBusHisLqBdcqzsdjxx.getXdm()+";";
regBusHisLqBdcqzsdjxx.setQlqtzk(qlqtzk);
regBusHisLqBdcqzsdjxx.setIsaudit("0");
regBusHisLqBdcqzsdjxx.setYt(DictUtils.getDictLabel(regBusHisLqBdcqzsdjxx.getYt(), "reg_bus_tdyt",""));
regBusHisLqBdcqzsdjxx.setSyqmj(regBusHisLqBdcqzsdjxx.getZdmj());
regBusHisLqBdcqzsdjxxService.save(regBusHisLqBdcqzsdjxx);
addMessage(redirectAttributes, "保存林权历史数据成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusHisLqBdcqzsdjxx/list?WO="+request.getParameter("WO")+"&optype="+optype+"&ywh="+regBusHisLqBdcqzsdjxx.getYwh()+"&lsbj="+lsbj;
}
@RequiresPermissions("reg:bus:regBusHisLqBdcqzsdjxx:edit")
@RequestMapping(value = "delete")
public String delete(RegBusHisLqBdcqzsdjxx regBusHisLqBdcqzsdjxx, RedirectAttributes redirectAttributes) {
RegBaseSllm sllm = new RegBaseSllm();
sllm.setBdcdyh(regBusHisLqBdcqzsdjxx.getBdcdyh());
sllm = regBaseSllmService.findList(sllm).get(0);
sllm.setIsaudit("1");
regBaseSllmService.save(sllm);
RegBusHisHouseQlr hisqlr = new RegBusHisHouseQlr();
hisqlr.setYwh(regBusHisLqBdcqzsdjxx.getYwh());
List<RegBusHisHouseQlr> listhisqlr = regBusHisHouseQlrService.findList(hisqlr);
if(listhisqlr.size()>0){
hisqlr = listhisqlr.get(0);
regBusHisHouseQlrService.delete(hisqlr);
}
regBusHisLqBdcqzsdjxxService.delete(regBusHisLqBdcqzsdjxx);
addMessage(redirectAttributes, "删除林权历史数据成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusHisLqBdcqzsdjxx/?repage";
}
/**
* 审核数据分插
* @param regBusHisLqBdcqzsdjxx
* @param request
* @param redirectAttributes
* @return
*/
@RequiresPermissions("reg:bus:regBusHisLqBdcqzsdjxx:edit")
@RequestMapping(value = "audit")
@ResponseBody
public ModelMap audit(RegBusHisLqBdcqzsdjxx regBusHisLqBdcqzsdjxx,HttpServletRequest request, RedirectAttributes redirectAttributes) {
String djxl = regBusHisLqBdcqzsdjxx.getDjxl();
ModelMap modelmap = new ModelMap();
RegBusBdcqzsdjxx bdcdjxx = new RegBusBdcqzsdjxx();
RegBusHisHouseQlr hisqlr = new RegBusHisHouseQlr();
if(null==regBusHisLqBdcqzsdjxx.getDjjg() || null==regBusHisLqBdcqzsdjxx.getDbr() || null==regBusHisLqBdcqzsdjxx.getFzsj()
|| null==regBusHisLqBdcqzsdjxx.getDjsj() || null==regBusHisLqBdcqzsdjxx.getSyqqssj() || null==regBusHisLqBdcqzsdjxx.getSllmsyqr1()
|| null==regBusHisLqBdcqzsdjxx.getSllmsyqr2() || null==regBusHisLqBdcqzsdjxx.getFbf() || null==regBusHisLqBdcqzsdjxx.getBdcqzh()
|| null==regBusHisLqBdcqzsdjxx.getDjyy()){
modelmap.addAttribute("successbj", "1");
modelmap.addAttribute("msg", "信息不完整,请确定后再审核。");
return modelmap;
}
hisqlr.setYwh(regBusHisLqBdcqzsdjxx.getYwh());
List<RegBusHisHouseQlr> hisqlrlist = regBusHisHouseQlrService.findList(hisqlr);
String qlrmc = "";
String gyrmc = "";
if(hisqlrlist.size() > 0 ){
String gyfs = DictUtils.getDictLabel(hisqlrlist.get(0).getGyfs(), "reg_bus_gyfs", "");
bdcdjxx.setGyqk(gyfs);
for(int qi=0;qi<hisqlrlist.size();qi++){
hisqlr = hisqlrlist.get(qi);
hisqlr.setYsdm("2003000000");
if(hisqlrlist.get(qi).getSxh().equals("1")){
qlrmc = hisqlrlist.get(qi).getQlrmc();
bdcdjxx.setQlrmc(qlrmc);
//反写宗地基本信息权利人和测绘申请人
RegBaseZdjbxx regBaseZdjbxx = new RegBaseZdjbxx();System.out.println(regBusHisLqBdcqzsdjxx.getBdcdyh());
regBaseZdjbxx.setZddm(regBusHisLqBdcqzsdjxx.getBdcdyh().substring(0, 19));
List<RegBaseZdjbxx> zdlist = regBaseZdjbxxService.findList(regBaseZdjbxx);
if(zdlist.size()>0){
regBaseZdjbxx = zdlist.get(0);
regBaseZdjbxx.setQlrxm(qlrmc);
regBaseZdjbxx.setZjlx(hisqlrlist.get(qi).getZjzl());
regBaseZdjbxx.setSfzh(hisqlrlist.get(qi).getZjh());
regBaseZdjbxxService.save(regBaseZdjbxx);
}
}else{
gyrmc += hisqlrlist.get(qi).getQlrmc()+"; ";
}
//首先获取权利人 ID个数
int qlrmcOrderNumber = 1;
RegBusQlr qlrtem = new RegBusQlr();
qlrtem.setYwh(regBusHisLqBdcqzsdjxx.getYwh());
List<RegBusQlr> qlrtemlist = regBusQlrService.findList_1(qlrtem);
int count = qlrtemlist.size();
if(count > 0){
qlrmcOrderNumber = qlrtemlist.size() + 1;
}
RegBusQlr qlr = new RegBusQlr();
BeanUtils.copyProperties(hisqlr, qlr);
qlr.setSxh(qlrmcOrderNumber);
qlr.setQszt("1");
qlr.setId("");
RegBusQlr qlr_33 = new RegBusQlr();
qlr_33.setYwh(regBusHisLqBdcqzsdjxx.getYwh());
qlr_33.setPcode(hisqlr.getPcode());
qlr_33.setQllx(regBusHisLqBdcqzsdjxx.getQllx());
List<RegBusQlr> qlrlist_33 = regBusQlrService.findList_1(qlr_33);
if(qlrlist_33.size() > 0 ){
qlr.setId(qlrlist_33.get(0).getId());
}
qlr.setQllx(regBusHisLqBdcqzsdjxx.getQllx());
regBusQlrService.save(qlr);
//修改人员信息的状态为已引用
if(StringUtils.isNotBlank(hisqlr.getZjh())){
RegBasePerson regBasePerson = new RegBasePerson();
regBasePerson.setZjh(hisqlr.getZjh());
regBasePerson.setZjzl(hisqlr.getZjzl());
List<RegBasePerson> findPersonList = regBasePersonService.findList(regBasePerson);
if(findPersonList.size()>0){
regBasePerson = findPersonList.get(0);
regBasePerson.setIsaudit("2");
regBasePersonService.save(regBasePerson);
}
}
}
}else{
modelmap.addAttribute("successbj", "1");
modelmap.addAttribute("msg", "权利人没添加,请确定后再审核。");
return modelmap;
}
//获取业务号相同的所有数据
RegBusHisLqBdcqzsdjxx hislqdjxx = new RegBusHisLqBdcqzsdjxx();
hislqdjxx.setYwh(regBusHisLqBdcqzsdjxx.getYwh());
List<RegBusHisLqBdcqzsdjxx> hislist = regBusHisLqBdcqzsdjxxService.findList(hislqdjxx);
int t = hislist.size();
int cfbz = 0;
RegBusHisLqBdcqzsdjxx hislq = new RegBusHisLqBdcqzsdjxx();
if(t > 0){
if(StringUtils.isNotBlank(hislist.get(0).getYwh())){
RegBaseSllmbhqk regBaseSllmbhqk = new RegBaseSllmbhqk();
regBaseSllmbhqk.setYwh(hislist.get(0).getYwh());
regBaseSllmbhqkService.deleteSllmbhqk(regBaseSllmbhqk);
}
for(int i=0;i<t;i++){
hislq = hislist.get(i);
if(StringUtils.isNotBlank(hislq.getYwh())){
RegBaseSllm regBaseSllm = new RegBaseSllm();
regBaseSllm.setBdcdyh(hislq.getBdcdyh());
List<RegBaseSllm> sllmlist = regBaseSllmService.findList(regBaseSllm);
if(sllmlist.size() > 0 ){
regBaseSllm = sllmlist.get(0);
RegBaseSllmbhqk regBaseSllmbhqk = new RegBaseSllmbhqk();
regBaseSllmbhqk.setYwh(hislq.getYwh());
regBaseSllmbhqk.setSllmid(regBaseSllm.getId());
regBaseSllmbhqk.setOldsllmid(regBaseSllm.getId());
regBaseSllmbhqk.setBdcdyh(hislq.getBdcdyh());
regBaseSllmbhqkService.save(regBaseSllmbhqk);
}
}
RegBusLq lq = new RegBusLq();
//插入已登记信息
bdcdjxx.setYt(hislq.getYt());
bdcdjxx.setQlqtzk(hislq.getQlqtzk());
bdcdjxx.setYwh(hislq.getYwh());
bdcdjxx.setZddm(hislq.getZddm());
bdcdjxx.setBdcdyh(hislq.getBdcdyh());
bdcdjxx.setBdcqzh(hislq.getBdcqzh());
bdcdjxx.setBdcqzbh(hislq.getBdcqzbh());
bdcdjxx.setZl(hislq.getZl());
bdcdjxx.setQlxz(DictUtils.getDictLabel(hislq.getQlxz(), "reg_bus_qlxz",""));
bdcdjxx.setMj(hislq.getSyqmj().toString());
bdcdjxx.setSyqx(hislq.getSyqx());
bdcdjxx.setPwh(hislq.getPwh());
bdcdjxx.setHbjk(hislq.getHbjk());
bdcdjxx.setHbhth(hislq.getHbhth());
bdcdjxx.setFzsj(DateUtils.formatDate(new Date(),"yyyy-MM-dd"));
bdcdjxx.setZzsj(hislq.getZzsj());
bdcdjxx.setDjlx(hislq.getDjxl());
bdcdjxx.setFj(hislq.getRemarks()+"/"+hislq.getFj());
if(djxl.equals("205")) {
bdcdjxx.setRights("1");
bdcdjxx.setQllx(hislq.getQllx());
}
bdcdjxx.setStatus("2");
bdcdjxx.setIshistory("0");
bdcdjxx.setIslogout("0");
bdcdjxx.setIsprint("0");
bdcdjxx.setIsfdsj(Integer.valueOf("0"));
bdcdjxx.setFj(hislq.getFj());
bdcdjxx.setDbsj(DateUtils.formatDate(new Date(),"yyyy-MM-dd"));
bdcdjxx.setId("");
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setYwh(hislq.getYwh());
djxx.setBdcdyh(hislq.getBdcdyh());
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx);
int tt = djxxlist.size();
if(tt > 0 ){
bdcdjxx.setId(djxxlist.get(0).getId());
}
regBusBdcqzsdjxxService.save(bdcdjxx);
//插入确权表
if(djxl.equals("205")) {
RegBusRights rights = new RegBusRights();
rights.setBdcdyh(hislq.getBdcdyh());
List<RegBusRights> rightslist = regBusRightsService.findList(rights);
if(rightslist.size() > 0 ){
rights = rightslist.get(0);
rights.setRemarks(djxl);
rights.setSsouyq(hislq.getYwh());
}else{
rights.setRemarks(djxl);
rights.setBdcdyh(hislq.getBdcdyh());
rights.setSsouyq(hislq.getYwh());
//去重验证
RegBusRights rightsold = new RegBusRights();
rightsold.setBdcdyh(hislq.getBdcdyh());
List<RegBusRights> rightsList1 = regBusRightsService.findList(rightsold);
if(rightsList1.size() > 0){
rights.setId(rightsList1.get(0).getId());
}
}
regBusRightsService.save(rights);
}
//开始分插数据
//首先在每个判断中获取已选择数据的业务号和不动产单元号,通过其去查询对应权属表中的对应数据
if(djxl.equals("205")){
//获取选择已登记信息的对应权属信息
lq.setBdcdyh(hislq.getBdcdyh());
lq.setYwh(hislq.getYwh());
lq.setQllx(hislq.getQllx());
lq.setDjlx(hislq.getDjlx());
lq.setDjyy(hislq.getDjyy());
lq.setYsdm("2002010300");
// lq.setFdzl(hislq.getZl());
lq.setLdsyqxz(hislq.getLdsyqxz());
lq.setZysz(hislq.getZysz());
lq.setZs(hislq.getZs());
lq.setLz(hislq.getLz());
lq.setQy(hislq.getQy());
lq.setZlnd(hislq.getZlnd());
lq.setLb(hislq.getLb());
lq.setXb(hislq.getXb());
lq.setXdm(hislq.getXdm());
lq.setFbf(hislq.getFbf());
lq.setSyqmj(hislq.getSyqmj());
lq.setBdcqzh(hislq.getBdcqzh());
lq.setQxdm(hislq.getQxdm());
lq.setDjjg(hislq.getDjjg());
lq.setDbr(hislq.getDbr());
lq.setDjsj(hislq.getDjsj());
lq.setFj(hislq.getFj());
lq.setSllmsyqr1(hislq.getSllmsyqr1());
lq.setSllmsyqr2(hislq.getSllmsyqr2());
lq.setLdsyqssj(hislq.getSyqqssj());
lq.setLdsyjssj(hislq.getSyqjssj());
lq.setQszt("1");
lq.setRemarks(hislq.getRemarks());
lq.setFj(hislq.getFj());
lq.setId("");
RegBusLq lq_1 = new RegBusLq();
lq_1.setYwh(hislq.getYwh());
lq_1.setBdcdyh(hislq.getBdcdyh());
List<RegBusLq> lq1list = regBusLqService.findList(lq_1);
int t3 = lq1list.size();
if(t3 > 0 ){
lq.setId(lq1list.get(0).getId());
}
lq.setIsfdsj(0);
regBusLqService.save(lq);
}
//设置该数据已经被审核
hislq.setIsaudit("1");
hislq.setQlrmc(qlrmc);
regBusHisLqBdcqzsdjxxService.save(hislq);
}
//循环结束
addMessage(redirectAttributes, "不动产登记历史数据审核成功!");
//最后再次查重只针对登记信息和确权就可以确定是否有重复数据了
for(int i=0;i<hislist.size();i++){
RegBusHisLqBdcqzsdjxx hislq1 = hislist.get(i);
//确权信息
RegBusRights rig = new RegBusRights();
rig.setBdcdyh(hislq1.getBdcdyh());
List<RegBusRights> riglist = regBusRightsService.findList(rig);
//登记信息
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setYwh(hislq1.getYwh());
djxx.setBdcdyh(hislq1.getBdcdyh());
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx);
if(djxxlist.size() >= 2 || riglist.size() >= 2){
cfbz = 1;
break;
}
}
}
modelmap.addAttribute("regBusHisLqBdcqzsdjxx", hislq);
//return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusHisLqBdcqzsdjxx?VIEWS=1&cfbz="+cfbz;
return modelmap;
}
/***
* @Title: getNextYwh
* @Description: 获取并生成业务号
* @param @return 设定文件
* @return String 返回类型
* @throws
*/
public synchronized String getNextYwhs() {
String maxYwh = regBusHisLqBdcqzsdjxxService.findMaxYwhLs();
if(StringUtils.isNotBlank(maxYwh) && DateUtils.getDate("yyyyMMdd").equals(maxYwh.substring(3, 11))){
maxYwh = maxYwh.substring(3, 15);
}else{
maxYwh = DateUtils.getDate("yyyyMMdd") + "0000";
}
String nextYwh = DateUtils.getDate("yyyyMMdd") + "0001";
//如果数据里的最大业务号不为空,就取出来进行处理;否则直接默认值
if(StringUtils.isNotBlank(maxYwh)){
//如果当前日期字符串等于数据库里最大业务号前面的日期字符串,那只要顺序往上加就好;否则直接默认值
if(DateUtils.getDate("yyyyMMdd").equals(maxYwh.substring(0, 8))){
int nextSerNum = Integer.parseInt(maxYwh.substring(8)) + 1;
if (nextSerNum < 10) {
nextYwh = DateUtils.getDate("yyyyMMdd") + "000" + nextSerNum;
}else if (nextSerNum > 9 && nextSerNum < 100) {
nextYwh = DateUtils.getDate("yyyyMMdd") + "00" + nextSerNum;
}else if (nextSerNum > 99 && nextSerNum < 1000) {
nextYwh = DateUtils.getDate("yyyyMMdd") + "0" + nextSerNum;
}else {
nextYwh = DateUtils.getDate("yyyyMMdd") + nextSerNum;
}
}
}
System.out.println(nextYwh);
return nextYwh;
}
}