diff --git a/device/src/main/java/com/njcn/gather/device/err/pojo/param/PqErrSysDtlsParam.java b/device/src/main/java/com/njcn/gather/device/err/pojo/param/PqErrSysDtlsParam.java index 6aaa06d7..ebaf4c48 100644 --- a/device/src/main/java/com/njcn/gather/device/err/pojo/param/PqErrSysDtlsParam.java +++ b/device/src/main/java/com/njcn/gather/device/err/pojo/param/PqErrSysDtlsParam.java @@ -16,10 +16,15 @@ import javax.validation.constraints.Pattern; @Data public class PqErrSysDtlsParam { - @ApiModelProperty(value = "电能质量指标类型", required = true) - @NotBlank(message = DevValidMessage.ERR_SYS_DTLS_TYPE_NOT_BLANK) - @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.ERR_SYS_DTLS_TYPE_FORMAT_ERROR) - private String type; + @ApiModelProperty(value = "误差项类型", required = true) + @NotBlank(message = DevValidMessage.ERR_SYS_DTLS_ERROR_TYPE_NOT_BLANK) + @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.ERR_SYS_DTLS_ERROR_TYPE_FORMAT_ERROR) + private String errorType; + + @ApiModelProperty(value = "脚本项类型", required = true) + @NotBlank(message = DevValidMessage.ERR_SYS_DTLS_SCRIPT_TYPE_NOT_BLANK) + @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.ERR_SYS_DTLS_SCRIPT_TYPE_FORMAT_ERROR) + private String scriptType; @ApiModelProperty(value = "误差判断起始值", required = true) private Float startValue; @@ -49,4 +54,8 @@ public class PqErrSysDtlsParam { @NotNull(message = DevValidMessage.ERROR_VALUE_TYPE_NOT_BLANK) private Integer errorValueType; + @ApiModelProperty("排序") + @NotNull(message = DevValidMessage.SORT_NOT_NULL) + private Integer sort; + } diff --git a/device/src/main/java/com/njcn/gather/device/err/pojo/po/PqErrSysDtls.java b/device/src/main/java/com/njcn/gather/device/err/pojo/po/PqErrSysDtls.java index 03d9bd6e..881c0aa1 100644 --- a/device/src/main/java/com/njcn/gather/device/err/pojo/po/PqErrSysDtls.java +++ b/device/src/main/java/com/njcn/gather/device/err/pojo/po/PqErrSysDtls.java @@ -24,9 +24,14 @@ public class PqErrSysDtls implements Serializable { private String errorSysId; /** - * 电能质量检测指标类型 + * 误差项类型 */ - private String type; + private String errorType; + + /** + * 脚本项类型 + */ + private String scriptType; /** * 误差判断起始值 @@ -68,5 +73,10 @@ public class PqErrSysDtls implements Serializable { */ private Integer errorValueType; + /** + * 排序 + */ + private Integer sort; + } diff --git a/device/src/main/java/com/njcn/gather/device/err/service/impl/PqErrSysDtlsServiceImpl.java b/device/src/main/java/com/njcn/gather/device/err/service/impl/PqErrSysDtlsServiceImpl.java index a3e6e836..7d756c37 100644 --- a/device/src/main/java/com/njcn/gather/device/err/service/impl/PqErrSysDtlsServiceImpl.java +++ b/device/src/main/java/com/njcn/gather/device/err/service/impl/PqErrSysDtlsServiceImpl.java @@ -27,7 +27,7 @@ public class PqErrSysDtlsServiceImpl extends ServiceImpl listPqErrSysDtlsByPqErrSysId(String pqErrSysId) { - return this.lambdaQuery().eq(PqErrSysDtls::getErrorSysId, pqErrSysId).list(); + return this.lambdaQuery().eq(PqErrSysDtls::getErrorSysId, pqErrSysId).orderBy(true, true,PqErrSysDtls::getSort).list(); } @Override diff --git a/device/src/main/java/com/njcn/gather/device/pojo/constant/DevValidMessage.java b/device/src/main/java/com/njcn/gather/device/pojo/constant/DevValidMessage.java index a0fea013..a67ce41e 100644 --- a/device/src/main/java/com/njcn/gather/device/pojo/constant/DevValidMessage.java +++ b/device/src/main/java/com/njcn/gather/device/pojo/constant/DevValidMessage.java @@ -96,9 +96,13 @@ public interface DevValidMessage { String ERR_SYS_ID_NOT_BLANK = "误差体系ID不能为空,请检查errSysId参数"; - String ERR_SYS_DTLS_TYPE_NOT_BLANK = "电能质量检测指标类型不能为空,请检查errSysDtlsType参数"; + String ERR_SYS_DTLS_ERROR_TYPE_NOT_BLANK = "误差项类型不能为空,请检查errorType参数"; - String ERR_SYS_DTLS_TYPE_FORMAT_ERROR = "电能质量检测指标类型格式错误,请检查errSysDtlsType参数"; + String ERR_SYS_DTLS_ERROR_TYPE_FORMAT_ERROR = "误差项类型格式错误,请检查errorType参数"; + + String ERR_SYS_DTLS_SCRIPT_TYPE_NOT_BLANK = "脚本项类型不能为空,请检查scriptType参数"; + + String ERR_SYS_DTLS_SCRIPT_TYPE_FORMAT_ERROR = "脚本项类型格式错误,请检查scriptType参数"; String START_VALUE_NOT_NULL = "起始值不能为空,请检查startValue参数"; @@ -201,4 +205,6 @@ public interface DevValidMessage { String FACTOR_FLAG_NOT_BLANK = "是否支持系数校准不能为空"; String CONDITION_TYPE_FORMAT_ERROR = "判断条件类型格式错误,请检查conditionType参数"; + + String SORT_NOT_NULL = "排序不能为空"; } diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTreeServiceImpl.java b/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTreeServiceImpl.java index dddd9568..1a9c4ffc 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTreeServiceImpl.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTreeServiceImpl.java @@ -52,7 +52,7 @@ public class DictTreeServiceImpl extends ServiceImpl i @Override @Transactional(rollbackFor = {Exception.class}) public boolean addDictTree(DictTreeParam dictTreeParam) { - checkRepeat(dictTreeParam,false); + //checkRepeat(dictTreeParam,false); boolean result; DictTree dictTree = new DictTree(); BeanUtils.copyProperties(dictTreeParam, dictTree); @@ -75,7 +75,7 @@ public class DictTreeServiceImpl extends ServiceImpl i @Override @Transactional(rollbackFor = {Exception.class}) public boolean updateDictTree(DictTreeParam.UpdateParam param) { - checkRepeat(param,true); + //checkRepeat(param,true); boolean result; DictTree dictTree = new DictTree(); BeanUtils.copyProperties(param, dictTree); @@ -171,7 +171,7 @@ public class DictTreeServiceImpl extends ServiceImpl i private void checkRepeat(DictTreeParam dictTreeParam,boolean isExcludeSelf){ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(DictTree::getCode, dictTreeParam.getCode()) - .eq(DictTree::getState, DataStateEnum.ENABLE.getCode()); + .eq(DictTree::getState, DictConst.ENABLE); if(isExcludeSelf){ if(dictTreeParam instanceof DictTreeParam.UpdateParam){ wrapper.ne(DictTree::getId, ((DictTreeParam.UpdateParam) dictTreeParam).getId());