trade:启动成功
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.api.combination;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 拼团活动 Api 接口实现类
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Service
|
||||
public class CombinationActivityApiImpl implements CombinationActivityApi {
|
||||
|
||||
}
|
||||
@@ -44,11 +44,6 @@ public class CombinationRecordApiImpl implements CombinationRecordApi {
|
||||
return CombinationRecordStatusEnum.isSuccess(record.getStatus());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRecordStatusToFailed(Long userId, Long orderId) {
|
||||
recordService.updateCombinationRecordStatusByUserIdAndOrderId(CombinationRecordStatusEnum.FAILED.getStatus(), userId, orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId, Long skuId, Integer count) {
|
||||
return recordService.validateJoinCombination(userId, activityId, headId, skuId, count);
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.api.coupon;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.convert.coupon.CouponTemplateConvert;
|
||||
import cn.iocoder.yudao.module.promotion.service.coupon.CouponTemplateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠劵模版 API 接口实现类
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Service
|
||||
public class CouponTemplateApiImpl implements CouponTemplateApi {
|
||||
|
||||
@Resource
|
||||
private CouponTemplateService couponTemplateService;
|
||||
|
||||
@Override
|
||||
public List<CouponTemplateRespDTO> getCouponTemplateListByIds(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) { // 防御一下
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return CouponTemplateConvert.INSTANCE.convertList(couponTemplateService.getCouponTemplateListByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,8 +75,4 @@ public interface CouponTemplateMapper extends BaseMapperX<CouponTemplateDO> {
|
||||
return canTakeConsumer;
|
||||
}
|
||||
|
||||
default List<CouponTemplateDO> selectListByIds(Collection<Long> ids) {
|
||||
return selectList(new LambdaQueryWrapperX<CouponTemplateDO>().in(CouponTemplateDO::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,15 +21,6 @@ import java.util.Map;
|
||||
*/
|
||||
public interface CombinationRecordService {
|
||||
|
||||
/**
|
||||
* 更新拼团状态
|
||||
*
|
||||
* @param status 状态
|
||||
* @param userId 用户编号
|
||||
* @param orderId 订单编号
|
||||
*/
|
||||
void updateCombinationRecordStatusByUserIdAndOrderId(Integer status, Long userId, Long orderId);
|
||||
|
||||
/**
|
||||
* 【下单前】校验是否满足拼团活动条件
|
||||
*
|
||||
@@ -62,15 +53,6 @@ public interface CombinationRecordService {
|
||||
*/
|
||||
CombinationRecordDO getCombinationRecord(Long userId, Long orderId);
|
||||
|
||||
/**
|
||||
* 获取拼团记录
|
||||
*
|
||||
* @param userId 用户 id
|
||||
* @param activityId 活动 id
|
||||
* @return 拼团记录列表
|
||||
*/
|
||||
List<CombinationRecordDO> getCombinationRecordListByUserIdAndActivityId(Long userId, Long activityId);
|
||||
|
||||
/**
|
||||
* 【下单前】校验是否满足拼团活动条件
|
||||
*
|
||||
|
||||
@@ -66,16 +66,6 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
|
||||
@Resource
|
||||
private TradeOrderApi tradeOrderApi;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateCombinationRecordStatusByUserIdAndOrderId(Integer status, Long userId, Long orderId) {
|
||||
// 校验拼团是否存在
|
||||
CombinationRecordDO record = validateCombinationRecord(userId, orderId);
|
||||
|
||||
// 更新状态
|
||||
combinationRecordMapper.updateById(new CombinationRecordDO().setId(record.getId()).setStatus(status));
|
||||
}
|
||||
|
||||
private CombinationRecordDO validateCombinationRecord(Long userId, Long orderId) {
|
||||
// 校验拼团是否存在
|
||||
CombinationRecordDO recordDO = combinationRecordMapper.selectByUserIdAndOrderId(userId, orderId);
|
||||
@@ -229,11 +219,6 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
|
||||
return combinationRecordMapper.selectByUserIdAndOrderId(userId, orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CombinationRecordDO> getCombinationRecordListByUserIdAndActivityId(Long userId, Long activityId) {
|
||||
return combinationRecordMapper.selectListByUserIdAndActivityId(userId, activityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId,
|
||||
Long skuId, Integer count) {
|
||||
|
||||
@@ -8,7 +8,6 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponTemplateDO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTakeTypeEnum;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -92,12 +91,4 @@ public interface CouponTemplateService {
|
||||
List<CouponTemplateDO> getCouponTemplateList(List<Integer> canTakeTypes, Integer productScope,
|
||||
Long productScopeValue, Integer count);
|
||||
|
||||
/**
|
||||
* 获得优惠券模版列表
|
||||
*
|
||||
* @param ids 优惠券模版编号
|
||||
* @return 优惠券模版列表
|
||||
*/
|
||||
List<CouponTemplateDO> getCouponTemplateListByIds(Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -127,9 +127,4 @@ public class CouponTemplateServiceImpl implements CouponTemplateService {
|
||||
return couponTemplateMapper.selectList(canTakeTypes, productScope, productScopeValue, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CouponTemplateDO> getCouponTemplateListByIds(Collection<Long> ids) {
|
||||
return couponTemplateMapper.selectListByIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user