Commit 1028d36b by wangli

mp2jpa

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