Authored by qinchao

加货号

... ... @@ -182,7 +182,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
LOGGER.info("in deliverToDepot record status change, orderCode {},uid {} ,sellerUid {}", orderCode,buyerUid,sellerUid);
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetOrderStatus.getCode());
inBoxFacade.sellerDeliver2Depot(buyerUid, orderCode, psog.getProductName());
inBoxFacade.sellerDeliver2Depot(buyerUid, orderCode, psog);
//虚假发货的mq
BuyerOrderCancelShamDeliveryEvent shamDeliveryEvent = BuyerOrderCancelShamDeliveryEvent.builder().uid(buyerUid).orderCode(orderCode).build();
... ...
... ... @@ -577,7 +577,7 @@ public class SellerOrderCancelService {
.loadPaymentRequest(buyerUid,buyerOrderCode,goodsMoney)
.refund();
//异步
inBoxFacade.noticeBuyerWhenSellerCancelAfterPaid(buyerUid, buyerOrderCode, psog.getProductName());
inBoxFacade.noticeBuyerWhenSellerCancelAfterPaid(buyerUid, buyerOrderCode, psog);
inBoxFacade.sellerCancelAfterBuyerPaid( psog);
//记录状态信息
... ...
... ... @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohobuy.ufo.model.order.common.SuperEnterStageLevel;
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;
... ... @@ -44,6 +45,9 @@ public class InBoxFacade {
@Autowired
private UserProxyService userProxyService;
@Autowired
private ProductMapper productMapper;
/*********************************************************************
* 买家消息 和 短信
********************************************************************/
... ... @@ -99,12 +103,11 @@ public class InBoxFacade {
* 卖家发货后
* @param buyerUid
* @param orderCode
* @param prdName
*/
public void sellerDeliver2Depot(int buyerUid, long orderCode, String prdName){
public void sellerDeliver2Depot(int buyerUid, long orderCode,SellerOrderGoods psog ){
executorService.execute(()-> {
try {
String prdName = psog.getProductName();
InboxBusinessTypeEnum ibtOfBuyer = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_SELLER_DELIVER;
String params = buildParams(orderCode);
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibtOfBuyer);
... ... @@ -112,13 +115,17 @@ public class InBoxFacade {
logger.info("record sellerDeliver2Depot inbox msg, buyerUid {}, orderCode {}, prdName {} resp {}",
buyerUid, orderCode, prdName, resp);
String sizeName= psog.getSizeName();
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
String productCode = product.getProductCode();
//sms
String phone = userProxyService.getMobile(buyerUid);
if (StringUtils.isBlank(phone)){
logger.warn("in sellerDeliver2Depot sms fail, buyerUid {} orderCode {} prdName {} ", buyerUid, orderCode,prdName);
return;
}
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER.getContent(),prdName,orderCode);
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER.getContent(),prdName,sizeName,productCode,orderCode);
List<String> mobileList = Arrays.asList(phone);
sendSmsService.smsSendByMobile(content,mobileList);
logger.info("record sellerDeliver2Depot inbox sms msg, buyerUid {}, orderCode {}, prdName {} phone {}",
... ... @@ -126,7 +133,7 @@ public class InBoxFacade {
} catch (Exception ex) {
logger.warn("InBoxFacade depotDeliver2Buyer error inbox msg, buyerUid {}, orderCode {} ,prdName {}",
buyerUid, orderCode,prdName, ex);
buyerUid, orderCode,psog, ex);
}
});
}
... ... @@ -271,9 +278,14 @@ public class InBoxFacade {
*
* @param orderCode
*/
public void noticeBuyerWhenSellerCancelAfterPaid(int buyerUid, long orderCode,String prdName) {
public void noticeBuyerWhenSellerCancelAfterPaid(int buyerUid, long orderCode,SellerOrderGoods psog ) {
try {
executorService.execute(()->{
String prdName = psog.getProductName();
String sizeName =psog.getSizeName();
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_CLOSED_SELLER;
String params = buildParams(orderCode);
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
... ... @@ -290,9 +302,7 @@ public class InBoxFacade {
}
List<String> mobileList = Arrays.asList(phone);
//SmsContentEnum smsIbt=SmsContentEnum.SMS_CLOSED_SELLER;
//String content=smsIbt.getReplacedContent(prdName);
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_CLOSED_SELLER.getContent(),prdName,orderCode);
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_CLOSED_SELLER.getContent(),prdName,productCode,sizeName,orderCode);
sendSmsService.smsSendByMobile(content,mobileList);
logger.info("record noticeBuyerWhenSellerCancelAfterPaid inbox sms msg, buyerUid {}, orderCode {},prdName {}",
... ... @@ -300,7 +310,7 @@ public class InBoxFacade {
});
} catch (Exception e) {
logger.warn("InBoxFacade noticeBuyerWhenSellerCancelAfterPaid error inbox msg, buyerUid {}, orderCode {} prdName {}",
buyerUid, orderCode,prdName, e);
buyerUid, orderCode,psog, e);
}
}
... ... @@ -330,9 +340,11 @@ public class InBoxFacade {
* @param buyerUid
* @param orderCode
*/
public void buyerGetEarnestMoneyWhenAppraiseFail(int buyerUid, long orderCode,String prdName) {
public void buyerGetEarnestMoneyWhenAppraiseFail(int buyerUid, long orderCode,SellerOrderGoods sellerOrderGoods ) {
try {
executorService.execute(()->{
String prdName = sellerOrderGoods.getProductName();
String sizeName=sellerOrderGoods.getSizeName();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_CLOSED_PLATFORM;
String params = buildParams(orderCode);
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
... ... @@ -341,6 +353,9 @@ public class InBoxFacade {
logger.info("record buyerGetEarnestMoneyWhenAppraiseFail inbox msg, buyerUid {}, orderCode {},prdName {} resp {}",
buyerUid, orderCode,prdName, resp);
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
String productCode = product.getProductCode();
//短信
String phone = userProxyService.getMobile(buyerUid);
if (StringUtils.isBlank(phone)){
... ... @@ -348,17 +363,15 @@ public class InBoxFacade {
return;
}
List<String> mobileList = Arrays.asList(phone);
//SmsContentEnum smsIbt=SmsContentEnum.SMS_CLOSED_PLATFORM;
//String content=smsIbt.getReplacedContent(prdName);
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_CLOSED_PLATFORM.getContent(),prdName,orderCode);
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_CLOSED_PLATFORM.getContent(),prdName,sizeName,productCode,orderCode);
sendSmsService.smsSendByMobile(content,mobileList);
logger.info("record buyerGetEarnestMoneyWhenAppraiseFail inbox sms msg, buyerUid {}, orderCode {},prdName {}",
buyerUid, orderCode,prdName);
});
} catch (Exception e) {
logger.warn("InBoxFacade buyerGetEarnestMoneyWhenAppraiseFail error inbox msg, buyerUid {}, orderCode {} ,prdName {}",
buyerUid, orderCode,prdName, e);
buyerUid, orderCode,sellerOrderGoods, e);
}
}
... ... @@ -1143,8 +1156,6 @@ public class InBoxFacade {
return;
}
List<String> mobileList = Arrays.asList(phone);
//SmsContentEnum smsIbt=SmsContentEnum.SMS_CLOSED_PLATFORM;
//String content=smsIbt.getReplacedContent(prdName);
String content= getReplacedContent(InboxBusinessTypeEnum.SMS_CANCELED_BY_BUYER_AFTER_DELIVERY.getContent(),orderCode);
sendSmsService.smsSendByMobile(content,mobileList);
... ...