|
|
@@ -2,6 +2,7 @@ package shop.alien.store.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
@@ -85,6 +86,7 @@ public class StorePlatformBenefitsServiceImpl extends ServiceImpl<StorePlatformB
|
|
|
virtualCurrency.setStatus(0);
|
|
|
virtualCurrency.setCreatedTime(new Date());
|
|
|
virtualCurrency.setCreatedUserId(userId);
|
|
|
+ virtualCurrency.setQuantity(benefits.getVirtualCurrencyAmount());
|
|
|
virtualCurrencyMapper.insert(virtualCurrency);
|
|
|
|
|
|
benefits.setBusinessId(virtualCurrency.getId().toString());
|
|
|
@@ -116,6 +118,7 @@ public class StorePlatformBenefitsServiceImpl extends ServiceImpl<StorePlatformB
|
|
|
virtualCurrency.setName(benefits.getName());
|
|
|
virtualCurrency.setUpdatedTime(new Date());
|
|
|
virtualCurrency.setUpdatedUserId(userId);
|
|
|
+ virtualCurrency.setQuantity(benefits.getVirtualCurrencyAmount());
|
|
|
virtualCurrencyMapper.updateById(virtualCurrency);
|
|
|
}
|
|
|
|
|
|
@@ -131,7 +134,9 @@ public class StorePlatformBenefitsServiceImpl extends ServiceImpl<StorePlatformB
|
|
|
benefits.setId(id);
|
|
|
benefits.setDeleteFlag(1);
|
|
|
benefits.setUpdatedTime(new Date());
|
|
|
- return benefitsMapper.updateById(benefits);
|
|
|
+ UpdateWrapper<StorePlatformBenefits> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("id", id).set("delete_flag", 1).set("updated_time", new Date());
|
|
|
+ return benefitsMapper.update(null, updateWrapper);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -166,9 +171,9 @@ public class StorePlatformBenefitsServiceImpl extends ServiceImpl<StorePlatformB
|
|
|
}
|
|
|
|
|
|
// 检查福利状态:必须是审核通过(status=2)
|
|
|
- if (benefits.getStatus() == null || benefits.getStatus() != 2) {
|
|
|
- throw new RuntimeException("福利未审核通过,无法领取");
|
|
|
- }
|
|
|
+// if (benefits.getStatus() == null || benefits.getStatus() != 2) {
|
|
|
+// throw new RuntimeException("福利未审核通过,无法领取");
|
|
|
+// }
|
|
|
|
|
|
// 检查删除标记
|
|
|
if (benefits.getDeleteFlag() != null && benefits.getDeleteFlag() == 1) {
|
|
|
@@ -226,7 +231,7 @@ public class StorePlatformBenefitsServiceImpl extends ServiceImpl<StorePlatformB
|
|
|
throw new RuntimeException("优惠券信息不存在");
|
|
|
}
|
|
|
|
|
|
- LifeDiscountCoupon lifeDiscountCoupon = lifeDiscountCouponMapper.selectById(benefitsId);
|
|
|
+ LifeDiscountCoupon lifeDiscountCoupon = lifeDiscountCouponMapper.selectById(benefits.getBusinessId());
|
|
|
if (lifeDiscountCoupon == null) {
|
|
|
throw new RuntimeException("优惠券不存在");
|
|
|
}
|