Authored by qinchao

加货号

... ... @@ -94,14 +94,18 @@ public class SellerOrderPaymentService extends AbstractOrderPaymentService {
public void processAfterPay(OrderInfo orderInfo) {
logger.info("method com.yohoufo.order.service.SellerOrderPaymentService.processAfterPay in, orderInfo is {}", orderInfo);
String prdName = null;
String sizeName = null;
Integer productId = null;
int sellerUid;
SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCode(orderInfo.getOrderCode());
SellerOrderGoods sellerOrderGoods = null;
if (Objects.nonNull(sellerOrder)){
sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(sellerOrder.getSkup());
prdName = sellerOrderGoods.getProductName();
sizeName = sellerOrderGoods.getSizeName();
productId = sellerOrderGoods.getProductId();
}
inBoxFacade.sellerPaidEarnestMoney(sellerUid=orderInfo.getUid(), prdName);
inBoxFacade.sellerPaidEarnestMoney(sellerUid=orderInfo.getUid(), prdName,sizeName,productId);
cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()),
CacheKeyBuilder.sellerOrderDetailKey(sellerOrderGoods),
... ...
... ... @@ -149,8 +149,8 @@ public class SellerDownShelfTaskHandler extends AbstractSellerTaskHandler<Map<In
private void inboxNotify(int uid, Map<Integer, SkupDto> skupDtoMap) {
try {
String productName = skupDtoMap.values().iterator().next().getSellerOrderGoods().getProductName();
inBoxFacade.sellerPlaySelf(uid, productName);
SellerOrderGoods psog = skupDtoMap.values().iterator().next().getSellerOrderGoods();
inBoxFacade.sellerPlaySelf(uid, psog);
} catch (Exception ex) {
log.error("[{}-{}] exception happened when inboxNotify", uid, ex);
}
... ...
... ... @@ -404,7 +404,7 @@ public class SellerOrderCancelService {
.skup(skup);
//TODO 1. cache goods 2. async execute msg
SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
inBoxFacade.sellerPlaySelf(sellerUid, psog.getProductName());
inBoxFacade.sellerPlaySelf(sellerUid, psog);
new RefundEarnestMoneyHandler()
.loadRefundAction(payRefundService::refund)
... ... @@ -739,7 +739,7 @@ public class SellerOrderCancelService {
PayRefundBo payRefundBo = payRefundService.refund(refundReq, bleb);
logger.info("in yoho Off Shelve Cancel , refund earnestMoney finish, seller {}, order code {}, skup {}, earnestMoney {}",
sellerUid, orderCode, skup, earnestMoney);
inBoxFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog.getProductName());
inBoxFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog);
}catch (Exception ex){
logger.warn("in yoho Off Shelve Cancel, refund earnestMoney fail, seller {}, order code {}, skup {}, earnestMoney {}",
sellerUid, orderCode, skup, earnestMoney, ex);
... ...
... ... @@ -322,7 +322,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
ForkJoinTask<SellerOrderSubmitHandler.ForkJoinResult> fjt = ThreadPoolFactory.getForkJoinPool().submit(batchProcessTask);
taskList.add(fjt);
}
inBoxFacade.sellerPaidEarnestMoney(uid, ctx.getSoldProduct().getProductName());
inBoxFacade.sellerPaidEarnestMoney(uid, ctx.getSoldProduct().getProductName(),ctx.getSoldProduct().getSizeName(),ctx.getSoldProduct().getProductId());
return OrderSubmitResp.builder().build();
}
... ... @@ -402,7 +402,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
}
SkupDto skupDto = tskupMap.values().iterator().next();
SellerOrderGoods sellerOrderGoods = skupDto.getSellerOrderGoods();
inBoxFacade.sellerPlaySelf(sellerOrderGoods.getUid(), sellerOrderGoods.getProductName());
inBoxFacade.sellerPlaySelf(sellerOrderGoods.getUid(), sellerOrderGoods);
//clean cache
cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(req.getUid(), TabType.SELL.getValue()),
CacheKeyBuilder.sellerOrderDetailKey(sellerOrderGoods)
... ...
... ... @@ -308,7 +308,7 @@ public class ShoppingServiceImpl implements IShoppingService {
.uid(shoppingRequest.getUid()).orderCode(orderCode).build();
EventBusPublisher.publishEvent(notPaidNoticeEvent);
//
inBoxFacade.sellerSkupCreateOrderByBuyer(sellerUid, skup.getProductName());
inBoxFacade.sellerSkupCreateOrderByBuyer(sellerUid, skup);
}else{
logger.warn("buyer submit order ");
}
... ...
... ... @@ -241,7 +241,7 @@ public class InBoxFacade {
String sizeName = psog.getSizeName();
Integer sellerUid = psog.getUid();
InboxBusinessTypeEnum ibtOfSeller = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS;
String paramsOfSeller = buildParams(prdName, sizeName);
String paramsOfSeller = buildParams(prdName, sizeName,productCode);
InboxReqVO reqOfSeller = buildInboxReqVO(sellerUid, paramsOfSeller, ibtOfSeller);
InBoxResponse respOfSeller = inBoxSDK.addInbox(reqOfSeller);
... ... @@ -546,11 +546,16 @@ public class InBoxFacade {
* @param sellerUid
* @param prdName
*/
public void sellerPaidEarnestMoney(int sellerUid, String prdName) {
public void sellerPaidEarnestMoney(int sellerUid, String prdName,String sizeName,Integer productId) {
try {
executorService.execute(() -> {
logger.info("record sellerPaidEarnestMoney inbox in , sellerUid {}, prdName {}, sizeName {} ,productId {}",
sellerUid, prdName, sizeName,productId);
Product product = productMapper.selectByPrimaryKey(productId);
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SALE_SHELF;
String params = buildParams(prdName);
String params = buildParams(prdName,sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -558,8 +563,8 @@ public class InBoxFacade {
sellerUid, prdName, resp);
});
} catch (Exception e) {
logger.warn("InBoxFacade sellerPaidEarnestMoney error inbox msg, sellerUid {}, prdName {} ",
sellerUid, prdName, e);
logger.warn("InBoxFacade sellerPaidEarnestMoney error inbox msg, sellerUid {}, prdName {} ,productId {} ",
sellerUid, prdName,productId, e);
}
}
... ... @@ -567,13 +572,17 @@ public class InBoxFacade {
* 下架成功
*
* @param sellerUid
* @param prdName
*/
public void sellerPlaySelf(int sellerUid, String prdName) {
public void sellerPlaySelf(int sellerUid,SellerOrderGoods sellerOrderGoods) {
try {
executorService.execute(() -> {
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SALE_UNSHELF;
String params = buildParams(prdName);
String params = buildParams(prdName,sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -583,7 +592,7 @@ public class InBoxFacade {
} catch (Exception e) {
logger.warn("InBoxFacade sellerPlaySelf error inbox msg, sellerUid {}, prdName {} ",
sellerUid, prdName, e);
sellerUid, sellerOrderGoods, e);
}
}
... ... @@ -593,13 +602,17 @@ public class InBoxFacade {
* 卖家商品售出提醒,买家下单后
*
* @param sellerUid
* @param prdName
*/
public void sellerSkupCreateOrderByBuyer(int sellerUid, String prdName) {
public void sellerSkupCreateOrderByBuyer(int sellerUid, 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.SALE_SELLED;
String params = buildParams(prdName);
String params = buildParams(prdName,sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -609,7 +622,7 @@ public class InBoxFacade {
} catch (Exception e) {
logger.warn("InBoxFacade sellerSkupCreateOrderByBuyer error inbox msg, sellerUid {}, prdName {} ",
sellerUid, prdName, e);
sellerUid, psog, e);
}
}
... ... @@ -622,11 +635,13 @@ public class InBoxFacade {
String sizeName = sog.getSizeName();
try {
executorService.execute(() -> {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_MINI_FAULT_UN_ACCEPT;
if(outTimeFlag){
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_MINI_FAULT_UN_ACCEPT_OUT_TIME;
}
String params = buildParams(prdName, sizeName);
String params = buildParams(prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -644,7 +659,7 @@ public class InBoxFacade {
if(outTimeFlag){
sms = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_MINI_FAULT_UN_ACCEPT_OUT_TIME;
}
String content = getReplacedContent(sms.getContent(),prdName,orderCode);
String content = getReplacedContent(sms.getContent(),prdName,sizeName,productCode,orderCode);
sendSmsService.smsSendByMobile(content, mobileList);
logger.info("record sellerMiniFaultUnAccept inbox sms msg,sellerUid {}, prdName {},orderCode {}",
sellerUid, prdName,orderCode);
... ... @@ -665,8 +680,10 @@ public class InBoxFacade {
String sizeName = sog.getSizeName();
try {
executorService.execute(() -> {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_QUALITY_CHECK_REJECT;
String params = buildParams(prdName, sizeName);
String params = buildParams(prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -680,7 +697,7 @@ public class InBoxFacade {
return;
}
List<String> mobileList = Arrays.asList(phone);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_QUALITY_CHECK_REJECT.getContent(),prdName,orderCode);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_QUALITY_CHECK_REJECT.getContent(),prdName,sizeName,productCode,orderCode);
sendSmsService.smsSendByMobile(content, mobileList);
logger.info("record sellerQualityCheckNotPass inbox sms msg,sellerUid {}, prdName {},orderCode {}",
sellerUid, prdName,orderCode);
... ... @@ -700,8 +717,10 @@ public class InBoxFacade {
String sizeName = sog.getSizeName();
try {
executorService.execute(() -> {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_EXPRESS_QUALITY_CHECK_REJECT;
String params = buildParams(prdName, sizeName);
String params = buildParams(prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -721,7 +740,7 @@ public class InBoxFacade {
}else if(type==3){
sms = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_EXPRESS_MINI_FAULT_UN_ACCEPT_OUT_TIME;
}
String content = getReplacedContent(sms.getContent(),prdName,orderCode,wayBillCode);
String content = getReplacedContent(sms.getContent(),prdName,sizeName,productCode,orderCode,wayBillCode);
sendSmsService.smsSendByMobile(content, mobileList);
logger.info("record sellerQualityCheckNotPass_send_back inbox sms msg,sellerUid {}, prdName {},type {},orderCode {}",
sellerUid, prdName,type,orderCode);
... ... @@ -745,9 +764,11 @@ public class InBoxFacade {
String sizeName = sog.getSizeName();
try {
executorService.execute(() -> {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SALE_SEND;
String timelimitDesc = new StringBuilder().append(deliveryTimeLimit).append(unit).toString();
String params = buildParams(prdName, sizeName, timelimitDesc);
String params = buildParams(prdName, sizeName,productCode, timelimitDesc);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -762,7 +783,7 @@ public class InBoxFacade {
return;
}
List<String> mobileList = Arrays.asList(phone);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND.getContent(),prdName,orderCode,timelimitDesc);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND.getContent(),prdName,orderCode,productCode,timelimitDesc);
sendSmsService.smsSendByMobile(content, mobileList);
logger.info("record sellerSkupPaidByBuyer inbox sms msg,sellerUid {}, prdName {},orderCode {} timelimitDesc {}",
sellerUid, prdName,orderCode, timelimitDesc);
... ... @@ -785,9 +806,11 @@ public class InBoxFacade {
String sizeName = sog.getSizeName();
try {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
executorService.execute(() -> {
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SALE_CLOSED_SELLER;
String params = buildParams(prdName, sizeName);
String params = buildParams(prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -851,8 +874,10 @@ public class InBoxFacade {
String sizeName = sog.getSizeName();
try {
executorService.execute(() -> {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SALE_CLOSED_PLATFORM;
String params = buildParams(prdName, sizeName);
String params = buildParams(prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -867,7 +892,7 @@ public class InBoxFacade {
return;
}
List<String> mobileList = Arrays.asList(phone);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_CLOSED_PLATFORM.getContent(),prdName,orderCode,wayBillCode);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_CLOSED_PLATFORM.getContent(),prdName,sizeName,productCode,orderCode,wayBillCode);
sendSmsService.smsSendByMobile(content, mobileList);
logger.info("record noticeSellerWhenAppraiseFail sms send,sellerUid {}, prdName {},orderCode {},wayBillCode {} ",
sellerUid, prdName,orderCode,wayBillCode);
... ... @@ -885,13 +910,16 @@ public class InBoxFacade {
* 商品下架提醒,
*
* @param sellerUid
* @param prdName
*/
public void notifyUnshelfCauseBySpecialReason(int sellerUid, String prdName) {
public void notifyUnshelfCauseBySpecialReason(int sellerUid,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.SALE_NOTIFIED_UNSHELF;
String params = buildParams(prdName);
String params = buildParams(prdName,sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
... ... @@ -905,17 +933,15 @@ public class InBoxFacade {
return;
}
List<String> mobileList = Arrays.asList(phone);
//SmsContentEnum smsIbt = SmsContentEnum.SMS_NOTIFIED_UNSHELF;
//String content = smsIbt.getReplacedContent(prdName);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTIFIED_UNSHELF.getContent(),prdName);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTIFIED_UNSHELF.getContent(),prdName,sizeName,productCode);
sendSmsService.smsSendByMobile(content, mobileList);
logger.info("record notifyUnshelfCauseBySpecialReason inbox sms msg,sellerUid {}, prdName {}, resp {}",
sellerUid, prdName);
});
} catch (Exception e) {
logger.warn("InBoxFacade notifyUnshelfCauseBySpecialReason error inbox msg, sellerUid {}, prdName {} ",
sellerUid, prdName, e);
logger.warn("InBoxFacade notifyUnshelfCauseBySpecialReason error inbox msg, sellerUid {}, psog {} ",
sellerUid, psog, e);
}
}
... ... @@ -1017,7 +1043,9 @@ public class InBoxFacade {
executorService.execute(() -> {
// 发站内信
logger.info("record seller sham send out inbox sms msg for seller,sellerUid {}, prdName {}", sellerUid, prdName);
String params = buildParams(prdName, sizeName);
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
String params = buildParams(prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, InboxBusinessTypeEnum.NOTICE_SELLER_SELLER_SHAM_SEND_OUT);
InBoxResponse resp = inBoxSDK.addInbox(req);
logger.info("record seller sham send out inbox msg,sellerUid {}, prdName {},sizeName {} resp {}",
... ... @@ -1029,7 +1057,7 @@ public class InBoxFacade {
return;
}
List<String> mobileList = Arrays.asList(phone);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_SELLER_SHAM_SEND_OUT.getContent(),prdName,orderCode);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_SELLER_SHAM_SEND_OUT.getContent(),prdName,sizeName,productCode);
sendSmsService.smsSendByMobile(content, mobileList);
logger.info("seller sham send out msg,sellerUid {}, prdName {}", sellerUid, prdName);
});
... ... @@ -1098,17 +1126,19 @@ public class InBoxFacade {
InboxBusinessTypeEnum smsInboxBusinessTypeEnum;
String params ;
String content;
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
try {
if (times == 2) {
params = buildParams(prdName, sizeName, leftTime, timeUnit);
params = buildParams(prdName, sizeName,productCode, leftTime, timeUnit);
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_DELIVER_GOODS;
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_NOTIFIED_SEND_SECOND;
content = getReplacedContent(smsInboxBusinessTypeEnum.getContent(),prdName,leftTime,timeUnit,orderCode);
content = getReplacedContent(smsInboxBusinessTypeEnum.getContent(),prdName,sizeName,productCode,leftTime,timeUnit,orderCode);
} else if (times == 3) {
params = buildParams(prdName, sizeName);
params = buildParams(prdName, sizeName,productCode);
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_DELIVER_GOODS_FAIL;
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_NOTIFIED_SEND_FAILED;
content = getReplacedContent(smsInboxBusinessTypeEnum.getContent(),prdName,orderCode);
content = getReplacedContent(smsInboxBusinessTypeEnum.getContent(),prdName,sizeName,productCode,orderCode);
} else {
return;
}
... ... @@ -1144,6 +1174,9 @@ public class InBoxFacade {
String sizeName = sog.getSizeName();
try {
executorService.execute(()->{
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_CLOSED_BY_BUYER_AFTER_DELIVERY;
String params = buildParams(orderCode,compesant);
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
... ... @@ -1153,7 +1186,7 @@ public class InBoxFacade {
buyerUid, orderCode,prdName, resp);
//seller
InboxBusinessTypeEnum ibtOfSeller = InboxBusinessTypeEnum.SALE_CLOSED_BY_BUYER_AFTER_DELIVERY;
String paramsOfSeller = buildParams(prdName, sizeName);
String paramsOfSeller = buildParams(prdName, sizeName,productCode);
InboxReqVO reqOfSeller = buildInboxReqVO(sellerUid, paramsOfSeller, ibtOfSeller);
InBoxResponse respOfSeller = inBoxSDK.addInbox(reqOfSeller);
logger.info("record buyerCancelBeforeDepotReceive to seller inbox msg, sellerUid {}, orderCode {},prdName {} resp {}",
... ...