| | |
| | | if (null != entity) { |
| | | Class<?> cls = entity.getClass(); |
| | | TableInfo tableInfo = TableInfoHelper.getTableInfo(cls); |
| | | if (null != tableInfo && StringUtils.isNotEmpty(tableInfo.getKeyProperty())) { |
| | | Object idVal = ReflectionKit.getMethodValue(cls, entity, tableInfo.getKeyProperty()); |
| | | if (null != tableInfo && StringUtils.isNotBlank(tableInfo.getKeyProperty())) { |
| | | // Object idVal = ReflectionKit.getMethodValue(cls, entity, tableInfo.getKeyProperty()); |
| | | Object idVal = ReflectionKit.getFieldValue(entity,tableInfo.getKeyProperty()); |
| | | if (StringUtils.checkValNull(idVal) || Objects.isNull(getById((Serializable) idVal))) { |
| | | if (StrUtil.isEmpty(msg)) { |
| | | msg = "已存在"; |