1:修改证书类配置的表达式删除最后面的\n

2:修改redis连接池信息
3:修改获取配置id的方式,改为从程序中遍历,从redis中太耗时了
4:添加单独添加域,删除域使用多线程的方法
This commit is contained in:
renkaige
2018-11-14 19:29:35 +08:00
parent ad41ff768f
commit 996a780c3c
14 changed files with 934 additions and 55 deletions

View File

@@ -5,6 +5,7 @@ package com.nis.web.service.restful;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -13,9 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nis.domain.restful.ConfigPzIdSource;
import com.zdjizhi.utils.StringUtil;
import com.nis.web.dao.ConfigPzIdDao;
import com.nis.web.service.BaseLogService;
import com.zdjizhi.utils.StringUtil;
/**
* @ClassName:ConfigPzIdService
@@ -33,26 +34,45 @@ public class ConfigPzIdService extends BaseLogService {
*/
@Autowired
protected ConfigPzIdDao dao;
@Autowired
ConfigRedisService configRedisService;
private static Map<String, String> sourceNameMap = new HashMap<String, String>();
static {
sourceNameMap.put("CONFIG_COMPILE", "SEQ_COMPILEID");
sourceNameMap.put("CONFIG_GROUP", "SEQ_GROUPID");
sourceNameMap.put("CONFIG_REGION", "SEQ_REGIONID");
}
public ConfigPzIdSource getConfigPzIdList(ConfigPzIdSource entity){
public ConfigPzIdSource getConfigPzIdListOld(ConfigPzIdSource entity) {
List<Long> pzIdList = new ArrayList<Long>();
entity.setSourceName(entity.getSourceName().toUpperCase());
String seqName= StringUtil.isEmpty(sourceNameMap.get(entity.getSourceName()))?"SEQ_COMPILEID":sourceNameMap.get(entity.getSourceName());
String seqName = StringUtil.isEmpty(sourceNameMap.get(entity.getSourceName())) ? "SEQ_COMPILEID"
: sourceNameMap.get(entity.getSourceName());
for (int i = 0; i < entity.getNum(); i++) {
// pzIdList.add(dao.getConfigPzIdList(entity)); //直接从数据库序列号获取
// pzIdList.add(dao.getConfigPzIdList(entity)); //直接从数据库序列号获取
pzIdList.add(configRedisService.getIncrId(seqName));
}
entity.setPzIdList(pzIdList);
return entity;
}
public ConfigPzIdSource getConfigPzIdList(ConfigPzIdSource entity) {
List<Long> pzIdList = new LinkedList<Long>();
entity.setSourceName(entity.getSourceName().toUpperCase());
String seqName = StringUtil.isEmpty(sourceNameMap.get(entity.getSourceName())) ? "SEQ_COMPILEID"
: sourceNameMap.get(entity.getSourceName());
long endNum = configRedisService.getIncrById(seqName, entity.getNum());
long startNum=endNum-entity.getNum();
for (long i = endNum; i > startNum; i--) {
// pzIdList.add(dao.getConfigPzIdList(entity)); //直接从数据库序列号获取
pzIdList.add(i);
}
entity.setPzIdList(pzIdList);
return entity;
}
}