Authored by qinchao

消息

@@ -526,9 +526,16 @@ public class AppraiseService { @@ -526,9 +526,16 @@ public class AppraiseService {
526 //鉴定不通过 ,其余的情况不发消息,改成寄回的时候再发消息 526 //鉴定不通过 ,其余的情况不发消息,改成寄回的时候再发消息
527 inBoxFacade.noticeSellerWhenAppraiseFail(sellerOrderGoods, orderCode, wayBillCode); 527 inBoxFacade.noticeSellerWhenAppraiseFail(sellerOrderGoods, orderCode, wayBillCode);
528 inBoxFacade.buyerGetEarnestMoneyWhenAppraiseFail(buyerUid, buyerOrder.getOrderCode(), sellerOrderGoods.getProductName()); 528 inBoxFacade.buyerGetEarnestMoneyWhenAppraiseFail(buyerUid, buyerOrder.getOrderCode(), sellerOrderGoods.getProductName());
  529 + }else if(type==2 ){
  530 + //质检不通过
  531 + inBoxFacade.noticeBuyerWhenQualityCheckNotPass(buyerUid, buyerOrder.getOrderCode(), sellerOrderGoods.getProductName());
529 }else if(type==3 || type == 4){ 532 }else if(type==3 || type == 4){
530 //瑕疵不接受(用户不接受和超时不接受),只给买家发消息 533 //瑕疵不接受(用户不接受和超时不接受),只给买家发消息
531 - inBoxFacade.buyerMiniFaultUnAccept(buyerUid,buyerOrder.getOrderCode(), sellerOrderGoods.getProductName()); 534 + boolean outTime=false;
  535 + if(type == 4){
  536 + outTime=true;
  537 + }
  538 + inBoxFacade.buyerMiniFaultUnAccept(buyerUid,buyerOrder.getOrderCode(), sellerOrderGoods.getProductName(),outTime);
532 } 539 }
533 540
534 }catch(Exception ex) { 541 }catch(Exception ex) {
@@ -308,6 +308,39 @@ public class InBoxFacade { @@ -308,6 +308,39 @@ public class InBoxFacade {
308 } 308 }
309 309
310 /** 310 /**
  311 + * 平台收货
  312 + */
  313 + public void noticeBuyerWhenQualityCheckNotPass(int buyerUid, long orderCode,String prdName) {
  314 + try {
  315 + executorService.execute(() -> {
  316 + InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_QUALITY_NOT_PASS;
  317 + String params = buildParams(orderCode);
  318 + InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
  319 +
  320 + InBoxResponse resp = inBoxSDK.addInbox(req);
  321 + logger.info("record noticeBuyerWhenQualityCheckNotPass inbox msg, buyerUid {}, orderCode {},prdName {} resp {}",
  322 + buyerUid, orderCode,prdName, resp);
  323 +
  324 + //短信
  325 + String phone = userProxyService.getMobile(buyerUid);
  326 + if (StringUtils.isBlank(phone)){
  327 + logger.warn("in noticeBuyerWhenQualityCheckNotPass sms fail, buyerUid {} orderCode {} ,prdName {}", buyerUid, orderCode,prdName);
  328 + return;
  329 + }
  330 + List<String> mobileList = Arrays.asList(phone);
  331 + String content=getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_QUALITY_NOT_PASS.getContent(),prdName,orderCode);
  332 +
  333 + sendSmsService.smsSendByMobile(content,mobileList);
  334 + logger.info("record noticeBuyerWhenQualityCheckNotPass inbox sms msg, buyerUid {}, orderCode {}, prdName {}",
  335 + buyerUid, orderCode,prdName);
  336 + });
  337 + } catch (Exception e) {
  338 + logger.warn("InBoxFacade noticeBuyerWhenQualityCheckNotPass error inbox msg, buyerUid {}, orderCode {} ,prdName {}",
  339 + buyerUid, orderCode,prdName, e);
  340 + }
  341 + }
  342 +
  343 + /**
311 * 瑕疵提醒,给买家消息 344 * 瑕疵提醒,给买家消息
312 */ 345 */
313 public void buyerMiniFaultCreate(int buyerUid, long orderCode) { 346 public void buyerMiniFaultCreate(int buyerUid, long orderCode) {
@@ -342,11 +375,14 @@ public class InBoxFacade { @@ -342,11 +375,14 @@ public class InBoxFacade {
342 /** 375 /**
343 * 不接受瑕疵,给买家消息 376 * 不接受瑕疵,给买家消息
344 */ 377 */
345 - public void buyerMiniFaultUnAccept(int buyerUid, long orderCode,String prdName) { 378 + public void buyerMiniFaultUnAccept(int buyerUid, long orderCode,String prdName,boolean outTimeFlag) {
346 379
347 try { 380 try {
348 executorService.execute(() -> { 381 executorService.execute(() -> {
349 InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_MINI_FAULT_UN_ACCEPT; 382 InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_MINI_FAULT_UN_ACCEPT;
  383 + if(outTimeFlag){
  384 + ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_MINI_FAULT_UN_ACCEPT_OUT_TIME;
  385 + }
350 String params = buildParams(orderCode); 386 String params = buildParams(orderCode);
351 InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt); 387 InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
352 388
@@ -361,7 +397,8 @@ public class InBoxFacade { @@ -361,7 +397,8 @@ public class InBoxFacade {
361 return; 397 return;
362 } 398 }
363 List<String> mobileList = Arrays.asList(phone); 399 List<String> mobileList = Arrays.asList(phone);
364 - String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_MINI_FAULT_UN_ACCEPT.getContent(),prdName,orderCode); 400 + InboxBusinessTypeEnum sms = InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_MINI_FAULT_UN_ACCEPT;
  401 + String content = getReplacedContent(sms.getContent(),prdName,orderCode);
365 sendSmsService.smsSendByMobile(content, mobileList); 402 sendSmsService.smsSendByMobile(content, mobileList);
366 logger.info("record buyerQualityCheckNotPass inbox sms msg,buyerUid {}, prdName {},orderCode {}", 403 logger.info("record buyerQualityCheckNotPass inbox sms msg,buyerUid {}, prdName {},orderCode {}",
367 buyerUid , prdName,orderCode); 404 buyerUid , prdName,orderCode);