Commit db9afa68 by chamberone

fix: 接口返回服务范围id

1 parent e0b70d34
...@@ -15,7 +15,8 @@ public class BusinessServerBlocksRespDTO { ...@@ -15,7 +15,8 @@ public class BusinessServerBlocksRespDTO {
@Data @Data
public static class Block { public static class Block {
private String id; private Integer id;
private String areaIds;
private String groupId; private String groupId;
private String groupName; private String groupName;
private String layerId; private String layerId;
......
...@@ -11,6 +11,8 @@ import com.dituhui.pea.order.entity.*; ...@@ -11,6 +11,8 @@ import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.feign.ISaaSRemoteService; import com.dituhui.pea.order.feign.ISaaSRemoteService;
import com.dituhui.pea.order.service.BusinessBlockService; import com.dituhui.pea.order.service.BusinessBlockService;
import com.dituhui.pea.order.utils.TypeUtils; import com.dituhui.pea.order.utils.TypeUtils;
import com.google.gson.internal.LinkedTreeMap;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -123,7 +125,8 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -123,7 +125,8 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String groupId = team.getGroupId(); String groupId = team.getGroupId();
String groupName = groupMapping.get(groupId); String groupName = groupMapping.get(groupId);
block.setId(b.getAreaIds()); block.setId(b.getId());
block.setAreaIds(b.getAreaIds());
block.setGroupId(groupId); block.setGroupId(groupId);
block.setGroupName(groupName); block.setGroupName(groupName);
block.setLayerId(b.getLayerId()); block.setLayerId(b.getLayerId());
...@@ -181,23 +184,17 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -181,23 +184,17 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
return Result.failure("该工作队图层服务范围已存在"); return Result.failure("该工作队图层服务范围已存在");
} }
// // 同步到saas,返回blockId // 同步初始化saas区划图层,图层命名方式:分部id_图层id,先检查一下图层是否存在,不存在则新建。FIXME saas处理逻辑
// // 获取小队出发点,初始化区块 String saasLayerName = team.getBranchId() + "_" + layerId;
// OrgGroupEntity group = orgGroupDao.getByGroupId(team.getGroupId()); String result = saasRemoteService.addLayer(ak, saasLayerName, 1, 1);
// String center = RegionUtils.constructCenter(group.getX(), group.getY()); log.info("addLayer params:{} result:{}", layerName, result);
// // 获取saas图层id Result<LinkedTreeMap<String, Object>> saasResult = TypeUtils.convertResult(result);
// String saasLayerId = getSaaSLayerId(team.getBranchId(), layerId); if (!ResultEnum.SUCCESS.getCode().equals(saasResult.getCode())) {
// if (StringUtils.isEmpty(saasLayerId)) { return Result.failure(saasResult.getMessage());
// return Result.failure(team.getTeamName() + " 图层未配置"); }
// } // 返回layerid和code
// String saasLayerId = (String) saasResult.getResult().get("id");// 存入pea
// String result = saasRemoteService.addArea(ak, team.getTeamName(), saasLayerId, center);
// log.info("params:{} {} {} {} result:{}", team.getTeamName(), saasLayerId, center, result);
// Result<String> saasResult = TypeUtils.convertResult(result);
// if (!ResultEnum.SUCCESS.getCode().equals(saasResult.getCode())) {
// return Result.failure("区块已存在或者裁剪为空");
// }
// String blockId = saasResult.getResult();
String blockName = String.format("%s_%s", layerName, team.getTeamName()); //区块名称 String blockName = String.format("%s_%s", layerName, team.getTeamName()); //区块名称
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!