This commit is contained in:
caozehui
2025-05-13 14:41:50 +08:00
parent ebb45238b0
commit ab2e5c346e
6 changed files with 41 additions and 22 deletions

View File

@@ -92,6 +92,7 @@ public class SocketDevResponseService {
private final ISysTestConfigService sysTestConfigService;
private final AdHarmonicService adHarmonicService;
private final IAdPlanService adPlanService;
private final IPqScriptCheckDataService pqScriptCheckDataService;
@Value("${phaseAngle.isEnable}")
private Boolean isPhaseAngle;
@@ -844,15 +845,17 @@ public class SocketDevResponseService {
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
//不合格项复检
List<Integer> indexes = new ArrayList<>();
Set<Integer> indexes = new HashSet<>();
StorageParam storageParam = new StorageParam();
storageParam.setCode(param.getCode());
storageParam.setScriptId(param.getScriptId());
param.getDevIds().forEach(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());
} else {
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());

View File

@@ -39,6 +39,7 @@ import com.njcn.gather.plan.service.IAdPlanSourceService;
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
import com.njcn.gather.report.pojo.po.PqReport;
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.IPqScriptService;
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 IDictTypeService dictTypeService;
private final AdHarmonicService adHarmonicService;
private final IPqScriptCheckDataService pqScriptCheckDataService;
@Override
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());
// }
List<Integer> indexes = new ArrayList<>();
List<Integer> notErrorCheckIndex = pqScriptCheckDataService.listNotErrorCheckIndex(scriptId);
Set<Integer> indexes = new HashSet<>();
StorageParam storageParam = new StorageParam();
storageParam.setCode(adPlan.getCode() + "");
storageParam.setScriptId(adPlan.getScriptId());
devIds.forEach(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());
}

View File

@@ -51,4 +51,12 @@ public interface IPqScriptCheckDataService extends IService<PqScriptCheckData> {
* @return
*/
boolean deleteByScriptIds(List<String> ids);
/**
* 根据脚本id查询出不参与误差比较的检查项对应的index
*
* @param scriptId
* @return
*/
List<Integer> listNotErrorCheckIndex(String scriptId);
}

View File

@@ -20,7 +20,9 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;
@@ -34,14 +36,14 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataMapper, PqScriptCheckData> implements IPqScriptCheckDataService {
private final String SYMBOL="$";
private final String SYMBOL = "$";
private final DictTreeMapper dictTreeMapper;
@Override
public List<String> getValueType(PqScriptCheckDataParam param) {
String dataType = param.getDataType();
if(StrUtil.isNotBlank(dataType)){
if (StrUtil.isNotBlank(dataType)) {
String[] split = dataType.split(",");
if (split.length > 1) {
dataType = split[0];
@@ -60,7 +62,7 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
if (param.getIsValueTypeName()) {
final String finalDataType = dataType;
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(finalDataType + SYMBOL + DetectionCodeEnum.V2_50.getCode())) {
checkData.add(U);
@@ -143,4 +145,13 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
public boolean deleteByScriptIds(List<String> 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());
}
}