金属元素新增BUG

This commit is contained in:
liss
2025-11-17 18:33:33 +08:00
parent 10bfece481
commit cfdeb40a23
2 changed files with 4 additions and 2 deletions

View File

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