处理退款是扣库存

This commit is contained in:
朱耘稷
2020-12-17 19:00:24 +08:00
committed by xuwenbo
parent ddd25bc1a1
commit 01a5610219
3 changed files with 14 additions and 0 deletions

View File

@ -201,6 +201,7 @@ public class WechatController {
storeOrder.setRefundStatus(OrderInfoEnum.REFUND_STATUS_2.getValue());
storeOrder.setRefundPrice(refundFee);
orderService.updateById(storeOrder);
orderService.retrunStock(orderId);
return WxPayNotifyResponse.success("处理成功!");
} catch (WxPayException | IllegalAccessException e) {
log.error(e.getMessage());

View File

@ -288,4 +288,7 @@ public interface YxStoreOrderService extends BaseService<YxStoreOrder>{
* @return map
*/
Map<String,Object> chartCount();
void retrunStock(String orderId);
}

View File

@ -67,6 +67,7 @@ import co.yixiang.modules.order.vo.OrderDataVo;
import co.yixiang.modules.order.vo.ShoperOrderTimeDataVo;
import co.yixiang.modules.order.vo.UserOrderCountVo;
import co.yixiang.modules.order.vo.YxStoreOrderQueryVo;
import co.yixiang.modules.product.domain.YxStoreProduct;
import co.yixiang.modules.product.domain.YxStoreProductReply;
import co.yixiang.modules.product.service.YxStoreProductReplyService;
import co.yixiang.modules.product.service.YxStoreProductService;
@ -692,6 +693,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
price.doubleValue(),
NumberUtil.add(price,userQueryVo.getNowMoney()).doubleValue(),
"订单退款到余额"+price+"",orderQueryVo.getId().toString());
this.retrunStock(orderQueryVo.getOrderId());
}
orderStatusService.create(orderQueryVo.getId(),OrderLogEnum.REFUND_ORDER_SUCCESS.getValue(),"退款给用户:"+price +"");
@ -2124,6 +2126,14 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
return map;
}
@Override
public void retrunStock(String orderId) {
YxStoreOrderQueryVo order = this.getOrderInfo(orderId,null);
this.regressionIntegral(order);
this.regressionStock(order);
this.regressionCoupon(order);
}
@Override
public Map<String, Object> queryAll(YxStoreOrderQueryCriteria criteria, Pageable pageable) {
getPage(pageable);