| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.ShopBalanceStatement; |
| | | import com.ruoyi.other.api.domain.ShopPoint; |
| | | import com.ruoyi.other.mapper.ShopBalanceStatementMapper; |
| | |
| | | public ShopCommissionStatisticsVO shopCommissionStatistics(IPage<ShopBalanceStatement> page, ShopBalanceStatement shopBalanceStatement) { |
| | | ShopCommissionStatisticsVO shopCommissionStatisticsVO = new ShopCommissionStatisticsVO(); |
| | | List<ShopBalanceStatement> shopBalanceStatements = this.baseMapper.selectShopBalanceStatementList(shopBalanceStatement); |
| | | |
| | | |
| | | shopBalanceStatements.forEach(s->s.setVariableAmount(s.getVariableAmount().multiply(new BigDecimal(s.getChangeDirection())))); |
| | | Map<Integer, BigDecimal> shopCommissionMap = shopBalanceStatements.stream() |
| | | .collect(Collectors.groupingBy( |
| | | ShopBalanceStatement::getType, |
| | |
| | | shopCommissionStatisticsVO.setTotalServiceCharge(totalServiceCharge); |
| | | BigDecimal totalAmount = totalCommission.add(totalSubordinateCommission).add(totalServiceCharge); |
| | | shopCommissionStatisticsVO.setTotalAmount(totalAmount); |
| | | |
| | | IPage<ShopBalanceStatement> statementIPage = this.baseMapper.queryShopBalanceStatementPage(page, shopBalanceStatement); |
| | | for (ShopBalanceStatement record : statementIPage.getRecords()) { |
| | | if (record.getChangeDirection() == -1){ |
| | |
| | | shopCommissionStatisticsVO.setStatementIPage(statementIPage); |
| | | return shopCommissionStatisticsVO; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取余额明细列表 |
| | | * @param type |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<ShopBalanceStatement> shopCommissionStatisticslist(Integer shopId, Integer type, Integer pageNum, Integer pageSize) { |
| | | PageInfo<ShopBalanceStatement> pageInfo = new PageInfo<>(pageNum, pageSize); |
| | | return this.baseMapper.shopCommissionStatisticslist(pageInfo, shopId, type); |
| | | } |
| | | } |