Authored by sailing-PC\sailing

fix

... ... @@ -81,6 +81,6 @@ public class SellerOrderController {
.build();
logger.info("in ufo.sellerOrder.publishPrd, req {}", req);
Long orderCode = sellerOrderService.publishPrd(req);
return new ApiResponse.ApiResponseBuilder().data(orderCode).code(200).message("算费成功").build();
return new ApiResponse.ApiResponseBuilder().data(orderCode).code(200).message("发布成功").build();
}
}
... ...
... ... @@ -118,6 +118,15 @@ public class SellerOrderService {
throw new GatewayException(400, "商品不存在");
}
context.setSoldProduct(goodsInfo);
StorageLeastPriceResp leastPriceResp = ufoServiceCaller.call("ufo.product.storage.leastprice", storageId);
BigDecimal leastPrice;
if (Objects.isNull(leastPriceResp) || Objects.isNull(leastPrice = leastPriceResp.getLeastPrice()) || leastPrice.doubleValue() == 0D){
throw new GatewayException(501, "无法比对商品最低价");
}
if (goodsInfo.getPrice().subtract(leastPrice).doubleValue() < 0D){
log.warn("in computePublishPrd,leastPrice {}, req {}", leastPrice, req);
throw new GatewayException(501, "设定的价格低于商品最低价");
}
// compute every fee from price
SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice());
log.info("in publishPrd , uid {}, storageId {}, price {}, computeResult {}", uid, storageId,
... ...