|
@@ -118,6 +118,15 @@ public class SellerOrderService { |
|
@@ -118,6 +118,15 @@ public class SellerOrderService { |
118
|
throw new GatewayException(400, "商品不存在");
|
118
|
throw new GatewayException(400, "商品不存在");
|
119
|
}
|
119
|
}
|
120
|
context.setSoldProduct(goodsInfo);
|
120
|
context.setSoldProduct(goodsInfo);
|
|
|
121
|
+ StorageLeastPriceResp leastPriceResp = ufoServiceCaller.call("ufo.product.storage.leastprice", storageId);
|
|
|
122
|
+ BigDecimal leastPrice;
|
|
|
123
|
+ if (Objects.isNull(leastPriceResp) || Objects.isNull(leastPrice = leastPriceResp.getLeastPrice()) || leastPrice.doubleValue() == 0D){
|
|
|
124
|
+ throw new GatewayException(501, "无法比对商品最低价");
|
|
|
125
|
+ }
|
|
|
126
|
+ if (goodsInfo.getPrice().subtract(leastPrice).doubleValue() < 0D){
|
|
|
127
|
+ log.warn("in computePublishPrd,leastPrice {}, req {}", leastPrice, req);
|
|
|
128
|
+ throw new GatewayException(501, "设定的价格低于商品最低价");
|
|
|
129
|
+ }
|
121
|
// compute every fee from price
|
130
|
// compute every fee from price
|
122
|
SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice());
|
131
|
SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice());
|
123
|
log.info("in publishPrd , uid {}, storageId {}, price {}, computeResult {}", uid, storageId,
|
132
|
log.info("in publishPrd , uid {}, storageId {}, price {}, computeResult {}", uid, storageId,
|