abai 21 годин тому
батько
коміт
9d48769d4c

+ 5 - 1
ruoyi-modules/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BjNotifyModelConfigServiceImpl.java

@@ -95,6 +95,9 @@ public class BjNotifyModelConfigServiceImpl implements IBjNotifyModelConfigServi
      */
     private void validEntityBeforeSave(BjNotifyModelConfig entity) {
         //TODO 做一些数据校验,如唯一约束
+        if (StringUtils.isBlank(entity.getModelName()) && StringUtils.isBlank(entity.getModelChildrenName())) {
+            throw new ServiceException("模型名称和模型子名称不能为空");
+        }
     }
 
     /**
@@ -120,7 +123,8 @@ public class BjNotifyModelConfigServiceImpl implements IBjNotifyModelConfigServi
         }
         List<BjNotifyModelConfig> notifyModelConfigList = baseMapper.selectList(Wrappers.<BjNotifyModelConfig>lambdaQuery()
                 .eq(BjNotifyModelConfig::getModelName, bo.getModelName())
-                .eq(BjNotifyModelConfig::getModelChildrenName, bo.getModelChildrenName()));
+                .eq(BjNotifyModelConfig::getModelChildrenName, bo.getModelChildrenName())
+                .orderByAsc(BjNotifyModelConfig::getCreateTime));
         if (CollectionUtils.isNotEmpty(notifyModelConfigList)) {
             return BeanUtil.copyProperties(notifyModelConfigList.get(0), BjNotifyModelConfigVo.class);
         }