wang-hao-jie
2022-03-17 6dfd2599d2e52507e018fd4c6b35d38873e48cfb
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPcScheduleImpl.java
@@ -1,6 +1,5 @@
package cn.exrick.xboot.your.schedulings;
import cn.exrick.xboot.core.common.redis.RedisTemplateHelper;
import cn.exrick.xboot.core.entity.User;
import cn.exrick.xboot.core.service.MessageService;
import cn.exrick.xboot.core.service.UserService;
import cn.exrick.xboot.your.entity.*;
@@ -11,9 +10,7 @@
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.Date;
import java.util.List;
//大屏首页统计
@Component
public class StatisticPcScheduleImpl {
@@ -47,9 +44,6 @@
    @Autowired
    private IRemoteCallService iRemoteCallService;
    @Autowired
    private IEquipmentService iEquipmentService;
    @Autowired
    private IEventLogService eventLogService;
@@ -87,14 +81,17 @@
            redisTemplate.set(HEAD+"likeRate",(i*100)/count+"");//互动率
        }
        String format = DateUtil.format(new Date(), "yyyy-MM-dd");
        redisTemplate.set(HEAD+"outCar",iEquipmentService.countByTypeAndStatus(0)+"");//出发车辆
        QueryWrapper<DrivingRecord> wp = new QueryWrapper<>();
        wp.between("create_time",format+" 00:00:00",format+" 23:59:59");
        redisTemplate.set(HEAD+"outCar",iDrivingRecordService.count(wp)+"");//出发车辆
        QueryWrapper<EventLog> wrapper2=new QueryWrapper<>();
        wrapper2.eq("type",5);
        redisTemplate.set(HEAD+"open",eventLogService.count(wrapper2)+"");//危险开启
        QueryWrapper<Customer> wrapper = new QueryWrapper<>();
        String format = DateUtil.format(new Date(), "yyyy-MM-dd");
        wrapper.between("create_time",format+" 00:00:00",format+" 23:59:59");
        redisTemplate.set(HEAD+"addCustomer",iCustomerService.count(wrapper)+"");//今日新增商户
    }