| | |
| | | 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; |
| | |
| | | if (null == id) { |
| | | return id; |
| | | } |
| | | |
| | | publishEntity.setId(id); |
| | | ResEntity resEntity = createResEntity(publishEntity); |
| | | resService.insert(resEntity); |
| | | |
| | | return insertMetaPub(pub, id); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 创建资源实体类 |
| | | */ |
| | | 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) { |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | /** |