82006e497566aa50ba1ecea472e50919ce2280a0.svn-base
17.8 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
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.reg.web.bus;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.RegBaseH;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseXm;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdjbxx;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZrzbg;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusGd;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusQlr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSlsq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSz;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseXmService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdjbxxService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZrzbgService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusGdService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusQlrService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusSlsqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusSzService;
import com.thinkgem.jeesite.modules.reg.utils.RegUtils;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
/**
* 归档信息维护Controller
* @author xuyg
* @version 2015-10-09
*/
@Controller
@RequestMapping(value = "${adminPath}/reg/bus/regBusGd")
public class RegBusGdController extends BaseController {
@Autowired
private RegBusGdService regBusGdService;
@Autowired
private RegBusSzService regBusSzService;
@Autowired
private RegBusSlsqService regBusSlsqService;
@Autowired
private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
@Autowired
private RegBusQlrService regBusQlrService;
@Autowired
private RegBaseZrzbgService regBaseZrzbgService;
@Autowired
private RegBaseZdjbxxService regBaseZdjbxxService;
@Autowired
private RegBaseXmService regBaseXmService;
@ModelAttribute
public RegBusGd get(@RequestParam(required=false) String id) {
RegBusGd entity = null;
if (StringUtils.isNotBlank(id)){
entity = regBusGdService.get(id);
}
if (entity == null){
entity = new RegBusGd();
}
return entity;
}
@RequiresPermissions("reg:bus:regBusGd:view")
@RequestMapping(value = {"list", ""})
public String list(RegBusGd regBusGd, HttpServletRequest request, HttpServletResponse response, Model model) {
//按照业务号查询受理表单相关的归档信息
if(StringUtils.isNotBlank(request.getParameter("ywh"))){
regBusGd.setYwh(request.getParameter("ywh"));
model.addAttribute("ywh", request.getParameter("ywh"));
}
//归档以后只能查看不能修改删除
if(StringUtils.isNotBlank(request.getParameter("LISTVIEWS"))){
model.addAttribute("LISTVIEWS", "1");
}
Page<RegBusGd> page = regBusGdService.findPage(new Page<RegBusGd>(request, response), regBusGd);
//判断当前是否已有归档记录
if(page.getList().size()>0){
model.addAttribute("ised", "1");
}
model.addAttribute("page", page);
return "modules/reg/bus/regBusGdList";
}
/**
* 电子档案归档信息打印
* @param regBusGd
* @param request
* @param response
* @param model
* @return
*/
@RequiresPermissions("reg:bus:regBusGd:view")
@RequestMapping(value = "printGd")
public String printGd(RegBusGd regBusGd, HttpServletRequest request, HttpServletResponse response, Model model) {
List<RegBusGd> gdlist = regBusGdService.findList(regBusGd);
if(gdlist.size() == 1){
regBusGd = gdlist.get(0);
model.addAttribute("ywh", regBusGd.getYwh());
model.addAttribute("djxl", DictUtils.getDictLabel(regBusGd.getDjxl(), "reg_bus_djxl", ""));
model.addAttribute("gdry", regBusGd.getGdry());
model.addAttribute("gdsj", DateUtils.formatDate(regBusGd.getGdsj(),"yyyy-MM-dd"));
model.addAttribute("jzh", regBusGd.getJzh());
model.addAttribute("wjjs", regBusGd.getWjjs());
model.addAttribute("zys", regBusGd.getZys());
model.addAttribute("dawz", regBusGd.getSh()+"室"+regBusGd.getGh()+"柜"
+regBusGd.getLh()+"列"+regBusGd.getCh()+"层"+regBusGd.getWh()+"位");
model.addAttribute("zl", regBusGd.getZl());
RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
regBusBdcqzsdjxx.setYwh(regBusGd.getYwh());
// regBusBdcqzsdjxx.setIslogout("13");
List<RegBusBdcqzsdjxx> findListRela = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
if(findListRela.size() > 0){
regBusBdcqzsdjxx = findListRela.get(0);
model.addAttribute("zl", regBusBdcqzsdjxx.getZl());
if(findListRela.size() > 1){
model.addAttribute("zl", regBusBdcqzsdjxx.getZl()+"; (等"+findListRela.size()+"宗、套)");
}
String bdcqzh = "";
String bdcqzh2 = "";
for (int i = 0; i < findListRela.size(); i++) {
regBusBdcqzsdjxx = findListRela.get(i);
if (StringUtils.isNotBlank(bdcqzh)) {
bdcqzh2 += ","+regBusBdcqzsdjxx.getBdcqzh();
}else{
bdcqzh = regBusBdcqzsdjxx.getBdcqzh();
}
}
bdcqzh = bdcqzh+bdcqzh2;
String aaArray[] = bdcqzh.split(",");
String bdcqzhs = "";
String[] rowsTemp = RegUtils.strReplace(aaArray);
if(rowsTemp!=null && rowsTemp.length > 0) {
int i = 0;
for(i=0; i<rowsTemp.length; i++) {
if(StringUtils.isNoneBlank(bdcqzhs)){
if(i < 4){
bdcqzhs += ";"+rowsTemp[i];
}else{
bdcqzhs = bdcqzhs+";(等共"+rowsTemp.length+"套)";
break;
}
}else {
bdcqzhs = rowsTemp[i];
}
}
if(i > 2){
model.addAttribute("bdcqzhsl", i);
}
}
model.addAttribute("qzhm", bdcqzhs);
}
RegBusQlr regBusQlr = new RegBusQlr();
regBusQlr.setYwh(regBusGd.getYwh());
List<RegBusQlr> qlrlist = regBusQlrService.findListSxh(regBusQlr);
if(qlrlist.size() > 0){
regBusQlr = qlrlist.get(0);
String gyr = "";
String gyr2 = "";
if(qlrlist.size() > 1){
for (int i = 1; i < qlrlist.size(); i++) {
if (StringUtils.isNotBlank(gyr)) {
gyr2 += ";"+qlrlist.get(i).getQlrmc();
}else{
gyr = qlrlist.get(i).getQlrmc();
}
}
gyr = ";"+gyr + gyr2;
}
model.addAttribute("qlr", regBusQlr.getQlrmc()+gyr);
}
}
return "modules/reg/print/printGdInfo";
}
/**
* 电子档案归档信息查看列表
* @param regBusGd
* @param request
* @param response
* @param model
* @return
*/
@RequiresPermissions("reg:bus:regBusGd:view")
@RequestMapping(value = "gdlist")
public String gdlist(RegBusGd regBusGd, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<RegBusGd> page = regBusGdService.findPage(new Page<RegBusGd>(request, response), regBusGd);
model.addAttribute("page", page);
return "modules/reg/bus/regBusGdshowList";
}
@RequiresPermissions("reg:bus:regBusGd:view")
@RequestMapping(value = "form")
public String form(RegBusGd regBusGd, Model model, HttpServletRequest request) {
model.addAttribute("regBusGd", regBusGd);
User user = UserUtils.getUser();
model.addAttribute("SLRMC", user.getName());
String ywh = request.getParameter("ywh");
String xg = "";
if(StringUtils.isNotBlank(request.getParameter("xg"))){
xg = "1";
model.addAttribute("xg", "1");
System.out.println(request.getParameter("id"));
model.addAttribute("ids", request.getParameter("id"));
}
//传递业务号和要素代码
if(StringUtils.isNotBlank(ywh)){
model.addAttribute("YWH", request.getParameter("ywh"));
model.addAttribute("YSDM",request.getParameter("YSDM"));
RegBusSlsq regBusSlsq = new RegBusSlsq();
regBusSlsq.setYwh(request.getParameter("ywh"));
List<RegBusSlsq> regBusSlsqlist = regBusSlsqService.findList(regBusSlsq);
if(regBusSlsqlist.size() > 0){//查找登记信息
regBusSlsq = regBusSlsqlist.get(0);
regBusGd.setDjxl(regBusSlsq.getDjxl());
regBusGd.setDjdl(regBusSlsq.getDjdl());
RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
regBusBdcqzsdjxx.setYwh(ywh);
List<RegBusBdcqzsdjxx> findListRela = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxx);
if(findListRela.size() > 0){
regBusBdcqzsdjxx = findListRela.get(0);
model.addAttribute("zl", regBusBdcqzsdjxx.getZl());
if(regBusBdcqzsdjxx.getDjlx().equals("429")){//期转现 没有权证号,没有上一笔数据
model.addAttribute("qzhm", "");
}else {
RegBusSz regBusSz = new RegBusSz();
regBusSz.setYwh(ywh);
List<RegBusSz> regBusSzlist = regBusSzService.findList(regBusSz);
if(regBusSzlist.size() > 0){
regBusSz = regBusSzlist.get(0);
if(!regBusSz.getSzzh().equals(regBusSz.getCurrmaxszbh())){
String szzh = regBusSz.getSzzh();
String maxszbh = regBusSz.getCurrmaxszbh();
String szsl = regBusSz.getSzsl();
String qzhm = "权证编号:"+szzh+"至"+maxszbh+", 一共"+szsl+"本证书";
model.addAttribute("qzhm", qzhm);
}else{
model.addAttribute("qzhm", regBusSz.getSzzh());
}
}else {
String oldId[] = regBusBdcqzsdjxx.getOldid().split(";");
regBusBdcqzsdjxx = regBusBdcqzsdjxxService.get(oldId[0]);
regBusSz.setYwh(regBusBdcqzsdjxx.getYwh());
regBusSzlist = regBusSzService.findList(regBusSz);
if(regBusSzlist.size() > 0){//正常业务繕证录入
regBusSz = regBusSzlist.get(0);
if(!regBusSz.getSzzh().equals(regBusSz.getCurrmaxszbh())){
String szzh = regBusSz.getSzzh();
String maxszbh = regBusSz.getCurrmaxszbh();
String szsl = regBusSz.getSzsl();
String qzhm = "权证编号:"+szzh+"至"+maxszbh+", 一共"+szsl+"本证书";
model.addAttribute("qzhm", qzhm);
}else{
model.addAttribute("qzhm", regBusSz.getSzzh());
}
}else {//历史入口录入
if(findListRela.get(0).getBdcqzbh() != null && !findListRela.get(0).getBdcqzbh().equals("")){
model.addAttribute("qzhm", findListRela.get(0).getBdcqzbh());
}
}
}
}
}else if(regBusSlsq.getDjxl().equals("440")){
model.addAttribute("qzhm", "");
RegBaseZrzbg regBaseZrzbg = new RegBaseZrzbg();
regBaseZrzbg.setYwh(ywh);
List<RegBaseZrzbg> findListZrzbg = regBaseZrzbgService.findList(regBaseZrzbg);
if(findListZrzbg.size() > 0){
regBaseZrzbg = findListZrzbg.get(0);
}
//根据宗地代码获取宗地坐落
RegBaseZdjbxx regBaseZdjbxx = new RegBaseZdjbxx();
regBaseZdjbxx.setZddm(regBaseZrzbg.getZddm());
List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(regBaseZdjbxx);
if(findList.size()>0){
regBaseZdjbxx = findList.get(0);
}
RegBaseXm regBaseXm = regBaseXmService.get(regBaseZrzbg.getXmid());
String zrzZl = regBaseZdjbxx.getZl()+regBaseXm.getXmmc()+regBaseZrzbg.getGzwmc();
model.addAttribute("zl", zrzZl);
}
}
}
//计算档案位置返回页面
if(!"1".equals(xg)){
if(StringUtils.isNotBlank(regBusGd.getYwh())){
//生成卷宗顺序号
RegBusGd gdjzh = new RegBusGd();
String jzh = "000100000";;
List<RegBusGd> jzhlist = regBusGdService.findMaxjzh(gdjzh);
String gdjzh1 = jzhlist.get(0)+"";
if(StringUtils.isNotBlank(gdjzh1.trim()) && !"null".equals(gdjzh1)){
jzh = gdjzh1;
}
String dajzh = getNextZrzSort(jzh);
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setYwh(regBusGd.getYwh());
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx);
if(djxxlist.size() > 0){
djxx = djxxlist.get(0);
if(djxx.getRights().equals("1")){
regBusGd.setQllb("所有权");
}
if(djxx.getRights().equals("4")){
regBusGd.setQllb("预告登记");
}
if(djxx.getRights().equals("2") || djxx.getRights().equals("5")){
regBusGd.setQllb("抵押权");
}
if(djxx.getRights().equals("3") || djxx.getRights().equals("6")){
regBusGd.setQllb("使用权");
}
}
//档案数据管理
regBusGd.setSh(1);
//开始计算档案位置
RegBusGd gd = new RegBusGd();
List<RegBusGd> gdlist = regBusGdService.findListgdwz(gd);
if(gdlist.size() > 0){
gd = gdlist.get(0);
int gh=gd.getGh();
int lh=gd.getLh();
int ch=gd.getCh();
int wh=gd.getWh();
wh = wh+1;
if(wh >= 80){
model.addAttribute("hc", 1);
}
if(wh > 120){
ch= ch+1;
wh=1;
if(ch > 6){
lh= lh+1;
ch=1;
if(lh > 4){
gh= gh+1;
lh=1;
}
}
}else{
gh=gd.getGh();
lh=gd.getLh();
ch=gd.getCh();
wh=gd.getWh()+1;
}
regBusGd.setGh(gh);
regBusGd.setLh(lh);
regBusGd.setCh(ch);
regBusGd.setWh(wh);
regBusGd.setDawz(regBusGd.getSh()+"-"+gh+"-"+lh+"-"+ch+"-"+wh);
}else{
int gh=1;
int lh=1;
int ch=1;
int wh=1;
int sh=1;
regBusGd.setGh(gh);
regBusGd.setLh(lh);
regBusGd.setCh(ch);
regBusGd.setWh(wh);
regBusGd.setSh(sh);
regBusGd.setDawz(sh+"-"+gh+"-"+lh+"-"+ch+"-"+wh);
}
regBusGd.setJzh("BDC"+dajzh);
}
}
//查看标示
if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
model.addAttribute("VIEWS", request.getParameter("VIEWS"));
}
return "modules/reg/bus/regBusGdForm";
}
/**
* 电子档案归档查看from
* @param regBusGd
* @param model
* @param request
* @return
*/
@RequiresPermissions("reg:bus:regBusGd:view")
@RequestMapping(value = "gdform")
public String gdform(RegBusGd regBusGd, Model model, HttpServletRequest request) {
String ids = request.getParameter("id");
regBusGd = regBusGdService.get(ids);
model.addAttribute("regBusGd",regBusGd);
return "modules/reg/bus/regBusGdshowForm";
}
@RequiresPermissions("reg:bus:regBusGd:edit")
@RequestMapping(value = "save")
public synchronized String save(RegBusGd regBusGd, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
if (!beanValidator(model, regBusGd)){
return form(regBusGd, model, request);
}
String bj ="";
if(StringUtils.isNotBlank(request.getParameter("bj"))){
bj = "1";
}
if(StringUtils.isNotBlank(request.getParameter("xg"))){
model.addAttribute("hc", "1");
}
RegBusGd regBusGd1 = new RegBusGd();
regBusGd1.setYwh(regBusGd.getYwh());
List<RegBusGd> regBusFzlist = regBusGdService.findList(regBusGd1);
if(regBusFzlist.size() > 0){
regBusGd1 = regBusFzlist.get(0);
regBusGd.setId(regBusGd1.getId());
}
//当前应该归档的数
int gh1=regBusGd.getGh();
int lh1=regBusGd.getLh();
int ch1=regBusGd.getCh();
int wh1=regBusGd.getWh();
regBusGd.setDawzsxh(String.valueOf(regBusGd.getSh())+String.valueOf(gh1)+String.valueOf(lh1)+String.valueOf(ch1)+String.valueOf(wh1));
regBusGdService.save(regBusGd);
addMessage(redirectAttributes, "保存归档信息成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusGd/?repage&ywh="+regBusGd.getYwh();
}
@RequiresPermissions("reg:bus:regBusGd:edit")
@RequestMapping(value = "delete")
public String delete(RegBusGd regBusGd, RedirectAttributes redirectAttributes) {
regBusGdService.delete(regBusGd);
addMessage(redirectAttributes, "删除归档信息成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusGd/?repage&ywh="+regBusGd.getYwh();
}
//卷宗顺序号生成
public synchronized String getNextZrzSort(String jzh) {
String nextSerNum = "";
if(StringUtils.isNotBlank(jzh)){
nextSerNum = Integer.parseInt(jzh)+1+"";
}
int SerNum = Integer.parseInt(nextSerNum);
if(SerNum < 1000000){
nextSerNum = "000" + SerNum;
}else if(SerNum < 10000000){
nextSerNum = "00" + SerNum;
}else if(SerNum < 100000000){
nextSerNum = "0" + SerNum;
}
return nextSerNum;
}
/**
* 档案位置顺序号验证
* @param request
* @return
*/
@RequiresPermissions("reg:bus:regBusBdcqzsdjxx:view")
@RequestMapping(value = "dawzsxhquery")
@ResponseBody
public ModelMap dawzsxhquery(HttpServletRequest request) {
String dawzsxh = request.getParameter("dawzsxh");
String dawz = request.getParameter("dawz");
String xg = request.getParameter("xg");
String ids = request.getParameter("ids");
ModelMap modelMap = new ModelMap();
modelMap.put("success",0);
if(!"1".endsWith(xg) || StringUtils.isBlank(xg)){
RegBusGd gdwzsxh = new RegBusGd();
gdwzsxh.setDawzsxh(dawzsxh);
gdwzsxh.setDawz(dawz);
List<RegBusGd> sxhlist = regBusGdService.findList(gdwzsxh);
if(sxhlist.size() > 0){
modelMap.put("success", 1);
modelMap.put("msg", "档案位置顺序重复,不能保存!");
}
}else{
RegBusGd gdwzsxh = new RegBusGd();
gdwzsxh.setDawzsxh(dawzsxh);
gdwzsxh.setDawz(dawz);
List<RegBusGd> sxhlist = regBusGdService.findList(gdwzsxh);
if(sxhlist.size() > 0){
gdwzsxh = sxhlist.get(0);
if(!gdwzsxh.getId().equals(ids)){
modelMap.put("success", 2);
modelMap.put("msg", "您修改的档案位置顺序已存在,不能保存!");
}
}
}
return modelMap;
}
}