1a61e83a1c39d214484e23fa66b35e12cea7f29e.svn-base
10.5 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
/**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> 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.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.google.common.collect.Lists;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusDyaq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSjchild;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSjmain;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusDyaqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusSjmainService;
import com.thinkgem.jeesite.modules.sys.entity.Office;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.service.OfficeService;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
/**
* 收件信息(主子表)维护Controller
* @author xuyg
* @version 2015-11-24
*/
@Controller
@RequestMapping(value = "${adminPath}/reg/bus/regBusSjmain")
public class RegBusSjmainController extends BaseController {
@Autowired
private RegBusSjmainService regBusSjmainService;
@Autowired
private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
@Autowired
private RegBusQlrController regBusQlrController;
@Autowired
private RegBusDyaqService regBusDyaqService;
@Autowired
private OfficeService officeService;
@ModelAttribute
public RegBusSjmain get(@RequestParam(required=false) String id) {
RegBusSjmain entity = null;
if (StringUtils.isNotBlank(id)){
entity = regBusSjmainService.get(id);
}
if (entity == null){
entity = new RegBusSjmain();
}
return entity;
}
@RequiresPermissions("reg:bus:regBusSjmain:view")
@RequestMapping(value = {"list", ""})
public String list(RegBusSjmain regBusSjmain, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<RegBusSjmain> page = regBusSjmainService.findPage(new Page<RegBusSjmain>(request, response), regBusSjmain);
model.addAttribute("page", page);
//初审以后的环节只能查看不能修改删除
if(StringUtils.isNotBlank(request.getParameter("LISTVIEWS"))){
model.addAttribute("LISTVIEWS", "1");
}
//WinOpen标示
if(StringUtils.isNotBlank(request.getParameter("WO"))){
model.addAttribute("WO", "1");
model.addAttribute("LISTVIEWS", "1");
}
//页面操作类型【新增还是更新】
if(StringUtils.isNotBlank(request.getParameter("optype"))){
model.addAttribute("optype", "update");
}
if(StringUtils.isNotBlank(request.getParameter("DJLX"))){
model.addAttribute("DJLX", request.getParameter("DJLX"));
}
return "modules/reg/bus/regBusSjmainList";
}
@RequiresPermissions("reg:bus:regBusSjmain:view")
@RequestMapping(value = "CXlist")
public String CXlist(RegBusSjmain regBusSjmain, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<RegBusSjmain> page = regBusSjmainService.findPage(new Page<RegBusSjmain>(request, response), regBusSjmain);
model.addAttribute("page", page);
return "modules/reg/bus/regBusSjmainCXList";
}
@RequiresPermissions("reg:bus:regBusSjmain:view")
@RequestMapping(value = "listView")
public String listView(RegBusSjmain regBusSjmain, HttpServletRequest request, HttpServletResponse response, Model model) {
User user = UserUtils.getUser();
List<RegBusSjmain> sjMainList = regBusSjmainService.findList(regBusSjmain);
List<RegBusSjchild> sjList = Lists.newArrayList();
String id = "";
for(int a = 0; a < sjMainList.size(); a++){
id = sjMainList.get(a).getId();
}
regBusSjmain = get(id);
sjList = regBusSjmain.getRegBusSjchildList();
int yjsl = 0;
String ywhStr = request.getParameter("ywh");
//String djlx = request.getParameter("djlx");
String bdcqzsdjxxID = request.getParameter("BdcqzsdjxxID");
if(StringUtils.isNotBlank(ywhStr)){
model.addAttribute("YWH", ywhStr); //业务号
//获取坐落-从不动产权证书信息表
String zl = "";
RegBusBdcqzsdjxx regBusBdcqzsdjxx = regBusBdcqzsdjxxService.get(bdcqzsdjxxID);
if(regBusBdcqzsdjxx != null){
zl = regBusBdcqzsdjxx.getZl();
}
model.addAttribute("ZL", zl); //坐落 改到从宗地信息取
model.addAttribute("SLSJ", request.getParameter("slsj")); //受理时间
model.addAttribute("SJSL", sjList.size()); //收件总数量
model.addAttribute("TZRXM", request.getParameter("tzrxm")); //申请人[受托人]姓名
model.addAttribute("STR", request.getParameter("str")); //[受托人]姓名
model.addAttribute("TZRYDDH", request.getParameter("tzryddh")); //申请人移动电话
for(int i=0; i< sjList.size(); i++){
if("1".equals(sjList.get(i).getSjlx())){
yjsl++;
}
}
String sqrmc = "";
// 获取权利人名称【根据列表可能是多个】抵押人与抵押共有人
RegBusDyaq temp = new RegBusDyaq();
temp.setYwh(ywhStr);
List<RegBusDyaq> tempList = regBusDyaqService.findList(temp);
if(tempList.size()>0){
temp = tempList.get(0);
sqrmc = "抵押人:" + temp.getDyr();
if (StringUtils.isNotBlank(temp.getDygyr())) {
sqrmc += " 抵押人共有人" + temp.getDygyr();
}
}else{
sqrmc = regBusQlrController.getQlrmcByYwh(ywhStr);
}
model.addAttribute("QLRMC", sqrmc);
model.addAttribute("YJSL", yjsl); //原件数量
}
model.addAttribute("SLRMC", user.getName());
model.addAttribute("regBusSjlist", sjList);
return "modules/reg/bus/regBusSjView";
}
@RequiresPermissions("reg:bus:regBusSjmain:view")
@RequestMapping(value = "form")
public String form(RegBusSjmain regBusSjmain, Model model, HttpServletRequest request) {
model.addAttribute("regBusSjmain", regBusSjmain);
if(StringUtils.isNotBlank(request.getParameter("ywh"))){
model.addAttribute("YWH", request.getParameter("ywh"));
}
//查看标示
if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
model.addAttribute("VIEWS", request.getParameter("VIEWS"));
}
System.out.println(request.getParameter("DJLX"));
if(StringUtils.isNotBlank(request.getParameter("DJLX"))){
model.addAttribute("DJLX", request.getParameter("DJLX"));
}
User user = UserUtils.getUser();
Office office = officeService.get(user.getCurrentUser().getOffice().getId());
String officeCode = office.getCode();
if ("S00001001001004".equals(officeCode)) {
model.addAttribute("officeCode", "S00001001001004");
}
model.addAttribute("YEAR", DateUtils.getYear());
model.addAttribute("MONTH", DateUtils.getMonth());
return "modules/reg/bus/regBusSjmainForm";
}
//用于附件下载、打印
@RequiresPermissions("reg:bus:regBusSjmain:view")
@RequestMapping(value = "CXform")
public String CXform(RegBusSjmain regBusSjmain, Model model, HttpServletRequest request) {
model.addAttribute("regBusSjmain", regBusSjmain);
if(StringUtils.isNotBlank(request.getParameter("ywh"))){
model.addAttribute("YWH", request.getParameter("ywh"));
}
if(StringUtils.isNotBlank(request.getParameter("DJLX"))){
model.addAttribute("DJLX", request.getParameter("DJLX"));
}
model.addAttribute("YEAR", DateUtils.getYear());
model.addAttribute("MONTH", DateUtils.getMonth());
return "modules/reg/bus/regBusSjmainCXForm";
}
/***
* @Title: issjed
* @Description: 判断是否已经收件
* @param @param request
* @param @return 设定文件
* @return ModelMap 返回类型
* @throws
*/
@RequiresPermissions("reg:bus:regBusSjmain:edit")
@RequestMapping(value = "issjed")
@ResponseBody
public ModelMap issjed(HttpServletRequest request) {
String ywh = request.getParameter("YWH");
RegBusSjmain regBusSjmainTemp = new RegBusSjmain();
regBusSjmainTemp.setYwh(ywh);
List<RegBusSjmain> findList = regBusSjmainService.findList(regBusSjmainTemp);
ModelMap modelMap = new ModelMap();
if(findList.size()>0){
modelMap.put("data", "1");//已经有收件信息记录
}else{
modelMap.put("data", "0");
}
return modelMap;
}
/***
* @Title: issjsubed
* @Description: 判断是否已经收件,子表
* @param @param request
* @param @return 设定文件
* @return ModelMap 返回类型
* @throws
*/
@RequiresPermissions("reg:bus:regBusSjmain:edit")
@RequestMapping(value = "issjsubed")
@ResponseBody
public ModelMap issjsubed(HttpServletRequest request) {
String id = request.getParameter("id");
RegBusSjmain regBusSjmain = regBusSjmainService.get(id);
List<RegBusSjchild> regBusSjchildList = regBusSjmain.getRegBusSjchildList();
ModelMap modelMap = new ModelMap();
if(regBusSjchildList.size()>0){
modelMap.put("data", "1");//已经有收件子表信息记录
}else{
modelMap.put("data", "0");
}
return modelMap;
}
@RequiresPermissions("reg:bus:regBusSjmain:edit")
@RequestMapping(value = "save")
public String save(RegBusSjmain regBusSjmain, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
if (!beanValidator(model, regBusSjmain)){
return form(regBusSjmain, model, request);
}
regBusSjmainService.save(regBusSjmain);
addMessage(redirectAttributes, "保存收件信息成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusSjmain/?repage&&WO=1&ywh="+request.getParameter("YWH") +"&optype="+request.getParameter("optype");
}
@RequiresPermissions("reg:bus:regBusSjmain:edit")
@RequestMapping(value = "delete")
public String delete(RegBusSjmain regBusSjmain, RedirectAttributes redirectAttributes, HttpServletRequest request) {
regBusSjmainService.delete(regBusSjmain);
addMessage(redirectAttributes, "删除收件信息成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusSjmain/?repage&ywh="+ request.getParameter("ywh");
}
}