|
|
@@ -760,13 +760,18 @@ public class MarketFrontServiceImpl implements MarketFrontService {
|
|
|
|
|
|
public Boolean saveChanceRecord(Long userId, Long orderId, Long goodsId, Long skuId) {
|
|
|
try {
|
|
|
- LuckyDrawSpecificChanceRecord record = new LuckyDrawSpecificChanceRecord();
|
|
|
- record.setUserId(userId);
|
|
|
- record.setOrderId(orderId);
|
|
|
- record.setGoodsId(goodsId);
|
|
|
- record.setSkuId(skuId);
|
|
|
- luckyDrawSpecificChanceRecordMapper.insert(record);
|
|
|
- return true;
|
|
|
+ LuckyDrawSpecificChanceRecord en = luckyDrawSpecificChanceRecordMapper.selectOne(Wrappers.lambdaQuery(LuckyDrawSpecificChanceRecord.class)
|
|
|
+ .eq(LuckyDrawSpecificChanceRecord::getOrderId, orderId).last("limit 1"));
|
|
|
+ if (en == null) {
|
|
|
+ LuckyDrawSpecificChanceRecord record = new LuckyDrawSpecificChanceRecord();
|
|
|
+ record.setUserId(userId);
|
|
|
+ record.setOrderId(orderId);
|
|
|
+ record.setGoodsId(goodsId);
|
|
|
+ record.setSkuId(skuId);
|
|
|
+ luckyDrawSpecificChanceRecordMapper.insert(record);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
} catch (DuplicateKeyException e) {
|
|
|
return false;
|
|
|
}
|