Authored by caoyan

物权转移

... ... @@ -69,7 +69,10 @@ public class MessageFacade {
List<String> uidList = Lists.newArrayList(ownerUid, applicantUid);
Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList);
String ownerMobile = profileMap.get(Integer.parseInt(ownerUid)).getMobile();
String applicantMobileMask = MobileHelper.coverMobile2(profileMap.get(Integer.parseInt(applicantUid)).getMobile());
String applicantName = profileMap.get(Integer.parseInt(applicantUid)).getNickname();
if(StringUtils.isEmpty(applicantName) || applicantName.startsWith("YOHO-")) {
applicantName = MobileHelper.coverMobile2(profileMap.get(Integer.parseInt(applicantUid)).getMobile());
}
//商品信息
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
... ... @@ -77,12 +80,13 @@ public class MessageFacade {
//skup获取 productInfo
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
String params = buildParams(applicantMobileMask, prdName);
String params = buildParams(applicantName, prdName, sizeName);
InboxReqVO req = buildInboxReqVO(Integer.parseInt(ownerUid), params, ibtOfBuyer);
InBoxResponse resp = inBoxSDK.addInbox(req);
logger.info("record applyToBeOwner inbox msg, ownerUid {}, applicantMobileMask {}, prdName {} resp {}",
ownerUid, applicantMobileMask, prdName, resp);
logger.info("record applyToBeOwner inbox msg, ownerUid {}, applicantUid {}, prdName {} resp {}",
ownerUid, applicantUid, prdName, resp);
//增加倒计时属性
if(null != resp.getData()) {
... ... @@ -103,13 +107,13 @@ public class MessageFacade {
//sms
if (StringUtils.isBlank(ownerMobile)){
logger.warn("in applyToBeOwner sms fail, ownerUid {} applicantMobileMask {} prdName {} ", ownerUid, applicantMobileMask,prdName);
logger.warn("in applyToBeOwner sms fail, ownerUid {} applicantUid {} prdName {} ", ownerUid, applicantUid,prdName);
return;
}
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM.getContent(), applicantMobileMask, prdName);
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM.getContent(), applicantName, prdName, sizeName);
List<String> mobileList = Arrays.asList(ownerMobile);
sendMessageService.smsSendByMobile(content,mobileList);
logger.info("record applyToBeOwner inbox sms msg, ownerUid {} applicantMobileMask {} prdName {}", ownerUid, applicantMobileMask,prdName);
logger.info("record applyToBeOwner inbox sms msg, ownerUid {} applicantUid {} prdName {}", ownerUid, applicantUid, prdName);
} catch (Exception ex) {
logger.warn("InBoxFacade applyToBeOwner error inbox msg, ownerUid {} applicantUid {} tagId {} nfcUid {}",
... ... @@ -127,6 +131,7 @@ public class MessageFacade {
public void ownerConfirmTimeOut(String applicantUid, Long orderCode){
executorService.execute(()-> {
try {
InboxBusinessTypeEnum ibtOfBuyer = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_OWNER_CONFIRM_TIMEOUT;
List<String> uidList = Lists.newArrayList(applicantUid);
Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList);
String applicantMobile = profileMap.get(Integer.parseInt(applicantUid)).getMobile();
... ... @@ -137,13 +142,20 @@ public class MessageFacade {
//skup获取 productInfo
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
String params = buildParams(prdName, sizeName);
InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
InBoxResponse resp = inBoxSDK.addInbox(req);
logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
applicantUid, prdName, resp);
//sms
if (StringUtils.isBlank(applicantMobile)){
logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
return;
}
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_TIMEOUT.getContent(), prdName);
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_TIMEOUT.getContent(), prdName, sizeName);
List<String> mobileList = Arrays.asList(applicantMobile);
sendMessageService.smsSendByMobile(content,mobileList);
logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
... ... @@ -161,6 +173,7 @@ public class MessageFacade {
public void ownerReject(String applicantUid, Long orderCode){
executorService.execute(()-> {
try {
InboxBusinessTypeEnum ibtOfBuyer = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_OWNER_REJECT;
List<String> uidList = Lists.newArrayList(applicantUid);
Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList);
String applicantMobile = profileMap.get(Integer.parseInt(applicantUid)).getMobile();
... ... @@ -171,13 +184,62 @@ public class MessageFacade {
//skup获取 productInfo
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
String params = buildParams(prdName, sizeName);
InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
InBoxResponse resp = inBoxSDK.addInbox(req);
logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
applicantUid, prdName, resp);
//sms
if (StringUtils.isBlank(applicantMobile)){
logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
return;
}
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_REJECT.getContent(), prdName, sizeName);
List<String> mobileList = Arrays.asList(applicantMobile);
sendMessageService.smsSendByMobile(content,mobileList);
logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
} catch (Exception ex) {
logger.warn("MessageFacade ownerConfirmTimeOut error inbox msg, applicantUid {} orderCode {} ",
applicantUid, orderCode, ex);
}
});
}
/**
* 当前主人同意物权转移
*/
public void ownerPass(String applicantUid, Long orderCode){
executorService.execute(()-> {
try {
InboxBusinessTypeEnum ibtOfBuyer = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_OWNER_PASS;
List<String> uidList = Lists.newArrayList(applicantUid);
Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList);
String applicantMobile = profileMap.get(Integer.parseInt(applicantUid)).getMobile();
//商品信息
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
Integer skup = buyerOrderGoods.getSkup();
//skup获取 productInfo
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
String params = buildParams(prdName, sizeName);
InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
InBoxResponse resp = inBoxSDK.addInbox(req);
logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
applicantUid, prdName, resp);
//sms
if (StringUtils.isBlank(applicantMobile)){
logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
return;
}
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_REJECT.getContent(), prdName);
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_PASS.getContent(), prdName, sizeName);
List<String> mobileList = Arrays.asList(applicantMobile);
sendMessageService.smsSendByMobile(content,mobileList);
logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
... ...
... ... @@ -446,7 +446,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
if(status.equals(OPERATE_TYPE_REJECT)) {
setFinalTimeToEnd(inboxId, identifyRecord.getOwner());
//“不同意”则拒绝物权占有,短信通知申请⼈人“您发起商品xxxxxx的物权转 移申请,当前物权所有⼈人拒绝转移申请,您可以重新发起物权申请”
//“不同意”发消息
messageFacade.ownerReject(String.valueOf(toUid), identifyRecord.getOrderCode());
return result;
}
... ... @@ -463,6 +463,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
//更新identify_record
result = identifyRecordsMapper.updateOwner(tagId, nfcUid, toUid);
setFinalTimeToEnd(inboxId, identifyRecord.getOwner());
//发信息
messageFacade.ownerPass(String.valueOf(toUid), identifyRecord.getOrderCode());
//清理缓存
clearIdentifyCache(tagId, nfcUid);
... ... @@ -598,9 +602,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
String message = "向" + result.getCurrentOwner() + "申请成为新主人";
String tip = "";
if(result.getApplyStatus().equals(OPERATE_TYPE_REJECT)) {
tip = "当前物权所有⼈拒绝物权转移";
tip = "您发起商品「" + result.getProductName() + "」「" + result.getProductSize() + "」物权占有申请,当前主人已拒绝您的申请,您可以重新发起物权转移申请";
}else if(result.getApplyStatus().equals(OPERATE_TYPE_TIMEOUT)) {
tip = "当前主人确认申请超时,您可以重新发起申请";
tip = "当前主人确认申请超时,您可以重新发起物权转移申请";
}
track.setMessage(message);
track.setTip(tip);
... ...