Authored by tanling

线下店公众号

... ... @@ -62,6 +62,14 @@ public class MessageCenterCommonEvent implements Serializable{
this.miniappType = miniappType;
this.uidList = uidList;
}
public MessageCenterCommonEvent(String sendScene, String sendSceneKey, int miniappType, int publicNumberCode, List<String> uidList) {
this.sendScene = sendScene;
this.sendSceneKey = sendSceneKey;
this.miniappType = miniappType;
this.uidList = uidList;
this.publicNumberCode = publicNumberCode;
}
public MessageCenterCommonEvent() {
super();
... ...
... ... @@ -30,7 +30,6 @@ public abstract class AbstractSendMessage {
}
public MessageCenterCommonEvent genMessageCenterCommonEvent(String sendScene, String sendSceneKey, int miniappType, String uid) {
List<String> uids = Arrays.asList(uid);
... ... @@ -43,8 +42,20 @@ public abstract class AbstractSendMessage {
return new MessageCenterCommonEvent(sendScene, sendSceneKey, miniappType, uids);
}
public MessageCenterCommonEvent genMessageCenterCommonEvent(String sendScene, String sendSceneKey, int miniappType, int publicNumberCode, String uid) {
List<String> uids = Arrays.asList(uid);
// 原来用 miniappFlg = 1 or 0 来标识是否是小程序
// 为了支持多小程序,miniappType (miniappFlg=1 实际上是 miniappType=0的小程序)
// 其他的 miniappFlg = miniappType
if (miniappType == 1){
miniappType = 0;
}
return new MessageCenterCommonEvent(sendScene, sendSceneKey, miniappType, publicNumberCode, uids);
}
public MessageCenterCommonEvent genMessageCenterCommonEvent(String sendScene, String sendSceneKey, int miniappType, List<String> uids) {
public MessageCenterCommonEvent genMessageCenterCommonEvent(String sendScene, String sendSceneKey, int miniappType, int publicNumberCode, List<String> uids) {
// 原来用 miniappFlg = 1 or 0 来标识是否是小程序
// 为了支持多小程序,miniappType (miniappFlg=1 实际上是 miniappType=0的小程序)
... ... @@ -52,7 +63,9 @@ public abstract class AbstractSendMessage {
if (miniappType == 1){
miniappType = 0;
}
return new MessageCenterCommonEvent(sendScene, sendSceneKey, miniappType, uids);
MessageCenterCommonEvent messageCenterCommonEvent = new MessageCenterCommonEvent(sendScene, sendSceneKey, miniappType, uids);
messageCenterCommonEvent.setPublicNumberCode(publicNumberCode);
return messageCenterCommonEvent;
}
... ...
... ... @@ -61,12 +61,12 @@ public class OfflineShopMessageImpl extends AbstractSendMessage implements IOffl
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);
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_MINIPROGRAM, PublicNumberConstants.OFF_SHOP_SERVICE, uids);
messageCenterCommonEvent.putInParams("activityName", activityName);
messageCenterCommonEvent.putInParams("registerTime",
DateUtils.long2DateStr(startTime * 1000l, DateUtils.fullDateTimeFormat) +
"-"+ DateUtils.long2DateStr(endTime * 1000l, DateUtils.fullDateTimeFormat));
DateUtils.long2DateStr(startTime * 1000l, DateUtils.DateTimeFormat) +
"-"+ DateUtils.long2DateStr(endTime * 1000l, DateUtils.DateTimeFormat));
messageCenterCommonEvent.putInParams("activityId", activityId);
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
... ... @@ -85,7 +85,7 @@ public class OfflineShopMessageImpl extends AbstractSendMessage implements IOffl
public SendMessageRspBo queueSuccess(String uid, String activityName, String queueTimeStr, String registerMobile, String activityId) {
// 指定线下店小程序
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(OfflineShopScenes.LIMIT_QUEUE_SUCCESS,
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_MINIPROGRAM, uid);
String.valueOf(System.currentTimeMillis()), PublicNumberConstants.OFF_SHOP_MINIPROGRAM, PublicNumberConstants.OFF_SHOP_SERVICE, uid);
messageCenterCommonEvent.putInParams("activityName", activityName);
messageCenterCommonEvent.putInParams("queueTimeStr", queueTimeStr);
... ... @@ -161,7 +161,7 @@ public class OfflineShopMessageImpl extends AbstractSendMessage implements IOffl
messageCenterCommonEvent.putInParams("desc", desc);
messageCenterCommonEvent.putInParams("activityName", activityName);
messageCenterCommonEvent.putInParams("activityAddress", activityAddress);
messageCenterCommonEvent.putInParams("activityTime", DateUtils.long2DateStr(activityTime * 1000l, DateUtils.fullDateTimeFormat));
messageCenterCommonEvent.putInParams("activityTime", DateUtils.long2DateStr(activityTime * 1000l, DateUtils.DateTimeFormat));
messageCenterCommonEvent.putInParams("appointmentPerson", appointmentPerson);
messageCenterCommonEvent.putInParams("remark", remark);
... ...
... ... @@ -16,7 +16,9 @@ public final class DateUtils {
fullDateTimeFormat = "yyyy-MM-dd HH:mm:ss",
MIN_DateTimeFormat = "yyyy-MM-dd HH:mm";
MIN_DateTimeFormat = "yyyy-MM-dd HH:mm",
DateTimeFormat = "yy.MM.dd HH:mm";
public static int getCurrentTimeSeconds() {
long longTime = System.currentTimeMillis();
... ...
... ... @@ -54,11 +54,17 @@ public class TestOfflineShopMessage {
@Test
public void realNameRegisterRemind() {
List<String> uids = new ArrayList<>();
uids.add("500031806");
uids.add("500031478");
offlineShopMessage.realNameRegisterRemind(uids, "中国李宁LI-NING蝴蝶鞋2018NYFW男款线上线下同步发售!",
1517905629, 1517905629, "12");
}
@Test
public void queueSuccess() {
offlineShopMessage.queueSuccess("500031478", "中国李宁LI-NING蝴蝶鞋2018NYFW男款线上线下同步发售!",
"18.04.06 10:00-10:00", "159****0217","123");
}
... ...