f6d1cc9c45d33d8b0335e3ea0ac3d8be5e72e70a.svn-base
8.13 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
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.reg.service.base;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.JsonUtil;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.reg.dao.base.RegBaseZdjbxxDao;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseChxx11;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdjbxx;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import com.thinkgem.jeesite.modules.title.buss.RemoteBuss;
import com.thinkgem.jeesite.modules.title.po.ZdjbxxDto;
/**
* 宗地基本信息表单维护Service
* @author xuyg
* @version 2015-10-12
*/
@Service
@Transactional(readOnly = true)
public class RegBaseZdjbxxService extends CrudService<RegBaseZdjbxxDao, RegBaseZdjbxx> {
@Autowired
private RemoteBuss buss;
@Autowired
private RegBaseChxx11Service regBaseChxxService;
public RegBaseZdjbxx get(String id) {
return super.get(id);
}
public List<RegBaseZdjbxx> findList(RegBaseZdjbxx regBaseZdjbxx) {
return super.findList(regBaseZdjbxx);
}
public List<RegBaseZdjbxx> findListdyhcf(RegBaseZdjbxx regBaseZdjbxx) {
return dao.findListdyhcf(regBaseZdjbxx);
}
/***
* @Title: findChoicePage
* @Description: 返回已登记已登簿宗地代码集合的宗地信息
* @param @param page
* @param @param regBaseZdjbxx
* @param @param zddms
* @param @return 设定文件
* @return Page<RegBaseZdjbxx> 返回类型
* @throws
*/
public Page<RegBaseZdjbxx> findChoicePage(Page<RegBaseZdjbxx> page, RegBaseZdjbxx regBaseZdjbxx, List<String> zddmList) {
regBaseZdjbxx.setPage(page);
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("DEL_FLAG_NORMAL", regBaseZdjbxx.getDelFlag());
paramMap.put("dbName", regBaseZdjbxx.getDbName());
paramMap.put("zddm", regBaseZdjbxx.getZddm());
paramMap.put("bdcdyh", regBaseZdjbxx.getBdcdyh());
paramMap.put("status", regBaseZdjbxx.getStatus());
paramMap.put("islogout", regBaseZdjbxx.getIslogout());
paramMap.put("zddmList", zddmList);
page.setList(dao.findChoiceList(paramMap));
return page;
}
public Page<RegBaseZdjbxx> findPage(Page<RegBaseZdjbxx> page, RegBaseZdjbxx regBaseZdjbxx) {
return super.findPage(page, regBaseZdjbxx);
}
public Page<RegBaseZdjbxx> findFwlinkPage(Page<RegBaseZdjbxx> page, RegBaseZdjbxx regBaseZdjbxx) {
return super.findFwlinkPage(page, regBaseZdjbxx);
}
/**
* @Title: findMaxZddm
* @Description: 查询当前数据库里最大的宗地代码
* @param @return 设定文件
* @return String 返回类型
* @throws
*/
public String findMaxZddm(){
return dao.findMaxZddm();
}
/***
* @Title: findMaxZddmByDistrict
* @Description: 获取最大宗地代码顺序号,依据地籍子区累计,用于宗地代码生成
* @param @return 设定文件
* @return String 返回类型
* @throws
*/
public synchronized String findMaxZddmByDistrict(String district){
if("oracle".equals(Global.getDbName())){
return dao.findMaxZddmByDistrictOfOracle(district);
}else{
return dao.findMaxZddmByDistrict(district);
}
}
@Transactional(readOnly = false)
public void save(RegBaseZdjbxx regBaseZdjbxx) {
super.save(regBaseZdjbxx);
//切面实现:测绘信息被引用点
/*if(StringUtils.isNotBlank(regBaseZdjbxx.getChid())){
RegBaseChxx regBaseChxx = regBaseChxxService.get(regBaseZdjbxx.getChid());
regBaseChxx.setIsaudit("2");
regBaseChxxService.save(regBaseChxx);
}*/
}
@Transactional(readOnly = false)
public void delete(RegBaseZdjbxx regBaseZdjbxx) {
Logger logger = LoggerFactory.getLogger(getClass());
logger.info("********************开始调用宗地删除********************");
logger.info("当前时间:{}", DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
logger.info("当前用户:{}", UserUtils.getUser().getLoginName());
logger.info("********************结束调用宗地删除********************");
/*if(StringUtils.isNotBlank(regBaseZdjbxx.getChid())){
RegBaseChxx regBaseChxx = regBaseChxxService.get(regBaseZdjbxx.getChid());
regBaseChxx.setIsaudit("1");
regBaseChxxService.save(regBaseChxx);
}*/
super.delete(regBaseZdjbxx);
}
@Transactional(readOnly = false)
public void update(RegBaseZdjbxx regBaseZdjbxx) {
super.save(regBaseZdjbxx);
/*if(StringUtils.isNotBlank(regBaseZdjbxx.getChid())){
RegBaseChxx regBaseChxx = regBaseChxxService.get(regBaseZdjbxx.getChid());
// regBaseChxx.setIsaudit("1");
regBaseChxxService.save(regBaseChxx);
}*/
}
@Transactional(readOnly = false)
public void deleteRegBaseZdjbxx(RegBaseZdjbxx regBaseZdjbxx) {
super.delete(regBaseZdjbxx);
}
/**
* @Title: getNextZddm
* @Description: 获取下一个宗地代码
* @param @param maxZddm
* @param @param ruleCode
* @param @return 设定文件
* @return String 返回类型
* @throws
*/
public synchronized String getNextZddm(String maxZddm, String ruleCode) {
String nextZddm = ruleCode + "00001";
//如果数据里的最大宗地代码不为空,就取出来进行处理;否则直接默认值
if(StringUtils.isNotBlank(maxZddm)){
int nextSerNum = Integer.parseInt(maxZddm) + 1;
if (nextSerNum < 10) {
nextZddm = ruleCode + "0000" + nextSerNum;
}else if (nextSerNum < 100) {
nextZddm = ruleCode + "000" + nextSerNum;
}else if (nextSerNum < 1000) {
nextZddm = ruleCode + "00" + nextSerNum;
}else if (nextSerNum < 10000) {
nextZddm = ruleCode + "0" + nextSerNum;
}else {
nextZddm = ruleCode + nextSerNum;
}
}
return nextZddm;
}
//楼栋找地
public RegBaseZdjbxx zrzgetdy(String bdcdyh){
return super.zrzgetdy(bdcdyh);
}
public RegBaseZdjbxx getQlrByDy(String ybdcdyh) {
// TODO Auto-generated method stub
return dao.getQlrByDy(ybdcdyh);
}
/**
* 权籍系统传送数据更新
* @param regBaseZdjbxx
*/
@Transactional(readOnly = false)
public void saveObject(RegBaseZdjbxx regBaseZdjbxx) {
super.save(regBaseZdjbxx);
}
public void postData(RegBaseZdjbxx regBaseZdjbxxNew) {
if(Global.isTitle()) {
ZdjbxxDto zdjbxx = new ZdjbxxDto();
BeanUtils.copyProperties(regBaseZdjbxxNew, zdjbxx);
zdjbxx.setYt(DictUtils.getDictValue(regBaseZdjbxxNew.getYt(), "reg_bus_tdyt", ""));
String url = Global.getTitleUrl() + "/inte/post/zdxxdata";
Map params = JsonUtil.ObjectoMap(zdjbxx);
String content = "";
try {
content = buss.posturl(params, url);
} catch (IOException e) {
e.printStackTrace();
}
}
}
public List<RegBaseZdjbxx> findListqj(RegBaseZdjbxx zdjbxx) {
// TODO Auto-generated method stub
return dao.findListqj(zdjbxx);
}
public void deleteqj(RegBaseZdjbxx zdjbxx) {
dao.deleteqj(zdjbxx);
}
public RegBaseZdjbxx getdyqj(String zddm) {
// TODO Auto-generated method stub
return dao.getdyqj(zddm);
}
public void saveZb(RegBaseZdjbxx zdjbxx) {
// TODO Auto-generated method stub
dao.saveZb(zdjbxx);
}
@Transactional(readOnly = false)
public void deleteNf(RegBaseZdjbxx regBaseZdjbxx) {
Logger logger = LoggerFactory.getLogger(getClass());
logger.info("********************开始调用宗地删除********************");
logger.info("当前时间:{}", DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
logger.info("当前用户:{}", UserUtils.getUser().getLoginName());
logger.info("********************结束调用宗地删除********************");
if(StringUtils.isNotBlank(regBaseZdjbxx.getChid())){
RegBaseChxx11 regBaseChxx = regBaseChxxService.get(regBaseZdjbxx.getChid());
regBaseChxxService.delete(regBaseChxx);
}
super.delete(regBaseZdjbxx);
}
}