|
@@ -4,15 +4,20 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
|
+import com.fdkankan.fusion.entity.CaseTag;
|
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
|
import com.fdkankan.fusion.entity.HotIcon;
|
|
|
import com.fdkankan.fusion.mapper.IHotIconMapper;
|
|
|
+import com.fdkankan.fusion.service.ICaseTagService;
|
|
|
import com.fdkankan.fusion.service.IHotIconService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -25,6 +30,9 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class HotIconServiceImpl extends ServiceImpl<IHotIconMapper, HotIcon> implements IHotIconService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ICaseTagService caseTagService;
|
|
|
+
|
|
|
@Override
|
|
|
public List<HotIcon> getListByUserName(String username) {
|
|
|
LambdaQueryWrapper<HotIcon> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -76,4 +84,23 @@ public class HotIconServiceImpl extends ServiceImpl<IHotIconMapper, HotIcon> imp
|
|
|
.eq(HotIcon::getUserName,username);
|
|
|
this.update(wrapper);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<HotIcon> getListByCaseId(Integer caseId) {
|
|
|
+ List<CaseTag> list = caseTagService.getListByCaseId(caseId);
|
|
|
+ if(list.size() >0){
|
|
|
+ List<Integer> hotIconId = list.parallelStream().map(CaseTag::getHotIconId).collect(Collectors.toList());
|
|
|
+ if(hotIconId.size() >0){
|
|
|
+ return this.getByIds(hotIconId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<HotIcon> getByIds(List<Integer> hotIconId) {
|
|
|
+ LambdaQueryWrapper<HotIcon> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.in(HotIcon::getIconId,hotIconId);
|
|
|
+ return this.list(wrapper);
|
|
|
+ }
|
|
|
}
|