| | |
| | | if (siteIds.isEmpty()){ |
| | | siteIds.add(-1); |
| | | } |
| | | |
| | | List<TChargingOrder> list = chargingOrderService.list(); |
| | | List<TParkingRecord> parkingRecord = parkingLotClient.getSiteIdAll().getData(); |
| | | for (PayOrderDto record : data.getRecords()) { |
| | | if (record.getType() == 1){ |
| | | TChargingOrder byId = chargingOrderService.getById(record.getId()); |
| | | record.setSiteId(byId.getSiteId()); |
| | | TChargingOrder chargingOrder = list.stream().filter(e -> e.getId().equals(Long.valueOf(record.getId()))).findFirst().orElse(null); |
| | | if (chargingOrder!=null){ |
| | | record.setSiteId(chargingOrder.getSiteId()); |
| | | } |
| | | } |
| | | if (record.getType()==4){ |
| | | Integer siteId=parkingLotClient.getSiteIdByOrderId(Long.valueOf(record.getId())).getData(); |
| | | if (siteId!=null){ |
| | | record.setSiteId(siteId); |
| | | TParkingRecord tParkingRecord = parkingRecord.stream().filter(e -> e.getId().equals(Long.valueOf(record.getId()))).findFirst().orElse(null); |
| | | if (tParkingRecord!=null){ |
| | | record.setSiteId(tParkingRecord.getSiteId()); |
| | | } |
| | | } |
| | | if (roleType==1||(record.getType()!=1&&record.getType()!=4)){ |
| | |
| | | TCharingOrderVO res = chargingOrderService.chargingOrder(dto); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String temp = "00"; |
| | | Integer i = Integer.valueOf(temp); |
| | | System.err.println(i); |
| | | } |
| | | @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 = tChargingOrderAccountingStrategy.getCreateTime().format(formatter); |
| | | String format = ""; |
| | | String format1 = ""; |
| | | String temp1=list.get(0).getStartTime().split(":")[0]; |
| | | String[] split = tChargingOrderAccountingStrategy.getStartTime().split(":"); |
| | | if (Integer.parseInt(split[0])>=Integer.valueOf(temp1)){ |
| | | format = byId.getCreateTime().format(formatter); |
| | | }else { |
| | | format = byId.getEndTime().format(formatter); |
| | | } |
| | | String[] split1 = tChargingOrderAccountingStrategy.getEndTime().split(":"); |
| | | if (Integer.parseInt(split1[0])<Integer.valueOf(temp1)){ |
| | | format1 = byId.getCreateTime().format(formatter); |
| | | }else { |
| | | format1 = byId.getEndTime().format(formatter); |
| | | } |
| | | tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format1+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ |
| | | BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |