|
|
@ -67,6 +67,7 @@ public class ActPhraseServiceImpl extends BaseServiceImpl<ActPhraseDao, ActPhras |
|
|
|
|
|
|
|
/** |
|
|
|
* 条件查询 |
|
|
|
* |
|
|
|
* @param params |
|
|
|
* @return |
|
|
|
*/ |
|
|
@ -74,8 +75,8 @@ public class ActPhraseServiceImpl extends BaseServiceImpl<ActPhraseDao, ActPhras |
|
|
|
public PageData<ActPhraseDTO> getPhrasePage(Map<String, Object> params) { |
|
|
|
String phrase = ((String) params.get("phrase")).trim(); |
|
|
|
String code = ((String) params.get("code")).trim(); |
|
|
|
params.put("phrase",phrase); |
|
|
|
params.put("code",code); |
|
|
|
params.put("phrase", phrase); |
|
|
|
params.put("code", code); |
|
|
|
IPage<ActPhraseDTO> page = getPage(params); |
|
|
|
List<ActPhraseDTO> list = baseDao.getPhrasePage(params); |
|
|
|
return new PageData<>(list, page.getTotal()); |
|
|
@ -88,8 +89,8 @@ public class ActPhraseServiceImpl extends BaseServiceImpl<ActPhraseDao, ActPhras |
|
|
|
return ConvertUtils.sourceToTarget(entityList, ActPhraseDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<ActPhraseEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
private QueryWrapper<ActPhraseEntity> getWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
QueryWrapper<ActPhraseEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
@ -134,7 +135,7 @@ public class ActPhraseServiceImpl extends BaseServiceImpl<ActPhraseDao, ActPhras |
|
|
|
String key = RedisKeys.getPhraseListKey(); |
|
|
|
redisUtils.delete(key); |
|
|
|
List<ActPhraseRedisEntity> list = baseDao.selectListPhraseInOrder(); |
|
|
|
redisUtils.set(key,list); |
|
|
|
redisUtils.set(key, list); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -148,11 +149,12 @@ public class ActPhraseServiceImpl extends BaseServiceImpl<ActPhraseDao, ActPhras |
|
|
|
String key = RedisKeys.getPhraseListKey(); |
|
|
|
redisUtils.delete(key); |
|
|
|
List<ActPhraseRedisEntity> list = baseDao.selectListPhraseInOrder(); |
|
|
|
redisUtils.set(key,list); |
|
|
|
redisUtils.set(key, list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 统计编码数量 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
@ -167,38 +169,43 @@ public class ActPhraseServiceImpl extends BaseServiceImpl<ActPhraseDao, ActPhras |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询启动时需存入radis内的常用语 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void insertPhraseListToRedis(){ |
|
|
|
public void insertPhraseListToRedis() { |
|
|
|
//redis存储
|
|
|
|
String key = RedisKeys.getPhraseListKey(); |
|
|
|
redisUtils.delete(key); |
|
|
|
List<ActPhraseRedisEntity> list = baseDao.selectListPhraseInOrder(); |
|
|
|
redisUtils.set(key,list); |
|
|
|
redisUtils.set(key, list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 使用次数加一 |
|
|
|
* |
|
|
|
* @param id |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void updateUsagenumAddOne(String id){ |
|
|
|
public void updateUsagenumAddOne(String id) { |
|
|
|
baseDao.updateUsagenumAddOne(id); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 从redis直接读取常用语 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ActPhraseRedisEntity> getPhraseList(){ |
|
|
|
public List<ActPhraseRedisEntity> getPhraseList() { |
|
|
|
String key = RedisKeys.getPhraseListKey(); |
|
|
|
Object object = redisUtils.get(key); |
|
|
|
List<ActPhraseRedisEntity> list = new ArrayList<ActPhraseRedisEntity>(); |
|
|
|
if(object != null){ |
|
|
|
list = (List<ActPhraseRedisEntity>)object; |
|
|
|
if (object != null) { |
|
|
|
list = (List<ActPhraseRedisEntity>) object; |
|
|
|
} else { |
|
|
|
list = baseDao.selectListPhraseInOrder(); |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|