Commit 8c29f4b7 by 王祖波

数据结构修改

parent b1bc5709
......@@ -156,11 +156,12 @@ public class WeekMonthDataAdaptor {
inlineParams.put("orderByFields", 2);
inlineParams.put("orderByType", 1);
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), apolloKey);
if (result.get("data") == null) {
List<JSONObject> dataList = DataApiUtils.getDataList(result);
if (CollectionUtils.isEmpty(dataList)) {
return null;
}
JSONObject jsonObject = DataApiUtils.getPageOne(result);
if (jsonObject == null) {
JSONObject jsonObject = dataList.get(0);
if (jsonObject.isEmpty()) {
return null;
}
BigDecimal useMatlNum = Optional.ofNullable(jsonObject.getBigDecimal("useMatlNum")).orElse(BigDecimal.ZERO);
......@@ -193,11 +194,12 @@ public class WeekMonthDataAdaptor {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), apolloKey);
if (result.get("data") == null) {
List<JSONObject> dataList = DataApiUtils.getDataList(result);
if (CollectionUtils.isEmpty(dataList)) {
return null;
}
JSONObject jsonObject = DataApiUtils.getPageOne(result);
if (jsonObject == null) {
JSONObject jsonObject = dataList.get(0);
if (jsonObject.isEmpty()) {
return null;
}
BigDecimal dayAvgUseMatlNum = jsonObject.getBigDecimal("dayAvgUseMatlNum");
......
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