| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | |
| | | import java.time.*; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | // 司机已消费金额 |
| | | Wrapper<BalanceUsageRecord> between4 = new EntityWrapper<BalanceUsageRecord>() |
| | | ; |
| | | if (time == 5 && insertTime==null){ |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("userType", 2) |
| | | ; |
| | | if (time == 5 && !StringUtils.hasLength(insertTime)){ |
| | | // 专车wrapper |
| | | between = new EntityWrapper<TOrderPrivateCar>() |
| | | .isNotNull("activityId") |
| | |
| | | // 司机提现 |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("type",1) |
| | | .eq("userType", 2) |
| | | ; |
| | | ; |
| | | }else{ |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("type",1) |
| | | .eq("userType", 2) |
| | | .between("insertTime", start, end); |
| | | // 专车wrapper |
| | |
| | | between4 = new EntityWrapper<BalanceUsageRecord>() |
| | | .ne("purpose", 6) |
| | | .between("createTime", start, end); |
| | | // 司机提现 |
| | | |
| | | |
| | | } |
| | | // 司机提现wrapper |
| | |
| | | driver = driverConsume.add(driverWithdrawal1); |
| | | return res; |
| | | } |
| | | |
| | | @RequestMapping(value = "/use/getCount") |
| | | @ResponseBody |
| | | public Object getCount1(Integer time,String insertTime,Integer type) { |
| | |
| | | Wrapper<BalanceUsageRecord> between4 = new EntityWrapper<BalanceUsageRecord>() |
| | | ; |
| | | // 司机提现 |
| | | Wrapper<TPubWithdrawal> between44 = new EntityWrapper<TPubWithdrawal>() |
| | | Wrapper<BalanceUsageRecord> between44 = new EntityWrapper<BalanceUsageRecord>() |
| | | ; |
| | | if (time == 5 && insertTime==null){ |
| | | if (time == 5 && !StringUtils.hasLength(insertTime)){ |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("type",1) |
| | | .eq("userType", 2) |
| | | ; |
| | | .between("insertTime", start, end); |
| | | // 专车wrapper |
| | | between = new EntityWrapper<TOrderPrivateCar>() |
| | | .isNotNull("activityId") |
| | |
| | | }else{ |
| | | driverWrapper = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("state", 2) |
| | | .eq("type",1) |
| | | .eq("userType", 2) |
| | | .between("insertTime", start, end); |
| | | // 专车wrapper |
| | |
| | | // 司机消费记录 |
| | | balanceUsageRecords = balanceUsageRecordService.selectList(between4); |
| | | |
| | | // 司机提现记录 |
| | | driverWithdrawal = pubWithdrawalService.selectList(driverWrapper); |
| | | break; |
| | | case 4: |
| | |
| | | // 消费 |
| | | balanceUsageRecords = balanceUsageRecordService.selectList(between4); |
| | | // 提现 |
| | | driverWithdrawal = pubWithdrawalService.selectList(between44); |
| | | driverWithdrawal = pubWithdrawalService.selectList(driverWrapper); |
| | | } |
| | | |
| | | // 已发放补贴总额 |
| | |
| | | } |
| | | grantVO.setRemark("订单号:"+userRedPacketRecord.getOrderNum()); |
| | | res.add(grantVO); |
| | | redPackage = redPackage.add(new BigDecimal(userRedPacketRecord.getPayMoney().toString())); |
| | | redPackage = redPackage.add(new BigDecimal(temp.toString())); |
| | | } |
| | | for (TOrderLogistics userRedPacketRecord : userRedPacketRecords1) { |
| | | if (userRedPacketRecord.getState() != 9 &&userRedPacketRecord.getState() != 8){ |
| | |
| | | } |
| | | grantVO.setRemark("订单号:"+userRedPacketRecord.getOrderNum()); |
| | | res.add(grantVO); |
| | | redPackage = redPackage.add(new BigDecimal(userRedPacketRecord.getPayMoney().toString())); |
| | | redPackage = redPackage.add(new BigDecimal(temp.toString())); |
| | | } |
| | | // 查询已领取优惠券总额 |
| | | for (TOrderPrivateCar userCouponRecord : userCouponRecords) { |
| | |
| | | grantVO.setName(tUser.getNickName()); |
| | | } |
| | | grantVO.setRemark("订单号:"+userCouponRecord.getOrderNum()); |
| | | coupon = coupon.add(new BigDecimal(userCouponRecord.getPayMoney().toString())); |
| | | coupon = coupon.add(new BigDecimal(userCouponRecord.getCouponMoney().toString())); |
| | | res.add(grantVO); |
| | | } |
| | | for (TOrderLogistics userCouponRecord : userCouponRecords1) { |
| | |
| | | grantVO.setName(tUser.getNickName()); |
| | | } |
| | | grantVO.setRemark("订单号:"+userCouponRecord.getOrderNum()); |
| | | coupon = coupon.add(new BigDecimal(userCouponRecord.getPayMoney().toString())); |
| | | coupon = coupon.add(new BigDecimal(userCouponRecord.getCouponMoney().toString())); |
| | | res.add(grantVO); |
| | | } |
| | | // 司机消费奖励 |
| | |
| | | // 司机奖励 |
| | | Wrapper<DriverActivityHistory> between4 = new EntityWrapper<DriverActivityHistory>() |
| | | ; |
| | | if (time == 5 && insertTime==null){ |
| | | if (time == 5 && !StringUtils.hasLength(insertTime)){ |
| | | // 专车wrapper |
| | | between = new EntityWrapper<TOrderPrivateCar>() |
| | | .isNotNull("discountMoney") |
| | |
| | | if (tUser!=null){ |
| | | grantVO.setName(tUser.getNickName()); |
| | | } |
| | | SysCouponRecord sysCouponRecord = |
| | | sysCouponRecordService.selectById(userCouponRecord.getCouponId()); |
| | | if (sysCouponRecord!=null){ |
| | | grantVO.setRemark(sysCouponRecord.getName()); |
| | | SysCouponActivity sysCouponActivity = sysCouponActivityService.selectById(userCouponRecord.getCouponActivityId()); |
| | | if (sysCouponActivity!=null){ |
| | | grantVO.setRemark(sysCouponActivity.getName()); |
| | | } |
| | | coupon = coupon.add(new BigDecimal(userCouponRecord.getMoney().toString())); |
| | | res.add(grantVO); |
| | |
| | | driver = driver.add(new BigDecimal(driverActivityHistory.getMoney().toString())); |
| | | res.add(grantVO); |
| | | } |
| | | List<GrantVO> sortedList = res.stream() |
| | | .sorted((o1, o2) -> o2.getInsertTime().compareTo(o1.getInsertTime())) |
| | | .collect(Collectors.toList()); |
| | | total = total.add(redPackage).add(coupon).add(discount).add(driver); |
| | | return res; |
| | | return sortedList; |
| | | } |
| | | @RequestMapping(value = "/grant/getCount") |
| | | @ResponseBody |
| | |
| | | // 司机奖励 |
| | | Wrapper<DriverActivityHistory> between4 = new EntityWrapper<DriverActivityHistory>() |
| | | ; |
| | | if (time == 5 && insertTime==null){ |
| | | if (time == 5 && !StringUtils.hasLength(insertTime)){ |
| | | // 专车wrapper |
| | | between = new EntityWrapper<TOrderPrivateCar>() |
| | | .isNotNull("discountMoney") |