Commit 1ae23861 by guojx

数据接口超过90天调整名称

parent 4eee1986
......@@ -158,9 +158,11 @@ public class DataController {
}
String apolloKey = qo.getApolloKey();
String useApolloKey = CrossDateUtils.getUseApolloKey(jsonObject == null ? null : jsonObject.getString("startDate"), apolloKey);
//如果不一样,说明是3个月前的接口,需要
boolean needTransferField = !apolloKey.equals(useApolloKey);
Map<String, Object> res = DataApiUtils.http(jsonObject.toJSONString(), useApolloKey);
boolean isPageQuery = jsonObject != null && jsonObject.containsKey("pageNum");
boolean isNeedFill = (apolloKey.contains("data_mbr_scale_stat_new_custm_overview")
|| apolloKey.contains("data_sales_perf_anal_cont_custm_overview")
......@@ -176,6 +178,9 @@ public class DataController {
if (CollectionUtils.isEmpty(resultList)) {
resultList = new ArrayList<>();
}
if (needTransferField) {
resultList = CrossDateUtils.dealStdJson(resultList);
}
List<String> dateTypeList = null;
if (apolloKey.contains("day")) {
dateTypeList = DateFillUtils.getDay(jsonObject.getString("bizDate"));
......@@ -203,7 +208,22 @@ public class DataController {
}
}
return RestResponse.successResult(res.get("data"));
if (isPageQuery) {
JSONObject data = (JSONObject) res.get("data");
List<JSONObject> list = DataApiUtils.getPageList(res);
if (needTransferField) {
list = CrossDateUtils.dealStdJson(list);
data.put("rows", list);
}
return RestResponse.successResult(data);
} else {
List<JSONObject> resultList = DataApiUtils.getDataList(res);
if (needTransferField) {
resultList = CrossDateUtils.dealStdJson(resultList);
}
return RestResponse.successResult(resultList);
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment