微调
This commit is contained in:
@@ -85,8 +85,6 @@ public interface DevValidMessage {
|
||||
String STANDARD_TIME_NOT_BLANK = "标准推行时间不能为空,请检查standardTime参数";
|
||||
|
||||
String SCRIPT_TYPE_FORMAT_ERROR = "检测脚本类型格式错误,请检查scriptType参数";
|
||||
String SCRIPT_VOLT_FORMAT_ERROR = "检测脚本额定电压格式错误,请检查scriptType参数";
|
||||
String SCRIPT_CURR_FORMAT_ERROR = "检测脚本额定电流格式错误,请检查scriptType参数";
|
||||
|
||||
String DEV_LEVEL_NOT_BLANK = "设备等级不能为空,请检查devLevel参数";
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ import java.util.List;
|
||||
public class PqDevParam {
|
||||
|
||||
@ApiModelProperty(value = "名称", required = true)
|
||||
//@NotBlank(message = DevValidMessage.NAME_NOT_BLANK)
|
||||
//@Pattern(regexp = PatternRegex.DEV_NAME_REGEX, message = DevValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "设备模式,字典表(数字、模拟、比对)", required = true)
|
||||
@@ -37,13 +35,9 @@ public class PqDevParam {
|
||||
private String devType;
|
||||
|
||||
@ApiModelProperty(value = "设备厂家,字典表", required = true)
|
||||
//@NotBlank(message = DevValidMessage.MANUFACTURER_NOT_BLANK)
|
||||
//@Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.MANUFACTURER_FORMAT_ERROR)
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(value = "出厂日期", required = true)
|
||||
//@NotBlank(message = DevValidMessage.CREATEDATETIME_NOT_NULL)
|
||||
//@DateTimeStrValid(format = "yyyy-MM-dd", message = DevValidMessage.CREATEDATETIME_FORMAT_ERROR)
|
||||
private String createDate;
|
||||
|
||||
@ApiModelProperty(value = "设备序列号", required = true)
|
||||
@@ -51,11 +45,9 @@ public class PqDevParam {
|
||||
private String createId;
|
||||
|
||||
@ApiModelProperty(value = "固件版本", required = true)
|
||||
//@NotBlank(message = DevValidMessage.FIRMWARE_NOT_BLANK)
|
||||
private String hardwareVersion;
|
||||
|
||||
@ApiModelProperty(value = "软件版本", required = true)
|
||||
//@NotBlank(message = DevValidMessage.SOFTWARE_NOT_BLANK)
|
||||
private String softwareVersion;
|
||||
|
||||
@ApiModelProperty(value = "通讯协议", required = true)
|
||||
@@ -123,9 +115,6 @@ public class PqDevParam {
|
||||
|
||||
@ApiModelProperty("icdId")
|
||||
private String icdId;
|
||||
//
|
||||
// @ApiModelProperty("power")
|
||||
// private String power;
|
||||
|
||||
@ApiModelProperty("预投计划")
|
||||
private String preinvestmentPlan;
|
||||
@@ -141,26 +130,6 @@ public class PqDevParam {
|
||||
@NotBlank(message = DevValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
// @ApiModelProperty("检测状态")
|
||||
// @Min(value = 0, message = DevValidMessage.CHECK_STATE_FORMAT_ERROR)
|
||||
// @Max(value = 3, message = DevValidMessage.CHECK_STATE_FORMAT_ERROR)
|
||||
// private Integer checkState;
|
||||
//
|
||||
// @ApiModelProperty("检测结果")
|
||||
// @Min(value = 0, message = DevValidMessage.CHECK_RESULT_FORMAT_ERROR)
|
||||
// @Max(value = 2, message = DevValidMessage.CHECK_RESULT_FORMAT_ERROR)
|
||||
// private Integer checkResult;
|
||||
//
|
||||
// @ApiModelProperty("报告状态")
|
||||
// @Min(value = 0, message = DevValidMessage.REPORT_STATE_FORMAT_ERROR)
|
||||
// @Max(value = 2, message = DevValidMessage.REPORT_STATE_FORMAT_ERROR)
|
||||
// private Integer reportState;
|
||||
//
|
||||
// @ApiModelProperty("归档状态")
|
||||
// @Min(value = 0, message = DevValidMessage.DOCUMENT_STATE_FORMAT_ERROR)
|
||||
// @Max(value = 1, message = DevValidMessage.DOCUMENT_STATE_FORMAT_ERROR)
|
||||
// private Integer documentState;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +139,6 @@ public class PqDevParam {
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryParam extends BaseParam {
|
||||
@ApiModelProperty("名称")
|
||||
// @Pattern(regexp = PatternRegex.DEV_NAME_REGEX, message = DevValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "设备模式,字典表(数字、模拟、比对)")
|
||||
@@ -180,7 +148,6 @@ public class PqDevParam {
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("检测计划ID")
|
||||
//@Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.PLAN_ID_FORMAT_ERROR)
|
||||
private String planId;
|
||||
|
||||
@ApiModelProperty("检测状态列表")
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.njcn.gather.device.service.IPqDevService;
|
||||
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
||||
import com.njcn.gather.monitor.service.IPqMonitorService;
|
||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
|
||||
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
||||
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
||||
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||
@@ -591,13 +592,16 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
@Override
|
||||
public void exportDev(PqDevParam.QueryParam queryParam) {
|
||||
String currrentScene = sysTestConfigService.getCurrrentScene();
|
||||
switch (currrentScene) {
|
||||
case "0":
|
||||
SceneEnum sceneEnum = SceneEnum.getSceneEnum(currrentScene);
|
||||
switch (sceneEnum) {
|
||||
case PROVINCE_PLATFORM:
|
||||
this.exportProvinceDev(queryParam);
|
||||
break;
|
||||
case "1":
|
||||
case LEAVE_FACTORY_TEST:
|
||||
this.exportCNDev(queryParam);
|
||||
break;
|
||||
case SELF_TEST:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -606,13 +610,16 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
@Override
|
||||
public void downloadTemplate() {
|
||||
String currrentScene = sysTestConfigService.getCurrrentScene();
|
||||
switch (currrentScene) {
|
||||
case "0":
|
||||
SceneEnum sceneEnum = SceneEnum.getSceneEnum(currrentScene);
|
||||
switch (sceneEnum) {
|
||||
case PROVINCE_PLATFORM:
|
||||
this.downloadProvinceDevTemplate();
|
||||
break;
|
||||
case "1":
|
||||
case LEAVE_FACTORY_TEST:
|
||||
this.downloadCNDevTemplate();
|
||||
break;
|
||||
case SELF_TEST:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -622,13 +629,16 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
@Override
|
||||
public void importDev(MultipartFile file, String patternId, String planId, HttpServletResponse response) {
|
||||
String currrentScene = sysTestConfigService.getCurrrentScene();
|
||||
switch (currrentScene) {
|
||||
case "0":
|
||||
SceneEnum sceneEnum = SceneEnum.getSceneEnum(currrentScene);
|
||||
switch (sceneEnum) {
|
||||
case PROVINCE_PLATFORM:
|
||||
this.importProvinceDev(file, patternId, planId, response);
|
||||
break;
|
||||
case "1":
|
||||
case LEAVE_FACTORY_TEST:
|
||||
this.importCNDev(file, patternId, planId, response);
|
||||
break;
|
||||
case SELF_TEST:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -9,4 +9,6 @@ public interface PqIcdPathValidMessage {
|
||||
String ID_FORMAT_ERROR = "id格式错误,请检查id参数";
|
||||
String NAME_NOT_BLANK = "名称不能为空";
|
||||
String PATH_NOT_BLANK = "icd存储路径不能为空";
|
||||
String NAME_FORMAT_ERROR = "名称格式错误,只能包含字母、数字、中文、下划线、中划线、点号,长度为1-50个字符";
|
||||
String PATH_FORMAT_ERROR = "ICD路径格式错误";
|
||||
}
|
||||
|
||||
@@ -19,10 +19,12 @@ import javax.validation.constraints.Pattern;
|
||||
public class PqIcdPathParam {
|
||||
@ApiModelProperty(value = "名称", required = true)
|
||||
@NotBlank(message = PqIcdPathValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.ICD_NAME_REGEX, message = PqIcdPathValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "存储路径", required = true)
|
||||
@NotBlank(message = PqIcdPathValidMessage.PATH_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.ICD_PATH_REGEX, message = PqIcdPathValidMessage.PATH_FORMAT_ERROR)
|
||||
private String path;
|
||||
|
||||
/**
|
||||
|
||||
@@ -105,33 +105,6 @@ public class AdPlanParam {
|
||||
@NotBlank(message = DevValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 检测状态,字典表(未检、检测中、检测完成)
|
||||
*/
|
||||
// @ApiModelProperty(value = "检测状态")
|
||||
// @NotNull(message = DeviceValidMessage.TEST_STATE_NOT_NULL)
|
||||
// @Min(value = 0, message = DeviceValidMessage.TEST_STATE_FORMAT_ERROR)
|
||||
// @Max(value = 2, message = DeviceValidMessage.TEST_STATE_FORMAT_ERROR)
|
||||
// private Integer testState;
|
||||
|
||||
/**
|
||||
* 报告生成状态,字典表(未生成、部分生成、全部生成)
|
||||
*/
|
||||
// @ApiModelProperty(value = "报告生成状态")
|
||||
// @NotNull(message = DeviceValidMessage.REPORT_STATE_NOT_NULL)
|
||||
// @Min(value = 0, message = DeviceValidMessage.REPORT_STATE_FORMAT_ERROR)
|
||||
// @Max(value = 2, message = DeviceValidMessage.REPORT_STATE_FORMAT_ERROR)
|
||||
// private Integer reportState;
|
||||
|
||||
/**
|
||||
* 检测结果,字典表(符合、不符合、/)
|
||||
*/
|
||||
// @ApiModelProperty(value = "检测结果")
|
||||
// @NotNull(message = DeviceValidMessage.CHECK_RESULT_STATE_NOT_NULL)
|
||||
// @Min(value = 0, message = DeviceValidMessage.CHECK_RESULT_STATE_FORMAT_ERROR)
|
||||
// @Max(value = 2, message = DeviceValidMessage.CHECK_RESULT_STATE_FORMAT_ERROR)
|
||||
// private Integer result;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -8,4 +8,10 @@ public interface PqScriptValidMessage {
|
||||
String INDEX_NOT_NULL = "index不能为空";
|
||||
|
||||
String VALUE_TYPE_NOT_BLANK = "脚本值类型不能为空";
|
||||
|
||||
String NAME_FORMAT_ERROR = "脚本名称格式错误,只能包含字母、数字、中文、下划线、中划线、点号,长度为1-50个字符";
|
||||
|
||||
String SCRIPT_VOLT_FORMAT_ERROR = "检测脚本额定电压格式错误,请检查ratedVolt参数";
|
||||
|
||||
String SCRIPT_CURR_FORMAT_ERROR = "检测脚本额定电流格式错误,请检查ratedCurr参数";
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.gather.script.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.gather.device.pojo.constant.DevValidMessage;
|
||||
import com.njcn.gather.script.pojo.constant.PqScriptValidMessage;
|
||||
import com.njcn.gather.system.pojo.constant.SystemValidMessage;
|
||||
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
@@ -20,6 +21,7 @@ public class PqScriptParam {
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = DevValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SCRIPT_NAME_REGEX, message = PqScriptValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("类型")
|
||||
@@ -44,7 +46,6 @@ public class PqScriptParam {
|
||||
|
||||
@ApiModelProperty("参照标准名称")
|
||||
@NotBlank(message = DevValidMessage.STANDARD_NAME_NOT_BLANK)
|
||||
//@Pattern(regexp = PatternRegex.ERR_SYS_NAME, message = DevValidMessage.STANDARD_NAME_FORMAT_ERROR)
|
||||
private String standardName;
|
||||
|
||||
|
||||
@@ -59,8 +60,8 @@ public class PqScriptParam {
|
||||
*/
|
||||
@ApiModelProperty("额定电压")
|
||||
@NotNull(message = DevValidMessage.SCRIPT_TYPE_NOT_BLANK)
|
||||
@Min(value = 0, message = DevValidMessage.SCRIPT_VOLT_FORMAT_ERROR)
|
||||
@Max(value = 380, message = DevValidMessage.SCRIPT_VOLT_FORMAT_ERROR)
|
||||
@Min(value = 0, message = PqScriptValidMessage.SCRIPT_VOLT_FORMAT_ERROR)
|
||||
@Max(value = 380, message = PqScriptValidMessage.SCRIPT_VOLT_FORMAT_ERROR)
|
||||
private Double ratedVolt;
|
||||
|
||||
/**
|
||||
@@ -68,8 +69,8 @@ public class PqScriptParam {
|
||||
*/
|
||||
@ApiModelProperty("额定电流")
|
||||
@NotNull(message = DevValidMessage.SCRIPT_TYPE_NOT_BLANK)
|
||||
@Min(value = 0, message = DevValidMessage.SCRIPT_CURR_FORMAT_ERROR)
|
||||
@Max(value = 20, message = DevValidMessage.SCRIPT_CURR_FORMAT_ERROR)
|
||||
@Min(value = 0, message = PqScriptValidMessage.SCRIPT_CURR_FORMAT_ERROR)
|
||||
@Max(value = 20, message = PqScriptValidMessage.SCRIPT_CURR_FORMAT_ERROR)
|
||||
private Double ratedCurr;
|
||||
|
||||
|
||||
|
||||
@@ -51,8 +51,6 @@ public class PqSourceParam {
|
||||
@ApiModelProperty("源参数")
|
||||
private String parameter;
|
||||
|
||||
// @ApiModelProperty("源参数")
|
||||
// private List<PqSourceParameterParam> parameterList;
|
||||
|
||||
@Data
|
||||
public static class QueryParam extends BaseParam {
|
||||
|
||||
@@ -169,34 +169,6 @@ public class PqSourceServiceImpl extends ServiceImpl<PqSourceMapper, PqSource> i
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// private List<SourceParam> filterTree(List<SourceParam> tree, String keyword) {
|
||||
// if (CollectionUtils.isEmpty(tree) || StrUtil.isBlank(keyword)) {
|
||||
// return tree;
|
||||
// }
|
||||
// filter(tree, keyword);
|
||||
// return tree;
|
||||
// }
|
||||
|
||||
// private void filter(List<SourceParam> list, String keyword) {
|
||||
// for (int i = list.size() - 1; i >= 0; i--) {
|
||||
// SourceParam sourceParam = list.get(i);
|
||||
// List<SourceParam> children = sourceParam.getChildren();
|
||||
// if (!keyword.equals(sourceParam.getType())) {
|
||||
// if (!CollectionUtils.isEmpty(children)) {
|
||||
// filter(children, keyword);
|
||||
// }
|
||||
// if (CollectionUtils.isEmpty(sourceParam.getChildren())) {
|
||||
// list.remove(i);
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// if (!CollectionUtils.isEmpty(children)) {
|
||||
// filter(children, keyword);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 生成检测源名称(检测源类型+设备类型+数字)
|
||||
|
||||
Reference in New Issue
Block a user