Merge #70 into master from cc_20260323_fix
feat:数量可以为0 * cc_20260323_fix: (2 commits squashed) - feat:数量可以为0 - feat:数量可以为0 Signed-off-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com> Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com> CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/70
This commit is contained in:
@@ -29,7 +29,6 @@ public class PCStoreOrderOptionQuantityUpdateRequest {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "数量", required = true)
|
@ApiModelProperty(value = "数量", required = true)
|
||||||
@NotNull(message = "数量不能为空")
|
@NotNull(message = "数量不能为空")
|
||||||
@DecimalMin(value = "0.01", message = "数量必须大于0")
|
|
||||||
private BigDecimal quantity;
|
private BigDecimal quantity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1202,7 +1202,7 @@ public class MiniStoreOrderServiceImpl implements MiniStoreOrderService {
|
|||||||
List<StoreOrderOptionSnapshotDO> batchUpdateList = new ArrayList<>();
|
List<StoreOrderOptionSnapshotDO> batchUpdateList = new ArrayList<>();
|
||||||
for (PCStoreOrderOptionQuantityUpdateRequest.SelectedOption selected : request.getSelectedOptions()) {
|
for (PCStoreOrderOptionQuantityUpdateRequest.SelectedOption selected : request.getSelectedOptions()) {
|
||||||
if (selected == null || selected.getOptionId() == null || selected.getQuantity() == null
|
if (selected == null || selected.getOptionId() == null || selected.getQuantity() == null
|
||||||
|| selected.getQuantity().compareTo(BigDecimal.ZERO) <= 0) {
|
|| selected.getQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user