| | |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | List<TOrderPrivateCar> tOrderPrivateCars = orderPrivateCarService.selectList(null); |
| | | List<TOrderPrivateCar> tOrderPrivateCars = orderPrivateCarService.selectList( |
| | | new EntityWrapper<TOrderPrivateCar>().eq("driverId",id) |
| | | ); |
| | | |
| | | List<Map<String, Object>> res = new ArrayList<>(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | res.add(temp); |
| | | } |
| | | } |
| | | |
| | | // 司机专车订单ids |
| | | List<Integer> orderIds = orderPrivateCarService.selectList(new EntityWrapper<TOrderPrivateCar>() |
| | | .eq("driverId", id)).stream() |
| | |
| | | } |
| | | } |
| | | // 平台充值 |
| | | if (handleType == null || handleType == 6){ |
| | | if (handleType == null || handleType == 5){ |
| | | Wrapper<TPubTransactionDetails> eq = new EntityWrapper<TPubTransactionDetails>() |
| | | .eq("userId", id) |
| | | .eq("orderType", 6) |
| | |
| | | } |
| | | } |
| | | // 平台扣除 |
| | | if (handleType == null || handleType == 7){ |
| | | if (handleType == null || handleType == 6){ |
| | | Wrapper<TPubTransactionDetails> eq = new EntityWrapper<TPubTransactionDetails>() |
| | | .eq("userId", id) |
| | | .eq("orderType", 7) |
| | |
| | | res.add(temp); |
| | | } |
| | | } |
| | | // 取消订单收入 |
| | | if (handleType == null || handleType == 7){ |
| | | Wrapper<Income> eq = new EntityWrapper<Income>() |
| | | .eq("objectId", id) |
| | | .eq("type", 3) |
| | | .eq("userType", 2); |
| | | if (beginTime!=null){ |
| | | eq.ge("insertTime", beginTime); |
| | | eq.le("insertTime", endTime); |
| | | } |
| | | List<Income> incomes = tIncomeService.selectList(eq); |
| | | for (Income income : incomes) { |
| | | Map<String, Object> temp = new HashMap<>(); |
| | | String times = simpleDateFormat.format(income.getInsertTime()); |
| | | if (income.getIncomeId()!=null){ |
| | | TOrderPrivateCar tOrderPrivateCar = tOrderPrivateCars.stream().filter(e -> e.getId() |
| | | .equals(income.getIncomeId())).findFirst().orElse(null); |
| | | temp.put("orderNumber",tOrderPrivateCar==null?null:tOrderPrivateCar.getOrderNum()); |
| | | temp.put("remark",tOrderPrivateCar.getRemark()); |
| | | } |
| | | temp.put("times",times); |
| | | temp.put("handleType","取消订单收入"); |
| | | temp.put("amount",income.getMoney()); |
| | | temp.put("withType","订单号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",income.getDriverBalance()); |
| | | res.add(temp); |
| | | } |
| | | } |
| | | res.sort((o1, o2) -> { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | try { |
| | | Date date1 = format.parse((String) o1.get("times")); |
| | | Date date2 = format.parse((String) o2.get("times")); |
| | | return date2.compareTo(date1); // 降序 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return 0; |
| | | } |
| | | }); |
| | | return res; |
| | | } |
| | | @RequestMapping("/getExcel") |