| | |
| | | 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{ |
| | | }else if (chargingOrder.getServiceCharge()!=null){ |
| | | serviceCharge = serviceCharge.add(chargingOrder.getServiceCharge()); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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<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(chargingOrderIds); |
| | | List<Map<String,Object>> maps = chargingOrderService.getSumByType(start,end); |
| | | |
| | | if (statisticsQueryDto.getDayType()==1){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getDateData(chargingOrderIds); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getDateData(start,end); |
| | | |
| | | List<Map<String, Object>> charMap = new ArrayList<>(); |
| | | // 生成从 "00:00" 到 "23:00" 的时间数据 |
| | |
| | | |
| | | |
| | | |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(chargingOrderIds); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(start,end); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==3){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(chargingOrderIds); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(start,end); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getYearData(chargingOrderIds); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getYearData(start,end); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==5){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getByDate(chargingOrderIds); |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getByDate(start,end); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | Map<String, Object> countAll(@Param("sixBefore")LocalDate sixBefore,@Param("siteIds")List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getSumByType(@Param("chargingOrderIds")List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getSumByType(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | |
| | | List<Map<String, Object>> getDateData(@Param("chargingOrderIds")List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getDateData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | |
| | | List<Map<String, Object>> getWeekData(@Param("chargingOrderIds")List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getWeekData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | |
| | | List<Map<String, Object>> getMonthData(@Param("chargingOrderIds")List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getMonthData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | |
| | | List<Map<String, Object>> getYearData(@Param("chargingOrderIds")List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getYearData(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | |
| | | 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("chargingOrderIds")List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getByDate(@Param("start")LocalDateTime start,@Param("end")LocalDateTime end); |
| | | |
| | | List<Map<String, Object>> queryPower(@Param("siteIds")List<Integer> siteIds); |
| | | |
| | |
| | | |
| | | Map<String, Object> countAll(LocalDate sixBefore,List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getSumByType(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getSumByType(LocalDate start,LocalDate end); |
| | | |
| | | List<Map<String, Object>> getDateData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getDateData(LocalDate start,LocalDate end); |
| | | |
| | | List<Map<String, Object>> getWeekData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getWeekData(LocalDate start,LocalDate end); |
| | | |
| | | List<Map<String, Object>> getMonthData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getMonthData(LocalDate start,LocalDate end); |
| | | |
| | | List<Map<String, Object>> getYearData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getYearData(LocalDate start,LocalDate end); |
| | | |
| | | ChargingOrderTimeVO chargingList(ChargingListQuery dto); |
| | | |
| | |
| | | */ |
| | | void excelEndCharge(String orderCode); |
| | | |
| | | List<Map<String, Object>> getByDate(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getByDate(LocalDate start,LocalDate end); |
| | | |
| | | List<Map<String, Object>> queryPower(List<Integer> siteIds); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getSumByType(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getSumByType(chargingOrderIds); |
| | | public List<Map<String, Object>> getSumByType(LocalDate start,LocalDate end) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getSumByType(start1,end1); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getDateData(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getDateData(chargingOrderIds); |
| | | public List<Map<String, Object>> getDateData(LocalDate start,LocalDate end) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getDateData(start1,end1); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getWeekData(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getWeekData(chargingOrderIds); |
| | | public List<Map<String, Object>> getWeekData(LocalDate start,LocalDate end) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getWeekData(start1,end1); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getMonthData(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getMonthData(chargingOrderIds); |
| | | public List<Map<String, Object>> getMonthData(LocalDate start,LocalDate end) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getMonthData(start1,end1); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getYearData(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getYearData(chargingOrderIds); |
| | | public List<Map<String, Object>> getYearData(LocalDate start,LocalDate end) { |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getYearData(start1,end1); |
| | | } |
| | | |
| | | @Resource |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getByDate(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getByDate(chargingOrderIds); |
| | | public List<Map<String, Object>> getByDate(LocalDate start,LocalDate end) { |
| | | |
| | | LocalDateTime start1 = start.atStartOfDay(); |
| | | LocalDateTime end1 = end.atTime(LocalTime.MAX); |
| | | return this.baseMapper.getByDate(start1,end1); |
| | | } |
| | | |
| | | @Override |
| | |
| | | WHEN order_source = 0 THEN payment_amount |
| | | WHEN order_source = 1 THEN payment_amount |
| | | ELSE service_charge * 0.2 |
| | | END P |
| | | END |
| | | ) AS paymentAmount |
| | | FROM |
| | | t_charging_order |
| | |
| | | FROM |
| | | t_charging_order_accounting_strategy t1 |
| | | LEFT JOIN t_charging_order t2 on t1.charging_order_id = t2.id |
| | | |
| | | <where> |
| | | <if test="chargingOrderIds != null and chargingOrderIds.size() > 0"> |
| | | AND t1.charging_order_id IN |
| | | <foreach collection="chargingOrderIds" item="chargingOrderId" open="(" separator="," close=")"> |
| | | #{chargingOrderId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | where t2.create_time between #{start} and #{end} |
| | | GROUP BY |
| | | t1.type |
| | | </select> |
| | |
| | | <where> |
| | | del_flag = 0 and recharge_payment_status = 2 and DATE(create_time) = CURDATE() |
| | | |
| | | AND id IN |
| | | <foreach collection="chargingOrderIds" item="chargingOrderId" open="(" separator="," close=")"> |
| | | #{chargingOrderId} |
| | | </foreach> |
| | | and create_time between #{start} and #{end} |
| | | |
| | | </where> |
| | | GROUP BY |
| | |
| | | <where> |
| | | del_flag = 0 and recharge_payment_status = 2 and YEARWEEK(DATE_FORMAT(create_time, '%Y-%m-%d'), 1) = YEARWEEK(NOW(), 1) |
| | | |
| | | AND id IN |
| | | <foreach collection="chargingOrderIds" item="chargingOrderId" open="(" separator="," close=")"> |
| | | #{chargingOrderId} |
| | | </foreach> |
| | | and create_time between #{start} and #{end} |
| | | |
| | | </where> |
| | | GROUP BY |
| | |
| | | <where> |
| | | del_flag = 0 and recharge_payment_status = 2 and MONTH(create_time) = MONTH(NOW()) AND YEAR(create_time) = YEAR(NOW()) |
| | | |
| | | AND id IN |
| | | <foreach collection="chargingOrderIds" item="chargingOrderId" open="(" separator="," close=")"> |
| | | #{chargingOrderId} |
| | | </foreach> |
| | | and create_time between #{start} and #{end} |
| | | |
| | | </where> |
| | | GROUP BY |
| | |
| | | <where> |
| | | del_flag = 0 and recharge_payment_status = 2 and YEAR(create_time) = YEAR(NOW()) |
| | | |
| | | AND id IN |
| | | <foreach collection="chargingOrderIds" item="chargingOrderId" open="(" separator="," close=")"> |
| | | #{chargingOrderId} |
| | | </foreach> |
| | | and create_time between #{start} and #{end} |
| | | |
| | | </where> |
| | | GROUP BY |
| | |
| | | t_charging_order |
| | | <where> |
| | | del_flag = 0 and recharge_payment_status = 2 |
| | | |
| | | AND id IN |
| | | <foreach collection="chargingOrderIds" item="chargingOrderId" open="(" separator="," close=")"> |
| | | #{chargingOrderId} |
| | | </foreach> |
| | | |
| | | and create_time between #{start} and #{end} |
| | | </where> |
| | | GROUP BY |
| | | time |