| | |
| | | } |
| | | } |
| | | // 时段总服务费 |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | 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); |
| | | tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); |
| | | 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.setVipDiscount(multiply); |
| | | } |
| | | bigDecimal = bigDecimal.add(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | |
| | | if (byId.getCouponDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ |
| | | BigDecimal multiply = byId.getCouponDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | |
| | | } else { |
| | | siteIds.add(statisticsQueryDto.getSiteId()); |
| | | } |
| | | |
| | | |
| | | List<Map<String,Object>> maps1 = chargingOrderService.queryPower(siteIds); |
| | | |
| | | |
| | |
| | | tCharingUserMapVO.setMap(charMap); |
| | | tCharingUserMapVO.setMap1(charMap1); |
| | | }else { |
| | | |
| | | |
| | | List<Map<String,Object>> map = chargingOrderService.usersByQuery(statisticsQueryDto); |
| | | |
| | | |
| | |
| | | List<Map<String,Object>> badTop = orderEvaluateService.badTop(siteIds); |
| | | |
| | | //流量分析 |
| | | List<Map<String,Object>> sourceMap = chargingOrderService.countBySource(siteIds); |
| | | List<Map<String,Object>> sourceMap = chargingOrderService.countBySource(siteIds,statisticsQueryDto); |
| | | tCharingUserEvaluateVO.setGoodTop(goodTop); |
| | | tCharingUserEvaluateVO.setBadTop(badTop); |
| | | tCharingUserEvaluateVO.setFlow(sourceMap); |
| | |
| | | } |
| | | //直流可用率 |
| | | List<Map<String,Object>> equipmentMap1 = chargingOrderService.equipmentUserType1(siteIds,statisticsQueryDto); |
| | | for (Map<String, Object> result : equipmentMap1) { |
| | | Object percentObj = result.get("percent"); |
| | | if (percentObj instanceof String) { |
| | | try { |
| | | BigDecimal percent = new BigDecimal((String) percentObj); |
| | | if (percent.compareTo(BigDecimal.ZERO) < 0) { |
| | | result.put("percent", percent.negate().toString()); |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | // 处理转换异常 |
| | | result.put("percent", BigDecimal.ZERO); // 或者其他默认值 |
| | | } |
| | | } else if (percentObj instanceof BigDecimal) { |
| | | BigDecimal percent = (BigDecimal) percentObj; |
| | | if (percent.compareTo(BigDecimal.ZERO) < 0) { |
| | | result.put("percent", percent.negate().toString()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //交流可用率 |
| | | List<Map<String,Object>> equipmentMap2= chargingOrderService.equipmentUserType2(siteIds,statisticsQueryDto); |
| | | |
| | | for (Map<String, Object> result : equipmentMap2) { |
| | | Object percentObj = result.get("percent"); |
| | | if (percentObj instanceof String) { |
| | | try { |
| | | BigDecimal percent = new BigDecimal((String) percentObj); |
| | | if (percent.compareTo(BigDecimal.ZERO) < 0) { |
| | | result.put("percent", percent.negate().toString()); |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | // 处理转换异常 |
| | | result.put("percent", BigDecimal.ZERO); // 或者其他默认值 |
| | | } |
| | | } else if (percentObj instanceof BigDecimal) { |
| | | BigDecimal percent = (BigDecimal) percentObj; |
| | | if (percent.compareTo(BigDecimal.ZERO) < 0) { |
| | | result.put("percent", percent.negate().toString()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //取出直流可用率和交流可用率的percent的平均值保留两位小数 |
| | | |
| | |
| | | |
| | | |
| | | |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().in(!siteIds.isEmpty(), TChargingOrder::getSiteId, siteIds).ge( TChargingOrder::getCreateTime,min).le(BasePojo::getCreateTime,max).eq(statisticsQueryDto.getSiteId() != null, TChargingOrder::getSiteId, statisticsQueryDto.getSiteId()).list(); |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().in(!siteIds.isEmpty(), TChargingOrder::getSiteId, siteIds).ge( TChargingOrder::getCreateTime,min).le(BasePojo::getCreateTime,max).eq(TChargingOrder::getStatus,5).eq(statisticsQueryDto.getSiteId() != null, TChargingOrder::getSiteId, statisticsQueryDto.getSiteId()).list(); |
| | | //当日的订单总数 |
| | | int size = list.size(); |
| | | //计算list中paymentAmount的总和 |
| | |
| | | EndOfChargePageInfo endOfChargePageInfo = chargingOrderService.getEndOfChargePageInfo(id); |
| | | return AjaxResult.success(endOfChargePageInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取订单数据 |
| | | * @param order |