月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-09-05 b27c72d3a671dc00bc5a1683ea309fb2a661dea3
src/main/java/com/moon/server/service/data/ShuJianService.java
@@ -7,6 +7,7 @@
import com.moon.server.entity.data.MetaPubEntity;
import com.moon.server.entity.data.PublishEntity;
import com.moon.server.entity.shujian.*;
import com.moon.server.entity.sys.ResEntity;
import com.moon.server.helper.HttpHelper;
import com.moon.server.helper.PathHelper;
import com.moon.server.helper.RestHelper;
@@ -95,6 +96,10 @@
        if (null == id) {
            return id;
        }
        publishEntity.setId(id);
        ResEntity resEntity = createResEntity(publishEntity);
        resService.insert(resEntity);
        return insertMetaPub(pub, id);
    }
@@ -242,6 +247,31 @@
    }
    /**
     * 创建资源实体类
     */
    private ResEntity createResEntity(PublishEntity pub) {
        ResEntity entity = new ResEntity();
        entity.setCnName(pub.getName());
        // 状态:0-禁用,1-启用原始地址,2-启用代理地址
        entity.setStatus(2);
        // 服务类别:0-其他,1-GisServer,2-GeoServer,3-数简
        entity.setCategory(3);
        // 服务类型:0-URL,1-TMS,2-WMTS,3-WMS,4-WFS,5-Tileset
        entity.setType(StaticData.DOM.equals(pub.getType()) ? 2 : 0);
        // 数据类型:0-URL,1-DOM,2-DEM
        entity.setData(StaticData.DOM.equals(pub.getType()) ? 1 : 2);
        entity.setUrl(pub.getUrl());
        entity.setArgs(ak);
        entity.setDescr("系统自动创建");
        entity.setDepid(pub.getDepid());
        entity.setDirid(pub.getDirid());
        entity.setCreateUser(pub.getCreateUser());
        entity.setPubid(pub.getId());
        return entity;
    }
    /**
     * 获取颜色表的JSON字符串
     */
    public String getColorTableJson(PubEntity pub) {
@@ -308,7 +338,20 @@
            entity.setGeom(StaticData.NULL);
        }
        return publishService.update(entity);
        int rows = publishService.update(entity);
        if (0 == rows) {
            return 0;
        }
        ResEntity resEntity = resService.selectByPubid(entity.getId());
        if (null == resEntity) {
            resEntity = createResEntity(entity);
            return resService.insert(resEntity);
        } else {
            resEntity.setCnName(entity.getName());
            resEntity.setUrl(entity.getUrl());
            return resService.update(resEntity);
        }
    }
    /**