Commit 6839b90a authored by 赵啸非's avatar 赵啸非

添加查询缓存

parent b5f81796
...@@ -8,6 +8,7 @@ import com.mortals.framework.model.Result; ...@@ -8,6 +8,7 @@ import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.business.model.BusinessEntity; import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.site.model.*; import com.mortals.xhx.module.site.model.*;
import com.mortals.xhx.module.window.model.WindowBusinessEntity; import com.mortals.xhx.module.window.model.WindowBusinessEntity;
...@@ -75,7 +76,9 @@ public class SiteHallController extends BaseCRUDJsonBodyMappingController<SiteHa ...@@ -75,7 +76,9 @@ public class SiteHallController extends BaseCRUDJsonBodyMappingController<SiteHa
} else { } else {
//查询数据库 //查询数据库
rest = this.service.getBusinessByHall(siteHall, getContext()); rest = this.service.getBusinessByHall(siteHall, getContext());
cacheService.set(KEY_SEARCH_HALL_BUSINESS_CACHE + siteHall.getId(), JSON.toJSONString(rest), KEY_SEARCH_TIMEOUTT_CACHE); if(rest.getCode()== YesNoEnum.YES.getValue()){
cacheService.set(KEY_SEARCH_HALL_BUSINESS_CACHE + siteHall.getId(), JSON.toJSONString(rest), KEY_SEARCH_TIMEOUTT_CACHE);
}
} }
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) { if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
......
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