Commit 50470d2f authored by hanbing's avatar hanbing

[update] 禅道 016 bug修复

parent 93ab03db
...@@ -12,7 +12,6 @@ import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO; ...@@ -12,7 +12,6 @@ import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import net.wanji.opt.dto.strategy.QuerySceneDTO; import net.wanji.opt.dto.strategy.QuerySceneDTO;
import net.wanji.opt.service.strategy.SceneService; import net.wanji.opt.service.strategy.SceneService;
import org.springframework.dao.DuplicateKeyException; import org.springframework.dao.DuplicateKeyException;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -48,10 +47,8 @@ public class SceneController { ...@@ -48,10 +47,8 @@ public class SceneController {
try { try {
sceneService.addOrUpdateScene(addOrUpdateSceneDTO); sceneService.addOrUpdateScene(addOrUpdateSceneDTO);
} catch (DuplicateKeyException e) { } catch (DuplicateKeyException e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
throw new DuplicateKeyException("场景编号或场景名称不可重复"); throw new DuplicateKeyException("场景编号或场景名称不可重复");
} catch (UniqueException e) { } catch (UniqueException e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
throw new UniqueException("应用策略或优化方法不可重复"); throw new UniqueException("应用策略或优化方法不可重复");
} }
return JsonViewObject.newInstance().success(); return JsonViewObject.newInstance().success();
......
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