Authored by caoyan

物权转移

@@ -69,7 +69,10 @@ public class MessageFacade { @@ -69,7 +69,10 @@ public class MessageFacade {
69 List<String> uidList = Lists.newArrayList(ownerUid, applicantUid); 69 List<String> uidList = Lists.newArrayList(ownerUid, applicantUid);
70 Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList); 70 Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList);
71 String ownerMobile = profileMap.get(Integer.parseInt(ownerUid)).getMobile(); 71 String ownerMobile = profileMap.get(Integer.parseInt(ownerUid)).getMobile();
72 - String applicantMobileMask = MobileHelper.coverMobile2(profileMap.get(Integer.parseInt(applicantUid)).getMobile()); 72 + String applicantName = profileMap.get(Integer.parseInt(applicantUid)).getNickname();
  73 + if(StringUtils.isEmpty(applicantName) || applicantName.startsWith("YOHO-")) {
  74 + applicantName = MobileHelper.coverMobile2(profileMap.get(Integer.parseInt(applicantUid)).getMobile());
  75 + }
73 76
74 //商品信息 77 //商品信息
75 BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode); 78 BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
@@ -77,12 +80,13 @@ public class MessageFacade { @@ -77,12 +80,13 @@ public class MessageFacade {
77 //skup获取 productInfo 80 //skup获取 productInfo
78 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup); 81 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
79 String prdName = sellerOrderGoods.getProductName(); 82 String prdName = sellerOrderGoods.getProductName();
  83 + String sizeName = sellerOrderGoods.getSizeName();
80 84
81 - String params = buildParams(applicantMobileMask, prdName); 85 + String params = buildParams(applicantName, prdName, sizeName);
82 InboxReqVO req = buildInboxReqVO(Integer.parseInt(ownerUid), params, ibtOfBuyer); 86 InboxReqVO req = buildInboxReqVO(Integer.parseInt(ownerUid), params, ibtOfBuyer);
83 InBoxResponse resp = inBoxSDK.addInbox(req); 87 InBoxResponse resp = inBoxSDK.addInbox(req);
84 - logger.info("record applyToBeOwner inbox msg, ownerUid {}, applicantMobileMask {}, prdName {} resp {}",  
85 - ownerUid, applicantMobileMask, prdName, resp); 88 + logger.info("record applyToBeOwner inbox msg, ownerUid {}, applicantUid {}, prdName {} resp {}",
  89 + ownerUid, applicantUid, prdName, resp);
86 90
87 //增加倒计时属性 91 //增加倒计时属性
88 if(null != resp.getData()) { 92 if(null != resp.getData()) {
@@ -103,13 +107,13 @@ public class MessageFacade { @@ -103,13 +107,13 @@ public class MessageFacade {
103 107
104 //sms 108 //sms
105 if (StringUtils.isBlank(ownerMobile)){ 109 if (StringUtils.isBlank(ownerMobile)){
106 - logger.warn("in applyToBeOwner sms fail, ownerUid {} applicantMobileMask {} prdName {} ", ownerUid, applicantMobileMask,prdName); 110 + logger.warn("in applyToBeOwner sms fail, ownerUid {} applicantUid {} prdName {} ", ownerUid, applicantUid,prdName);
107 return; 111 return;
108 } 112 }
109 - String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM.getContent(), applicantMobileMask, prdName); 113 + String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM.getContent(), applicantName, prdName, sizeName);
110 List<String> mobileList = Arrays.asList(ownerMobile); 114 List<String> mobileList = Arrays.asList(ownerMobile);
111 sendMessageService.smsSendByMobile(content,mobileList); 115 sendMessageService.smsSendByMobile(content,mobileList);
112 - logger.info("record applyToBeOwner inbox sms msg, ownerUid {} applicantMobileMask {} prdName {}", ownerUid, applicantMobileMask,prdName); 116 + logger.info("record applyToBeOwner inbox sms msg, ownerUid {} applicantUid {} prdName {}", ownerUid, applicantUid, prdName);
113 117
114 } catch (Exception ex) { 118 } catch (Exception ex) {
115 logger.warn("InBoxFacade applyToBeOwner error inbox msg, ownerUid {} applicantUid {} tagId {} nfcUid {}", 119 logger.warn("InBoxFacade applyToBeOwner error inbox msg, ownerUid {} applicantUid {} tagId {} nfcUid {}",
@@ -127,6 +131,7 @@ public class MessageFacade { @@ -127,6 +131,7 @@ public class MessageFacade {
127 public void ownerConfirmTimeOut(String applicantUid, Long orderCode){ 131 public void ownerConfirmTimeOut(String applicantUid, Long orderCode){
128 executorService.execute(()-> { 132 executorService.execute(()-> {
129 try { 133 try {
  134 + InboxBusinessTypeEnum ibtOfBuyer = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_OWNER_CONFIRM_TIMEOUT;
130 List<String> uidList = Lists.newArrayList(applicantUid); 135 List<String> uidList = Lists.newArrayList(applicantUid);
131 Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList); 136 Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList);
132 String applicantMobile = profileMap.get(Integer.parseInt(applicantUid)).getMobile(); 137 String applicantMobile = profileMap.get(Integer.parseInt(applicantUid)).getMobile();
@@ -137,13 +142,20 @@ public class MessageFacade { @@ -137,13 +142,20 @@ public class MessageFacade {
137 //skup获取 productInfo 142 //skup获取 productInfo
138 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup); 143 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
139 String prdName = sellerOrderGoods.getProductName(); 144 String prdName = sellerOrderGoods.getProductName();
  145 + String sizeName = sellerOrderGoods.getSizeName();
  146 +
  147 + String params = buildParams(prdName, sizeName);
  148 + InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
  149 + InBoxResponse resp = inBoxSDK.addInbox(req);
  150 + logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
  151 + applicantUid, prdName, resp);
140 152
141 //sms 153 //sms
142 if (StringUtils.isBlank(applicantMobile)){ 154 if (StringUtils.isBlank(applicantMobile)){
143 logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName); 155 logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
144 return; 156 return;
145 } 157 }
146 - String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_TIMEOUT.getContent(), prdName); 158 + String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_TIMEOUT.getContent(), prdName, sizeName);
147 List<String> mobileList = Arrays.asList(applicantMobile); 159 List<String> mobileList = Arrays.asList(applicantMobile);
148 sendMessageService.smsSendByMobile(content,mobileList); 160 sendMessageService.smsSendByMobile(content,mobileList);
149 logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName); 161 logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
@@ -161,6 +173,7 @@ public class MessageFacade { @@ -161,6 +173,7 @@ public class MessageFacade {
161 public void ownerReject(String applicantUid, Long orderCode){ 173 public void ownerReject(String applicantUid, Long orderCode){
162 executorService.execute(()-> { 174 executorService.execute(()-> {
163 try { 175 try {
  176 + InboxBusinessTypeEnum ibtOfBuyer = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_OWNER_REJECT;
164 List<String> uidList = Lists.newArrayList(applicantUid); 177 List<String> uidList = Lists.newArrayList(applicantUid);
165 Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList); 178 Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList);
166 String applicantMobile = profileMap.get(Integer.parseInt(applicantUid)).getMobile(); 179 String applicantMobile = profileMap.get(Integer.parseInt(applicantUid)).getMobile();
@@ -171,13 +184,62 @@ public class MessageFacade { @@ -171,13 +184,62 @@ public class MessageFacade {
171 //skup获取 productInfo 184 //skup获取 productInfo
172 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup); 185 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
173 String prdName = sellerOrderGoods.getProductName(); 186 String prdName = sellerOrderGoods.getProductName();
  187 + String sizeName = sellerOrderGoods.getSizeName();
  188 +
  189 + String params = buildParams(prdName, sizeName);
  190 + InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
  191 + InBoxResponse resp = inBoxSDK.addInbox(req);
  192 + logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
  193 + applicantUid, prdName, resp);
  194 +
  195 + //sms
  196 + if (StringUtils.isBlank(applicantMobile)){
  197 + logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
  198 + return;
  199 + }
  200 + String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_REJECT.getContent(), prdName, sizeName);
  201 + List<String> mobileList = Arrays.asList(applicantMobile);
  202 + sendMessageService.smsSendByMobile(content,mobileList);
  203 + logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
  204 +
  205 + } catch (Exception ex) {
  206 + logger.warn("MessageFacade ownerConfirmTimeOut error inbox msg, applicantUid {} orderCode {} ",
  207 + applicantUid, orderCode, ex);
  208 + }
  209 + });
  210 + }
  211 +
  212 + /**
  213 + * 当前主人同意物权转移
  214 + */
  215 + public void ownerPass(String applicantUid, Long orderCode){
  216 + executorService.execute(()-> {
  217 + try {
  218 + InboxBusinessTypeEnum ibtOfBuyer = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_OWNER_PASS;
  219 + List<String> uidList = Lists.newArrayList(applicantUid);
  220 + Map<Integer, ProfileInfoRsp> profileMap = userInfoProxyService.queryIcoAndMobile(uidList);
  221 + String applicantMobile = profileMap.get(Integer.parseInt(applicantUid)).getMobile();
  222 +
  223 + //商品信息
  224 + BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
  225 + Integer skup = buyerOrderGoods.getSkup();
  226 + //skup获取 productInfo
  227 + SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
  228 + String prdName = sellerOrderGoods.getProductName();
  229 + String sizeName = sellerOrderGoods.getSizeName();
  230 +
  231 + String params = buildParams(prdName, sizeName);
  232 + InboxReqVO req = buildInboxReqVO(Integer.parseInt(applicantUid), params, ibtOfBuyer);
  233 + InBoxResponse resp = inBoxSDK.addInbox(req);
  234 + logger.info("record applyToBeOwner inbox msg, applicantUid {}, prdName {} resp {}",
  235 + applicantUid, prdName, resp);
174 236
175 //sms 237 //sms
176 if (StringUtils.isBlank(applicantMobile)){ 238 if (StringUtils.isBlank(applicantMobile)){
177 logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName); 239 logger.warn("in ownerConfirmTimeOut sms fail, applicantUid {} prdName {} ", applicantUid, prdName);
178 return; 240 return;
179 } 241 }
180 - String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_REJECT.getContent(), prdName); 242 + String content=getReplacedContent(InboxBusinessTypeEnum.SMS_OWNER_CONFIRM_PASS.getContent(), prdName, sizeName);
181 List<String> mobileList = Arrays.asList(applicantMobile); 243 List<String> mobileList = Arrays.asList(applicantMobile);
182 sendMessageService.smsSendByMobile(content,mobileList); 244 sendMessageService.smsSendByMobile(content,mobileList);
183 logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName); 245 logger.info("record ownerConfirmTimeOut inbox sms msg, applicantUid {},prdName {}", applicantUid, prdName);
@@ -446,7 +446,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -446,7 +446,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
446 446
447 if(status.equals(OPERATE_TYPE_REJECT)) { 447 if(status.equals(OPERATE_TYPE_REJECT)) {
448 setFinalTimeToEnd(inboxId, identifyRecord.getOwner()); 448 setFinalTimeToEnd(inboxId, identifyRecord.getOwner());
449 - //“不同意”则拒绝物权占有,短信通知申请⼈人“您发起商品xxxxxx的物权转 移申请,当前物权所有⼈人拒绝转移申请,您可以重新发起物权申请” 449 + //“不同意”发消息
450 messageFacade.ownerReject(String.valueOf(toUid), identifyRecord.getOrderCode()); 450 messageFacade.ownerReject(String.valueOf(toUid), identifyRecord.getOrderCode());
451 return result; 451 return result;
452 } 452 }
@@ -463,6 +463,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -463,6 +463,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
463 //更新identify_record 463 //更新identify_record
464 result = identifyRecordsMapper.updateOwner(tagId, nfcUid, toUid); 464 result = identifyRecordsMapper.updateOwner(tagId, nfcUid, toUid);
465 setFinalTimeToEnd(inboxId, identifyRecord.getOwner()); 465 setFinalTimeToEnd(inboxId, identifyRecord.getOwner());
  466 +
  467 + //发信息
  468 + messageFacade.ownerPass(String.valueOf(toUid), identifyRecord.getOrderCode());
  469 +
466 //清理缓存 470 //清理缓存
467 clearIdentifyCache(tagId, nfcUid); 471 clearIdentifyCache(tagId, nfcUid);
468 472
@@ -598,9 +602,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -598,9 +602,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
598 String message = "向" + result.getCurrentOwner() + "申请成为新主人"; 602 String message = "向" + result.getCurrentOwner() + "申请成为新主人";
599 String tip = ""; 603 String tip = "";
600 if(result.getApplyStatus().equals(OPERATE_TYPE_REJECT)) { 604 if(result.getApplyStatus().equals(OPERATE_TYPE_REJECT)) {
601 - tip = "当前物权所有⼈拒绝物权转移"; 605 + tip = "您发起商品「" + result.getProductName() + "」「" + result.getProductSize() + "」物权占有申请,当前主人已拒绝您的申请,您可以重新发起物权转移申请";
602 }else if(result.getApplyStatus().equals(OPERATE_TYPE_TIMEOUT)) { 606 }else if(result.getApplyStatus().equals(OPERATE_TYPE_TIMEOUT)) {
603 - tip = "当前主人确认申请超时,您可以重新发起申请"; 607 + tip = "当前主人确认申请超时,您可以重新发起物权转移申请";
604 } 608 }
605 track.setMessage(message); 609 track.setMessage(message);
606 track.setTip(tip); 610 track.setTip(tip);