Merge remote-tracking branch 'origin/master'
| | |
| | | TAccountingStrategy one = accountingStrategyService.lambdaQuery().eq(TAccountingStrategy::getId, byId.getParentId()).one(); |
| | | byId.setSiteId(one.getSiteId()); |
| | | //将site表对应的模板id修改为新的这个 |
| | | Site byId1 = siteService.getById(one.getSiteId()); |
| | | if (byId1!=null) { |
| | | byId1.setAccountingStrategyId(byId.getId()); |
| | | siteService.updateById(byId1); |
| | | List<Site> list = siteService.lambdaQuery().eq(Site::getAccountingStrategyId, one.getId()).list(); |
| | | for (Site site : list) { |
| | | site.setAccountingStrategyId(byId.getId()); |
| | | } |
| | | siteService.updateBatchById(list); |
| | | // |
| | | |
| | | |
| | | |
| | | // |
| | | accountingStrategyService.removeById(one.getId()); |
| | | } |
| | | //硬件 |
| | |
| | | */ |
| | | List<TChargingPileNotification> chargingPileNotificationPageList(PageInfo<TChargingPileNotification> pageInfo, @Param("siteIds") Set<Integer> siteIds); |
| | | |
| | | /** |
| | | * 保存通知数据 |
| | | * @param siteId |
| | | * @param chargingPileId |
| | | * @param phone |
| | | * @param content |
| | | */ |
| | | void saveData(@Param("siteId") Integer siteId, |
| | | @Param("chargingPileId")Integer chargingPileId, |
| | | @Param("phone")String phone, |
| | | @Param("content")String content); |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void saveData(Integer type,Integer siteId,Integer chargingPileId, String phone, String data) { |
| | | TChargingPileNotification notification = new TChargingPileNotification(); |
| | | switch (type){ |
| | | case 1: |
| | | // 验证码 |
| | | notification.setPhone(phone); |
| | | notification.setContent(data); |
| | | break; |
| | | default: |
| | | // 停车占位 |
| | | notification.setSiteId(siteId); |
| | | notification.setChargingPileId(chargingPileId); |
| | | notification.setPhone(phone); |
| | | notification.setContent(data); |
| | | break; |
| | | } |
| | | this.save(notification); |
| | | this.baseMapper.saveData(siteId,chargingPileId,phone,data); |
| | | } |
| | | |
| | | } |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, site_id, charging_pile_id, content, create_time, del_flag |
| | | </sql> |
| | | <insert id="saveData"> |
| | | insert into t_charging_pile_notification( |
| | | <if test="siteId != null and siteId != 0">site_id,</if> |
| | | <if test="chargingPileId != null and chargingPileId != 0">charging_pile_id,</if> |
| | | <if test="phone != null and phone != ''">phone,</if> |
| | | <if test="content != null and content != ''">content,</if> |
| | | create_time |
| | | )values( |
| | | <if test="siteId != null and siteId != 0">#{siteId},</if> |
| | | <if test="chargingPileId != null and chargingPileId != 0">#{chargingPileId},</if> |
| | | <if test="phone != null and phone != ''">#{phone},</if> |
| | | <if test="content != null and content != ''">#{content},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="chargingPileNotificationPageList" resultType="com.ruoyi.chargingPile.api.model.TChargingPileNotification"> |
| | | select |
| | | a.id, |
| | |
| | | query.addCriteria(Criteria.where("status").is(mongoChargingOrderQuery.getStatus())); |
| | | } |
| | | |
| | | if (mongoChargingOrderQuery.getStartTime() != null) { |
| | | String[] split = mongoChargingOrderQuery.getStartTime().split(" - "); |
| | | if (mongoChargingOrderQuery.getCreateTime() != null) { |
| | | String[] split = mongoChargingOrderQuery.getCreateTime().split(" - "); |
| | | |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date start = dateFormat.parse(split[0]); |
| | | Date end = dateFormat.parse(split[1]); |
| | | query.addCriteria(Criteria.where("startTime").gte(start).lt(end)); |
| | | query.addCriteria(Criteria.where("create_time").gte(start).lt(end)); |
| | | } |
| | | |
| | | if (mongoChargingOrderQuery.getEndTime() != null && mongoChargingOrderQuery.getEndTime() != null) { |
| | | String[] split = mongoChargingOrderQuery.getEndTime().split(" - "); |
| | | if (mongoChargingOrderQuery.getLastTime() != null && mongoChargingOrderQuery.getLastTime() != null) { |
| | | String[] split = mongoChargingOrderQuery.getLastTime().split(" - "); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date start = dateFormat.parse(split[0]); |
| | | Date end = dateFormat.parse(split[1]); |
| | | query.addCriteria(Criteria.where("lastTime").gte(start).lt(end)); |
| | | query.addCriteria(Criteria.where("last_time").gte(start).lt(end)); |
| | | } |
| | | |
| | | |
| | |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | end = statisticsQueryDto.getEndTime().plusDays(1); |
| | | // 获取本月1号的日期 |
| | | YearMonth yearMonth = YearMonth.from(today); |
| | | // start = yearMonth.atDay(1); |
| | | // |
| | | // System.out.println("本月1号是: " + start); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | LocalDate today = LocalDate.now(); |
| | | // 获取当前年份 |
| | | int currentYear = today.getYear(); |
| | | |
| | | // 获取今年1月1日的日期 |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | |
| | | // 获取今年1月1日的日期 |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | if (start.equals(end)){ |
| | | 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); |
| | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | | |
| | | |
| | | List<Map<String, Object>> dateRangeStatistics = new ArrayList<>(); |
| | | |
| | | // 遍历日期范围 |
| | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | | |
| | | |
| | | |
| | | List<Map<String, Object>> dateRangeStatistics = new ArrayList<>(); |
| | | |
| | | // 遍历日期范围 |