微调
This commit is contained in:
@@ -92,6 +92,7 @@ public class SocketDevResponseService {
|
|||||||
private final ISysTestConfigService sysTestConfigService;
|
private final ISysTestConfigService sysTestConfigService;
|
||||||
private final AdHarmonicService adHarmonicService;
|
private final AdHarmonicService adHarmonicService;
|
||||||
private final IAdPlanService adPlanService;
|
private final IAdPlanService adPlanService;
|
||||||
|
private final IPqScriptCheckDataService pqScriptCheckDataService;
|
||||||
@Value("${phaseAngle.isEnable}")
|
@Value("${phaseAngle.isEnable}")
|
||||||
private Boolean isPhaseAngle;
|
private Boolean isPhaseAngle;
|
||||||
|
|
||||||
@@ -844,15 +845,17 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
||||||
//不合格项复检
|
//不合格项复检
|
||||||
List<Integer> indexes = new ArrayList<>();
|
Set<Integer> indexes = new HashSet<>();
|
||||||
StorageParam storageParam = new StorageParam();
|
StorageParam storageParam = new StorageParam();
|
||||||
storageParam.setCode(param.getCode());
|
storageParam.setCode(param.getCode());
|
||||||
storageParam.setScriptId(param.getScriptId());
|
storageParam.setScriptId(param.getScriptId());
|
||||||
param.getDevIds().forEach(devId -> {
|
param.getDevIds().forEach(devId -> {
|
||||||
storageParam.setDevId(devId);
|
storageParam.setDevId(devId);
|
||||||
indexes.addAll(adHarmonicService.getIndex(storageParam, true));
|
indexes.addAll(adHarmonicService.getIndex(storageParam));
|
||||||
});
|
});
|
||||||
issueParam.setIndexList(indexes);
|
List<Integer> notErrorCheckIndex = pqScriptCheckDataService.listNotErrorCheckIndex(param.getScriptId());
|
||||||
|
indexes.removeAll(notErrorCheckIndex);
|
||||||
|
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
||||||
} else {
|
} else {
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.njcn.gather.plan.service.IAdPlanSourceService;
|
|||||||
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
||||||
import com.njcn.gather.report.pojo.po.PqReport;
|
import com.njcn.gather.report.pojo.po.PqReport;
|
||||||
import com.njcn.gather.script.pojo.po.PqScriptDtls;
|
import com.njcn.gather.script.pojo.po.PqScriptDtls;
|
||||||
|
import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
||||||
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
||||||
import com.njcn.gather.script.service.IPqScriptService;
|
import com.njcn.gather.script.service.IPqScriptService;
|
||||||
import com.njcn.gather.source.pojo.po.PqSource;
|
import com.njcn.gather.source.pojo.po.PqSource;
|
||||||
@@ -103,6 +104,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
private final IDevTypeService devTypeService;
|
private final IDevTypeService devTypeService;
|
||||||
private final IDictTypeService dictTypeService;
|
private final IDictTypeService dictTypeService;
|
||||||
private final AdHarmonicService adHarmonicService;
|
private final AdHarmonicService adHarmonicService;
|
||||||
|
private final IPqScriptCheckDataService pqScriptCheckDataService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<AdPlanVO> listAdPlan(AdPlanParam.QueryParam queryParam) {
|
public Page<AdPlanVO> listAdPlan(AdPlanParam.QueryParam queryParam) {
|
||||||
@@ -330,15 +332,16 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
//
|
//
|
||||||
// scriptDtlsList = scriptDtlsList.stream().filter(obj -> !sortSet.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
// scriptDtlsList = scriptDtlsList.stream().filter(obj -> !sortSet.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
||||||
// }
|
// }
|
||||||
List<Integer> indexes = new ArrayList<>();
|
List<Integer> notErrorCheckIndex = pqScriptCheckDataService.listNotErrorCheckIndex(scriptId);
|
||||||
|
Set<Integer> indexes = new HashSet<>();
|
||||||
StorageParam storageParam = new StorageParam();
|
StorageParam storageParam = new StorageParam();
|
||||||
storageParam.setCode(adPlan.getCode() + "");
|
storageParam.setCode(adPlan.getCode() + "");
|
||||||
storageParam.setScriptId(adPlan.getScriptId());
|
storageParam.setScriptId(adPlan.getScriptId());
|
||||||
devIds.forEach(devId -> {
|
devIds.forEach(devId -> {
|
||||||
storageParam.setDevId(devId);
|
storageParam.setDevId(devId);
|
||||||
indexes.addAll(adHarmonicService.getIndex(storageParam, true));
|
indexes.addAll(adHarmonicService.getIndex(storageParam));
|
||||||
});
|
});
|
||||||
|
indexes.removeAll(notErrorCheckIndex);
|
||||||
scriptDtlsList = scriptDtlsList.stream().filter(obj -> indexes.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
scriptDtlsList = scriptDtlsList.stream().filter(obj -> indexes.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,4 +51,12 @@ public interface IPqScriptCheckDataService extends IService<PqScriptCheckData> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean deleteByScriptIds(List<String> ids);
|
boolean deleteByScriptIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据脚本id查询出不参与误差比较的检查项对应的index
|
||||||
|
*
|
||||||
|
* @param scriptId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Integer> listNotErrorCheckIndex(String scriptId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@@ -34,14 +36,14 @@ import java.util.stream.Collectors;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataMapper, PqScriptCheckData> implements IPqScriptCheckDataService {
|
public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataMapper, PqScriptCheckData> implements IPqScriptCheckDataService {
|
||||||
|
|
||||||
private final String SYMBOL="$";
|
private final String SYMBOL = "$";
|
||||||
|
|
||||||
private final DictTreeMapper dictTreeMapper;
|
private final DictTreeMapper dictTreeMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getValueType(PqScriptCheckDataParam param) {
|
public List<String> getValueType(PqScriptCheckDataParam param) {
|
||||||
String dataType = param.getDataType();
|
String dataType = param.getDataType();
|
||||||
if(StrUtil.isNotBlank(dataType)){
|
if (StrUtil.isNotBlank(dataType)) {
|
||||||
String[] split = dataType.split(",");
|
String[] split = dataType.split(",");
|
||||||
if (split.length > 1) {
|
if (split.length > 1) {
|
||||||
dataType = split[0];
|
dataType = split[0];
|
||||||
@@ -60,7 +62,7 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
|
|||||||
if (param.getIsValueTypeName()) {
|
if (param.getIsValueTypeName()) {
|
||||||
final String finalDataType = dataType;
|
final String finalDataType = dataType;
|
||||||
List<String> checkData = pqScriptCheckData.stream().map(x -> finalDataType + SYMBOL + x.getValueType()).distinct().collect(Collectors.toList());
|
List<String> checkData = pqScriptCheckData.stream().map(x -> finalDataType + SYMBOL + x.getValueType()).distinct().collect(Collectors.toList());
|
||||||
String U = finalDataType + SYMBOL+ DetectionCodeEnum.U1.getCode();
|
String U = finalDataType + SYMBOL + DetectionCodeEnum.U1.getCode();
|
||||||
if (!checkData.contains(U)) {
|
if (!checkData.contains(U)) {
|
||||||
if (checkData.contains(finalDataType + SYMBOL + DetectionCodeEnum.V2_50.getCode())) {
|
if (checkData.contains(finalDataType + SYMBOL + DetectionCodeEnum.V2_50.getCode())) {
|
||||||
checkData.add(U);
|
checkData.add(U);
|
||||||
@@ -143,4 +145,13 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
|
|||||||
public boolean deleteByScriptIds(List<String> ids) {
|
public boolean deleteByScriptIds(List<String> ids) {
|
||||||
return this.remove(new LambdaQueryWrapper<PqScriptCheckData>().in(PqScriptCheckData::getScriptId, ids));
|
return this.remove(new LambdaQueryWrapper<PqScriptCheckData>().in(PqScriptCheckData::getScriptId, ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Integer> listNotErrorCheckIndex(String scriptId) {
|
||||||
|
LambdaQueryWrapper<PqScriptCheckData> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.select(PqScriptCheckData::getScriptIndex)
|
||||||
|
.eq(PqScriptCheckData::getScriptId, scriptId)
|
||||||
|
.eq(PqScriptCheckData::getErrorFlag, 0);
|
||||||
|
return this.list(wrapper).stream().map(PqScriptCheckData::getScriptIndex).distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,10 +48,9 @@ public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
|||||||
* 获取索引
|
* 获取索引
|
||||||
*
|
*
|
||||||
* @param param
|
* @param param
|
||||||
* @param isExculdePhaseAngle 是否排除电压相角、电流相角
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Integer> getIndex(StorageParam param, Boolean isExculdePhaseAngle);
|
List<Integer> getIndex(StorageParam param);
|
||||||
|
|
||||||
AdHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam);
|
AdHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam);
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adMap.keySet()));
|
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adMap.keySet()));
|
||||||
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
||||||
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(3);
|
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(3);
|
||||||
adMap.forEach((ad,value)->{
|
adMap.forEach((ad, value) -> {
|
||||||
if (dictTreeByName.containsKey(ad)) {
|
if (dictTreeByName.containsKey(ad)) {
|
||||||
DictTree dictData = dictTreeByName.get(ad);
|
DictTree dictData = dictTreeByName.get(ad);
|
||||||
List<RawDataVO> rawDataVOS = new ArrayList<>();
|
List<RawDataVO> rawDataVOS = new ArrayList<>();
|
||||||
@@ -147,7 +147,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adMap.keySet()));
|
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adMap.keySet()));
|
||||||
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
||||||
Map<String, List<RawResultDataVO>> info = new LinkedHashMap<>(3);
|
Map<String, List<RawResultDataVO>> info = new LinkedHashMap<>(3);
|
||||||
adMap.forEach((ad,value)->{
|
adMap.forEach((ad, value) -> {
|
||||||
if (dictTreeByName.containsKey(ad)) {
|
if (dictTreeByName.containsKey(ad)) {
|
||||||
DictTree dictData = dictTreeByName.get(ad);
|
DictTree dictData = dictTreeByName.get(ad);
|
||||||
List<RawResultDataVO> rawDataVOS = new ArrayList<>();
|
List<RawResultDataVO> rawDataVOS = new ArrayList<>();
|
||||||
@@ -201,7 +201,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> getIndex(StorageParam param, Boolean isExculdePhaseAngle) {
|
public List<Integer> getIndex(StorageParam param) {
|
||||||
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,7 +211,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
.ne(AdHarmonicResult::getResultFlag, 1)
|
.ne(AdHarmonicResult::getResultFlag, 1)
|
||||||
.eq(AdHarmonicResult::getScriptId, param.getScriptId());
|
.eq(AdHarmonicResult::getScriptId, param.getScriptId());
|
||||||
List<AdHarmonicResult> adHarmonicResultList = this.list(lambdaQueryWrapper);
|
List<AdHarmonicResult> adHarmonicResultList = this.list(lambdaQueryWrapper);
|
||||||
List<Integer> indexes = new ArrayList<>(adHarmonicResultList.stream().map(AdHarmonicResult::getSort).collect(Collectors.toList()));
|
List<Integer> indexes = new ArrayList<>(adHarmonicResultList.stream().map(AdHarmonicResult::getSort).distinct().collect(Collectors.toList()));
|
||||||
|
|
||||||
DynamicTableNameHandler.setTableName(prefixNon + param.getCode());
|
DynamicTableNameHandler.setTableName(prefixNon + param.getCode());
|
||||||
LambdaQueryWrapper<AdNonHarmonicResult> resultLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AdNonHarmonicResult> resultLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -219,13 +219,8 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
.likeRight(StrUtil.isNotBlank(param.getDevId()), AdNonHarmonicResult::getMonitorId, param.getDevId())
|
.likeRight(StrUtil.isNotBlank(param.getDevId()), AdNonHarmonicResult::getMonitorId, param.getDevId())
|
||||||
.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).distinct().collect(Collectors.toList()));
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return indexes;
|
return indexes;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user