| File was renamed from CenterService/src/main/java/com/java110/center/smo/impl/CenterServiceCacheSMOImpl.java |
| | |
| | | package com.java110.center.smo.impl; |
| | | package com.java110.order.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.center.dao.ICenterServiceDAO; |
| | | import com.java110.center.smo.ICenterServiceCacheSMO; |
| | | import com.java110.common.cache.ServiceBusinessCache; |
| | | import com.java110.entity.order.ServiceBusiness; |
| | | import com.java110.order.dao.ICenterServiceDAO; |
| | | import com.java110.order.smo.ICenterServiceCacheSMO; |
| | | import com.java110.common.cache.AppRouteCache; |
| | | import com.java110.common.cache.MappingCache; |
| | | import com.java110.common.cache.ServiceSqlCache; |
| | |
| | | //3.0 分装 ServiceSql |
| | | flushServiceSql(dataQuery); |
| | | |
| | | //4.0 刷新业务信息 |
| | | flushServiceBusiness(dataQuery); |
| | | |
| | | dataQuery.setResponseInfo(DataTransactionFactory.createBusinessResponseJson(ResponseConstant.RESULT_CODE_SUCCESS,"刷新成功")); |
| | | } |
| | | |
| | |
| | | |
| | | //3.0 分装 ServiceSql |
| | | flushServiceSql(headers); |
| | | |
| | | //4.0 刷新业务信息 |
| | | flushServiceBusiness(headers); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | //3.0 分装 ServiceSql |
| | | doFlushServiceSql(); |
| | | |
| | | doFlushServiceBusiness(); |
| | | } |
| | | |
| | | private void checkCacheParam(DataQuery dataQuery) throws SMOException{ |
| | |
| | | doFlushServiceSql(); |
| | | } |
| | | |
| | | private void flushServiceBusiness(DataQuery dataQuery) { |
| | | |
| | | JSONObject params = dataQuery.getRequestParams(); |
| | | if(!CommonConstant.CACHE_SERVICE_BUSINESS.equals(params.getString(CommonConstant.CACHE_PARAM_NAME))){ |
| | | return ; |
| | | } |
| | | // 刷新 |
| | | doFlushServiceBusiness(); |
| | | } |
| | | |
| | | /** |
| | | * 3.0 分装 ServiceSql |
| | | */ |
| | |
| | | } |
| | | // 刷新 |
| | | doFlushServiceSql(); |
| | | } |
| | | |
| | | /** |
| | | * 3.0 分装 ServiceSql |
| | | */ |
| | | private void flushServiceBusiness(Map<String,String> headers) { |
| | | |
| | | Assert.hasKey(headers,CommonConstant.CACHE_PARAM,"未包含cache参数"+headers.toString()); |
| | | if(!CommonConstant.CACHE_SERVICE_BUSINESS.equals(headers.get(CommonConstant.CACHE_PARAM)) |
| | | && !CommonConstant.CACHE_ALL.equals(headers.get(CommonConstant.CACHE_PARAM))){ |
| | | return ; |
| | | } |
| | | // 刷新 |
| | | doFlushServiceBusiness(); |
| | | } |
| | | |
| | | private void doFlushServiceSql() { |
| | |
| | | } |
| | | } |
| | | |
| | | private void doFlushServiceBusiness(){ |
| | | logger.debug("开始刷新 ServiceBusiness数据到redis数据库中"); |
| | | List<ServiceBusiness> serviceBusinesses = queryServiceDAOImpl.qureyServiceBusiness(); |
| | | |
| | | if(serviceBusinesses == null || serviceBusinesses.size() == 0){ |
| | | return; |
| | | } |
| | | //删除原始数据 |
| | | ServiceSqlCache.removeData(ServiceBusinessCache._KEY_SERVICE_BUSINESS); |
| | | |
| | | //设置缓存 |
| | | ServiceBusinessCache.setServiceBusiness(serviceBusinesses); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷新 Mapping 数据 |