|
@@ -7,6 +7,7 @@ import java.util.Map;
|
|
|
import com.ym.mec.cms.controller.queryinfo.NewsInformationQueryInfo;
|
|
|
import com.ym.mec.cms.dal.entity.NewsStatusEnum;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -15,6 +16,7 @@ import com.ym.mec.cms.dal.entity.SysNewsInformation;
|
|
|
import com.ym.mec.cms.service.SysNewsInformationService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.util.collection.MapUtil;
|
|
|
|
|
|
@Service
|
|
|
public class SysNewsInformationServiceImpl extends BaseServiceImpl<Long, SysNewsInformation> implements SysNewsInformationService {
|
|
@@ -43,16 +45,34 @@ public class SysNewsInformationServiceImpl extends BaseServiceImpl<Long, SysNews
|
|
|
//1精彩活动,2热门资讯,3banner类型
|
|
|
Map<String,PageInfo<SysNewsInformation>> homeList = new HashMap<>();
|
|
|
queryInfo.setStatus(NewsStatusEnum.SHOW);
|
|
|
+
|
|
|
+ String memo = queryInfo.getMemo();
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ queryInfo.setType(3);
|
|
|
+ int count = sysNewsInformationDao.queryCount(params);
|
|
|
+ if(count == 0){
|
|
|
+ queryInfo.setMemo(null);
|
|
|
+ }
|
|
|
+ homeList.put("banner",queryPage(queryInfo));
|
|
|
+
|
|
|
+ queryInfo.setMemo(memo);
|
|
|
+ queryInfo.setType(6);
|
|
|
+ count = sysNewsInformationDao.queryCount(params);
|
|
|
+ if(count == 0){
|
|
|
+ queryInfo.setMemo(null);
|
|
|
+ }
|
|
|
+ homeList.put("app",queryPage(queryInfo));
|
|
|
+
|
|
|
+ queryInfo.setMemo(null);
|
|
|
queryInfo.setType(1);
|
|
|
homeList.put("active",queryPage(queryInfo));
|
|
|
queryInfo.setType(2);
|
|
|
homeList.put("hot",queryPage(queryInfo));
|
|
|
- queryInfo.setType(3);
|
|
|
- homeList.put("banner",queryPage(queryInfo));
|
|
|
queryInfo.setType(5);
|
|
|
homeList.put("flash",queryPage(queryInfo));
|
|
|
- queryInfo.setType(6);
|
|
|
- homeList.put("app",queryPage(queryInfo));
|
|
|
return homeList;
|
|
|
}
|
|
|
|