|
@@ -1,11 +1,13 @@
|
|
|
package cn.cslg.pas.service.business;
|
|
|
|
|
|
import cn.cslg.pas.domain.business.AssoScenarioMatter;
|
|
|
+import cn.cslg.pas.domain.business.Matter;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.mapper.AssoScenarioMatterMapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -19,21 +21,28 @@ import java.util.stream.Collectors;
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
public class AssoScenarioMatterService extends ServiceImpl<AssoScenarioMatterMapper, AssoScenarioMatter> {
|
|
|
+ @Autowired
|
|
|
+ private MatterService matterService;
|
|
|
+
|
|
|
/**
|
|
|
* 根据应用场景id查询处理事项id集合
|
|
|
* @param scenarioIds
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Integer> queryMatterIds(List<Integer> scenarioIds){
|
|
|
+ public List<Matter> queryMatterIds(List<Integer> scenarioIds){
|
|
|
List<Integer> matterIds = new ArrayList<>();
|
|
|
+ List<Matter> matters = new ArrayList<>();
|
|
|
if(scenarioIds != null && scenarioIds.size() != 0){
|
|
|
LambdaQueryWrapper<AssoScenarioMatter> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.in(AssoScenarioMatter::getScenarioId, scenarioIds);
|
|
|
List<AssoScenarioMatter> assoScenarioMatters = this.list(queryWrapper);
|
|
|
matterIds = assoScenarioMatters.stream().map(AssoScenarioMatter::getMatterId).distinct().collect(Collectors.toList());
|
|
|
+ LambdaQueryWrapper<Matter> matterLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ matterLambdaQueryWrapper.in(Matter::getId, matterIds);
|
|
|
+ matters = matterService.list(matterLambdaQueryWrapper);
|
|
|
} else {
|
|
|
throw new XiaoShiException("scenarioIds不能为空");
|
|
|
}
|
|
|
- return matterIds;
|
|
|
+ return matters;
|
|
|
}
|
|
|
}
|