Authored by wujiexiang

Merge branch 'dev-detectnotpass' into hotfix-20190826

... ... @@ -637,8 +637,9 @@ public class AppraiseService {
throw new ServiceException(ServiceError.ORDER_NULL);
}
Integer oldBuyerOrderStatus = buyerOrder.getStatus();
Set<Integer> expectStatus = Sets.newHashSet(OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode(), OrderStatus.PLATFORM_DETECTION_NOT_PASS.getCode());
if (!expectStatus.contains(buyerOrder.getStatus())) {
if (!expectStatus.contains(oldBuyerOrderStatus)) {
LOGGER.warn("returnBackOrderCauseOfUnsure expectStatus {}, actual status {}, orderCode {}", expectStatus,
buyerOrder.getStatus(), orderCode);
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
... ... @@ -657,8 +658,13 @@ 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);
} else if (oldBuyerOrderStatus == OrderStatus.PLATFORM_DETECTION_NOT_PASS.getCode()) {
//检测不通过
inBoxFacade.sellerDetectionNotPass_send_back(sellerOrderGoods, orderCode, wayBillCode);
}
return apiResponse;
}
... ...
... ... @@ -711,6 +711,47 @@ public class InBoxFacade extends BaseNoticeFacade{
}
}
/**
* 检测不通过寄回,给卖家消息
*/
public void sellerDetectionNotPass_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_DETECTION_NOT_PASS_SEND_BACK;
String params = buildParams(goodsTypeTag,prdName, sizeName,productCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
log.info("record sellerDetectionNotPass_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("sellerDetectionNotPass_send_back sms send fail,sellerUid {}, prdName {}", sellerUid, prdName);
return;
}
List<String> mobileList = Arrays.asList(phone);
InboxBusinessTypeEnum sms = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_DETECTION_NOT_PASS_SEND_BACK;
String content = getReplacedContent(sms.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode,wayBillCode);
sendSmsService.smsSendByMobile(content, mobileList);
log.info("record sellerDetectionNotPass_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 noticeSellerOfSellerShamSendOut(SellerOrderGoods sog,long orderCode){
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
... ...