Authored by sailing-PC\sailing

fix

@@ -81,6 +81,6 @@ public class SellerOrderController { @@ -81,6 +81,6 @@ public class SellerOrderController {
81 .build(); 81 .build();
82 logger.info("in ufo.sellerOrder.publishPrd, req {}", req); 82 logger.info("in ufo.sellerOrder.publishPrd, req {}", req);
83 Long orderCode = sellerOrderService.publishPrd(req); 83 Long orderCode = sellerOrderService.publishPrd(req);
84 - return new ApiResponse.ApiResponseBuilder().data(orderCode).code(200).message("算费成功").build(); 84 + return new ApiResponse.ApiResponseBuilder().data(orderCode).code(200).message("发布成功").build();
85 } 85 }
86 } 86 }
@@ -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,