cd4d9eeccafaa7162343d81c60a986caabb6faa9.svn-base
6.65 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
/**
* Copyright © 2015-2018 <a href="#">J-Site</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.reg.web.bus;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.StringUtils;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseH;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusFcxxquery;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusQlr;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseHService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusFcxxqueryService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusQlrService;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;
/**
* 房屋信息查询Controller
* @author wb
* @version 2018-01-18
*/
@Controller
@RequestMapping(value = "${adminPath}/reg/bus/regBusFcxxquery")
public class RegBusFcxxqueryController extends BaseController {
@Autowired
private RegBusFcxxqueryService regBusFcxxqueryService;
@Autowired
private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
@Autowired
private RegBaseHService regBaseHService;
@Autowired
private RegBusQlrService regBusQlrService;
@ModelAttribute
public RegBusFcxxquery get(@RequestParam(required=false) String id) {
RegBusFcxxquery entity = null;
if (StringUtils.isNotBlank(id)){
entity = regBusFcxxqueryService.get(id);
}
if (entity == null){
entity = new RegBusFcxxquery();
}
return entity;
}
@RequiresPermissions("reg:bus:regBusFcxxquery:view")
@RequestMapping(value = {"list", ""})
public String list(RegBusFcxxquery regBusFcxxquery, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<RegBusFcxxquery> page = regBusFcxxqueryService.findPage(new Page<RegBusFcxxquery>(request, response), regBusFcxxquery);
model.addAttribute("page", page);
return "modules/reg/bus/regBusFcxxqueryList";
}
@RequiresPermissions("reg:bus:regBusFcxxquery:view")
@RequestMapping(value = "form")
public String form(RegBusFcxxquery regBusFcxxquery, Model model) {
model.addAttribute("regBusFcxxquery", regBusFcxxquery);
return "modules/reg/bus/regBusFcxxqueryForm";
}
@RequiresPermissions("reg:bus:regBusFcxxquery:edit")
@RequestMapping(value = "save")
public String save(RegBusFcxxquery regBusFcxxquery, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, regBusFcxxquery)){
return form(regBusFcxxquery, model);
}
regBusFcxxqueryService.save(regBusFcxxquery);
addMessage(redirectAttributes, "保存房屋信息查询成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusFcxxquery/?repage";
}
@RequiresPermissions("reg:bus:regBusFcxxquery:edit")
@RequestMapping(value = "delete")
public String delete(RegBusFcxxquery regBusFcxxquery, RedirectAttributes redirectAttributes) {
regBusFcxxqueryService.delete(regBusFcxxquery);
addMessage(redirectAttributes, "删除房屋信息查询成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusFcxxquery/?repage";
}
/**
* 查询房屋虚所有和室所有权数据
* 2018-01-18
* 需求提出人:胡工
* @param regBaseChxx
* @param model
* @param request
* @param maps
* @return
*/
@RequestMapping(value = "fcxxinfoquery")
@ResponseBody
public ModelMap fcxxinfoquery(RegBusFcxxquery regBusFcxxquery, Model model, HttpServletRequest request,Map<String,Object> maps) {
ModelMap modelMap = new ModelMap();
modelMap.put("success",0);
RegBusBdcqzsdjxx djxx = new RegBusBdcqzsdjxx();
djxx.setRights("14");
djxx.setDbsj("NOTNULL");
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx);
if(djxxlist.size() > 0){
for(int i=0;i<djxxlist.size();i++){
RegBusFcxxquery regBusFcxx = new RegBusFcxxquery();
djxx = djxxlist.get(i);
regBusFcxx.setBdcqzh(djxx.getBdcqzh());
regBusFcxx.setDbsj(djxx.getDbsj());
regBusFcxx.setDjxl(djxx.getDjlx());
if("0".equals(djxx.getIslogout())){
regBusFcxx.setSjyxzt("有效");
}else{
regBusFcxx.setSjyxzt("无效");
}
//查询户信息
RegBaseH h = regBaseHService.getdy(djxx.getBdcdyh());
if(h != null){
if(StringUtils.isNotBlank(String.valueOf(h.getScjzmj()))){
regBusFcxx.setScjzmj(h.getScjzmj());
}
regBusFcxx.setZl(h.getZl());
regBusFcxx.setFwyt1(DictUtils.getDictLabel(h.getFwyt1(),"reg_bus_fwyt", ""));
if("1".equals(h.getIsdiya())){
regBusFcxx.setFwxzzt("已抵押,");
}else{
regBusFcxx.setFwxzzt("无抵押,");
}
if("1".equals(h.getIsyiyi())){
regBusFcxx.setFwxzzt(regBusFcxx.getFwxzzt()+"已异议,");
}else{
regBusFcxx.setFwxzzt(regBusFcxx.getFwxzzt()+"无异议,");
}
if("0".equals(h.getIschafeng())){
regBusFcxx.setFwxzzt(regBusFcxx.getFwxzzt()+"无查封");
}else{
regBusFcxx.setFwxzzt(regBusFcxx.getFwxzzt()+"已查封");
}
}
//首先查询权利人
RegBusQlr regBusQlr = new RegBusQlr();
String gyqlr = "";
String gyzjh = "";
regBusQlr.setYwh(djxx.getYwh());
List<RegBusQlr> listnew = regBusQlrService.findListSxh(regBusQlr);
if(listnew.size()>0){
for(int t=0;t<listnew.size();t++){
regBusQlr = listnew.get(t);
if(regBusQlr.getSxh() == 1){
regBusFcxx.setQlrmc(regBusQlr.getQlrmc());
regBusFcxx.setZjh(regBusQlr.getZjh());
}else{
if(StringUtils.isBlank(gyqlr)){
gyqlr += regBusQlr.getQlrmc();
gyzjh += regBusQlr.getZjh();
}else{
gyqlr += ","+regBusQlr.getQlrmc();
gyzjh += ","+regBusQlr.getZjh();
}
}
}
regBusFcxx.setGyqlrmc(gyqlr);
regBusFcxx.setGyzjh(gyzjh);
}
regBusFcxxqueryService.save(regBusFcxx);
}
modelMap.put("success",0);
modelMap.put("msg","查询数据插入完成!");
}
return modelMap;
}
}