Authored by LUOXC

fixbug

... ... @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rabbitmq.YhConsumer;
import com.yohobuy.ufo.model.promotion.response.CrmCouponSendResultBean;
import com.yohoufo.order.service.impl.function.BuyerNoticeSender;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.BuyerNoticeFacade;
import com.yohoufo.order.utils.LoggerUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -22,7 +22,7 @@ public class BuyerCouponSendResultForAppraiseUnsureConsumer implements YhConsume
private Logger logger = LoggerUtils.getMqConsumerLogger();
@Autowired
private InBoxFacade inBoxFacade;
private BuyerNoticeFacade buyerNoticeFacade;
@Override
public void handleMessage(Object o) throws Exception {
... ... @@ -45,7 +45,7 @@ public class BuyerCouponSendResultForAppraiseUnsureConsumer implements YhConsume
throw new RuntimeException("parse message params result is null");
}
// 通知买家商品无法鉴定
inBoxFacade.noticeBuyerAppraiseUnsure(request);
buyerNoticeFacade.noticeBuyerAppraiseUnsure(request);
} catch (Exception e) {
logger.info("BuyerCouponSendResultForAppraiseUnsureConsumer fail receive msg:{}", o, e);
}
... ...
... ... @@ -1841,7 +1841,7 @@ public class AppraiseService {
* @param request
*/
private void noticeBuyerDetectNotPass(BuyerNoticeSender.Request request) {
inBoxFacade.noticeBuyerDetectNotPass(request);
buyerNoticeFacade.noticeBuyerDetectNotPass(request);
}
/**
... ...
... ... @@ -42,6 +42,7 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
public Logger getLogger() {
return log;
}
/**
* 买家订单未付款
*
... ... @@ -61,10 +62,11 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
/**
* 鉴定订单
*
* @param uid
* @param orderCode
*/
public void sellerDepositOrderNotPaidNotice(int uid, long orderCode){
public void sellerDepositOrderNotPaidNotice(int uid, long orderCode) {
log.info("sellerDepositOrderNotPaidNotice uid {} orderCode {}", uid, orderCode);
newNotice(uid)
.withLogPrefix("notice seller DepositOrder not paid")
... ... @@ -483,7 +485,6 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
/**
*
* @param buyerOrder
* @param inbox
* @param sms
... ... @@ -520,4 +521,48 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
}
/**
* 通知买家商品无法鉴定
*
* @param request
*/
public void noticeBuyerAppraiseUnsure(@NonNull BuyerNoticeSender.Request request) {
String logPrefix = "notice buyer appraise unsure";
Integer uid = request.getUid();
Long orderCode = request.getOrderCode();
try {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
newBuyerNotice(buyerOrder)
.withLogPrefix(logPrefix)
.withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_APPRAISE_UNSURE, orderCode)
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_APPRAISE_UNSURE, orderCode)
.withPush(() -> ufoSendService.identifyFail(String.valueOf(uid), String.valueOf(orderCode)))
.send();
} catch (Exception e) {
log.warn("{} fail,uid {}", logPrefix, uid, e);
}
}
/**
* 通知买家商品无法鉴定
*
* @param request
*/
public void noticeBuyerDetectNotPass(@NonNull BuyerNoticeSender.Request request) {
String logPrefix = "notice buyer detect not pass";
Integer uid = request.getUid();
Long orderCode = request.getOrderCode();
try {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
newBuyerNotice(buyerOrder)
.withLogPrefix(logPrefix)
.withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DETECTION_NOT_PASS, orderCode)
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DETECTION_NOT_PASS, orderCode)
.send();
} catch (Exception e) {
log.warn("{} fail,uid {}", logPrefix, uid, e);
}
}
}
... ...
... ... @@ -706,70 +706,10 @@ public class InBoxFacade extends BaseNoticeFacade{
}
}
/**
* 通知买家商品无法鉴定
* @param request
*/
public void noticeBuyerAppraiseUnsure(@NonNull BuyerNoticeSender.Request request){
Integer uid = request.getUid();
Long orderCode = request.getOrderCode();
String params = buildParams(orderCode);
InboxReqVO inboxMessage = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_APPRAISE_UNSURE);
String smsContent = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_APPRAISE_UNSURE.getContent(), orderCode);
try {
log.info("noticeBuyerAppraiseUnsure,uid {} request is {}", uid, request);
executorService.execute(() -> {
InBoxResponse inBoxResponse = inBoxSDK.addInbox(inboxMessage);
log.info("noticeBuyerAppraiseUnsure inbox send success, message is {} res is {}", inboxMessage, inBoxResponse);
//发push
SendMessageRspBo bo = ufoSendService.identifyFail(String.valueOf(uid),String.valueOf(orderCode));
log.info("noticeBuyerAppraiseUnsure push buyer uid is {}, orderCode is {}, result is {}", uid, orderCode, JSON.toJSONString(bo));
//sms
String phone = userProxyService.getMobile(uid);
if (StringUtils.isBlank(phone)) {
log.warn("noticeBuyerAppraiseUnsure sms send fail,uid {} can not find phone", uid);
return;
}
sendSmsService.smsSendByMobile(smsContent, Arrays.asList(phone));
log.info("noticeBuyerAppraiseUnsure sms send success,uid {}", uid);
});
} catch (Exception e) {
log.warn("noticeBuyerAppraiseUnsure fail,uid {}", uid, e);
}
}
/**
* 通知买家商品无法鉴定
* @param request
*/
public void noticeBuyerDetectNotPass(@NonNull BuyerNoticeSender.Request request){
Integer uid = request.getUid();
Long orderCode = request.getOrderCode();
String params = buildParams(orderCode);
InboxReqVO inboxMessage = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DETECTION_NOT_PASS);
String smsContent = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DETECTION_NOT_PASS.getContent(), orderCode);
try {
log.info("noticeBuyerDetectNotPass,uid {} request is {}", uid, request);
executorService.execute(() -> {
InBoxResponse inBoxResponse = inBoxSDK.addInbox(inboxMessage);
log.info("noticeBuyerDetectNotPass inbox send success, message is {} res is {}", inboxMessage, inBoxResponse);
//sms
String phone = userProxyService.getMobile(uid);
if (StringUtils.isBlank(phone)) {
log.warn("noticeBuyerDetectNotPass sms send fail,uid {} can not find phone", uid);
return;
}
sendSmsService.smsSendByMobile(smsContent, Arrays.asList(phone));
log.info("noticeBuyerDetectNotPass sms send success,uid {}", uid);
});
} catch (Exception e) {
log.warn("noticeBuyerDetectNotPass fail,uid {}", uid, e);
}
}
public void buyerCancelBeforeDepotReceive(@NonNull BuyerOrder buyerOrder, String compesant, SellerOrderGoods sog, boolean useDepositGoods) {
buyerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, compesant, sog);
... ...