1、APP策略配置增加IP配置;2、修改IP转换时,IPV4的IP/MASK格式时,MASK为0异常的错误。
Signed-off-by: zhangwei <zhangwei@intranet.com>
This commit is contained in:
@@ -17,6 +17,7 @@ import com.nis.domain.configuration.AppHttpCfg;
|
||||
import com.nis.domain.configuration.AppIpCfg;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
@@ -84,7 +85,10 @@ public class AppCfgService extends BaseService {
|
||||
return page;
|
||||
}
|
||||
public AppPolicyCfg getAppPolicyCfg(Long cfgId){
|
||||
return appCfgDao.getAppPolicyCfg(cfgId);
|
||||
AppPolicyCfg policy = appCfgDao.getAppPolicyCfg(cfgId);
|
||||
List<IpPortCfg> ipPortList = appCfgDao.getAppPolicyIpList(policy);
|
||||
policy.setIpPortList(ipPortList);
|
||||
return policy;
|
||||
}
|
||||
public AppIpCfg getAppIpCfg(Long cfgId){
|
||||
return appCfgDao.getAppIpCfg(cfgId);
|
||||
@@ -116,6 +120,13 @@ public class AppCfgService extends BaseService {
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
appCfgDao.insertAppPolicyCfg(entity);
|
||||
//保存策略IP配置
|
||||
if(entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
appCfgDao.insertAppPolicyIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
@@ -134,15 +145,25 @@ public class AppCfgService extends BaseService {
|
||||
entity.setEditTime(new Date());
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
appCfgDao.updateAppPolicyCfg(entity);
|
||||
appCfgDao.updateAppPolicyCfg(entity);
|
||||
|
||||
appCfgDao.deleteAppPolicyIpCfg(entity);
|
||||
//删除旧的区域IP,新增新的区域IP
|
||||
AreaIpCfg area = new AreaIpCfg();
|
||||
area.setCompileId(entity.getCompileId());
|
||||
area.setFunctionId(entity.getFunctionId());
|
||||
areaIpCfgDao.deleteAreaIpCfg(area);
|
||||
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
//保存策略IP配置
|
||||
if(entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
appCfgDao.insertAppPolicyIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
@@ -390,19 +411,37 @@ public class AppCfgService extends BaseService {
|
||||
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||
entity.setTableName(AppPolicyCfg.getTablename());
|
||||
appCfgDao.auditCfg(entity);
|
||||
|
||||
if(isAudit==1){
|
||||
if(entity.getBehavCode()!=null){
|
||||
entity.setCfgKeywords(entity.getAppCode()+"&"+entity.getBehavCode());
|
||||
}else{
|
||||
entity.setCfgKeywords(entity.getAppCode()+"");
|
||||
}
|
||||
|
||||
List<AppPolicyCfg> list = new ArrayList();
|
||||
list.add(entity);
|
||||
Map<String,List> map = cfgConvert(strRegionList,list,2,entity,groupRelationList);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
|
||||
//查询子配置并修改审核状态
|
||||
entity = this.getAppPolicyCfg(entity.getCfgId());
|
||||
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
appCfgDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList);
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
||||
@@ -810,6 +849,15 @@ public class AppCfgService extends BaseService {
|
||||
entity.setTableName(AppPolicyCfg.getTablename());
|
||||
entity.setFunctionId(functionId);
|
||||
appCfgDao.updateCfgValid(entity);
|
||||
|
||||
//查询子配置
|
||||
entity = this.getAppPolicyCfg(Long.parseLong(id));
|
||||
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
appCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
|
||||
Reference in New Issue
Block a user