stream、DDOS和高级功能模块对某些用户的配置不经过审核直接生效及生效中的配置进行修改的功能
This commit is contained in:
@@ -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());
|
||||
@@ -433,6 +466,13 @@ public class AppCfgService extends BaseService {
|
||||
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());
|
||||
@@ -457,6 +497,16 @@ public class AppCfgService extends BaseService {
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 配置状态
|
||||
|
||||
Reference in New Issue
Block a user