|
@@ -432,7 +432,11 @@ public class KwoTradeOrderService {
|
|
|
BigDecimal amount = param.getAmount();
|
|
BigDecimal amount = param.getAmount();
|
|
|
String trading = param.getTrading();
|
|
String trading = param.getTrading();
|
|
|
BigDecimal price = param.getPrice();
|
|
BigDecimal price = param.getPrice();
|
|
|
- if (!isAcceptanceOrder) {
|
|
|
|
|
|
|
+ KwpGoods goods = goodsInfoService.getGoodsById(param.getGoodsId());
|
|
|
|
|
+ if (Objects.isNull(goods) || Objects.equals(goods.getDelFlag(), Global.YES) ) {
|
|
|
|
|
+ throw new BusinessException("商品不存在!");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Boolean.FALSE.equals(isAcceptanceOrder)) {
|
|
|
if (price.compareTo(amount.multiply(param.getUnitPrice())) != 0) {
|
|
if (price.compareTo(amount.multiply(param.getUnitPrice())) != 0) {
|
|
|
throw new BusinessException("订单总金额不等于商品单价*订单总量!");
|
|
throw new BusinessException("订单总金额不等于商品单价*订单总量!");
|
|
|
}
|
|
}
|
|
@@ -447,13 +451,9 @@ public class KwoTradeOrderService {
|
|
|
if (CollectionUtils.isEmpty(entCooperate)) {
|
|
if (CollectionUtils.isEmpty(entCooperate)) {
|
|
|
throw new BusinessException("供采双方企业无合作关系!");
|
|
throw new BusinessException("供采双方企业无合作关系!");
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- KwpGoods goods = goodsInfoService.getGoodsById(param.getGoodsId());
|
|
|
|
|
- if (Objects.isNull(goods) || Objects.equals(goods.getDelFlag(), Global.YES) || !Objects.equals(goods.getStatus(), 1)) {
|
|
|
|
|
- throw new BusinessException("商品不存在或已下架!");
|
|
|
|
|
- }
|
|
|
|
|
- if (goods.getAmount().compareTo(amount) < 0) {
|
|
|
|
|
- throw new BusinessException("商品库存不足,请联系供应方!");
|
|
|
|
|
|
|
+ if (goods.getAmount().compareTo(amount) < 0) {
|
|
|
|
|
+ throw new BusinessException("商品库存不足,请联系供应方!");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
//支付方式预付款校验
|
|
//支付方式预付款校验
|
|
|
if (trading.startsWith("1")) {
|
|
if (trading.startsWith("1")) {
|