From 43e341cc2b42f978ac20c08bdec839a79cefe37a Mon Sep 17 00:00:00 2001 From: hupeng Date: Wed, 26 Sep 2018 19:02:28 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=90=A5=E9=94=80][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E8=90=A5=E9=94=80=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E4=B8=8D=E5=A1=AB=E5=BC=95=E8=B5=B7=E7=9A=84=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MarkingDataReportServiceImpl.java | 49 +++++++----- .../resources/mapper/WxCarCmdLogMapper.xml | 2 + .../mapper/WxCouponActionLogMapper.xml | 16 +++- .../resources/mapper/WxCouponOrderMapper.xml | 76 +++++++++++++++---- .../resources/mapper/WxUserVisitMapper.xml | 10 ++- 5 files changed, 116 insertions(+), 37 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java index 8e0d06150..b2adccfaf 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java @@ -8,6 +8,7 @@ import com.iformall.domain.vo.MarkingCouponDataReportVo; import com.iformall.domain.vo.MarkingSceneDataReportVo; import com.iformall.domain.vo.MarkingSceneDataVo; import com.iformall.domain.vo.TouchUsersReportVo; +import com.iformall.enums.EnumCarCmd; import com.iformall.enums.EnumCouponSendSendType; import com.iformall.enums.EnumCouponType; import com.iformall.mapper.*; @@ -194,8 +195,10 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { public PageInfo getCouponDateList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { HashMap params = new HashMap<>(); params.put("tenantId", tenantId); - params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); - params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); + if (markingCouponDataReportDto.getStartTime() != null) + params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); + if (markingCouponDataReportDto.getEndTime() != null) + params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); if(markingCouponDataReportDto.getCouponType()!=null){ params.put("couponType", markingCouponDataReportDto.getCouponType()); } @@ -226,8 +229,10 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { public PageInfo getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { HashMap params = new HashMap<>(); params.put("tenantId", tenantId); - params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); - params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); + if (markingCouponDataReportDto.getStartTime() != null) + params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); + if (markingCouponDataReportDto.getEndTime() != null) + params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); //停车发券数 停车发券被核销数 核销发券数 核销发券被核销数 PageHelper.startPage(pageIndex, pageSize); List templist = wxCouponActionLogMapper.sceneDataList(params); @@ -251,18 +256,22 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { //停车发券被核销数 HashMap params1 = new HashMap<>(); params1.put("tenantId", tenantId); - params1.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); - params1.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); - params1.put("channelType", 3);//停车 + if (markingCouponDataReportDto.getStartTime() != null) + params1.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); + if (markingCouponDataReportDto.getEndTime() != null) + params1.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); + params1.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode()); List list1 = wxCouponActionLogMapper.sceneDataJoinCouponOrderList(params1); countMap = list1.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getxTime, p -> p.getTempCount())); }else{ //核销发券被核销数 HashMap params2 = new HashMap<>(); params2.put("tenantId", tenantId); - params2.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); - params2.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); - params2.put("channelType", 4);//核销 + if (markingCouponDataReportDto.getStartTime() != null) + params2.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); + if (markingCouponDataReportDto.getEndTime() != null) + params2.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); + params2.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode()); List list2 = wxCouponActionLogMapper.sceneDataJoinCouponOrderList(params2); countMap = list2.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getxTime, p -> p.getTempCount())); } @@ -270,9 +279,11 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { //获取车辆进场数 HashMap params3 = new HashMap<>(); params3.put("tenantId", tenantId); - params3.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); - params3.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); - params3.put("cmdType", 601);//核销 + if (markingCouponDataReportDto.getStartTime() != null) + params3.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); + if (markingCouponDataReportDto.getEndTime() != null) + params3.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); + params3.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode()); List markingSceneDataVos = wxCarCmdLogMapper.queryForSceneRepotyHistoryCar(params3); Map carCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getCarCount())); @@ -297,16 +308,20 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { //核销量 HashMap params = new HashMap<>(); params.put("tenantId", tenantId); - params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); - params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); + if (markingCouponDataReportDto.getStartTime() != null) + params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); + if (markingCouponDataReportDto.getEndTime() != null) + params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); PageHelper.startPage(pageIndex, pageSize); List couponDatalist = wxCouponOrderMapper.touchUsersReportList(params); //查询UV PV HashMap params1 = new HashMap<>(); params1.put("tenantId", tenantId); - params1.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); - params1.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); + if (markingCouponDataReportDto.getStartTime() != null) + params1.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); + if (markingCouponDataReportDto.getEndTime() != null) + params1.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); List wxUserVisitList = wxUserVisitMapper.touchUsersReportList(params1); Map visitMap = wxUserVisitList.stream().collect(Collectors.toMap(TouchUsersReportVo::getxTime, p -> p)); for (TouchUsersReportVo temp:couponDatalist) { diff --git a/mallinkService/src/main/resources/mapper/WxCarCmdLogMapper.xml b/mallinkService/src/main/resources/mapper/WxCarCmdLogMapper.xml index c5237b5da..cd376e8eb 100644 --- a/mallinkService/src/main/resources/mapper/WxCarCmdLogMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCarCmdLogMapper.xml @@ -88,7 +88,9 @@ diff --git a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml index 1d0705ee3..4aec9d3c2 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml @@ -92,7 +92,9 @@ from wx_coupon_action_log where tenant_id=#{tenantId} and createtime >= #{startTime} - and createtime <= #{endTime} group by xTime + and createtime <= #{endTime} + group by xTime + order by xTime desc diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index 1de63c780..80688fca5 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -389,40 +389,84 @@ SELECT DATE_FORMAT(day_date,'%Y-%m-%d') as xTime,visit_pv as pv,visit_uv as uv - from wx_user_visit where tenant_id=#{tenantId} AND day_date >= #{startTime} and day_date <= #{endTime} order by day_date desc + from wx_user_visit + where tenant_id=#{tenantId} + + and day_date >= #{startTime} + + + and day_date <= #{endTime} + + order by day_date desc