ddos增加批量修改数据库状态
This commit is contained in:
@@ -81,6 +81,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
@Autowired
|
||||
protected ConfigGroupInfoDao configGroupInfoDao;
|
||||
private boolean lastServiceTag = false;//标识是否是最后一个同步业务
|
||||
private boolean isFinished = false;
|
||||
/**
|
||||
* 配置全量更新下发
|
||||
* @param request
|
||||
@@ -134,6 +135,15 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
Page<BaseCfg> page=new Page<BaseCfg>(request,response,Constants.MAAT_JSON_SEND_SIZE,"a");
|
||||
handleCallbackData(className,page,entity,request,response,false);
|
||||
}
|
||||
if(!isFinished && lastServiceTag){//如果业务没有配置数据,并且为最后一个业务,需要发送给服务接口一个结束标识
|
||||
String json = "";
|
||||
if("1".equals(serviceType)){
|
||||
json="{}";
|
||||
}else{
|
||||
json="[]";
|
||||
}
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,Integer.parseInt(serviceType),entity.getServiceId(),entity.getTableName(),"FINISHED");
|
||||
}
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
logger.info("本次配置全量同步,开始时间:"+start
|
||||
@@ -434,8 +444,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
}else {
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,(((!hasData)&&lastServiceTag)?"FINISHED":null));
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
}
|
||||
}
|
||||
return hasData;
|
||||
@@ -482,6 +493,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
List<Integer> compileIds = new ArrayList();
|
||||
for(FileDigestCfg cfg:list){
|
||||
compileIds.add(cfg.getCompileId());
|
||||
if(!StringUtil.isEmpty(cfg.getCfdsLevel()) && (cfg.getCfdsLevel() > 10)){
|
||||
cfg.setCfdsLevel((int)(cfg.getCfdsLevel()/10));//文件摘要置信度界面显示为70,80,90,100,下发为7,8,9,10
|
||||
}
|
||||
fileList.add(cfg);
|
||||
}
|
||||
|
||||
@@ -602,8 +616,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
}else {
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,(((!hasData)&&lastServiceTag)?"FINISHED":null));
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
}
|
||||
}
|
||||
return hasData;
|
||||
@@ -791,8 +806,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
}else {
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,(((!hasData)&&lastServiceTag)?"FINISHED":null));
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
}
|
||||
}
|
||||
return hasData;
|
||||
@@ -951,8 +967,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
}else {
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,(((!hasData)&&lastServiceTag)?"FINISHED":null));
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
}
|
||||
}
|
||||
return hasData;
|
||||
@@ -1065,6 +1082,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
List<IpCfg> areaIpRegionList;
|
||||
maatBean = new ToMaatBean();
|
||||
configCompileList = new ArrayList();
|
||||
List<Integer> compileIds=new ArrayList();
|
||||
//批量获取regionId,groupId
|
||||
List<Integer> regionIds = ConfigServiceUtil.getId(3, list.size());
|
||||
List<Integer> groupIds = ConfigServiceUtil.getId(2, list.size());
|
||||
@@ -1114,6 +1132,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
userRegion = userRegion.substring(0, userRegion.length()-1);
|
||||
}
|
||||
}
|
||||
if(isUpdateCfg && !StringUtil.isEmpty(cfg) && !StringUtil.isEmpty(cfg.getCompileId())) {
|
||||
compileIds.add(cfg.getCompileId());
|
||||
}
|
||||
list1.add(cfg);
|
||||
if(list1.size()>0){
|
||||
Map<String,List> map = cfgToMaatConvert(ipRegionList,list1,1,groupRelationList);
|
||||
@@ -1139,6 +1160,11 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
configCompileList.add(maatCfg);
|
||||
}
|
||||
if(isUpdateCfg) {
|
||||
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
|
||||
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,compileIds,null);
|
||||
}
|
||||
}
|
||||
page.setList(list);
|
||||
if(page.isLastPage()){
|
||||
hasData = false;
|
||||
@@ -1160,8 +1186,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
}else {
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,(((!hasData)&&lastServiceTag)?"FINISHED":null));
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1343,8 +1370,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
}else {
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,(((!hasData)&&lastServiceTag)?"FINISHED":null));
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1461,8 +1489,9 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
}else {
|
||||
//调用服务接口配置全量更新
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,(((!hasData)&&lastServiceTag)?"FINISHED":null));
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,isFinished?"FINISHED":null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1535,6 +1564,10 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}else{
|
||||
if(className.equals("AvFileSampleCfg")){
|
||||
list = configSynchronizationDao.getAvFileCfgList(entity);
|
||||
newList.addAll(list);
|
||||
}else if(className.equals("AvSignSampleCfg")){
|
||||
list = configSynchronizationDao.getAvSignCfgList(entity);
|
||||
newList.addAll(list);
|
||||
}else if(className.equals("PxyObjKeyring")){
|
||||
list = configSynchronizationDao.getPxyObjKeyringCfgList(entity);
|
||||
for(int i=0;i<list.size();i++){
|
||||
@@ -1591,7 +1624,8 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}else {
|
||||
FileUtils.writeToFile("/home/ceiec/configSync/"+DateUtils.getDate("yyyy-MM-dd")+"/"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".json", json, false);
|
||||
//调用服务接口同步回调类配置
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,2,entity.getServiceId(),entity.getTableName(),(((!hasData)&&lastServiceTag)?"FINISHED":null));
|
||||
isFinished = ((!hasData)&&lastServiceTag)?true:false;
|
||||
JSONObject result = ConfigServiceUtil.configSync(json,2,entity.getServiceId(),entity.getTableName(),isFinished?"FINISHED":null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ $(document).ready(function() {
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
if(!"${bean.reportBusinessType}"){//default
|
||||
$("#reportBusinessType").val("label_report");
|
||||
ajaxReport("/report/ajaxNtcTagReport","#label");
|
||||
$("#reportBusinessType").val("lwhh_report");
|
||||
ajaxReport("/report/ajaxNtcLwhhReport","#lwhh");
|
||||
}else if("${bean.reportBusinessType}"=="label_report"){
|
||||
ajaxReport("/report/ajaxNtcTagReport","#label");
|
||||
}else if("${bean.reportBusinessType}"=="lwhh_report"){
|
||||
@@ -68,7 +68,7 @@ $(document).ready(function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
ajaxServiceLogTotal();
|
||||
//ajaxServiceLogTotal();
|
||||
$("#export-btn").click(function(){
|
||||
totaltb(1,-1);
|
||||
var te = $(".in table").tableExport({
|
||||
@@ -166,8 +166,8 @@ var ajaxServiceLogTotal=function(){
|
||||
data:{
|
||||
"services":services.join(","),
|
||||
"functionId":$("#functionId").val(),
|
||||
"reportType":$('[name="reportType"]').val(),
|
||||
"reportTime":$('[name="reportTime"]').val()
|
||||
"reportType":1/* $('[name="reportType"]').val() ,
|
||||
"reportTime":$('[name="reportTime"]').val()*/
|
||||
},
|
||||
dataType:'json',
|
||||
async:true,
|
||||
@@ -328,10 +328,10 @@ function customColumnClick(){
|
||||
|
||||
var reportBusinessType=$("#reportBusinessType").val()
|
||||
var tableId="tagTable";
|
||||
if(reportBusinessType=="label_report"){
|
||||
tableId="tagTable";
|
||||
}else if(reportBusinessType=="lwhh_report"){
|
||||
if(reportBusinessType=="lwhh_report"){
|
||||
tableId="lwhhTable";
|
||||
}else if(reportBusinessType=="label_report"){
|
||||
tableId="tagTable";
|
||||
} else if(reportBusinessType=="src_ip_report"){
|
||||
tableId="contentTable1";
|
||||
}else if(reportBusinessType=="attr_type_report"){
|
||||
@@ -373,22 +373,21 @@ white-space:nowrap;
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<%-- <c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action"> --%>
|
||||
<%-- <div class="theme-panel hidden-xs hidden-sm">
|
||||
<c:forEach items="${serviceList}" var="service" varStatus="status">
|
||||
<%-- <c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}"> --%>
|
||||
<c:if test="${(service.action ne 128) && (service.action ne 32) && (service.action ne 96) && (service.serviceId ne 37) && (service.serviceId ne 149)}" >
|
||||
<c:if test="${(service.action ne 128) && (service.serviceId ne 37) && (service.serviceId ne 149)}" >
|
||||
<div data-service="${service.serviceId}" class="service btn">
|
||||
<spring:message code="${service.serviceName}"/>
|
||||
<%-- <spring:message code="log_total"/> --%>
|
||||
<spring:message code="total"/>
|
||||
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action">
|
||||
<c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}">
|
||||
<spring:message code="${action.itemValue}"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<span>0</span>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<%-- </c:if> --%>
|
||||
</c:forEach>
|
||||
<%-- </c:forEach> --%>
|
||||
</div>
|
||||
</div> --%>
|
||||
<h3 class="page-title">
|
||||
<spring:message code="${bean.cfgName}"/>
|
||||
<small><spring:message code="report_list"/></small>
|
||||
@@ -416,16 +415,9 @@ white-space:nowrap;
|
||||
<%-- <c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action" > --%>
|
||||
<c:forEach items="${serviceList}" var="service" >
|
||||
<%-- <c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}"> --%>
|
||||
<c:if test="${service.serviceId ne 5}">
|
||||
<c:if test="${(service.action ne 128) && (service.action ne 32) && (service.action ne 96) }" >
|
||||
<c:if test="${(service.action ne 128) && (service.serviceId ne 37) && (service.serviceId ne 149) }" >
|
||||
<form:option value="${service.serviceId}" ><spring:message code="${service.serviceName}"/></form:option>
|
||||
</c:if>
|
||||
</c:if>
|
||||
<c:if test="${service.serviceId eq 5}">
|
||||
<c:if test="${(service.action ne 128) && (service.action ne 96) }" >
|
||||
<form:option value="${service.serviceId}" ><spring:message code="${service.serviceName}"/></form:option>
|
||||
</c:if>
|
||||
</c:if>
|
||||
<%-- </c:if> --%>
|
||||
</c:forEach>
|
||||
<%-- </c:forEach> --%>
|
||||
@@ -487,7 +479,12 @@ white-space:nowrap;
|
||||
<br>
|
||||
<ul class="nav nav-tabs nav-justified" >
|
||||
<li
|
||||
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}">
|
||||
<c:if test="${bean.reportBusinessType eq 'lwhh_report' or bean.reportBusinessType ==null}">
|
||||
class="active"
|
||||
</c:if>
|
||||
><a class="lireport" data-bussiness="lwhh_report" data-toggle="tab" href="#lwhh" title="<spring:message code="lwhh_report"/>" ><spring:message code="lwhh_report"/></a></li>
|
||||
<li
|
||||
<c:if test="${bean.reportBusinessType eq 'label_report'}">
|
||||
class="active"
|
||||
</c:if>
|
||||
><a class="lireport" data-bussiness="label_report" data-toggle="tab" href="#label" title="<spring:message code="label_report"/>"><spring:message code="label_report"/></a></li>
|
||||
@@ -497,11 +494,6 @@ white-space:nowrap;
|
||||
</c:if>
|
||||
><a class="lireport" data-bussiness="attr_type_report" data-toggle="tab" href="#attrType" title="<spring:message code="attr_type_report"/>" ><spring:message code="attr_type_report"/></a></li>
|
||||
<li
|
||||
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
|
||||
class="active"
|
||||
</c:if>
|
||||
><a class="lireport" data-bussiness="lwhh_report" data-toggle="tab" href="#lwhh" title="<spring:message code="lwhh_report"/>" ><spring:message code="lwhh_report"/></a></li>
|
||||
<li
|
||||
<c:if test="${bean.reportBusinessType eq 'src_ip_report'}">
|
||||
class="active"
|
||||
</c:if>
|
||||
@@ -518,18 +510,18 @@ white-space:nowrap;
|
||||
><a class="lireport" data-bussiness="isp_report" data-toggle="tab" href="#entranceId" title="<spring:message code="isp_report"/>"><spring:message code="isp_report"/></a></li>
|
||||
</ul>
|
||||
<div class="tab-content table-responsive">
|
||||
<div id="lwhh" class="tab-pane fade
|
||||
<c:if test="${bean.reportBusinessType eq 'lwhh_report' or bean.reportBusinessType ==null}">
|
||||
in active
|
||||
</c:if>"></div>
|
||||
<div id="label" class="tab-pane fade
|
||||
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}">
|
||||
<c:if test="${bean.reportBusinessType eq 'label_report'}">
|
||||
in active
|
||||
</c:if>"></div>
|
||||
<div id="attrType" class="tab-pane fade
|
||||
<c:if test="${bean.reportBusinessType eq 'attr_type_report'}">
|
||||
in active
|
||||
</c:if>"></div>
|
||||
<div id="lwhh" class="tab-pane fade
|
||||
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
|
||||
in active
|
||||
</c:if>"></div>
|
||||
<div id="srcIp" class="tab-pane fade
|
||||
<c:if test="${bean.reportBusinessType eq 'src_ip_report'}">
|
||||
in active
|
||||
|
||||
Reference in New Issue
Block a user