奖品兑换需求
This commit is contained in:
@@ -22,6 +22,7 @@ import com.sqx.modules.discSpinning.dao.DiscSpinningRecordDao;
|
||||
import com.sqx.modules.discSpinning.entity.DiscSpinningRecord;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
@@ -75,6 +76,7 @@ public class UserPrizeExchangeServiceImpl extends ServiceImpl<UserPrizeExchangeD
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void exchange(Long currentUserId, UserPrizeExchange dto) {
|
||||
if (dto.getDiscSpinningRecordId() == null) {
|
||||
throw new SqxException("中奖记录ID不能为空");
|
||||
@@ -120,6 +122,9 @@ public class UserPrizeExchangeServiceImpl extends ServiceImpl<UserPrizeExchangeD
|
||||
dto.setStatus(0);
|
||||
dto.setCreateTime(new Date());
|
||||
baseMapper.insert(dto);
|
||||
record.setTarget("3");
|
||||
record.setTargetId(dto.getId());
|
||||
discSpinningRecordDao.updateById(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user