Commit 1028d36b by wangli

mp2jpa

1 parent 731bda9a
...@@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import java.util.*; import java.util.*;
...@@ -139,6 +140,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -139,6 +140,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
return Result.success(resp); return Result.success(resp);
} }
@Transactional
@Override @Override
public Result<?> businessServiceBlockAdd(String layerId, String teamId) throws BusinessException { public Result<?> businessServiceBlockAdd(String layerId, String teamId) throws BusinessException {
...@@ -188,7 +190,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -188,7 +190,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String blockName = String.format("%s_%s", layerName, team.getTeamName()); //区块名称 String blockName = String.format("%s_%s", layerName, team.getTeamName()); //区块名称
MapBlockInfo block = new MapBlockInfo(); MapBlockInfoEntity block = new MapBlockInfoEntity();
block.setBlockId(blockId); block.setBlockId(blockId);
block.setBlockName(blockName); block.setBlockName(blockName);
block.setBranchId(team.getBranchId()); block.setBranchId(team.getBranchId());
...@@ -196,8 +198,8 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -196,8 +198,8 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
block.setTeamId(teamId); block.setTeamId(teamId);
block.setLayerId(layerId); block.setLayerId(layerId);
block.setLayer(layerName); block.setLayer(layerName);
block.setStatus(1); block.setStatus(true);
mapBlockInfoMPDao.insert(block); entityManager.persist(block);
return Result.success(null); return Result.success(null);
} }
...@@ -226,6 +228,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -226,6 +228,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
return saasLayerId; return saasLayerId;
} }
@Transactional
@Override @Override
public Result<?> businessServiceBlockRemove(String blockId) throws BusinessException { public Result<?> businessServiceBlockRemove(String blockId) throws BusinessException {
MapBlockInfoEntity block = mapBlockInfoDao.findByBlockId(blockId); MapBlockInfoEntity block = mapBlockInfoDao.findByBlockId(blockId);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!