微调
This commit is contained in:
@@ -785,7 +785,7 @@ public class SocketDevResponseService {
|
|||||||
StorageParam storageParam = new StorageParam();
|
StorageParam storageParam = new StorageParam();
|
||||||
storageParam.setCode(Integer.valueOf(param.getCode()));
|
storageParam.setCode(Integer.valueOf(param.getCode()));
|
||||||
storageParam.setScriptId(param.getScriptId());
|
storageParam.setScriptId(param.getScriptId());
|
||||||
List<Integer> indexes = adHarmonicService.getIndex(storageParam);
|
List<Integer> indexes = adHarmonicService.getIndex(storageParam,false);
|
||||||
issueParam.setIndexList(indexes);
|
issueParam.setIndexList(indexes);
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue());
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
StorageParam storageParam = new StorageParam();
|
StorageParam storageParam = new StorageParam();
|
||||||
storageParam.setCode(Integer.valueOf(adPlan.getCode()));
|
storageParam.setCode(Integer.valueOf(adPlan.getCode()));
|
||||||
storageParam.setScriptId(adPlan.getScriptId());
|
storageParam.setScriptId(adPlan.getScriptId());
|
||||||
List<Integer> indexes = adHarmonicService.getIndex(storageParam);
|
List<Integer> indexes = adHarmonicService.getIndex(storageParam,true);
|
||||||
scriptDtlsList = scriptDtlsList.stream().filter(obj -> indexes.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
scriptDtlsList = scriptDtlsList.stream().filter(obj -> indexes.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,13 @@ public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
|||||||
*/
|
*/
|
||||||
Map<String, RawResultDataVO> listHarmResultData(StorageParam param) ;
|
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);
|
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.storage.service.AdHarmonicService;
|
||||||
import com.njcn.gather.system.dictionary.mapper.DictTreeMapper;
|
import com.njcn.gather.system.dictionary.mapper.DictTreeMapper;
|
||||||
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
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.pojo.po.DictTree;
|
||||||
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -76,7 +75,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
;
|
;
|
||||||
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
||||||
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(3);
|
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(3);
|
||||||
if(CollectionUtil.isNotEmpty(adHarmonicResults)){
|
if (CollectionUtil.isNotEmpty(adHarmonicResults)) {
|
||||||
List<Double> harmNum = param.getHarmNum();
|
List<Double> harmNum = param.getHarmNum();
|
||||||
RawDataVO dataVO;
|
RawDataVO dataVO;
|
||||||
List<RawDataVO> rawDataVOS;
|
List<RawDataVO> rawDataVOS;
|
||||||
@@ -178,7 +177,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
if (ObjectUtil.isNotNull(a)) {
|
if (ObjectUtil.isNotNull(a)) {
|
||||||
dataVO.setRadius(a.getRadius());
|
dataVO.setRadius(a.getRadius());
|
||||||
}
|
}
|
||||||
dataVO.setIsData(setResultFlag(Arrays.asList(a,b,c)));
|
dataVO.setIsData(setResultFlag(Arrays.asList(a, b, c)));
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
@@ -194,7 +193,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> getIndex(StorageParam param) {
|
public List<Integer> getIndex(StorageParam param, Boolean isExculdePhaseAngle) {
|
||||||
String prefix = "ad_harmonic_result_";
|
String prefix = "ad_harmonic_result_";
|
||||||
String prefixNon = "ad_non_harmonic_result_";
|
String prefixNon = "ad_non_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
||||||
@@ -211,9 +210,12 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
.ne(AdNonHarmonicResult::getResultFlag, 1)
|
.ne(AdNonHarmonicResult::getResultFlag, 1)
|
||||||
.eq(AdNonHarmonicResult::getScriptId, param.getScriptId());
|
.eq(AdNonHarmonicResult::getScriptId, param.getScriptId());
|
||||||
;
|
;
|
||||||
|
if (isExculdePhaseAngle) {
|
||||||
|
List<String> phaseAngleIds = dictTreeMapper.getPhaseAngleIds();
|
||||||
|
resultLambdaQueryWrapper.notIn(AdNonHarmonicResult::getAdType, phaseAngleIds);
|
||||||
|
}
|
||||||
List<AdNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
List<AdNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
||||||
indexes.addAll(nonHarmonicResults.stream().map(AdNonHarmonicResult::getSort).collect(Collectors.toList()));
|
indexes.addAll(nonHarmonicResults.stream().map(AdNonHarmonicResult::getSort).collect(Collectors.toList()));
|
||||||
|
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return indexes;
|
return indexes;
|
||||||
}
|
}
|
||||||
@@ -234,6 +236,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer setResultFlag(List<RawResultDataVO.DetectionData> numbers) {
|
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());
|
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);
|
return getInteger(isData);
|
||||||
|
|||||||
@@ -13,4 +13,11 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface DictTreeMapper extends BaseMapper<DictTree> {
|
public interface DictTreeMapper extends BaseMapper<DictTree> {
|
||||||
List<DictTreeVO> queryLastLevelById(@Param("id") String id);
|
List<DictTreeVO> queryLastLevelById(@Param("id") String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取电压相角、电流相角的id列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getPhaseAngleIds();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,7 @@
|
|||||||
WHERE
|
WHERE
|
||||||
b.pids LIKE concat('%',#{id},'%') and a.id = b.pid)
|
b.pids LIKE concat('%',#{id},'%') and a.id = b.pid)
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getPhaseAngleIds" resultType="java.lang.String">
|
||||||
|
select id from sys_dict_tree where name like '电压相角' or name like '电流相角'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user