This commit is contained in:
caozehui
2024-12-25 19:13:51 +08:00
parent 9706c91c3f
commit c4443c5669
5 changed files with 37 additions and 12 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -27,7 +27,7 @@ public class PqErrSysDtlsServiceImpl extends ServiceImpl<PqErrSysDtlsMapper, PqE
@Override
public List<PqErrSysDtls> 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

View File

@@ -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 = "排序不能为空";
}

View File

@@ -52,7 +52,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> 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<DictTreeMapper, DictTree> 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<DictTreeMapper, DictTree> i
private void checkRepeat(DictTreeParam dictTreeParam,boolean isExcludeSelf){
LambdaQueryWrapper<DictTree> 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());