不合格项复检
This commit is contained in:
@@ -246,13 +246,13 @@ public class AdPlanController extends BaseController {
|
||||
// }
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getBigTestItem")
|
||||
@PostMapping("/getBigTestItem")
|
||||
@ApiOperation("获取检测大项数据")
|
||||
@ApiImplicitParam(name = "id", value = "检测计划id", required = true)
|
||||
public HttpResult<List<Map<String, String>>> getBigTestItem(@RequestParam("planId") String planId) {
|
||||
public HttpResult<List<Map<String, String>>> getBigTestItem(@RequestBody AdPlanParam.CheckParam checkParam) {
|
||||
String methodDescribe = getMethodDescribe("getBigTestItem");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, planId);
|
||||
List<Map<String, String>> result = adPlanService.getBigTestItem(planId);
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, checkParam);
|
||||
List<Map<String, String>> result = adPlanService.getBigTestItem(checkParam.getReCheckType(),checkParam.getPlanId(),checkParam.getDevId());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
@@ -126,4 +127,11 @@ public class AdPlanParam {
|
||||
// private Integer result;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CheckParam{
|
||||
// 0:不合格项复检 1:全部复检
|
||||
private Integer reCheckType;
|
||||
private String planId;
|
||||
private String devId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.njcn.gather.plan.service;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.gather.plan.pojo.param.AdPlanParam;
|
||||
import com.njcn.gather.plan.pojo.vo.AdPlanVO;
|
||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||
import com.njcn.gather.plan.pojo.vo.AdPlanExcel;
|
||||
import com.njcn.gather.plan.pojo.vo.AdPlanVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -70,6 +70,7 @@ public interface IAdPlanService extends IService<AdPlan> {
|
||||
|
||||
/**
|
||||
* 二楼导入检测计划
|
||||
*
|
||||
* @param planExcelList
|
||||
* @param patternId
|
||||
*/
|
||||
@@ -85,26 +86,30 @@ public interface IAdPlanService extends IService<AdPlan> {
|
||||
/**
|
||||
* 获取检测大项
|
||||
*
|
||||
* @param reCheckType 0:不合格项复检 1:全部复检
|
||||
* @param planId 检测计划Id
|
||||
* @param devId 设备Id
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, String>> getBigTestItem(String planId);
|
||||
List<Map<String, String>> getBigTestItem(Integer reCheckType, String planId, String devId);
|
||||
|
||||
/**
|
||||
* 修改计划状态
|
||||
*
|
||||
* @param planId
|
||||
* @param devIds
|
||||
* @return
|
||||
*/
|
||||
boolean updateTestState(String planId,List<String> devIds);
|
||||
boolean updateTestState(String planId, List<String> devIds);
|
||||
|
||||
/**
|
||||
* 数据状态回退
|
||||
*
|
||||
* @param planId
|
||||
* @param devIds
|
||||
* @return
|
||||
*/
|
||||
boolean updateBackTestState(String planId,List<String> devIds);
|
||||
boolean updateBackTestState(String planId, List<String> devIds);
|
||||
|
||||
void finishPlan(String planId);
|
||||
|
||||
|
||||
@@ -37,6 +37,9 @@ import com.njcn.gather.script.service.IPqScriptDtlsService;
|
||||
import com.njcn.gather.script.service.IPqScriptService;
|
||||
import com.njcn.gather.source.pojo.po.PqSource;
|
||||
import com.njcn.gather.source.service.IPqSourceService;
|
||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
||||
import com.njcn.gather.storage.service.TableGenService;
|
||||
import com.njcn.gather.system.config.pojo.po.SysTestConfig;
|
||||
import com.njcn.gather.system.config.service.ISysTestConfigService;
|
||||
@@ -91,6 +94,8 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
private final ISysTestConfigService sysTestConfigService;
|
||||
private final IDevTypeService devTypeService;
|
||||
private final IDictTypeService dictTypeService;
|
||||
private final AdNonHarmonicService adNonHarmonicService;
|
||||
private final AdHarmonicService adHarmonicService;
|
||||
|
||||
@Override
|
||||
public Page<AdPlanVO> listAdPlan(AdPlanParam.QueryParam queryParam) {
|
||||
@@ -163,7 +168,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
AdPlan plan1 = this.getById(param.getId());
|
||||
AdPlan plan2 = new AdPlan();
|
||||
if (plan1.getTestState() != CheckStateEnum.UNCHECKED.getValue()) {
|
||||
if (!plan1.getScriptId().equals(param.getScriptId())){
|
||||
if (!plan1.getScriptId().equals(param.getScriptId())) {
|
||||
throw new BusinessException(PlanResponseEnum.CANNOT_CHANGE_SCRIPT_WHEN_CHECKING);
|
||||
}
|
||||
if (!plan1.getErrorSysId().equals(param.getErrorSysId())) {
|
||||
@@ -351,7 +356,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getBigTestItem(String planId) {
|
||||
public List<Map<String, String>> getBigTestItem(Integer reCheckType, String planId, String devId) {
|
||||
List<Map<String, String>> result = new ArrayList<>();
|
||||
AdPlan adPlan = this.getById(planId);
|
||||
if (ObjectUtil.isNull(adPlan)) {
|
||||
@@ -361,6 +366,20 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
|
||||
List<PqScriptDtls> scriptDtlsList = pqScriptDtlsService.listPqScriptDtlByScriptId(scriptId);
|
||||
|
||||
// 不合格项复检
|
||||
if (reCheckType == 0) {
|
||||
List<AdBaseResult> allResultList = new ArrayList<>();
|
||||
allResultList.addAll(adHarmonicService.get(scriptId, null, devId, "-1", adPlan.getCode()));
|
||||
allResultList.addAll(adNonHarmonicService.get(scriptId, null, devId, "-1", adPlan.getCode()));
|
||||
|
||||
if (ObjectUtil.isNotEmpty(allResultList)) {
|
||||
List<AdBaseResult> passList = allResultList.stream().filter(obj -> obj.getResultFlag() == 1).collect(Collectors.toList());
|
||||
TreeSet<Integer> sortSet = passList.stream().map(AdBaseResult::getSort).collect(Collectors.toCollection(TreeSet::new));
|
||||
|
||||
scriptDtlsList = scriptDtlsList.stream().filter(obj -> !sortSet.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, List<PqScriptDtls>> collect = scriptDtlsList.stream()
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getScriptIndex))
|
||||
.collect(Collectors.groupingBy(PqScriptDtls::getScriptType, LinkedHashMap::new, Collectors.toList()));
|
||||
|
||||
Reference in New Issue
Block a user