27 changed files with 606 additions and 227 deletions
@ -0,0 +1,31 @@ |
|||||||
|
package com.biutag.supervision.config; |
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean; |
||||||
|
import org.springframework.context.annotation.Configuration; |
||||||
|
import org.springframework.data.redis.cache.RedisCacheConfiguration; |
||||||
|
import org.springframework.data.redis.cache.RedisCacheManager; |
||||||
|
import org.springframework.data.redis.connection.RedisConnectionFactory; |
||||||
|
|
||||||
|
import java.time.Duration; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Auther: sh |
||||||
|
* @Date: 2024/12/13 11:03 |
||||||
|
* @Description: 针对首页大屏的缓存 |
||||||
|
*/ |
||||||
|
@Configuration |
||||||
|
public class RedisCacheConfig { |
||||||
|
|
||||||
|
@Bean |
||||||
|
public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { |
||||||
|
// 配置统一的缓存过期时间
|
||||||
|
RedisCacheConfiguration cacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() |
||||||
|
.entryTtl(Duration.ofHours(4)); //
|
||||||
|
|
||||||
|
// 创建一个缓存管理器,使用默认配置,并为所有缓存设置统一的过期时间
|
||||||
|
RedisCacheManager res = RedisCacheManager.builder(redisConnectionFactory) |
||||||
|
.cacheDefaults(cacheConfiguration) // 设置所有缓存的默认过期时间
|
||||||
|
.build(); |
||||||
|
return res; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,26 @@ |
|||||||
|
package com.biutag.supervision.pojo.vo; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.NoArgsConstructor; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Auther: sh |
||||||
|
* @Date: 2024/12/13 16:24 |
||||||
|
* @Description: 首页大屏一级子屏的总览vo |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@AllArgsConstructor |
||||||
|
@NoArgsConstructor |
||||||
|
public class SubOneOverViewVo implements Serializable { |
||||||
|
// 首页大屏一级子屏的各种总览,从左到右对应
|
||||||
|
private String one; |
||||||
|
private String two; |
||||||
|
private String three; |
||||||
|
private String four; |
||||||
|
private String five; |
||||||
|
private String six; |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1,43 @@ |
|||||||
|
package com.biutag.supervision.service; |
||||||
|
|
||||||
|
import com.biutag.supervision.mapper.NegativeMapper; |
||||||
|
import com.biutag.supervision.pojo.vo.EchartsVo; |
||||||
|
import com.biutag.supervision.pojo.vo.RankVo; |
||||||
|
import com.biutag.supervision.pojo.vo.SubOneOverViewVo; |
||||||
|
import jakarta.annotation.Resource; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Auther: sh |
||||||
|
* @Date: 2024/12/12 15:59 |
||||||
|
* @Description: 一级子屏业务层 |
||||||
|
*/ |
||||||
|
|
||||||
|
@RequiredArgsConstructor |
||||||
|
@Service |
||||||
|
public class SubOneService { |
||||||
|
@Resource |
||||||
|
private NegativeMapper negativeMapper; |
||||||
|
|
||||||
|
|
||||||
|
public List<EchartsVo> getSubOneTrend(Integer departPId, Integer year, String... args) { |
||||||
|
List<EchartsVo> res = negativeMapper.getSubOneTrend(departPId, year, args); |
||||||
|
return res; |
||||||
|
} |
||||||
|
|
||||||
|
public List<RankVo> getCaseVerifyRank(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String... args) { |
||||||
|
List<RankVo> res = negativeMapper.getCaseVerifyRank(departPId, statisticsGroupId, beginTime, endTime, args); |
||||||
|
return res; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public SubOneOverViewVo getCaseVerifyOverView(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String... args) { |
||||||
|
SubOneOverViewVo res = negativeMapper.getCaseVerifyOverView(departPId, statisticsGroupId, beginTime, endTime, args); |
||||||
|
return res; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
Loading…
Reference in new issue