...
|
...
|
@@ -2,6 +2,7 @@ package com.yoho.message.sdk.service.impl; |
|
|
|
|
|
import com.yoho.message.sdk.common.constants.MiniAppTypeEnum;
|
|
|
import com.yoho.message.sdk.common.constants.OfflineShopScenes;
|
|
|
import com.yoho.message.sdk.common.constants.PromotionScenes;
|
|
|
import com.yoho.message.sdk.common.constants.PublicNumberConstants;
|
|
|
import com.yoho.message.sdk.common.handler.MessageCenterMqHandler;
|
|
|
import com.yoho.message.sdk.common.model.MessageCenterCommonEvent;
|
...
|
...
|
@@ -12,6 +13,8 @@ import com.yoho.message.sdk.utils.DateUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
import static com.yoho.message.sdk.common.constants.PublicNumberConstants.KEY_APP_ID;
|
|
|
|
|
|
@Service
|
...
|
...
|
@@ -21,20 +24,150 @@ public class OfflineShopMessageImpl extends AbstractSendMessage implements IOffl |
|
|
private MessageCenterMqHandler messageCenterMqHandler;
|
|
|
|
|
|
|
|
|
public SendMessageRspBo reserveRemineForAllFans(String activityName, int startTime, int endTime, String address, String pagePath) {
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEventPublicCode(OfflineShopScenes.RESERVE_REMIND,
|
|
|
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_SERVICE, PublicNumberConstants.ALL_FANS);
|
|
|
/**
|
|
|
* 预约提醒
|
|
|
* @param activityName 活动名称
|
|
|
* @param startTime 限定活动开始时间
|
|
|
* @param endTime 限定活动结束时间
|
|
|
* @param isAB 公众消息跳转的小程序路径
|
|
|
* @param miniPathParam 小程序页面参数
|
|
|
* @return
|
|
|
*/
|
|
|
public SendMessageRspBo reserveRemindForAllFans(String activityName, int startTime, int endTime, boolean isAB, String miniPathParam) {
|
|
|
|
|
|
messageCenterCommonEvent.putMiniprogram(PublicNumberConstants.KEY_APP_ID, MiniAppTypeEnum.OFFSHOP.getAppId());
|
|
|
messageCenterCommonEvent.putMiniprogram(PublicNumberConstants.KEY_PAGE_PATH, pagePath);
|
|
|
String scene = isAB ? OfflineShopScenes.RESERVE_REMIND_AB : OfflineShopScenes.RESERVE_REMIND_CD;
|
|
|
// 指定线下店公众号
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEventPublicCode(scene,
|
|
|
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_SERVICE, PublicNumberConstants.ALL_FANS);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("activityName",activityName);
|
|
|
messageCenterCommonEvent.putInParams("startTime", DateUtils.long2DateStr(startTime * 1000l, DateUtils.fullDateTimeFormat));
|
|
|
messageCenterCommonEvent.putInParams("endTime", DateUtils.long2DateStr(endTime * 1000l, DateUtils.fullDateTimeFormat));
|
|
|
messageCenterCommonEvent.putInParams("address",address);
|
|
|
messageCenterCommonEvent.putInParams("miniPathParam", miniPathParam);
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 实名登记提醒
|
|
|
* @param uids
|
|
|
* @param activityName
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param activityId
|
|
|
* @return
|
|
|
*/
|
|
|
public SendMessageRspBo realNameRegisterRemind(List<String> uids, String activityName, int startTime, int endTime, String activityId) {
|
|
|
// 指定线下店小程序
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(OfflineShopScenes.REALNAME_REGISTER_REMIND,
|
|
|
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_MINIPROGRAM, uids);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("activityName", activityName);
|
|
|
messageCenterCommonEvent.putInParams("registerTime",
|
|
|
DateUtils.long2DateStr(startTime * 1000l, DateUtils.fullDateTimeFormat) +
|
|
|
"-"+ DateUtils.long2DateStr(endTime * 1000l, DateUtils.fullDateTimeFormat));
|
|
|
messageCenterCommonEvent.putInParams("activityId", activityId);
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 排队成功通知
|
|
|
* @param uids
|
|
|
* @param activityName
|
|
|
* @param queueTimeStr
|
|
|
* @param registerMobile
|
|
|
* @param activityId
|
|
|
* @return
|
|
|
*/
|
|
|
public SendMessageRspBo queueSuccess(List<String> uids, String activityName, String queueTimeStr, String registerMobile, String activityId) {
|
|
|
// 指定线下店小程序
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(OfflineShopScenes.LIMIT_QUEUE_SUCCESS,
|
|
|
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_MINIPROGRAM, uids);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("activityName", activityName);
|
|
|
messageCenterCommonEvent.putInParams("queueTimeStr", queueTimeStr);
|
|
|
messageCenterCommonEvent.putInParams("registerMobile", registerMobile);
|
|
|
messageCenterCommonEvent.putInParams("activityId", activityId);
|
|
|
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 服务到期提醒
|
|
|
* @param uids
|
|
|
* @param expireCouponNum 券数量
|
|
|
* @param couponName 体验券名称
|
|
|
* @param expireTime 过期时间
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public SendMessageRspBo serviceDue(String uids, String brandName, int expireCouponNum, String couponName, int expireTime) {
|
|
|
// 指定线下店公众号
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEventPublicCode(OfflineShopScenes.COUPON_SERVICE_DUE,
|
|
|
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_SERVICE, uids);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("expireCouponNum", expireCouponNum);
|
|
|
messageCenterCommonEvent.putInParams("brandName", brandName);
|
|
|
messageCenterCommonEvent.putInParams("couponName", couponName);
|
|
|
messageCenterCommonEvent.putInParams("expireTime", DateUtils.long2DateStr(expireTime * 1000l, DateUtils.dateFormat));
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 入驻成功
|
|
|
* @param desc 后台配置内容字段
|
|
|
* @param enterTimeStr 入驻时间
|
|
|
* @param remark 后台配置温馨提示
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public SendMessageRspBo enterSuccess(String desc, String enterTimeStr, String remark) {
|
|
|
// 指定线下店公众号
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEventPublicCode(OfflineShopScenes.ENTER_SUCCESS_SHOP,
|
|
|
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_SERVICE, PublicNumberConstants.ALL_FANS);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("desc", desc);
|
|
|
messageCenterCommonEvent.putInParams("enterTimeStr", enterTimeStr);
|
|
|
messageCenterCommonEvent.putInParams("remark", remark);
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 赴约通知
|
|
|
* @param desc 后台配置内容字段值
|
|
|
* @param activityName 活动名称
|
|
|
* @param activityAddress 活动地点
|
|
|
* @param activityTime 活动时间
|
|
|
* @param appointmentPerson 赴约的人
|
|
|
* @param remark 后台配置温馨提示字段值
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public SendMessageRspBo appointmentRemind(String desc, String activityName, String activityAddress, int activityTime,
|
|
|
String appointmentPerson, String remark) {
|
|
|
// 指定线下店公众号
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEventPublicCode(OfflineShopScenes.APPOINTMENT_REMIND,
|
|
|
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_SERVICE, PublicNumberConstants.ALL_FANS);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("desc", desc);
|
|
|
messageCenterCommonEvent.putInParams("activityName", activityName);
|
|
|
messageCenterCommonEvent.putInParams("activityAddress", activityAddress);
|
|
|
messageCenterCommonEvent.putInParams("activityTime", DateUtils.long2DateStr(activityTime * 1000l, DateUtils.fullDateTimeFormat));
|
|
|
messageCenterCommonEvent.putInParams("appointmentPerson", appointmentPerson);
|
|
|
messageCenterCommonEvent.putInParams("remark", remark);
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|