Просмотр исходного кода

[触达用户数][修改]:用view获取数据

release_toaliyun_real
Stormeye Wu 6 лет назад
Родитель
Сommit
3d30f5e062
2 измененных файлов: 7 добавлений и 42 удалений
  1. +2
    -12
      mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java
  2. +5
    -30
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 2
- 12
mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java Просмотреть файл

@@ -662,7 +662,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
if (markingCouponDataReportDto.getEndTime() != null)
markingCouponDataReportDto.setEndTime(markingCouponDataReportDto.getEndTime());
PageHelper.startPage(pageIndex, pageSize);
List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportList(markingCouponDataReportDto);

//获取领取人数
//获取领取量
@@ -674,17 +674,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0));
if (markingCouponDataReportDto.getEndTime() != null)
params2.put("endTime", markingCouponDataReportDto.getEndTime());
List<TouchUsersReportVo> couponDatalist = wxCouponOrderMapper.touchUsersReportList(params2);

Map<String,TouchUsersReportVo> visitMap = couponDatalist.stream().collect(Collectors.toMap(TouchUsersReportVo::getXTime, p -> p));
for (TouchUsersReportVo temp:wxUserVisitList) {
if(visitMap.get(temp.getXTime())!=null){
temp.setCouponCount(visitMap.get(temp.getXTime()).getCouponCount());
temp.setUserCount(visitMap.get(temp.getXTime()).getUserCount());
temp.setVerifyCount(visitMap.get(temp.getXTime()).getVerifyCount());
temp.setVerifyUserCount(visitMap.get(temp.getXTime()).getVerifyUserCount());
}
}
List<TouchUsersReportVo> wxUserVisitList = wxCouponOrderMapper.touchUsersReportList(params2);
return new PageInfo<>(wxUserVisitList);
}



+ 5
- 30
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Просмотреть файл

@@ -149,39 +149,14 @@
</select>

<select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto">
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}
SELECT xTime, tenant_id, pv, uv, couponCount, userCount, verifyCount, verifyUserCount
FROM view_touch_user
WHERE view_touch_user.tenant_id=#{tenantId}
<if test="startTime != null">
and c.update_date &gt;= #{startTime}
and view_touch_user.xTime &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d')
</if>
<if test="endTime != null">
and c.update_date &lt;= #{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}
<if test="startTime != null">
and d.update_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and d.update_date &lt;= #{endTime}
</if>
)
as verifyUserCount
from wx_coupon_order
where tenant_id=#{tenantId}
<if test="startTime != null">
AND create_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and create_date &lt;= #{endTime}
and view_touch_user.xTime &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')
</if>
GROUP BY xTime
order by xTime desc


Загрузка…
Отмена
Сохранить