ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/vo/TCharingUserEvaluateVO.java
@@ -9,7 +9,7 @@ @Data public class TCharingUserEvaluateVO { @ApiModelProperty("评价分") Long aver; Double aver; @ApiModelProperty("各个评分数量") List<Map<String,Object>> evaluate; @ApiModelProperty("差评数量") ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
@@ -190,17 +190,17 @@ siteList.setPageSize(99999); PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList); for (GetSiteListDTO record : list.getRecords()) { Long count = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); Long count = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); record.setC1(count); Long count1 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, 2).count(); Long count1 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, 2).count(); record.setC2(count1); Long count2 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); Long count2 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); record.setK1(count2); Long count3 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, 2).count(); Long count3 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, 2).count(); record.setK2(count3); Long count4 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); Long count4 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); record.setM1(count4); Long count5 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, 2).count(); Long count5 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, 2).count(); record.setM2(count5); //利用率 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
@@ -377,6 +377,7 @@ }else if (byId.getAuditStatus()==2){ byId.setTwoRemark(steategyPassDto.getRemark()); byId.setTwoAuditTime(LocalDateTime.now()); } byId.setAuditStatus(4); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TParkingLotController.java
@@ -155,7 +155,7 @@ @PostMapping(value = "/getRecordAmount") public R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") LocalDate sixBefore){ BigDecimal sum = parkingRecordService.getSum(sixBefore); return R.ok(); return R.ok(sum); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TParkingRecordController.java
@@ -63,8 +63,7 @@ @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "列表") @PostMapping(value = "/page") public R<Page<TParkingRecord>> page(@RequestBody ParkingRecordPageQuery query) { Page<TParkingRecord> page = parkingRecordService.lambdaQuery().ge(query.getStart() != null, TParkingRecord::getCreateTime, query.getStart()) .le(query.getEnd() != null, TParkingRecord::getCreateTime, query.getEnd()) Page<TParkingRecord> page = parkingRecordService.lambdaQuery() .like(query.getLicensePlate() != null, TParkingRecord::getLicensePlate, query.getLicensePlate()) .eq(query.getStatus() != null, TParkingRecord::getStatus, query.getStatus()) .eq(query.getOutParkingType() != null, TParkingRecord::getOutParkingType, query.getOutParkingType()) ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/dto/ParkingRecordPageQuery.java
@@ -2,6 +2,7 @@ import com.ruoyi.common.core.web.page.BasePage; import lombok.Data; import org.stringtemplate.v4.ST; import java.time.LocalDate; import java.time.LocalDateTime; @@ -10,6 +11,7 @@ public class ParkingRecordPageQuery extends BasePage { LocalDate start; LocalDate end; String timePeriod; String licensePlate; Integer status; Integer outParkingType; ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -282,6 +282,14 @@ @ApiOperation(value = "充电明细", tags = {"管理后台-支付订单-订单信息"}) public R<List<TChargingOrderAccountingStrategy>> chargingDetail(Long orderId) { 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); tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime()); } return R.ok(list); } @@ -890,7 +898,7 @@ start = statisticsQueryDto.getStartTime(); end = statisticsQueryDto.getEndTime(); } List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getStartTime, start).le(TChargingOrder::getEndTime, end).in(TChargingOrder::getSiteId, siteIds).list(); List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getCreateTime, start).le(TChargingOrder::getCreateTime, end).in(TChargingOrder::getSiteId, siteIds).list(); List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList()); chargingOrderIds.add(-1L); //上方饼图 @@ -1065,6 +1073,11 @@ //用户标签 List<Map<String,Object>> maps = chargingOrderService.getUserTagCount(); Map<String,Object> stringObjectMap = new HashMap<>(); Long noTagCount = chargingOrderService.countNoTag(); stringObjectMap.put("count",noTagCount); maps.add(stringObjectMap); //会员标签 List<Map<String,Object>> maps1 = chargingOrderService.getVipCount(); @@ -1104,7 +1117,7 @@ siteIds.add(statisticsQueryDto.getSiteId()); } //查询评价分 Long aver = chargingOrderService.getAver(siteIds); Double aver = chargingOrderService.getAver(siteIds); //查询各个分数 List<Map<String,Object>> evaluate = chargingOrderService.getLevelEvaluate(siteIds); //查询差评回复数 @@ -1415,8 +1428,9 @@ //将capMap的chargingCapacity除以totalRatedPower保留两位数 capMap.forEach(map -> { BigDecimal chargingCapacity = (BigDecimal) map.get("chargingCapacity"); BigDecimal result = chargingCapacity.divide(totalRatedPower, 2, RoundingMode.HALF_UP); map.put("chargingCapacity", result); BigDecimal result = chargingCapacity.divide(totalRatedPower, 4, RoundingMode.HALF_UP); BigDecimal multiply = result.multiply(new BigDecimal(100)); map.put("chargingCapacity", multiply); }); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/TChargingOrderMapper.java
@@ -106,7 +106,7 @@ Map<String, Object> countLocalCar(); Long getAver(@Param("siteIds") List<Integer> siteIds); Double getAver(@Param("siteIds") List<Integer> siteIds); List<Map<String, Object>> getLevelEvaluate(@Param("siteIds")List<Integer> siteIds); @@ -137,4 +137,6 @@ List<Map<String, Object>> countAllUserData(); List<Map<String, Object>> needElec1(@Param("siteIds")List<Integer> siteIds,@Param("statisticsQueryDto") ChargingStatisticsQueryDto statisticsQueryDto); Long countNoTag(); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/TChargingOrderService.java
@@ -212,7 +212,7 @@ Map<String, Object> countLocalCar(); Long getAver(List<Integer> siteIds); Double getAver(List<Integer> siteIds); List<Map<String, Object>> getLevelEvaluate(List<Integer> siteIds); @@ -266,4 +266,6 @@ * @return */ EndOfChargePageInfo getEndOfChargePageInfo(String id); Long countNoTag(); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -2015,7 +2015,7 @@ } @Override public Long getAver(List<Integer> siteIds) { public Double getAver(List<Integer> siteIds) { return this.baseMapper.getAver(siteIds); } @@ -2033,6 +2033,11 @@ public R payRefund(PayOrderRefundDto payOrderQueryDto) { if (payOrderQueryDto.getType()==1){ TChargingOrder tChargingOrder = this.baseMapper.selectById(payOrderQueryDto.getOrderId()); if (tChargingOrder.getPaymentAmount().compareTo(payOrderQueryDto.getRefundAmount())==-1){ return R.fail("退款金额需小于支付金额"); } TChargingOrderRefund chargingOrderRefund = new TChargingOrderRefund(); chargingOrderRefund.setChargingOrderId(tChargingOrder.getId()); chargingOrderRefund.setRefundAmount(payOrderQueryDto.getRefundAmount()); @@ -2094,6 +2099,9 @@ } if (payOrderQueryDto.getType()==2){ TShoppingOrder tChargingOrder = shoppingOrderService.getById(payOrderQueryDto.getOrderId()); if (tChargingOrder.getPaymentAmount().compareTo(payOrderQueryDto.getRefundAmount())==-1){ return R.fail("退款金额需小于支付金额"); } TShoppingOrderRefund chargingOrderRefund = new TShoppingOrderRefund(); chargingOrderRefund.setShoppingOrderId(tChargingOrder.getId()); chargingOrderRefund.setRefundAmount(payOrderQueryDto.getRefundAmount()); @@ -2143,6 +2151,10 @@ tChargingOrder.setRefundStatus(2); tChargingOrder.setRefundAmount((tChargingOrder.getRefundAmount()==null? BigDecimal.valueOf(0) :tChargingOrder.getRefundAmount()).add(payOrderQueryDto.getRefundAmount())); if (payOrderQueryDto.getRefundAmount().compareTo(tChargingOrder.getPaymentAmount())==0){ tChargingOrder.setStatus(5); } shoppingOrderService.updateById(tChargingOrder); shoppingOrderRefundService.save(chargingOrderRefund); @@ -2636,4 +2648,9 @@ info.setDuration(0 == hour ? String.format("%s分钟", second) : String.format("%s小时%s分钟", hour, second)); return info; } @Override public Long countNoTag() { return this.baseMapper.countNoTag(); } } ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -121,7 +121,6 @@ title, `status`, order_amount, recharge_amount, payment_amount , create_time, end_time, @@ -426,6 +425,7 @@ SUM(service_charge-coupon_discount_amount) as servicecharge, SUM(charging_capacity) as electrovalence, SUM(electrovalence) AS paymentAmount, SUM(payment_amount) AS paymoney, count(1) as orderCount FROM t_charging_order @@ -450,6 +450,7 @@ SUM(service_charge-coupon_discount_amount) as servicecharge, SUM(charging_capacity) as electrovalence, SUM(electrovalence) AS paymentAmount, SUM(payment_amount) AS paymoney, count(1) as orderCount FROM t_charging_order @@ -474,6 +475,7 @@ SUM(service_charge-coupon_discount_amount) as servicecharge, SUM(charging_capacity) as electrovalence, SUM(electrovalence) AS paymentAmount, SUM(payment_amount) AS paymoney, count(1) as orderCount FROM @@ -499,6 +501,9 @@ DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, SUM(service_charge-coupon_discount_amount) as servicecharge, SUM(charging_capacity) as electrovalence, SUM(electrovalence) AS paymentAmount, SUM(payment_amount) AS paymoney, count(1) as orderCount FROM t_charging_order @@ -723,6 +728,8 @@ charging_pile_account.t_app_user_tag a JOIN ( SELECT app_user_id, MAX( create_time ) AS max_create_time FROM charging_pile_account.t_app_user_tag GROUP BY app_user_id ) b ON a.app_user_id = b.app_user_id AND a.create_time = b.max_create_time LEFT JOIN `charging_pile_other`.`t_user_tag` ct on a.user_tag_id = ct.id WHERE ct.del_flag = 0 ) o LEFT JOIN `charging_pile_other`.`t_user_tag` tt on o.user_tag_id = tt.id GROUP BY @@ -766,10 +773,10 @@ </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} and DATE(co.create_time) >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> </if> </where> @@ -800,7 +807,7 @@ WHERE del_flag = 0 </select> <select id="getAver" resultType="java.lang.Long"> <select id="getAver" resultType="java.lang.Double"> SELECT ROUND(AVG(te.mark), 2) AS average_mark FROM @@ -952,7 +959,7 @@ 31536000 </if> <if test="statisticsQueryDto.dayType == 5"> (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference )) </if> @@ -983,12 +990,12 @@ AND YEAR( co.create_time ) = YEAR(CURDATE() ) </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} </if> and DATE(co.create_time) >= #{statisticsQueryDto.startTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> GROUP BY tc.name,cp.name,co.charging_gun_id @@ -1012,7 +1019,7 @@ 31536000 </if> <if test="statisticsQueryDto.dayType == 5"> (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference )) </if> @@ -1044,10 +1051,10 @@ </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} and DATE(co.create_time) >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> </if> GROUP BY tc.name,cp.name,co.charging_gun_id @@ -1070,7 +1077,7 @@ 31536000 </if> <if test="statisticsQueryDto.dayType == 5"> (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference )) </if> @@ -1101,10 +1108,10 @@ </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} and DATE(co.create_time) >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> </if> GROUP BY tc.name,cp.name,co.charging_gun_id @@ -1127,7 +1134,7 @@ 31536000 </if> <if test="statisticsQueryDto.dayType == 5"> (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference )) </if> @@ -1158,10 +1165,10 @@ </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} and DATE(co.create_time) >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> </if> GROUP BY tc.name,cp.name,co.charging_gun_id @@ -1184,7 +1191,7 @@ 31536000 </if> <if test="statisticsQueryDto.dayType == 5"> (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference )) </if> @@ -1215,10 +1222,10 @@ </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} and DATE(co.create_time) >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> </if> GROUP BY tc.name,cp.name,co.charging_gun_id @@ -1239,7 +1246,7 @@ 31536000 </if> <if test="statisticsQueryDto.dayType == 5"> (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference )) </if> @@ -1270,10 +1277,10 @@ </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} and DATE(co.create_time) >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> </if> GROUP BY tc.name,cp.name,co.charging_gun_id @@ -1311,10 +1318,10 @@ </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} and DATE(co.create_time) >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> </if> </where> @@ -1506,10 +1513,10 @@ </if> <if test="statisticsQueryDto.dayType == 5"> <if test="statisticsQueryDto.startTime != null"> AND co.create_time >= #{statisticsQueryDto.startTime} and DATE(co.create_time) >= #{statisticsQueryDto.startTime} </if> <if test="statisticsQueryDto.endTime != null"> AND co.create_time <= #{statisticsQueryDto.endTime} and DATE(co.create_time) <= #{statisticsQueryDto.endTime} </if> </if> </where> @@ -1518,4 +1525,15 @@ cp.name, co.charging_gun_id; </select> <select id="countNoTag" resultType="java.lang.Long"> SELECT count(1) from `charging_pile_account`.`t_app_user` au WHERE au.id not IN ( SELECT app_user_id from `charging_pile_account`.`t_app_user_tag` GROUP BY app_user_id ) and au.del_flag = 0 </select> </mapper>