新增航班动态信息处理

This commit is contained in:
zhouxiunai
2018-11-30 11:30:08 +08:00
parent e22f1ead9f
commit eb32e8b1e9
7 changed files with 222 additions and 65 deletions
@@ -22,9 +22,10 @@ public class ExchangeServiceImpl implements IExchangeService {
Map map;
ObjectMapper xmlMapper = new XmlMapper();
map = xmlMapper.readValue(xml, Map.class);
map.remove("noNamespaceSchemaLocation");
ObjectMapper jsonMapper = new ObjectMapper();
String json = jsonMapper.writeValueAsString(map);
String json = jsonMapper.writer().withDefaultPrettyPrinter().writeValueAsString(map);
return json;
} catch (JsonParseException e) {
throw new ExchangeServiceException(e.getMessage(),e);