Authored by LUOXC

fixbug

@@ -283,10 +283,10 @@ public class AppraiseService { @@ -283,10 +283,10 @@ public class AppraiseService {
283 appraiseExpressInfoBo.getWayBillCode(), 283 appraiseExpressInfoBo.getWayBillCode(),
284 appraiseExpressInfoBo.getDepotNum(), 284 appraiseExpressInfoBo.getDepotNum(),
285 appraiseExpressInfoBo.getMobile()); 285 appraiseExpressInfoBo.getMobile());
286 - //清缓存  
287 - SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());  
288 - Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);  
289 - inBoxFacade.noticeBuyerWhenDeliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(), sellerOrderGoods, product); 286 + // 通知买家已发货
  287 + inBoxFacade.noticeBuyerWhenDeliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(),
  288 + () -> cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid()),
  289 + sellerOrderGoods -> Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null));
290 }else { 290 }else {
291 LOGGER.warn("in deliveryGoodsToBuyer, buyer Deposit Order orderCode {}", buyerOrder.getOrderCode()); 291 LOGGER.warn("in deliveryGoodsToBuyer, buyer Deposit Order orderCode {}", buyerOrder.getOrderCode());
292 throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE); 292 throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
@@ -33,6 +33,8 @@ import java.util.concurrent.ArrayBlockingQueue; @@ -33,6 +33,8 @@ import java.util.concurrent.ArrayBlockingQueue;
33 import java.util.concurrent.ExecutorService; 33 import java.util.concurrent.ExecutorService;
34 import java.util.concurrent.ThreadPoolExecutor; 34 import java.util.concurrent.ThreadPoolExecutor;
35 import java.util.concurrent.TimeUnit; 35 import java.util.concurrent.TimeUnit;
  36 +import java.util.function.Function;
  37 +import java.util.function.Supplier;
36 38
37 /** 39 /**
38 * Created by chenchao on 2018/10/8. 40 * Created by chenchao on 2018/10/8.
@@ -220,14 +222,15 @@ public class InBoxFacade { @@ -220,14 +222,15 @@ public class InBoxFacade {
220 * 222 *
221 * @return 223 * @return
222 */ 224 */
223 - public void noticeBuyerWhenDeliveryDepositGoodsToBuyer(int buyerUid, String wayBillCode, SellerOrderGoods psog,Product product) { 225 + public void noticeBuyerWhenDeliveryDepositGoodsToBuyer(int buyerUid, String wayBillCode, Supplier<SellerOrderGoods> psogSupplier, Function<SellerOrderGoods,Product> productFunction) {
224 226
225 executorService.execute(()->{ 227 executorService.execute(()->{
226 228
227 try { 229 try {
228 - logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer inbox msg, buyerUid {}, wayBillCode {}, psog {},SellerOrderGoods {} product {}", 230 + SellerOrderGoods psog = psogSupplier.get();
  231 + Product product = productFunction.apply(psog);
  232 + logger.info("noticeBuyerWhenDeliveryDepositGoodsToBuyer, buyerUid {}, wayBillCode {}, psog {},SellerOrderGoods {} product {}",
229 buyerUid, wayBillCode, psog, JSON.toJSONString(psog), JSON.toJSONString(product)); 233 buyerUid, wayBillCode, psog, JSON.toJSONString(psog), JSON.toJSONString(product));
230 - String skupTypeText=SkupType.getSkupType(psog.getAttributes()).attrName();  
231 String prdName = psog.getProductName(); 234 String prdName = psog.getProductName();
232 String sizeName = psog.getSizeName(); 235 String sizeName = psog.getSizeName();
233 String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse(""); 236 String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
@@ -237,24 +240,23 @@ public class InBoxFacade { @@ -237,24 +240,23 @@ public class InBoxFacade {
237 InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt); 240 InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
238 241
239 InBoxResponse resp = inBoxSDK.addInbox(req); 242 InBoxResponse resp = inBoxSDK.addInbox(req);
240 - logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer inbox msg, buyerUid {}, wayBillCode {}, prdName {},SellerOrderGoods {} resp {}", 243 + logger.info("noticeBuyerWhenDeliveryDepositGoodsToBuyer, buyerUid {}, wayBillCode {}, prdName {},SellerOrderGoods {} resp {}",
241 buyerUid, wayBillCode, prdName, JSON.toJSONString(psog), resp); 244 buyerUid, wayBillCode, prdName, JSON.toJSONString(psog), resp);
242 245
243 //短信 246 //短信
244 String phone = userProxyService.getMobile(buyerUid); 247 String phone = userProxyService.getMobile(buyerUid);
245 if (StringUtils.isBlank(phone)){ 248 if (StringUtils.isBlank(phone)){
246 - logger.warn("in noticeBuyerWhenDeliveryGoodsToBuyer notice buyer sms fail, buyerUid {} wayBillCode {} prdName {} ", 249 + logger.warn("noticeBuyerWhenDeliveryDepositGoodsToBuyer notice buyer sms fail, buyerUid {} wayBillCode {} prdName {} ",
247 buyerUid, wayBillCode,prdName); 250 buyerUid, wayBillCode,prdName);
248 }else{ 251 }else{
249 List<String> mobileList = Arrays.asList(phone); 252 List<String> mobileList = Arrays.asList(phone);
250 String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DEPOSIT_GOODS_PURCHASE_SENDED.getContent(),prdName,sizeName,productCode,wayBillCode); 253 String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DEPOSIT_GOODS_PURCHASE_SENDED.getContent(),prdName,sizeName,productCode,wayBillCode);
251 sendSmsService.smsSendByMobile(content,mobileList); 254 sendSmsService.smsSendByMobile(content,mobileList);
252 - logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer notice buyer sms msg, buyerUid {}, wayBillCode {}, prdName {} phone {}", 255 + logger.info("noticeBuyerWhenDeliveryDepositGoodsToBuyer notice buyer sms msg, buyerUid {}, wayBillCode {}, prdName {} phone {}",
253 buyerUid, wayBillCode,prdName, phone); 256 buyerUid, wayBillCode,prdName, phone);
254 } 257 }
255 } catch (Exception e) { 258 } catch (Exception e) {
256 - logger.warn("InBoxFacade noticeBuyerWhenDeliveryGoodsToBuyer error inbox msg, buyerUid {}, wayBillCode {} ,psog {}",  
257 - buyerUid, wayBillCode, psog, e); 259 + logger.warn("noticeBuyerWhenDeliveryDepositGoodsToBuyer fail, buyerUid {}, wayBillCode {}", buyerUid, wayBillCode, e);
258 } 260 }
259 }); 261 });
260 262