| | |
| | | // 司机消费 |
| | | List<BalanceUsageRecord> balanceUsageRecords = new ArrayList<>(); |
| | | // 司机提现 |
| | | List<BalanceUsageRecord> driverWithdrawal = new ArrayList<>(); |
| | | List<TPubWithdrawal> driverWithdrawal = new ArrayList<>(); |
| | | |
| | | Wrapper<TPubWithdrawal> driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | ; |
| | |
| | | // 司机已消费金额 |
| | | Wrapper<BalanceUsageRecord> between4 = new EntityWrapper<BalanceUsageRecord>() |
| | | ; |
| | | // 司机提现 |
| | | Wrapper<BalanceUsageRecord> between44 = new EntityWrapper<BalanceUsageRecord>() |
| | | ; |
| | | if (time!=null && time == 5){ |
| | | if (time == 5 && insertTime==null){ |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("userType", 2) |
| | |
| | | between4 = new EntityWrapper<BalanceUsageRecord>() |
| | | .ne("purpose", 6); |
| | | // 司机提现 |
| | | between44 = new EntityWrapper<BalanceUsageRecord>() |
| | | .eq("purpose", 6); |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("userType", 2) |
| | | ; |
| | | }else{ |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("userType", 2) |
| | | .between("handleTime", start, end); |
| | | .between("insertTime", start, end); |
| | | // 专车wrapper |
| | | between = new EntityWrapper<TOrderPrivateCar>() |
| | | .isNotNull("activityId") |
| | |
| | | .ne("purpose", 6) |
| | | .between("createTime", start, end); |
| | | // 司机提现 |
| | | between44 = new EntityWrapper<BalanceUsageRecord>() |
| | | .eq("purpose", 6) |
| | | .between("createTime", start, end); |
| | | |
| | | } |
| | | // 司机提现wrapper |
| | | if (type!=null){ |
| | |
| | | case 3: |
| | | // 司机消费记录 |
| | | balanceUsageRecords = balanceUsageRecordService.selectList(between4); |
| | | |
| | | driverWithdrawal = balanceUsageRecordService.selectList(between44); |
| | | driverWithdrawal = pubWithdrawalService.selectList(driverWrapper); |
| | | break; |
| | | case 4: |
| | | // 专车订单 |
| | |
| | | // 消费 |
| | | balanceUsageRecords = balanceUsageRecordService.selectList(between4); |
| | | // 提现 |
| | | driverWithdrawal = balanceUsageRecordService.selectList(between44); |
| | | driverWithdrawal = pubWithdrawalService.selectList(driverWrapper); |
| | | } |
| | | |
| | | // 已发放补贴总额 |
| | |
| | | GrantVO grantVO = new GrantVO(); |
| | | grantVO.setInsertTime(format.format(userCouponRecord.getInsertTime())); |
| | | grantVO.setType("优惠券"); |
| | | grantVO.setAmount(userCouponRecord.getPayMoney().toString()); |
| | | grantVO.setAmount(userCouponRecord.getCouponMoney().toString()); |
| | | TUser tUser = appUserService.selectById(userCouponRecord.getUserId()); |
| | | if (tUser!=null){ |
| | | grantVO.setName(tUser.getNickName()); |
| | |
| | | GrantVO grantVO = new GrantVO(); |
| | | grantVO.setInsertTime(format.format(userCouponRecord.getInsertTime())); |
| | | grantVO.setType("优惠券"); |
| | | grantVO.setAmount(userCouponRecord.getPayMoney().toString()); |
| | | grantVO.setAmount(userCouponRecord.getCouponMoney().toString()); |
| | | TUser tUser = appUserService.selectById(userCouponRecord.getUserId()); |
| | | if (tUser!=null){ |
| | | grantVO.setName(tUser.getNickName()); |
| | |
| | | res.add(grantVO); |
| | | } |
| | | // 司机提现 |
| | | for (BalanceUsageRecord balanceUsageRecord : driverWithdrawal) { |
| | | for (TPubWithdrawal balanceUsageRecord : driverWithdrawal) { |
| | | GrantVO grantVO = new GrantVO(); |
| | | grantVO.setInsertTime(format.format(balanceUsageRecord.getCreateTime())); |
| | | grantVO.setInsertTime(format.format(balanceUsageRecord.getInsertTime())); |
| | | grantVO.setType("司机奖励"); |
| | | grantVO.setAmount(balanceUsageRecord.getMoney().toString()); |
| | | TDriver tUser = driverService.selectById(balanceUsageRecord.getDriverId()); |
| | | TDriver tUser = driverService.selectById(balanceUsageRecord.getUserId()); |
| | | if (tUser!=null){ |
| | | grantVO.setName(tUser.getFirstName()+tUser.getLastName()); |
| | | } |
| | | switch (balanceUsageRecord.getPurpose()){ |
| | | case 6: |
| | | grantVO.setRemark("司机提现"); |
| | | break; |
| | | } |
| | | grantVO.setRemark("司机提现"); |
| | | driverWithdrawal1 = driverWithdrawal1.add(new BigDecimal(balanceUsageRecord.getMoney().toString())); |
| | | res.add(grantVO); |
| | | } |
| | |
| | | // 司机消费 |
| | | List<BalanceUsageRecord> balanceUsageRecords = new ArrayList<>(); |
| | | // 司机提现 |
| | | List<BalanceUsageRecord> driverWithdrawal = new ArrayList<>(); |
| | | List<TPubWithdrawal> driverWithdrawal = new ArrayList<>(); |
| | | Wrapper<TPubWithdrawal> driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | ; |
| | | // 专车wrapper |
| | |
| | | Wrapper<BalanceUsageRecord> between4 = new EntityWrapper<BalanceUsageRecord>() |
| | | ; |
| | | // 司机提现 |
| | | Wrapper<BalanceUsageRecord> between44 = new EntityWrapper<BalanceUsageRecord>() |
| | | Wrapper<TPubWithdrawal> between44 = new EntityWrapper<TPubWithdrawal>() |
| | | ; |
| | | if (time!=null && time == 5){ |
| | | if (time == 5 && insertTime==null){ |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("userType", 2) |
| | |
| | | // 司机已消费金额 |
| | | between4 = new EntityWrapper<BalanceUsageRecord>() |
| | | .ne("purpose", 6); |
| | | // 司机提现 |
| | | between44 = new EntityWrapper<BalanceUsageRecord>() |
| | | .eq("purpose", 6); |
| | | |
| | | }else{ |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("userType", 2) |
| | | .between("handleTime", start, end); |
| | | .between("insertTime", start, end); |
| | | // 专车wrapper |
| | | between = new EntityWrapper<TOrderPrivateCar>() |
| | | .isNotNull("activityId") |
| | |
| | | between4 = new EntityWrapper<BalanceUsageRecord>() |
| | | .ne("purpose", 6) |
| | | .between("createTime", start, end); |
| | | // 司机提现 |
| | | between44 = new EntityWrapper<BalanceUsageRecord>() |
| | | .eq("purpose", 6) |
| | | .between("createTime", start, end); |
| | | } |
| | | |
| | | if (type!=null){ |
| | |
| | | // 司机消费记录 |
| | | balanceUsageRecords = balanceUsageRecordService.selectList(between4); |
| | | |
| | | driverWithdrawal = balanceUsageRecordService.selectList(between44); |
| | | driverWithdrawal = pubWithdrawalService.selectList(driverWrapper); |
| | | break; |
| | | case 4: |
| | | // 专车订单 |
| | |
| | | // 消费 |
| | | balanceUsageRecords = balanceUsageRecordService.selectList(between4); |
| | | // 提现 |
| | | driverWithdrawal = balanceUsageRecordService.selectList(between44); |
| | | driverWithdrawal = pubWithdrawalService.selectList(between44); |
| | | } |
| | | |
| | | // 已发放补贴总额 |
| | |
| | | GrantVO grantVO = new GrantVO(); |
| | | grantVO.setInsertTime(format.format(userCouponRecord.getInsertTime())); |
| | | grantVO.setType("优惠券"); |
| | | grantVO.setAmount(userCouponRecord.getPayMoney().toString()); |
| | | grantVO.setAmount(userCouponRecord.getCouponMoney().toString()); |
| | | TUser tUser = appUserService.selectById(userCouponRecord.getUserId()); |
| | | if (tUser!=null){ |
| | | grantVO.setName(tUser.getNickName()); |
| | |
| | | GrantVO grantVO = new GrantVO(); |
| | | grantVO.setInsertTime(format.format(userCouponRecord.getInsertTime())); |
| | | grantVO.setType("优惠券"); |
| | | grantVO.setAmount(userCouponRecord.getPayMoney().toString()); |
| | | grantVO.setAmount(userCouponRecord.getCouponMoney().toString()); |
| | | TUser tUser = appUserService.selectById(userCouponRecord.getUserId()); |
| | | if (tUser!=null){ |
| | | grantVO.setName(tUser.getNickName()); |
| | |
| | | res.add(grantVO); |
| | | } |
| | | // 司机提现 |
| | | for (BalanceUsageRecord balanceUsageRecord : driverWithdrawal) { |
| | | for (TPubWithdrawal balanceUsageRecord : driverWithdrawal) { |
| | | GrantVO grantVO = new GrantVO(); |
| | | grantVO.setInsertTime(format.format(balanceUsageRecord.getCreateTime())); |
| | | grantVO.setInsertTime(format.format(balanceUsageRecord.getInsertTime())); |
| | | grantVO.setType("司机奖励"); |
| | | grantVO.setAmount(balanceUsageRecord.getMoney().toString()); |
| | | TDriver tUser = driverService.selectById(balanceUsageRecord.getDriverId()); |
| | | TDriver tUser = driverService.selectById(balanceUsageRecord.getUserId()); |
| | | if (tUser!=null){ |
| | | grantVO.setName(tUser.getFirstName()+tUser.getLastName()); |
| | | } |
| | | switch (balanceUsageRecord.getPurpose()){ |
| | | case 6: |
| | | grantVO.setRemark("司机提现"); |
| | | break; |
| | | } |
| | | grantVO.setRemark("司机提现"); |
| | | driverWithdrawal1 = driverWithdrawal1.add(new BigDecimal(balanceUsageRecord.getMoney().toString())); |
| | | res.add(grantVO); |
| | | } |
| | | |
| | | // 总额 |
| | | total = total.add(redPackage).add(coupon).add(discount).add(driverConsume).add(driverWithdrawal1); |
| | | // 已使用司机奖励合计 |
| | |
| | | useMoneyVO.setDriver(driver); |
| | | useMoneyVO.setDriverWithdrawal(driverWithdrawal1); |
| | | useMoneyVO.setDriverConsume(driverConsume); |
| | | |
| | | return useMoneyVO; |
| | | } |
| | | |
| | |
| | | // 司机奖励 |
| | | Wrapper<DriverActivityHistory> between4 = new EntityWrapper<DriverActivityHistory>() |
| | | ; |
| | | if (time == 5){ |
| | | if (time == 5 && insertTime==null){ |
| | | // 专车wrapper |
| | | between = new EntityWrapper<TOrderPrivateCar>() |
| | | .isNotNull("discountMoney") |
| | |
| | | BigDecimal driver = new BigDecimal("0"); |
| | | // 查询已使用折扣总额 |
| | | for (TOrderPrivateCar tOrderPrivateCar : tOrderPrivateCars) { |
| | | if (tOrderPrivateCar.getDiscountMoney()==null){ |
| | | if (tOrderPrivateCar.getDiscountMoney()==null || tOrderPrivateCar.getDiscountMoney() == 0){ |
| | | continue; |
| | | } |
| | | discount = discount.add(new BigDecimal(tOrderPrivateCar.getDiscountMoney().toString())); |
| | |
| | | res.add(grantVO); |
| | | } |
| | | for (TOrderLogistics tOrderPrivateCar : tOrderLogistics) { |
| | | if (tOrderPrivateCar.getDiscountMoney()==null){ |
| | | if (tOrderPrivateCar.getDiscountMoney()==null || tOrderPrivateCar.getDiscountMoney() == 0){ |
| | | continue; |
| | | } |
| | | |
| | |
| | | // 司机奖励 |
| | | Wrapper<DriverActivityHistory> between4 = new EntityWrapper<DriverActivityHistory>() |
| | | ; |
| | | if (time == 5){ |
| | | if (time == 5 && insertTime==null){ |
| | | // 专车wrapper |
| | | between = new EntityWrapper<TOrderPrivateCar>() |
| | | .isNotNull("discountMoney") |