Commit 4f86eeab by huluobin

次卡

parent 4aeb2913
...@@ -336,11 +336,11 @@ public class MarketServiceImpl implements MarketService { ...@@ -336,11 +336,11 @@ public class MarketServiceImpl implements MarketService {
.list(new LambdaQueryWrapper<TimesCardUsedRecord>() .list(new LambdaQueryWrapper<TimesCardUsedRecord>()
.eq(TimesCardUsedRecord::getOrderId, orderId) .eq(TimesCardUsedRecord::getOrderId, orderId)
.eq(TimesCardUsedRecord::getStatus, 1)); .eq(TimesCardUsedRecord::getStatus, 1));
timesCardUsedRecordList.forEach(timesCardUsedRecord -> timesCardUsedRecord.setStatus(TimesCardUsedRecord.STATUS_USED)); timesCardUsedRecordList.forEach(timesCardUsedRecord -> {
if (ListUtil.isNotEmpty(timesCardUsedRecordList)) { timesCardUsedRecord.setStatus(TimesCardUsedRecord.STATUS_USED);
timesCardUsedRecordService.saveOrUpdateBatch(timesCardUsedRecordList); timesCardUsedRecordService.updateById(timesCardUsedRecord);
//更新使用次数
TimesCardCustomerRelevance timesCardCustomerRelevance = timesCardCustomerRelevanceService.getById(timesCardUsedRecordList.stream().findAny().orElseThrow(NullPointerException::new).getCardRelevanceCustomerId()); TimesCardCustomerRelevance timesCardCustomerRelevance = timesCardCustomerRelevanceService.getById(timesCardUsedRecord.getCardRelevanceCustomerId());
timesCardCustomerRelevance.setUsedTimes(timesCardCustomerRelevance.getUsedTimes() + 1); timesCardCustomerRelevance.setUsedTimes(timesCardCustomerRelevance.getUsedTimes() + 1);
if (timesCardCustomerRelevance.getUsedTimes().equals(timesCardCustomerRelevance.getSumTimes())) { if (timesCardCustomerRelevance.getUsedTimes().equals(timesCardCustomerRelevance.getSumTimes())) {
//次数用完 //次数用完
...@@ -348,7 +348,7 @@ public class MarketServiceImpl implements MarketService { ...@@ -348,7 +348,7 @@ public class MarketServiceImpl implements MarketService {
} }
timesCardCustomerRelevanceService.updateById(timesCardCustomerRelevance); timesCardCustomerRelevanceService.updateById(timesCardCustomerRelevance);
} });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment