| | |
| | | if (type == null) { |
| | | List<ShopBalanceStatement> list = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId, objectId).eq(ShopBalanceStatement::getType, 3).list(); |
| | | List<ShopBalanceStatement> list1 = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId, objectId).eq(ShopBalanceStatement::getType, 1).list(); |
| | | List<ShopBalanceStatementCopy> list3 = shopBalanceStatementCopyMapper.selectList(new LambdaQueryWrapper<ShopBalanceStatementCopy>().eq(ShopBalanceStatementCopy::getShopId, objectId).eq(ShopBalanceStatementCopy::getType, 3)); |
| | | List<ShopBalanceStatementCopy> list4 = shopBalanceStatementCopyMapper.selectList(new LambdaQueryWrapper<ShopBalanceStatementCopy>().eq(ShopBalanceStatementCopy::getShopId, objectId).eq(ShopBalanceStatementCopy::getType, 1)); |
| | | |
| | | BigDecimal bigDecimal1 = new BigDecimal(0); |
| | | for (ShopBalanceStatement shopBalanceStatement : list) { |
| | | bigDecimal1 = bigDecimal1.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatementCopy shopBalanceStatement : list3) { |
| | | bigDecimal1 = bigDecimal1.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatement shopBalanceStatement : list1) { |
| | | bigDecimal1 = bigDecimal1.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatementCopy shopBalanceStatement : list4) { |
| | | bigDecimal1 = bigDecimal1.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | dto.setBigDecimal1(bigDecimal1); |
| | |
| | | for (ShopBalanceStatement shopBalanceStatement : list) { |
| | | bigDecimal2 = bigDecimal2.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatementCopy shopBalanceStatement : list3) { |
| | | bigDecimal2 = bigDecimal2.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | dto.setBigDecimal2(bigDecimal2); |
| | | |
| | | BigDecimal bigDecimal3 = new BigDecimal(0); |
| | | for (ShopBalanceStatement shopBalanceStatement : list1) { |
| | | bigDecimal3 = bigDecimal3.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatementCopy shopBalanceStatement : list4) { |
| | | bigDecimal3 = bigDecimal3.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | dto.setBigDecimal3(bigDecimal3); |
| | | |
| | | List<ShopBalanceStatement> list2 = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId, objectId).eq(ShopBalanceStatement::getType, 2).list(); |
| | | List<ShopBalanceStatementCopy> list5 = shopBalanceStatementCopyMapper.selectList(new LambdaQueryWrapper<ShopBalanceStatementCopy>().eq(ShopBalanceStatementCopy::getShopId, objectId).eq(ShopBalanceStatementCopy::getType, 2)); |
| | | BigDecimal bigDecimal4 = new BigDecimal(0); |
| | | for (ShopBalanceStatement shopBalanceStatement : list2) { |
| | | bigDecimal4 = bigDecimal4.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatementCopy shopBalanceStatement : list5) { |
| | | bigDecimal4 = bigDecimal4.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | dto.setBigDecimal4(bigDecimal4); |
| | |
| | | // 关联用户分拥 |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | List<ShopBalanceStatement> list1 = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId, objectId).eq(ShopBalanceStatement::getType, 1).list(); |
| | | List<ShopBalanceStatementCopy> list4 = shopBalanceStatementCopyMapper.selectList(new LambdaQueryWrapper<ShopBalanceStatementCopy>().eq(ShopBalanceStatementCopy::getShopId, objectId).eq(ShopBalanceStatementCopy::getType, 1)); |
| | | for (ShopBalanceStatement shopBalanceStatement : list1) { |
| | | bigDecimal = bigDecimal.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatementCopy shopBalanceStatement : list4) { |
| | | bigDecimal = bigDecimal.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | dto.setBigDecimal3(bigDecimal); |
| | |
| | | // 下级门店分佣 |
| | | BigDecimal bigDecimal2 = new BigDecimal(0); |
| | | List<ShopBalanceStatement> list2 = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId, objectId).eq(ShopBalanceStatement::getType, 2).list(); |
| | | List<ShopBalanceStatementCopy> list5 = shopBalanceStatementCopyMapper.selectList(new LambdaQueryWrapper<ShopBalanceStatementCopy>().eq(ShopBalanceStatementCopy::getShopId, objectId).eq(ShopBalanceStatementCopy::getType, 2)); |
| | | for (ShopBalanceStatement shopBalanceStatement : list2) { |
| | | bigDecimal2 = bigDecimal2.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatementCopy shopBalanceStatement : list5) { |
| | | bigDecimal2 = bigDecimal2.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | dto.setBigDecimal4(bigDecimal2); |
| | |
| | | case 3: |
| | | // 服务费分佣 |
| | | List<ShopBalanceStatement> list = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId, objectId).eq(ShopBalanceStatement::getType, 3).list(); |
| | | List<ShopBalanceStatementCopy> list6 = shopBalanceStatementCopyMapper.selectList(new LambdaQueryWrapper<ShopBalanceStatementCopy>().eq(ShopBalanceStatementCopy::getShopId, objectId).eq(ShopBalanceStatementCopy::getType, 3)); |
| | | BigDecimal bigDecimal3 = new BigDecimal(0); |
| | | for (ShopBalanceStatement shopBalanceStatement : list) { |
| | | bigDecimal3 = bigDecimal3.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | for (ShopBalanceStatementCopy shopBalanceStatement : list6) { |
| | | bigDecimal3 = bigDecimal3.add(shopBalanceStatement.getVariableAmount()); |
| | | } |
| | | dto.setBigDecimal2(bigDecimal3); |
| | | dto.setBigDecimal1(bigDecimal3); |
| | | break; |