perf: 增加新增导出类型配置校验

dev
huangfeng 1 year ago
parent d88afc2fbc
commit e8aa69683f

@ -17,7 +17,7 @@ public interface I2syncService {
List<I2syncConfig> listConfig(); List<I2syncConfig> listConfig();
void addConfig(I2syncConfig item); void addConfig(I2syncConfig item) throws Exception;
void delConfig(Integer id); void delConfig(Integer id);

@ -88,7 +88,12 @@ public class I2syncServiceImpl implements I2syncService {
} }
@Override @Override
public void addConfig(I2syncConfig item) { public void addConfig(I2syncConfig item) throws Exception {
ModevType modevType = modevTypeService.detail(item.getModevtypeId());
List<I2syncField> fieldList = syncFieldRepository.findByTableName(modevType.getTablename());
if (CollectionUtils.isEmpty(fieldList)) {
throw new BusinessException("还未配置该类型的字段映射");
}
item.setId(null); item.setId(null);
item.setCreateTime(new Date()); item.setCreateTime(new Date());
configRepository.save(item); configRepository.save(item);

Loading…
Cancel
Save