ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -24,6 +24,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.domain.BasePojo; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.redis.service.RedisService; import com.ruoyi.common.security.utils.SecurityUtils; @@ -576,6 +577,13 @@ } } } //test // if (status==1||status==7){ // TFaultMessage one = faultMessageService.lambdaQuery().eq(TFaultMessage::getChargingGunId, gunMonitoring.getId()).orderByDesc(TFaultMessage::getCreateTime).last("limit 1").one(); // if (one!=null) { // gunMonitoring.setFaultCause(one.getContent()); // } // } } return pageInfo.setRecords(chargingGunMonitoring); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -1125,6 +1125,8 @@ } else { siteIds.add(statisticsQueryDto.getSiteId()); } List<Map<String,Object>> maps1 = chargingOrderService.queryPower(siteIds); @@ -1330,7 +1332,7 @@ 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); @@ -1355,8 +1357,48 @@ } //直流可用率 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的平均值保留两位小数 @@ -1457,7 +1499,7 @@ 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的总和 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/TChargingOrderMapper.java
@@ -110,7 +110,7 @@ List<Map<String, Object>> getLevelEvaluate(@Param("siteIds")List<Integer> siteIds); List<Map<String, Object>> countBySource(@Param("siteIds")List<Integer> siteIds); List<Map<String, Object>> countBySource(@Param("siteIds")List<Integer> siteIds,@Param("statisticsQueryDto") ChargingStatisticsQueryDto statisticsQueryDto); List<Map<String, Object>> equipmentUserType1(@Param("siteIds") List<Integer> siteIds, @Param("statisticsQueryDto") ChargingStatisticsQueryDto statisticsQueryDto); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/TChargingOrderService.java
@@ -232,7 +232,7 @@ SettlementTotalVO settlementTotal(String time); List<Map<String, Object>> countBySource(List<Integer> siteIds); List<Map<String, Object>> countBySource(List<Integer> siteIds,ChargingStatisticsQueryDto statisticsQueryDto); List<Map<String, Object>> equipmentUserType1(List<Integer> siteIds, ChargingStatisticsQueryDto statisticsQueryDto); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -2881,8 +2881,8 @@ } @Override public List<Map<String, Object>> countBySource(List<Integer> siteIds) { return this.baseMapper.countBySource(siteIds); public List<Map<String, Object>> countBySource(List<Integer> siteIds, ChargingStatisticsQueryDto statisticsQueryDto) { return this.baseMapper.countBySource(siteIds,statisticsQueryDto); } @Override ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -601,10 +601,10 @@ </if> <if test="statisticsQueryDto.dayType ==5"> AND create_time >= #{statisticsQueryDto.startTime} AND DATE(create_time) >= #{statisticsQueryDto.startTime} AND create_time <= #{statisticsQueryDto.endTime} AND DATE(create_time) <= #{statisticsQueryDto.endTime} </if> @@ -940,6 +940,13 @@ #{siteId} </foreach> </if> <if test="statisticsQueryDto.dayType == 1"> AND DATE(create_time ) = CURDATE() </if> <if test="statisticsQueryDto.dayType != 1"> and DATE(create_time) >= #{statisticsQueryDto.startTime} and DATE(create_time) <= #{statisticsQueryDto.endTime} </if> group by source_name