|
|
package com.yohoufo.order.service.proxy;
|
|
|
|
|
|
import com.yoho.message.sdk.common.constants.UFOMessageScene;
|
|
|
import com.yoho.message.sdk.service.ufo.IUFOSendService;
|
|
|
import com.yoho.message.sdk.service.ufo.UFOMessageService;
|
|
|
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
|
|
|
import com.yohobuy.ufo.model.order.common.MsgSendFlg;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderAttributes;
|
...
|
...
|
@@ -21,6 +23,7 @@ import org.slf4j.Logger; |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.Optional;
|
|
|
import java.util.function.Supplier;
|
|
|
|
...
|
...
|
@@ -40,6 +43,9 @@ public class SellerNoticeFacade extends BaseNoticeFacade { |
|
|
@Autowired
|
|
|
FastDeliveryProxyService fastDeliveryProxyService;
|
|
|
|
|
|
@Autowired
|
|
|
private UFOMessageService ufoMessageService;
|
|
|
|
|
|
@Override
|
|
|
public Logger getLogger() {
|
|
|
return log;
|
...
|
...
|
@@ -482,4 +488,22 @@ public class SellerNoticeFacade extends BaseNoticeFacade { |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @param sog
|
|
|
* @param inbox
|
|
|
* @param sms
|
|
|
* @param push
|
|
|
* @param parameters 保持顺序
|
|
|
*/
|
|
|
public void messageNotice(SellerOrderGoods sog, InboxBusinessTypeEnum inbox, InboxBusinessTypeEnum sms, UFOMessageScene push, LinkedHashMap<String, Object> parameters) {
|
|
|
log.info("[{}] Seller Message Notice,inbox:{},sms:{},push:{}", sog.getUid(), inbox, sms, push);
|
|
|
Object[] params = parameters.values().toArray(new Object[0]);
|
|
|
newSellerNotice(sog)
|
|
|
.withLogPrefix("Seller Message Notice")
|
|
|
.withInBox(() -> buildInboxContent(inbox, parameters.values().toArray(new Object[0])))
|
|
|
.withSmsIf(sms != null, () -> buildSmsContent(sms, params))
|
|
|
.withPushIf(push != null, () -> ufoMessageService.sendMessage(String.valueOf(sog.getUid()), push, parameters))
|
|
|
.send();
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|