金属元素新增BUG
This commit is contained in:
@@ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import java.util.List;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -95,8 +96,8 @@ public class ElementServiceImpl implements ElementService {
|
||||
|
||||
private void validateElementCodeExists(String code) {
|
||||
ElementDO elementDO = elementMapper.getElementName(code);
|
||||
if (elementDO == null) {
|
||||
throw exception(ELEMENT_NOT_EXISTS);
|
||||
if (elementDO != null) {
|
||||
throw exception(ELEMENT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user