|
|
|
@@ -295,12 +295,12 @@ public class WxChartServiceImpl implements WxChartDataService { |
|
|
|
|
|
|
|
//首页场景发券 |
|
|
|
if (chart.equals(EnumChart.INDEX_COUPON_SCENE.getCode())) { |
|
|
|
return new ResultData(markingDataReportService.getSceneDataHistory(tenantId, paramsMap.get("startdate"), paramsMap.get("enddate"))); |
|
|
|
return new ResultData(markingDataReportService.getSceneDataHistory(tenantId, startdate, enddate)); |
|
|
|
} |
|
|
|
|
|
|
|
//首页营销数据 |
|
|
|
if (chart.equals(EnumChart.INDEX_SALE_DATA.getCode())) { |
|
|
|
return getSaleDataHistory(tenantId, startdate,enddate); |
|
|
|
return getSaleDataHistory(tenantId, startdate, enddate); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@@ -2426,34 +2426,19 @@ public class WxChartServiceImpl implements WxChartDataService { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private ResultData getSaleDataHistory(String tenantId, String startdate,String enddate) { |
|
|
|
Date startDate = DateUtils.getDateFromString(startdate,"yyyy-MM-dd").getTime(); |
|
|
|
Date endDate = DateUtils.getDateFromString(enddate,"yyyy-MM-dd").getTime(); |
|
|
|
Date startDate = DateUtils.getDateFromString(startdate,"yyyy-MM-dd HH:mm:ss").getTime(); |
|
|
|
Date endDate = DateUtils.getDateFromString(enddate,"yyyy-MM-dd HH:mm:ss").getTime(); |
|
|
|
|
|
|
|
HashMap<String, Object> datamap = new HashMap<>(); |
|
|
|
//卷数据 |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
params.put("startTime", startDate); |
|
|
|
params.put("endTime", endDate); |
|
|
|
List<MarkingCouponDataReportVo> couponDatalist = wxCouponOrderMapper.couponDataMap(params); |
|
|
|
|
|
|
|
List<String> days = DateUtils.getTjTimeList(startdate,enddate,"0"); |
|
|
|
TreeMap<String, Object> historyMap = new TreeMap<>(); |
|
|
|
Map<String, Integer> countMap = couponDatalist.stream().collect(Collectors.toMap(MarkingCouponDataReportVo::getCreateTime, p -> p.getCouponCount())); |
|
|
|
for (String date:days) { |
|
|
|
historyMap.put(date.substring(5,date.length()).replace("-","/"),"0"); |
|
|
|
} |
|
|
|
for (String key : countMap.keySet()) { |
|
|
|
String keySub = key.substring(5,key.length()).replace("-","/"); |
|
|
|
historyMap.put(keySub,countMap.get(key)); |
|
|
|
} |
|
|
|
datamap.put("couponHistory",historyMap); |
|
|
|
|
|
|
|
//卡数据 |
|
|
|
TreeMap<String, Object> historyMap; |
|
|
|
Map<String, Integer> countMap; |
|
|
|
WxCoupon couponQuery = new WxCoupon(); |
|
|
|
couponQuery.setTenantId(tenantId); |
|
|
|
couponQuery.setStartdate(startDate); |
|
|
|
couponQuery.setEnddate(endDate); |
|
|
|
|
|
|
|
//卡数据 |
|
|
|
List<WxCouponStatisVo> couponStatisVoList = wxCouponService.findSaleCardCountHistory(couponQuery); |
|
|
|
countMap = couponStatisVoList.stream().collect(Collectors.toMap(WxCouponStatisVo::getXtime, p -> Integer.parseInt(p.getXcount()))); |
|
|
|
historyMap = new TreeMap<>(); |
|
|
|
@@ -2467,15 +2452,28 @@ public class WxChartServiceImpl implements WxChartDataService { |
|
|
|
datamap.put("cardHistory",historyMap); |
|
|
|
|
|
|
|
//砍价数据 |
|
|
|
List<WxCouponStatisVo> pressSendHistory = wxCouponService.pressSendHistory(couponQuery); |
|
|
|
Map<String,String> pressSendHistoryMap = getDateMap(startDate,endDate); |
|
|
|
for (WxCouponStatisVo coupon:pressSendHistory){ |
|
|
|
pressSendHistoryMap.put(coupon.getXtime(),coupon.getXcount()); |
|
|
|
List<WxCouponStatisVo> wxCouponStatisVoList = wxCouponService.pressSendHistory(couponQuery); |
|
|
|
Map<String,String> countHistoryMap = getDateMap(startDate,endDate); |
|
|
|
for (WxCouponStatisVo coupon:wxCouponStatisVoList){ |
|
|
|
countHistoryMap.put(coupon.getXtime(),coupon.getXcount()); |
|
|
|
} |
|
|
|
datamap.put("pressSendHistory",pressSendHistoryMap); |
|
|
|
datamap.put("pressSendHistory",countHistoryMap); |
|
|
|
|
|
|
|
//拼团 |
|
|
|
long groupCount = wxOrderGroupMapper.queryOrderGroupCount(params); |
|
|
|
wxCouponStatisVoList = wxOrderGroupMapper.queryOrderGroupCountHistory(couponQuery); |
|
|
|
countHistoryMap = getDateMap(startDate,endDate); |
|
|
|
for (WxCouponStatisVo coupon:wxCouponStatisVoList){ |
|
|
|
countHistoryMap.put(coupon.getXtime(),coupon.getXcount()); |
|
|
|
} |
|
|
|
datamap.put("groupHistory",countHistoryMap); |
|
|
|
|
|
|
|
//卷数据 |
|
|
|
wxCouponStatisVoList = wxCouponService.findCouponOrderCount(couponQuery); |
|
|
|
countHistoryMap = getDateMap(startDate,endDate); |
|
|
|
for (WxCouponStatisVo coupon:wxCouponStatisVoList){ |
|
|
|
countHistoryMap.put(coupon.getXtime(),coupon.getXcount()); |
|
|
|
} |
|
|
|
datamap.put("couponHistory",countHistoryMap); |
|
|
|
|
|
|
|
return new ResultData(datamap); |
|
|
|
} |
|
|
|
|