a6cb8e5ed9fb84e75dbeba84bbdf3df6e9243ebc.svn-base
3.15 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
package com.thinkgem.jeesite.modules.information.service;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Lists;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.collect.Maps;
import com.thinkgem.jeesite.common.utils.JsonUtil;
import com.thinkgem.jeesite.modules.reg.dao.base.RegBaseHDao;
import com.thinkgem.jeesite.modules.reg.dao.base.RegBaseZrzDao;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseH;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZrz;
import com.thinkgem.jeesite.common.utils.StringUtils;
@Service
@Transactional(readOnly = true)
public class InformationService {
@Autowired
private RegBaseHDao regBaseHDao;
@Autowired
private RegBaseZrzDao regBaseZrzDao;
public Map getInformation(String jsonstr) {
Map resmap = Maps.newHashMap();
List jsonList = JsonUtil.ObjectToList(jsonstr);
for (int i = 0; i < jsonList.size(); i++) {
Map jsonobj = (Map)jsonList.get(i);
String lcdm = jsonobj.containsKey("lcdm")?jsonobj.get("lcdm").toString() : "";
String lcxlmc = jsonobj.containsKey("lcxlmc")?jsonobj.get("lcxlmc").toString() : "";//流程小类名称
String qydm = jsonobj.containsKey("qydm")?jsonobj.get("qydm").toString() : "";//区域代码
if( StringUtils.isEmpty(lcdm) || StringUtils.isEmpty(qydm) ) {
resmap.put("data", false);
resmap.put("rtnMessage", "缺少必传参数,请补充!");
resmap.put("txStatus", "0");
return resmap;
}else {
if(jsonobj.containsKey("bdcdyh")) {
Map ckeckBd = Maps.newHashMap();
List bdcdyhList = jsonobj.containsKey("bdcdyh")? (List)jsonobj.get("bdcdyh") : Lists.newArrayList();
ckeckBd = ckeckBdcdyh(bdcdyhList);
resmap.put("data",ckeckBd);
}
}
}
return resmap;
}
/**
* 4.5根据房屋不动产单元号提取不动产单元信息
* @param bdcdyhList
* @return
*/
private Map ckeckBdcdyh(List bdcdyhList) {
List list = new ArrayList();
Map resmap = Maps.newHashMap();
for (int j = 0; j < bdcdyhList.size(); j++) {
RegBaseH regBaseH = new RegBaseH();
regBaseH.setBdcdyh(bdcdyhList.get(j).toString());
String setBdcd = bdcdyhList.get(j).toString();
RegBaseH h = regBaseHDao.findByBdcdyh(regBaseH);
if(h == null ) {
resmap.put("data", false);
resmap.put("rtnMessage", "不动产单元号:"+bdcdyhList.get(j).toString()+"查询的有效证号与已传输证号不符,请核验!");
resmap.put("txStatus", "0");
return resmap;
}
String bdcqzs = (String) bdcdyhList.get(j);
String bdcqzsSub = bdcqzs.substring(0, 24);
String regBaseZrz = regBaseZrzDao.findByBdcqzsSub(bdcqzsSub);
String subs = regBaseZrz.substring(0, 10);
Map map = Maps.newHashMap();
map.put("jgsj",subs);
map.put("zh","");
map.put("syqjssj","");
map.put("syqqssj","");
map.put("sfyg","");
map.put("sfygdy","");
map.put("sfdyi","");
list.add(map);
}
resmap.put("bdcxx",list);
return resmap;
}
}