This commit is contained in:
Lemon
2024-08-05 14:10:04 +08:00
parent a93d86bfff
commit 7b4b657faa
4 changed files with 71 additions and 36 deletions

View File

@@ -781,9 +781,9 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
// 获取type类型
String type = dto.getType();
// 获取站点id如果为空则默认查询该账号下所有站点
String stationId = dto.getStationId();
List<String> stationIds = new ArrayList<>();
if (stationId == null) {
// String stationId = dto.getStationId();
List<String> stationIds = dto.getStationIds();
if (CollectionUtils.isNotEmpty(stationIds)) {
List<MerchantInfoVO> merchantInfoVOList = UserUtils.getMerchantInfoVOList();
List<String> merchantIds = merchantInfoVOList.stream()
.map(MerchantInfoVO::getMerchantId)
@@ -797,8 +797,6 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
// 未查到该运营商下的站点
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
}
} else {
stationIds.add(stationId);
}
// 日期区间
String startTime = null;
@@ -824,7 +822,9 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
// 根据站点ids和日期区间查询订单详情
List<BusinessOrderDetailInfoVO> orderDetails = orderBasicInfoService.getOrderDetailByStationIds(stationIds, startTime, endTime);
if (CollectionUtils.isEmpty(orderDetails)) {
return new StationBusinessAnalyzeInfoVO();
}
for (BusinessOrderDetailInfoVO orderDetail : orderDetails) {
if (orderDetail.getSharpAmount() == null) {
orderDetail.setSharpAmount(BigDecimal.ZERO);
@@ -961,12 +961,13 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
// 获取目标日期(年-月)
String dateTime = dto.getDateTime();
// 设置开始时间、结束时间
String stationId = dto.getStationId();
// String stationId = dto.getStationId();
List<String> stationIds = dto.getStationIds();
String startTime = DateUtils.getLastDayOfCurrentMonth(); // 去年月份第一天
String endTime = DateUtils.getFirstDayOfLastYearMonth(); // 当前月份最后一天
// 查询订单日报表过去一年的数据
List<SettleOrderReport> list = settleOrderReportService.queryOrderReport(Lists.newArrayList(stationId), startTime, endTime);
List<SettleOrderReport> list = settleOrderReportService.queryOrderReport(stationIds, startTime, endTime);
// 按照日期汇总数据
Map<String, SettleOrderReport> collect = list.stream()
.peek(report -> {
@@ -1034,5 +1035,4 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
return vo;
}
}
}

View File

@@ -35,7 +35,13 @@ public class StationBusinessAnalyzeInfoVO {
*/
private String serviceAmountGrowthRate;
/**
* 运营端小程序订单详情VO
*/
private List<BusinessOrderDetailInfoVO> businessOrderDetailInfoVOList;
/**
* 结算订单报表
*/
private List<SettleOrderReport> settleOrderReportList;
}