Commit 0a407660 by yangyang

湖南相关接口处理(湖南)

parent d2fcff1e
......@@ -45,12 +45,17 @@ public class GlgxInterface {
// 车牌号能够查出手机号还有身份证号码
if (objectType.equals("01")) {
List<SkRelatedResultInterFace> listResult = new ArrayList<>();
try {
// 车牌号码查询车主信息
HttpClient httpClientCar = new HttpClient();
JSONObject paramsCar = new JSONObject();
paramsCar.put("cphm", objectValue);
JSONObject resultCar = httpClientCar.doPostJsonHunan(hunanUrl + ZjhmBycphm, paramsCar.toJSONString());
JSONObject resultCar = null;
try {
resultCar = httpClientCar.doPostJsonHunan(hunanUrl + ZjhmBycphm, paramsCar.toJSONString());
}catch (Exception e){
e.printStackTrace();
}
if (resultCar == null) {
ArrayList<SkRelatedResultInterFace> res = new ArrayList<>();
return MapRestResult.build(200, "没有对应的数据!", 0, res);
......@@ -67,11 +72,16 @@ public class GlgxInterface {
peopleInfo.setObjectValue(obj.getString("zjhm"));
// 拿到djrq最近定检日期 最新的车主证件号码再去查询手机号
JSONArray jsonArrayPhone = getJzxx(obj.getString("zjhm"), "zjhm");
JSONArray jsonArrayPhone = new JSONArray();
try {
jsonArrayPhone = getJzxx(obj.getString("zjhm"), "zjhm");
}catch (Exception e){
e.printStackTrace();
}
if (jsonArrayPhone.size() > 0) {
for (int i = 0; i < jsonArrayPhone.size(); i++) {
JSONObject objPhone = jsonArrayPhone.getJSONObject(i);
if (Arrays.asList("1", "0", "2").contains(obj.getString("status"))) {// 用户状态(1:在用,0:欠费停机,2:停机,3:注销,9:其它)
if (Arrays.asList("1", "0", "2").contains(objPhone.getString("status"))) {// 用户状态(1:在用,0:欠费停机,2:停机,3:注销,9:其它)
SkRelatedResultInterFace phoneInfo = new SkRelatedResultInterFace();
phoneInfo.setObjectType("03");
phoneInfo.setObjectValue(objPhone.getString("phoneNo"));
......@@ -101,15 +111,17 @@ public class GlgxInterface {
}
}
}
} catch (Exception e) {
return MapRestResult.error("关联关系接口错误!" + e);
}
} else if (objectType.equals("03")) {
//手机号能够了查到身份证号还有车牌号
List<SkRelatedResultInterFace> listResult = new ArrayList<>();
try {
// 手机号码查询机主信息
JSONArray jsonArrayPhone = getJzxx(objectValue, "sjhm");
JSONArray jsonArrayPhone = new JSONArray();
try{
jsonArrayPhone = getJzxx(objectValue, "sjhm");
}catch (Exception e){
e.printStackTrace();
}
if (jsonArrayPhone.size() == 0) {
ArrayList<SkRelatedResultInterFace> res = new ArrayList<>();
return MapRestResult.build(200, "没有对应的数据!", 0, res);
......@@ -126,7 +138,12 @@ public class GlgxInterface {
HttpClient httpClientPhone = new HttpClient();
JSONObject paramsPhone = new JSONObject();
paramsPhone.put("zjhm", obj.getString("idCard"));
JSONObject resultCar = httpClientPhone.doPostJsonHunan(hunanUrl + cphmByZjhm, paramsPhone.toJSONString());
JSONObject resultCar = null;
try{
resultCar = httpClientPhone.doPostJsonHunan(hunanUrl + cphmByZjhm, paramsPhone.toJSONString()); }catch (Exception e){
e.printStackTrace();
}
if (null != resultCar) { // 解析返回结果
if ("success".equals(resultCar.getString("status"))) {
JSONArray jsonArrayCar = JSONObject.parseObject(resultCar.get("data").toString()).getJSONArray("rows");
......@@ -156,18 +173,20 @@ public class GlgxInterface {
newList.add(skRelatedResultVO);
return MapRestResult.build(200, "成功获取关联信息!", 1, newList);
}
} catch (Exception e) {
return MapRestResult.error("关联关系接口错误!" + e);
}
} else if (objectType.equals("02")) {
List<SkRelatedResultInterFace> listResult = new ArrayList<>();
try {
//身份证号查询出来车牌号还有手机号
if (null == objectValue) {
return MapRestResult.error("无法查询此标识号值");
}
// 解析返回结果
JSONArray jsonArrayPhone = getJzxx(objectValue, "zjhm");
JSONArray jsonArrayPhone = new JSONArray();;
try {
jsonArrayPhone = getJzxx(objectValue, "zjhm");
}catch (Exception e){
e.printStackTrace();
}
if (jsonArrayPhone.size() > 0) {
for (int i = 0; i < jsonArrayPhone.size(); i++) {
JSONObject obj = jsonArrayPhone.getJSONObject(i);
......@@ -189,8 +208,14 @@ public class GlgxInterface {
HttpClient httpClientCar = new HttpClient();
JSONObject paramsCar = new JSONObject();
paramsCar.put("zjhm", objectValue);
JSONObject resultCar = httpClientCar.doPostJsonHunan(hunanUrl + cphmByZjhm, paramsCar.toJSONString());
if (null != resultCar) { // 解析返回结果
JSONObject resultCar = null;
try {
resultCar = httpClientCar.doPostJsonHunan(hunanUrl + cphmByZjhm, paramsCar.toJSONString());
} catch (Exception e) {
e.printStackTrace();
}
if (null != resultCar) { // 解析返回结果
if ("success".equals(resultCar.getString("status"))) {
JSONArray jsonArray = JSONObject.parseObject(resultCar.get("data").toString()).getJSONArray("rows");
if (jsonArray.size() > 0) {
......@@ -220,10 +245,6 @@ public class GlgxInterface {
newList.add(skRelatedResultVO);
return MapRestResult.build(200, "成功获取关联信息!", 1, newList);
}
} catch (Exception e) {
e.printStackTrace();
return MapRestResult.error("关联关系接口错误!" + e);
}
} else {
return MapRestResult.error("无法查询此标识号类型");
}
......
......@@ -213,18 +213,8 @@
DATE_FORMAT(T.asjfssj_Asjfskssj,'%Y-%m-%d %H:%i:%S') as asjfssjAsjfskssj,
DATE_FORMAT(T.larq,'%Y-%m-%d %H:%i:%S') as larq,
T.ZUZDW_ZBR_XM AS zuzdwZbrXm,
case when (T.ASJFSDD_DQJD is not null) then T.ASJFSDD_DQJD
when (T.ASJFSDD_DQWD is null and (select xk_jd from tb_asj_jwdinfo info where info.asjbh = T.asjbh)is not null)
then (select xk_jd from tb_asj_jwdinfo info where info.asjbh = T.asjbh)
when((select xk_jd from tb_asj_jwdinfo info where info.asjbh = T.asjbh)is null and (select jq_jd from
tb_asj_jwdinfo info where info.asjbh = T.asjbh) is not null)then (select jq_jd from tb_asj_jwdinfo info where
info.asjbh = T.asjbh) end as x,
case when (T.ASJFSDD_DQJD is not null) then T.ASJFSDD_DQWD
when (T.ASJFSDD_DQWD is null and (select xk_wd from tb_asj_jwdinfo info where info.asjbh = T.asjbh)is not null)
then (select xk_wd from tb_asj_jwdinfo info where info.asjbh = T.asjbh)
when((select xk_wd from tb_asj_jwdinfo info where info.asjbh = T.asjbh)is null and (select jq_wd from
tb_asj_jwdinfo info where info.asjbh = T.asjbh) is not null)then (select jq_wd from tb_asj_jwdinfo info where
info.asjbh = T.asjbh) end as y,
T.ASJFSDD_DQJD AS x,
T.ASJFSDD_DQWD AS y,
(select name from sys_dictitem where groupid='CODE_UNIT' AND code = T.zuzdw_Gajgjgdm) AS zuzdwGajgjgdmMc,
(select name from sys_dictitem where groupid='CODE_ZCJDDM' AND code = T.zcjddm) AS zcjddmMc,
(select name from sys_dictitem where groupid='CODE_UNIT' AND code = T.ladw_Gajgjgdm) AS ladwGajgjgdmMc,
......
......@@ -140,7 +140,7 @@
and th.THGLXYRSL = 2
and th.THGLAJSL = 2
</if>
<if test="(ryxm != null and ryxm != '') or (hjd != null and hjd != '')">
<if test="(ryxm != null and ryxm != '') or (hjd != null and hjd != '') or (zjhm != null and zjhm != '')">
and th.thbh in (select thxyr.thbh from tb_yw_shse_thglxyr thxyr
<where>
1 = 1
......@@ -150,6 +150,9 @@
<if test="hjd != null and hjd != ''">
and thxyr.HJDDM = #{hjd}
</if>
<if test="zjhm != null and zjhm != ''">
and thxyr.ZJHM = #{zjhm}
</if>
</where>
)
</if>
......@@ -206,7 +209,7 @@
and th.THGLXYRSL = 2
and th.THGLAJSL = 2
</if>
<if test="(ryxm != null and ryxm != '') or (hjd != null and hjd != '')">
<if test="(ryxm != null and ryxm != '') or (hjd != null and hjd != '')or (zjhm != null and zjhm != '')">
and th.thbh in (select thxyr.thbh from tb_yw_shse_thglxyr thxyr
<where>
1 = 1
......@@ -216,6 +219,9 @@
<if test="hjd != null and hjd != ''">
and thxyr.HJDDM = #{hjd}
</if>
<if test="zjhm != null and zjhm != ''">
and thxyr.ZJHM = #{zjhm}
</if>
</where>
)
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment