检测计划新增数据处理原则字段、全局配置中移除数据处理原则字段
This commit is contained in:
@@ -21,6 +21,7 @@ import com.njcn.gather.detection.util.socket.*;
|
||||
import com.njcn.gather.device.pojo.po.PqDev;
|
||||
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||
import com.njcn.gather.device.service.IPqDevService;
|
||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||
import com.njcn.gather.plan.service.IAdPlanService;
|
||||
import com.njcn.gather.script.pojo.param.PqScriptCheckDataParam;
|
||||
import com.njcn.gather.script.pojo.param.PqScriptIssueParam;
|
||||
@@ -32,9 +33,10 @@ import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
||||
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
||||
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
||||
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
||||
import com.njcn.gather.system.pojo.enums.DicDataEnum;
|
||||
import com.njcn.gather.system.reg.service.ISysRegResService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -93,6 +95,7 @@ public class SocketDevResponseService {
|
||||
private final AdHarmonicService adHarmonicService;
|
||||
private final IAdPlanService adPlanService;
|
||||
private final IPqScriptCheckDataService pqScriptCheckDataService;
|
||||
private final IDictDataService dictDataService;
|
||||
@Value("${phaseAngle.isEnable}")
|
||||
private Boolean isPhaseAngle;
|
||||
|
||||
@@ -1619,11 +1622,13 @@ public class SocketDevResponseService {
|
||||
//初始化有效数据数
|
||||
//Map<String, SysRegResVO> sysRegResMap = iSysRegResService.listRegRes();
|
||||
|
||||
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||
if (ObjectUtil.isNotNull(oneConfig)) {
|
||||
dataRule = DictDataEnum.getDictDataEnumByCode(oneConfig.getDataRule());
|
||||
//SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||
AdPlan plan = adPlanService.getById(param.getPlanId());
|
||||
DictData dictData = dictDataService.getDictDataById(plan.getDataRule());
|
||||
if (ObjectUtil.isNotNull(dictData)) {
|
||||
dataRule = DictDataEnum.getDictDataEnumByCode(dictData.getCode());
|
||||
} else {
|
||||
dataRule = DictDataEnum.AT_WILL_VALUE;
|
||||
dataRule = DictDataEnum.SECTION_VALUE;
|
||||
}
|
||||
//字典树
|
||||
SocketManager.valueTypeMap = iPqScriptCheckDataService.getValueTypeMap(param.getScriptId());
|
||||
|
||||
@@ -65,6 +65,10 @@ public class AdPlanParam {
|
||||
@ApiModelProperty(value = "报告模板名称")
|
||||
private String reportTemplateName;
|
||||
|
||||
@ApiModelProperty(value = "数据处理原则")
|
||||
@NotBlank(message = DetectionValidMessage.DATA_RULE_NOT_BLANK)
|
||||
private String dataRule;
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
|
||||
@@ -94,5 +94,10 @@ public class AdPlan extends BaseEntity implements Serializable {
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 数据处理原则。任意值、部分值、所有值、cp95值、平均值
|
||||
*/
|
||||
private String dataRule;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,4 +108,6 @@ public class AdPlanVO {
|
||||
* 报告模板名称
|
||||
*/
|
||||
private String reportTemplateName;
|
||||
|
||||
private String dataRule;
|
||||
}
|
||||
|
||||
@@ -761,12 +761,9 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
}
|
||||
});
|
||||
PqErrSys errSys = pqErrSysService.getById(plan.getErrorSysId());
|
||||
SysTestConfig config1 = sysTestConfigService.getConfig();
|
||||
if (ObjectUtil.isNotNull(config1)) {
|
||||
DictData dictData = dictDataService.getDictDataById(config1.getDataRule());
|
||||
if (ObjectUtil.isNotNull(errSys) && ObjectUtil.isNotNull(dictData)) {
|
||||
note.append("测试结果采用\"" + errSys.getName() + "\"误差体系结合\"" + dictData.getName() + "\"数据原则计算得出。");
|
||||
}
|
||||
DictData dictData1 = dictDataService.getDictDataById(plan.getDataRule());
|
||||
if (ObjectUtil.isNotNull(dictData1) && ObjectUtil.isNotNull(errSys)) {
|
||||
note.append("测试结果采用\"" + errSys.getName() + "\"误差体系结合\"" + dictData1.getName() + "\"数据原则计算得出。");
|
||||
}
|
||||
return note.toString();
|
||||
}
|
||||
|
||||
@@ -179,4 +179,5 @@ public interface DetectionValidMessage {
|
||||
|
||||
String DEV_TYPE_NAME_FORMAT_ERROR = "设备类型名称格式错误,只能包含字母、数字、中文、下划线、中划线、点号、空格,长度为1-32个字符";
|
||||
String REPORT_NAME_NOT_BLANK = "报告模板不能为空";
|
||||
String DATA_RULE_NOT_BLANK = "数据处理原则不能为空";
|
||||
}
|
||||
|
||||
@@ -53,10 +53,11 @@ import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
||||
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
||||
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
||||
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
||||
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
||||
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
||||
import com.njcn.gather.system.dictionary.service.IDictTreeService;
|
||||
import com.njcn.web.utils.ExcelUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -90,6 +91,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
private final IPqScriptCheckDataService pqScriptCheckDataService;
|
||||
private final TableGenMapper tableGenMapper;
|
||||
private final DetectionServiceImpl detectionServiceImpl;
|
||||
private final IDictDataService dictDataService;
|
||||
|
||||
/**
|
||||
* 谐波类code,取树形字典表中的code
|
||||
@@ -108,7 +110,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
adPlanService.visualize(Collections.singletonList(plan));
|
||||
}
|
||||
formContentVO.setScriptName(plan.getScriptId());
|
||||
formContentVO.setDataRule(sysTestConfigService.getConfig().getDataRule());
|
||||
formContentVO.setDataRule(plan.getDataRule());
|
||||
formContentVO.setDeviceName(pqDevService.getById(queryParam.getDeviceId()).getName());
|
||||
|
||||
List<Map<String, String>> chnList = new ArrayList<>();
|
||||
@@ -1510,12 +1512,19 @@ public class ResultServiceImpl implements IResultService {
|
||||
// PqDev dev = pqDevService.getById(devId);
|
||||
devIdMapComm.put(devId, devId);
|
||||
|
||||
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||
DictDataEnum dataRule;
|
||||
if (ObjectUtil.isNotNull(oneConfig)) {
|
||||
dataRule = DictDataEnum.getDictDataEnumByCode(oneConfig.getDataRule());
|
||||
// SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||
// if (ObjectUtil.isNotNull(oneConfig)) {
|
||||
// dataRule = DictDataEnum.getDictDataEnumByCode(oneConfig.getDataRule());
|
||||
// } else {
|
||||
// dataRule = DictDataEnum.SECTION_VALUE;
|
||||
// }
|
||||
AdPlan plan = adPlanService.getById(planId);
|
||||
DictData dictData = dictDataService.getDictDataById(plan.getDataRule());
|
||||
if (ObjectUtil.isNotNull(dictData)) {
|
||||
dataRule = DictDataEnum.getDictDataEnumByCode(dictData.getCode());
|
||||
} else {
|
||||
dataRule = DictDataEnum.AT_WILL_VALUE;
|
||||
dataRule = DictDataEnum.SECTION_VALUE;
|
||||
}
|
||||
|
||||
List<AdNonHarmonicResult> allNonHarmonicRawData = adNonHarmonicService.listAllRawData(scriptId, oldCode, devId);
|
||||
|
||||
Reference in New Issue
Block a user