Authored by chenchao

fix build object from source

... ... @@ -177,7 +177,8 @@ public class MsgService {
.productId(sellerOrderGoods.getProductId())
.prdName(sellerOrderGoods.getProductName())
.sizeName(sellerOrderGoods.getSizeName())
.productCode(product.getProductCode()).price(sellerOrderGoods.getGoodsPrice().toPlainString()).build();
.productCode(product.getProductCode())
.price(sellerOrderGoods.getGoodsPrice().toPlainString()).build();
centerEvent.setParams(JSONObject.parseObject(JSONObject.toJSONString(prdMsg)));
centerEvent.setBusinessLine("ufo");
... ...
... ... @@ -186,27 +186,19 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
return PushDataNode.builder().pushEnable(pushEnable).pushSupplier(pushSupplier).build();
}
private PushDataNode buildPushDataNode(GoodsInfo soldProduct, Supplier<Product> productSupplier){
String prdName = soldProduct.getProductName();
String sizeName = soldProduct.getSizeName();
Integer productId = soldProduct.getProductId();
SkupType skupType = soldProduct.getSkupType();
private PushDataNode buildPushDataNode(SellerOrderGoods tsog, Supplier<Product> productSupplier){
SkupType skupType = SkupType.getSkupType(tsog.getAttributes());
List<Integer> statusList = Lists.newArrayList(SkupStatus.CAN_SELL.getCode());
Set<Integer> skupTypes = Sets.newHashSet(skupType.getCode());
Integer sku = soldProduct.getStorageId();
Integer sku = tsog.getStorageId();
BigDecimal leastPrice;
//卖家的现货出价是否是全网最低价
boolean pushEnable = skupType.equals(SkupType.IN_STOCK)
&& Objects.nonNull(leastPrice=skupService.getLeastPriceOfSku(sku , statusList, skupTypes))
&& leastPrice.compareTo(soldProduct.getPrice())<=0;
&& leastPrice.compareTo(tsog.getGoodsPrice())<=0;
Supplier pushSupplier = null;
if (pushEnable){
List<Integer> uids = bidProductProxyService.getAllUidBySku(sku);
SellerOrderGoods tsog = new SellerOrderGoods();
tsog.setStorageId(sku);
tsog.setProductId(productId);
tsog.setProductName(prdName);
tsog.setSizeName(sizeName);
pushSupplier = ()-> msgService.noticeBuyerWhenSellerOnShelve(uids, tsog, productSupplier.get());
}
... ... @@ -216,21 +208,9 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
public void pushMsg2BuyerWhenSellerChangePrice(SellerOrderGoods sog){
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
Integer productId = sog.getProductId();
Integer skupAttributes = sog.getAttributes();
GoodsInfo soldProduct = new GoodsInfo();
soldProduct.setStorageId(sog.getStorageId());
soldProduct.setPrice(sog.getGoodsPrice());
soldProduct.setProductId(productId);
soldProduct.setProductName(prdName);
soldProduct.setSkupType(SkupType.getSkupType(skupAttributes));
soldProduct.setSizeName(sizeName);
//
Supplier<Product> productSupplier = () -> productMapper.selectByPrimaryKey(sog.getProductId());
PushDataNode pushDataNode = buildPushDataNode(soldProduct, productSupplier);
PushDataNode pushDataNode = buildPushDataNode(sog, productSupplier);
if (pushDataNode.pushEnable){
pushDataNode.pushSupplier.get();
}else {
... ...