Commit 4f86eeab by huluobin

次卡

parent 4aeb2913
......@@ -336,11 +336,11 @@ public class MarketServiceImpl implements MarketService {
.list(new LambdaQueryWrapper<TimesCardUsedRecord>()
.eq(TimesCardUsedRecord::getOrderId, orderId)
.eq(TimesCardUsedRecord::getStatus, 1));
timesCardUsedRecordList.forEach(timesCardUsedRecord -> timesCardUsedRecord.setStatus(TimesCardUsedRecord.STATUS_USED));
if (ListUtil.isNotEmpty(timesCardUsedRecordList)) {
timesCardUsedRecordService.saveOrUpdateBatch(timesCardUsedRecordList);
//更新使用次数
TimesCardCustomerRelevance timesCardCustomerRelevance = timesCardCustomerRelevanceService.getById(timesCardUsedRecordList.stream().findAny().orElseThrow(NullPointerException::new).getCardRelevanceCustomerId());
timesCardUsedRecordList.forEach(timesCardUsedRecord -> {
timesCardUsedRecord.setStatus(TimesCardUsedRecord.STATUS_USED);
timesCardUsedRecordService.updateById(timesCardUsedRecord);
TimesCardCustomerRelevance timesCardCustomerRelevance = timesCardCustomerRelevanceService.getById(timesCardUsedRecord.getCardRelevanceCustomerId());
timesCardCustomerRelevance.setUsedTimes(timesCardCustomerRelevance.getUsedTimes() + 1);
if (timesCardCustomerRelevance.getUsedTimes().equals(timesCardCustomerRelevance.getSumTimes())) {
//次数用完
......@@ -348,7 +348,7 @@ public class MarketServiceImpl implements MarketService {
}
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