Commit 4640a543 by chamberone

fix: 修复layerid为空问题

1 parent e15313e6
...@@ -168,18 +168,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -168,18 +168,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
OrgGroupEntity group = orgGroupDao.getByGroupId(team.getGroupId()); OrgGroupEntity group = orgGroupDao.getByGroupId(team.getGroupId());
String region = RegionUtils.constructRegion(group.getX(), group.getY()); String region = RegionUtils.constructRegion(group.getX(), group.getY());
// 获取saas图层id // 获取saas图层id
MapLayerEntity layer = mapLayerDao.getByLayerId(layerId); String saasLayerId = getSaaSLayerId(team.getBranchId(), layerId);
String saasLayerId = null;
if (null == layer) {
MapLayerCustomizeEntity layerCustom = mapLayerCustomizeDao.findByBranchIdAndLayerId(team.getBranchId(),
layerId);
if (null == layerCustom) {
return Result.failure("图层数据错误");
}
saasLayerId = layerCustom.getSaasLayerId();
} else {
saasLayerId = layer.getSaasLayerId();
}
if (StringUtils.isEmpty(saasLayerId)) { if (StringUtils.isEmpty(saasLayerId)) {
return Result.failure("图层未配置"); return Result.failure("图层未配置");
} }
...@@ -198,7 +187,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -198,7 +187,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
block.setBranchId(team.getBranchId()); block.setBranchId(team.getBranchId());
block.setGroupId(team.getGroupId()); block.setGroupId(team.getGroupId());
block.setTeamId(teamId); block.setTeamId(teamId);
block.setLayer(layerId); block.setLayerId(layerId);
block.setLayer(layerName); block.setLayer(layerName);
block.setStatus(1); block.setStatus(1);
mapBlockInfoMPDao.insert(block); mapBlockInfoMPDao.insert(block);
...@@ -206,6 +195,25 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -206,6 +195,25 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
return Result.success(null); return Result.success(null);
} }
/**
* 获取saas图层id
*
* @param branchId
* @param layerId
* @return
*/
private String getSaaSLayerId(String branchId, String layerId) {
MapLayerEntity layer = mapLayerDao.getByLayerId(layerId);
String saasLayerId = null;
if (null == layer) {
MapLayerCustomizeEntity layerCustom = mapLayerCustomizeDao.findByBranchIdAndLayerId(branchId, layerId);
saasLayerId = layerCustom.getSaasLayerId();
} else {
saasLayerId = layer.getSaasLayerId();
}
return saasLayerId;
}
@Override @Override
public Result<?> businessServiceBlockRemove(String blockId) throws BusinessException { public Result<?> businessServiceBlockRemove(String blockId) throws BusinessException {
MapBlockInfo block = mapBlockInfoMPDao.getByBlockId(blockId); MapBlockInfo block = mapBlockInfoMPDao.getByBlockId(blockId);
...@@ -238,9 +246,11 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -238,9 +246,11 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String password = "qjOHxpQPXLnJP+Jq1CZGBQ=="; String password = "qjOHxpQPXLnJP+Jq1CZGBQ==";
// 跳转SaaS url // 跳转SaaS url
// 获取saas图层id
String saasLayerId = getSaaSLayerId(block.getBranchId(), block.getLayerId());
HashMap<String, String> res = new HashMap<>(); HashMap<String, String> res = new HashMap<>();
res.put("url", url + "/mlAutoLogin?userAccount=" + userAccount + "&password=" + password res.put("url", url + "/mlAutoLogin?userAccount=" + userAccount + "&password=" + password
+ "&jump=basedata&navHidden=true&layerId=" + block.getLayerId() + "&areaId=" + block.getBlockId()); + "&jump=basedata&navHidden=true&layerId=" + saasLayerId + "&areaId=" + block.getBlockId());
return Result.success(res); return Result.success(res);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!