develop

Conflicts:
	src/main/resources/messages/message_en.properties
	src/main/resources/messages/message_ru.properties
	src/main/resources/messages/message_zh_CN.properties
	关键字日志转http url配置功能完成
This commit is contained in:
duandongmei
2018-10-29 16:29:23 +08:00
98 changed files with 2202 additions and 559 deletions

View File

@@ -1558,6 +1558,7 @@ public class AvContentCfgService extends BaseService{
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(auditTime);
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
@@ -1588,6 +1589,10 @@ public class AvContentCfgService extends BaseService{
if(isAudit==1){
if(!StringUtil.isEmpty(ipPortList)){
IpPortCfg cfg = new IpPortCfg();
BeanUtils.copyProperties(entity, cfg, new String[] { "cfgId" });
cfg.setTableName(IpPortCfg.getTablename());
avContentCfgDao.updateCfgValid(cfg);
Map<String,List> ipMap = cfgConvert(ipRegionList,ipPortList,1,entity,groupRelationList);
groupRelationList=ipMap.get("groupList");
ipRegionList=ipMap.get("dstList");

View File

@@ -75,13 +75,13 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
public CfgIndexInfo exportbgp(CfgIndexInfo entity){
List<IpPortCfg> ipPortList = bgpCfgDao.getIpPortList(entity);
NtcSubscribeIdCfg subscribeId = new NtcSubscribeIdCfg();
subscribeId.setCompileId(entity.getCompileId());
subscribeId.setIsValid(entity.getIsValid());
List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList = stringCfgDao.findSubscribeIdCfgList(subscribeId);
// NtcSubscribeIdCfg subscribeId = new NtcSubscribeIdCfg();
// subscribeId.setCompileId(entity.getCompileId());
// subscribeId.setIsValid(entity.getIsValid());
// List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList = stringCfgDao.findSubscribeIdCfgList(subscribeId);
List<NtcBgpAsCfg> ntcBgpAsCfgList = bgpCfgDao.getNtcBgpAsList(entity);
entity.setIpPortList(ipPortList);
entity.setNtcSubscribeIdCfgList(ntcSubscribeIdCfgList);
// entity.setNtcSubscribeIdCfgList(ntcSubscribeIdCfgList);
entity.setNtcBgpAsCfgList(ntcBgpAsCfgList);
return entity;
}

View File

@@ -5,6 +5,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -523,4 +524,5 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
logger.info("http配置取消配置响应信息"+result.getMsg());
}
}
}

View File

@@ -18,6 +18,7 @@ import com.nis.domain.configuration.IpMultiplexPoolCfg;
import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.basics.SysDictInfoDao;
import com.nis.web.dao.configuration.IpMultiplexPoolCfgDao;
import com.nis.web.security.UserUtils;
@@ -191,6 +192,7 @@ public class IpMultiplexPoolCfgService extends BaseService{
public List<IpMultiplexPoolCfg> getIsp(List<IpMultiplexPoolCfg> ispList){
for (IpMultiplexPoolCfg snat : ispList) {
if(!StringUtil.isEmpty(snat.getAreaEffectiveIds())){
if(snat.getAreaEffectiveIds().contains(":")){
int index=snat.getAreaEffectiveIds().indexOf(":");
String ispCode =snat.getAreaEffectiveIds().substring(index+1);
@@ -198,6 +200,12 @@ public class IpMultiplexPoolCfgService extends BaseService{
if(dict !=null){
snat.setIspName(dict.getItemValue());
}
}else{
SysDictInfo dict= sysDictInfoDao.getDictByItemCode(snat.getAreaEffectiveIds());
if(dict !=null){
snat.setIspName(dict.getItemValue());
}
}
}
}
return ispList;

View File

@@ -39,6 +39,7 @@ import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtil;
import com.nis.web.dao.basics.ServiceDictInfoDao;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.dao.configuration.WebsiteCfgDao;
@@ -58,6 +59,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
protected AreaIpCfgDao areaIpCfgDao;
@Autowired
protected StringCfgDao stringCfgDao;
@Autowired
private ServiceDictInfoDao serviceDictInfoDao;
public CfgIndexInfo getHttpCfg(Long cfgId){
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId);
@@ -377,7 +380,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
}
}
public void auditHttpCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
public void auditHttpCfg(CfgIndexInfo entity,Integer isAudit) throws Exception{
//修改数据库审核状态信息
entity.setTableName(CfgIndexInfo.getTablename());
websiteCfgDao.auditCfg(entity);
@@ -555,6 +558,14 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
//http关键字配置失效时需确认是否存在与之关联的HTTPURL配置
List<MaatCfg> httpUrlCompile=new ArrayList<>();
if(entity.getFunctionId().equals(635)){
httpUrlCompile=auditHttpUrlByBodyId(maatCfg,httpUrlCompile,entity);
}
if(!StringUtil.isEmpty(httpUrlCompile)){
configCompileList.addAll(httpUrlCompile);
}
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
@@ -566,8 +577,122 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("http配置取消配置响应信息"+result.getMsg());
}
}
public List<MaatCfg> auditHttpUrlByBodyId(MaatCfg maatCfgBody,List<MaatCfg> httpUrlCompile,CfgIndexInfo cfgHttpBody) throws Exception{
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
CfgIndexInfo cfg=new CfgIndexInfo();
cfg.setSourceCompileId(maatCfgBody.getCompileId());
cfg.setFunctionId(6);//http url
List<CfgIndexInfo> cfgs=websiteCfgDao.getCfgIndexInfos(cfg);
//关键字包含的所有url配置
for (CfgIndexInfo cfgIndexInfo : cfgs) {
//查询所有httpurl配置
List<HttpUrlCfg> httpUrlList=websiteCfgDao.getHttpUrlList(cfgIndexInfo);
//审核通过的,失效 3 0
if(cfgIndexInfo.getIsAudit().equals(1)){
cfgIndexInfo.setTableName(CfgIndexInfo.getTablename());
cfgIndexInfo.setAuditorId(UserUtils.getUser().getId());
cfgIndexInfo.setAuditTime(maatCfgBody.getAuditTime());
cfgIndexInfo.setIsAudit(3);
cfgIndexInfo.setIsValid(0);
//设置配置取消的来函信息
serviceDictInfoDao.auditCancleRequestInfo(cfgHttpBody.getCancelRequestId(),
"cfg_index_info",
cfgIndexInfo.getCfgId().toString());
websiteCfgDao.auditCfg(cfgIndexInfo);
for (BaseStringCfg httpUrlCfg : httpUrlList) {
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
httpUrlCfg.setAuditorId(UserUtils.getUser().getId());
httpUrlCfg.setAuditTime(maatCfgBody.getAuditTime());
httpUrlCfg.setIsAudit(3);
httpUrlCfg.setIsValid(0);
websiteCfgDao.auditCfg(httpUrlCfg);
}
}else if(!(cfgIndexInfo.getIsAudit().equals(3) || cfgIndexInfo.getIsValid().equals(-1))){
//未审核和审核未通过,删除 0 -1
cfgIndexInfo.setTableName(CfgIndexInfo.getTablename());
cfgIndexInfo.setEditorId(UserUtils.getUser().getId());
cfgIndexInfo.setEditTime(maatCfgBody.getAuditTime());
cfgIndexInfo.setIsAudit(0);
cfgIndexInfo.setIsValid(-1);
websiteCfgDao.updateCfgValid(cfgIndexInfo);
for (BaseStringCfg httpUrlCfg : httpUrlList) {
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
httpUrlCfg.setEditorId(UserUtils.getUser().getId());
httpUrlCfg.setEditTime(maatCfgBody.getAuditTime());
httpUrlCfg.setIsAudit(0);
httpUrlCfg.setIsValid(-1);
websiteCfgDao.updateCfgValid(httpUrlCfg);
}
}
//只有审核通过的配置需要下发失效动作
if(cfgIndexInfo.getIsAudit().equals(3)){
maatCfg.setCompileId(cfgIndexInfo.getCompileId());
maatCfg.setServiceId(cfgIndexInfo.getServiceId());
maatCfg.setIsValid(0);//无效
httpUrlCompile.add(maatCfg);
}
}
/*
List<HttpUrlCfg> httpUrlList=websiteCfgDao.getHttpUrlList(cfg);
if(!StringUtil.isEmpty(httpUrlList)){}{
for (BaseStringCfg httpUrlCfg : httpUrlList) {
//失效中间表
CfgIndexInfo entity=new CfgIndexInfo();
entity.setTableName(CfgIndexInfo.getTablename());
entity.setFunctionId(6);
entity.setCompileId(httpUrlCfg.getCompileId());
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
//审核通过的,失效 3 0
if(httpUrlCfg.getIsAudit().equals(1)){
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(maatCfgBody.getAuditTime());
entity.setIsAudit(3);
entity.setIsValid(0);
httpUrlCfg.setAuditorId(UserUtils.getUser().getId());
httpUrlCfg.setAuditTime(maatCfgBody.getAuditTime());
httpUrlCfg.setIsAudit(3);
httpUrlCfg.setIsValid(0);
websiteCfgDao.auditCfg(entity);
websiteCfgDao.auditCfg(httpUrlCfg);
//serviceDictInfoDao.auditCancleRequestInfo(cancelRequestId, "cfg_index_info", entity);
}else if(!(httpUrlCfg.getIsAudit().equals(3) || httpUrlCfg.getIsValid().equals(-1))){
//未审核和审核未通过,删除 0 -1
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(maatCfgBody.getAuditTime());
entity.setIsAudit(0);
entity.setIsValid(-1);
httpUrlCfg.setEditorId(UserUtils.getUser().getId());
httpUrlCfg.setEditTime(maatCfgBody.getAuditTime());
httpUrlCfg.setIsAudit(0);
httpUrlCfg.setIsValid(-1);
websiteCfgDao.updateCfgValid(entity);
websiteCfgDao.updateCfgValid(httpUrlCfg);
}
//只有审核通过的配置需要下发失效动作
if(httpUrlCfg.getIsAudit().equals(3)){
maatCfg.setCompileId(httpUrlCfg.getCompileId());
maatCfg.setServiceId(httpUrlCfg.getServiceId());
maatCfg.setIsValid(0);//无效
httpUrlCompile.add(maatCfg);
}
}
}*/
return httpUrlCompile;
}
public void saveSslCfg(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);

View File

@@ -38,4 +38,7 @@ public class ConfigureStatisticsService extends CrudService<NumCfgDao,NumBoundar
List<Object[]> dataList=configureStatisticsDao.getRequestStateStatistics(requestList,serviceList);
return dataList;
}
public Integer getEffectiveCfgNum(Integer serviceId){
return configureStatisticsDao.getEffectiveCfgNum(serviceId);
}
}