|
@@ -118,6 +118,9 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean placeRefundSmallOrder(OrderGoodsRefundAddBo bo) {
|
|
public Boolean placeRefundSmallOrder(OrderGoodsRefundAddBo bo) {
|
|
|
|
|
+ if(Validator.isEmpty(bo.getGoodsId())||Validator.isEmpty(bo.getOrderSn())){
|
|
|
|
|
+ throw new CustomException("参数缺失");
|
|
|
|
|
+ }
|
|
|
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn,bo.getOrderSn())
|
|
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn,bo.getOrderSn())
|
|
|
.eq(OrderGoods::getGoodsId, bo.getGoodsId()));
|
|
.eq(OrderGoods::getGoodsId, bo.getGoodsId()));
|
|
|
if(Validator.isEmpty(orderGoods)){
|
|
if(Validator.isEmpty(orderGoods)){
|
|
@@ -193,17 +196,17 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean placeRefundInputOrder(List<OrderGoodsRefundAddBo> bos) {
|
|
public Boolean placeRefundInputOrder(List<OrderGoodsRefundAddBo> bos) {
|
|
|
for(OrderGoodsRefundAddBo bo : bos){
|
|
for(OrderGoodsRefundAddBo bo : bos){
|
|
|
|
|
+ if(Validator.isEmpty(bo.getGoodsId())||Validator.isEmpty(bo.getOrderSn())){
|
|
|
|
|
+ throw new CustomException("参数缺失");
|
|
|
|
|
+ }
|
|
|
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn,bo.getOrderSn())
|
|
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn,bo.getOrderSn())
|
|
|
.eq(OrderGoods::getGoodsId, bo.getGoodsId()));
|
|
.eq(OrderGoods::getGoodsId, bo.getGoodsId()));
|
|
|
if(Validator.isEmpty(orderGoods)){
|
|
if(Validator.isEmpty(orderGoods)){
|
|
|
throw new CustomException("订单商品数据错误");
|
|
throw new CustomException("订单商品数据错误");
|
|
|
}
|
|
}
|
|
|
- if(orderGoods.getPayStatus()!=3||orderGoods.getPayStatus()!=2){
|
|
|
|
|
|
|
+ if(orderGoods.getPayStatus()!=3&&orderGoods.getPayStatus()!=2){
|
|
|
throw new CustomException("订单商品尚未收费");
|
|
throw new CustomException("订单商品尚未收费");
|
|
|
}
|
|
}
|
|
|
- if(orderGoods.getRefundStatus()==2){
|
|
|
|
|
- throw new CustomException("订单商品已退款");
|
|
|
|
|
- }
|
|
|
|
|
if(orderGoods.getRefundStatus()!=0){
|
|
if(orderGoods.getRefundStatus()!=0){
|
|
|
throw new CustomException("订单商品目前正在退款中");
|
|
throw new CustomException("订单商品目前正在退款中");
|
|
|
}
|
|
}
|
|
@@ -212,8 +215,8 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
|
|
|
if(order.getStatus()==0){
|
|
if(order.getStatus()==0){
|
|
|
throw new CustomException("订单无效");
|
|
throw new CustomException("订单无效");
|
|
|
}
|
|
}
|
|
|
- if(order.getOrderFrom()!=2){
|
|
|
|
|
- throw new CustomException("不支持非小程序订单退款");
|
|
|
|
|
|
|
+ if(order.getOrderFrom()!=5){
|
|
|
|
|
+ throw new CustomException("不支持非录单订单退款");
|
|
|
}
|
|
}
|
|
|
//订单商品
|
|
//订单商品
|
|
|
Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId,bo.getGoodsId()));
|
|
Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId,bo.getGoodsId()));
|