| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.ruoyi.common.core.service.IUserExtInfoService; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.IvrLibaScriptAssort; |
| | | import com.smartor.domain.SvyLibScriptCategory; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 用户扩展信息服务实现(smartor 模块) |
| | |
| | | */ |
| | | @Service |
| | | public class UserExtInfoServiceImpl implements IUserExtInfoService { |
| | | |
| | | private static final String SATISFACTION_CACHE_KEY = "satisfaction:categories:"; |
| | | private static final int SATISFACTION_CACHE_TTL = 30; |
| | | |
| | | @Autowired |
| | | private SysUserOrgMapper sysUserOrgMapper; |
| | |
| | | |
| | | @Autowired |
| | | private SvyLibScriptCategoryMapper svyLibScriptCategoryMapper; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * 获取用户机构/院区信息 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取满意度问题分类(语音 + 问卷) |
| | | * 获取满意度问题分类(语音 + 问卷),带Redis缓存 |
| | | */ |
| | | @Override |
| | | @SuppressWarnings("unchecked") |
| | | public Map<String, Object> getSatisfactionCategories(String orgid) { |
| | | // 先查缓存 |
| | | String cacheKey = SATISFACTION_CACHE_KEY + orgid; |
| | | Map<String, Object> cached = redisCache.getCacheObject(cacheKey); |
| | | if (cached != null) { |
| | | return cached; |
| | | } |
| | | |
| | | Map<String, Object> satisfactionCategories = new HashMap<>(); |
| | | |
| | | // 获取语音问题分类 |
| | |
| | | } |
| | | satisfactionCategories.put("questionnaireCategorys", questionnaireCategorys); |
| | | |
| | | // 写入缓存 |
| | | redisCache.setCacheObject(cacheKey, satisfactionCategories, SATISFACTION_CACHE_TTL, TimeUnit.MINUTES); |
| | | |
| | | return satisfactionCategories; |
| | | } |
| | | } |