|
|
package com.yohoufo.product.service;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ArrayBlockingQueue;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.slf4j.helpers.MessageFormatter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.service.model.response.ProfileInfoRsp;
|
|
|
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
|
...
|
...
|
@@ -25,11 +9,28 @@ import com.yohoufo.dal.order.BuyerOrderGoodsMapper; |
|
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrderGoods;
|
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.dal.product.ProductMapper;
|
|
|
import com.yohoufo.dal.product.model.Product;
|
|
|
import com.yohoufo.dal.user.IInBoxAttrDao;
|
|
|
import com.yohoufo.dal.user.model.InBoxAttr;
|
|
|
import com.yohoufo.inboxclient.model.InBoxResponse;
|
|
|
import com.yohoufo.inboxclient.model.InboxReqVO;
|
|
|
import com.yohoufo.inboxclient.sdk.InBoxSDK;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.slf4j.helpers.MessageFormatter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ArrayBlockingQueue;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
|
* Created by caoyan.
|
...
|
...
|
@@ -59,6 +60,9 @@ public class MessageFacade { |
|
|
@Autowired
|
|
|
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private ProductMapper productMapper;
|
|
|
|
|
|
/**
|
|
|
* 申请物权转移后
|
|
|
*/
|
...
|
...
|
@@ -83,8 +87,11 @@ public class MessageFacade { |
|
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
|
|
|
String prdName = sellerOrderGoods.getProductName();
|
|
|
String sizeName = sellerOrderGoods.getSizeName();
|
|
|
|
|
|
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
|
|
|
String params = buildParams(applicantName, prdName, sizeName);
|
|
|
String params = buildParams(applicantName, prdName, sizeName,productCode);
|
|
|
InboxReqVO req = buildInboxReqVO(Integer.parseInt(ownerUid), params, ibtOfBuyer);
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
logger.info("record applyToBeOwner inbox msg, ownerUid {}, applicantUid {}, prdName {} resp {}",
|
...
|
...
|
@@ -113,7 +120,7 @@ public class MessageFacade { |
|
|
logger.warn("in applyToBeOwner sms fail, ownerUid {} applicantUid {} prdName {} ", ownerUid, applicantUid,prdName);
|
|
|
return;
|
|
|
}
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM.getContent(), applicantName, prdName, sizeName);
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM.getContent(), applicantName, prdName, sizeName,productCode);
|
|
|
List<String> mobileList = Arrays.asList(ownerMobile);
|
|
|
sendMessageService.smsSendByMobile(content,mobileList);
|
|
|
logger.info("record applyToBeOwner inbox sms msg, ownerUid {} applicantUid {} prdName {}", ownerUid, applicantUid, prdName);
|
...
|
...
|
@@ -127,9 +134,7 @@ public class MessageFacade { |
|
|
|
|
|
/**
|
|
|
* 物权转移确认超时
|
|
|
* @param buyerUid
|
|
|
* @param orderCode
|
|
|
* @param prdName
|
|
|
*/
|
|
|
public void ownerConfirmTimeOut(String applicantUid, Long orderCode){
|
|
|
executorService.execute(()-> {
|
...
|
...
|
@@ -146,8 +151,11 @@ public class MessageFacade { |
|
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
|
|
|
String prdName = sellerOrderGoods.getProductName();
|
|
|
String sizeName = sellerOrderGoods.getSizeName();
|
|
|
|
|
|
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
|
|
|
String params = buildParams(prdName, sizeName);
|
|
|
String params = buildParams(prdName, sizeName,productCode);
|
|
|
InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
|
...
|
...
|
@@ -158,7 +166,7 @@ public class MessageFacade { |
|
|
logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
|
|
|
return;
|
|
|
}
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_TIMEOUT.getContent(), prdName, sizeName);
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_TIMEOUT.getContent(), prdName, sizeName,productCode);
|
|
|
List<String> mobileList = Arrays.asList(applicantMobile);
|
|
|
sendMessageService.smsSendByMobile(content,mobileList);
|
|
|
logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
|
...
|
...
|
@@ -188,8 +196,11 @@ public class MessageFacade { |
|
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
|
|
|
String prdName = sellerOrderGoods.getProductName();
|
|
|
String sizeName = sellerOrderGoods.getSizeName();
|
|
|
|
|
|
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
|
|
|
String params = buildParams(prdName, sizeName);
|
|
|
String params = buildParams(prdName, sizeName,productCode);
|
|
|
InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
|
...
|
...
|
@@ -200,7 +211,7 @@ public class MessageFacade { |
|
|
logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
|
|
|
return;
|
|
|
}
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_REJECT.getContent(), prdName, sizeName);
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_REJECT.getContent(), prdName, sizeName,productCode);
|
|
|
List<String> mobileList = Arrays.asList(applicantMobile);
|
|
|
sendMessageService.smsSendByMobile(content,mobileList);
|
|
|
logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
|
...
|
...
|
@@ -230,8 +241,11 @@ public class MessageFacade { |
|
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
|
|
|
String prdName = sellerOrderGoods.getProductName();
|
|
|
String sizeName = sellerOrderGoods.getSizeName();
|
|
|
|
|
|
String params = buildParams(prdName, sizeName);
|
|
|
|
|
|
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
|
|
|
String params = buildParams(prdName, sizeName,productCode);
|
|
|
InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
|
...
|
...
|
@@ -242,7 +256,7 @@ public class MessageFacade { |
|
|
logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
|
|
|
return;
|
|
|
}
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_PASS.getContent(), prdName, sizeName);
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_PASS.getContent(), prdName, sizeName,productCode);
|
|
|
List<String> mobileList = Arrays.asList(applicantMobile);
|
|
|
sendMessageService.smsSendByMobile(content,mobileList);
|
|
|
logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
|
...
|
...
|
|