|
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.energy.manage.common.base.Page;
|
|
|
import com.energy.manage.common.constant.redis.ManagerRedisKeyConstant;
|
|
|
import com.energy.manage.common.enums.IdPrefixEnum;
|
|
|
+import com.energy.manage.common.po.analysis.AnalysisGeneralFilePo;
|
|
|
import com.energy.manage.common.po.analysis.AnalysisOptionRecordsPo;
|
|
|
import com.energy.manage.common.po.analysis.AnalysisResultPo;
|
|
|
import com.energy.manage.common.po.analysis.AnalysisTypePo;
|
|
@@ -446,27 +447,29 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 查询所有的分析类型
|
|
|
- */
|
|
|
- @Override
|
|
|
- public List<Map<String, Object>> queryAllAnalysisType() {
|
|
|
- return getAnalysisType(null);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
*过滤分析类型并生成树形结构
|
|
|
* @param analysisCodes
|
|
|
* @return
|
|
|
*/
|
|
|
private List<Map<String, Object>> getAnalysisType(Set<String> analysisCodes){
|
|
|
- List<AnalysisTypePo> analysisTypePos = analysisTypeMapper.selectAllByOrderNum();
|
|
|
- if(CollectionUtils.isNotEmpty(analysisCodes)){
|
|
|
- analysisTypePos = analysisTypePos.stream().filter(item -> analysisCodes.contains(item.getTypeCode()) || item.getParentId().equals(ZREO_STR)).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isEmpty(analysisCodes)){
|
|
|
+ return new ArrayList<>();
|
|
|
}
|
|
|
+ List<AnalysisTypePo> analysisTypePos = analysisTypeMapper.selectAllByOrderNum();
|
|
|
+ analysisTypePos = analysisTypePos.stream().filter(item -> analysisCodes.contains(item.getTypeCode()) || item.getParentId().equals(ZREO_STR)).collect(Collectors.toList());
|
|
|
return TreeUtil.getJava8ResultTree(BeanMapUtils.listBeanToListMap(analysisTypePos), "parentId", "id");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 查询所有的分析类型
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> queryAllAnalysisType() {
|
|
|
+ List<AnalysisTypePo> analysisTypeList = analysisTypeMapper.selectAllByOrderNum();
|
|
|
+ return TreeUtil.getJava8ResultTree(BeanMapUtils.listBeanToListMap(analysisTypeList), "parentId", "id");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 查询已经分析的风机信息
|
|
|
* @param batchCode
|
|
|
* @param analysisTypeCode
|
|
@@ -475,6 +478,16 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
@Override
|
|
|
public Set<WindEngineGroupShortVo> queryAnalysisedEngine(String batchCode, String analysisTypeCode){
|
|
|
Set<WindEngineGroupShortVo> set = diagramRelationMapper.selectByBatchCodeAndAnalysisTypeCode(batchCode,analysisTypeCode);
|
|
|
+ if(CollectionUtils.isEmpty(set)){
|
|
|
+ int count = generalFileMapper.selectCount(new AnalysisGeneralFilePo().setBatchCode(batchCode));
|
|
|
+ if(count > 0){
|
|
|
+ AnalysisResultPo analysisResultPo = analysisResultMapper.selectByBatchCode(batchCode);
|
|
|
+ set = engineGroupMapper.selectWindEngineGroupShortList(analysisResultPo.getFieldCode())
|
|
|
+ .stream().collect(Collectors.toSet());
|
|
|
+ }else{
|
|
|
+ return new HashSet<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
//排序
|
|
|
return set.stream()
|
|
|
.sorted(Comparator.comparing(WindEngineGroupShortVo::getEngineName))
|