Merge branch 'develop_no_common_group' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop_no_common_group

This commit is contained in:
段冬梅
2019-04-19 18:33:01 +08:00
110 changed files with 3653 additions and 3258 deletions

View File

@@ -248,7 +248,10 @@ public class AppCfgService extends BaseService {
public void saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception {
// 设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) {
Integer compileId = 0;
try {
@@ -302,7 +305,20 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
if(entity.getFunctionId() == 407){
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
}
if(entity.getFunctionId() == 63){
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP);
}
if(entity.getFunctionId() == 408){
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
}
auditAppPolicyCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
}
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -356,6 +372,20 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
if(entity.getFunctionId() == 407){
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
}
if(entity.getFunctionId() == 63){
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP);
}
if(entity.getFunctionId() == 408){
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
}
auditAppPolicyCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
}
}
}
@@ -363,7 +393,10 @@ public class AppCfgService extends BaseService {
public void saveOrUpdateAppIpCfg(AppIpCfg entity) throws Exception {
// 设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) {
SpecificServiceCfg specificServiceCfg=specificServiceCfgDao.getBySpecServiceId(entity.getSpecServiceId());
@@ -429,10 +462,17 @@ public class AppCfgService extends BaseService {
BeanUtils.copyProperties(entity, cfg,
new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective",
"areaEffectiveIds", "protocol", "portPattern", "srcPort", "destPort",
"direction", "destIpAddress", "srcIpAddress", "ipPattern" });
"direction", "destIpAddress", "srcIpAddress", "srcIpPattern", "destIpPattern" });
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
List<AppIpCfg> entitys=new ArrayList<AppIpCfg>();
entity.setIsAudit(1);
entity.setIsValid(1);
entitys.add(entity);
auditAppIpCfg(entitys, entity.getIsAudit());
}
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -453,10 +493,20 @@ public class AppCfgService extends BaseService {
BeanUtils.copyProperties(entity, cfg,
new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective", "areaEffectiveIds",
"protocol", "portPattern", "srcPort", "destPort", "direction", "destIpAddress",
"srcIpAddress", "ipPattern" });
"srcIpAddress", "srcIpPattern", "destIpPattern" });
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
List<AppIpCfg> entitys=new ArrayList<AppIpCfg>();
entity.setIsAudit(1);
entity.setIsValid(1);
AppIpCfg entity2 = appCfgDao.getAppIpCfg(entity.getCfgId());
entity2.setIsAudit(1);
entity2.setIsValid(1);
entitys.add(entity2);
auditAppIpCfg(entitys, entity.getIsAudit());
}
}
}
public void saveAppHttpCfg(List<ComplexkeywordCfg> cfgs) {
@@ -538,7 +588,10 @@ public class AppCfgService extends BaseService {
public void saveOrUpdateAppDomainCfg(AppDomainCfg entity) throws Exception {
// 设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) {
Integer compileId = 0;
try {
@@ -565,6 +618,11 @@ public class AppCfgService extends BaseService {
logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
}
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -586,6 +644,11 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
}
}
}
@@ -593,7 +656,10 @@ public class AppCfgService extends BaseService {
public void saveOrUpdateAppTopicDomainCfg(AppTopicDomainCfg entity) throws Exception {
// 设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) {
Integer compileId = 0;
try {
@@ -620,6 +686,11 @@ public class AppCfgService extends BaseService {
logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
}
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -641,6 +712,11 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
}
}
}
@@ -890,7 +966,10 @@ public class AppCfgService extends BaseService {
}
}
public void auditAppPolicyCfg(AppPolicyCfg entity, Integer isAudit) {
public void auditAppPolicyCfg(AppPolicyCfg entity, Integer isAudit,Integer opAction) {
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
String configType = entity.getConfigType();
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
@@ -1036,7 +1115,7 @@ public class AppCfgService extends BaseService {
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据
String json = gsonToJson(maatBean);
logger.info("app策略配置下发配置参数" + json);
@@ -1164,6 +1243,12 @@ public class AppCfgService extends BaseService {
}
}
public void auditAppIpCfg(List<AppIpCfg> entitys, Integer isAudit) {
for (AppIpCfg entity : entitys) {
entity.setTableName(AppIpCfg.getTablename());
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
}
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
@@ -1380,7 +1465,10 @@ public class AppCfgService extends BaseService {
}
}
public void auditAppDomainCfg(AppDomainCfg entity, Integer isAudit) {
public void auditAppDomainCfg(AppDomainCfg entity, Integer isAudit,Integer opAction) {
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
@@ -1441,7 +1529,7 @@ public class AppCfgService extends BaseService {
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据
String json = gsonToJson(maatBean);
logger.info("app域名配置下发配置参数" + json);
@@ -1469,7 +1557,10 @@ public class AppCfgService extends BaseService {
}
// app主题网站配置审核
public void auditAppTopicDomainCfg(AppTopicDomainCfg entity, Integer isAudit) {
public void auditAppTopicDomainCfg(AppTopicDomainCfg entity, Integer isAudit,Integer opAction) {
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
@@ -1536,7 +1627,7 @@ public class AppCfgService extends BaseService {
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据
String json = gsonToJson(maatBean);
logger.info("app主题网站配置下发配置参数" + json);

View File

@@ -78,6 +78,10 @@ public class AppMultiFeatureCfgService extends BaseService {
//新增或保存复杂特征配置
@Transactional(readOnly = false, rollbackFor = RuntimeException.class)
public void saveOrUpdateAppFeatureCfg(AppFeatureIndex entity) throws Exception {
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) {
Integer compileId = 0;
try {
@@ -166,6 +170,11 @@ public class AppMultiFeatureCfgService extends BaseService {
logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
}
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -243,6 +252,11 @@ public class AppMultiFeatureCfgService extends BaseService {
}
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
}
}
}
@@ -286,7 +300,11 @@ public class AppMultiFeatureCfgService extends BaseService {
cfg.setCfgKeywords(keyword);
}
public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit) {
public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit,Integer opAction) {
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
@@ -421,7 +439,7 @@ public class AppMultiFeatureCfgService extends BaseService {
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据
String json = gsonToJson(maatBean);
logger.info("app 特征配置下发配置参数:" + json);

View File

@@ -255,7 +255,6 @@ public class AvContentCfgService extends BaseService{
auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION);
}
}else{
entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId());
@@ -534,7 +533,6 @@ public class AvContentCfgService extends BaseService{
}
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
@@ -772,9 +770,11 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -812,9 +812,11 @@ public class AvContentCfgService extends BaseService{
,"cfgType"
,"cfgId"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -829,9 +831,11 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -936,9 +940,11 @@ public class AvContentCfgService extends BaseService{
,"cfgType"
,"cfgId"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -1111,9 +1117,11 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -1151,9 +1159,11 @@ public class AvContentCfgService extends BaseService{
,"cfgType"
,"cfgId"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -1168,9 +1178,11 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -1275,9 +1287,11 @@ public class AvContentCfgService extends BaseService{
,"cfgType"
,"cfgId"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"

View File

@@ -71,10 +71,14 @@ public class DdosCfgService extends BaseService{
return ddosCfgDao.getDdosIpCfg(cfgId,compileId);
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdate(DdosIpCfg entity){
public void saveOrUpdate(DdosIpCfg entity) throws Exception{
Date createTime=new Date();
//设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
String antiddosProtocol = entity.getAntiddosProtocol();
Long bpsThreadshold = entity.getBpsThreadshold();
Long ppsThreadshold = entity.getPpsThreadshold();
@@ -116,7 +120,11 @@ public class DdosCfgService extends BaseService{
}else {
throw new RuntimeException("Could not get compileId!");
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.INSERT_ACTION);
}
//修改
}else{
Date editTime=new Date();
@@ -126,6 +134,11 @@ public class DdosCfgService extends BaseService{
entity.setEditTime(editTime);
ddosCfgDao.update(entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.UPDATE_ACTION);
}
}
}
@@ -228,7 +241,7 @@ public class DdosCfgService extends BaseService{
}*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime) throws Exception{
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime,Integer opAction) throws Exception{
DdosIpCfg entity = new DdosIpCfg();
entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id),entity.getCompileId());
@@ -308,7 +321,7 @@ public class DdosCfgService extends BaseService{
maatBean.setAuditTime(auditTime);
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
maatBean.setOpAction(opAction);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("ddos 配置下发配置参数:"+json);

View File

@@ -22,6 +22,7 @@ import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.DnsIpCfgDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService;
@@ -64,6 +65,10 @@ public class DnsIpCfgService extends BaseService{
Date createTime=new Date();
//设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
//新增
if(entity.getCfgId()==null){
entity.setCreatorId(UserUtils.getUser().getId());
@@ -102,6 +107,11 @@ public class DnsIpCfgService extends BaseService{
entity.setEditTime(editTime);
dnsIpCfgDao.update(entity);
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
}
}
/**
@@ -140,11 +150,13 @@ public class DnsIpCfgService extends BaseService{
dnsIp.setFunctionId(401);
dnsIp.setCfgRegionCode(1);
dnsIp.setCfgType("dns_fake_ip");
dnsIp.setIpPattern(3);
dnsIp.setSrcIpPattern(3);
dnsIp.setDestIpPattern(3);
dnsIp.setSrcIpAddress("0.0.0.0");
dnsIp.setDestPort("0");
dnsIp.setSrcPort("0");
dnsIp.setPortPattern(1);
dnsIp.setSrcPortPattern(1);
dnsIp.setDestPortPattern(1);
dnsIp.setDnsStrategyId(0);
dnsIp.setAction(16);
dnsIp.setServiceId(64);

View File

@@ -19,6 +19,7 @@ import com.nis.domain.configuration.DnsResStrategy;
import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.DnsResStrategyDao;
import com.nis.web.dao.configuration.StringCfgDao;
@@ -86,6 +87,10 @@ public class DnsResStrategyService extends BaseService{
public void saveOrUpdate(DnsResStrategy entity){
Date createTime=new Date();
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
List<DnsResStrategy> list = new ArrayList<DnsResStrategy>();
if( entity.getCfgId()!=null && !"".equals(entity.getCfgId())){
list=dnsResStrategyDao.findList(entity.getCfgId(),null,null);
@@ -112,6 +117,11 @@ public class DnsResStrategyService extends BaseService{
}
}
dnsResStrategyDao.insert(entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
}
//修改
}else{
Date editTime=new Date();
@@ -121,6 +131,11 @@ public class DnsResStrategyService extends BaseService{
entity.setEditTime(editTime);
dnsResStrategyDao.update(entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
}
}
}
@@ -157,8 +172,8 @@ public class DnsResStrategyService extends BaseService{
cfg.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit);
cfg.setEditTime(auditTime);
cfg.setEditorId(UserUtils.getUser().getId());
// cfg.setEditTime(auditTime);
// cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime);
dnsResStrategyDao.update(cfg);

View File

@@ -76,7 +76,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
c.initDefaultValue();
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
"cfgType","srcIpPattern","destIpPattern","srcIpAddress","srcPortPattern","destPortPattern","srcPort","destIpAddress","destPort"});
c.setTableName(AreaIpCfg.getTablename());
}
this.saveIpBatch(cfg.getAreaCfg());
@@ -106,7 +106,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
c.initDefaultValue();
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
"cfgType","srcIpPattern","destIpPattern","srcIpAddress","srcPortPattern","destPortPattern","srcPort","destIpAddress","destPort"});
c.setTableName(AreaIpCfg.getTablename());
c.setCreatorId(cfg.getCurrentUser().getId());
c.setCreateTime(date);
@@ -202,9 +202,11 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
,"cfgType"
,"cfgId"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"

View File

@@ -1,14 +1,11 @@
package com.nis.web.service.configuration;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -16,14 +13,12 @@ import org.springframework.transaction.annotation.Transactional;
import com.beust.jcommander.internal.Lists;
import com.nis.domain.Page;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.DdosIpCfg;
import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
import com.nis.domain.configuration.IpReusePolicyCfg;
import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtils;
import com.nis.web.dao.configuration.IpMultiplexDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService;

View File

@@ -20,6 +20,7 @@ import com.nis.domain.configuration.PxyObjTrustedCaCrl;
import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.basics.ServiceDictInfoDao;
import com.nis.web.dao.configuration.PxyObjKeyringDao;
@@ -100,6 +101,10 @@ public class PxyObjKeyringService extends BaseService{
public void saveOrUpdate(PxyObjKeyring entity){
Date createTime=new Date();
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
//新增
@@ -128,11 +133,21 @@ public class PxyObjKeyringService extends BaseService{
pxyObjKeyringDao.update(entity);
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void trustedCertsaveOrUpdate(PxyObjTrustedCaCert entity){
public void trustedCertsaveOrUpdate(PxyObjTrustedCaCert entity) throws InterruptedException{
Date createTime=new Date();
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
//新增
@@ -162,11 +177,16 @@ public class PxyObjKeyringService extends BaseService{
//修改主表cert配置时需要修改子表crl配置信息
PxyObjTrustedCaCrl crlCfg =new PxyObjTrustedCaCrl();
BeanUtils.copyProperties(entity, crlCfg, new String[]{"cfgId","serviceId","compileId","cfgType"});
entity=pxyObjKeyringDao.getPxyObjTrustedCaCert(entity.getCfgId());
crlCfg.setCertId(entity.getCompileId());
PxyObjTrustedCaCert cert=pxyObjKeyringDao.getPxyObjTrustedCaCert(entity.getCfgId());
crlCfg.setCertId(cert.getCompileId());
pxyObjKeyringDao.updatePxyObjTrustedCaCrl(crlCfg);
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
trustedCertAudit(entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void trustedCrlsaveOrUpdate(PxyObjTrustedCaCrl entity){
@@ -320,8 +340,8 @@ public class PxyObjKeyringService extends BaseService{
cfg.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit);
cfg.setEditTime(auditTime);
cfg.setEditorId(UserUtils.getUser().getId());
// cfg.setEditTime(auditTime);
// cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime);
pxyObjKeyringDao.update(cfg);
@@ -402,8 +422,8 @@ public class PxyObjKeyringService extends BaseService{
cfg.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit);
cfg.setEditTime(auditTime);
cfg.setEditorId(UserUtils.getUser().getId());
// cfg.setEditTime(auditTime);
// cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime);
//修改主表cert 配置状态