| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.DayOfWeek; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.*; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ChargingOrderGroup; |
| | | import com.ruoyi.common.core.dto.ChargingPercentProvinceDto; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.time.YearMonth; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.time.temporal.TemporalAdjusters; |
| | |
| | | payOrderInfoDto.setTradeNo(byId.getRechargeSerialNumber()); |
| | | payOrderInfoDto.setPayType(byId.getRechargePaymentType()); |
| | | payOrderInfoDto.setPayAmount(byId.getPaymentAmount()); |
| | | payOrderInfoDto.setPayTime(byId.getPayTime()); |
| | | payOrderInfoDto.setPayTime(byId.getCreateTime()); |
| | | payOrderInfoDto.setRefundAmount(byId.getRefundAmount()); |
| | | return R.ok(payOrderInfoDto); |
| | | case 2: |
| | |
| | | payOrderInfoDto1.setTradeNo(byId1.getSerialNumber()); |
| | | payOrderInfoDto1.setPayType(byId1.getPaymentType()); |
| | | payOrderInfoDto1.setPayAmount(byId1.getPaymentAmount()); |
| | | payOrderInfoDto1.setPayTime(byId1.getPayTime()); |
| | | payOrderInfoDto1.setPayTime(byId1.getCreateTime()); |
| | | payOrderInfoDto1.setRefundAmount(byId1.getRefundAmount()); |
| | | return R.ok(payOrderInfoDto1); |
| | | case 3: |
| | |
| | | payOrderInfoDto2.setTradeNo(byId2.getSerialNumber()); |
| | | payOrderInfoDto2.setPayType(byId2.getPaymentType()); |
| | | payOrderInfoDto2.setPayAmount(byId2.getPaymentAmount()); |
| | | payOrderInfoDto2.setPayTime(byId2.getPayTime()); |
| | | payOrderInfoDto2.setPayTime(byId2.getCreateTime()); |
| | | payOrderInfoDto2.setRefundAmount(byId2.getRefundAmount()); |
| | | return R.ok(payOrderInfoDto2); |
| | | //todo luo 停车场订单 |
| | |
| | | @PostMapping(value = "/pay/order/refund/list") |
| | | @ApiOperation(value = "列表", tags = {"管理后台-支付订单-退款订单"}) |
| | | public R<PageInfo<TChargingOrderRefund>> refundList(@RequestBody ChargingRefundDto chargingRefundDto) { |
| | | return chargingOrderService.getRefundList(chargingRefundDto); |
| | | R<PageInfo<TChargingOrderRefund>> refundList = chargingOrderService.getRefundList(chargingRefundDto); |
| | | for (TChargingOrderRefund record : refundList.getData().getRecords()) { |
| | | record.setUid(record.getId().toString()); |
| | | } |
| | | return refundList; |
| | | |
| | | } |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping(value = "/chargingOrderInfo") |
| | | @GetMapping(value = "/chargingOrderInfo") |
| | | @ApiOperation(value = "充电桩订单列表查看详情", tags = {"管理后台-订单管理"}) |
| | | public AjaxResult<ChargingOrderInfoVO> chargingOrderInfo(String strategyId) { |
| | | TChargingOrder byId = chargingOrderService.getById(strategyId); |
| | |
| | | chargingOrderInfoVO.setVehicleUse(data.get(0).getVehicleUse()); |
| | | } |
| | | } |
| | | // 时段总服务费 |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, strategyId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { |
| | | bigDecimal = bigDecimal.add(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | tChargingOrderAccountingStrategy.setVipDiscount( |
| | | tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice() |
| | | .subtract(tChargingOrderAccountingStrategy.getPeriodServicePrice()) |
| | | ); |
| | | tChargingOrderAccountingStrategy.setCouponDiscount( |
| | | tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice() |
| | | .subtract(tChargingOrderAccountingStrategy.getPeriodServicePrice()) |
| | | ); |
| | | } |
| | | chargingOrderInfoVO.setList(list); |
| | | return AjaxResult.success(chargingOrderInfoVO); |
| | | } |
| | |
| | | BigDecimal data2 = vipOrderService.getSumAmout(sixBefore); |
| | | map.put("vipAmount",data2); |
| | | |
| | | return R.ok(map); |
| | | |
| | | |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @Resource |
| | |
| | | } |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getStartTime, start).le(TChargingOrder::getEndTime, end).in(TChargingOrder::getSiteId, siteIds).list(); |
| | | List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList()); |
| | | chargingOrderIds.add(-1l); |
| | | chargingOrderIds.add(-1L); |
| | | //上方饼图 |
| | | List<Map<String,Object>> maps = chargingOrderService.getSumByType(chargingOrderIds); |
| | | |
| | |
| | | startDate = startDate.plusDays(1); |
| | | } |
| | | |
| | | tCharingUserMapVO.setMap(map); |
| | | tCharingUserMapVO.setMap(dateRangeStatistics); |
| | | |
| | | |
| | | List<Map<String,Object>> map1 = chargingOrderService.usersByQuery1(statisticsQueryDto); |
| | | |
| | | |
| | | |
| | | LocalDate startDate1 = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate1 = statisticsQueryDto.getEndTime(); |
| | | |
| | | List<Map<String, Object>> dateRangeStatistics1 = new ArrayList<>(); |
| | | |
| | | // 遍历日期范围 |
| | | while (!startDate1.isAfter(endDate1)) { |
| | | String formattedDate = startDate1.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | Map<String, Object> dailyStats = findMapWithDateValue(map1, formattedDate); |
| | | |
| | | if (dailyStats != null) { |
| | | dateRangeStatistics1.add(dailyStats); |
| | | } else { |
| | | Map<String, Object> dateMap = new HashMap<>(); |
| | | dateMap.put("time", formattedDate); |
| | | dateMap.put("counts", 0); |
| | | dateRangeStatistics1.add(dateMap); |
| | | } |
| | | |
| | | // 移动到下一天 |
| | | startDate1 = startDate1.plusDays(1); |
| | | } |
| | | |
| | | tCharingUserMapVO.setMap1(dateRangeStatistics1); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | //用户标签 |
| | |
| | | } else { |
| | | siteIds.add(statisticsQueryDto.getSiteId()); |
| | | } |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().in(!siteIds.isEmpty(), TChargingOrder::getSiteId, siteIds).eq(statisticsQueryDto.getSiteId() != null, TChargingOrder::getSiteId, statisticsQueryDto.getSiteId()).list(); |
| | | LocalDateTime selectDate = statisticsQueryDto.getSelectDate(); |
| | | LocalDateTime min = selectDate.with(LocalTime.MIN); |
| | | LocalDateTime max = selectDate.with(LocalTime.MAX); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | 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(); |
| | | //当日的订单总数 |
| | | int size = list.size(); |
| | | //计算list中paymentAmount的总和 |