Commit 8ba683a1 by songyinghui

feat: 数据统计

parent 4c77a896
......@@ -427,13 +427,22 @@ public class MaterialDataAdaptor {
materialAreaUsedDataVO.setEndTime(endTime);
return materialAreaUsedDataVO;
}
List<MaterialAreaUsedDataVO> areaUsedDataVOS = JSON.parseArray(JSON.toJSONString(result.get("data")), MaterialAreaUsedDataVO.class);
if (CollectionUtils.isEmpty(areaUsedDataVOS)) {
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(result.get("data")), JSONObject.class);
if (CollectionUtils.isEmpty(jsonObjects)) {
MaterialAreaUsedDataVO materialAreaUsedDataVO = new MaterialAreaUsedDataVO();
materialAreaUsedDataVO.setStartTime(startTime);
materialAreaUsedDataVO.setEndTime(endTime);
return materialAreaUsedDataVO;
}
List<MaterialAreaUsedDataVO> areaUsedDataVOS = jsonObjects.stream()
.map(item -> {
MaterialAreaUsedDataVO temp = JSONObject.parseObject(item.toJSONString(), MaterialAreaUsedDataVO.class);
temp.setDayAvgUseRate(item.getBigDecimal("dayAvgUseBindProportion"));
temp.setClickUserNum(item.getInteger("userClickNum"));
temp.setConvSalesNmt(item.getBigDecimal("convSalesAmt"));
return temp;
})
.collect(Collectors.toList());
MaterialAreaUsedDataVO materialAreaUsedDataVO = areaUsedDataVOS.get(0);
materialAreaUsedDataVO.setStartTime(startTime);
materialAreaUsedDataVO.setEndTime(endTime);
......
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