| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 远程调用 监管平台查询前一天用能统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 远程调用 增加管理后台赠送会员记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 远程调用根据枪id 查询最新的订单id 用户后台结束充电 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public static List<PayOrderDto> testing5(long total, long current, long size, List<PayOrderDto> str){ |
| | | List<PayOrderDto> result = new ArrayList<>(); |
| | | //获取初始化分页结构 |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return R.ok(payOrderInfoDto3); |
| | | |
| | | |
| | | |
| | | } |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/paymentOrder/refund"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/pay/order/refund/list") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public static List<TChargingOrderRefund> testing4(long total, long current, long size, List<TChargingOrderRefund> str){ |
| | | List<TChargingOrderRefund> result = new ArrayList<>(); |
| | | //获取初始化分页结构 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping(value = "/pay/order/refund/list1") |
| | | @ApiOperation(value = "列表1", tags = {"管理后台-支付订单-退款订单"}) |
| | |
| | | return chargingOrderService.getRefundList(chargingRefundDto); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPileOrder"}, logical = Logical.OR) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Log(title = "【扫一扫】添加评价", businessType = BusinessType.INSERT,operatorType = OperatorType.MOBILE) |
| | | @ResponseBody |
| | | @PostMapping(value = "/addEvaluate") |
| | |
| | | orderEvaluateService.addOrderEvaluate(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询会员在本月有多少次享受了充电折扣 |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | //订单详情 |
| | | @PostMapping(value = "/detail") |
| | | public R<TChargingOrder> detail(@RequestParam("orderId") Long orderId) { |
| | | return R.ok(chargingOrderService.getById(orderId)); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping(value = "/getList") |
| | |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().eq(TChargingOrder::getSiteId, siteId).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping(value = "/getBySiteIdAndTime") |
| | |
| | | |
| | | /** |
| | | * 根据站点id和时间区间查询订单数据 |
| | | * |
| | | * @param chargingPercentProvinceDto |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据充电枪id获取正在进行中的订单 |
| | | * |
| | | * @param chargingGunId 充电枪id |
| | | * @return |
| | | */ |
| | |
| | | .eq(TChargingOrder::getDelFlag, 0).eq(TChargingOrder::getStatus, 3)); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | MyChargingOrderInfo myChargingOrderInfo = chargingOrderService.getMyChargingOrderInfo(id); |
| | | return AjaxResult.success(myChargingOrderInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 修改安全检测数据 |
| | | * |
| | | * @param securityDetection |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 远程启动充电应答 |
| | | * |
| | | * @param message |
| | | */ |
| | | @ResponseBody |
| | |
| | | log.info("-------------------远程启动充电请求应答-------------------:" + message); |
| | | chargingOrderService.startChargeSuccessfully(message); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @RequestParam("attach") String attach) { |
| | | chargingOrderService.chargingOrderCallback(2, out_trade_no, transaction_id, attach); |
| | | } |
| | | |
| | | /** |
| | | * 支付宝H5支付成功后的回调 |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 远程启动失败后退款回调 |
| | | */ |
| | |
| | | @RequestParam("success_time") String success_time){ |
| | | chargingOrderService.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Log(title = "【扫一扫】手动停止充电", businessType = BusinessType.STOP,operatorType = OperatorType.MOBILE) |
| | | @ResponseBody |
| | | @PutMapping(value = "/stopCharging/{id}") |
| | |
| | | |
| | | /** |
| | | * 停止充电应答处理逻辑 |
| | | * |
| | | * @param platformStopChargingReply |
| | | */ |
| | | @PostMapping("/terminateSuccessfulResponse") |
| | |
| | | |
| | | /** |
| | | * 停止充电返回账单后计算费用 |
| | | * |
| | | * @param vo |
| | | */ |
| | | @PostMapping("/endChargeBillingCharge") |
| | |
| | | log.info("-------------------停止充电返回账单后计算费用及修改业务状态-------------------:" + vo); |
| | | return chargingOrderService.endChargeBillingCharge(vo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/platformRevenueAnalysis"}, logical = Logical.OR) |
| | |
| | | List<SixVipDto> vipDtos = vipOrderService.sixBefore(sixBefore); |
| | | return R.ok(vipDtos); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 处理充电订单实时监控数据相关的业务逻辑 |
| | | * |
| | | * @param query |
| | | */ |
| | | @PostMapping("/chargeMonitoring") |
| | |
| | | |
| | | /** |
| | | * 通过流水号查询订单 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | |
| | | one.setIdStr(one.getId().toString()); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingOperationAnalysis"}, logical = Logical.OR) |
| | |
| | | start = LocalDate.now(); |
| | | end = LocalDate.now().plusDays(1); |
| | | }else if (statisticsQueryDto.getDayType()==2){ |
| | | LocalDate today = LocalDate.now(); |
| | | // 获取本周一的日期 |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | end = statisticsQueryDto.getEndTime().plusDays(1); |
| | | } else if (statisticsQueryDto.getDayType()==3){ |
| | | // 获取当前日期 |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | end = statisticsQueryDto.getEndTime().plusDays(1); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | // 获取今年1月1日的日期 |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | end = statisticsQueryDto.getEndTime().plusDays(1); |
| | | }else if (statisticsQueryDto.getDayType()==5){ |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | if (start.equals(end)){ |
| | | end = end.plusDays(1); |
| | | } |
| | | } |
| | | //上方饼图 |
| | | List<Map<String,Object>> maps = chargingOrderService.getSumByType(start,end, siteIds); |
| | |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | | |
| | | |
| | | |
| | | List<Map<String, Object>> dateRangeStatistics = new ArrayList<>(); |
| | |
| | | List<Map<String,Object>> map1 = chargingOrderService.usersByQuery1(statisticsQueryDto); |
| | | |
| | | |
| | | |
| | | LocalDate startDate1 = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate1 = statisticsQueryDto.getEndTime(); |
| | | |
| | |
| | | } |
| | | |
| | | tCharingUserMapVO.setMap1(dateRangeStatistics1); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | System.out.printf("The average percent is: %.2f\n", average4); |
| | | |
| | | |
| | | |
| | | TCharingUserEquimentVO tCharingUserEquimentVO = new TCharingUserEquimentVO(); |
| | | tCharingUserEquimentVO.setEquipmentMap1(equipmentMap1); |
| | | tCharingUserEquimentVO.setEquipmentMap2(equipmentMap2); |
| | |
| | | } |
| | | |
| | | private static final DecimalFormat DF = new DecimalFormat("#.00"); |
| | | |
| | | public static double calculateAveragePercent(List<Map<String, Object>> mapList1, List<Map<String, Object>> mapList2) { |
| | | int totalElements = mapList1.size() + mapList2.size(); |
| | | double sum = 0.0; |
| | |
| | | tCharingWorkVO.setTotalChargingCapacity(totalChargingCapacity); |
| | | return R.ok(tCharingWorkVO); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/work/use") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 硬件充电结束后的处理逻辑 |
| | | * |
| | | * @param code |
| | | */ |
| | | @PostMapping("/endCharge") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 硬件异常结束充电后的处理逻辑 |
| | | * |
| | | * @param code |
| | | */ |
| | | @PostMapping("/excelEndCharge") |
| | |
| | | |
| | | /** |
| | | * 根据车牌号和时间查询有效的充电数据 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改充电订单 |
| | | * |
| | | * @param chargingOrder |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取订单数据 |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据车辆id获取指定时间范围内的数据 |
| | | * |
| | | * @param carId |
| | | * @param startTime |
| | | * @param endTime |
| | |
| | | |
| | | /** |
| | | * 根据车牌号查询指定时间范围内的数据 |
| | | * |
| | | * @param plateNum |
| | | * @param startTime |
| | | * @param endTime |
| | |
| | | |
| | | /** |
| | | * 添加三方平台充电订单数据 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/addTripartitePlatformOrder") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据三方平台订单id获取充电数据 |
| | | * |
| | | * @param startChargeSeq |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据三方平台订单ids获取充电数据 |
| | | * |
| | | * @param startChargeSeqs |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 三方平台请求停止充电 |
| | | * |
| | | * @param startChargeSeq |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 临时接口 |
| | | * 获取充电后没有扣除费用的数据 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/getNotPaymentChargingOrder") |
| | |
| | | |
| | | /** |
| | | * 手动推送订单给三方平台 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加汇总数据(临时) |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | return R.ok(new BigDecimal(sumDegreeBySiteIds)); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/addChargingOrder") |
| | | public R<Long> addChargingOrder(@RequestBody TChargingOrder chargingOrder){ |
| | |
| | | |
| | | /** |
| | | * 手动查询订单和退款数据,完善退款记录 |
| | | * |
| | | * @param orderId |
| | | * @param refund_out_trade_no |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 手动查询订单和退款数据,批量完善退款记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/orderQueryRefundList") |
| | |
| | | |
| | | /** |
| | | * 手动添加完善订单费用明细 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 手动批量修改订单支付金额 |
| | | * |
| | | * @param dtos |
| | | * @return |
| | | */ |
| | |
| | | |
| | | Map<String, Object> countAll(@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getSumByType(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | List<Map<String, Object>> getSumByType(@Param("start")String start,@Param("end")String end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getDateData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | List<Map<String, Object>> getDateData(@Param("start")String start,@Param("end")String end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getWeekData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | List<Map<String, Object>> getWeekData(@Param("start")String start,@Param("end")String end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getMonthData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | List<Map<String, Object>> getMonthData(@Param("start")String start,@Param("end")String end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getYearData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | List<Map<String, Object>> getYearData(@Param("start")String start,@Param("end")String end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<ChargingOrderListVO> chargingList(@Param("req") ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getSumByType(LocalDate start, LocalDate end, List<Integer> siteIds) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | String start1 = start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | String end1 = end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | return this.baseMapper.getSumByType(start1, end1, siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getDateData(LocalDate start, LocalDate end, List<Integer> siteIds) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | String start1 = start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | String end1 = end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | return this.baseMapper.getDateData(start1, end1, siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getWeekData(LocalDate start, LocalDate end, List<Integer> siteIds) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | String start1 = start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | String end1 = end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | return this.baseMapper.getWeekData(start1, end1, siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getMonthData(LocalDate start, LocalDate end, List<Integer> siteIds) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | String start1 = start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | String end1 = end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | return this.baseMapper.getMonthData(start1, end1, siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getYearData(LocalDate start, LocalDate end, List<Integer> siteIds) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | String start1 = start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | String end1 = end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00"; |
| | | return this.baseMapper.getYearData(start1, end1, siteIds); |
| | | } |
| | | |
| | |
| | | if (StringUtils.hasLength(dto.getStartTime())) { |
| | | String[] split = dto.getStartTime().split(" - "); |
| | | startTime1 = split[0]; |
| | | String[] split1 = split[1].split(":"); |
| | | startTime2 = split1[0] + ":" + split1[1] + ":59"; |
| | | startTime2 = split[1]; |
| | | } |
| | | |
| | | if (StringUtils.hasLength(dto.getEndTime())) { |
| | | String[] split = dto.getEndTime().split(" - "); |
| | | endTime1 = split[0]; |
| | | String[] split1 = split[1].split(":"); |
| | | endTime2 = split1[0] + ":" + split1[1] + ":59"; |
| | | endTime2 = split[1]; |
| | | } |
| | | ChargingOrderTimeVO chargingOrderTimeVO = new ChargingOrderTimeVO(); |
| | | if (StringUtils.hasLength(dto.getPhone())) { |
| | |
| | | } |
| | | list.add(chargingOrderListVO); |
| | | } |
| | | |
| | | |
| | | |
| | | // 尖峰平谷充电到账 |
| | |
| | | if (thirdRefundAmount.compareTo(BigDecimal.ZERO) == 0) { |
| | | chargingOrderRefund.setRefundSerialNumber("BALANCE"); |
| | | finishManualChargingRefund(tChargingOrder, chargingOrderRefund, manualRefundAmount, balanceRefundAmount, thirdRefundAmount); |
| | | } |
| | | else if (1 == tChargingOrder.getRechargePaymentType()) { |
| | | } else if (1 == tChargingOrder.getRechargePaymentType()) { |
| | | WxPaymentRefundModel model = new WxPaymentRefundModel(); |
| | | model.setOut_trade_no(tChargingOrder.getCode()); |
| | | model.setOut_refund_no(chargingOrderRefund.getRefundCode()); |
| | |
| | | .set(TChargingOrderRefund::getRefundFee, refund_fee) |
| | | .update(); |
| | | } |
| | | } |
| | | |
| | | else if (2 == tChargingOrder.getRechargePaymentType()) { |
| | | } else if (2 == tChargingOrder.getRechargePaymentType()) { |
| | | RefundReq dto = new RefundReq(); |
| | | dto.setOutTradeNo(tChargingOrder.getCode()); |
| | | dto.setOutRequestNo(tChargingOrder.getCode()); |
| | |
| | | finishManualChargingRefund(tChargingOrder, chargingOrderRefund, manualRefundAmount, balanceRefundAmount, thirdRefundAmount); |
| | | |
| | | } |
| | | } |
| | | else if (3 == tChargingOrder.getRechargePaymentType()) { |
| | | } else if (3 == tChargingOrder.getRechargePaymentType()) { |
| | | RefundReq dto = new RefundReq(); |
| | | dto.setOutTradeNo(tChargingOrder.getRechargeSerialNumber()); |
| | | dto.setOutRequestNo(tChargingOrder.getCode()); |
| | |
| | | |
| | | /** |
| | | * 获取已结束的数据 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 获取需要手动修改订单状态的数据 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 查询充电算账单数据 |
| | | * |
| | | * @param startTime |
| | | * @param endTime |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询账户结算账单数据 |
| | | * |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 手动处理退款数据 |
| | | * |
| | | * @param refund_out_trade_no 退款商户单号 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 手动添加完善订单费用明细 |
| | | * |
| | | * @param orderId |
| | | */ |
| | | @Override |
| | |
| | | FROM |
| | | t_charging_order_accounting_strategy t1 |
| | | LEFT JOIN t_charging_order t2 on t1.charging_order_id = t2.id |
| | | where t2.del_flag = 0 and t2.recharge_payment_status = 2 and t2.start_time between #{start} and #{end} |
| | | where t2.del_flag = 0 and t2.recharge_payment_status = 2 and t2.start_time IS NOT NULL and t2.end_time is not null and t2.pay_time between #{start} and #{end} |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and t2.site_id in |
| | | <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> |
| | |
| | | </select> |
| | | <select id="getDateData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(a.create_time, '%H:00' ) as time, |
| | | DATE_FORMAT(a.pay_time, '%H:00' ) as time, |
| | | SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | |
| | | sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money |
| | | from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) |
| | | <where> |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and DATE(a.create_time) = CURDATE() |
| | | and a.start_time between #{start} and #{end} |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and a.start_time IS NOT NULL and a.end_time is not null |
| | | and a.pay_time between #{start} and #{end} |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and a.site_id in |
| | | <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> |
| | |
| | | </select> |
| | | <select id="getWeekData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d' ) as time, |
| | | DATE_FORMAT(a.pay_time, '%Y-%m-%d' ) as time, |
| | | SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | |
| | | sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money |
| | | from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) |
| | | <where> |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and YEARWEEK(DATE_FORMAT(a.create_time, |
| | | '%Y-%m-%d'), 1) = YEARWEEK(NOW(), 1) |
| | | and a.start_time between #{start} and #{end} |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and a.start_time IS NOT NULL and a.end_time is not null |
| | | and a.pay_time between #{start} and #{end} |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and a.site_id in |
| | | <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> |
| | |
| | | </select> |
| | | <select id="getMonthData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d' ) as time, |
| | | DATE_FORMAT(a.pay_time, '%Y-%m-%d' ) as time, |
| | | SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | |
| | | sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money |
| | | from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) |
| | | <where> |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and MONTH(a.create_time) = MONTH(NOW()) |
| | | AND YEAR(a.create_time) = YEAR(NOW()) |
| | | and a.start_time between #{start} and #{end} |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and a.start_time IS NOT NULL and a.end_time is not null |
| | | and a.pay_time between #{start} and #{end} |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and a.site_id in |
| | | <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> |
| | |
| | | </select> |
| | | <select id="getYearData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d' ) as time, |
| | | DATE_FORMAT(a.pay_time, '%Y-%m-%d' ) as time, |
| | | SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | |
| | | sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money |
| | | from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) |
| | | <where> |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and YEAR(a.create_time) = YEAR(NOW()) |
| | | and a.start_time between #{start} and #{end} |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and a.start_time IS NOT NULL and a.end_time is not null |
| | | and a.pay_time between #{start} and #{end} |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and a.site_id in |
| | | <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> |
| | |
| | | </select> |
| | | <select id="getByDate" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d' ) as time, |
| | | DATE_FORMAT(a.pay_time, '%Y-%m-%d' ) as time, |
| | | SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | |
| | | sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money |
| | | from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) |
| | | <where> |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 |
| | | and a.start_time between #{start} and #{end} |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and a.start_time IS NOT NULL and a.end_time is not null |
| | | and a.pay_time between #{start} and #{end} |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and a.site_id in |
| | | <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> |
| | |
| | | and a.site_id = #{req.siteId} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (a.create_time between #{startTime1} and #{startTime2}) |
| | | and (a.pay_time between #{startTime1} and #{startTime2}) |
| | | </if> |
| | | <if test="endTime1 != null and endTime1!=''"> |
| | | and (a.end_time between #{endTime1} and #{endTime2}) |
| | |
| | | and b.site_id = #{req.siteId} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and b.start_time between #{startTime1} and #{startTime2} |
| | | and b.pay_time between #{startTime1} and #{startTime2} |
| | | </if> |
| | | <if test="endTime1 != null and endTime2!=''"> |
| | | and b.end_time between #{endTime1} and #{endTime2} |
| | |
| | | and co.site_id = #{req.siteId} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and co.start_time between #{startTime1} and #{startTime2} |
| | | and co.pay_time between #{startTime1} and #{startTime2} |
| | | </if> |
| | | <if test="endTime1 != null and endTime2!=''"> |
| | | and co.end_time between #{endTime1} and #{endTime2} |
| | |
| | | and co.site_id = #{req.siteId} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and co.start_time between #{startTime1} and #{startTime2} |
| | | and co.pay_time between #{startTime1} and #{startTime2} |
| | | </if> |
| | | <if test="endTime1 != null and endTime2!=''"> |
| | | and co.end_time between #{endTime1} and #{endTime2} |