公众号推送
This commit is contained in:
@@ -20,6 +20,7 @@ public interface AShopUserService {
|
||||
|
||||
Page<ShopUserDTO> getPage(String key, Integer isVip, BigDecimal amount);
|
||||
Page<ShopUser> getPushEventUser(SmsPushEventUser smsPushEventUser);
|
||||
Page<ShopUser> getAcPushEventUser(SmsPushEventUser smsPushEventUser);
|
||||
|
||||
List<ShopUser> getPushEventUserList(SmsPushEventUser smsPushEventUser);
|
||||
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
|
||||
package com.czg.market.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.market.entity.SmsPushEventUser;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serial;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 公众号推送任务 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class AcPushEventDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 1 全部用户 2范围用户 3 指定用户
|
||||
*/
|
||||
private Long userType;
|
||||
|
||||
/**
|
||||
* 预计人数
|
||||
*/
|
||||
private Long estimateNum;
|
||||
|
||||
/**
|
||||
* 实际人数
|
||||
*/
|
||||
private Long actualNum;
|
||||
|
||||
/**
|
||||
* 成功人数
|
||||
*/
|
||||
private Long successNum;
|
||||
|
||||
/**
|
||||
* 指定用户时 使用
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 0待发送 1 发送中 2发送成功 -1失败
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 商家名称(客户)
|
||||
*/
|
||||
@NotBlank(message = "商家名称不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 活动描述(商品名称)
|
||||
*/
|
||||
@NotBlank(message = "活动描述不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private String activityDetail;
|
||||
|
||||
/**
|
||||
* 活动时间(发货时间)
|
||||
*/
|
||||
@NotBlank(message = "活动时间不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private String activityTime;
|
||||
|
||||
/**
|
||||
* 商家地址(收货地址)
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 赠送券信息[{"id":"268700","num":12,"title":"邀新10元优惠券"}]
|
||||
*/
|
||||
private String coupon;
|
||||
|
||||
/**
|
||||
* 发送类型 1 立即发送 2定时发送
|
||||
*/
|
||||
@NotNull(message = "发送类型不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private Integer sendType;
|
||||
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String error;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
private Integer isDel;
|
||||
|
||||
/**
|
||||
* 发送的用户信息选项
|
||||
* userType为2时 使用
|
||||
*/
|
||||
private SmsPushEventUser pushEventUser;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 公众号推送任务 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("ac_push_event")
|
||||
public class AcPushEvent implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 1 全部用户 2范围用户 3 指定用户
|
||||
*/
|
||||
private Long userType;
|
||||
|
||||
/**
|
||||
* 预计人数
|
||||
*/
|
||||
private Long estimateNum;
|
||||
|
||||
/**
|
||||
* 实际人数
|
||||
*/
|
||||
private Long actualNum;
|
||||
|
||||
/**
|
||||
* 成功人数
|
||||
*/
|
||||
private Long successNum;
|
||||
|
||||
/**
|
||||
* 指定用户时 使用
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 0待发送 1 发送中 2发送成功 -1失败
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 商家名称(客户)
|
||||
*/
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 活动描述(商品名称)
|
||||
*/
|
||||
private String activityDetail;
|
||||
|
||||
/**
|
||||
* 活动时间(发货时间)
|
||||
*/
|
||||
private String activityTime;
|
||||
|
||||
/**
|
||||
* 商家地址(收货地址)
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 赠送券信息[{"id":"268700","num":12,"title":"邀新10元优惠券"}]
|
||||
*/
|
||||
private String coupon;
|
||||
|
||||
/**
|
||||
* 发送类型 1 立即发送 2定时发送
|
||||
*/
|
||||
private Integer sendType;
|
||||
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String error;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@Column(isLogicDelete = true)
|
||||
private Integer isDel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.market.dto.AcPushEventDTO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.AcPushEvent;
|
||||
|
||||
/**
|
||||
* 公众号推送任务 服务层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
public interface AcPushEventService extends IService<AcPushEvent> {
|
||||
|
||||
/**
|
||||
* 分页查询公众号推送任务列表
|
||||
*/
|
||||
Page<AcPushEventDTO> getPushEventPage(Integer page, Integer size, Long shopId, Integer status, Long id);
|
||||
|
||||
/**
|
||||
* 添加公众号推送任务
|
||||
*/
|
||||
void addPushEvent(AcPushEventDTO param);
|
||||
|
||||
/**
|
||||
* 发送公众号推送任务中的优惠券
|
||||
*/
|
||||
void sendPushEventCoupon(String eventId);
|
||||
|
||||
/**
|
||||
* 更新公众号推送任务
|
||||
*/
|
||||
void upPushEvent(AcPushEventDTO param);
|
||||
|
||||
void deletePushEvent(Long id);
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.account.dto.QueryReceiveDto;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.vo.CouponReceiveVo;
|
||||
import com.czg.account.vo.UserCouponVo;
|
||||
import com.czg.market.dto.MkRewardCouponDTO;
|
||||
import com.czg.market.dto.MkShopCouponGiftDTO;
|
||||
import com.czg.market.dto.MkShopCouponRecordDTO;
|
||||
import com.czg.market.dto.*;
|
||||
import com.czg.market.entity.MkShopCouponRecord;
|
||||
import com.czg.market.vo.UserCouponVO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkShopCouponRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -48,13 +45,13 @@ public interface MkShopCouponRecordService extends IService<MkShopCouponRecord>
|
||||
*/
|
||||
void receiveCoupon(MkShopCouponGiftDTO giftDTO, Integer number, boolean isLimit);
|
||||
|
||||
|
||||
/**
|
||||
* 发放券 批量发放 不计限领
|
||||
* 检查优惠券状态 检查店铺ID是否存在且与发放店铺一致 检查优惠券是否失效
|
||||
* @param giftDTO 除 sourceFlowId shopUserId外 全必填 如果有 也填
|
||||
* @param number 发放数量
|
||||
* 短信/公众号 事件发送优惠券
|
||||
* 通过事件发放优惠券
|
||||
*/
|
||||
void batchReceiveCoupon(MkShopCouponGiftDTO giftDTO, Integer number, List<ShopUser> userList);
|
||||
void smsGrantCoupon(SmsPushEventDTO param);
|
||||
void acGrantCoupon(AcPushEventDTO param);
|
||||
|
||||
/**
|
||||
* 用户优惠券 失效/删除
|
||||
|
||||
Reference in New Issue
Block a user