ec6b52c83d21f3e43d72aa5199783e6769b9c25a.svn-base
9.08 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
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.reg.web.nf;
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 com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.common.web.BaseController;
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.RegBaseXm;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZbinfoZrz;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdbhqk;
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.base.RegBaseZrzchxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusJsydsyq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusQlr;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseCService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseHService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseXmService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdbhqkService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdjbxxService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZrzService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZrzchxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusJsydsyqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusQlrService;
/**
* 农房入库数据信息维护Controller
*
*/
@Controller
@RequestMapping(value = "${adminPath}/reg/nf/regBusNf")
public class RegBusNfController extends BaseController {
@Autowired
private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
@Autowired
private RegBaseZrzService regBaseZrzService;
@Autowired
private RegBusJsydsyqService regBusJsydsyqService;
@Autowired
private RegBusQlrService regBusQlrService;
@Autowired
private RegBaseZdbhqkService regBaseZdbhqkService;
@Autowired
private RegBaseZdjbxxService regBaseZdjbxxService;
@Autowired
private RegBaseXmService regBaseXmService;
@Autowired
private RegBaseCService regBaseCService;
@Autowired
private RegBaseHService regBaseHService;
@Autowired
private RegBaseZrzchxxService regBaseZrzchxxService;
@ModelAttribute
public RegBusBdcqzsdjxx get(@RequestParam(required = false) String id) {
RegBusBdcqzsdjxx entity = null;
if (StringUtils.isNotBlank(id)) {
entity = regBusBdcqzsdjxxService.get(id);
}
if (entity == null) {
entity = new RegBusBdcqzsdjxx();
}
return entity;
}
/*
* 地
*/
@RequiresPermissions("reg:bus:regBusNf:view")
@RequestMapping(value = { "list", "" })
public String list(RegBusBdcqzsdjxx regBusBdcqzsdjxx, HttpServletRequest request, HttpServletResponse response, Model model) {
regBusBdcqzsdjxx.setYwh("LZ");
Page<RegBusBdcqzsdjxx> page = regBusBdcqzsdjxxService.selectNfPage(new Page<RegBusBdcqzsdjxx>(request, response), regBusBdcqzsdjxx);
model.addAttribute("page", page);
model.addAttribute("regBusBdcqzsdjxx", regBusBdcqzsdjxx);
return "modules/reg/nf/regBusBdcqzsdjxxList";
}
@RequiresPermissions("reg:bus:regBusNf:view")
@RequestMapping(value = "delete")
public String delete(RegBusBdcqzsdjxx regBusBdcqzsdjxx, Model model, HttpServletRequest request) {
if(StringUtils.isNotBlank(regBusBdcqzsdjxx.getId())) {
RegBusJsydsyq jsydsyq = new RegBusJsydsyq();
jsydsyq.setYwh(regBusBdcqzsdjxx.getYwh());
jsydsyq.setBdcdyh(regBusBdcqzsdjxx.getBdcdyh());
List<RegBusJsydsyq> syqlist = regBusJsydsyqService.findList(jsydsyq);
if(syqlist.size()>0) {
for(int i=0;i<syqlist.size();i++) {
regBusJsydsyqService.delete(syqlist.get(i));
}
}
RegBusQlr qlr = new RegBusQlr();
qlr.setYwh(regBusBdcqzsdjxx.getYwh());
qlr.setBdcdyh(regBusBdcqzsdjxx.getBdcdyh());
List<RegBusQlr> qlrlist = regBusQlrService.findList_1(qlr);
if(qlrlist.size()>0) {
for(int q=0;q<qlrlist.size();q++) {
regBusQlrService.delete(qlrlist.get(q));
}
}
RegBaseZdbhqk zdbhqk = new RegBaseZdbhqk();
zdbhqk.setZddm(regBusBdcqzsdjxx.getZddm());
List<RegBaseZdbhqk> bhqklist = regBaseZdbhqkService.findList(zdbhqk);
if(bhqklist.size()>0) {
for(int b=0;b<bhqklist.size();b++) {
regBaseZdbhqkService.delete(bhqklist.get(b));
}
}
RegBaseZdjbxx zdjbxx = new RegBaseZdjbxx();
zdjbxx.setZddm(regBusBdcqzsdjxx.getZddm());
zdjbxx.setBdcdyh(regBusBdcqzsdjxx.getBdcdyh());
List<RegBaseZdjbxx> jbxxlist = regBaseZdjbxxService.findList(zdjbxx);
if(jbxxlist.size()>0) {
for(int d = 0;d<jbxxlist.size();d++) {
regBaseZdjbxxService.deleteNf(jbxxlist.get(d));
}
}
regBusBdcqzsdjxxService.delete(regBusBdcqzsdjxx);
}
return "redirect:" + Global.getAdminPath() + "/reg/nf/regBusNf/list?id="+regBusBdcqzsdjxx.getId();
}
/*
* 房
*/
@RequiresPermissions("reg:bus:regBusNf:view")
@RequestMapping(value = { "zrzlist", "" })
public String zrzlist(RegBaseZrz regBaseZrz, HttpServletRequest request, HttpServletResponse response, Model model) {
regBaseZrz.setBdcdyh("JC");
regBaseZrz.setRemarks("1");
Page<RegBaseZrz> page = regBaseZrzService.findPage(new Page<RegBaseZrz>(request, response), regBaseZrz);
model.addAttribute("page", page);
model.addAttribute("regBaseZrz", regBaseZrz);
return "modules/reg/nf/regBaseZrzList";
}
@RequiresPermissions("reg:bus:regBusNf:view")
@RequestMapping(value = "fwdelete")
public String fwdelete(RegBaseZrz regBaseZrz, Model model, HttpServletRequest request) {
String zrzid = request.getParameter("zrzid");
regBaseZrz = regBaseZrzService.get(zrzid);
if(regBaseZrz != null) {
RegBaseH h = new RegBaseH();
h.setBdcdyh(regBaseZrz.getBdcdyh().substring(0, 24));
List<RegBaseH> hlist = regBaseHService.findList(h);
if(hlist.size()>0) {
for(int i=0;i<hlist.size();i++) {
regBaseHService.delete(hlist.get(i));
}
}
RegBaseC c = new RegBaseC();
c.setZid(regBaseZrz.getId());
List<RegBaseC> clist = regBaseCService.findList(c);
if(clist.size()>0) {
for(int q=0;q<clist.size();q++) {
regBaseCService.delete(clist.get(q));
}
}
RegBaseZrzchxx zrzchxx = new RegBaseZrzchxx();
zrzchxx.setBdcdyh(regBaseZrz.getZddm());
List<RegBaseZrzchxx> zrzchxxlist = regBaseZrzchxxService.findList(zrzchxx);
if(zrzchxxlist.size()>0) {
for(int d = 0;d<zrzchxxlist.size();d++) {
regBaseZrzchxxService.chdelete(zrzchxxlist.get(d));
}
}
RegBaseXm xm = new RegBaseXm();
xm.setId(regBaseZrz.getXmid());
xm.setXmmc(regBaseZrz.getXmmc());
List<RegBaseXm> xmlist = regBaseXmService.findList(xm);
if(xmlist.size()>0) {
for(int x=0;x<xmlist.size();x++) {
regBaseXmService.delete(xmlist.get(x));
}
}
regBaseZrzService.delete(regBaseZrz);
}
return "redirect:" + Global.getAdminPath() + "/reg/nf/regBusNf/zrzlist?zrzid="+regBaseZrz.getId();
}
@RequiresPermissions("reg:bus:regBusNf:view")
@RequestMapping(value = "isdelete")
@ResponseBody
public ModelMap queryinfo(HttpServletRequest request) {
ModelMap modelmap = new ModelMap();
String id = request.getParameter("id");
RegBusBdcqzsdjxx djxx = regBusBdcqzsdjxxService.get(id);
String zrzid = request.getParameter("zrzid");
RegBaseZrz zrz = regBaseZrzService.get(zrzid);
if(StringUtils.isNotBlank(id) && djxx != null) {
RegBusBdcqzsdjxx djxx1 = new RegBusBdcqzsdjxx();
djxx1.setBdcdyh(djxx.getZddm()+"F");
djxx1.setDjlx("220521");
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx1);
if(djxxlist.size()>0) {
modelmap.put("yw", "1");
}
RegBaseZrz zrz11 = new RegBaseZrz();
zrz11.setZddm(djxx.getZddm());
List<RegBaseZrz> zrzlist = regBaseZrzService.findList(zrz11);
if(zrzlist.size()>0) {
modelmap.put("fw", "1");
}
}
if(StringUtils.isNotBlank(zrzid) && zrz != null) {
RegBusBdcqzsdjxx djxx1 = new RegBusBdcqzsdjxx();
djxx1.setBdcdyh(zrz.getZddm()+"F");
djxx1.setDjlx("220521");
List<RegBusBdcqzsdjxx> djxxlist = regBusBdcqzsdjxxService.findList(djxx1);
if(djxxlist.size()>0) {
modelmap.put("yw", "1");
}
}
return modelmap;
}
}