Authored by mali

更低售价

package com.yohoufo.order.service.proxy;
import com.alibaba.fastjson.JSON;
import com.yoho.message.sdk.service.ufo.IUFOSendService;
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohobuy.ufo.model.order.common.SuperEnterStageLevel;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.order.StoredSellerMapper;
import com.yohoufo.dal.order.model.SellerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.StoredSeller;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.inboxclient.model.InBoxResponse;
... ... @@ -18,10 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
... ... @@ -49,6 +51,15 @@ public class InBoxFacade {
@Autowired
private ProductMapper productMapper;
@Autowired
private IUFOSendService ufoSendService;
@Autowired
private StoredSellerMapper storedSellerMapper;
@Autowired
private SellerOrderMapper sellerOrderMapper;
/*********************************************************************
* 买家消息 和 短信
********************************************************************/
... ... @@ -970,6 +981,48 @@ public class InBoxFacade {
sellerUid, prdName, sizeName, resp);
}
);
noticeSellerUidList.stream().forEach( // 发送PUSH
sellerUid ->{
StoredSeller storedSeller = storedSellerMapper.selectValidByUid(sellerUid);
if (Objects.isNull(storedSeller)) {
SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(sog.getId());
String orderCode = Optional.ofNullable(sellerOrder).map(SellerOrder::getOrderCode).map(String::valueOf).orElse(null);
/**
* 更低出售价提醒 商家未入驻
* @param uid
* @param productName 商品名称
* @param size 尺寸
* @param goodsNumber 货号
* @param salePrice 提醒的更低售价
* @param orderCode 订单编号
* @return
*/
ufoSendService.sendLessPrice(String.valueOf(sellerUid), product.getProductName(), sog.getSizeName(),
product.getProductCode(), sog.getGoodsPrice().toPlainString(), orderCode);
logger.info("personal seller record laster price send out push msg sellerUid【{}】 productName【{}】 SizeName【{}】 productCode【{}】 price【{}】 orderCode【{}】",
sellerUid, product.getProductName(), sog.getSizeName(), product.getProductCode(), sog.getGoodsPrice(), orderCode);
} else {
/**
* 更低出售价提醒 商家已入驻
* @param uid
* @param productName 商品名称
* @param size 尺寸
* @param goodsNumber 货号
* @param salePrice 提醒的更低售价
* @param productSkn 商品skn
* @return
*/
ufoSendService.sendLessPriceEnter(String.valueOf(sellerUid), product.getProductName(), sog.getSizeName(),
product.getProductCode(), sog.getGoodsPrice().toPlainString(), String.valueOf(sog.getProductId()));
logger.info("store seller record laster price send out push msg sellerUid【{}】 productName【{}】 SizeName【{}】 productCode【{}】 price【{}】 productId【{}】",
sellerUid, product.getProductName(), sog.getSizeName(), product.getProductCode(), sog.getGoodsPrice(), sog.getProductId());
}
}
);
});
} catch (Exception e) {
logger.warn("InBoxFacade noticeSellerWhenOtherChangePriceLower error inbox msg, noticeSellerUidList {}, sog {} ", noticeSellerUidList, sog, e);
... ...