|
|
|
@@ -272,7 +272,7 @@ public class AsyncTask { |
|
|
|
//查询所有匹配了poi的 |
|
|
|
TtMerchantPoi poiQ = new TtMerchantPoi(); |
|
|
|
poiQ.updateTenantInfo(tenantEntity); |
|
|
|
Map<String,Long> poiMerchantIdMap = ttMerchantPoiService.queryPoiMerchantIdMap(poiQ); |
|
|
|
Map<String,TtMerchantPoi> poiMerchantMap = ttMerchantPoiService.queryPoiMerchantMap(poiQ); |
|
|
|
|
|
|
|
//查询所有商户 |
|
|
|
WxMerchant merchantQ = new WxMerchant(); |
|
|
|
@@ -282,6 +282,31 @@ public class AsyncTask { |
|
|
|
try { |
|
|
|
successList.parallelStream().forEach(poiBase -> { |
|
|
|
try { |
|
|
|
String poiId = poiBase.getPoiId(); |
|
|
|
if (StringUtils.isNotBlank(poiId) && null != poiMerchantMap) { |
|
|
|
TtMerchantPoi tm = poiMerchantMap.get(poiId); |
|
|
|
if (null != tm) { |
|
|
|
if (tm.getId() > 0 ) { |
|
|
|
poiBase.setMerchantId(String.valueOf(tm.getId())); |
|
|
|
poiBase.setProvince(tm.getProvince()); |
|
|
|
poiBase.setCity(tm.getCity()); |
|
|
|
poiBase.setAddress(tm.getAddress()); |
|
|
|
poiBase.setLongitude(tm.getLongitude()); |
|
|
|
poiBase.setLatitude(tm.getLatitude()); |
|
|
|
poiBase.setGaodeRemark("已匹配过,无需查询高德匹配"); |
|
|
|
}else { |
|
|
|
poiBase.setMerchantId(null); |
|
|
|
poiBase.setMerchantName("多个商户已匹配该POI,请手动输入商户信息"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (null != merchantMap && null != tm && tm.getId() > 0) { |
|
|
|
WxMerchant m = merchantMap.get(tm.getId()); |
|
|
|
if (null != m) { |
|
|
|
poiBase.setMerchantName(m.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(poiBase.getProvince()) && StringUtils.isNotBlank(poiBase.getCity()) |
|
|
|
&& StringUtils.isNotBlank(poiBase.getAddress()) && null != poiBase.getLongitude() && null != poiBase.getLatitude()) { |
|
|
|
//do nothing |
|
|
|
@@ -302,23 +327,7 @@ public class AsyncTask { |
|
|
|
poiBase.setGaodeRemark("未匹配到信息"); |
|
|
|
} |
|
|
|
} |
|
|
|
String poiId = poiBase.getPoiId(); |
|
|
|
if (StringUtils.isNotBlank(poiId) && null != poiMerchantIdMap) { |
|
|
|
Long merchantId = poiMerchantIdMap.get(poiId); |
|
|
|
if (null != merchantId) { |
|
|
|
if (merchantId > 0 ) { |
|
|
|
poiBase.setMerchantId(String.valueOf(merchantId)); |
|
|
|
}else { |
|
|
|
poiBase.setMerchantId("多个商户已匹配该POI,请手动输入"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (null != merchantMap && null != merchantId && merchantId > 0) { |
|
|
|
WxMerchant m = merchantMap.get(merchantId); |
|
|
|
if (null != m) { |
|
|
|
poiBase.setMerchantName(m.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (UnknownSessionException ue) { |
|
|
|
logger.error("session :"+ue.getMessage()); |
|
|
|
|