Commit 01737bd3 by guojx

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

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