|
|
|
@@ -158,7 +158,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
params.put("startTime", addDay(-30)); |
|
|
|
params.put("endTime", addDay(1)); |
|
|
|
//停车发券数 停车发券被核销数 核销发券数 核销发券被核销数 |
|
|
|
List<MarkingSceneDataReportVo> list = wxCouponActionLogMapper.sceneDataMap(params); |
|
|
|
// TODO DELETE sceneDataMap |
|
|
|
List<MarkingSceneDataReportTVo> sceneList = wxCouponActionLogMapper.getSceneDataMap(params); |
|
|
|
|
|
|
|
//停车发券被核销数 |
|
|
|
HashMap<String, Object> params1 = new HashMap<>(); |
|
|
|
@@ -196,13 +197,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
List<MarkingSceneDataReportVo> list4 = wxCouponActionLogMapper.sceneDataMapJoinCouponOrder(params4); |
|
|
|
Map<String, Integer> OrderCountMap = list4.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())); |
|
|
|
vo.setVerifyCount(verifyCountMap.get(vo.getXTime()) == null ? 0 : verifyCountMap.get(vo.getXTime())); |
|
|
|
vo.setMicroPayCount(microPayCountMap.get(vo.getXTime()) == null ? 0 : microPayCountMap.get(vo.getXTime())); |
|
|
|
vo.setOrderCount(OrderCountMap.get(vo.getXTime()) == null ? 0 : OrderCountMap.get(vo.getXTime())); |
|
|
|
} |
|
|
|
|
|
|
|
String startdate = DateUtils.getTimeBefore(30, new Date()); |
|
|
|
String enddate = DateUtils.getTimeBefore(1,new Date()); |
|
|
|
List<String> tjTimeList = DateUtils.getTjTimeList(startdate, enddate, "0"); |
|
|
|
@@ -210,30 +204,44 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { |
|
|
|
List<MarkingSceneDataReportVo> tempDatalist =new LinkedList<>(); |
|
|
|
|
|
|
|
for(String tj:tjList){ |
|
|
|
Optional<MarkingSceneDataReportVo> first = list.stream().filter(c -> c.getXTime().equals(tj)).findFirst(); |
|
|
|
|
|
|
|
MarkingSceneDataReportVo msdVo; |
|
|
|
if(!first.isPresent()){ |
|
|
|
msdVo = new MarkingSceneDataReportVo(); |
|
|
|
msdVo.setXTime(tj); |
|
|
|
msdVo.setCarCount(0); |
|
|
|
msdVo.setParkCount(0); |
|
|
|
msdVo.setVerifyCount(0); |
|
|
|
msdVo.setMicroPayCount(0); |
|
|
|
msdVo.setOrderCount(0); |
|
|
|
msdVo.setTempCount(0); |
|
|
|
MarkingSceneDataReportVo msdVo = new MarkingSceneDataReportVo(); |
|
|
|
msdVo.setXTime(tj); |
|
|
|
Optional<MarkingSceneDataReportTVo> carStop = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.CAR_STOP.getCode()).findFirst(); |
|
|
|
if(!carStop.isPresent()) { |
|
|
|
msdVo.setParkSendCount(0); |
|
|
|
} else { |
|
|
|
MarkingSceneDataReportTVo tvo = carStop.get(); |
|
|
|
msdVo.setParkSendCount(tvo.getCount()); |
|
|
|
} |
|
|
|
|
|
|
|
Optional<MarkingSceneDataReportTVo> couponVerify = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.COUPON_VERIFY.getCode()).findFirst(); |
|
|
|
if(!couponVerify.isPresent()) { |
|
|
|
msdVo.setVerifySendCount(0); |
|
|
|
} else { |
|
|
|
MarkingSceneDataReportTVo tvo = couponVerify.get(); |
|
|
|
msdVo.setVerifySendCount(tvo.getCount()); |
|
|
|
} |
|
|
|
|
|
|
|
Optional<MarkingSceneDataReportTVo> microPay = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.B_MICROPAY.getCode()).findFirst(); |
|
|
|
if(!microPay.isPresent()) { |
|
|
|
msdVo.setMicroPaySendCount(0); |
|
|
|
} else { |
|
|
|
MarkingSceneDataReportTVo tvo = microPay.get(); |
|
|
|
msdVo.setMicroPaySendCount(tvo.getCount()); |
|
|
|
} |
|
|
|
|
|
|
|
Optional<MarkingSceneDataReportTVo> orderSend = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.B_MICROPAY.getCode()).findFirst(); |
|
|
|
if(!orderSend.isPresent()) { |
|
|
|
msdVo.setOrderSendCount(0); |
|
|
|
msdVo.setTotal(0); |
|
|
|
} else { |
|
|
|
msdVo = first.get(); |
|
|
|
msdVo.setTotal(msdVo.getParkSendCount() + |
|
|
|
msdVo.getVerifySendCount() + |
|
|
|
msdVo.getMicroPaySendCount() + |
|
|
|
msdVo.getOrderSendCount()); |
|
|
|
MarkingSceneDataReportTVo tvo = orderSend.get(); |
|
|
|
msdVo.setOrderSendCount(tvo.getCount()); |
|
|
|
} |
|
|
|
msdVo.setTotal(msdVo.getParkSendCount() + |
|
|
|
msdVo.getVerifySendCount() + |
|
|
|
msdVo.getMicroPaySendCount() + |
|
|
|
msdVo.getOrderSendCount()); |
|
|
|
|
|
|
|
tempDatalist.add(msdVo); |
|
|
|
} |
|
|
|
|
|
|
|
|