1.基础协议添加关键字域,dolog,配置id查询
This commit is contained in:
@@ -34,6 +34,7 @@ import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.configuration.AppCfgDao;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
@@ -146,12 +147,22 @@ public class AppCfgService extends BaseService {
|
||||
entity.setIsAudit(0);
|
||||
appCfgDao.insertAppPolicyCfg(entity);
|
||||
//保存策略IP配置
|
||||
if(entity.getIpPortList()!=null){
|
||||
if(entity!=null&&entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
appCfgDao.insertAppPolicyIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存关键字配置
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setCfgKeywords(cfg.getCfgKeywords());
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
stringcfgDao.saveSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
@@ -173,6 +184,12 @@ public class AppCfgService extends BaseService {
|
||||
appCfgDao.updateAppPolicyCfg(entity);
|
||||
|
||||
appCfgDao.deleteAppPolicyIpCfg(entity);
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
for (NtcSubscribeIdCfg ntcSubscribeIdCfg : entity.getNtcSubscribeIdCfgList()) {
|
||||
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
|
||||
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
|
||||
}
|
||||
}
|
||||
//删除旧的区域IP,新增新的区域IP
|
||||
AreaIpCfg area = new AreaIpCfg();
|
||||
area.setCompileId(entity.getCompileId());
|
||||
@@ -188,6 +205,15 @@ public class AppCfgService extends BaseService {
|
||||
appCfgDao.insertAppPolicyIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setCfgKeywords(cfg.getCfgKeywords());
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
stringcfgDao.saveSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
@@ -494,7 +520,19 @@ public class AppCfgService extends BaseService {
|
||||
List<DigestCfg> digestRegionList = new ArrayList();
|
||||
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||
entity.setTableName(AppPolicyCfg.getTablename());
|
||||
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
|
||||
appCfgDao.auditCfg(entity);
|
||||
//更新关键字表状态
|
||||
if(entity.getCompileId()!=null){
|
||||
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
|
||||
ntc.setCompileId(entity.getCompileId());
|
||||
ntc.setIsAudit(entity.getIsAudit());
|
||||
ntc.setIsValid(entity.getIsValid());
|
||||
ntc.setAuditorId(UserUtils.getUser().getId());
|
||||
ntc.setAuditTime(entity.getAuditTime());
|
||||
stringcfgDao.updateSubscribeIdCfg(ntc);
|
||||
}
|
||||
|
||||
if(isAudit==1){
|
||||
StringBuffer cfgKeywords=new StringBuffer();
|
||||
if(entity.getBehavCode()!=null){
|
||||
@@ -538,6 +576,19 @@ public class AppCfgService extends BaseService {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getCompileId()!=null){
|
||||
|
||||
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
|
||||
ntcList = stringcfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
|
||||
}
|
||||
if(isAudit==1){
|
||||
if(!StringUtil.isEmpty(ntcList)){
|
||||
Map<String,List> ntcMap = cfgConvert(strRegionList,ntcList,2,entity,groupRelationList);
|
||||
groupRelationList=ntcMap.get("groupList");
|
||||
strRegionList=ntcMap.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
@@ -1048,6 +1099,12 @@ public class AppCfgService extends BaseService {
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
appCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
//删除关键字
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
BeanUtils.copyProperties(entity, ntcSubscribeIdCfg, new String[]{"cfgId"});
|
||||
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
|
||||
Reference in New Issue
Block a user