Commit db9afa68 by chamberone

fix: 接口返回服务范围id

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