Authored by LUOXC

fixbug

... ... @@ -267,7 +267,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
int ts = DateUtil.getCurrentTimeSecond();
int deliveryHours = deliveryMinutesService.getDeliverMinutesThird_hours(ts);//把分钟转小时
String unit = DateUtil.UNIT_HOURS;
inBoxFacade.sellerSkupPaidByBuyer(sellerOrderGoods,orderCode,deliveryHours, unit);
sellerNoticeFacade.sellerSkupPaidByBuyer(sellerOrderGoods,orderCode,deliveryHours, unit);
//离发货截止12小时提醒
DeliverNoticeEvent deliverNoticeEvent = DeliverNoticeEvent.builder().skup(sellerOrderGoods.getId())
... ... @@ -299,7 +299,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
int ts = DateUtil.getCurrentTimeSecond();
int deliveryTime = deliveryMinutesService.getDeliverOverSeasDay();
String unit = DateUtil.UNIT_DAYS;
inBoxFacade.sellerOverSeasSkupPaidByBuyer(sellerOrderGoods,orderCode,deliveryTime, unit);
sellerNoticeFacade.sellerOverSeasSkupPaidByBuyer(sellerOrderGoods,orderCode,deliveryTime, unit);
//离发货截止12小时提醒
DeliverNoticeEvent deliverNoticeEvent = DeliverNoticeEvent.builder().skup(sellerOrderGoods.getId())
... ... @@ -332,7 +332,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
TimeUnit tu = acr.getTimeUnit();
int dtl = acr.getMin();
String unit = TimeUnit.HOURS.equals(tu) ? DateUtil.UNIT_HOURS : DateUtil.UNIT_DAYS;
inBoxFacade.sellerSkupPaidByBuyer(sellerOrderGoods, orderCode, dtl, unit);
sellerNoticeFacade.sellerSkupPaidByBuyer(sellerOrderGoods, orderCode, dtl, unit);
buyerNoticeFacade.buyerFinishPaid(orderInfo, dtl, unit);
// 记录此订单的发货超时时间期限点
... ...
... ... @@ -527,7 +527,7 @@ public class AppraiseService {
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
//发送消息
inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid,orderCode, sellerOrderGoods,wayBillCode);
sellerNoticeFacade.sendCancelledProductToSellerByCenter(sellerUid,orderCode, sellerOrderGoods,wayBillCode);
return apiResponse;
... ... @@ -692,7 +692,7 @@ public class AppraiseService {
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
if (oldBuyerOrderStatus == OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()) {
//无法鉴定
inBoxFacade.sellerAppraiseUnsure_send_back(sellerOrderGoods, orderCode, wayBillCode);
sellerNoticeFacade.sellerAppraiseUnsureSendBack(sellerOrderGoods, orderCode, wayBillCode);
} else if (oldBuyerOrderStatus == OrderStatus.PLATFORM_DETECTION_NOT_PASS.getCode()) {
//检测不通过
sellerNoticeFacade.sellerDetectionNotPassSendBack(sellerOrderGoods, orderCode, wayBillCode);
... ... @@ -1053,7 +1053,7 @@ public class AppraiseService {
//TODO 消息
//鉴定不通过 ,其余的情况不发消息,改成寄回的时候再发消息
inBoxFacade.noticeSellerWhenAppraiseFail(sellerOrderGoods, orderCode, wayBillCode);
sellerNoticeFacade.noticeSellerWhenAppraiseFail(sellerOrderGoods, orderCode, wayBillCode);
buyerNoticeFacade.appraiseFail(buyerOrder, sellerOrderGoods);
} catch (Exception ex) {
... ...
... ... @@ -90,66 +90,6 @@ public class InBoxFacade extends BaseNoticeFacade{
return log;
}
/**
* 卖家发货提醒,买家支付购买后
*
* @param sog
*/
public void sellerSkupPaidByBuyer(SellerOrderGoods sog, long orderCode, int deliveryTimeLimit, String unit) {
String logPrefix = "seller skup paid by buyer";
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
try {
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
String timelimitDesc = new StringBuilder().append(deliveryTimeLimit).append(unit).toString();
newSellerNotice(sog)
.withLogPrefix(logPrefix)
.withInBox(InboxBusinessTypeEnum.SALE_SEND, goodsTypeTag,prdName, sizeName,productCode, timelimitDesc)
.withPush(()->ufoSendService.sellerGoodsSend(String.valueOf(sellerUid),String.valueOf(orderCode),prdName,sizeName,productCode,timelimitDesc))
.withSms(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND,goodsTypeTag,prdName,sizeName,productCode,orderCode,timelimitDesc)
.send();
} catch (Exception e) {
log.warn("{} fail, sellerUid {}, prdName {} ", logPrefix,sellerUid, prdName, e);
}
}
public void sellerOverSeasSkupPaidByBuyer(SellerOrderGoods sog, long orderCode, int deliveryTimeLimit, String unit) {
String logPrefix = "seller overseas skup paid by buyer";
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
try {
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
String timelimitDesc = new StringBuilder().append(deliveryTimeLimit).append(unit).toString();
newSellerNotice(sog)
.withLogPrefix(logPrefix)
.withInBox(InboxBusinessTypeEnum.SALE_SEND, goodsTypeTag,prdName, sizeName,productCode, timelimitDesc)
.withPush(()->ufoSendService.sellerGoodsSend(String.valueOf(sellerUid),String.valueOf(orderCode),prdName,sizeName,productCode,timelimitDesc))
.withSms(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND,goodsTypeTag,prdName,sizeName,productCode,orderCode,timelimitDesc)
.send();
} catch (Exception e) {
log.warn("{} fail, sellerUid {}, prdName {} ", logPrefix,sellerUid, prdName, e);
}
}
/**
* 鉴定结束发货,发送站内信和短信
* @param uid
... ... @@ -159,7 +99,6 @@ public class InBoxFacade extends BaseNoticeFacade{
*/
public void sendInboxSmsWhenAppraiseFinished(InboxBusinessTypeEnum inbox, InboxBusinessTypeEnum sms,
int uid, String prdName, String productCode,String wayBillCode){
try {
executorService.execute(() -> {
String params = buildParams(prdName, productCode);
... ... @@ -217,51 +156,6 @@ public class InBoxFacade extends BaseNoticeFacade{
}
/**
* 交易关闭:订单生成,平台鉴定不通过
*
* @param sog
*/
public void noticeSellerWhenAppraiseFail(SellerOrderGoods sog,long orderCode ,String wayBillCode) {
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
try {
executorService.execute(() -> {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SALE_CLOSED_PLATFORM;
String params = buildParams(goodsTypeTag,prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
log.info("record noticeSellerWhenAppraiseFail inbox msg, SellerOrderGoods {} sellerUid {}, prdName {} orderCode {},wayBillCode {} resp {}",
JSON.toJSONString(sog), sellerUid, prdName,orderCode ,wayBillCode, resp);
//短信
String phone = userProxyService.getMobile(sellerUid);
if (StringUtils.isBlank(phone)){
log.warn("record noticeSellerWhenAppraiseFail sms send fail cause of empty phone number,sellerUid {}, prdName {} ,wayBillCode {}", sellerUid, prdName,wayBillCode);
return;
}
List<String> mobileList = Arrays.asList(phone);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_CLOSED_PLATFORM.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode,wayBillCode);
sendSmsService.smsSendByMobile(content, mobileList);
log.info("record noticeSellerWhenAppraiseFail sms send,sellerUid {}, prdName {},orderCode {},wayBillCode {} ",
sellerUid, prdName,orderCode,wayBillCode);
});
} catch (Exception e) {
log.warn("InBoxFacade noticeSellerWhenAppraiseFail error inbox msg, sellerUid {}, prdName {} ",
sellerUid, prdName, e);
}
}
/**
* 更低的出价提醒
* @param sog
*/
... ... @@ -307,101 +201,6 @@ public class InBoxFacade extends BaseNoticeFacade{
}
}
/**
* 鉴定中心把 买家取消(卖家已发货给中心)的物品,顺丰到付寄给卖家
*/
public void sendCancelledProductToSellerByCenter(int sellerUid,Long orderCode,SellerOrderGoods sog,String wayBillCode){
try {
executorService.execute(() -> {
log.info("record sendCancelledProductToSeller inbox sms msg,sellerUid {},orderCode {},sellerOrderGoods {}, wayBillCode {}",
sellerUid, orderCode,sog,wayBillCode);
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
//消息
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_EXPRESS_CANCELLED_BY_BUYER_AFTER_DELIVERY;
String params = buildParams(goodsTypeTag,prdName,sizeName,productCode,wayBillCode);
InboxReqVO inBoxReq = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(inBoxReq);
log.info("InBoxFacade sendCancelledProductToSeller inbox msg, sellerUid {},orderCode {},sellerOrderGoods {}, wayBillCode {},resp {}",
sellerUid, orderCode,sog,wayBillCode,resp);
//短信
String phone = userProxyService.getMobile(sellerUid);
log.info("sendCancelledProductToSeller wayBillCode sms send get phone {},sellerUid {}, wayBillCode {}",
phone,sellerUid,wayBillCode);
if (StringUtils.isBlank(phone)){
log.warn("sendCancelledProductToSeller wayBillCode sms send fail cause of phone blank,sellerUid {}, wayBillCode {}",
sellerUid,wayBillCode);
return;
}
List<String> mobileList = Arrays.asList(phone);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_CANCELED_BY_BUYER_AFTER_RECEIVED.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode,wayBillCode);
sendSmsService.smsSendByMobile(content, mobileList);
log.info("record sendCancelledProductToSeller inbox sms msg end,sellerUid {}, wayBillCode {}, phone {},",
sellerUid, wayBillCode, phone);
});
} catch (Exception e) {
log.warn("InBoxFacade sendCancelledProductToSeller error inbox msg, sellerUid {}, wayBillCode {} ",
sellerUid, wayBillCode, e);
}
}
/**
* 无法鉴定寄回,给卖家消息
*/
public void sellerAppraiseUnsure_send_back(SellerOrderGoods sog,long orderCode,String wayBillCode) {
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
try {
executorService.execute(() -> {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_UNSURE_SEND_BACK;
String params = buildParams(goodsTypeTag,prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
log.info("record sellerAppraiseUnsure_send_back inbox msg, SellerOrderGoods {} ,sellerUid {}, prdName {}, sizeName {}, resp {}",
JSON.toJSONString(sog),sellerUid, prdName, sizeName , resp);
//短信
String phone = userProxyService.getMobile(sellerUid);
if (StringUtils.isBlank(phone)){
log.warn("sellerAppraiseUnsure_send_back sms send fail,sellerUid {}, prdName {}", sellerUid, prdName);
return;
}
List<String> mobileList = Arrays.asList(phone);
InboxBusinessTypeEnum sms = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_UNSURE_SEND_BACK;
String content = getReplacedContent(sms.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode,wayBillCode);
sendSmsService.smsSendByMobile(content, mobileList);
log.info("record sellerAppraiseUnsure_send_back inbox sms msg,sellerUid {}, prdName {},orderCode {}",
sellerUid, prdName,orderCode);
});
} catch (Exception e) {
log.warn("InBoxFacade sellerAppraiseUnsure_send_back error inbox msg, sellerUid {}, prdName {} ",
sellerUid, prdName, e);
}
}
public void buyerCancelBeforeDepotReceive(@NonNull BuyerOrder buyerOrder, String compesant, SellerOrderGoods sog, boolean useDepositGoods) {
buyerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, compesant, sog);
sellerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, sog, useDepositGoods);
... ... @@ -685,8 +484,7 @@ public class InBoxFacade extends BaseNoticeFacade{
}
}
public void sendMessageWhenChangeOwner(Integer ownerUid,Long orderCode,
SellerOrderGoods sellerOrderGoods){
InboxBusinessTypeEnum inboxType = InboxBusinessTypeEnum.NOTICE_BUYER_DEPOSIT_IN_STORAGE;
... ... @@ -709,9 +507,6 @@ public class InBoxFacade extends BaseNoticeFacade{
}
public void paidAppraiseOrderDeliverBackNotice(int uid,long orderCode, String expressNumber, AppraiseOrderStatus targetStatus){
log.info("enter paidAppraiseOrderDeliverBackNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus);
try {
... ...
... ... @@ -791,4 +791,116 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
}
}
/**
* 卖家发货提醒,买家支付购买后
*
* @param sog
*/
public void sellerSkupPaidByBuyer(SellerOrderGoods sog, long orderCode, int deliveryTimeLimit, String unit) {
String logPrefix = "seller skup paid by buyer";
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
try {
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
String timelimitDesc = new StringBuilder().append(deliveryTimeLimit).append(unit).toString();
newSellerNotice(sog)
.withLogPrefix(logPrefix)
.withInBox(InboxBusinessTypeEnum.SALE_SEND, goodsTypeTag, prdName, sizeName, productCode, timelimitDesc)
.withPush(() -> ufoSendService.sellerGoodsSend(String.valueOf(sellerUid), String.valueOf(orderCode), prdName, sizeName, productCode, timelimitDesc))
.withSms(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND, goodsTypeTag, prdName, sizeName, productCode, orderCode, timelimitDesc)
.send();
} catch (Exception e) {
log.warn("{} fail, sellerUid {}, prdName {} ", logPrefix, sellerUid, prdName, e);
}
}
public void sellerOverSeasSkupPaidByBuyer(SellerOrderGoods sog, long orderCode, int deliveryTimeLimit, String unit) {
String logPrefix = "seller overseas skup paid by buyer";
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
try {
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
String timelimitDesc = new StringBuilder().append(deliveryTimeLimit).append(unit).toString();
newSellerNotice(sog)
.withLogPrefix(logPrefix)
.withInBox(InboxBusinessTypeEnum.SALE_SEND, goodsTypeTag, prdName, sizeName, productCode, timelimitDesc)
.withPush(() -> ufoSendService.sellerGoodsSend(String.valueOf(sellerUid), String.valueOf(orderCode), prdName, sizeName, productCode, timelimitDesc))
.withSms(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND, goodsTypeTag, prdName, sizeName, productCode, orderCode, timelimitDesc)
.send();
} catch (Exception e) {
log.warn("{} fail, sellerUid {}, prdName {} ", logPrefix, sellerUid, prdName, e);
}
}
/**
* 交易关闭:订单生成,平台鉴定不通过
*
* @param sog
*/
public void noticeSellerWhenAppraiseFail(SellerOrderGoods sog, long orderCode, String wayBillCode) {
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
try {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
newSellerNotice(sog)
.withLogPrefix("notice seller when appraise fail")
.withInBox(InboxBusinessTypeEnum.SALE_CLOSED_PLATFORM, goodsTypeTag, prdName, sizeName, productCode)
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_CLOSED_PLATFORM, goodsTypeTag, prdName, sizeName, productCode, orderCode, wayBillCode)
.send();
} catch (Exception e) {
log.warn("notice seller when appraise fail fail, sellerUid {}, prdName {} ", sellerUid, prdName, e);
}
}
/**
* 鉴定中心把 买家取消(卖家已发货给中心)的物品,顺丰到付寄给卖家
*/
public void sendCancelledProductToSellerByCenter(int sellerUid, Long orderCode, SellerOrderGoods sog, String wayBillCode) {
try {
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
newSellerNotice(sog)
.withLogPrefix("notice send cancelled product to seller by center")
.withInBox(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_EXPRESS_CANCELLED_BY_BUYER_AFTER_DELIVERY, goodsTypeTag, prdName, sizeName, productCode, wayBillCode)
.withSms(InboxBusinessTypeEnum.SMS_CANCELED_BY_BUYER_AFTER_RECEIVED, goodsTypeTag, prdName, sizeName, productCode, orderCode, wayBillCode)
.send();
} catch (Exception e) {
log.warn("notice send cancelled product to seller by center fail, sellerUid {}, wayBillCode {} ", sellerUid, wayBillCode, e);
}
}
/**
* 无法鉴定寄回,给卖家消息
*/
public void sellerAppraiseUnsureSendBack(SellerOrderGoods sog, long orderCode, String wayBillCode) {
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
try {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_UNSURE_SEND_BACK;
newSellerNotice(sog)
.withLogPrefix("notice seller appraise unsure send back")
.withInBox(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_UNSURE_SEND_BACK, goodsTypeTag, prdName, sizeName, productCode)
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_UNSURE_SEND_BACK, goodsTypeTag, prdName, sizeName, productCode, orderCode, wayBillCode)
.send();
} catch (Exception e) {
log.warn("notice seller appraise unsure send back fail, sellerUid {}, prdName {} ", sellerUid, prdName, e);
}
}
}
... ...