微调
This commit is contained in:
@@ -273,14 +273,14 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
@Override
|
@Override
|
||||||
public void sendScript(SimulateDetectionParam param) {
|
public void sendScript(SimulateDetectionParam param) {
|
||||||
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + DetectionCommunicateConstant.SOURCE);
|
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + DetectionCommunicateConstant.SOURCE);
|
||||||
// if (Objects.isNull(channel) || !channel.isActive()) {
|
if (Objects.isNull(channel) || !channel.isActive()) {
|
||||||
// // 进行源通信连接
|
// 进行源通信连接
|
||||||
// PreDetectionParam preDetectionParam = new PreDetectionParam();
|
PreDetectionParam preDetectionParam = new PreDetectionParam();
|
||||||
// preDetectionParam.setSourceId(param.getSourceId());
|
preDetectionParam.setSourceId(param.getSourceId());
|
||||||
// preDetectionParam.setUserPageId(param.getUserPageId());
|
preDetectionParam.setUserPageId(param.getUserPageId());
|
||||||
// preDetectionParam.setSendWebMsg(false);
|
preDetectionParam.setSendWebMsg(false);
|
||||||
// this.sendYtxSocketSimulate(preDetectionParam);
|
this.sendYtxSocketSimulate(preDetectionParam);
|
||||||
// }
|
}
|
||||||
//组装源控制脚本
|
//组装源控制脚本
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
issueParam.setSourceId(param.getSourceId());
|
issueParam.setSourceId(param.getSourceId());
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
<foreach collection="devIds" item="devId" open="(" separator="," close=")">
|
<foreach collection="devIds" item="devId" open="(" separator="," close=")">
|
||||||
#{devId}
|
#{devId}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
order by Num
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -628,9 +628,9 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
checkData.setEnable(channelListDTO.getEnable());
|
checkData.setEnable(channelListDTO.getEnable());
|
||||||
//电压*电流*cos(电压角度-电流角度)
|
//电压*电流*cos(电压角度-电流角度)
|
||||||
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000 * Math.cos((listDTO.getFPhase() - channelI.get(0).getFPhase()) * Math.PI / 180));
|
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000 * Math.cos((listDTO.getFPhase() - channelI.get(0).getFPhase()) * Math.PI / 180));
|
||||||
if (valueType) {
|
// if (valueType) {
|
||||||
checkData.setValue(checkData.getValue() * 57.74 * 5);
|
checkData.setValue(checkData.getValue() * 57.74 * 5);
|
||||||
}
|
// }
|
||||||
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -651,9 +651,9 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
checkData.setEnable(channelListDTO.getEnable());
|
checkData.setEnable(channelListDTO.getEnable());
|
||||||
//电压*电流*cos(电压角度-电流角度)
|
//电压*电流*cos(电压角度-电流角度)
|
||||||
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000 * Math.sin((listDTO.getFPhase() - channelI.get(0).getFPhase()) * Math.PI / 180));
|
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000 * Math.sin((listDTO.getFPhase() - channelI.get(0).getFPhase()) * Math.PI / 180));
|
||||||
if (valueType) {
|
// if (valueType) {
|
||||||
checkData.setValue(checkData.getValue() * 57.74 * 5);
|
checkData.setValue(checkData.getValue() * 57.74 * 5);
|
||||||
}
|
// }
|
||||||
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -674,9 +674,9 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
checkData.setEnable(channelListDTO.getEnable());
|
checkData.setEnable(channelListDTO.getEnable());
|
||||||
//电压*电流*cos(电压角度-电流角度)
|
//电压*电流*cos(电压角度-电流角度)
|
||||||
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000);
|
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000);
|
||||||
if (valueType) {
|
// if (valueType) {
|
||||||
checkData.setValue(checkData.getValue() * 57.74 * 5);
|
checkData.setValue(checkData.getValue() * 57.74 * 5);
|
||||||
}
|
// }
|
||||||
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,14 +109,13 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
|
|||||||
}
|
}
|
||||||
if (nonHarmonicResultList.get(0) instanceof ContrastNonHarmonicResult) {
|
if (nonHarmonicResultList.get(0) instanceof ContrastNonHarmonicResult) {
|
||||||
List<ContrastNonHarmonicResult> contrastNonHarmonicResultList = BeanUtil.copyToList(nonHarmonicResultList, ContrastNonHarmonicResult.class);
|
List<ContrastNonHarmonicResult> contrastNonHarmonicResultList = BeanUtil.copyToList(nonHarmonicResultList, ContrastNonHarmonicResult.class);
|
||||||
List<String> monitorIds = contrastNonHarmonicResultList.stream().map(ContrastNonHarmonicResult::getDevMonitorId).distinct().collect(Collectors.toList());
|
ContrastNonHarmonicResult contrastNonHarmonicResult = contrastNonHarmonicResultList.get(0);
|
||||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
contrastNonHarmonicService.remove(new LambdaQueryWrapper<ContrastNonHarmonicResult>().in(ContrastNonHarmonicResult::getDevMonitorId, contrastNonHarmonicResult.getDevMonitorId())
|
||||||
contrastNonHarmonicService.remove(new LambdaQueryWrapper<ContrastNonHarmonicResult>().in(ContrastNonHarmonicResult::getDevMonitorId, monitorIds)
|
.eq(ContrastNonHarmonicResult::getNum, contrastNonHarmonicResult.getNum())
|
||||||
.eq(ContrastNonHarmonicResult::getNum, contrastNonHarmonicResultList.get(0).getNum())
|
.eq(ContrastNonHarmonicResult::getAdType, contrastNonHarmonicResult.getAdType())
|
||||||
.eq(ContrastNonHarmonicResult::getDataType, contrastNonHarmonicResultList.get(0).getDataType())
|
.eq(ContrastNonHarmonicResult::getDataType, contrastNonHarmonicResult.getDataType())
|
||||||
.eq(ObjectUtil.isNotNull(contrastNonHarmonicResultList.get(0).getWaveNum()), ContrastNonHarmonicResult::getWaveNum, contrastNonHarmonicResultList.get(0).getWaveNum())
|
.eq(ObjectUtil.isNotNull(contrastNonHarmonicResult.getWaveNum()), ContrastNonHarmonicResult::getWaveNum, contrastNonHarmonicResult.getWaveNum())
|
||||||
.isNull(ObjectUtil.isNull(contrastNonHarmonicResultList.get(0).getWaveNum()), ContrastNonHarmonicResult::getWaveNum));
|
.isNull(ObjectUtil.isNull(contrastNonHarmonicResult.getWaveNum()), ContrastNonHarmonicResult::getWaveNum));
|
||||||
}
|
|
||||||
contrastNonHarmonicService.saveBatch(contrastNonHarmonicResultList);
|
contrastNonHarmonicService.saveBatch(contrastNonHarmonicResultList);
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
@@ -143,14 +142,13 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
|
|||||||
|
|
||||||
if (harmonicResultList.get(0) instanceof ContrastHarmonicResult) {
|
if (harmonicResultList.get(0) instanceof ContrastHarmonicResult) {
|
||||||
List<ContrastHarmonicResult> contrastHarmonicResultList = BeanUtil.copyToList(harmonicResultList, ContrastHarmonicResult.class);
|
List<ContrastHarmonicResult> contrastHarmonicResultList = BeanUtil.copyToList(harmonicResultList, ContrastHarmonicResult.class);
|
||||||
List<String> monitorIds = contrastHarmonicResultList.stream().map(ContrastHarmonicResult::getDevMonitorId).distinct().collect(Collectors.toList());
|
ContrastHarmonicResult contrastHarmonicResult = contrastHarmonicResultList.get(0);
|
||||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
contrastHarmonicService.remove(new LambdaQueryWrapper<ContrastHarmonicResult>().eq(ContrastHarmonicResult::getDevMonitorId, contrastHarmonicResult.getDevMonitorId())
|
||||||
contrastHarmonicService.remove(new LambdaQueryWrapper<ContrastHarmonicResult>().in(ContrastHarmonicResult::getDevMonitorId, monitorIds)
|
.eq(ContrastHarmonicResult::getNum, contrastHarmonicResult.getNum())
|
||||||
.eq(ContrastHarmonicResult::getNum, contrastHarmonicResultList.get(0).getNum())
|
.eq(ContrastHarmonicResult::getAdType, contrastHarmonicResult.getAdType())
|
||||||
.eq(ContrastHarmonicResult::getDataType, contrastHarmonicResultList.get(0).getDataType())
|
.eq(ContrastHarmonicResult::getDataType, contrastHarmonicResult.getDataType())
|
||||||
.eq(ObjectUtil.isNotNull(contrastHarmonicResultList.get(0).getWaveNum()), ContrastHarmonicResult::getWaveNum, contrastHarmonicResultList.get(0).getWaveNum())
|
.eq(ObjectUtil.isNotNull(contrastHarmonicResult.getWaveNum()), ContrastHarmonicResult::getWaveNum, contrastHarmonicResult.getWaveNum())
|
||||||
.isNull(ObjectUtil.isNull(contrastHarmonicResultList.get(0).getWaveNum()), ContrastHarmonicResult::getWaveNum));
|
.isNull(ObjectUtil.isNull(contrastHarmonicResult.getWaveNum()), ContrastHarmonicResult::getWaveNum));
|
||||||
}
|
|
||||||
contrastHarmonicService.saveBatch(contrastHarmonicResultList);
|
contrastHarmonicService.saveBatch(contrastHarmonicResultList);
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
|
|||||||
Reference in New Issue
Block a user