...
|
...
|
@@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.order.bo.GoodsInfo; |
|
|
import com.yohobuy.ufo.model.order.common.SellerWalletType;
|
|
|
import com.yohobuy.ufo.model.order.req.SellerOrderSubmitReq;
|
|
|
import com.yohoufo.common.exception.GatewayException;
|
|
|
import com.yohoufo.common.exception.UfoServiceException;
|
|
|
import com.yohoufo.common.utils.AddressUtil;
|
|
|
import com.yohoufo.common.utils.BigDecimalHelper;
|
|
|
import com.yohoufo.dal.order.SellerWalletMapper;
|
...
|
...
|
@@ -184,24 +185,26 @@ public class SellerOrderPrepareProcessor { |
|
|
return Objects.nonNull(suggestMaxPrice) && prdPrice.compareTo(suggestMaxPrice) > 0;
|
|
|
}
|
|
|
|
|
|
public void checkPrice(int storageId, BigDecimal prdPrice, boolean validateMaxPrice) throws GatewayException {
|
|
|
public static final int TIPS_ERROR_CODE = 505;
|
|
|
|
|
|
public void checkPrice(int storageId, BigDecimal prdPrice, boolean validateMaxPrice) {
|
|
|
ProductProxyService.PrdPrice prdPriceRange = productProxyService.getPrdPriceRange(storageId);
|
|
|
log.info("in checkPrice, prdPrice {}, storageId {} prdPriceRange {}", prdPrice, storageId, prdPriceRange);
|
|
|
BigDecimal minPrice = prdPriceRange.getMinPrice();
|
|
|
BigDecimal maxPrice = prdPriceRange.getMaxPrice();
|
|
|
if (prdPrice.subtract(minPrice).doubleValue() < 0D){
|
|
|
log.warn("in computePublishPrd,minPrice {}, storageId {}", minPrice, storageId);
|
|
|
throw new GatewayException(501, "您的出价过低");
|
|
|
throw new UfoServiceException(501, "您的出价过低");
|
|
|
}
|
|
|
|
|
|
if (validateMaxPrice && prdPrice.subtract(maxPrice).doubleValue() > 0D){
|
|
|
log.warn("in computePublishPrd,maxPrice {}, storageId {}", maxPrice, storageId);
|
|
|
throw new GatewayException(501, "您的出价过高");
|
|
|
throw new UfoServiceException(501, "您的出价过高");
|
|
|
}
|
|
|
BigDecimal suggestMaxPrice = prdPriceRange.getSuggestMaxPrice();
|
|
|
if (isOverSuggestMaxPrice(suggestMaxPrice, prdPrice)){
|
|
|
log.warn("in computePublishPrd,prdPrice {}, storageId {} prdPriceRange {}", prdPrice, storageId, prdPriceRange);
|
|
|
throw new GatewayException(501, "您的出价已超出建议售价,此商品将不会给顾客展示!");
|
|
|
throw new UfoServiceException(TIPS_ERROR_CODE, "您的出价已超出建议售价,此商品将不会给顾客展示!");
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|