Commit de331684 by 章家宝

feat:【优惠券需求】优惠券活动代码分页查询

1 parent 50d06f8a
......@@ -163,6 +163,7 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity,
ca.send_notification AS sendNotification,
ca.remark AS remark,
ca.update_time AS updateTime,
ca.template_id AS templateId,
COUNT(DISTINCT cdr.coupon_id) AS totalGrantCount,
COUNT(DISTINCT cvr.coupon_id) AS usedCount,
CASE
......@@ -182,7 +183,7 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity,
ca.id, ca.activity_id, ca.activity_name, ca.valid_start_time,
ca.valid_end_time, ca.activity_type, ca.target_type,
ca.distribution_quantity, ca.status, ca.create_time,
ca.send_notification, ca.remark, ca.update_time
ca.send_notification, ca.remark, ca.update_time, ca.template_id
ORDER BY
CASE WHEN :sortField = 'writeOffRate' AND :sortOrder = 'ASC' THEN
ROUND(COUNT(DISTINCT cvr.coupon_id) / COUNT(DISTINCT cdr.coupon_id) * 100, 2) END ASC,
......
......@@ -4,7 +4,7 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 优惠券活动统计DTO(小驼峰·纯数字·新增字段)
* 优惠券活动统计DTO(小驼峰·纯数字·完整版)
*/
public interface CouponActivityStatDTO {
Long getId();
......@@ -20,6 +20,8 @@ public interface CouponActivityStatDTO {
Integer getSendNotification();
String getRemark();
LocalDateTime getUpdateTime();
Long getTemplateId(); // 补充模板ID
// 统计字段
Long getTotalGrantCount();
Long getUsedCount();
BigDecimal getWriteOffRate();
......
......@@ -348,6 +348,7 @@ public class CouponActivityService {
vo.setUpdateTime(dto.getUpdateTime());
vo.setCreateTime(dto.getCreateTime());
vo.setTotalGrantCount(dto.getTotalGrantCount());
vo.setTemplateId(dto.getTemplateId());
vo.setUsedCount(dto.getUsedCount());
vo.setWriteOffRate(dto.getWriteOffRate());
return vo;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!