Commit 16878755 authored by 刘喆's avatar 刘喆

update DimRichAsyncFunction bug

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