|
@@ -8,10 +8,14 @@ import com.ym.mec.cms.dal.entity.SysNewsTypeTree;
|
|
|
import com.ym.mec.cms.service.SysNewsTypeService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
+
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -56,11 +60,18 @@ public class SysNewsTypeServiceImpl extends BaseServiceImpl<Integer, SysNewsType
|
|
|
|
|
|
all.forEach(e -> {
|
|
|
List<SysNewsInformation> list = informationDao.queryBySubType(e.getId(), memo);
|
|
|
- if (CollectionUtils.isNotEmpty(list)) {
|
|
|
- e.setInformationList(list);
|
|
|
- } else {
|
|
|
- e.setInformationList(informationDao.queryBySubType(e.getId(), null));
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
+ list = informationDao.queryBySubType(e.getId(), null);
|
|
|
}
|
|
|
+ Iterator<SysNewsInformation> iterator = list.iterator();
|
|
|
+ SysNewsInformation sni = null;
|
|
|
+ while(iterator.hasNext()){
|
|
|
+ sni = iterator.next();
|
|
|
+ if(TenantContextHolder.getTenantId() != 1 && StringUtils.indexOf(sni.getTitle(), "商城") >= 0){
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ e.setInformationList(list);
|
|
|
});
|
|
|
List<SysNewsType> treeMenus = all.stream()
|
|
|
.filter((e) -> e.getParentId().equals(newsType.getParentId()))
|