From 50b5ffdb74872a188c6dbd5ebb4e5bf1b51a8e0d Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 27 Sep 2019 22:26:54 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BA=93=E5=AD=98][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E8=BF=94=E5=9B=9Ebug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/service/WxCouponService.java | 9 +++++---- .../iformall/service/impl/WxCouponSendServiceImpl.java | 4 ++-- .../com/iformall/service/impl/WxCouponServiceImpl.java | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java index 308922c7a..ac4707e4b 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java @@ -209,18 +209,19 @@ public interface WxCouponService { * 库存减少 * * @param id 券ID - * @param remainInventory 当前库存 * @param number 减少数量 + * @param remainInventory 当前库存 + */ - void reduceRemainInventory(Long id, Integer remainInventory, Integer number); + void reduceRemainInventory(Long id, Integer number, Integer remainInventory); /** * 库存退回 * * @param id 券ID - * @param remainInventory 当前库存 * @param number 回退数量 + * @param remainInventory 当前库存 */ - void backRemainInventory(Long id, Integer remainInventory, Integer number); + void backRemainInventory(Long id, Integer number, Integer remainInventory); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java index 66bb348c7..24942c046 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java @@ -177,7 +177,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { } //更新库存 - wxCouponService.reduceRemainInventory(wxCouponOfDb.getId(), wxCouponOfDb.getRemainInventory(), merchantLnventory); + wxCouponService.reduceRemainInventory(wxCouponOfDb.getId(), merchantLnventory, wxCouponOfDb.getRemainInventory()); } @Override @@ -206,7 +206,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { } //退回coupon库存 if(merchantRemain!=0) { - wxCouponService.backRemainInventory(queryById.getId(), wxCouponOfDb.getRemainInventory(), merchantRemain); + wxCouponService.backRemainInventory(queryById.getId(), merchantRemain, wxCouponOfDb.getRemainInventory()); } } wxCouponSendMapper.updateByPrimaryKeySelective(record); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index a373b9238..ccb1a0a70 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -693,7 +693,7 @@ public class WxCouponServiceImpl implements WxCouponService { @Override @Transactional(isolation= Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) - public void reduceRemainInventory(Long id, Integer remainInventory, Integer number) { + public void reduceRemainInventory(Long id, Integer number, Integer remainInventory) { int num = wxCouponMapper.reduceInventory(id, number, remainInventory); if (num == 0) { throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); @@ -702,7 +702,7 @@ public class WxCouponServiceImpl implements WxCouponService { @Override @Transactional(isolation= Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) - public void backRemainInventory(Long id, Integer remainInventory, Integer number) { + public void backRemainInventory(Long id, Integer number, Integer remainInventory) { int num = wxCouponMapper.backInventory(id, number, remainInventory); if (num == 0) { throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL);