Commit bcf1895b by 吕明尚

消费记录BUG

parent e5c0ec0c
...@@ -4,6 +4,7 @@ import java.util.ArrayList; ...@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -58,10 +59,19 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi ...@@ -58,10 +59,19 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
public List<SConsumptionRecordsVo> selectSConsumptionRecordsList(SConsumptionRecords sConsumptionRecords) public List<SConsumptionRecordsVo> selectSConsumptionRecordsList(SConsumptionRecords sConsumptionRecords)
{ {
List<SConsumptionRecordsVo> sConsumptionRecordsList = sConsumptionRecordsMapper.selectSConsumptionRecordsList(sConsumptionRecords); List<SConsumptionRecordsVo> sConsumptionRecordsList = sConsumptionRecordsMapper.selectSConsumptionRecordsList(sConsumptionRecords);
if (CollectionUtils.isEmpty(sConsumptionRecordsList)) {
return new ArrayList<>();
}
//获取消费记录的用户id集合 //获取消费记录的用户id集合
List<Long> collect = sConsumptionRecordsList.stream().map(SConsumptionRecords::getConsumerId).collect(Collectors.toList()); List<Long> collect = sConsumptionRecordsList.stream().map(SConsumptionRecords::getConsumerId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(collect)) {
return new ArrayList<>();
}
//获取用户id集合的用户信息 //获取用户id集合的用户信息
List<SConsumer> sConsumers = sConsumerMapper.selectBatchIds(collect); List<SConsumer> sConsumers = sConsumerMapper.selectBatchIds(collect);
if (CollectionUtils.isEmpty(sConsumers)) {
return new ArrayList<>();
}
List<Long> oredrIds = sConsumptionRecordsList.stream().map(SConsumptionRecords::getOrderId).collect(Collectors.toList()); List<Long> oredrIds = sConsumptionRecordsList.stream().map(SConsumptionRecords::getOrderId).collect(Collectors.toList());
List<SOrder> sOrders = sOrderMapper.selectBatchIds(oredrIds); List<SOrder> sOrders = sOrderMapper.selectBatchIds(oredrIds);
sConsumptionRecordsList.stream().forEach(item -> { sConsumptionRecordsList.stream().forEach(item -> {
......
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