整理代码

This commit is contained in:
caozehui
2025-03-26 10:01:56 +08:00
parent 4ef5c982de
commit 9a7d841d9c
29 changed files with 174 additions and 513 deletions

View File

@@ -1,20 +0,0 @@
package com.njcn.gather.err.pojo.enums;
import lombok.Getter;
/**
* @author caozehui
* @data 2025-03-10
*/
@Getter
public enum ErrResponseEnum {
ERR_SYS_BOUND_NOT_DELETE("A100001","误差体系已被计划所绑定,无法删除!");
private String code;
private String message;
ErrResponseEnum(String code, String message) {
this.code = code;
this.message = message;
}
}

View File

@@ -8,9 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.gather.device.pojo.enums.DevResponseEnum;
import com.njcn.gather.err.mapper.PqErrSysMapper;
import com.njcn.gather.err.pojo.enums.ErrResponseEnum;
import com.njcn.gather.err.pojo.param.PqErrSysDtlsParam;
import com.njcn.gather.err.pojo.param.PqErrSysParam;
import com.njcn.gather.err.pojo.po.PqErrSys;
@@ -18,6 +16,7 @@ import com.njcn.gather.err.pojo.po.PqErrSysDtls;
import com.njcn.gather.err.pojo.vo.PqErrSysDtlsVO;
import com.njcn.gather.err.service.IPqErrSysDtlsService;
import com.njcn.gather.err.service.IPqErrSysService;
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
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;
@@ -98,7 +97,7 @@ public class PqErrSysServiceImpl extends ServiceImpl<PqErrSysMapper, PqErrSys> i
public boolean deletePqErrSys(List<String> ids) {
Integer count = this.baseMapper.getCountBoundByIds(ids);
if (count > 0) {
throw new BusinessException(ErrResponseEnum.ERR_SYS_BOUND_NOT_DELETE);
throw new BusinessException(DetectionResponseEnum.ERR_SYS_BOUND_NOT_DELETE);
}
pqErrSysDtlsService.deletePqErrSysDtlsByPqErrSysId(ids);
this.lambdaUpdate().in(PqErrSys::getId, ids).set(PqErrSys::getState, DataStateEnum.DELETED.getCode()).update();
@@ -188,7 +187,7 @@ public class PqErrSysServiceImpl extends ServiceImpl<PqErrSysMapper, PqErrSys> i
if (ObjectUtil.isNotNull(devLevelDictData)) {
return param.getStandardName() + "-" + param.getStandardTime() + "-" + devLevelDictData.getName();
}
throw new BusinessException(DevResponseEnum.PQ_ERRSYS_GEN_NAME_ERROR);
throw new BusinessException(DetectionResponseEnum.PQ_ERRSYS_GEN_NAME_ERROR);
}
@Override
@@ -213,6 +212,6 @@ public class PqErrSysServiceImpl extends ServiceImpl<PqErrSysMapper, PqErrSys> i
if (ObjectUtils.allNotNull(param.getStandardName(), param.getStandardTime(), devLevel)) {
return param.getStandardName() + "-" + param.getStandardTime() + "-" + devLevel.getName();
}
throw new BusinessException(DevResponseEnum.ERR_SOURCE_GEN_NAME_ERROR);
throw new BusinessException(DetectionResponseEnum.ERR_SOURCE_GEN_NAME_ERROR);
}
}