Commit 731bda9a by wangli

mp2jpa

1 parent f3f8f699
......@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.persistence.EntityManager;
import java.util.*;
import java.util.stream.Collectors;
......@@ -49,6 +50,9 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Autowired
private MapLayerCustomizeDao mapLayerCustomizeDao;
@Autowired
private EntityManager entityManager;
@Value("${SaaS.ak}")
String ak;
......@@ -159,7 +163,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
}
// 重复检查layerId+teamId
MapBlockInfo existBlock = mapBlockInfoMPDao.getByTeamIdAndLayerId(teamId, layerId);
MapBlockInfoEntity existBlock = mapBlockInfoDao.findByTeamIdAndLayerId(teamId, layerId);
if (null != existBlock) {
return Result.failure("区块已存在");
}
......@@ -224,12 +228,12 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Override
public Result<?> businessServiceBlockRemove(String blockId) throws BusinessException {
MapBlockInfo block = mapBlockInfoMPDao.getByBlockId(blockId);
MapBlockInfoEntity block = mapBlockInfoDao.findByBlockId(blockId);
if (block == null) {
throw new BusinessException("区块不存在");
}
block.setStatus(0);
mapBlockInfoMPDao.updateById(block);
block.setStatus(false);
entityManager.merge(block);
// 同步删除saas区块
String result = saasRemoteService.deleteArea(ak, blockId);
......@@ -244,7 +248,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Override
public Result<?> saasBaseDataLayerUrl(String blockId) throws BusinessException {
MapBlockInfo block = mapBlockInfoMPDao.getByBlockId(blockId);
MapBlockInfoEntity block = mapBlockInfoDao.findByBlockId(blockId);
if (block == null) {
throw new BusinessException("区块不存在");
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!