| | |
| | | //充电中 |
| | | long charging = list.stream().filter(s -> s.getStatus().equals(4)).count(); |
| | | //离网 |
| | | long offline = list.stream().filter(s -> s.getStatus().equals(0)).count(); |
| | | long offline = list.stream().filter(s -> s.getStatus().equals(1)).count(); |
| | | //故障 |
| | | long breakdown = list.stream().filter(s -> s.getStatus().equals(7)).count(); |
| | | ChargingGunCountMonitoring chargingGunCountMonitoring = new ChargingGunCountMonitoring(); |
| | |
| | | |
| | | if(null != query.getStatus() && 0 < query.getStatus().size()){ |
| | | if(query.getStatus().contains(3)){ |
| | | query.getStatus().add(5); |
| | | query.getStatus().add(6); |
| | | query.getStatus().add(7); |
| | | } |
| | | } |
| | | PageInfo<ChargingGunMonitoring> pageInfo = new PageInfo<>(query.getPageCurr(), query.getPageSize()); |
| | |
| | | TChargingOrder chargingOrder = chargingOrderClient.getOrderDetailByGunId(id).getData(); |
| | | if(null != chargingOrder){ |
| | | Long appUserCarId = chargingOrder.getAppUserCarId(); |
| | | TAppUserCar tAppUserCar = appUserCarClient.getCarByIds(Arrays.asList(appUserCarId)).getData().get(0); |
| | | if(null != tAppUserCar){ |
| | | if(null != appUserCarId){ |
| | | TAppUserCar tAppUserCar = appUserCarClient.getCarByIds(Arrays.asList(appUserCarId)).getData().get(0); |
| | | gunMonitoring.setLicensePlate(tAppUserCar.getLicensePlate()); |
| | | } |
| | | |
| | |
| | | </foreach> |
| | | </if> |
| | | <if test="null != query.name and '' != query.name"> |
| | | and a.name like CONCAT('%', #{query.name}, '%') |
| | | and CONCAT(b.number, a.name) like CONCAT('%', #{query.name}, '%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | 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 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; |
| | |
| | | BigDecimal data2 = vipOrderService.getSumAmout(sixBefore); |
| | | map.put("vipAmount",data2); |
| | | |
| | | return R.ok(map); |
| | | |
| | | |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @Resource |
| | |
| | | siteIds.add(statisticsQueryDto.getSiteId()); |
| | | } |
| | | LocalDateTime selectDate = statisticsQueryDto.getSelectDate(); |
| | | LocalDateTime min = selectDate.MIN; |
| | | LocalDateTime max = selectDate.MAX; |
| | | 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(); |
| | |
| | | @ApiModelProperty("结束时间") |
| | | private LocalDate endTime; |
| | | @ApiModelProperty("工作台用查询参数") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8") |
| | | private LocalDateTime selectDate; |
| | | } |
| | |
| | | List<TChargingOrder> list = chargingOrderService.list(new LambdaQueryWrapper<TChargingOrder>().in(TChargingOrder::getSiteId, siteIds).eq(TChargingOrder::getStatus, 5) |
| | | .eq(TChargingOrder::getDelFlag, 0).last(" and start_time between '" + startTime + "' and DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%s')")); |
| | | List<Long> orderId = list.stream().map(TChargingOrder::getId).collect(Collectors.toList()); |
| | | List<TChargingOrderAccountingStrategy> list1 = this.list(new LambdaQueryWrapper<TChargingOrderAccountingStrategy>().in(TChargingOrderAccountingStrategy::getChargingOrderId, orderId)); |
| | | |
| | | List<TChargingOrderAccountingStrategy> list1 = new ArrayList<>(); |
| | | if(orderId.size() > 0){ |
| | | list1 = this.list(new LambdaQueryWrapper<TChargingOrderAccountingStrategy>().in(TChargingOrderAccountingStrategy::getChargingOrderId, orderId)); |
| | | } |
| | | |
| | | List<List<Map<String, Object>>> list2 = new ArrayList<>(); |
| | | for (int i = days; i >= 0; i--) { |
| | | Calendar nowDateTime = Calendar.getInstance(); |
| | |
| | | chargingGun.setSoc(query.getSoc()); |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | } |
| | | chargingOrder.setChargingCapacity(query.getCharging_degree()); |
| | | chargingOrder.setElectricity(query.getCharging_degree()); |
| | | chargingOrder.setTotalElectricity(new BigDecimal(100 - query.getSoc())); |
| | | this.updateById(chargingOrder); |
| | |
| | | // 每天凌晨12点执行的定时任务 |
| | | |
| | | |
| | | // @Scheduled(cron = "0 0 12 * * ?") |
| | | @Scheduled(cron = "0 0 12 2 * ?") |
| | | // 每30秒执行一次的定时任务 |
| | | @Scheduled(cron = "0/30 * * * * ?") |
| | | @Scheduled(cron = "0 0 12 1 * ?") |
| | | public void taskMonth() { |
| | | try { |
| | | System.err.println("执行定时任务生成账单"); |
| | |
| | | } |
| | | } |
| | | // 每个月最后一天23点执行的定时任务 |
| | | @Scheduled(cron = "0 0 23 L * ?") |
| | | @Scheduled(cron = "0 0 12 1 * ?") |
| | | public void taskLastDay() { |
| | | try { |
| | | // 获取上个月的开始和结束日期 |
| | |
| | | |
| | | </select> |
| | | <select id="countAll" resultType="java.util.Map"> |
| | | select sum(electrovalence) as electrovalence,sum(service_charge) as service_charge,sum(commission_amount) as commission_amount,sum(sharing_amount) as sharing_amount |
| | | select sum(electrovalence) as electrovalence,sum(service_charge) as service_charge,ROUND(sum(order_amount) * 0.0006, 2) as commission_amount,sum(sharing_amount) as sharing_amount |
| | | from t_charging_order |
| | | where create_time >= #{sixBefore} and del_flag = 0 and recharge_payment_status = 2 |
| | | </select> |
| | |
| | | id, code, app_user_id, order_type, goods_id, coupon_id, purchase_quantity, app_user_address_id, order_amount, app_coupon_id, coupon_discount_amount, vip_discount, vip_discount_amount, payment_amount, payment_status, payment_type, serial_number, remark, status, express_company, express_number, consigner_id, consigner_time, receiving_time, cancellation_time, cancellation_id, refund_code, refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag |
| | | </sql> |
| | | <select id="activityStatistics" resultType="com.ruoyi.order.api.vo.TActivityStatisticslVO"> |
| | | select t9.code ,t9.order_amount as orderAmount, |
| | | t9.coupon_discount_amount as couponDiscountAmount, |
| | | t9.vip_discount_amount as vipDiscountAmount, |
| | | t9.payment_amount as paymentAmount, |
| | | t9.create_time as createTime, |
| | | 1 as orderType |
| | | from t_charging_order t9 |
| | | where t9.id = 0 limit 1 |
| | | <if test="req.orderType == null or req.orderType == 1"> |
| | | <if test="req.type == null or req.type == 1 or req.type == 2"> |
| | | select t1.code ,t1.order_amount as orderAmount, |
| | | union all |
| | | select t1.code ,t1.order_amount as orderAmount, |
| | | t1.coupon_discount_amount as couponDiscountAmount, |
| | | t1.vip_discount_amount as vipDiscountAmount, |
| | | t1.payment_amount as paymentAmount, |
| | |
| | | switch (buyType){ |
| | | case 1: |
| | | if (byId.getMonthlyCardDiscountStart()!=null&&(now.isAfter(byId.getMonthlyCardDiscountStart())&&now.isBefore(byId.getMonthlyCardDiscountEnd()))){ |
| | | payMoney = byId.getMonthlyCard().multiply(byId.getMonthlyCardDiscount()); |
| | | payMoney = byId.getMonthlyCard().multiply(byId.getMonthlyCardDiscount().divide(new BigDecimal(10))); |
| | | discountMoney = byId.getMonthlyCard().subtract(payMoney); |
| | | discount = byId.getMonthlyCardDiscount(); |
| | | }else { |
| | |
| | | break; |
| | | case 2: |
| | | if (byId.getSeasonCardDiscountStart()!=null&&(now.isAfter(byId.getSeasonCardDiscountStart())&&now.isBefore(byId.getSeasonCardDiscountEnd()))){ |
| | | payMoney = byId.getSeasonCard().multiply(byId.getSeasonCardDiscount()); |
| | | payMoney = byId.getSeasonCard().multiply(byId.getSeasonCardDiscount().divide(new BigDecimal(10))); |
| | | discountMoney = byId.getSeasonCard().subtract(payMoney); |
| | | discount = byId.getSeasonCardDiscount(); |
| | | }else { |
| | |
| | | break; |
| | | case 3: |
| | | if (byId.getAnnualCardDiscountStart()!=null&&(now.isAfter(byId.getAnnualCardDiscountStart())&&now.isBefore(byId.getAnnualCardDiscountEnd()))){ |
| | | payMoney = byId.getAnnualCard().multiply(byId.getAnnualCardDiscount()); |
| | | payMoney = byId.getAnnualCard().multiply(byId.getAnnualCardDiscount().divide(new BigDecimal(10))); |
| | | discountMoney = byId.getAnnualCard().subtract(payMoney); |
| | | discount = byId.getAnnualCardDiscount(); |
| | | }else { |