金属元素新增BUG
This commit is contained in:
@@ -12,6 +12,7 @@ public interface ErrorCodeConstants {
|
|||||||
// ========== 示例模块 1-001-000-000 ==========
|
// ========== 示例模块 1-001-000-000 ==========
|
||||||
ErrorCode MATERIAL_OTHER_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料不存在");
|
ErrorCode MATERIAL_OTHER_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料不存在");
|
||||||
ErrorCode ELEMENT_NOT_EXISTS = new ErrorCode(1_001_000_001, "金属元素不存在");
|
ErrorCode ELEMENT_NOT_EXISTS = new ErrorCode(1_001_000_001, "金属元素不存在");
|
||||||
|
ErrorCode ELEMENT_EXISTS = new ErrorCode(1_001_000_002, "金属元素已经存在");
|
||||||
ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_001_000_001, "联系人不存在");
|
ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_001_000_001, "联系人不存在");
|
||||||
ErrorCode ACCOUNT_NOT_EXISTS = new ErrorCode(1_001_000_001, "账户条款不存在");
|
ErrorCode ACCOUNT_NOT_EXISTS = new ErrorCode(1_001_000_001, "账户条款不存在");
|
||||||
ErrorCode MATERIAL_DESTROY_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料回收率不存在");
|
ErrorCode MATERIAL_DESTROY_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料回收率不存在");
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.ELEMENT_EXISTS;
|
||||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.ELEMENT_NOT_EXISTS;
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.ELEMENT_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,8 +96,8 @@ public class ElementServiceImpl implements ElementService {
|
|||||||
|
|
||||||
private void validateElementCodeExists(String code) {
|
private void validateElementCodeExists(String code) {
|
||||||
ElementDO elementDO = elementMapper.getElementName(code);
|
ElementDO elementDO = elementMapper.getElementName(code);
|
||||||
if (elementDO == null) {
|
if (elementDO != null) {
|
||||||
throw exception(ELEMENT_NOT_EXISTS);
|
throw exception(ELEMENT_EXISTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user