|
|
@@ -902,15 +902,15 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
@Override
|
|
|
public Boolean updateByEditBo(OrderEditBo bo) {
|
|
|
Order order = this.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderId, bo.getOrderId()));
|
|
|
- if (order.getOrderStatus() != 0) {
|
|
|
+ if (order.getOrderStatus() >0) {
|
|
|
throw new CustomException("订单无法取消");
|
|
|
}
|
|
|
|
|
|
Order update = BeanUtil.toBean(bo, Order.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
-
|
|
|
- if (update.getOrderStatus() == -1) {
|
|
|
+ //待支付手动关闭
|
|
|
+ if (Validator.isNotEmpty(update.getOrderStatus())&&update.getOrderStatus() == -1 &&order.getOrderStatus()==0) {
|
|
|
update.setCancelTime(DateUtils.getNowTime());
|
|
|
//手动关闭订单
|
|
|
OrderVo orderVo = this.queryById(bo.getOrderId());
|
|
|
@@ -1045,7 +1045,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
List<OrderGoodsVo> list1 = iOrderGoodsService.selectList(orderGoodsQueryBo);
|
|
|
for(OrderGoodsVo goodsVo : list1){
|
|
|
if(Validator.isNotEmpty(goodsVo.getServiceEndTime())&&(goodsVo.getServiceEndTime().longValue()>(System.currentTimeMillis()/1000))){
|
|
|
- throw new CustomException("存在已购买【班级学习服务期未过期】的商品,不可以重复购买商品", 511);
|
|
|
+ if(Validator.isNotEmpty(goodsVo.getGradeId())){
|
|
|
+ ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
|
|
|
+ .eq(ClassGrade::getGradeId, goodsVo.getGradeId()));
|
|
|
+ //不存在班级有效期才校验服务期是否过期
|
|
|
+ if(Validator.isEmpty(grade.getClassEndTime())){
|
|
|
+ throw new CustomException("存在已购买【班级学习服务期未过期】的商品,不可以重复购买商品", 511);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (list1 != null && list1.size() > 0) {
|