Просмотр исходного кода

[库存][修改]:库存返回bug修复

release_toaliyun_real
Stormeye Wu 6 лет назад
Родитель
Сommit
50b5ffdb74
3 измененных файлов: 9 добавлений и 8 удалений
  1. +5
    -4
      mallinkService/src/main/java/com/iformall/service/WxCouponService.java
  2. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java
  3. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java

+ 5
- 4
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);

}

+ 2
- 2
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);


+ 2
- 2
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);


Загрузка…
Отмена
Сохранить