Commit e15313e6 by chamberone

feat: 添加saas图层id相关逻辑

1 parent bbf4dbe9
...@@ -4,4 +4,7 @@ import com.dituhui.pea.order.entity.MapLayerCustomizeEntity; ...@@ -4,4 +4,7 @@ import com.dituhui.pea.order.entity.MapLayerCustomizeEntity;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface MapLayerCustomizeDao extends JpaRepository<MapLayerCustomizeEntity, Long> { public interface MapLayerCustomizeDao extends JpaRepository<MapLayerCustomizeEntity, Long> {
public MapLayerCustomizeEntity findByBranchIdAndLayerId(String branchId, String layerId);
} }
...@@ -20,6 +20,9 @@ public class MapLayerCustomizeEntity { ...@@ -20,6 +20,9 @@ public class MapLayerCustomizeEntity {
@Column(name = "layer_id", length = 32) @Column(name = "layer_id", length = 32)
private String layerId; private String layerId;
@Column(name = "saas_layer_id", length = 32)
private String saasLayerId;
@Column(name = "layer", nullable = false, length = 50) @Column(name = "layer", nullable = false, length = 50)
private String layer; private String layer;
......
...@@ -17,6 +17,9 @@ public class MapLayerEntity { ...@@ -17,6 +17,9 @@ public class MapLayerEntity {
@Column(name = "layer_id", nullable = false, length = 32) @Column(name = "layer_id", nullable = false, length = 32)
private String layerId; private String layerId;
@Column(name = "saas_layer_id", nullable = false, length = 32)
private String saasLayerId;
@Column(name = "layer", nullable = false, length = 50) @Column(name = "layer", nullable = false, length = 50)
private String layer; private String layer;
......
...@@ -49,6 +49,12 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -49,6 +49,12 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Autowired @Autowired
private OrgGroupDao orgGroupDao; private OrgGroupDao orgGroupDao;
@Autowired
private MapLayerDao mapLayerDao;
@Autowired
private MapLayerCustomizeDao mapLayerCustomizeDao;
@Value("${SaaS.ak}") @Value("${SaaS.ak}")
String ak; String ak;
...@@ -160,8 +166,25 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -160,8 +166,25 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
// 同步到saas,返回blockId // 同步到saas,返回blockId
// 获取小队出发点,初始化区块 // 获取小队出发点,初始化区块
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());
String result = saasRemoteService.addArea(ak, team.getTeamName(), layerId, region, "gcj02mc"); // 获取saas图层id
MapLayerEntity layer = mapLayerDao.getByLayerId(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)) {
return Result.failure("图层未配置");
}
String result = saasRemoteService.addArea(ak, team.getTeamName(), saasLayerId, region, "gcj02mc");
log.info("params:{} {} {} result:{}", team.getTeamName(), layerId, region, result); log.info("params:{} {} {} result:{}", team.getTeamName(), layerId, region, result);
Result<String> saasResult = TypeUtils.<String>convertResult(result); Result<String> saasResult = TypeUtils.<String>convertResult(result);
if (!ResultEnum.SUCCESS.getCode().equals(saasResult.getCode())) { if (!ResultEnum.SUCCESS.getCode().equals(saasResult.getCode())) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!