233631d1dd60bfbaa44315d6e4559f6f38cc5877.svn-base
5.24 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
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.reg.web.base;
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.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
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.RegBaseZdbhqk;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdbhqkService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
/**
* 宗地基本信息变化表单维护Controller
* @author xuyg
* @version 2015-10-20
*/
@Controller
@RequestMapping(value = "${adminPath}/reg/base/regBaseZdbhqk")
public class RegBaseZdbhqkController extends BaseController {
@Autowired
private RegBaseZdbhqkService regBaseZdbhqkService;
@Autowired
private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
@ModelAttribute
public RegBaseZdbhqk get(@RequestParam(required=false) String id) {
RegBaseZdbhqk entity = null;
if (StringUtils.isNotBlank(id)){
entity = regBaseZdbhqkService.get(id);
}
if (entity == null){
entity = new RegBaseZdbhqk();
}
return entity;
}
@RequiresPermissions("reg:base:regBaseZdbhqk:view")
@RequestMapping(value = {"list", ""})
public String list(RegBaseZdbhqk regBaseZdbhqk, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isNotBlank(request.getParameter("YWH"))){
regBaseZdbhqk.setYwh(request.getParameter("YWH"));
model.addAttribute("YWH", request.getParameter("YWH"));
}
//传递宗地代码
if(StringUtils.isNotBlank(request.getParameter("zddm"))){
model.addAttribute("ZDDM", request.getParameter("zddm"));
}
//WinOpen标示
if(StringUtils.isNotBlank(request.getParameter("WO"))){
model.addAttribute("WO", "1");
}
//页面操作类型【新增还是更新】
if(StringUtils.isNotBlank(request.getParameter("optype"))){
model.addAttribute("optype", "update");
}
if(StringUtils.isNotBlank(request.getParameter("LISTVIEWS"))){
model.addAttribute("LISTVIEWS", "1");
}
Page<RegBaseZdbhqk> page = regBaseZdbhqkService.findPage(new Page<RegBaseZdbhqk>(request, response), regBaseZdbhqk);
model.addAttribute("page", page);
return "modules/reg/base/regBaseZdbhqkList";
}
@RequiresPermissions("reg:base:regBaseZdbhqk:view")
@RequestMapping(value = "form")
public String form(RegBaseZdbhqk regBaseZdbhqk, Model model, HttpServletRequest request) {
User user = UserUtils.getUser();
//点击了选择已登记信息后,在宗地情况变化信息添加里,应该过滤出与 已登记信息 有关的宗地基本信息
//by ztk 2016 -01-16 start
String bdcqzsdjxxID = request.getParameter("BdcqzsdjxxID");
if(StringUtils.isNotBlank(bdcqzsdjxxID)){
RegBusBdcqzsdjxx regBusBdcqzsdjxx = regBusBdcqzsdjxxService.get(bdcqzsdjxxID);
if(regBusBdcqzsdjxx != null){
regBaseZdbhqk.setZddm(regBusBdcqzsdjxx.getZddm());
}
}
//by ztk end
model.addAttribute("regBaseZdbhqk", regBaseZdbhqk);
//传递宗地代码
if(StringUtils.isNotBlank(request.getParameter("zddm"))){
model.addAttribute("ZDDM", request.getParameter("zddm"));
}
//查看标示
if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
model.addAttribute("VIEWS", request.getParameter("VIEWS"));
}
if(StringUtils.isNotBlank(request.getParameter("ywh"))){
model.addAttribute("YWH", request.getParameter("ywh"));
}
model.addAttribute("SLR", user.getName());
return "modules/reg/base/regBaseZdbhqkForm";
}
@RequiresPermissions("reg:base:regBaseZdbhqk:edit")
@RequestMapping(value = "save")
public String save(RegBaseZdbhqk regBaseZdbhqk, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
if (!beanValidator(model, regBaseZdbhqk)){
return form(regBaseZdbhqk, model, request);
}
regBaseZdbhqkService.save(regBaseZdbhqk);
addMessage(redirectAttributes, "保存宗地基本信息变化成功");
return "redirect:"+Global.getAdminPath()+"/reg/base/regBaseZdbhqk/?repage&WO=1&YWH="+ request.getParameter("YWH") +"&optype="+request.getParameter("optype");
}
@RequiresPermissions("reg:base:regBaseZdbhqk:edit")
@RequestMapping(value = "delete")
public String delete(RegBaseZdbhqk regBaseZdbhqk, RedirectAttributes redirectAttributes, HttpServletRequest request) {
regBaseZdbhqkService.delete(regBaseZdbhqk);
addMessage(redirectAttributes, "删除宗地基本信息变化成功");
return "redirect:"+Global.getAdminPath()+"/reg/base/regBaseZdbhqk/?repage&YWH="+ request.getParameter("YWH");
}
}