Commit 6f90d831 authored by duanruiming's avatar duanruiming

[update] 策略管理-优先级唯一校验

parent 8a3036be
...@@ -49,7 +49,7 @@ public class SceneController { ...@@ -49,7 +49,7 @@ public class SceneController {
} catch (DuplicateKeyException e) { } catch (DuplicateKeyException e) {
throw new DuplicateKeyException("场景编号或场景名称不可重复"); throw new DuplicateKeyException("场景编号或场景名称不可重复");
} catch (UniqueException e) { } catch (UniqueException e) {
throw new UniqueException("应用策略或优化方法不可重复"); throw new UniqueException("应用策略或优化方法或优先级不可重复");
} }
return JsonViewObject.newInstance().success(); return JsonViewObject.newInstance().success();
} }
......
...@@ -94,7 +94,7 @@ public class SceneServiceImpl implements SceneService { ...@@ -94,7 +94,7 @@ public class SceneServiceImpl implements SceneService {
boolean addStrategy = strategyNameSet.add(strategyName); boolean addStrategy = strategyNameSet.add(strategyName);
Integer priority = strategyListElement.getPriority(); Integer priority = strategyListElement.getPriority();
boolean addPriority = strategyPrioritySet.add(priority); boolean addPriority = strategyPrioritySet.add(priority);
if (!addStrategy && !addPriority) { if (!addStrategy || !addPriority) {
throw new UniqueException(); throw new UniqueException();
} }
Set<String> ideaNameSet = new HashSet<>(); Set<String> ideaNameSet = new HashSet<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment