mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-25 01:29:47 +08:00
update 添加更新时间字段
This commit is contained in:
@@ -161,6 +161,7 @@ public class MemberGroupController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据memberGroup查询车辆消费记录
|
* 根据memberGroup查询车辆消费记录
|
||||||
|
* /member/memberGroup/queryMemberGroupConsumptionList
|
||||||
*/
|
*/
|
||||||
@PostMapping("/queryMemberGroupConsumptionList")
|
@PostMapping("/queryMemberGroupConsumptionList")
|
||||||
public TableDataInfo queryMemberGroupConsumptionList(@RequestBody MemberGroupDTO dto) {
|
public TableDataInfo queryMemberGroupConsumptionList(@RequestBody MemberGroupDTO dto) {
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,7 +313,10 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
|||||||
Map<String, List<OrderBasicInfo>> listMap = orderList.stream().collect(Collectors.groupingBy(OrderBasicInfo::getMemberId));
|
Map<String, List<OrderBasicInfo>> listMap = orderList.stream().collect(Collectors.groupingBy(OrderBasicInfo::getMemberId));
|
||||||
MemberGroupConsumptionVO vo = null;
|
MemberGroupConsumptionVO vo = null;
|
||||||
for (Map.Entry<String, List<OrderBasicInfo>> entry : listMap.entrySet()) {
|
for (Map.Entry<String, List<OrderBasicInfo>> entry : listMap.entrySet()) {
|
||||||
List<OrderBasicInfo> orderBasicInfoList = entry.getValue();
|
// 订单根据结算时间倒序,结算时间为null的排在最后(null在前,结算日期正序,之后整个list反转)
|
||||||
|
List<OrderBasicInfo> orderBasicInfoList = entry.getValue().stream()
|
||||||
|
.sorted(Comparator.comparing(OrderBasicInfo::getSettlementTime, Comparator.nullsFirst(Comparator.reverseOrder())))
|
||||||
|
.collect(Collectors.toList());
|
||||||
if (CollectionUtils.isEmpty(orderBasicInfoList)) {
|
if (CollectionUtils.isEmpty(orderBasicInfoList)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -324,11 +325,13 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
|||||||
String vinCode = null;
|
String vinCode = null;
|
||||||
String licensePlateNumber = null;
|
String licensePlateNumber = null;
|
||||||
BigDecimal totalConsumptionAmount = BigDecimal.ZERO;
|
BigDecimal totalConsumptionAmount = BigDecimal.ZERO;
|
||||||
|
Date date = DateUtils.getNowDate();
|
||||||
for (int i = 0; i < orderBasicInfoList.size(); i++) {
|
for (int i = 0; i < orderBasicInfoList.size(); i++) {
|
||||||
OrderBasicInfo orderBasicInfo = orderBasicInfoList.get(i);
|
OrderBasicInfo orderBasicInfo = orderBasicInfoList.get(i);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
vinCode = orderBasicInfo.getVinCode();
|
vinCode = orderBasicInfo.getVinCode();
|
||||||
licensePlateNumber = orderBasicInfo.getPlateNumber();
|
licensePlateNumber = orderBasicInfo.getPlateNumber();
|
||||||
|
date = orderBasicInfo.getSettlementTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 订单消费金额
|
// 订单消费金额
|
||||||
@@ -343,6 +346,7 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
|||||||
vo.setVinCode(vinCode);
|
vo.setVinCode(vinCode);
|
||||||
vo.setLicensePlateNumber(licensePlateNumber);
|
vo.setLicensePlateNumber(licensePlateNumber);
|
||||||
vo.setTotalConsumptionAmount(totalConsumptionAmount.toString());
|
vo.setTotalConsumptionAmount(totalConsumptionAmount.toString());
|
||||||
|
vo.setLastDate(DateUtils.formatDateTime(date));
|
||||||
}
|
}
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,9 @@ public class MemberGroupConsumptionVO {
|
|||||||
* 总消费金额
|
* 总消费金额
|
||||||
*/
|
*/
|
||||||
private String totalConsumptionAmount;
|
private String totalConsumptionAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最近一笔订单的消费时间
|
||||||
|
*/
|
||||||
|
private String lastDate;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user