现场算法测试优化

This commit is contained in:
xy
2025-05-19 09:52:02 +08:00
parent 272c723775
commit 228b694322
46 changed files with 166 additions and 64 deletions

View File

@@ -9,7 +9,7 @@ public class DataCommonUtils {
/**
* 传入字典类型的电压等级,获取可以计算的数据
* 例如 35kV->32.0
* 例如 35kV->35.0
* 0.38kV->0.38
*/
public static Double getVoltageData(String lineVoltage) {

View File

@@ -0,0 +1,48 @@
package com.njcn.dataProcess.config;
import com.njcn.common.config.GeneralInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author hongawen
* @version 1.0.0
* @date 2022年03月11日 09:32
*/
@Data
@Order(100)
@Configuration
@EnableAsync
@AllArgsConstructor
public class InsertDataConfiguration {
private final GeneralInfo generalInfo;
@Bean("InsertDataConfiguration")
public Executor asyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// 核心线程数:线程池创建时候初始化的线程数
executor.setCorePoolSize(generalInfo.getCorePoolSize());
// 最大线程数:线程池最大的线程数,只有在缓冲队列满了之后才会申请超过核心线程数的线程
executor.setMaxPoolSize(generalInfo.getMaxPoolSize());
// 缓冲队列:用来缓冲执行任务的队列
executor.setQueueCapacity(generalInfo.getQueueCapacity());
// 允许线程的空闲时间60秒当超过了核心线程之外的线程在空闲时间到达之后会被销毁
executor.setKeepAliveSeconds(generalInfo.getKeepAliveSeconds());
// 线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
executor.setThreadNamePrefix(generalInfo.getMicroServiceName());
// 缓冲队列满了之后的拒绝策略:由调用线程处理(一般是主线程)
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.initialize();
return executor;
}
}

View File

@@ -7,6 +7,8 @@ import com.njcn.dataProcess.dao.relation.mapper.PqDataVerifyMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.po.PqDataVerify;
import com.njcn.dataProcess.service.IPqDataVerifyService;
import org.junit.jupiter.api.condition.DisabledIfSystemProperties;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -26,8 +28,9 @@ public class PqDataVerifyServiceImpl extends MppServiceImpl<PqDataVerifyMapper,
@Override
@Transactional(rollbackFor = Exception.class)
@Async("InsertDataConfiguration")
public void insertData(List<PqDataVerify> list) {
this.saveOrUpdateBatchByMultiId(list,500);
this.saveOrUpdateBatchByMultiId(list,1000);
}
@Override

View File

@@ -31,6 +31,6 @@ public class RelationDataComAssImpl extends MppServiceImpl<RStatDataComAssMapper
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -87,7 +87,7 @@ public class RelationDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataFlicker.saveOrUpdateBatchByMultiId(result,500);
dataFlicker.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -78,7 +78,7 @@ public class RelationDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataFluc.saveOrUpdateBatchByMultiId(result,500);
dataFluc.saveOrUpdateBatchByMultiId(result,1000);
}
;

View File

@@ -43,6 +43,6 @@ public class RelationDataHarmRateIImpl extends MppServiceImpl<RStatDataHarmRateI
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataHarmRateI.saveOrUpdateBatchByMultiId(result,500);
dataHarmRateI.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -95,7 +95,7 @@ public class RelationDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataHarmRateV.saveOrUpdateBatchByMultiId(result,500);
dataHarmRateV.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -83,6 +83,6 @@ public class RelationDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataHarmphasicI.saveOrUpdateBatchByMultiId(result,500);
dataHarmphasicI.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -86,7 +86,7 @@ public class RelationDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataHarmphasicV.saveOrUpdateBatchByMultiId(result,500);
dataHarmphasicV.saveOrUpdateBatchByMultiId(result,1000);
}

View File

