Authored by LUOXC

fixbug

... ... @@ -248,7 +248,7 @@ public class BuyerOrderCancelService {
// 通知卖家商品发货超时
.withNoticeSeller((soa, buyerOrder) -> sellerNoticeFacade.sellerDeliverWithTimes(soa, buyerOrder, 3, 0, null)).and()
// 通知买家卖家商品发货超时
.withNoticeBuyer(inBoxFacade::noticeBuyerOfSellerSendOutTimeout).and()
.withNoticeBuyer(buyerNoticeFacade::noticeBuyerOfSellerSendOutTimeout).and()
// 退优惠券
.withRefundCoupon(BuyerRefundCouponEvent.BizCase.SELLER_DELIVER_TIMEOUT)
.withCacheCleaner(cacheCleaner::delete)
... ...
package com.yohoufo.order.service.proxy;
import com.alibaba.fastjson.JSON;
import com.yoho.message.sdk.common.constants.UFOMessageScene;
import com.yoho.message.sdk.service.ufo.IUFOSendService;
import com.yoho.message.sdk.service.ufo.UFOMessageService;
... ... @@ -11,19 +10,14 @@ import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.inboxclient.model.InBoxResponse;
import com.yohoufo.inboxclient.model.InboxReqVO;
import com.yohoufo.order.service.impl.function.BuyerNoticeSender;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
... ... @@ -573,7 +567,7 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
/**
* 提醒买家支付成功&卖家已经发货
*
* @param sog sog
* @param sog sog
* @param buyerOrder
*/
public void buyerPaidFastDelivery(SellerOrderGoods sog, BuyerOrder buyerOrder) {
... ... @@ -591,7 +585,24 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER, goodsTypeTag, prdName, sizeName, productCode, orderCode)
.send();
} catch (Exception e) {
log.warn("buyer paid fast delivery fail, uid {}, orderCode {} ",uid, orderCode, e);
log.warn("buyer paid fast delivery fail, uid {}, orderCode {} ", uid, orderCode, e);
}
}
public void noticeBuyerOfSellerSendOutTimeout(BuyerNoticeSender.Request request) {
Integer uid = request.getUid();
Long orderCode = request.getOrderCode();
try {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
newBuyerNotice(buyerOrder)
.withLogPrefix("notice buyer of seller send out timeout")
.withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT, orderCode)
.withPush(() -> ufoSendService.sellerDeliverHours(String.valueOf(uid), String.valueOf(orderCode)))
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT, orderCode)
.send();
} catch (Exception e) {
log.warn("notice buyer of seller send out timeout fail,uid {}", uid, e);
}
}
... ...
... ... @@ -472,36 +472,6 @@ public class InBoxFacade extends BaseNoticeFacade{
public void noticeBuyerOfSellerSendOutTimeout(BuyerNoticeSender.Request request){
Integer uid = request.getUid();
Long orderCode = request.getOrderCode();
String params = buildParams(orderCode);
InboxReqVO inboxMessage = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT);
String smsContent = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT.getContent(), orderCode);
try {
log.info("noticeBuyerOfSellerSendOutTimeout,uid {} request is {}", uid, request);
executorService.execute(() -> {
InBoxResponse inBoxResponse = inBoxSDK.addInbox(inboxMessage);
log.info("noticeBuyerOfSellerSendOutTimeout inbox send success, message is {} res is {}", inboxMessage, inBoxResponse);
//发push
SendMessageRspBo bo = ufoSendService.sellerDeliverHours(String.valueOf(uid),String.valueOf(orderCode));
log.info("record noticeBuyerOfSellerSendOutTimeout push buyer uid is {}, orderCode is {}, result is {}", uid, orderCode, JSON.toJSONString(bo));
String phone = userProxyService.getMobile(uid);
if (StringUtils.isBlank(phone)) {
log.warn("noticeBuyerOfSellerSendOutTimeout sms send fail,uid {} can not find phone", uid);
return;
}
sendSmsService.smsSendByMobile(smsContent, Arrays.asList(phone));
log.info("noticeBuyerOfSellerSendOutTimeout sms send success,uid {}", uid);
});
} catch (Exception e) {
log.warn("noticeBuyerOfSellerSendOutTimeout fail,uid {}", uid, e);
}
}
... ...