| | |
| | | @GetMapping(value = "/pay/order/charging/details") |
| | | @ApiOperation(value = "充电明细", tags = {"管理后台-支付订单-订单信息"}) |
| | | public R<List<TChargingOrderAccountingStrategy>> chargingDetail(Long orderId) { |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId) |
| | | .orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { |
| | | String format = tChargingOrderAccountingStrategy.getCreateTime().format(formatter); |
| | | LocalDateTime createTime = tChargingOrderAccountingStrategy.getCreateTime(); |
| | | String format = createTime.format(formatter); |
| | | String startTime = tChargingOrderAccountingStrategy.getStartTime(); |
| | | if("00:00".equals(startTime)){ |
| | | createTime = createTime.plusDays(1); |
| | | format = createTime.format(formatter); |
| | | } |
| | | tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | } |
| | | |
| | | |
| | | //从新排序 |
| | | list.sort(new Comparator<TChargingOrderAccountingStrategy>() { |
| | | @Override |
| | | public int compare(TChargingOrderAccountingStrategy o1, TChargingOrderAccountingStrategy o2) { |
| | | String startTime = o1.getStartTime(); |
| | | String startTime1 = o2.getStartTime(); |
| | | LocalDateTime localDateTime = LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| | | LocalDateTime localDateTime1 = LocalDateTime.parse(startTime1, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| | | if(localDateTime.isBefore(localDateTime1)){ |
| | | return -1; |
| | | } |
| | | if(localDateTime.isAfter(localDateTime1)){ |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | ; |
| | | System.err.println(Integer.parseInt("01")); |
| | | System.err.println(Integer.valueOf("01")); |
| | | ; |
| | | } |
| | | @RequiresPermissions(value = {"/chargingPileOrder/monitoring_record"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/chargingOrderInfo") |
| | |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, strategyId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { |
| | | String format = ""; |
| | | String format1 = ""; |
| | | // String temp1=list.get(0).getStartTime().split(":")[0]; |
| | | System.err.println("订单详情时间第一条"+list.get(0).getStartTime()); |
| | | System.err.println("订单详情时间开始"+tChargingOrderAccountingStrategy.getStartTime()); |
| | | System.err.println("订单详情时间结束"+tChargingOrderAccountingStrategy.getEndTime()); |
| | | String temp1=list.get(0).getStartTime().split(" ")[1].split(":")[0]; |
| | | String[] split = tChargingOrderAccountingStrategy.getStartTime().split(" ")[1].split(":"); |
| | | if (Integer.parseInt(split[0])>=Integer.parseInt(temp1)){ |
| | | format = byId.getCreateTime().format(formatter); |
| | | }else { |
| | | format = byId.getEndTime().format(formatter); |
| | | } |
| | | String[] split1 = tChargingOrderAccountingStrategy.getEndTime().split(" ")[1].split(":"); |
| | | if (Integer.parseInt(split1[0])<Integer.parseInt(temp1)){ |
| | | format1 = byId.getCreateTime().format(formatter); |
| | | }else { |
| | | format1 = byId.getEndTime().format(formatter); |
| | | LocalDateTime createTime = tChargingOrderAccountingStrategy.getCreateTime(); |
| | | String format = createTime.format(formatter); |
| | | String startTime = tChargingOrderAccountingStrategy.getStartTime(); |
| | | if("00:00".equals(startTime)){ |
| | | createTime = createTime.plusDays(1); |
| | | format = createTime.format(formatter); |
| | | } |
| | | tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format1+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ |
| | | BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | |
| | | tChargingOrderAccountingStrategy.setCouponDiscount(multiply); |
| | | } |
| | | } |
| | | //从新排序 |
| | | list.sort(new Comparator<TChargingOrderAccountingStrategy>() { |
| | | @Override |
| | | public int compare(TChargingOrderAccountingStrategy o1, TChargingOrderAccountingStrategy o2) { |
| | | String startTime = o1.getStartTime(); |
| | | String startTime1 = o2.getStartTime(); |
| | | LocalDateTime localDateTime = LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| | | LocalDateTime localDateTime1 = LocalDateTime.parse(startTime1, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| | | if(localDateTime.isBefore(localDateTime1)){ |
| | | return -1; |
| | | } |
| | | if(localDateTime.isAfter(localDateTime1)){ |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | chargingOrderInfoVO.setList(list); |
| | | return AjaxResult.success(chargingOrderInfoVO); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/platformRevenueAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/total") |
| | |
| | | siteIds.add(-1); |
| | | } |
| | | Map<String,Object> map = chargingOrderService.countAll(sixBefore,siteIds); |
| | | BigDecimal data = parkingLotClient.getRecordAmount(sixBefore).getData(); |
| | | BigDecimal data = parkingLotClient.getRecordAmount(sixBefore.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).getData(); |
| | | if (map ==null){ |
| | | map = new HashMap<String,Object>(); |
| | | } |