拼团活动:完善 TradeCombinationHandler

This commit is contained in:
puhui999
2023-10-05 19:14:19 +08:00
parent 1bda3c8b53
commit 07d6ab5842
5 changed files with 78 additions and 38 deletions

View File

@@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.promotion.api.bargain;
import cn.iocoder.yudao.module.promotion.api.bargain.dto.BargainRecordCreateReqDTO;
import cn.iocoder.yudao.module.promotion.api.bargain.dto.BargainValidateJoinRespDTO;
import cn.iocoder.yudao.module.promotion.service.bargain.BargainRecordService;
import org.springframework.stereotype.Service;
@@ -18,9 +17,9 @@ public class BargainRecordApiImpl implements BargainRecordApi {
@Resource
private BargainRecordService bargainRecordService;
@Override
public void createBargainRecord(BargainRecordCreateReqDTO reqDTO) {
}
//@Override
//public void createBargainRecord(BargainRecordCreateReqDTO reqDTO) {
//}
@Override
public BargainValidateJoinRespDTO validateJoinBargain(Long userId, Long bargainRecordId, Long skuId) {

View File

@@ -77,12 +77,12 @@ public class BargainRecordServiceImpl implements BargainRecordService {
@Override
public BargainValidateJoinRespDTO validateJoinBargain(Long userId, Long bargainRecordId, Long skuId) {
// 1.1 拼团记录不存在
// 1.1 砍价记录不存在
BargainRecordDO record = bargainRecordMapper.selectByIdAndUserId(bargainRecordId, userId);
if (record == null) {
throw exception(BARGAIN_RECORD_NOT_EXISTS);
}
// 1.2 拼团记录未在进行中
// 1.2 砍价记录未在进行中
if (ObjUtil.notEqual(record.getStatus(), BargainRecordStatusEnum.IN_PROGRESS)) {
throw exception(BARGAIN_JOIN_RECORD_NOT_SUCCESS);
}