|
|
@@ -410,11 +410,11 @@ public class KwoTradeOrderService {
|
|
|
|
|
|
|
|
|
private void checkParams(UpdateOrderParam param, String source) {
|
|
|
- if (Objects.isNull(param.getAmount())) {
|
|
|
- throw new BusinessException("订单总量不能为空!");
|
|
|
+ if (Objects.isNull(param.getAmount()) || param.getAmount().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ throw new BusinessException("订单总量不能为空且不能为负数!");
|
|
|
}
|
|
|
- if (Objects.isNull(param.getPrice())) {
|
|
|
- throw new BusinessException("订单金额不能为空!");
|
|
|
+ if (Objects.isNull(param.getPrice()) || param.getPrice().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ throw new BusinessException("订单金额不能为空且不能为负数!");
|
|
|
}
|
|
|
if (StringUtils.isBlank(param.getTrading())) {
|
|
|
throw new BusinessException("交易方式不能为空!");
|
|
|
@@ -465,8 +465,8 @@ public class KwoTradeOrderService {
|
|
|
if (StringUtils.isBlank(goodsInfo.getGoodsType())) {
|
|
|
throw new BusinessException("商品类型不能为空!");
|
|
|
}
|
|
|
- if (Objects.isNull(goodsInfo.getGoodsTaxRate())) {
|
|
|
- throw new BusinessException("商品发票税率不能为空!");
|
|
|
+ if (Objects.isNull(goodsInfo.getGoodsTaxRate()) || goodsInfo.getGoodsTaxRate().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ throw new BusinessException("商品发票税率不能为空且不能为负数!");
|
|
|
}
|
|
|
if (StringUtils.isBlank(goodsInfo.getGoodsSpec())) {
|
|
|
throw new BusinessException("商品尺寸大小不能为空!");
|
|
|
@@ -477,8 +477,8 @@ public class KwoTradeOrderService {
|
|
|
if (Objects.isNull(goodsInfo.getPriceRangeId())) {
|
|
|
throw new BusinessException("价格段id不能为空!");
|
|
|
}
|
|
|
- if (Objects.isNull(goodsInfo.getUnitPrice())) {
|
|
|
- throw new BusinessException("订单成交单价不能为空!");
|
|
|
+ if (Objects.isNull(goodsInfo.getUnitPrice()) || goodsInfo.getUnitPrice().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ throw new BusinessException("订单成交单价不能为空且不能为负数!");
|
|
|
}
|
|
|
if (Objects.isNull(goodsInfo.getCollectionUnitId())) {
|
|
|
throw new BusinessException("收款单位id不能为空!");
|