Commit 01737bd3 by guojx

活码数据统计-趋势图补0

parent c57b62fe
......@@ -290,28 +290,31 @@ public class HmQrcodeController {
StatisticsDTO dto = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_trend_m, hmTrendQO);
list = JSON.parseArray(JSON.toJSONString(dto.getData()), Map.class);
}
if (hmTrendVO != null) {
//日期补充
List<String> dateList = DateUtils.getDateList(hmTrendQO.getInFields().getStartTime(), hmTrendQO.getInFields().getEndTime(), type);
Map<String, Object> trendMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(list)) {
for (Map temp : list) {
trendMap.put((String) temp.get("bizDate"), temp.get("addNum"));
}
if (hmTrendVO == null) {
hmTrendVO = new HmTrendVO();
hmTrendVO.setAddNum(0);
hmTrendVO.setAddNumT(0);
}
//日期补充
List<String> dateList = DateUtils.getDateList(hmTrendQO.getInFields().getStartTime(), hmTrendQO.getInFields().getEndTime(), type);
Map<String, Object> trendMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(list)) {
for (Map temp : list) {
trendMap.put((String) temp.get("bizDate"), temp.get("addNum"));
}
for (String date : dateList) {
Map vo = new HashMap();
vo.put("bizDate", date);
Object addNum = trendMap.get(date);
if (addNum == null) {
vo.put("addNum", 0);
} else {
vo.put("addNum", addNum);
}
list.add(vo);
}
for (String date : dateList) {
Map vo = new HashMap();
vo.put("bizDate", date);
Object addNum = trendMap.get(date);
if (addNum == null) {
vo.put("addNum", 0);
} else {
vo.put("addNum", addNum);
}
hmTrendVO.setDateList(list);
list.add(vo);
}
hmTrendVO.setDateList(list);
return RestResponse.successResult(hmTrendVO);
}
......
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