生日有礼定时奖励
This commit is contained in:
@@ -12,6 +12,7 @@ import lombok.experimental.Accessors;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -55,7 +56,7 @@ public class ShopUser implements Serializable {
|
||||
/**
|
||||
* 会员生日
|
||||
*/
|
||||
private String birthDay;
|
||||
private LocalDate birthDay;
|
||||
|
||||
/**
|
||||
* 0-女 1男
|
||||
|
||||
@@ -39,7 +39,7 @@ public class MkBirthdayGiftConfig implements Serializable {
|
||||
/**
|
||||
* 是否开启
|
||||
*/
|
||||
private String deliverTime;
|
||||
private Integer deliverTime;
|
||||
private String deliverDate;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -14,6 +15,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生日有礼记录 实体类。
|
||||
@@ -26,6 +28,7 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_birthday_gift_record")
|
||||
@Accessors(chain = true)
|
||||
public class MkBirthdayGiftRecord implements Serializable {
|
||||
|
||||
@Serial
|
||||
@@ -33,6 +36,7 @@ public class MkBirthdayGiftRecord implements Serializable {
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
private Long sourceId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
@@ -43,7 +47,7 @@ public class MkBirthdayGiftRecord implements Serializable {
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private Date birthday;
|
||||
private LocalDate birthday;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@@ -55,4 +59,10 @@ public class MkBirthdayGiftRecord implements Serializable {
|
||||
*/
|
||||
private Long mainShopId;
|
||||
|
||||
private String pushStatus;
|
||||
private String pushResp;
|
||||
private String templateCode;
|
||||
private String templateContent;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
@@ -25,6 +26,7 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_birthday_gift_record_coupon")
|
||||
@Accessors(chain = true)
|
||||
public class MkBirthdayGiftRecordCoupon implements Serializable {
|
||||
|
||||
@Serial
|
||||
|
||||
@@ -42,6 +42,10 @@ public class SmsShopTemplate implements Serializable {
|
||||
* 模板内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 阿里云模板code
|
||||
*/
|
||||
private String templateCode;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
|
||||
@@ -25,4 +25,6 @@ public interface MkBirthdayGiftService extends IService<MkBirthdayGift> {
|
||||
Page<MkBirthdayGiftRecordVO> getRecord(Long shopId, String key, LocalDateTime dateTime);
|
||||
|
||||
MkBirthdayGiftRecordSummaryVO summary(Long shopId, String key, LocalDateTime dateTime);
|
||||
|
||||
void deliver();
|
||||
}
|
||||
|
||||
@@ -38,4 +38,36 @@ public interface TableValueConstant {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface BirthdayGiftRecord {
|
||||
@Getter
|
||||
enum PushStatus {
|
||||
WAIT_PUSH("wait_push", "待推送"),
|
||||
NO_PUSH("no_push", "不用推送"),
|
||||
SUCCESS("success", "推送成功");
|
||||
private final String code;
|
||||
private final String msg;
|
||||
|
||||
PushStatus(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface BirthdayGiftRecordCoupon {
|
||||
@Getter
|
||||
enum Type {
|
||||
GIVE("give", "待推送"),
|
||||
CONSUME("consume", "推送成功");
|
||||
private final String code;
|
||||
private final String msg;
|
||||
|
||||
Type(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.czg.utils;
|
||||
|
||||
import cn.hutool.core.lang.func.Func0;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Slf4j
|
||||
public class FunUtils {
|
||||
/**
|
||||
* 执行方法并捕获异常
|
||||
* @param func 方法
|
||||
* @param value 失败的值
|
||||
*/
|
||||
public static <T> T safeRun(Func0<T> func, T value) {
|
||||
try {
|
||||
return func.call();
|
||||
} catch (Exception e) {
|
||||
log.warn("方法执行失败: {}", e.getMessage());
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void safeRunVoid(Runnable func, String... msg) {
|
||||
try {
|
||||
func.run();
|
||||
} catch (Exception e) {
|
||||
log.warn(msg.length > 0 ? msg[0] : "方法执行失败: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user