|
@@ -1,11 +1,15 @@ |
|
|
package com.ningdatech.kqapi.zzsfw.manage; |
|
|
package com.ningdatech.kqapi.zzsfw.manage; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.ningdatech.kqapi.common.enumeration.CommonEnum; |
|
|
import com.ningdatech.kqapi.common.enumeration.CommonEnum; |
|
|
import com.ningdatech.kqapi.zzsfw.constants.ZzsfwMenuConstant; |
|
|
import com.ningdatech.kqapi.zzsfw.constants.ZzsfwMenuConstant; |
|
|
|
|
|
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMattersDeduplicate; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; |
|
|
|
|
|
import com.ningdatech.kqapi.zzsfw.entity.vo.MatterTopVO; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.vo.TreeVO; |
|
|
import com.ningdatech.kqapi.zzsfw.entity.vo.TreeVO; |
|
|
|
|
|
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; |
|
|
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; |
|
|
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
@@ -28,8 +32,11 @@ public class MatterManage { |
|
|
|
|
|
|
|
|
private final INdKqZzsfwMenuService menuService; |
|
|
private final INdKqZzsfwMenuService menuService; |
|
|
|
|
|
|
|
|
|
|
|
private final INdKqZzsfwMatterDeduplicateService matterDeduplicateService; |
|
|
|
|
|
|
|
|
public List<TreeVO> getMatters() { |
|
|
public List<TreeVO> getMatters() { |
|
|
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) |
|
|
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) |
|
|
|
|
|
.isNotNull(NdKqZzsfwMenu::getWebapplyurl) |
|
|
.orderByAsc(NdKqZzsfwMenu::getSort)); |
|
|
.orderByAsc(NdKqZzsfwMenu::getSort)); |
|
|
if(CollUtil.isEmpty(matters)){ |
|
|
if(CollUtil.isEmpty(matters)){ |
|
|
return Collections.emptyList(); |
|
|
return Collections.emptyList(); |
|
@@ -87,4 +94,17 @@ public class MatterManage { |
|
|
return matter; |
|
|
return matter; |
|
|
}).collect(Collectors.toList()); |
|
|
}).collect(Collectors.toList()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<MatterTopVO> topTen() { |
|
|
|
|
|
List<NdKqZzsfwMattersDeduplicate> topTen = matterDeduplicateService.list(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class) |
|
|
|
|
|
.orderByDesc(NdKqZzsfwMattersDeduplicate::getCountNum) |
|
|
|
|
|
.last("limit 10")); |
|
|
|
|
|
return topTen.stream().map(m -> { |
|
|
|
|
|
MatterTopVO vo = new MatterTopVO(); |
|
|
|
|
|
vo.setMatterName(m.getQlName()); |
|
|
|
|
|
vo.setWebapplyurl(m.getWebapplyurl()); |
|
|
|
|
|
vo.setCount(m.getCountNum()); |
|
|
|
|
|
return vo; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |