正式检测-左侧检测项、检测详情弹窗-表单内容

This commit is contained in:
caozehui
2024-12-31 14:42:19 +08:00
parent 3bc797f23e
commit 14f3ab52bb
22 changed files with 652 additions and 23 deletions

View File

@@ -52,8 +52,6 @@ import java.util.Map;
public class AdPlanController extends BaseController { public class AdPlanController extends BaseController {
private final IAdPlanService adPlanService; private final IAdPlanService adPlanService;
private final IPqDevService pqDevService;
private final IDictDataService dictDataService;
@OperateInfo @OperateInfo
@PostMapping("/list") @PostMapping("/list")
@@ -166,7 +164,7 @@ public class AdPlanController extends BaseController {
} else { } else {
List<AdPlanExcel.ImportData> adPlanExcelList = adPlanExcelResult.getList(); List<AdPlanExcel.ImportData> adPlanExcelList = adPlanExcelResult.getList();
if (ObjectUtil.isNotEmpty(adPlanExcelList)) { if (ObjectUtil.isNotEmpty(adPlanExcelList)) {
adPlanService.importData(patternId,adPlanExcelList); adPlanService.importData(patternId, adPlanExcelList);
} }
} }
} catch (Exception e) { } catch (Exception e) {
@@ -186,5 +184,16 @@ public class AdPlanController extends BaseController {
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); // return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
// } // }
@OperateInfo
@GetMapping("/getBigTestItem")
@ApiOperation("获取检测大项数据")
@ApiImplicitParam(name = "id", value = "检测计划id", required = true)
public HttpResult<List<Map<String, String>>> getBigTestItem(@RequestParam("planId") String planId) {
String methodDescribe = getMethodDescribe("getBigTestItem");
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, planId);
List<Map<String, String>> result = adPlanService.getBigTestItem(planId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
} }

View File

@@ -77,4 +77,19 @@ public interface IAdPlanService extends IService<AdPlan> {
*/ */
void importData(String patternId, List<AdPlanExcel.ImportData> adPlanExcelList); void importData(String patternId, List<AdPlanExcel.ImportData> adPlanExcelList);
/**
* 可视化
*
* @param planList 检测计划列表
*/
void visualize(List<AdPlan> planList);
/**
* 获取检测大项
*
* @param planId 检测计划Id
* @return
*/
List<Map<String, String>> getBigTestItem(String planId);
} }

View File

@@ -15,6 +15,8 @@ import com.njcn.gather.device.device.pojo.po.PqDev;
import com.njcn.gather.device.device.service.IPqDevService; import com.njcn.gather.device.device.service.IPqDevService;
import com.njcn.gather.device.err.service.IPqErrSysService; import com.njcn.gather.device.err.service.IPqErrSysService;
import com.njcn.gather.device.pojo.enums.*; import com.njcn.gather.device.pojo.enums.*;
import com.njcn.gather.device.script.pojo.po.PqScriptDtls;
import com.njcn.gather.device.script.service.IPqScriptDtlsService;
import com.njcn.gather.device.script.service.IPqScriptService; import com.njcn.gather.device.script.service.IPqScriptService;
import com.njcn.gather.device.source.pojo.po.PqSource; import com.njcn.gather.device.source.pojo.po.PqSource;
import com.njcn.gather.device.source.service.IPqSourceService; import com.njcn.gather.device.source.service.IPqSourceService;
@@ -26,7 +28,9 @@ import com.njcn.gather.plan.pojo.vo.AdPlanExcel;
import com.njcn.gather.plan.pojo.vo.AdPlanVO; import com.njcn.gather.plan.pojo.vo.AdPlanVO;
import com.njcn.gather.plan.service.IAdPlanService; import com.njcn.gather.plan.service.IAdPlanService;
import com.njcn.gather.plan.service.IAdPlanSourceService; import com.njcn.gather.plan.service.IAdPlanSourceService;
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
import com.njcn.gather.system.dictionary.service.IDictDataService; import com.njcn.gather.system.dictionary.service.IDictDataService;
import com.njcn.gather.system.dictionary.service.IDictTreeService;
import com.njcn.web.factory.PageFactory; import com.njcn.web.factory.PageFactory;
import com.njcn.web.utils.ExcelUtil; import com.njcn.web.utils.ExcelUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -53,6 +57,8 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
private final IPqDevService pqDevService; private final IPqDevService pqDevService;
private final IDictDataService dictDataService; private final IDictDataService dictDataService;
private final IPqSourceService pqSourceService; private final IPqSourceService pqSourceService;
private final IPqScriptDtlsService pqScriptDtlsService;
private final IDictTreeService dictTreeService;
@Override @Override
public Page<AdPlanVO> listAdPlan(AdPlanParam.QueryParam queryParam) { public Page<AdPlanVO> listAdPlan(AdPlanParam.QueryParam queryParam) {
@@ -168,7 +174,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
child.put("id", adPlan.getId()); child.put("id", adPlan.getId());
child.put("pid", adPlan.getFatherPlanId()); child.put("pid", adPlan.getFatherPlanId());
child.put("name", adPlan.getName()); child.put("name", adPlan.getName());
child.put("timeCheck",adPlan.getTimeCheck()); child.put("timeCheck", adPlan.getTimeCheck());
children.add(child); children.add(child);
}); });
} }
@@ -266,12 +272,8 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
return queryWrapper; return queryWrapper;
} }
/** @Override
* 可视化 public void visualize(List<AdPlan> planList) {
*
* @param planList 检测计划列表
*/
private void visualize(List<AdPlan> planList) {
planList.forEach(adPlan -> { planList.forEach(adPlan -> {
// if (StrUtil.isNotBlank(adPlan.getPattern())) { // if (StrUtil.isNotBlank(adPlan.getPattern())) {
// adPlan.setPattern(dictDataService.getDictDataById(adPlan.getPattern()).getName()); // adPlan.setPattern(dictDataService.getDictDataById(adPlan.getPattern()).getName());
@@ -295,6 +297,30 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
}); });
} }
@Override
public List<Map<String, String>> getBigTestItem(String planId) {
List<Map<String, String>> result = new ArrayList<>();
AdPlan adPlan = this.getById(planId);
String scriptId = adPlan.getScriptId();
List<PqScriptDtls> scriptDtlsList = pqScriptDtlsService.listPqScriptDtlByScriptId(scriptId);
Map<String, List<PqScriptDtls>> collect = scriptDtlsList.stream()
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
.collect(Collectors.groupingBy(PqScriptDtls::getScriptType, LinkedHashMap::new, Collectors.toList()));
collect.forEach((key, value) -> {
Map<String, String> map = new HashMap<>();
map.put("id", key);
DictTree dictTree = dictTreeService.getById(key);
map.put("code", dictTree.getCode());
map.put("scriptName", dictTree.getName());
result.add(map);
});
return result;
}
/** /**
* 逆向可视化 * 逆向可视化
* *
@@ -327,5 +353,4 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
private Integer generateCode() { private Integer generateCode() {
return this.count() + 1; return this.count() + 1;
} }
} }

View File

@@ -0,0 +1,61 @@
package com.njcn.gather.result.controller;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.LogUtil;
import com.njcn.gather.result.pojo.param.ResultParam;
import com.njcn.gather.result.pojo.vo.FormContentVO;
import com.njcn.gather.result.pojo.vo.TreeDataVO;
import com.njcn.gather.result.service.IResultService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.utils.HttpResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author caozehui
* @data 2024-12-30
*/
@Slf4j
@Api(tags = "检测结果")
@RestController
@RequestMapping("/result")
@RequiredArgsConstructor
public class ResultController extends BaseController {
private final IResultService resultService;
@OperateInfo
@PostMapping("/formContent")
@ApiOperation("查询检测结果-表单内容")
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
public HttpResult<FormContentVO> formContent(@RequestBody @Validated ResultParam.QueryParam queryParam) {
String methodDescribe = getMethodDescribe("formContent");
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
FormContentVO result = resultService.getFormContent(queryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
@OperateInfo
@PostMapping("/treeData")
@ApiOperation("查询检测结果-树形结构的具体检测项")
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
public HttpResult<List<TreeDataVO>> treeData(@RequestBody @Validated ResultParam.QueryParam queryParam) {
String methodDescribe = getMethodDescribe("treeData");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
}

View File

@@ -0,0 +1,37 @@
package com.njcn.gather.result.pojo.param;
import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.gather.device.pojo.constant.DevValidMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
/**
* @author caozehui
* @data 2024-12-30
*/
@Data
public class ResultParam {
@Data
public static class QueryParam {
@ApiModelProperty(value = "检测计划Id", required = true)
@NotBlank(message = DevValidMessage.PLAN_ID_NOT_NULL)
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.PLAN_ID_FORMAT_ERROR)
private String planId;
// 脚本类型当为null时表示查询所有脚本类型否则只查询指定脚本类型
private String scriptType;
@ApiModelProperty(value = "设备Id", required = true)
@NotBlank(message = DevValidMessage.DEV_ID_NOT_BLANK)
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.DEV_ID_FORMAT_ERROR)
private String deviceId;
// 通道号,当为-1时表示查询所有通道号否则只查询指定通道号
private String chnNum;
}
}

View File

@@ -0,0 +1,24 @@
package com.njcn.gather.result.pojo.vo;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author caozehui
* @data 2024-12-30
*/
@Data
public class FormContentVO {
private String scriptName;
private String errorSysName;
private String dataRule;
private String deviceName;
private List<Map<String, String>> chnList;
}

View File

@@ -0,0 +1,16 @@
package com.njcn.gather.result.pojo.vo;
import lombok.Data;
/**
* @author caozehui
* @data 2024-12-31
*/
@Data
public class TreeDataVO {
private String id;
private String scriptName;
private TreeDataVO[] children;
}

View File

@@ -0,0 +1,12 @@
package com.njcn.gather.result.service;
import com.njcn.gather.result.pojo.param.ResultParam;
import com.njcn.gather.result.pojo.vo.FormContentVO;
/**
* @author caozehui
* @data 2024-12-30
*/
public interface IResultService {
FormContentVO getFormContent(ResultParam.QueryParam queryParam);
}

View File

@@ -0,0 +1,109 @@
package com.njcn.gather.result.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
import com.njcn.gather.device.device.service.IPqDevService;
import com.njcn.gather.device.script.service.IPqScriptDtlsService;
import com.njcn.gather.plan.pojo.po.AdPlan;
import com.njcn.gather.plan.service.IAdPlanService;
import com.njcn.gather.result.pojo.param.ResultParam;
import com.njcn.gather.result.pojo.vo.FormContentVO;
import com.njcn.gather.result.service.IResultService;
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.system.config.service.ISysTestConfigService;
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
import com.njcn.gather.system.dictionary.service.IDictTreeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author caozehui
* @data 2024-12-30
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class ResultServiceImpl implements IResultService {
private final IAdPlanService adPlanService;
private final ISysTestConfigService sysTestConfigService;
private final IPqDevService pqDevService;
private final AdNonHarmonicService adNonHarmonicService;
private final AdHarmonicService adHarmonicService;
private final IPqScriptDtlsService pqScriptDtlsService;
private final IDictTreeService dictTreeService;
// 谐波类code取树形字典表中的code
private final List<String> HARMONIC_TYPE_CODE = Arrays.asList("HV", "HI", "HP", "HSV", "HSI");
@Override
public FormContentVO getFormContent(ResultParam.QueryParam queryParam) {
FormContentVO formContentVO = new FormContentVO();
AdPlan plan = adPlanService.getById(queryParam.getPlanId());
String scriptId = null;
if (ObjectUtil.isNotNull(plan)) {
scriptId = plan.getScriptId();
adPlanService.visualize(Collections.singletonList(plan));
}
formContentVO.setScriptName(plan.getScriptId());
formContentVO.setErrorSysName(plan.getErrorSysId());
formContentVO.setDataRule(sysTestConfigService.getConfig().getDataRule());
formContentVO.setDeviceName(pqDevService.getById(queryParam.getDeviceId()).getName());
List<Map<String, String>> chnList = new ArrayList<>();
List<AdBaseResult> allResultList = new ArrayList<>();
if (ObjectUtil.isNotNull(queryParam.getScriptType())) { //只查询指定的脚本类型
List<Integer> indexList = pqScriptDtlsService.getIndexList(queryParam.getScriptType(), scriptId);
DictTree dictTree = dictTreeService.getById(queryParam.getScriptType());
if (HARMONIC_TYPE_CODE.contains(dictTree.getCode())) {
String prefix = "ad_harmonic_result_";
DynamicTableNameHandler.setTableName(prefix + plan.getCode());
allResultList.addAll(adHarmonicService.get(scriptId, indexList, queryParam.getDeviceId(), queryParam.getChnNum()));
DynamicTableNameHandler.remove();
} else {
String prefix = "ad_non_harmonic_result_";
DynamicTableNameHandler.setTableName(prefix + plan.getCode());
allResultList.addAll(adNonHarmonicService.get(scriptId, indexList, queryParam.getDeviceId(), queryParam.getChnNum()));
DynamicTableNameHandler.remove();
}
} else { //查询所有的脚本类型
String prefix = "ad_harmonic_result_";
DynamicTableNameHandler.setTableName(prefix + plan.getCode());
allResultList.addAll(adHarmonicService.get(scriptId, null, queryParam.getDeviceId(), queryParam.getChnNum()));
DynamicTableNameHandler.remove();
prefix = "ad_non_harmonic_result_";
DynamicTableNameHandler.setTableName(prefix + plan.getCode());
allResultList.addAll(adNonHarmonicService.get(scriptId, null, queryParam.getDeviceId(), queryParam.getChnNum()));
DynamicTableNameHandler.remove();
}
if(ObjectUtil.isNotEmpty(allResultList)){
Map<String, List<AdBaseResult>> chnMap = allResultList.stream().collect(
Collectors.groupingBy(obj -> obj.getMonitorId().substring(obj.getMonitorId().lastIndexOf("_") + 1))
);
chnMap.forEach((chn, list) -> {
Map<String, String> map = new HashMap<>();
map.put("value", chn);
long count = list.stream().filter(obj -> obj.getResultFlag() == 0).count();
map.put("label", count > 0 ? "0" : "1");
chnList.add(map);
});
}
chnList.sort(Comparator.comparingInt(o -> Integer.parseInt(o.get("value"))));
formContentVO.setChnList(chnList);
return formContentVO;
}
}

View File

@@ -138,9 +138,9 @@ public interface DevValidMessage {
String PQ_SOURCE_PARAMETER_VALUE_NOT_BLANK = "参数值不能为空请检查pqSourceParameterValue参数"; String PQ_SOURCE_PARAMETER_VALUE_NOT_BLANK = "参数值不能为空请检查pqSourceParameterValue参数";
String DEV_ID_NOT_BLANK = "所属设备ID不能为空"; String DEV_ID_NOT_BLANK = "设备ID不能为空";
String DEV_ID_FORMAT_ERROR = "所属设备ID格式错误"; String DEV_ID_FORMAT_ERROR = "设备ID格式错误";
String BELONG_LINE_NOT_BLANK = "所属母线不能为空"; String BELONG_LINE_NOT_BLANK = "所属母线不能为空";

View File

@@ -23,6 +23,7 @@ public class PqScriptDtls implements Serializable {
/** /**
* 检测脚本ID * 检测脚本ID
*/ */
@TableField("Script_Id")
private String scriptId; private String scriptId;
/** /**
@@ -34,6 +35,7 @@ public class PqScriptDtls implements Serializable {
/** /**
* 检测脚本类型 * 检测脚本类型
*/ */
@TableField("Script_Type")
private String scriptType; private String scriptType;
/** /**
@@ -51,6 +53,7 @@ public class PqScriptDtls implements Serializable {
/** /**
* 表明指标类型例如VOL电压、CUR电流、Freq频率... * 表明指标类型例如VOL电压、CUR电流、Freq频率...
*/ */
@TableField("Value_Type")
private String valueType; private String valueType;
/** /**

View File

@@ -55,8 +55,18 @@ public interface IPqScriptDtlsService extends IService<PqScriptDtls> {
/** /**
* 根据计划绑定检测脚本id获取全部检测脚本 * 根据计划绑定检测脚本id获取全部检测脚本
*
* @param param * @param param
* @return * @return
*/ */
List<SourceIssue> listSourceIssue(PqScriptIssueParam param); List<SourceIssue> listSourceIssue(PqScriptIssueParam param);
/**
* 根据脚本类型、脚本id获取index列表
*
* @param scriptType 脚本类型
* @param scriptId 脚本id
* @return index列表
*/
List<Integer> getIndexList(String scriptType, String scriptId);
} }

View File

@@ -197,6 +197,16 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
return sourceIssues; return sourceIssues;
} }
@Override
public List<Integer> getIndexList(String scriptType, String scriptId) {
MPJLambdaWrapper<PqScriptDtls> wrapper = new MPJLambdaWrapper<>();
wrapper.select(PqScriptDtls::getIndex)
.distinct()
.eq(PqScriptDtls::getScriptType, scriptType)
.eq(PqScriptDtls::getScriptId, scriptId);
return this.getBaseMapper().selectJoinList(PqScriptDtls.class, wrapper).stream().map(PqScriptDtls::getIndex).collect(Collectors.toList());
}
private List<PqScriptDtls> pqScriptDtls(String scriptId, Boolean isPhaseSequence, Double volt, Double curr) { private List<PqScriptDtls> pqScriptDtls(String scriptId, Boolean isPhaseSequence, Double volt, Double curr) {
List<PqScriptDtls> pqScriptDtls; List<PqScriptDtls> pqScriptDtls;
MPJLambdaWrapper<PqScriptDtls> queryWrapper = new MPJLambdaWrapper<>(); MPJLambdaWrapper<PqScriptDtls> queryWrapper = new MPJLambdaWrapper<>();

View File

@@ -0,0 +1,14 @@
package com.njcn.gather.storage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
import org.apache.ibatis.annotations.Mapper;
/**
* @author caozehui
* @data 2024-12-30
*/
@Mapper
public interface AdHarmonicMappper extends MPJBaseMapper<AdHarmonicResult> {
}

View File

@@ -1,9 +1,17 @@
package com.njcn.gather.storage.mapper; package com.njcn.gather.storage.mapper;
import com.njcn.db.mybatisplus.mapper.BatchBaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult; import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AdNonHarmonicMapper extends MPJBaseMapper<AdNonHarmonicResult> {
public interface AdNonHarmonicMapper extends BatchBaseMapper<AdNonHarmonicResult> {
} }

View File

@@ -0,0 +1,30 @@
package com.njcn.gather.storage.pojo.po;
import lombok.Data;
/**
* @author caozehui
* @data 2024-12-30
*/
@Data
public class AdBaseResult {
/**
* 监测点Id
*/
private String monitorId;
/**
* 检测脚本Id
*/
private String scriptId;
/**
* 总检测脚本中的测试项序号
*/
private Integer index;
/**
* 0.不合格 1.合格
*/
private Integer resultFlag;
}

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -22,6 +23,9 @@ public class AdHarmonicResult {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableField(exist = false)
private String scriptDtlsId;
/** /**
* 监测点Id * 监测点Id
*/ */
@@ -37,7 +41,9 @@ public class AdHarmonicResult {
*/ */
private String scriptId; private String scriptId;
@TableField("`INDEX`") /**
* 总检测脚本中的测试项序号
*/
private Integer index; private Integer index;
/** /**
@@ -58,751 +64,901 @@ public class AdHarmonicResult {
/** /**
* A相基波 * A相基波
*/ */
@TableField(value = "A_Value_1")
private String aValue1; private String aValue1;
/** /**
* 2次A相谐波 * 2次A相谐波
*/ */
@TableField(value = "A_Value_2")
private String aValue2; private String aValue2;
/** /**
* 3次A相谐波 * 3次A相谐波
*/ */
@TableField(value = "A_Value_3")
private String aValue3; private String aValue3;
/** /**
* 4次A相谐波 * 4次A相谐波
*/ */
@TableField(value = "A_Value_4")
private String aValue4; private String aValue4;
/** /**
* 5次A相谐波 * 5次A相谐波
*/ */
@TableField(value = "A_Value_5")
private String aValue5; private String aValue5;
/** /**
* 6次A相谐波 * 6次A相谐波
*/ */
@TableField(value = "A_Value_6")
private String aValue6; private String aValue6;
/** /**
* 7次A相谐波 * 7次A相谐波
*/ */
@TableField(value = "A_Value_7")
private String aValue7; private String aValue7;
/** /**
* 8次A相谐波 * 8次A相谐波
*/ */
@TableField(value = "A_Value_8")
private String aValue8; private String aValue8;
/** /**
* 9次A相谐波 * 9次A相谐波
*/ */
@TableField(value = "A_Value_9")
private String aValue9; private String aValue9;
/** /**
* 10次A相谐波 * 10次A相谐波
*/ */
@TableField(value = "A_Value_10")
private String aValue10; private String aValue10;
/** /**
* 11次A相谐波 * 11次A相谐波
*/ */
@TableField(value = "A_Value_11")
private String aValue11; private String aValue11;
/** /**
* 12次A相谐波 * 12次A相谐波
*/ */
@TableField(value = "A_Value_12")
private String aValue12; private String aValue12;
/** /**
* 13次A相谐波 * 13次A相谐波
*/ */
@TableField(value = "A_Value_13")
private String aValue13; private String aValue13;
/** /**
* 14次A相谐波 * 14次A相谐波
*/ */
@TableField(value = "A_Value_14")
private String aValue14; private String aValue14;
/** /**
* 15次A相谐波 * 15次A相谐波
*/ */
@TableField(value = "A_Value_15")
private String aValue15; private String aValue15;
/** /**
* 16次A相谐波 * 16次A相谐波
*/ */
@TableField(value = "A_Value_16")
private String aValue16; private String aValue16;
/** /**
* 17次A相谐波 * 17次A相谐波
*/ */
@TableField(value = "A_Value_17")
private String aValue17; private String aValue17;
/** /**
* 18次A相谐波 * 18次A相谐波
*/ */
@TableField(value = "A_Value_18")
private String aValue18; private String aValue18;
/** /**
* 19次A相谐波 * 19次A相谐波
*/ */
@TableField(value = "A_Value_19")
private String aValue19; private String aValue19;
/** /**
* 20次A相谐波 * 20次A相谐波
*/ */
@TableField(value = "A_Value_20")
private String aValue20; private String aValue20;
/** /**
* 21次A相谐波 * 21次A相谐波
*/ */
@TableField(value = "A_Value_21")
private String aValue21; private String aValue21;
/** /**
* 22次A相谐波 * 22次A相谐波
*/ */
@TableField(value = "A_Value_22")
private String aValue22; private String aValue22;
/** /**
* 23次A相谐波 * 23次A相谐波
*/ */
@TableField(value = "A_Value_23")
private String aValue23; private String aValue23;
/** /**
* 24次A相谐波 * 24次A相谐波
*/ */
@TableField(value = "A_Value_24")
private String aValue24; private String aValue24;
/** /**
* 25次A相谐波 * 25次A相谐波
*/ */
@TableField(value = "A_Value_25")
private String aValue25; private String aValue25;
/** /**
* 26次A相谐波 * 26次A相谐波
*/ */
@TableField(value = "A_Value_26")
private String aValue26; private String aValue26;
/** /**
* 27次A相谐波 * 27次A相谐波
*/ */
@TableField(value = "A_Value_27")
private String aValue27; private String aValue27;
/** /**
* 28次A相谐波 * 28次A相谐波
*/ */
@TableField(value = "A_Value_28")
private String aValue28; private String aValue28;
/** /**
* 29次A相谐波 * 29次A相谐波
*/ */
@TableField(value = "A_Value_29")
private String aValue29; private String aValue29;
/** /**
* 30次A相谐波 * 30次A相谐波
*/ */
@TableField(value = "A_Value_30")
private String aValue30; private String aValue30;
/** /**
* 31次A相谐波 * 31次A相谐波
*/ */
@TableField(value = "A_Value_31")
private String aValue31; private String aValue31;
/** /**
* 32次A相谐波 * 32次A相谐波
*/ */
@TableField(value = "A_Value_32")
private String aValue32; private String aValue32;
/** /**
* 33次A相谐波 * 33次A相谐波
*/ */
@TableField(value = "A_Value_33")
private String aValue33; private String aValue33;
/** /**
* 34次A相谐波 * 34次A相谐波
*/ */
@TableField(value = "A_Value_34")
private String aValue34; private String aValue34;
/** /**
* 35次A相谐波 * 35次A相谐波
*/ */
@TableField(value = "A_Value_35")
private String aValue35; private String aValue35;
/** /**
* 36次A相谐波 * 36次A相谐波
*/ */
@TableField(value = "A_Value_36")
private String aValue36; private String aValue36;
/** /**
* 37次A相谐波 * 37次A相谐波
*/ */
@TableField(value = "A_Value_37")
private String aValue37; private String aValue37;
/** /**
* 38次A相谐波 * 38次A相谐波
*/ */
@TableField(value = "A_Value_38")
private String aValue38; private String aValue38;
/** /**
* 39次A相谐波 * 39次A相谐波
*/ */
@TableField(value = "A_Value_39")
private String aValue39; private String aValue39;
/** /**
* 40次A相谐波 * 40次A相谐波
*/ */
@TableField(value = "A_Value_40")
private String aValue40; private String aValue40;
/** /**
* 41次A相谐波 * 41次A相谐波
*/ */
@TableField(value = "A_Value_41")
private String aValue41; private String aValue41;
/** /**
* 42次A相谐波 * 42次A相谐波
*/ */
@TableField(value = "A_Value_42")
private String aValue42; private String aValue42;
/** /**
* 43次A相谐波 * 43次A相谐波
*/ */
@TableField(value = "A_Value_43")
private String aValue43; private String aValue43;
/** /**
* 44次A相谐波 * 44次A相谐波
*/ */
@TableField(value = "A_Value_44")
private String aValue44; private String aValue44;
/** /**
* 45次A相谐波 * 45次A相谐波
*/ */
@TableField(value = "A_Value_45")
private String aValue45; private String aValue45;
/** /**
* 46次A相谐波 * 46次A相谐波
*/ */
@TableField(value = "A_Value_46")
private String aValue46; private String aValue46;
/** /**
* 47次A相谐波 * 47次A相谐波
*/ */
@TableField(value = "A_Value_47")
private String aValue47; private String aValue47;
/** /**
* 48次A相谐波 * 48次A相谐波
*/ */
@TableField(value = "A_Value_48")
private String aValue48; private String aValue48;
/** /**
* 49次A相谐波 * 49次A相谐波
*/ */
@TableField(value = "A_Value_49")
private String aValue49; private String aValue49;
/** /**
* 50次A相谐波 * 50次A相谐波
*/ */
@TableField(value = "A_Value_50")
private String aValue50; private String aValue50;
/** /**
* B相基波 * B相基波
*/ */
@TableField(value = "B_Value_1")
private String bValue1; private String bValue1;
/** /**
* 2次B相谐波 * 2次B相谐波
*/ */
@TableField(value = "B_Value_2")
private String bValue2; private String bValue2;
/** /**
* 3次B相谐波 * 3次B相谐波
*/ */
@TableField(value = "B_Value_3")
private String bValue3; private String bValue3;
/** /**
* 4次B相谐波 * 4次B相谐波
*/ */
@TableField(value = "B_Value_4")
private String bValue4; private String bValue4;
/** /**
* 5次B相谐波 * 5次B相谐波
*/ */
@TableField(value = "B_Value_5")
private String bValue5; private String bValue5;
/** /**
* 6次B相谐波 * 6次B相谐波
*/ */
@TableField(value = "B_Value_6")
private String bValue6; private String bValue6;
/** /**
* 7次B相谐波 * 7次B相谐波
*/ */
@TableField(value = "B_Value_7")
private String bValue7; private String bValue7;
/** /**
* 8次B相谐波 * 8次B相谐波
*/ */
@TableField(value = "B_Value_8")
private String bValue8; private String bValue8;
/** /**
* 9次B相谐波 * 9次B相谐波
*/ */
@TableField(value = "B_Value_9")
private String bValue9; private String bValue9;
/** /**
* 10次B相谐波 * 10次B相谐波
*/ */
@TableField(value = "B_Value_10")
private String bValue10; private String bValue10;
/** /**
* 11次B相谐波 * 11次B相谐波
*/ */
@TableField(value = "B_Value_11")
private String bValue11; private String bValue11;
/** /**
* 12次B相谐波 * 12次B相谐波
*/ */
@TableField(value = "B_Value_12")
private String bValue12; private String bValue12;
/** /**
* 13次B相谐波 * 13次B相谐波
*/ */
@TableField(value = "B_Value_13")
private String bValue13; private String bValue13;
/** /**
* 14次B相谐波 * 14次B相谐波
*/ */
@TableField(value = "B_Value_14")
private String bValue14; private String bValue14;
/** /**
* 15次B相谐波 * 15次B相谐波
*/ */
@TableField(value = "B_Value_15")
private String bValue15; private String bValue15;
/** /**
* 16次B相谐波 * 16次B相谐波
*/ */
@TableField(value = "B_Value_16")
private String bValue16; private String bValue16;
/** /**
* 17次B相谐波 * 17次B相谐波
*/ */
@TableField(value = "B_Value_17")
private String bValue17; private String bValue17;
/** /**
* 18次B相谐波 * 18次B相谐波
*/ */
@TableField(value = "B_Value_18")
private String bValue18; private String bValue18;
/** /**
* 19次B相谐波 * 19次B相谐波
*/ */
@TableField(value = "B_Value_19")
private String bValue19; private String bValue19;
/** /**
* 20次B相谐波 * 20次B相谐波
*/ */
@TableField(value = "B_Value_20")
private String bValue20; private String bValue20;
/** /**
* 21次B相谐波 * 21次B相谐波
*/ */
@TableField(value = "B_Value_21")
private String bValue21; private String bValue21;
/** /**
* 22次B相谐波 * 22次B相谐波
*/ */
@TableField(value = "B_Value_22")
private String bValue22; private String bValue22;
/** /**
* 23次B相谐波 * 23次B相谐波
*/ */
@TableField(value = "B_Value_23")
private String bValue23; private String bValue23;
/** /**
* 24次B相谐波 * 24次B相谐波
*/ */
@TableField(value = "B_Value_24")
private String bValue24; private String bValue24;
/** /**
* 25次B相谐波 * 25次B相谐波
*/ */
@TableField(value = "B_Value_25")
private String bValue25; private String bValue25;
/** /**
* 26次B相谐波 * 26次B相谐波
*/ */
@TableField(value = "B_Value_26")
private String bValue26; private String bValue26;
/** /**
* 27次B相谐波 * 27次B相谐波
*/ */
@TableField(value = "B_Value_27")
private String bValue27; private String bValue27;
/** /**
* 28次B相谐波 * 28次B相谐波
*/ */
@TableField(value = "B_Value_28")
private String bValue28; private String bValue28;
/** /**
* 29次B相谐波 * 29次B相谐波
*/ */
@TableField(value = "B_Value_29")
private String bValue29; private String bValue29;
/** /**
* 30次B相谐波 * 30次B相谐波
*/ */
@TableField(value = "B_Value_30")
private String bValue30; private String bValue30;
/** /**
* 31次B相谐波 * 31次B相谐波
*/ */
@TableField(value = "B_Value_31")
private String bValue31; private String bValue31;
/** /**
* 32次B相谐波 * 32次B相谐波
*/ */
@TableField(value = "B_Value_32")
private String bValue32; private String bValue32;
/** /**
* 33次B相谐波 * 33次B相谐波
*/ */
@TableField(value = "B_Value_33")
private String bValue33; private String bValue33;
/** /**
* 34次B相谐波 * 34次B相谐波
*/ */
@TableField(value = "B_Value_34")
private String bValue34; private String bValue34;
/** /**
* 35次B相谐波 * 35次B相谐波
*/ */
@TableField(value = "B_Value_35")
private String bValue35; private String bValue35;
/** /**
* 36次B相谐波 * 36次B相谐波
*/ */
@TableField(value = "B_Value_36")
private String bValue36; private String bValue36;
/** /**
* 37次B相谐波 * 37次B相谐波
*/ */
@TableField(value = "B_Value_37")
private String bValue37; private String bValue37;
/** /**
* 38次B相谐波 * 38次B相谐波
*/ */
@TableField(value = "B_Value_38")
private String bValue38; private String bValue38;
/** /**
* 39次B相谐波 * 39次B相谐波
*/ */
@TableField(value = "B_Value_39")
private String bValue39; private String bValue39;
/** /**
* 40次B相谐波 * 40次B相谐波
*/ */
@TableField(value = "B_Value_40")
private String bValue40; private String bValue40;
/** /**
* 41次B相谐波 * 41次B相谐波
*/ */
@TableField(value = "B_Value_41")
private String bValue41; private String bValue41;
/** /**
* 42次B相谐波 * 42次B相谐波
*/ */
@TableField(value = "B_Value_42")
private String bValue42; private String bValue42;
/** /**
* 43次B相谐波 * 43次B相谐波
*/ */
@TableField(value = "B_Value_43")
private String bValue43; private String bValue43;
/** /**
* 44次B相谐波 * 44次B相谐波
*/ */
@TableField(value = "B_Value_44")
private String bValue44; private String bValue44;
/** /**
* 45次B相谐波 * 45次B相谐波
*/ */
@TableField(value = "B_Value_45")
private String bValue45; private String bValue45;
/** /**
* 46次B相谐波 * 46次B相谐波
*/ */
@TableField(value = "B_Value_46")
private String bValue46; private String bValue46;
/** /**
* 47次B相谐波 * 47次B相谐波
*/ */
@TableField(value = "B_Value_47")
private String bValue47; private String bValue47;
/** /**
* 48次B相谐波 * 48次B相谐波
*/ */
@TableField(value = "B_Value_48")
private String bValue48; private String bValue48;
/** /**
* 49次B相谐波 * 49次B相谐波
*/ */
@TableField(value = "B_Value_49")
private String bValue49; private String bValue49;
/** /**
* 50次B相谐波 * 50次B相谐波
*/ */
@TableField(value = "B_Value_50")
private String bValue50; private String bValue50;
/** /**
* C相基波 * C相基波
*/ */
@TableField(value = "C_Value_1")
private String cValue1; private String cValue1;
/** /**
* 2次C相谐波 * 2次C相谐波
*/ */
@TableField(value = "C_Value_2")
private String cValue2; private String cValue2;
/** /**
* 3次C相谐波 * 3次C相谐波
*/ */
@TableField(value = "C_Value_3")
private String cValue3; private String cValue3;
/** /**
* 4次C相谐波 * 4次C相谐波
*/ */
@TableField(value = "C_Value_4")
private String cValue4; private String cValue4;
/** /**
* 5次C相谐波 * 5次C相谐波
*/ */
@TableField(value = "C_Value_5")
private String cValue5; private String cValue5;
/** /**
* 6次C相谐波 * 6次C相谐波
*/ */
@TableField(value = "C_Value_6")
private String cValue6; private String cValue6;
/** /**
* 7次C相谐波 * 7次C相谐波
*/ */
@TableField(value = "C_Value_7")
private String cValue7; private String cValue7;
/** /**
* 8次C相谐波 * 8次C相谐波
*/ */
@TableField(value = "C_Value_8")
private String cValue8; private String cValue8;
/** /**
* 9次C相谐波 * 9次C相谐波
*/ */
@TableField(value = "C_Value_9")
private String cValue9; private String cValue9;
/** /**
* 10次C相谐波 * 10次C相谐波
*/ */
@TableField(value = "C_Value_10")
private String cValue10; private String cValue10;
/** /**
* 11次C相谐波 * 11次C相谐波
*/ */
@TableField(value = "C_Value_11")
private String cValue11; private String cValue11;
/** /**
* 12次C相谐波 * 12次C相谐波
*/ */
@TableField(value = "C_Value_12")
private String cValue12; private String cValue12;
/** /**
* 13次C相谐波 * 13次C相谐波
*/ */
@TableField(value = "C_Value_13")
private String cValue13; private String cValue13;
/** /**
* 14次C相谐波 * 14次C相谐波
*/ */
@TableField(value = "C_Value_14")
private String cValue14; private String cValue14;
/** /**
* 15次C相谐波 * 15次C相谐波
*/ */
@TableField(value = "C_Value_15")
private String cValue15; private String cValue15;
/** /**
* 16次C相谐波 * 16次C相谐波
*/ */
@TableField(value = "C_Value_16")
private String cValue16; private String cValue16;
/** /**
* 17次C相谐波 * 17次C相谐波
*/ */
@TableField(value = "C_Value_17")
private String cValue17; private String cValue17;
/** /**
* 18次C相谐波 * 18次C相谐波
*/ */
@TableField(value = "C_Value_18")
private String cValue18; private String cValue18;
/** /**
* 19次C相谐波 * 19次C相谐波
*/ */
@TableField(value = "C_Value_19")
private String cValue19; private String cValue19;
/** /**
* 20次C相谐波 * 20次C相谐波
*/ */
@TableField(value = "C_Value_20")
private String cValue20; private String cValue20;
/** /**
* 21次C相谐波 * 21次C相谐波
*/ */
@TableField(value = "C_Value_21")
private String cValue21; private String cValue21;
/** /**
* 22次C相谐波 * 22次C相谐波
*/ */
@TableField(value = "C_Value_22")
private String cValue22; private String cValue22;
/** /**
* 23次C相谐波 * 23次C相谐波
*/ */
@TableField(value = "C_Value_23")
private String cValue23; private String cValue23;
/** /**
* 24次C相谐波 * 24次C相谐波
*/ */
@TableField(value = "C_Value_24")
private String cValue24; private String cValue24;
/** /**
* 25次C相谐波 * 25次C相谐波
*/ */
@TableField(value = "C_Value_25")
private String cValue25; private String cValue25;
/** /**
* 26次C相谐波 * 26次C相谐波
*/ */
@TableField(value = "C_Value_26")
private String cValue26; private String cValue26;
/** /**
* 27次C相谐波 * 27次C相谐波
*/ */
@TableField(value = "C_Value_27")
private String cValue27; private String cValue27;
/** /**
* 28次C相谐波 * 28次C相谐波
*/ */
@TableField(value = "C_Value_28")
private String cValue28; private String cValue28;
/** /**
* 29次C相谐波 * 29次C相谐波
*/ */
@TableField(value = "C_Value_29")
private String cValue29; private String cValue29;
/** /**
* 30次C相谐波 * 30次C相谐波
*/ */
@TableField(value = "C_Value_30")
private String cValue30; private String cValue30;
/** /**
* 31次C相谐波 * 31次C相谐波
*/ */
@TableField(value = "C_Value_31")
private String cValue31; private String cValue31;
/** /**
* 32次C相谐波 * 32次C相谐波
*/ */
@TableField(value = "C_Value_32")
private String cValue32; private String cValue32;
/** /**
* 33次C相谐波 * 33次C相谐波
*/ */
@TableField(value = "C_Value_33")
private String cValue33; private String cValue33;
/** /**
* 34次C相谐波 * 34次C相谐波
*/ */
@TableField(value = "C_Value_34")
private String cValue34; private String cValue34;
/** /**
* 35次C相谐波 * 35次C相谐波
*/ */
@TableField(value = "C_Value_35")
private String cValue35; private String cValue35;
/** /**
* 36次C相谐波 * 36次C相谐波
*/ */
@TableField(value = "C_Value_36")
private String cValue36; private String cValue36;
/** /**
* 37次C相谐波 * 37次C相谐波
*/ */
@TableField(value = "C_Value_37")
private String cValue37; private String cValue37;
/** /**
* 38次C相谐波 * 38次C相谐波
*/ */
@TableField(value = "C_Value_38")
private String cValue38; private String cValue38;
/** /**
* 39次C相谐波 * 39次C相谐波
*/ */
@TableField(value = "C_Value_39")
private String cValue39; private String cValue39;
/** /**
* 40次C相谐波 * 40次C相谐波
*/ */
@TableField(value = "C_Value_40")
private String cValue40; private String cValue40;
/** /**
* 41次C相谐波 * 41次C相谐波
*/ */
@TableField(value = "C_Value_41")
private String cValue41; private String cValue41;
/** /**
* 42次C相谐波 * 42次C相谐波
*/ */
@TableField(value = "C_Value_42")
private String cValue42; private String cValue42;
/** /**
* 43次C相谐波 * 43次C相谐波
*/ */
@TableField(value = "C_Value_43")
private String cValue43; private String cValue43;
/** /**
* 44次C相谐波 * 44次C相谐波
*/ */
@TableField(value = "C_Value_44")
private String cValue44; private String cValue44;
/** /**
* 45次C相谐波 * 45次C相谐波
*/ */
@TableField(value = "C_Value_45")
private String cValue45; private String cValue45;
/** /**
* 46次C相谐波 * 46次C相谐波
*/ */
@TableField(value = "C_Value_46")
private String cValue46; private String cValue46;
/** /**
* 47次C相谐波 * 47次C相谐波
*/ */
@TableField(value = "C_Value_47")
private String cValue47; private String cValue47;
/** /**
* 48次C相谐波 * 48次C相谐波
*/ */
@TableField(value = "C_Value_48")
private String cValue48; private String cValue48;
/** /**
* 49次C相谐波 * 49次C相谐波
*/ */
@TableField(value = "C_Value_49")
private String cValue49; private String cValue49;
/** /**
* 50次C相谐波 * 50次C相谐波
*/ */
@TableField(value = "C_Value_50")
private String cValue50; private String cValue50;

View File

@@ -1,6 +1,5 @@
package com.njcn.gather.storage.pojo.po; package com.njcn.gather.storage.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@@ -37,7 +36,9 @@ public class AdNonHarmonicResult {
*/ */
private String scriptId; private String scriptId;
@TableField("`INDEX`") /**
* 总检测脚本中的测试项序号
*/
private Integer index; private Integer index;
/** /**

View File

@@ -0,0 +1,25 @@
package com.njcn.gather.storage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.gather.storage.pojo.po.AdBaseResult;
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
import java.util.List;
/**
* @author caozehui
* @data 2024-12-30
*/
public interface AdHarmonicService extends IService<AdHarmonicResult> {
/**
* 根据设备ID和通道号获取谐波结果
*
* @param scriptId 脚本id
* @param index 序号列表
* @param deviceId 设备ID
* @param chnNum 通道号从1开始
* @return 谐波结果
*/
List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum);
}

View File

@@ -1,11 +1,24 @@
package com.njcn.gather.storage.service; package com.njcn.gather.storage.service;
import com.njcn.db.mybatisplus.service.IReplenishMybatisService; import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.gather.storage.pojo.po.AdBaseResult;
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult; import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
import java.util.List;
public interface AdNonHarmonicService extends IReplenishMybatisService<AdNonHarmonicResult> { public interface AdNonHarmonicService extends IService<AdNonHarmonicResult> {
/**
* 根据设备ID和通道号获取非谐波结果
*
* @param scriptId 脚本ID
* @param index 总检测脚本中的测试项序号列表
* @param deviceId 设备ID
* @param chnNum 通道号从1开始
* @return 非谐波结果
*/
List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum);
} }

View File

@@ -0,0 +1,34 @@
package com.njcn.gather.storage.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.njcn.gather.storage.mapper.AdHarmonicMappper;
import com.njcn.gather.storage.pojo.po.AdBaseResult;
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
import com.njcn.gather.storage.service.AdHarmonicService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author caozehui
* @data 2024-12-30
*/
@Service
public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarmonicResult> implements AdHarmonicService {
@Override
public List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum) {
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
String monitorId = deviceId + "_" + chnNum;
if ("-1".equals(chnNum)) {
monitorId = deviceId;
}
wrapper.like(AdHarmonicResult::getMonitorId, monitorId)
.eq(ObjectUtil.isNotNull(scriptId), AdHarmonicResult::getScriptId, scriptId)
.in(ObjectUtil.isNotEmpty(index), AdHarmonicResult::getIndex, index);
List<AdHarmonicResult> list = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
return BeanUtil.copyToList(list, AdBaseResult.class);
}
}

View File

@@ -1,17 +1,34 @@
package com.njcn.gather.storage.service.impl; package com.njcn.gather.storage.service.impl;
import com.njcn.db.mybatisplus.service.impl.ReplenishMybatisServiceImpl; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.njcn.gather.storage.mapper.AdNonHarmonicMapper; import com.njcn.gather.storage.mapper.AdNonHarmonicMapper;
import com.njcn.gather.storage.pojo.po.AdBaseResult;
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult; import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
import com.njcn.gather.storage.service.AdNonHarmonicService; import com.njcn.gather.storage.service.AdNonHarmonicService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* *
*/ */
@Service @Service
public class AdNonHarmonicServiceImpl extends ReplenishMybatisServiceImpl<AdNonHarmonicMapper, AdNonHarmonicResult> implements AdNonHarmonicService { public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, AdNonHarmonicResult> implements AdNonHarmonicService {
@Override
public List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum) {
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
String monitorId = deviceId + "_" + chnNum;
if ("-1".equals(chnNum)) {
monitorId = deviceId;
}
wrapper.like(AdNonHarmonicResult::getMonitorId, monitorId)
.eq(ObjectUtil.isNotNull(scriptId), AdNonHarmonicResult::getScriptId, scriptId)
.in(ObjectUtil.isNotEmpty(index), AdNonHarmonicResult::getIndex, index);
List<AdNonHarmonicResult> list = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
return BeanUtil.copyToList(list, AdBaseResult.class);
}
} }