@@ -87,6 +87,6 @@ public class RelationDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataHarmPowerP.saveOrUpdateBatchByMultiId(result,500);
dataHarmPowerP.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -85,6 +85,6 @@ public class RelationDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataHarmpowerQ.saveOrUpdateBatchByMultiId(result,500);
dataHarmpowerQ.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -80,6 +80,6 @@ public class RelationDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataHarmPowerS.saveOrUpdateBatchByMultiId(result,500);
dataHarmPowerS.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -93,7 +93,7 @@ public class RelationDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
BeanUtils.copyProperties(item, dataI);
result.add(dataI);
});
iDataI.saveOrUpdateBatchByMultiId(result,500);
iDataI.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -78,6 +78,6 @@ public class RelationDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataInharmI.saveOrUpdateBatchByMultiId(result,500);
dataInharmI.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -86,6 +86,6 @@ public class RelationDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataInHarmV.saveOrUpdateBatchByMultiId(result,500);
dataInHarmV.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -35,7 +35,7 @@ public class RelationDataIntegrityImpl extends MppServiceImpl<RStatIntegrityDMap
BeanUtils.copyProperties(item, onlineRate);
result.add(onlineRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataLimitQualifiedImpl extends MppServiceImpl<RStatLimitQua
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -110,7 +110,7 @@ public class RelationDataLimitRateDetailImpl extends MppServiceImpl<RStatLimitRa
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -39,7 +39,7 @@ public class RelationDataLimitRateImpl extends MppServiceImpl<RStatLimitRateRela
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -42,7 +42,7 @@ public class RelationDataLimitTargetImpl extends MppServiceImpl<RStatLimitTarget
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -35,7 +35,7 @@ public class RelationDataOnlineRateImpl extends MppServiceImpl<RStatOnlineRateD
BeanUtils.copyProperties(item, onlineRate);
result.add(onlineRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -35,7 +35,7 @@ public class RelationDataOrgIntegrityImpl extends MppServiceImpl<RStatOrgIntegri
BeanUtils.copyProperties(item, onlineRate);
result.add(onlineRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -91,7 +91,7 @@ public class RelationDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapp
BeanUtils.copyProperties(item, data);
result.add(data);
});
dataPlt.saveOrUpdateBatchByMultiId(result,500);
dataPlt.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionImpl extends MppServiceImpl<RMpPollutionDMappe
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionOrgDImpl extends MppServiceImpl<RStatPollution
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionOrgMImpl extends MppServiceImpl<RStatPollution
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionOrgQImpl extends MppServiceImpl<RStatPollution
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionOrgYImpl extends MppServiceImpl<RStatPollution
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionSubstationDImpl extends MppServiceImpl<RStatPo
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionSubstationMImpl extends MppServiceImpl<RStatPo
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionSubstationQImpl extends MppServiceImpl<RStatPo
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -34,7 +34,7 @@ public class RelationDataPollutionSubstationYImpl extends MppServiceImpl<RStatPo
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -120,7 +120,7 @@ public class RelationDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
BeanUtils.copyProperties(item, dataV);
result.add(dataV);
});
iDataV.saveOrUpdateBatchByMultiId(result,500);
iDataV.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -32,6 +32,6 @@ public class RelationRActivePowerRangeServiceImpl extends MppServiceImpl<RActive
powerRange.setState(1);
result.add(powerRange);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -33,7 +33,7 @@ public class RelationRmpEventDetailDImpl extends MppServiceImpl<RMpEventDetailDM
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -33,7 +33,7 @@ public class RelationRmpEventDetailMImpl extends MppServiceImpl<RMpEventDetailMM
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -33,7 +33,7 @@ public class RelationRmpEventDetailQImpl extends MppServiceImpl<RMpEventDetailQM
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
@Override

View File

@@ -30,6 +30,6 @@ public class RelationRmpEventDetailYImpl extends MppServiceImpl<RMpEventDetailYM
BeanUtils.copyProperties(item, limitRate);
result.add(limitRate);
});
this.saveOrUpdateBatchByMultiId(result,500);
this.saveOrUpdateBatchByMultiId(result,1000);
}
}

View File

@@ -9,6 +9,10 @@ microservice:
url: @gateway.url@
server:
port: 10405
compression:
enabled: true
mime-types: application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 1024
#feign接口开启服务熔断降级处理
feign:
sentinel: