定时任务修改
This commit is contained in:
@@ -60,8 +60,8 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl<ShopOrderStatisti
|
||||
|
||||
// 统计充值记录
|
||||
Map<Long, BigDecimal> flowMap = shopUserFlowService.list(new QueryWrapper()
|
||||
.ge(ShopUserFlow::getCreateTime, startOfDay)
|
||||
.le(ShopUserFlow::getCreateTime, endOfDay)
|
||||
.ge(ShopUserFlow::getCreateTime, startOfDay.toLocalDateTime())
|
||||
.le(ShopUserFlow::getCreateTime, endOfDay.toLocalDateTime())
|
||||
.in(ShopUserFlow::getBizCode, CollUtil.newArrayList("cashIn", "wechatIn", "alipayIn", "awardIn"))).stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
ShopUserFlow::getShopId,
|
||||
@@ -138,13 +138,17 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl<ShopOrderStatisti
|
||||
// 充值金额
|
||||
// statistic.setRechargeAmount(BigDecimal.ZERO);
|
||||
//客单价
|
||||
statistic.setCustomerUnitPrice(totalAmount.divide(totalCount, 2, RoundingMode.DOWN));
|
||||
if (totalAmount.compareTo(BigDecimal.ZERO) != 0) {
|
||||
statistic.setCustomerUnitPrice(totalAmount.divide(totalCount, 2, RoundingMode.DOWN));
|
||||
}
|
||||
|
||||
// 查询台桌数量
|
||||
long count = shopTableService.count(new QueryWrapper().eq(ShopTable::getShopId, shopId));
|
||||
|
||||
//翻台率
|
||||
statistic.setTableTurnoverRate(totalCount.subtract(BigDecimal.valueOf(count)).divide(BigDecimal.valueOf(count), 2, RoundingMode.DOWN).multiply(BigDecimal.valueOf(100)));
|
||||
if (count > 0) {
|
||||
statistic.setTableTurnoverRate(totalCount.subtract(BigDecimal.valueOf(count)).divide(BigDecimal.valueOf(count), 2, RoundingMode.DOWN).multiply(BigDecimal.valueOf(100)));
|
||||
}
|
||||
statistic.setUpdateTime(LocalDateTime.now());
|
||||
BeanUtil.copyProperties(info, statistic);
|
||||
saveOrUpdate(statistic);
|
||||
|
||||
Reference in New Issue
Block a user