订单过期返回状态码
This commit is contained in:
@@ -112,7 +112,7 @@ public class ProductDTO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 称重 价格/千克
|
* 称重 价格/千克
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "重量不能为空", groups = DefaultGroup.class)
|
// @NotNull(message = "重量不能为空", groups = DefaultGroup.class)
|
||||||
private BigDecimal weight;
|
private BigDecimal weight;
|
||||||
/**
|
/**
|
||||||
* 是否允许临时改价
|
* 是否允许临时改价
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
public OrderInfo checkOrderPay(CheckOrderPay param) {
|
public OrderInfo checkOrderPay(CheckOrderPay param) {
|
||||||
OrderInfo orderInfo = getById(param.getOrderId());
|
OrderInfo orderInfo = getById(param.getOrderId());
|
||||||
if (!orderInfo.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) {
|
if (!orderInfo.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) {
|
||||||
throw new ValidateException("生成支付订单失败,订单不可支付");
|
throw new OrderCancelException("生成支付订单失败,订单不可支付");
|
||||||
}
|
}
|
||||||
if (!"after-pay".equals(orderInfo.getPayMode())) {
|
if (!"after-pay".equals(orderInfo.getPayMode())) {
|
||||||
if (redisService.hasKey(RedisCst.classKeyExpired.EXPIRED_ORDER + param.getOrderId())) {
|
if (redisService.hasKey(RedisCst.classKeyExpired.EXPIRED_ORDER + param.getOrderId())) {
|
||||||
|
|||||||
@@ -281,6 +281,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|||||||
}
|
}
|
||||||
Product old = super.getById(dto.getId());
|
Product old = super.getById(dto.getId());
|
||||||
Product entity = BeanUtil.copyProperties(dto, Product.class);
|
Product entity = BeanUtil.copyProperties(dto, Product.class);
|
||||||
|
if ("weight".equals(entity.getType()) && (entity.getWeight() == null || entity.getWeight().compareTo(BigDecimal.ZERO) <= 0)) {
|
||||||
|
throw new CzgException("称重商品重量必须大于0");
|
||||||
|
}
|
||||||
entity.setImages(JSON.toJSONString(dto.getImages(), JSONWriter.Feature.WriteMapNullValue));
|
entity.setImages(JSON.toJSONString(dto.getImages(), JSONWriter.Feature.WriteMapNullValue));
|
||||||
entity.setGroupSnap("[]");
|
entity.setGroupSnap("[]");
|
||||||
//套餐
|
//套餐
|
||||||
|
|||||||
Reference in New Issue
Block a user