Commit 153c8f12 authored by hanbing's avatar hanbing

[update] 策略管理-优化ID判空逻辑

parent f76562ab
......@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.ws.rs.core.MediaType;
import java.util.List;
/**
* 策略管理-策略库
......
......@@ -33,7 +33,7 @@ public class IdeaServiceImpl implements IdeaService {
@Transactional
public void addOrUpdateIdea(AddOrUpdateIdeaDTO addOrUpdateIdeaDTO) {
Integer id = addOrUpdateIdeaDTO.getId();
if (id == 0 || ObjectUtil.isEmpty(id)) {
if (ObjectUtil.isEmpty(id) || id == 0) {
// 不传ID为新增
IdeaPO ideaPO = new IdeaPO();
ideaPO.setIdeaCode(addOrUpdateIdeaDTO.getIdeaCode());
......
......@@ -49,7 +49,7 @@ public class SceneServiceImpl implements SceneService {
@Transactional
public void addOrUpdateScene(AddOrUpdateSceneDTO addOrUpdateSceneDTO) {
Integer id = addOrUpdateSceneDTO.getId();
if (id == 0 || ObjectUtil.isEmpty(id)) {
if (ObjectUtil.isEmpty(id) || id == 0) {
// 不传ID为新增
// 插入场景表获取场景ID
ScenePO scenePO = new ScenePO();
......
......@@ -36,7 +36,7 @@ public class StrategyServiceImpl implements StrategyService {
@Transactional
public void addOrUpdateStrategy(AddOrUpdateStrategyDTO addOrUpdateStrategyDTO) {
Integer id = addOrUpdateStrategyDTO.getId();
if (id == 0 || ObjectUtil.isEmpty(id)) {
if (ObjectUtil.isEmpty(id) || id == 0) {
// 不传ID为新增
StrategyPO strategyPO = new StrategyPO();
strategyPO.setStrategyCode(addOrUpdateStrategyDTO.getStrategyCode());
......
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