Commit f59dae0e by 吕明尚

修改数据统计

parent 199dcfb3
......@@ -5,6 +5,7 @@ import share.system.domain.SOrder;
import share.system.domain.vo.OrderVo;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Data
......@@ -50,7 +51,7 @@ public class OrderStatisticsResponse {
//积分退款
private BigDecimal integralRefundFee = BigDecimal.ZERO;
//订单集合
private List<SOrder> orderList;
private List<OrderVo> orderVoList;
private List<SOrder> orderList = new ArrayList<>();
private List<OrderVo> orderVoList = new ArrayList<>();
}
......@@ -112,7 +112,7 @@ public class RoomStatusServiceImpl implements RoomStatusService {
queryWrapper.ge(SOrder::getEndDate, DateUtils.addMinutes(DateUtils.getNowDate(), -15));
SOrder one = orderService.getOne(queryWrapper);
if (ObjectUtils.isEmpty(one)) {
isAvailable = false;
isAvailable = true;
} else {
isAvailable = true;
}
......@@ -298,7 +298,9 @@ public class RoomStatusServiceImpl implements RoomStatusService {
}else{
if (!ObjectUtils.isEmpty(orderId)) {
if (!order.getId().equals(orderId)) {
orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.ROOM_LOCK_DELAY_MINUTE);
if (order.getOrderType().equals(OrderTypeEnum.RENEW.getCode())) {
orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.OPEN_DOOR_AHEAD_HOUR);
}
}
} else {
orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.ROOM_LOCK_DELAY_MINUTE);
......
......@@ -2919,6 +2919,17 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if (!longs.contains(request.getStoreId())) {
throw new RuntimeException("当前用户不是该门店管理人员");
}
List<SOrder> orderList = baseMapper.selectList(new LambdaQueryWrapper<SOrder>()
.eq(SOrder::getStoreId, request.getStoreId())
.eq(SOrder::getIsDelete, YesNoEnum.no.getIndex())
.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex())
.ge(SOrder::getCreateTime, request.getStartTime())
.le(SOrder::getCreateTime, request.getEndTime())
.orderByDesc(SOrder::getCreateTime)
);
if (CollectionUtil.isEmpty(orderList)) {
return new OrderStatisticsResponse();
}
List<Recharge> rechargeList = rechargeService.list(new LambdaQueryWrapper<Recharge>()
.ge(Recharge::getCreateTime, request.getStartTime())
.le(Recharge::getCreateTime, request.getEndTime())
......@@ -2930,14 +2941,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
BigDecimal rechargeAmount = rechargeList.stream().map(Recharge::getRechargeAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
OrderStatisticsResponse statisticsResponse = new OrderStatisticsResponse();
Map<Long, SConsumerCoupon> map = new HashMap<>();
List<SOrder> orderList = baseMapper.selectList(new LambdaQueryWrapper<SOrder>()
.eq(SOrder::getStoreId, request.getStoreId())
.eq(SOrder::getIsDelete, YesNoEnum.no.getIndex())
.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex())
.ge(SOrder::getCreateTime, request.getStartTime())
.le(SOrder::getCreateTime, request.getEndTime())
.orderByDesc(SOrder::getCreateTime)
);
//优惠券id集合,去掉为null的
List<Long> ids = orderList.stream().map(SOrder::getCouponId).filter(Objects::nonNull).collect(Collectors.toList());
List<Long> consumerIds = orderList.stream().map(SOrder::getConsumerId).filter(Objects::nonNull).collect(Collectors.toList());
......
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