| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.*; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private final static String MISSION_STATUS = "%s/sj_raster/v6/api/mission/%d?op=get_status&%s"; |
| | | |
| | | private final static String COLOR_TABLE = "%s/sj_raster/v6/api/color_table?%s&page_count=%d&page_num=%d&key="; |
| | | |
| | | private final static String IMAGE_INFO = "%s/sj_raster/v6/api/image?%s&key=&page_num=1&page_count=1000&layer_id=%d"; |
| | | |
| | | /** |
| | | * 分页查询数简的颜色表 |
| | |
| | | |
| | | return flag ? null : rs.getResult(); |
| | | } |
| | | |
| | | /** |
| | | * 更新数简图层的拉伸方式 |
| | | */ |
| | | public Integer updateSjLayerStretch(PubEntity entity) { |
| | | PublishEntity pub = publishService.selectByLayerId(entity.getLayerId()); |
| | | if (null == pub || null == pub.getLayerid()) { |
| | | return 0; |
| | | } |
| | | |
| | | ImageResultEntity ir = selectImageInfo(pub.getLayerid()); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * 根据图层ID查询影像信息 |
| | | */ |
| | | public ImageResultEntity selectImageInfo(Integer layerId) { |
| | | try { |
| | | String url = String.format(IMAGE_INFO, sjUrl5, ak, layerId); |
| | | |
| | | RestTemplate rest = RestHelper.getRestTemplate(); |
| | | ResponseEntity<ImageResultEntity> resp = rest.getForEntity(url, ImageResultEntity.class); |
| | | |
| | | return resp.getBody(); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | } |