| @@ -31,8 +31,8 @@ public class MarkingDataReportController extends BaseController { | |||
| @ApiOperation("查询券数据列表") | |||
| @GetMapping("/couponDataList") | |||
| public ResultData findCouponDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto) { | |||
| return new ResultData(markingDataReportService.getCouponDateList(getTenantId(),markingCouponDataReportDto)); | |||
| public ResultData findCouponDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto,Integer pageNum, Integer pageSize) { | |||
| return new ResultData(markingDataReportService.getCouponDateList(getTenantId(),markingCouponDataReportDto,pageNum,pageSize)); | |||
| } | |||
| @ApiOperation("查询场景投放券数据") | |||
| @@ -43,8 +43,8 @@ public class MarkingDataReportController extends BaseController { | |||
| @ApiOperation("查询场景营销数据列表") | |||
| @GetMapping("/sceneDataList") | |||
| public ResultData findSceneDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto) { | |||
| return new ResultData(markingDataReportService.getSceneDataList(getTenantId(),markingCouponDataReportDto)); | |||
| public ResultData findSceneDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto,Integer pageNum, Integer pageSize) { | |||
| return new ResultData(markingDataReportService.getSceneDataList(getTenantId(),markingCouponDataReportDto,pageNum,pageSize)); | |||
| } | |||
| @ApiOperation("查询触达用户数数据") | |||
| @@ -55,8 +55,8 @@ public class MarkingDataReportController extends BaseController { | |||
| @ApiOperation("查询触达用户数数据列表") | |||
| @GetMapping("/touchUsersDataList") | |||
| public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto) { | |||
| return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(),markingCouponDataReportDto)); | |||
| public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto,Integer pageNum, Integer pageSize) { | |||
| return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(),markingCouponDataReportDto,pageNum,pageSize)); | |||
| } | |||
| @@ -1,5 +1,6 @@ | |||
| package com.simple.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.dto.MarkingCouponDataReportDto; | |||
| import com.simple.domain.vo.MarkingCouponDataReportVo; | |||
| import com.simple.domain.vo.MarkingSceneDataReportVo; | |||
| @@ -17,11 +18,11 @@ public interface MarkingDataReportService { | |||
| Map<String,Object> getSceneData(String tenantId); | |||
| List<MarkingCouponDataReportVo> getCouponDateList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto); | |||
| PageInfo<MarkingCouponDataReportVo> getCouponDateList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||
| List<MarkingSceneDataVo> getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto); | |||
| PageInfo<MarkingSceneDataVo> getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||
| List<TouchUsersReportVo> getTouchUsersReportList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto); | |||
| PageInfo<TouchUsersReportVo> getTouchUsersReportList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize); | |||
| List<TouchUsersReportVo> getTouchUsersReportData(String tenantId); | |||
| } | |||
| @@ -1,5 +1,7 @@ | |||
| package com.simple.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.dto.MarkingCouponDataReportDto; | |||
| import com.simple.domain.po.WxUserVisit; | |||
| import com.simple.domain.vo.MarkingCouponDataReportVo; | |||
| @@ -186,22 +188,24 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| } | |||
| @Override | |||
| public List<MarkingCouponDataReportVo> getCouponDateList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto) { | |||
| public PageInfo<MarkingCouponDataReportVo> getCouponDateList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||
| HashMap<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); | |||
| params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<MarkingCouponDataReportVo> couponDatalist = wxCouponOrderMapper.couponDataList(params); | |||
| return couponDatalist; | |||
| return new PageInfo<>(couponDatalist); | |||
| } | |||
| @Override | |||
| public List<MarkingSceneDataVo> getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto) { | |||
| public PageInfo<MarkingSceneDataVo> getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||
| HashMap<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); | |||
| params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); | |||
| //停车发券数 停车发券被核销数 核销发券数 核销发券被核销数 | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<MarkingSceneDataReportVo> templist = wxCouponActionLogMapper.sceneDataList(params); | |||
| List<MarkingSceneDataVo> list = new ArrayList<>(); | |||
| @@ -258,11 +262,11 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| vo.setVerifyPercent(vo.getVerifyCount() / gcd + "/" + vo.getSendCount() / gcd); | |||
| } | |||
| } | |||
| return list; | |||
| return new PageInfo<>(list); | |||
| } | |||
| @Override | |||
| public List<TouchUsersReportVo> getTouchUsersReportList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto){ | |||
| public PageInfo<TouchUsersReportVo> getTouchUsersReportList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | |||
| //获取领取人数 | |||
| //获取领取量 | |||
| //获取核销人数 | |||
| @@ -271,6 +275,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| params.put("tenantId", tenantId); | |||
| params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime())); | |||
| params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1)); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<TouchUsersReportVo> couponDatalist = wxCouponOrderMapper.touchUsersReportList(params); | |||
| //查询UV PV | |||
| @@ -286,7 +291,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| temp.setPv(visitMap.get(temp.getxTime()).getPv()); | |||
| } | |||
| } | |||
| return couponDatalist; | |||
| return new PageInfo<>(couponDatalist); | |||
| } | |||
| @Override | |||
| @@ -89,7 +89,14 @@ | |||
| <select id="sceneDataList" resultType="com.simple.domain.vo.MarkingSceneDataReportVo" parameterType="hashmap"> | |||
| select DATE_FORMAT(createtime,'%Y-%m-%d') as xTime, (select Count(*) from wx_coupon_action_log c where DATE_FORMAT(createtime,'%Y-%m-%d')=xTime and c.channel_type=3 and tenant_id=#{tenantId} ) as parkSendCount,(select Count(*) from wx_coupon_action_log c where DATE_FORMAT(createtime,'%Y-%m-%d')=xTime and c.channel_type=4 and tenant_id=#{tenantId}) as verifySendCount | |||
| from wx_coupon_action_log where tenant_id=#{tenantId} and createtime >= #{startTime} and createtime <= #{endTime} group by xTime | |||
| from wx_coupon_action_log where tenant_id=#{tenantId} | |||
| <if test=" null != startTime "> | |||
| and createtime >= #{startTime} | |||
| </if> | |||
| <if test=" null != endTime "> | |||
| and createtime <= #{endTime} | |||
| </if> | |||
| group by xTime | |||
| </select> | |||
| <select id="sceneDataJoinCouponOrderList" resultType="com.simple.domain.vo.MarkingSceneDataReportVo" parameterType="hashmap"> | |||
| @@ -393,9 +393,25 @@ | |||
| <select id="touchUsersReportList" resultType="com.simple.domain.vo.TouchUsersReportVo" parameterType="hashmap"> | |||
| SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as xTime | |||
| ,COUNT(DISTINCT c_user_id) as userCount,count(*) as couponCount | |||
| ,(select Count(*) from wx_coupon_order c where coupon_order_status=1 AND DATE_FORMAT(create_date,'%Y-%m-%d')=xTime and tenant_id=#{tenantId} AND c.update_date >= #{startTime} and c.update_date <= #{endTime}) as verifyCount | |||
| ,(select Count(*) from wx_coupon_order c where coupon_order_status=1 AND DATE_FORMAT(create_date,'%Y-%m-%d')=xTime and tenant_id=#{tenantId} | |||
| <if test="startTime != null"> | |||
| AND c.update_date >= #{startTime} | |||
| </if> | |||
| <if test="endTime != null"> | |||
| and c.update_date <= #{endTime} | |||
| </if> | |||
| ) as verifyCount | |||
| ,(select Count(DISTINCT c_user_id) from wx_coupon_order d where coupon_order_status=1 AND DATE_FORMAT(create_date,'%Y-%m-%d')=xTime and tenant_id=#{tenantId} AND d.update_date >= #{startTime} and d.update_date <= #{endTime}) as verifyUserCount | |||
| from wx_coupon_order where tenant_id=#{tenantId} AND create_date >= #{startTime} and create_date <= #{endTime} GROUP BY xTime | |||
| from wx_coupon_order where tenant_id=#{tenantId} | |||
| <if test="startTime != null"> | |||
| AND create_date >= #{startTime} | |||
| </if> | |||
| <if test="endTime != null"> | |||
| and create_date <= #{endTime} | |||
| </if> | |||
| GROUP BY xTime | |||
| </select> | |||
| <select id="queryPriceTotalGroup" resultType="com.simple.domain.vo.CUserDateAmountVo" > | |||