| | |
| | | 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.*; |
| | |
| | | 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 { |
| | |
| | | |
| | | @Autowired |
| | | private IRemoteCallService iRemoteCallService; |
| | | |
| | | @Autowired |
| | | private IEquipmentService iEquipmentService; |
| | | |
| | | @Autowired |
| | | private IEventLogService eventLogService; |
| | |
| | | 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)+"");//今日新增商户 |
| | | } |