| | |
| | | import com.yeshi.fanli.entity.admin.RecommendBannerAdmin;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendBanner;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.RecommendBannerService;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | private SuperRecommendBannerService superRecommendBannerService;
|
| | |
|
| | | @Resource
|
| | | private SystemService systemService;
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | public List<RecommendBanner> getRecommendBanners() {
|
| | |
|
| | |
| | | String platform, String packages, String key) {
|
| | | final int strat = pageIndex * Constant.PAGE_SIZE;
|
| | | platform = Utils.getMap().get(platform);
|
| | | com.yeshi.fanli.entity.system.System system = systemService.getSystem(platform, packages);
|
| | | com.yeshi.fanli.entity.system.BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
|
| | | List<RecommendBanner> recommendBannerList=null;
|
| | | List<SuperRecommendBanner> superRecommendBannerList=null;
|
| | | Map<Long,RecommendBannerAdmin> recommendBannerAdminMap=new HashMap<Long, RecommendBannerAdmin>();
|
| | |
| | | rsIdList.add(rs.getId());
|
| | | }
|
| | | superRecommendBannerList = superRecommendBannerService.getSuperRecommendBannersByBanners(rsIdList);
|
| | | Map<Long,List<System>> superMap = new HashMap<Long, List<System>>();
|
| | | Map<Long,List<BusinessSystem>> superMap = new HashMap<Long, List<BusinessSystem>>();
|
| | | Long rsId=null;
|
| | | List<System> systemList=null;
|
| | | List<BusinessSystem> systemList=null;
|
| | | for (SuperRecommendBanner srs : superRecommendBannerList) {
|
| | | rsId = srs.getRecommendBanner().getId();
|
| | | systemList = superMap.get(rsId);
|
| | | if(systemList==null){
|
| | | systemList=new ArrayList<System>();
|
| | | systemList=new ArrayList<BusinessSystem>();
|
| | | }
|
| | | systemList.add(srs.getSystem());
|
| | | superMap.put(rsId,systemList);
|
| | |
| | | if(rsa==null){
|
| | | rsa=new RecommendBannerAdmin();
|
| | | }
|
| | | List<System> list = superMap.get(id);
|
| | | List<BusinessSystem> list = superMap.get(id);
|
| | | if(list != null){
|
| | | rsa.getSystemList().addAll(superMap.get(id));
|
| | | }
|
| | |
| | |
|
| | | public int getCount(String platform, String packages, final String key) {
|
| | | platform = Utils.getMap().get(platform);
|
| | | final System system = systemService.getSystem(platform, packages);
|
| | | final BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
|
| | | return (Integer) recommendBannerDao.excute(new HibernateCallback<Integer>() {
|
| | |
|
| | | public Integer doInHibernate(Session session)
|