Commit 16878755 authored by 刘喆's avatar 刘喆

update DimRichAsyncFunction bug

parent 67701600
......@@ -79,59 +79,70 @@ public class DimRichAsyncFunction extends RichAsyncFunction<MlPreciseExposureBea
//解决方案:dimCityCache缓存中的key既有城市ID又有城市TAGID,获取到城市对象后将正确的城市ID填充到Current_city_id中
if (current_city_id != null) {
DimCity dimCity = dimCityCache.getValue(current_city_id, new DimTableCallable(current_city_id, DimTableList.DIM_CITY.getTableName(), dimJdbcUrl));
if (dimCity.getName() == null) {
dimCityCache.invalidate(current_city_id);
} else {
mlPreciseExposureBean.setCurrent_city_id(dimCity.getCode());
mlPreciseExposureBean.setCurrent_city_name(dimCity.getName());
mlPreciseExposureBean.setCurrent_province_id(dimCity.getParent_province_code());
mlPreciseExposureBean.setCurrent_province_name(dimCity.getParent_province_name());
mlPreciseExposureBean.setCurrent_country_id(dimCity.getParent_country_code());
mlPreciseExposureBean.setCurrent_country_name(dimCity.getParent_country_name());
mlPreciseExposureBean.setCurrent_region_id(dimCity.getParent_region_code());
mlPreciseExposureBean.setCurrent_region_name(dimCity.getParent_region_name());
if (dimCity != null) {
if (dimCity.getName() == null) {
dimCityCache.invalidate(current_city_id);
} else {
mlPreciseExposureBean.setCurrent_city_id(dimCity.getCode());
mlPreciseExposureBean.setCurrent_city_name(dimCity.getName());
mlPreciseExposureBean.setCurrent_province_id(dimCity.getParent_province_code());
mlPreciseExposureBean.setCurrent_province_name(dimCity.getParent_province_name());
mlPreciseExposureBean.setCurrent_country_id(dimCity.getParent_country_code());
mlPreciseExposureBean.setCurrent_country_name(dimCity.getParent_country_name());
mlPreciseExposureBean.setCurrent_region_id(dimCity.getParent_region_code());
mlPreciseExposureBean.setCurrent_region_name(dimCity.getParent_region_name());
}
}
}
if (page_code != null) {
DimPageType dimPageType = dimPageTypeCache.getValue(page_code, new DimTableCallable(page_code, DimTableList.DIM_PAGE_TYPE.getTableName(), dimJdbcUrl));
if (dimPageType.getName() == null) {
dimPageTypeCache.invalidate(page_code);
} else {
mlPreciseExposureBean.setPage_name(dimPageType.getName());
if (dimPageType != null) {
if (dimPageType.getName() == null) {
dimPageTypeCache.invalidate(page_code);
} else {
mlPreciseExposureBean.setPage_name(dimPageType.getName());
}
}
}
if (referrer_code != null) {
DimPageType dimReferrerType = dimPageTypeCache.getValue(referrer_code, new DimTableCallable(referrer_code, DimTableList.DIM_PAGE_TYPE.getTableName(), dimJdbcUrl));
if (dimReferrerType.getName() == null) {
dimPageTypeCache.invalidate(page_code);
} else {
mlPreciseExposureBean.setReferrer_name(dimReferrerType.getName());
if (dimReferrerType != null) {
if (dimReferrerType.getName() == null) {
dimPageTypeCache.invalidate(page_code);
} else {
mlPreciseExposureBean.setReferrer_name(dimReferrerType.getName());
}
}
}
if (card_content_type != null) {
DimCardContentType dimCardContentType = dimCardContentTypeCache.getValue(card_content_type, new DimTableCallable(card_content_type, DimTableList.DIM_CARD_CONTENT_TYPE.getTableName(), dimJdbcUrl));
if (dimCardContentType.getName() == null) {
dimCardContentTypeCache.invalidate(card_content_type);
} else {
mlPreciseExposureBean.setCard_content_type(dimCardContentType.getNew_code());
mlPreciseExposureBean.setCard_content_type_name(dimCardContentType.getName());
if (dimCardContentType != null) {
if (dimCardContentType.getName() == null) {
dimCardContentTypeCache.invalidate(card_content_type);
} else {
mlPreciseExposureBean.setCard_content_type(dimCardContentType.getNew_code());
mlPreciseExposureBean.setCard_content_type_name(dimCardContentType.getName());
}
}
}
if (card_type != null) {
DimTable dimCardType = dimCardTypeCache.getValue(card_type, new DimTableCallable(card_type, DimTableList.DIM_CARD_TYPE.getTableName(), dimJdbcUrl));
if(dimCardType.getName() == null){
dimCardTypeCache.invalidate(card_type);
} else {
mlPreciseExposureBean.setCard_type_name(dimCardType.getName());
if (dimCardType != null) {
if (dimCardType.getName() == null) {
dimCardTypeCache.invalidate(card_type);
} else {
mlPreciseExposureBean.setCard_type_name(dimCardType.getName());
}
}
}
if (transaction_type != null) {
DimTable dimTransactionType = dimTransactionTypeCache.getValue(transaction_type, new DimTableCallable(transaction_type, DimTableList.DIM_TRANSACTION_TYPE.getTableName(), dimJdbcUrl));
if (dimTransactionType.getName() == null) {
dimTransactionTypeCache.invalidate(transaction_type);
} else {
mlPreciseExposureBean.setTransaction_type_name(dimTransactionType.getName());
if (dimTransactionType != null) {
if (dimTransactionType.getName() == null) {
dimTransactionTypeCache.invalidate(transaction_type);
} else {
mlPreciseExposureBean.setTransaction_type_name(dimTransactionType.getName());
}
}
}
// System.out.println(mlPreciseExposureBean);
......
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