月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-09-06 8935ec073fc3bc7bb2f71ce7170316bfbb54ea55
src/main/java/com/moon/server/service/data/ShuJianService.java
@@ -92,16 +92,15 @@
        }
        PublishEntity publishEntity = createPublishEntity(pub, layerId, serviceId);
        Integer id = publishService.insert(publishEntity);
        if (null == id) {
            return id;
        int rows = publishService.insert(publishEntity);
        if (0 == rows) {
            return 0;
        }
        publishEntity.setId(id);
        ResEntity resEntity = createResEntity(publishEntity);
        resService.insert(resEntity);
        return insertMetaPub(pub, id);
        return insertMetaPub(pub, publishEntity.getId());
    }
    /**
@@ -178,7 +177,7 @@
     */
    public Integer postLayerEntity(CreateLayerEntity layerEntity) {
        Map<String, Object> map = getMapData(layerEntity);
        String url = String.format("%s/sj_raster/sj_raster/v6/api/layer?%s", sjUrl, ak);
        String url = String.format("%s/sj_raster/v6/api/layer?%s", sjUrl, ak);
        LayerResultEntity rs = postForRest(url, map, LayerResultEntity.class);
        boolean flag = null == rs || !StaticData.SUCCESS.equals(rs.getStatus()) || null == rs.getResult().getLayer_id();
@@ -229,20 +228,25 @@
     */
    public PublishEntity createPublishEntity(PubEntity pub, Integer layerId, Integer serviceId) {
        PublishEntity entity = new PublishEntity();
        entity.setType(pub.getType());
        entity.setLayerid(layerId);
        entity.setServiceid(serviceId);
        entity.setEventid(pub.getUuid());
        entity.setName(pub.getName());
        entity.setUrl(String.format(TYPES.get(0).equals(pub.getType()) ? DOM_FORMAT : DEM_FORMAT, sjUrl, serviceId, StaticData.I0));
        entity.setPath(null);
        entity.setType(pub.getType());
        entity.setStatus(3);
        entity.setDirid(pub.getDircode());
        entity.setDepid(pub.getDepcode());
        entity.setEnhanceType(pub.getEnhanceType());
        entity.setMin(pub.getMin());
        entity.setMax(pub.getMax());
        entity.setEpsg(pub.getEpsg());
        entity.setCreateUser(pub.getUserId());
        entity.setDirid(pub.getDircode());
        entity.setDepid(pub.getDepcode());
        entity.setStatus(3);
        entity.setLayerid(layerId);
        entity.setServiceid(serviceId);
        entity.setEventid(pub.getUuid());
        entity.setJson(getColorTableJson(pub));
        entity.setUrl(String.format(TYPES.get(0).equals(pub.getType()) ? DOM_FORMAT : DEM_FORMAT, sjUrl, serviceId, StaticData.I0));
        entity.setCtType(getColorTableType(pub));
        entity.setCtJson(getColorTableJson(pub));
        entity.setCreateUser(pub.getUserId());
        entity.setGeom("null");
        return entity;
    }
@@ -273,6 +277,20 @@
    }
    /**
     * 获取颜色表类型
     */
    private String getColorTableType(PubEntity pub) {
        if (null == pub.getColorTable() && null == pub.getGradientColorTable()) {
            return null;
        }
        if (null != pub.getGradientColorTable()) {
            return "渐变颜色表";
        }
        return "普通颜色表";
    }
    /**
     * 获取颜色表的JSON字符串
     */
    public String getColorTableJson(PubEntity pub) {