PROXY+IP Spoofing+IP payload增加配置热修改和配置新增直接生效功能
This commit is contained in:
@@ -56,6 +56,12 @@ public class ControlPolicyService 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());
|
||||
@@ -89,6 +95,12 @@ public class ControlPolicyService extends BaseService{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
audit(entity.getIsAudit(), entity.getIsValid(), entity.getFunctionId(), entity.getId().toString(), new Date(), Constants.REPLACE_REQ_KEY_VALUE, Constants.INSERT_ACTION);
|
||||
}
|
||||
|
||||
//修改
|
||||
}else{
|
||||
Date editTime=new Date();
|
||||
@@ -135,6 +147,12 @@ public class ControlPolicyService extends BaseService{
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
entity.setEditTime(editTime);
|
||||
controlPolicyDao.update(entity);
|
||||
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
audit(entity.getIsAudit(), entity.getIsValid(), entity.getFunctionId(), entity.getId().toString(), new Date(), Constants.REPLACE_REQ_KEY_VALUE, Constants.UPDATE_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +174,7 @@ public class ControlPolicyService extends BaseService{
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime,String replaceKeyValue){
|
||||
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime,String replaceKeyValue,Integer opAction){
|
||||
HttpBodyCfg entity = new HttpBodyCfg();
|
||||
List<HttpBodyCfg> list = new ArrayList();
|
||||
List<AreaIpCfg> areaIpCfgList = new ArrayList();
|
||||
@@ -234,7 +252,7 @@ public class ControlPolicyService 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("配置下发配置参数:"+json);
|
||||
|
||||
Reference in New Issue
Block a user