修改南京银行对私涉农逻辑
This commit is contained in:
@@ -19,6 +19,7 @@ public class Township implements MongoEntity {
|
||||
private String street;
|
||||
private String pid;
|
||||
private String id;
|
||||
private String hasGov;
|
||||
@JSONField(name = "tjj_province_code")
|
||||
private String tjjProvinceCode;
|
||||
|
||||
@@ -325,4 +326,13 @@ public class Township implements MongoEntity {
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Column(name = "has_gov")
|
||||
public String getHasGov() {
|
||||
return hasGov;
|
||||
}
|
||||
|
||||
public void setHasGov(String hasGov) {
|
||||
this.hasGov = hasGov;
|
||||
}
|
||||
}
|
||||
|
||||
+39
-1
@@ -3,9 +3,11 @@ package com.fangjia.open.controllers;
|
||||
import com.fangjia.core.util.DataUtil;
|
||||
import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.dal.mongo.model.DistrictAnalyData;
|
||||
import com.fangjia.dal.mongo.model.Township;
|
||||
import com.fangjia.dal.mongo.model.VillageIdentify;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.open.APIConstant;
|
||||
import com.fangjia.open.FangjiaApiUtil;
|
||||
import com.fangjia.open.dto.UniversalDto;
|
||||
import com.fangjia.open.dto.addressGovernance.DistrictDto;
|
||||
import com.fangjia.open.dto.addressGovernance.DistrictIdentifyDto;
|
||||
@@ -21,6 +23,7 @@ import com.fangjia.open.util.CommonDtoUtils;
|
||||
import com.fangjia.service.bo.DistrictAvgBo;
|
||||
import com.fangjia.service.datastore.DistrictService;
|
||||
import com.fangjia.service.district.DistrictStatService;
|
||||
import com.fangjia.service.mongo.fangjia.TownshipService;
|
||||
import com.fangjia.service.mongo.fangjia.VillageIdentifyService;
|
||||
import com.fangjia.service.open.DistrictAnalyDataService;
|
||||
import com.google.gson.Gson;
|
||||
@@ -63,6 +66,7 @@ public class AddrSvcController {
|
||||
private DistrictService districtService;
|
||||
private VillageIdentifyService villageIdentifyService;
|
||||
private DistrictAnalyDataService districtAnalyDataService;
|
||||
private TownshipService townshipService;
|
||||
|
||||
/**
|
||||
* 地址结构化
|
||||
@@ -972,7 +976,6 @@ public class AddrSvcController {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (json != null) {
|
||||
int code = json.getInt("msgCode");
|
||||
String msg = json.getString("msg");
|
||||
@@ -980,6 +983,37 @@ public class AddrSvcController {
|
||||
if (json.containsKey("result")) {
|
||||
//我们的结果
|
||||
JSONObject result = json.getJSONObject("result");
|
||||
String userId = FangjiaApiUtil.parseUserId(model.getToken());
|
||||
if("对私".equals(villageType) && ("1007801".equals(userId) || "1007497".equals(userId))){
|
||||
result.remove("verifyFlag");
|
||||
if(result.containsKey("district")){
|
||||
String district = result.getString("district");
|
||||
if(district != null){
|
||||
if(district.endsWith("区")){
|
||||
result.put("verifyFlag", "非农");
|
||||
}else if(result.containsKey("countyGov") && StringUtils.isNotBlank(result.getString("countyGov"))){
|
||||
String countyGov = result.getString("countyGov");
|
||||
if("是".equals(countyGov)){
|
||||
result.put("verifyFlag", "非农");
|
||||
} else if ("否".equals(countyGov)) {
|
||||
result.put("verifyFlag", "农");
|
||||
}
|
||||
}else if(result.containsKey("townCode")){
|
||||
String townCode = result.getString("townCode");
|
||||
Township township = townshipService.findTownshipByCode(townCode);
|
||||
if(township != null){
|
||||
String countyGov = "是".equals(township.getHasGov())?"是":"否";
|
||||
result.put("countyGov", countyGov);
|
||||
if("是".equals(countyGov)){
|
||||
result.put("verifyFlag", "非农");
|
||||
} else {
|
||||
result.put("verifyFlag", "农");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
basicModel.setResult(result);
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
@@ -1788,4 +1822,8 @@ public class AddrSvcController {
|
||||
public void setDistrictAnalyDataService(DistrictAnalyDataService districtAnalyDataService) {
|
||||
this.districtAnalyDataService = districtAnalyDataService;
|
||||
}
|
||||
|
||||
public void setTownshipService(TownshipService townshipService) {
|
||||
this.townshipService = townshipService;
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -46,4 +46,7 @@ public interface TownshipService {
|
||||
*/
|
||||
public Township findTownship(String id);
|
||||
|
||||
|
||||
public Township findTownshipByCode(String code);
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -87,6 +87,13 @@ public class TownshipServiceImpl implements TownshipService {
|
||||
return townshipDao.findById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Township findTownshipByCode(String streetCode) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("tjjStreetCode", streetCode));
|
||||
return townshipDao.findFirstByParams( params);
|
||||
}
|
||||
|
||||
public void setTownshipDao(TownshipDao townshipDao) {
|
||||
this.townshipDao = townshipDao;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user