|
@@ -2,6 +2,7 @@ package shop.alien.store.service.impl;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -262,20 +263,12 @@ public class StoreServiceFeeRuleServiceImpl implements StoreServiceFeeRuleServic
|
|
|
if (id == null) {
|
|
if (id == null) {
|
|
|
return R.fail("规则ID不能为空");
|
|
return R.fail("规则ID不能为空");
|
|
|
}
|
|
}
|
|
|
- StoreServiceFeeRule existing = ruleMapper.selectById(id);
|
|
|
|
|
- if (existing == null) {
|
|
|
|
|
- return R.fail("服务费规则不存在");
|
|
|
|
|
- }
|
|
|
|
|
- ruleMapper.delete(new LambdaQueryWrapper<StoreServiceFeeRule>()
|
|
|
|
|
- .eq(StoreServiceFeeRule::getStoreId, existing.getStoreId())
|
|
|
|
|
- .eq(StoreServiceFeeRule::getFeeName, existing.getFeeName())
|
|
|
|
|
- .eq(StoreServiceFeeRule::getFeeType, existing.getFeeType())
|
|
|
|
|
- .eq(StoreServiceFeeRule::getFeeValue, existing.getFeeValue())
|
|
|
|
|
- .eq(StoreServiceFeeRule::getStatus, existing.getStatus())
|
|
|
|
|
- .eq(StoreServiceFeeRule::getEffectiveMode, existing.getEffectiveMode())
|
|
|
|
|
- .eq(StoreServiceFeeRule::getStartDate, existing.getStartDate())
|
|
|
|
|
- .eq(StoreServiceFeeRule::getEndDate, existing.getEndDate()));
|
|
|
|
|
- return R.data(true);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ LambdaUpdateWrapper<StoreServiceFeeRule> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
|
+ updateWrapper.eq(StoreServiceFeeRule::getId, id);
|
|
|
|
|
+ updateWrapper.set(StoreServiceFeeRule::getDeleteFlag, 1);
|
|
|
|
|
+ int result = ruleMapper.update(null, updateWrapper);
|
|
|
|
|
+ return R.data(result > 0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|