|
|
|
@@ -45,17 +45,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
@Autowired |
|
|
|
private WxOrderMapper wxOrderMapper; |
|
|
|
|
|
|
|
//取本月第一天 |
|
|
|
private Date getFirstDayOfMonth() { |
|
|
|
Calendar c = Calendar.getInstance(); |
|
|
|
c.set(Calendar.DAY_OF_MONTH, 0);//设置为1号,当前日期既为本月第一天 |
|
|
|
c.set(Calendar.HOUR_OF_DAY, 0); |
|
|
|
c.set(Calendar.MINUTE, 0); |
|
|
|
c.set(Calendar.SECOND, 0); |
|
|
|
c.set(Calendar.MILLISECOND, 0); |
|
|
|
Date thisMonth = c.getTime(); |
|
|
|
return thisMonth; |
|
|
|
} |
|
|
|
|
|
|
|
private Date addDay(int addDayAmount) { |
|
|
|
Calendar c = Calendar.getInstance(); |
|
|
|
@@ -68,20 +57,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
return date; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param date 转换当前时间去掉时分秒 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private Date convertDate(Date date) { |
|
|
|
Calendar c = Calendar.getInstance(); |
|
|
|
c.setTime(date); |
|
|
|
c.set(Calendar.HOUR_OF_DAY, 0); |
|
|
|
c.set(Calendar.MINUTE, 0); |
|
|
|
c.set(Calendar.SECOND, 0); |
|
|
|
c.set(Calendar.MILLISECOND, 0); |
|
|
|
Date result = c.getTime(); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private Date convertDateAndAdd(Date date, int addDayAmount) { |
|
|
|
Calendar c = Calendar.getInstance(); |
|
|
|
@@ -122,7 +97,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
//couponData |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
params.put("startTime", getFirstDayOfMonth()); |
|
|
|
params.put("startTime", addDay(-30)); |
|
|
|
params.put("endTime", addDay(1)); |
|
|
|
List<MarkingCouponDataReportVo> couponDatalist = wxCouponOrderMapper.couponDataMap(params); |
|
|
|
//查询券领取人数 |
|
|
|
@@ -182,7 +157,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
params.put("startTime", getFirstDayOfMonth()); |
|
|
|
params.put("startTime", addDay(-30)); |
|
|
|
params.put("endTime", addDay(1)); |
|
|
|
//停车发券数 停车发券被核销数 核销发券数 核销发券被核销数 |
|
|
|
List<MarkingSceneDataReportVo> list = wxCouponActionLogMapper.sceneDataMap(params); |
|
|
|
@@ -190,28 +165,30 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
//停车发券被核销数 |
|
|
|
HashMap<String, Object> params1 = new HashMap<>(); |
|
|
|
params1.put("tenantId", tenantId); |
|
|
|
params1.put("startTime", getFirstDayOfMonth()); |
|
|
|
params1.put("startTime", addDay(-30)); |
|
|
|
params1.put("endTime", addDay(1)); |
|
|
|
params1.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode());//停车 |
|
|
|
List<MarkingSceneDataReportVo> list1 = wxCouponActionLogMapper.sceneDataMapJoinCouponOrder(params1); |
|
|
|
Map<String, Integer> parkCountMap = list1.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); |
|
|
|
|
|
|
|
//核销发券被核销数 |
|
|
|
HashMap<String, Object> params2 = new HashMap<>(); |
|
|
|
params2.put("tenantId", tenantId); |
|
|
|
params2.put("startTime", getFirstDayOfMonth()); |
|
|
|
params2.put("startTime", addDay(-30)); |
|
|
|
params2.put("endTime", addDay(1)); |
|
|
|
params2.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode());//核销 |
|
|
|
List<MarkingSceneDataReportVo> list2 = wxCouponActionLogMapper.sceneDataMapJoinCouponOrder(params2); |
|
|
|
Map<String, Integer> verifyCountMap = list2.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); |
|
|
|
|
|
|
|
// B端刷卡支付被核销数 |
|
|
|
// TODO |
|
|
|
HashMap<String, Object> params3 = new HashMap<>(); |
|
|
|
params3.put("tenantId", tenantId); |
|
|
|
params3.put("startTime", getFirstDayOfMonth()); |
|
|
|
params3.put("startTime", addDay(-30)); |
|
|
|
params3.put("endTime", addDay(1)); |
|
|
|
params3.put("channelType", EnumCouponSendSendType.B_MICROPAY.getCode());//B端刷卡支付 |
|
|
|
List<MarkingSceneDataReportVo> list3 = wxCouponActionLogMapper.sceneDataMapJoinCouponOrder(params3); |
|
|
|
Map<String, Integer> microPayCountMap = list2.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); |
|
|
|
Map<String, Integer> microPayCountMap = list3.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); |
|
|
|
|
|
|
|
for (MarkingSceneDataReportVo vo : list) { |
|
|
|
vo.setParkCount(parkCountMap.get(vo.getXTime()) == null ? 0 : parkCountMap.get(vo.getXTime())); |
|
|
|
@@ -261,9 +238,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
if(markingCouponDataReportDto.getCouponType()!=null){ |
|
|
|
params.put("couponType", markingCouponDataReportDto.getCouponType()); |
|
|
|
} |
|
|
|
@@ -298,9 +275,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
//停车发券数 停车发券被核销数, 核销发券数 核销发券被核销数, B端刷卡支付发券数 刷卡支付发券被核销数 |
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
List<MarkingSceneDataReportVo> templist = wxCouponActionLogMapper.sceneDataList(params); |
|
|
|
@@ -329,9 +306,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
params.clear(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
params.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode()); |
|
|
|
List<MarkingSceneDataReportVo> list1 = wxCouponActionLogMapper.sceneDataJoinCouponOrderList(params); |
|
|
|
countMap = list1.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); |
|
|
|
@@ -340,9 +317,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
params.clear(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
params.put("channelType", EnumCouponSendSendType.B_MICROPAY.getCode()); |
|
|
|
List<MarkingSceneDataReportVo> list1 = wxCouponActionLogMapper.sceneDataJoinCouponOrderList(params); |
|
|
|
countMap = list1.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); |
|
|
|
@@ -351,9 +328,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
params.clear(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
params.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode()); |
|
|
|
List<MarkingSceneDataReportVo> list2 = wxCouponActionLogMapper.sceneDataJoinCouponOrderList(params); |
|
|
|
countMap = list2.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); |
|
|
|
@@ -366,9 +343,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
params.clear(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
params.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode()); |
|
|
|
List<MarkingSceneDataVo> markingSceneDataVos = wxCarCmdLogMapper.queryForSceneRepotyHistoryCar(params); |
|
|
|
triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getTriggerCount())); |
|
|
|
@@ -377,9 +354,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
params.clear(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
params.put("type", EnumOrderType.MICROPAY.getCode()); |
|
|
|
List<MarkingSceneDataVo> markingSceneDataVos = wxOrderMapper.queryForSceneRepotyHistory(params); |
|
|
|
triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getTriggerCount())); |
|
|
|
@@ -388,9 +365,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
params.clear(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
List<MarkingSceneDataVo> markingSceneDataVos = wxCouponOrderMapper.queryForSceneRepotyHistoryVerified(params); |
|
|
|
triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getTriggerCount())); |
|
|
|
} |
|
|
|
@@ -415,9 +392,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
HashMap<String, Object> params1 = new HashMap<>(); |
|
|
|
params1.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params1.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params1.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params1.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params1.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportList(params1); |
|
|
|
|
|
|
|
@@ -429,9 +406,9 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
HashMap<String, Object> params2 = new HashMap<>(); |
|
|
|
params2.put("tenantId", tenantId); |
|
|
|
if (markingCouponDataReportDto.getStartTime() != null) |
|
|
|
params2.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); |
|
|
|
params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); |
|
|
|
if (markingCouponDataReportDto.getEndTime() != null) |
|
|
|
params2.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); |
|
|
|
params2.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); |
|
|
|
List<TouchUsersReportVo> couponDatalist = wxCouponOrderMapper.touchUsersReportList(params2); |
|
|
|
|
|
|
|
Map<String,TouchUsersReportVo> visitMap = couponDatalist.stream().collect(Collectors.toMap(TouchUsersReportVo::getxTime, p -> p)); |
|
|
|
|