微调
This commit is contained in:
@@ -43,8 +43,13 @@ public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
||||
*/
|
||||
Map<String, RawResultDataVO> listHarmResultData(StorageParam param) ;
|
||||
|
||||
|
||||
List<Integer> getIndex(StorageParam param);
|
||||
/**
|
||||
* 获取索引
|
||||
* @param param
|
||||
* @param isExculdePhaseAngle 是否排除电压相角、电流相角
|
||||
* @return
|
||||
*/
|
||||
List<Integer> getIndex(StorageParam param,Boolean isExculdePhaseAngle);
|
||||
|
||||
AdHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
||||
import com.njcn.gather.system.dictionary.mapper.DictTreeMapper;
|
||||
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
||||
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -76,7 +75,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
;
|
||||
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
||||
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(3);
|
||||
if(CollectionUtil.isNotEmpty(adHarmonicResults)){
|
||||
if (CollectionUtil.isNotEmpty(adHarmonicResults)) {
|
||||
List<Double> harmNum = param.getHarmNum();
|
||||
RawDataVO dataVO;
|
||||
List<RawDataVO> rawDataVOS;
|
||||
@@ -178,7 +177,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
if (ObjectUtil.isNotNull(a)) {
|
||||
dataVO.setRadius(a.getRadius());
|
||||
}
|
||||
dataVO.setIsData(setResultFlag(Arrays.asList(a,b,c)));
|
||||
dataVO.setIsData(setResultFlag(Arrays.asList(a, b, c)));
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
@@ -194,7 +193,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getIndex(StorageParam param) {
|
||||
public List<Integer> getIndex(StorageParam param, Boolean isExculdePhaseAngle) {
|
||||
String prefix = "ad_harmonic_result_";
|
||||
String prefixNon = "ad_non_harmonic_result_";
|
||||
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
||||
@@ -211,9 +210,12 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
.ne(AdNonHarmonicResult::getResultFlag, 1)
|
||||
.eq(AdNonHarmonicResult::getScriptId, param.getScriptId());
|
||||
;
|
||||
if (isExculdePhaseAngle) {
|
||||
List<String> phaseAngleIds = dictTreeMapper.getPhaseAngleIds();
|
||||
resultLambdaQueryWrapper.notIn(AdNonHarmonicResult::getAdType, phaseAngleIds);
|
||||
}
|
||||
List<AdNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
||||
indexes.addAll(nonHarmonicResults.stream().map(AdNonHarmonicResult::getSort).collect(Collectors.toList()));
|
||||
|
||||
DynamicTableNameHandler.remove();
|
||||
return indexes;
|
||||
}
|
||||
@@ -234,6 +236,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Integer setResultFlag(List<RawResultDataVO.DetectionData> numbers) {
|
||||
List<Integer> isData = numbers.stream().filter(x -> ObjectUtil.isNotNull(x.getData())).filter(x -> 4 != x.getIsData()).map(RawResultDataVO.DetectionData::getIsData).distinct().collect(Collectors.toList());
|
||||
return getInteger(isData);
|
||||
|
||||
Reference in New Issue
Block a user