Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
# Conflicts:
# ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
# ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
| | |
| | | |
| | | @Override |
| | | public R<List<Integer>> getCountByCouponIds(String couponIds) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getUseCountByCouponId(Integer couponId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R<List<TAppUserCar>> getAllCar() { |
| | | return null; |
| | | return R.fail("获取所有车辆失败:"+throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R<List<Long>> getAppUserCarByLicensePlates(String licensePlate) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R<List<TAppUser>> getAllUser() { |
| | | return null; |
| | | return R.fail("根据所有用户失败:"+throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R changeDown(PointChangeDto points) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R giveVip(GiveVipDto giveVipDto) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R<List<TChargingGun>> getAllGun() { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<TChargingPile>> getAllPile() { |
| | | return null; |
| | | return R.fail("获取所有桩失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R<List<TChargingPile>> getChargingPileBySiteIds(List<Integer> siteIds) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<BigDecimal> getRecordAmount(String sixBefore) { |
| | | return null; |
| | | public R<BigDecimal> getRecordAmount() { |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R<Integer> getSiteIdByOrderId(Long id) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<TParkingRecord>> getSiteIdAll() { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R<List<Boolean>> getChargingOrderMenu(Integer partnerId, Integer siteId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Boolean>> getChargingListMenu(Integer partnerId, Integer siteId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Boolean>> getSettlementListMenu(Integer partnerId, Integer siteId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Boolean>> getAccountMenu(Integer partnerId, Integer siteId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Boolean>> managePageListMenu(Integer partnerId, Integer siteId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Boolean>> parkingRecordListMenu(Integer partnerId, Integer siteId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Boolean>> watchChargingOrder(Integer partnerId, Integer siteId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Boolean>> chargeEvaluation(Integer partnerId, Integer siteId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R<List<GetSiteListDTO>> getSiteListByUserId(Long userId) { |
| | | return R.fail("获取数据失败"); |
| | | return R.fail("获取数据失败" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R<List<Partner>> getAllPartner() { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | R<TParkingRecord> getRecordById(@RequestParam("id") Long siteId); |
| | | |
| | | @PostMapping(value = "/t-parking-lot/getRecordAmount") |
| | | R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") String sixBefore); |
| | | R<BigDecimal> getRecordAmount(); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public R delete(String id) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R<List<ChargingOrderGroup>> getBySiteIdAndTime(ChargingPercentProvinceDto chargingPercentProvinceDto) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R<TExchangeOrder> orderDetail(Long orderId) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R<Integer> getSalesCountByGoodsIdgetCount(Integer goodId, Integer goodeType, Integer buyType) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public R<Long> addVipOrder(TVipOrder vipOrder) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | @Override |
| | | public R<TVip> getInfo(Integer type) { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public R<List<TVip>> getAllVip() { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | |
| | | @Override |
| | | public R<Boolean> saveLog(SysOperLog sysOperLog, String source) |
| | | { |
| | | return null; |
| | | return R.fail("获取数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | }; |
| | |
| | | */ |
| | | @PostMapping(value = "/getAllGun") |
| | | public R<List<TChargingGun>> getAllGun() { |
| | | return R.ok(chargingGunService.list(null)); |
| | | return R.ok(chargingGunService.list()); |
| | | } |
| | | /** |
| | | * 查询所有桩 |
| | | */ |
| | | @PostMapping(value = "/getAllPile") |
| | | public R<List<TChargingPile>> getAllPile() { |
| | | return R.ok(chargingPileService.list(null)); |
| | | return R.ok(chargingPileService.list()); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | @PostMapping(value = "/getRecordAmount") |
| | | public R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") String sixBefore){ |
| | | BigDecimal sum = parkingRecordService.getSum(sixBefore); |
| | | public R<BigDecimal> getRecordAmount(){ |
| | | BigDecimal sum = parkingRecordService.getSum(); |
| | | return R.ok(sum); |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface TParkingRecordMapper extends BaseMapper<TParkingRecord> { |
| | | |
| | | BigDecimal getSum(@Param("sixBefore") String sixBefore); |
| | | BigDecimal getSum(); |
| | | |
| | | /** |
| | | * 停车缴费订单列表 |
| | |
| | | */ |
| | | public interface TParkingRecordService extends IService<TParkingRecord> { |
| | | |
| | | BigDecimal getSum(String sixBefore); |
| | | BigDecimal getSum(); |
| | | |
| | | /** |
| | | * 停车缴费订单列表 |
| | |
| | | private SiteClient siteClient; |
| | | |
| | | @Override |
| | | public BigDecimal getSum(String sixBefore) { |
| | | return this.baseMapper.getSum(sixBefore); |
| | | public BigDecimal getSum() { |
| | | return this.baseMapper.getSum(); |
| | | } |
| | | |
| | | @Autowired |
| | |
| | | id, code,app_user_id, license_plate, vehicle_color, charging_order_id, parking_lot_id, in_parking_time, out_parking_time, parking_duration, order_amount, status, out_parking_type, create_time |
| | | </sql> |
| | | <select id="getSum" resultType="java.math.BigDecimal"> |
| | | select sum(timeout_amount) from t_parking_record where in_parking_time >= #{sixBefore} |
| | | select sum(timeout_amount) from t_parking_record |
| | | </select> |
| | | <select id="pageList" resultType="com.ruoyi.chargingPile.api.vo.TParkingRecordVO"> |
| | | select |
| | |
| | | @ApiOperation(value = "底部数据分类", tags = {"后台-数据分析-平台收入分析"}) |
| | | public R<Map<String,Object>> total() { |
| | | //count近6个月的数据 |
| | | LocalDate sixBefore = PreviousSixMonths.get(); |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | //获取当前登录的siteIds |
| | | List<Integer> siteIds = new ArrayList<>(); |
| | |
| | | if (siteIds.isEmpty()){ |
| | | siteIds.add(-1); |
| | | } |
| | | Map<String,Object> map = chargingOrderService.countAll(sixBefore,siteIds); |
| | | BigDecimal data = parkingLotClient.getRecordAmount(sixBefore.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).getData(); |
| | | Map<String,Object> map = chargingOrderService.countAll(siteIds); |
| | | BigDecimal data = parkingLotClient.getRecordAmount().getData(); |
| | | if (map ==null){ |
| | | map = new HashMap<String,Object>(); |
| | | } |
| | | map.put("parkingAmount",data); |
| | | BigDecimal data1 = shoppingOrderService.getSumAmount(sixBefore); |
| | | BigDecimal data1 = shoppingOrderService.getSumAmount(); |
| | | map.put("shopAmount",data1); |
| | | BigDecimal data2 = vipOrderService.getSumAmout(sixBefore); |
| | | BigDecimal data2 = vipOrderService.getSumAmout(); |
| | | map.put("vipAmount",data2); |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().between(TChargingOrder::getCreateTime, sixBefore, LocalDate.now()).list(); |
| | | BigDecimal serviceCharge = new BigDecimal("0"); |
| | | BigDecimal commissionAmount = new BigDecimal("0"); |
| | | |
| | | for (TChargingOrder chargingOrder : list) { |
| | | if (chargingOrder.getOrderSource().equals(2)){ |
| | | serviceCharge = serviceCharge.add(chargingOrder.getServiceCharge()!=null?chargingOrder.getServiceCharge().multiply(new BigDecimal("0.2")).setScale(2,BigDecimal.ROUND_DOWN):new BigDecimal("0")); |
| | | commissionAmount = commissionAmount.add(chargingOrder.getServiceCharge()!=null?chargingOrder.getServiceCharge().multiply(new BigDecimal("0.2")).setScale(2,BigDecimal.ROUND_DOWN):new BigDecimal("0")); |
| | | }else if (chargingOrder.getServiceCharge()!=null){ |
| | | serviceCharge = serviceCharge.add(chargingOrder.getServiceCharge()); |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().eq(TChargingOrder::getStatus, 5).eq(TChargingOrder::getDelFlag, 0) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2).list(); |
| | | BigDecimal sharingAmount = BigDecimal.ZERO; |
| | | BigDecimal commissionAmount = BigDecimal.ZERO; |
| | | //计算list中electrovalence的总和 |
| | | BigDecimal totalElectrovalence = BigDecimal.ZERO; |
| | | //计算list中serviceCharge的总和 |
| | | BigDecimal totalServiceCharge = BigDecimal.ZERO; |
| | | List<TChargingOrderAccountingStrategy> accountingStrategyList = chargingOrderAccountingStrategyService.list(); |
| | | for (TChargingOrder order : list) { |
| | | List<TChargingOrderAccountingStrategy> collect = accountingStrategyList.stream().filter(s -> s.getChargingOrderId().equals(order.getId())).collect(Collectors.toList()); |
| | | BigDecimal periodElectricPrice = collect.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal periodServicePrice = collect.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | totalElectrovalence = totalElectrovalence.add(periodElectricPrice); |
| | | commissionAmount = commissionAmount.add(order.getRechargeAmount().multiply(new BigDecimal("0.006"))); |
| | | if(2 != order.getOrderSource()){ |
| | | totalServiceCharge = totalServiceCharge.add(periodServicePrice); |
| | | }else{ |
| | | totalServiceCharge = totalServiceCharge.add(periodServicePrice.multiply(new BigDecimal("0.8"))); |
| | | sharingAmount = sharingAmount.add(periodServicePrice.multiply(new BigDecimal("0.2"))); |
| | | } |
| | | |
| | | } |
| | | map.put("service_charge",serviceCharge); |
| | | map.put("commission_amount",commissionAmount); |
| | | map.put("service_charge",totalServiceCharge.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | map.put("electrovalence",totalElectrovalence.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | map.put("commission_amount",commissionAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | map.put("sharing_amount",sharingAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | return R.ok(map); |
| | | } |
| | | |
| | |
| | | if (siteIds.isEmpty())siteIds.add(-1); |
| | | TCharingOrderMapVO tCharingOrderMapVO = new TCharingOrderMapVO(); |
| | | |
| | | |
| | | LocalDate start = null; |
| | | LocalDate end = null; |
| | | if (statisticsQueryDto.getDayType()==1){ |
| | | start = LocalDate.now(); |
| | | end = LocalDate.now().plusDays(1); |
| | | |
| | | }else if (statisticsQueryDto.getDayType()==2){ |
| | | LocalDate today = LocalDate.now(); |
| | | |
| | | // 获取本周一的日期 |
| | | LocalDate mondayThisWeek = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)); |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | System.out.println("本周一是: " + mondayThisWeek); |
| | | } |
| | | else if (statisticsQueryDto.getDayType()==3){ |
| | | } else if (statisticsQueryDto.getDayType()==3){ |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime().plusDays(1); |
| | | // 获取本月1号的日期 |
| | | // start = yearMonth.atDay(1); |
| | | // |
| | | // System.out.println("本月1号是: " + start); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | |
| | | // 获取今年1月1日的日期 |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | }else if (statisticsQueryDto.getDayType()==5){ |
| | | |
| | | // 获取今年1月1日的日期 |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | |
| | | end = end.plusDays(1); |
| | | } |
| | | } |
| | | |
| | | // 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); |
| | | //上方饼图 |
| | | List<Map<String,Object>> maps = chargingOrderService.getSumByType(start,end, siteIds); |
| | | |
| | |
| | | |
| | | tCharingOrderMapVO.setMaps1(charMap); |
| | | }else if (statisticsQueryDto.getDayType()==2){ |
| | | |
| | | |
| | | |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(start,end); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(start,end, siteIds); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==3){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(start,end); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(start,end, siteIds); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getYearData(start,end); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getYearData(start,end, siteIds); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==5){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getByDate(start,end); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getByDate(start,end, siteIds); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | |
| | | 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(TChargingOrder::getStatus,5) |
| | | .between(TChargingOrder::getCreateTime, min, max).eq(TChargingOrder::getStatus,5).eq(TChargingOrder::getDelFlag, 0) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2) |
| | | .eq(statisticsQueryDto.getSiteId() != null, TChargingOrder::getSiteId, statisticsQueryDto.getSiteId()).list(); |
| | | //当日的订单总数 |
| | | int size = list.size(); |
| | | //计算list中paymentAmount的总和 |
| | | BigDecimal totalPaymentAmount = list.stream().map(TChargingOrder::getPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalPaymentAmount = BigDecimal.ZERO; |
| | | //计算list中electrovalence的总和 |
| | | BigDecimal totalElectrovalence = list.stream().map(TChargingOrder::getElectrovalence).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalElectrovalence = BigDecimal.ZERO; |
| | | //计算list中serviceCharge的总和 |
| | | BigDecimal totalServiceCharge = list.stream().map(TChargingOrder::getServiceCharge).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalServiceCharge = BigDecimal.ZERO; |
| | | //计算list中charging_capacity的总和 |
| | | BigDecimal totalChargingCapacity = list.stream().map(TChargingOrder::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalChargingCapacity = BigDecimal.ZERO; |
| | | List<TChargingOrderAccountingStrategy> accountingStrategyList = chargingOrderAccountingStrategyService.list(); |
| | | for (TChargingOrder order : list) { |
| | | List<TChargingOrderAccountingStrategy> collect = accountingStrategyList.stream().filter(s -> s.getChargingOrderId().equals(order.getId())).collect(Collectors.toList()); |
| | | BigDecimal periodElectricPrice = collect.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal periodServicePrice = collect.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal chargingCapacity = collect.stream().map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | totalElectrovalence = totalElectrovalence.add(periodElectricPrice); |
| | | totalChargingCapacity = totalChargingCapacity.add(chargingCapacity); |
| | | if(2 != order.getOrderSource()){ |
| | | totalServiceCharge = totalServiceCharge.add(periodServicePrice); |
| | | totalPaymentAmount = totalPaymentAmount.add(periodElectricPrice).add(periodServicePrice); |
| | | }else{ |
| | | totalServiceCharge = totalServiceCharge.add(periodServicePrice.multiply(new BigDecimal("0.8"))); |
| | | totalPaymentAmount = totalPaymentAmount.add(periodElectricPrice).add(periodServicePrice.multiply(new BigDecimal("0.8"))); |
| | | } |
| | | } |
| | | |
| | | TCharingWorkVO tCharingWorkVO = new TCharingWorkVO(); |
| | | tCharingWorkVO.setCount(size); |
| | | tCharingWorkVO.setTotalPaymentAmount(totalPaymentAmount); |
| | |
| | | |
| | | List<SixCircleDto> circle(@Param("siteIds")List<Integer> siteIds,@Param("sixBefore")LocalDate sixBefore); |
| | | |
| | | Map<String, Object> countAll(@Param("sixBefore")LocalDate sixBefore,@Param("siteIds")List<Integer> siteIds); |
| | | 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>> getDateData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getWeekData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | List<Map<String, Object>> getWeekData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getMonthData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | List<Map<String, Object>> getMonthData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getYearData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | List<Map<String, Object>> getYearData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<ChargingOrderListVO> chargingList(@Param("pageInfo")PageInfo<ChargingOrderListVO> pageInfo, @Param("req") ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | List<ChargingOrderListVO> chargingListNoPage( @Param("req")ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | |
| | | List<Map<String, Object>> getByDate(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | List<Map<String, Object>> getByDate(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> queryPower(@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | Map<String, Object> queryPowerLevel(@Param("siteIds") List<Integer> siteIds,@Param("statisticsQueryDto") ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | List<Map<String, Object>> queryOrderCountAndMoneyBySiteIdDate(@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> usersDay(@Param("statisticsQueryDto")ChargingStatisticsQueryDto statisticsQueryDto); |
| | | List<Map<String, Object>> usersDay1(); |
| | |
| | | |
| | | List<SixShopDto> sixBefore(@Param("sixBefore")LocalDate sixBefore,@Param("status") Integer status); |
| | | |
| | | BigDecimal getSumAmount(@Param("sixBefore")LocalDate sixBefore); |
| | | BigDecimal getSumAmount(); |
| | | |
| | | List<Map<String, Object>> getData(@Param("statisticsQueryDto")ChargingStatisticsQueryDto statisticsQueryDto); |
| | | } |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | List<SixVipDto> sixBefore(@Param("sixBefore")LocalDate sixBefore); |
| | | |
| | | BigDecimal getSumAmout(@Param("sixBefore")LocalDate sixBefore); |
| | | BigDecimal getSumAmout(); |
| | | } |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | List<SixCircleDto> circle(List<Integer> siteIds,LocalDate sixBefore); |
| | | |
| | | Map<String, Object> countAll(LocalDate sixBefore,List<Integer> siteIds); |
| | | Map<String, Object> countAll(List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getSumByType(LocalDate start,LocalDate end,List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getDateData(LocalDate start,LocalDate end,List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getWeekData(LocalDate start,LocalDate end); |
| | | List<Map<String, Object>> getWeekData(LocalDate start,LocalDate end,List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getMonthData(LocalDate start,LocalDate end); |
| | | List<Map<String, Object>> getMonthData(LocalDate start,LocalDate end,List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getYearData(LocalDate start,LocalDate end); |
| | | List<Map<String, Object>> getYearData(LocalDate start,LocalDate end,List<Integer> siteIds); |
| | | |
| | | ChargingOrderTimeVO chargingList(ChargingListQuery dto); |
| | | |
| | |
| | | */ |
| | | void excelEndCharge(String orderCode); |
| | | |
| | | List<Map<String, Object>> getByDate(LocalDate start,LocalDate end); |
| | | List<Map<String, Object>> getByDate(LocalDate start,LocalDate end, List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> queryPower(List<Integer> siteIds); |
| | | |
| | | Map<String, Object> qureryPowerLevel(List<Integer> siteIds, ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | List<Map<String, Object>> queryOrderCountAndMoneyBySiteIdDate(List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> usersDay(ChargingStatisticsQueryDto statisticsQueryDto); |
| | | List<Map<String, Object>> usersDay1(); |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | List<SixShopDto> sixBefore(LocalDate sixBefore, Integer status); |
| | | |
| | | BigDecimal getSumAmount(LocalDate sixBefore); |
| | | BigDecimal getSumAmount(); |
| | | |
| | | List<Map<String, Object>> getData(ChargingStatisticsQueryDto statisticsQueryDto); |
| | | } |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | List<SixVipDto> sixBefore(LocalDate sixBefore); |
| | | |
| | | BigDecimal getSumAmout(LocalDate sixBefore); |
| | | BigDecimal getSumAmout(); |
| | | |
| | | void payBack(String outTradeNo); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public ChargingBillVO chargingBillList1(ChargingListQuery dto) { |
| | | |
| | | ChargingBillVO chargingBillVO = new ChargingBillVO(); |
| | | List<TChargingOrder> tChargingOrders1 = new ArrayList<>(); |
| | | String startTime1 = null; |
| | |
| | | List<TAppUser> userList = appUserClient.getAllUser().getData(); |
| | | List<TAppUserCar> carList = appUserCarClient.getAllCar().getData(); |
| | | List<TChargingOrder> total = chargingOrderList.selectList(new LambdaQueryWrapper<>(TChargingOrder.class) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2)); |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2).eq(TChargingOrder::getStatus, 5)); |
| | | List<TChargingOrderRefund> totalRefund = chargingOrderRefundService.lambdaQuery().eq(TChargingOrderRefund::getRefundStatus, 2).list(); |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | // 查询当前登陆人按钮权限 |
| | |
| | | startTime2 = split[1]; |
| | | } |
| | | List<TChargingOrder> total = chargingOrderList.selectList(new LambdaQueryWrapper<>(TChargingOrder.class) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2)); |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2).eq(TChargingOrder::getStatus, 5)); |
| | | PageInfo<ChargingBillListVO> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize()); |
| | | List<Site> data6 = siteClient.getSiteAll().getData(); |
| | | List<TChargingGun> gunList = chargingGunClient.getAllGun().getData(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | List<TChargingOrderRefund> chargingOrderRefunds = chargingOrderRefundService.lambdaQuery() |
| | | .eq(TChargingOrderRefund::getRefundStatus,2).list(); |
| | | |
| | | BigDecimal total = new BigDecimal("0"); |
| | | long time = 0L; |
| | | BigDecimal electronicMoney = new BigDecimal("0"); |
| | | BigDecimal serviceMoney = new BigDecimal("0"); |
| | | BigDecimal refundMoney = new BigDecimal("0"); |
| | | BigDecimal paymentMoney = new BigDecimal("0"); |
| | | for (ChargingOrderVO chargingOrderVO : list1) { |
| | | if(null == chargingOrderVO.getStatus() || 5 != chargingOrderVO.getStatus()){ |
| | | continue; |
| | | } |
| | | List<TChargingOrderAccountingStrategy> list4 = list3.stream().filter(e -> e.getChargingOrderId().equals(chargingOrderVO.getId())).collect(Collectors.toList()); |
| | | BigDecimal electronic_reduce = list4.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal service_reduce = list4.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal chargingCapacity = list4.stream().map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | electronicMoney = electronicMoney.add(electronic_reduce); |
| | | total = total.add(chargingCapacity); |
| | | if (!chargingOrderVO.getOrderSource().equals(2)) { |
| | | paymentMoney = paymentMoney.add(chargingOrderVO.getPaymentAmount() != null ? chargingOrderVO.getPaymentAmount() : new BigDecimal("0")); |
| | | serviceMoney = serviceMoney.add(service_reduce); |
| | | paymentMoney = paymentMoney.add(electronic_reduce).add(service_reduce); |
| | | }else{ |
| | | paymentMoney = paymentMoney.add(electronic_reduce).add(service_reduce.multiply(new BigDecimal("0.8")).setScale(2, BigDecimal.ROUND_DOWN)); |
| | | } |
| | | // if (chargingOrderVO.getRechargeAmount()!=null){ |
| | | // commissionMoney = commissionMoney.add(chargingOrderVO.getRechargeAmount().multiply(new BigDecimal("0.006")).setScale(2,BigDecimal.ROUND_DOWN)); |
| | | // } |
| | | if (chargingOrderVO.getChargingCapacity()!=null){ |
| | | total = total.add(chargingOrderVO.getElectricity()!=null?chargingOrderVO.getElectricity():new BigDecimal("0")); |
| | | serviceMoney = serviceMoney.add(service_reduce.multiply(new BigDecimal("0.8"))); |
| | | paymentMoney = paymentMoney.add(electronic_reduce).add(service_reduce.multiply(new BigDecimal("0.8"))); |
| | | } |
| | | if (chargingOrderVO.getStartTime()!=null && chargingOrderVO.getEndTime()!=null){ |
| | | LocalDateTime startTime = chargingOrderVO.getStartTime(); |
| | |
| | | for (TChargingOrderRefund tChargingOrderRefund : list2) { |
| | | refundMoney = refundMoney.add(tChargingOrderRefund.getRefundTotalAmount()); |
| | | } |
| | | |
| | | //充电明细 |
| | | electronicMoney = electronicMoney.add(electronic_reduce); |
| | | if (!chargingOrderVO.getOrderSource().equals(2)){ |
| | | serviceMoney = serviceMoney.add(service_reduce); |
| | | }else{ |
| | | serviceMoney = serviceMoney.add(service_reduce.multiply(new BigDecimal("0.8"))); |
| | | } |
| | | } |
| | | tCharingOrderVO.setTotal(total); |
| | | tCharingOrderVO.setTime(time); |
| | | tCharingOrderVO.setIncome(paymentMoney); |
| | | tCharingOrderVO.setElectronicMoney(electronicMoney); |
| | | tCharingOrderVO.setServiceMoney(serviceMoney); |
| | | tCharingOrderVO.setIncome(paymentMoney.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | tCharingOrderVO.setElectronicMoney(electronicMoney.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | tCharingOrderVO.setServiceMoney(serviceMoney.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | pageInfo.setRecords(list); |
| | | tCharingOrderVO.setList(pageInfo); |
| | | return tCharingOrderVO; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> countAll(LocalDate sixBefore,List<Integer> siteIds) { |
| | | return this.baseMapper.countAll(sixBefore,siteIds); |
| | | public Map<String, Object> countAll(List<Integer> siteIds) { |
| | | return this.baseMapper.countAll(siteIds); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getWeekData(LocalDate start,LocalDate end) { |
| | | public List<Map<String, Object>> getWeekData(LocalDate start,LocalDate end,List<Integer> siteIds) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getWeekData(start1,end1); |
| | | return this.baseMapper.getWeekData(start1,end1,siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getMonthData(LocalDate start,LocalDate end) { |
| | | public List<Map<String, Object>> getMonthData(LocalDate start,LocalDate end,List<Integer> siteIds) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getMonthData(start1,end1); |
| | | return this.baseMapper.getMonthData(start1,end1,siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getYearData(LocalDate start,LocalDate end) { |
| | | public List<Map<String, Object>> getYearData(LocalDate start,LocalDate end,List<Integer> siteIds) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getYearData(start1,end1); |
| | | return this.baseMapper.getYearData(start1,end1,siteIds); |
| | | } |
| | | |
| | | @Resource |
| | |
| | | BigDecimal gu = new BigDecimal("0"); |
| | | List<TChargingOrderAccountingStrategy> chargingOrderAccountingStrategies = chargingOrderAccountingStrategyService.list(); |
| | | for (ChargingOrderListVO chargingOrderListVO : list1) { |
| | | if (chargingOrderListVO.getChargingCapacity()!=null)electronic = electronic.add(chargingOrderListVO.getElectricity()); |
| | | |
| | | if (chargingOrderListVO.getPaymentAmount()!=null){ |
| | | if (chargingOrderListVO.getOrderSource().equals(2)){ |
| | | paymentAmount = paymentAmount.add(chargingOrderListVO.getServiceCharge()!=null?chargingOrderListVO.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP)):new BigDecimal("0")); |
| | | }else{ |
| | | paymentAmount = paymentAmount.add(chargingOrderListVO.getPaymentAmount()); |
| | | } |
| | | } |
| | | if (chargingOrderListVO.getElectrovalence()!=null)electrovalence = electrovalence.add(chargingOrderListVO.getElectrovalence()); |
| | | if (chargingOrderListVO.getServiceCharge()!=null){ |
| | | if (chargingOrderListVO.getOrderSource().equals(2)){ |
| | | serviceCharge = serviceCharge.add(chargingOrderListVO.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | }else{ |
| | | serviceCharge = serviceCharge.add(chargingOrderListVO.getServiceCharge()); |
| | | } |
| | | List<TChargingOrderAccountingStrategy> collect = chargingOrderAccountingStrategies.stream().filter(s -> s.getChargingOrderId().equals(chargingOrderListVO.getId())).collect(Collectors.toList()); |
| | | BigDecimal periodServicePrice = collect.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal periodElectricPrice = collect.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal chargingCapacity = collect.stream().map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | electronic = electronic.add(chargingCapacity); |
| | | electrovalence = electrovalence.add(periodElectricPrice); |
| | | if (chargingOrderListVO.getOrderSource().equals(2)){ |
| | | serviceCharge = serviceCharge.add(periodServicePrice.multiply(new BigDecimal("0.8"))); |
| | | paymentAmount = paymentAmount.add(periodElectricPrice).add(periodServicePrice.multiply(new BigDecimal("0.8"))); |
| | | }else{ |
| | | serviceCharge = serviceCharge.add(periodServicePrice); |
| | | paymentAmount = paymentAmount.add(periodElectricPrice).add(periodServicePrice); |
| | | } |
| | | if (!chargingOrderListVO.getOrderSource().equals(2)){ |
| | | List<TChargingOrderAccountingStrategy> list2 = chargingOrderAccountingStrategies.stream().filter(e -> e.getChargingOrderId().equals(chargingOrderListVO.getId())) |
| | |
| | | for (TChargingOrderAccountingStrategy temp : list2) { |
| | | switch (temp.getType()){ |
| | | case 1: |
| | | if (temp.getChargingCapacity()!=null)jian = jian.add(temp.getChargingCapacity()); |
| | | if (temp.getElectrovalence()!=null)jianElectronic = jianElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getServiceCharge()!=null)jianService = jianService.add(temp.getServiceCharge()); |
| | | if (temp.getChargingCapacity()!=null){ |
| | | jian = jian.add(temp.getChargingCapacity()); |
| | | } |
| | | if (temp.getElectrovalence()!=null){ |
| | | jianElectronic = jianElectronic.add(temp.getElectrovalence()); |
| | | } |
| | | if (temp.getServiceCharge()!=null){ |
| | | jianService = jianService.add(temp.getServiceCharge()); |
| | | } |
| | | break; |
| | | case 2: |
| | | if (temp.getChargingCapacity()!=null)feng = feng.add(temp.getChargingCapacity()); |
| | | if (temp.getElectrovalence()!=null)fengElectronic = fengElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getServiceCharge()!=null)fengService = fengService.add(temp.getServiceCharge()); |
| | | if (temp.getChargingCapacity()!=null){ |
| | | feng = feng.add(temp.getChargingCapacity()); |
| | | } |
| | | if (temp.getElectrovalence()!=null){ |
| | | fengElectronic = fengElectronic.add(temp.getElectrovalence()); |
| | | } |
| | | if (temp.getServiceCharge()!=null){ |
| | | fengService = fengService.add(temp.getServiceCharge()); |
| | | } |
| | | break; |
| | | case 3: |
| | | if (temp.getChargingCapacity()!=null)ping = ping.add(temp.getChargingCapacity()); |
| | | if (temp.getElectrovalence()!=null)pingElectronic = pingElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getServiceCharge()!=null)pingService = pingService.add(temp.getServiceCharge()); |
| | | if (temp.getChargingCapacity()!=null){ |
| | | ping = ping.add(temp.getChargingCapacity()); |
| | | } |
| | | if (temp.getElectrovalence()!=null){ |
| | | pingElectronic = pingElectronic.add(temp.getElectrovalence()); |
| | | } |
| | | if (temp.getServiceCharge()!=null){ |
| | | pingService = pingService.add(temp.getServiceCharge()); |
| | | } |
| | | break; |
| | | case 4: |
| | | if (temp.getChargingCapacity()!=null)gu = gu.add(temp.getChargingCapacity()); |
| | | if (temp.getElectrovalence()!=null)guElectronic = guElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getServiceCharge()!=null)guService = guService.add(temp.getServiceCharge()); |
| | | if (temp.getChargingCapacity()!=null){ |
| | | gu = gu.add(temp.getChargingCapacity()); |
| | | } |
| | | if (temp.getElectrovalence()!=null){ |
| | | guElectronic = guElectronic.add(temp.getElectrovalence()); |
| | | } |
| | | if (temp.getServiceCharge()!=null){ |
| | | guService = guService.add(temp.getServiceCharge()); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | for (TChargingOrderAccountingStrategy temp : list2) { |
| | | switch (temp.getType()){ |
| | | case 1: |
| | | if (temp.getChargingCapacity()!=null)jian = jian.add(temp.getChargingCapacity()); |
| | | if (temp.getElectrovalence()!=null)jianElectronic = jianElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getServiceCharge()!=null)jianService = jianService.add(temp.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | if (temp.getChargingCapacity()!=null){ |
| | | jian = jian.add(temp.getChargingCapacity()); |
| | | } |
| | | if (temp.getElectrovalence()!=null){ |
| | | jianElectronic = jianElectronic.add(temp.getElectrovalence()); |
| | | } |
| | | if (temp.getServiceCharge()!=null){ |
| | | jianService = jianService.add(temp.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | } |
| | | break; |
| | | case 2: |
| | | if (temp.getChargingCapacity()!=null)feng = feng.add(temp.getChargingCapacity()); |
| | | if (temp.getElectrovalence()!=null)fengElectronic = fengElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getServiceCharge()!=null)fengService = fengService.add(temp.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | if (temp.getChargingCapacity()!=null){ |
| | | feng = feng.add(temp.getChargingCapacity()); |
| | | } |
| | | if (temp.getElectrovalence()!=null){ |
| | | fengElectronic = fengElectronic.add(temp.getElectrovalence()); |
| | | } |
| | | if (temp.getServiceCharge()!=null){ |
| | | fengService = fengService.add(temp.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | } |
| | | break; |
| | | case 3: |
| | | if (temp.getChargingCapacity()!=null)ping = ping.add(temp.getChargingCapacity()); |
| | | if (temp.getElectrovalence()!=null)pingElectronic = pingElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getServiceCharge()!=null)pingService = pingService.add(temp.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | if (temp.getChargingCapacity()!=null){ |
| | | ping = ping.add(temp.getChargingCapacity()); |
| | | } |
| | | if (temp.getElectrovalence()!=null){ |
| | | pingElectronic = pingElectronic.add(temp.getElectrovalence()); |
| | | } |
| | | if (temp.getServiceCharge()!=null){ |
| | | pingService = pingService.add(temp.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | } |
| | | break; |
| | | case 4: |
| | | if (temp.getChargingCapacity()!=null)gu = gu.add(temp.getChargingCapacity()); |
| | | if (temp.getElectrovalence()!=null)guElectronic = guElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getServiceCharge()!=null)guService = guService.add(temp.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | if (temp.getChargingCapacity()!=null){ |
| | | gu = gu.add(temp.getChargingCapacity()); |
| | | } |
| | | if (temp.getElectrovalence()!=null){ |
| | | guElectronic = guElectronic.add(temp.getElectrovalence()); |
| | | } |
| | | if (temp.getServiceCharge()!=null){ |
| | | guService = guService.add(temp.getServiceCharge().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | chargingOrderTimeVO.setChargingCapacity(electronic); |
| | | chargingOrderTimeVO.setPaymentAmount(paymentAmount); |
| | | chargingOrderTimeVO.setElectrovalence(electrovalence); |
| | | chargingOrderTimeVO.setServiceCharge(serviceCharge); |
| | | chargingOrderTimeVO.setChargingCapacity(electronic.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | chargingOrderTimeVO.setPaymentAmount(paymentAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | chargingOrderTimeVO.setElectrovalence(electrovalence.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | chargingOrderTimeVO.setServiceCharge(serviceCharge.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | // 计算尖峰平谷充电到账占比 |
| | | |
| | | BigDecimal add = jianElectronic.add(fengElectronic).add(pingElectronic).add(guElectronic); |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getByDate(LocalDate start,LocalDate end) { |
| | | public List<Map<String, Object>> getByDate(LocalDate start,LocalDate end,List<Integer> siteIds) { |
| | | |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getByDate(start1,end1); |
| | | return this.baseMapper.getByDate(start1,end1,siteIds); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return this.baseMapper.queryPowerLevel(siteIds,statisticsQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryOrderCountAndMoneyBySiteIdDate(List<Integer> siteIds) { |
| | | return this.baseMapper.queryOrderCountAndMoneyBySiteIdDate(siteIds); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> usersDay(ChargingStatisticsQueryDto statisticsQueryDto) { |
| | |
| | | siteIds.add(-1); |
| | | } |
| | | List<Site> siteList = siteClient.getSiteAll().getData(); |
| | | List<TChargingGun> gunList = chargingGunClient.getAllGun().getData(); |
| | | List<TChargingPile> pileList = chargingGunClient.getAllPile().getData(); |
| | | List<TAppUser> userList = appUserClient.getAllUser().getData(); |
| | | List<TAppUserCar> carList = appUserCarClient.getAllCar().getData(); |
| | | List<TChargingOrder> totalOrder = chargingOrderService.list(new LambdaQueryWrapper<>(TChargingOrder.class) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2)); |
| | | List<TChargingOrderRefund> totalRefund = chargingOrderRefundService.lambdaQuery().eq(TChargingOrderRefund::getRefundStatus, 2).list(); |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2).eq(TChargingOrder::getStatus, 5)); |
| | | SettlementTotalVO res = new SettlementTotalVO(); |
| | | List<TSettlementConfirm> list1 = tSettlementConfirmMapper.settlementTotal(time,siteIds); |
| | | LocalDateTime parse = LocalDateTime.parse(time, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | |
| | | BigDecimal orderCommission = new BigDecimal("0"); |
| | | BigDecimal vipDiscount = new BigDecimal("0"); |
| | | BigDecimal couponDiscount = new BigDecimal("0"); |
| | | // tSettlementConfirm1.setIncomePercentage(); |
| | | // tSettlementConfirm1.setTotalPercentage(); |
| | | tSettlementConfirm1.setElectronicRefund(0); |
| | | // 上月成本合计 |
| | | BigDecimal beforeCost= new BigDecimal("0"); |
| | |
| | | for (TChargingPile datum : data) { |
| | | bigDecimal = bigDecimal.add(datum.getRatedPower()); |
| | | } |
| | | |
| | | |
| | | tSettlementConfirm.setIncome(tSettlementConfirm.getElectrovalence().add(tSettlementConfirm.getServiceCharge())); |
| | | //利用率=充电量/(桩数量*功率*时间) |
| | |
| | | BigDecimal subtract = income.subtract(beforeIncome).divide(beforeIncome,2,RoundingMode.HALF_DOWN).multiply(new BigDecimal("100")); |
| | | tSettlementConfirm.setIncomePercentage(subtract+"%"); |
| | | tSettlementConfirm.setIncomePercentage(subtract+"%"); |
| | | |
| | | } |
| | | // 比较总利润 收入合计-成本合计 |
| | | BigDecimal subtract1 = income.subtract(cost); |
| | |
| | | public List<SixShopDto> sixBefore(LocalDate sixBefore, Integer status) { |
| | | return this.baseMapper.sixBefore(sixBefore,status); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public BigDecimal getSumAmount(LocalDate sixBefore) { |
| | | return this.baseMapper.getSumAmount(sixBefore); |
| | | public BigDecimal getSumAmount() { |
| | | return this.baseMapper.getSumAmount(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal getSumAmout(LocalDate sixBefore) { |
| | | return this.baseMapper.getSumAmout(sixBefore); |
| | | public BigDecimal getSumAmout() { |
| | | return this.baseMapper.getSumAmout(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | <select id="chargingOrder" resultType="com.ruoyi.order.api.vo.ChargingOrderVO"> |
| | | select t1.* |
| | | from t_charging_order t1 |
| | | where 1=1 |
| | | where t1.del_flag = 0 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t1.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | |
| | | </select> |
| | | <select id="charge" resultType="com.ruoyi.order.dto.SixChargingDto"> |
| | | SELECT |
| | | DATE_FORMAT( subquery.create_time, '%m' ) AS MONTH, |
| | | SUM(electrovalence) AS electrovalence, |
| | | DATE_FORMAT( subquery.create_time, '%m' ) AS MONTH, |
| | | SUM(electrovalence) AS electrovalence, |
| | | SUM( |
| | | CASE |
| | | WHEN subquery.order_source = 0 THEN subquery.service_charge |
| | | WHEN subquery.order_source = 1 THEN subquery.service_charge |
| | | ELSE subquery.service_charge * 0.2 |
| | | ELSE subquery.service_charge * 0.8 |
| | | END |
| | | ) AS service_charge |
| | | |
| | | FROM |
| | | ( |
| | | SELECT |
| | | create_time, |
| | | electrovalence, |
| | | service_charge, |
| | | order_source |
| | | a.create_time, |
| | | b.period_electric_price as electrovalence, |
| | | b.period_service_price as service_charge, |
| | | a.order_source |
| | | FROM |
| | | t_charging_order |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_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> |
| | | del_flag = 0 and recharge_payment_status = 2 |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and a.status = 5 |
| | | <if test="sixBefore != null"> |
| | | AND create_time >= #{sixBefore} |
| | | AND a.create_time >= #{sixBefore} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | AND site_id IN |
| | | AND a.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | |
| | | </select> |
| | | <select id="circle" resultType="com.ruoyi.order.dto.SixCircleDto"> |
| | | SELECT |
| | | site_id as siteId, |
| | | SUM( |
| | | CASE |
| | | WHEN order_source = 0 THEN payment_amount |
| | | WHEN order_source = 1 THEN payment_amount |
| | | ELSE service_charge * 0.2 |
| | | END |
| | | ) AS paymentAmount |
| | | site_id as siteId, |
| | | ROUND(SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.money |
| | | WHEN a.order_source = 1 THEN b.money |
| | | ELSE (b.period_electric_price + b.period_service_price * 0.8) |
| | | END), 2) AS paymentAmount |
| | | FROM |
| | | t_charging_order |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_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> |
| | | del_flag = 0 |
| | | a.del_flag = 0 and a.recharge_payment_status = 2 and a.status = 5 |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | AND site_id IN |
| | | AND a.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | |
| | | AND create_time >= #{sixBefore} |
| | | </if> |
| | | </where> |
| | | GROUP BY site_id |
| | | GROUP BY a.site_id |
| | | |
| | | |
| | | </select> |
| | | <select id="countAll" resultType="java.util.Map"> |
| | | select sum(electrovalence) as electrovalence,sum(service_charge) as service_charge,ROUND(sum(electrovalence+service_charge) * 0.006, 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 |
| | | where del_flag = 0 and recharge_payment_status = 2 and status = 5 |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | AND site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | |
| | | SELECT |
| | | t1.type, |
| | | SUM( t1.charging_capacity ) as charging_capacity , |
| | | |
| | | SUM( |
| | | CASE |
| | | WHEN t2.order_source = 0 THEN t1.period_service_price |
| | | WHEN t2.order_source = 1 THEN t1.period_service_price |
| | | ELSE t1.period_service_price * 0.2 |
| | | ELSE t1.period_service_price * 0.8 |
| | | END |
| | | )as period_electric_price, |
| | | SUM(t1.period_electric_price) as total_amount |
| | |
| | | </select> |
| | | <select id="getDateData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%H:00' ) as time, |
| | | CAST( |
| | | SUM( |
| | | CASE |
| | | WHEN order_source = 0 THEN service_charge |
| | | WHEN order_source = 1 THEN service_charge |
| | | ELSE service_charge * 0.2 |
| | | END |
| | | )AS DECIMAL(20, 6)) as servicecharge, |
| | | CAST(SUM(charging_capacity) AS DECIMAL(20, 6)) as electrovalence, |
| | | CAST(SUM(electrovalence) AS DECIMAL(20, 4)) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | DATE_FORMAT(a.create_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 |
| | | ELSE b.period_service_price * 0.8 |
| | | END) as servicecharge, |
| | | SUM(a.charging_capacity) as electrovalence, |
| | | SUM(a.electrovalence) AS paymentAmount, |
| | | ROUND(SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.money |
| | | WHEN a.order_source = 1 THEN b.money |
| | | ELSE (b.period_electric_price + b.period_service_price * 0.8) |
| | | END), 2) AS paymoney, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_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> |
| | | del_flag = 0 and recharge_payment_status = 2 and DATE(create_time) = CURDATE() |
| | | |
| | | and create_time between #{start} and #{end} |
| | | |
| | | a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and DATE(a.create_time) = CURDATE() |
| | | and a.create_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"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | time |
| | |
| | | </select> |
| | | <select id="getWeekData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d' ) as time, |
| | | SUM(CASE |
| | | WHEN order_source = 0 THEN service_charge |
| | | WHEN order_source = 1 THEN service_charge |
| | | ELSE service_charge * 0.2 |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | | ELSE b.period_service_price * 0.8 |
| | | END) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | SUM(a.charging_capacity) as electrovalence, |
| | | SUM(a.electrovalence) AS paymentAmount, |
| | | ROUND(SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.money |
| | | WHEN a.order_source = 1 THEN b.money |
| | | ELSE (b.period_electric_price + b.period_service_price * 0.8) |
| | | END), 2) AS paymoney, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_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> |
| | | del_flag = 0 and recharge_payment_status = 2 and YEARWEEK(DATE_FORMAT(create_time, '%Y-%m-%d'), 1) = YEARWEEK(NOW(), 1) |
| | | |
| | | and create_time between #{start} and #{end} |
| | | |
| | | a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and YEARWEEK(DATE_FORMAT(a.create_time, '%Y-%m-%d'), 1) = YEARWEEK(NOW(), 1) |
| | | and a.create_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"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | time |
| | |
| | | </select> |
| | | <select id="getMonthData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d' ) as time, |
| | | SUM(CASE |
| | | WHEN order_source = 0 THEN service_charge |
| | | WHEN order_source = 1 THEN service_charge |
| | | ELSE service_charge * 0.2 |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | | ELSE b.period_service_price * 0.8 |
| | | END) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM( |
| | | CASE |
| | | WHEN order_source = 0 THEN payment_amount |
| | | WHEN order_source = 1 THEN payment_amount |
| | | ELSE service_charge * 0.2 |
| | | END) AS paymoney, |
| | | SUM(a.charging_capacity) as electrovalence, |
| | | SUM(a.electrovalence) AS paymentAmount, |
| | | ROUND(SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.money |
| | | WHEN a.order_source = 1 THEN b.money |
| | | ELSE (b.period_electric_price + b.period_service_price * 0.8) |
| | | END), 2) AS paymoney, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_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> |
| | | del_flag = 0 and recharge_payment_status = 2 and MONTH(create_time) = MONTH(NOW()) AND YEAR(create_time) = YEAR(NOW()) |
| | | |
| | | and create_time between #{start} and #{end} |
| | | |
| | | a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and MONTH(a.create_time) = MONTH(NOW()) AND YEAR(a.create_time) = YEAR(NOW()) |
| | | and a.create_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"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | time |
| | |
| | | </select> |
| | | <select id="getYearData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d' ) as time, |
| | | SUM(CASE |
| | | WHEN order_source = 0 THEN service_charge |
| | | WHEN order_source = 1 THEN service_charge |
| | | ELSE service_charge * 0.2 |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | | ELSE b.period_service_price * 0.8 |
| | | END) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | |
| | | SUM(a.charging_capacity) as electrovalence, |
| | | SUM(a.electrovalence) AS paymentAmount, |
| | | ROUND(SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.money |
| | | WHEN a.order_source = 1 THEN b.money |
| | | ELSE (b.period_electric_price + b.period_service_price * 0.8) |
| | | END), 2) AS paymoney, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_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> |
| | | del_flag = 0 and recharge_payment_status = 2 and YEAR(create_time) = YEAR(NOW()) |
| | | |
| | | and create_time between #{start} and #{end} |
| | | |
| | | a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and YEAR(a.create_time) = YEAR(NOW()) |
| | | and a.create_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"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | time |
| | | ORDER BY |
| | | time |
| | | |
| | | |
| | | </select> |
| | | <select id="getByDate" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | DATE_FORMAT(a.create_time, '%Y-%m-%d' ) as time, |
| | | SUM(CASE |
| | | WHEN order_source = 0 THEN service_charge |
| | | WHEN order_source = 1 THEN service_charge |
| | | ELSE service_charge * 0.2 |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | | ELSE b.period_service_price * 0.8 |
| | | END) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | |
| | | SUM(a.charging_capacity) as electrovalence, |
| | | SUM(a.electrovalence) AS paymentAmount, |
| | | ROUND(SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.money |
| | | WHEN a.order_source = 1 THEN b.money |
| | | ELSE (b.period_electric_price + b.period_service_price * 0.8) |
| | | END), 2) AS paymoney, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_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> |
| | | del_flag = 0 and recharge_payment_status = 2 |
| | | and create_time between #{start} and #{end} |
| | | a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 |
| | | and a.create_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"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | time |
| | |
| | | <select id="chargingList" resultType="com.ruoyi.order.api.vo.ChargingOrderListVO"> |
| | | select t1.*, |
| | | t1.current as chargingCapacity,t1.payment_amount as paymentAmount,t1.electricity as chargingCapacity from t_charging_order t1 |
| | | where 1=1 |
| | | where t1.del_flag = 0 and t1.status = 5 and t1.recharge_payment_status = 2 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t1.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | |
| | | <if test="endTime1 != null and endTime1!=''"> |
| | | and (t1.end_time between #{endTime1} and #{endTime2}) |
| | | </if> |
| | | AND t1.del_flag = 0 |
| | | and t1.start_time IS NOT NULL |
| | | order by t1.create_time desc |
| | | </select> |
| | |
| | | SELECT |
| | | DATE_FORMAT( |
| | | <if test="statisticsQueryDto.type == 1"> |
| | | start_time |
| | | a.start_time |
| | | </if> |
| | | <if test="statisticsQueryDto.type == 2"> |
| | | end_time |
| | | a.end_time |
| | | </if> |
| | | , '%H:00' ) as time, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(electrovalence) as electrovalence, |
| | | SUM(charging_capacity) as electricity, |
| | | SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | | ELSE b.period_service_price * 0.8 |
| | | END) as servicecharge, |
| | | SUM(b.period_electric_price) as electrovalence, |
| | | SUM(b.charging_capacity) as electricity, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | WHERE del_flag = 0 and status = 5 and recharge_payment_status = 2 and DATE( |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_price, sum(period_service_price) as period_service_price, sum(charging_capacity) as charging_capacity, 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.status = 5 and a.recharge_payment_status = 2 and DATE( |
| | | <if test="statisticsQueryDto.type == 1"> |
| | | start_time |
| | | a.start_time |
| | | </if> |
| | | <if test="statisticsQueryDto.type == 2"> |
| | | end_time |
| | | a.end_time |
| | | </if> |
| | | ) = #{statisticsQueryDto.hourDate} |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and site_id IN |
| | | and a.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | |
| | | SELECT |
| | | DATE_FORMAT( |
| | | <if test="statisticsQueryDto.type == 1"> |
| | | start_time |
| | | a.start_time |
| | | </if> |
| | | <if test="statisticsQueryDto.type == 2"> |
| | | end_time |
| | | a.end_time |
| | | </if> |
| | | , '%Y-%m-%d' ) as time, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(electrovalence) as electrovalence, |
| | | count(1) as orderCount, |
| | | SUM(electricity) as electricity |
| | | SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | | ELSE b.period_service_price * 0.8 |
| | | END) as servicecharge, |
| | | SUM(b.period_electric_price) as electrovalence, |
| | | SUM(b.charging_capacity) as electricity, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | WHERE del_flag = 0 and recharge_payment_status = 2 and DATE( |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_price, sum(period_service_price) as period_service_price, sum(charging_capacity) as charging_capacity, 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.status = 5 and a.recharge_payment_status = 2 and DATE( |
| | | <if test="statisticsQueryDto.type == 1"> |
| | | start_time |
| | | a.start_time |
| | | </if> |
| | | <if test="statisticsQueryDto.type == 2"> |
| | | end_time |
| | | a.end_time |
| | | </if> |
| | | ) between #{statisticsQueryDto.startTime} and #{statisticsQueryDto.endTime} |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and site_id IN |
| | | and a.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | |
| | | SELECT |
| | | DATE_FORMAT( |
| | | <if test="statisticsQueryDto.type == 1"> |
| | | start_time |
| | | a.start_time |
| | | </if> |
| | | <if test="statisticsQueryDto.type == 2"> |
| | | end_time |
| | | a.end_time |
| | | </if> |
| | | , '%Y-%m' ) as time, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(electrovalence) as electrovalence, |
| | | count(1) as orderCount, |
| | | SUM(electricity) as electricity |
| | | SUM(CASE |
| | | WHEN a.order_source = 0 THEN b.period_service_price |
| | | WHEN a.order_source = 1 THEN b.period_service_price |
| | | ELSE b.period_service_price * 0.8 |
| | | END) as servicecharge, |
| | | SUM(b.period_electric_price) as electrovalence, |
| | | SUM(b.charging_capacity) as electricity, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | |
| | | WHERE del_flag = 0 and recharge_payment_status = 2 and DATE( |
| | | t_charging_order a |
| | | left join (select charging_order_id, sum(period_electric_price) as period_electric_price, sum(period_service_price) as period_service_price, sum(charging_capacity) as charging_capacity, 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.status = 5 and a.recharge_payment_status = 2 and DATE( |
| | | <if test="statisticsQueryDto.type == 1"> |
| | | start_time |
| | | a.start_time |
| | | </if> |
| | | <if test="statisticsQueryDto.type == 2"> |
| | | end_time |
| | | a.end_time |
| | | </if> |
| | | ) between #{statisticsQueryDto.startTime} and #{statisticsQueryDto.endTime} |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and site_id IN |
| | | and a.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | |
| | | select sum(payment_amount) |
| | | from t_shopping_order |
| | | where del_flag = 0 and payment_status = 2 and ISNULL(refund_status) and status!=4 |
| | | <if test="null != sixBefore"> |
| | | and DATE_FORMAT(create_time, '%Y-%m-%d') >= DATE_FORMAT(#{sixBefore}, '%Y-%m-%d') |
| | | </if> |
| | | </select> |
| | | <select id="getData" resultType="java.util.Map"> |
| | | |
| | |
| | | WHERE |
| | | del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} AND |
| | | payment_status = 2 |
| | | <if test="sixBefore != null"> |
| | | AND create_time > #{sixBefore} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |