修复ddos定时任务界面BUG;

修复基础协议定时任务图标不显示bug;
所有业务增加定时任务逻辑

Conflicts:
	src/main/java/com/nis/web/service/configuration/AvContentCfgService.java
This commit is contained in:
duandongmei
2019-04-21 19:02:33 +08:00
parent 7fdd0f7568
commit 3016a82c17
14 changed files with 408 additions and 258 deletions

View File

@@ -305,6 +305,9 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
// 处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -372,6 +375,10 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
// 处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -1061,6 +1068,12 @@ public class AppCfgService extends BaseService {
areaIpRegionList = map.get("dstList");
}
}
if (isAudit != 1) {
// 处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
// 构造提交综合服务参数格式,一条配置提交一次综合服务
if (isAudit == 1) {
maatCfg.initDefaultValue();
@@ -1852,6 +1865,9 @@ public class AppCfgService extends BaseService {
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.updateCfgValid(cfg);
}
// 处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}

View File

@@ -124,6 +124,9 @@ public class AvCfgService extends BaseService{
}else{
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isAudit==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -145,6 +148,9 @@ public class AvCfgService extends BaseService{
}
avCfgDao.updateAvFileSample(entity);
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isAudit==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -358,6 +364,8 @@ public class AvCfgService extends BaseService{
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
avCfgDao.updateAvFileSampleValid(entity);
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
@@ -368,6 +376,10 @@ public class AvCfgService extends BaseService{
//修改数据库审核状态信息
avCfgDao.auditAvFileSample(entity);
List<AvFileSampleCfg> list = new ArrayList<AvFileSampleCfg>();
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//一条配置提交一次综合服务
if(isAudit==1){
list.add(entity);

View File

@@ -194,121 +194,117 @@ public class AvContentCfgService extends BaseService{
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAvVoip(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0);//无效
entity.setIsAudit(0);//未审核
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setIsValid(0);//无效
entity.setIsAudit(0);//未审核
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
avContentCfgDao.insertCfgIndexInfo(entity);
/* if(entity.getVoipIps()!=null){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}*/
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.insertAvVoipKeywordCfg(cfg);
}
}
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.insertAvVoipAccountCfg(cfg);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION);
}
}else{
entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId());
avContentCfgDao.updateCfgIndexInfo(entity);
//无效子配置后,再新增子配置
//avContentCfgDao.deleteAvVoipIp(entity);
avContentCfgDao.deleteIpCfg(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
avContentCfgDao.deleteAvVoipAccountCfg(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
/*if(entity.getVoipIps()!=null&&entity.getVoipIps().size()>0){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}*/
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.insertAvVoipKeywordCfg(cfg);
}
}
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.insertAvVoipAccountCfg(cfg);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAvVoip(entity,entity.getIsAudit(), Constants.UPDATE_ACTION);
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.insertAvVoipKeywordCfg(cfg);
}
}
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.insertAvVoipAccountCfg(cfg);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION);
}
}else{
entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId());
avContentCfgDao.updateCfgIndexInfo(entity);
//无效子配置后,再新增子配置
//avContentCfgDao.deleteAvVoipIp(entity);
avContentCfgDao.deleteIpCfg(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
avContentCfgDao.deleteAvVoipAccountCfg(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
/*if(entity.getVoipIps()!=null&&entity.getVoipIps().size()>0){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}*/
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.insertAvVoipKeywordCfg(cfg);
}
}
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.insertAvVoipAccountCfg(cfg);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAvVoip(entity,entity.getIsAudit(), Constants.UPDATE_ACTION);
}
}
}
/*@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
@@ -427,6 +423,9 @@ public class AvContentCfgService extends BaseService{
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg);
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
/**
@@ -520,21 +519,23 @@ public class AvContentCfgService extends BaseService{
}
}
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
avContentCfgDao.updateCfgValid(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
avContentCfgDao.updateCfgValid(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
@@ -1475,6 +1476,8 @@ public class AvContentCfgService extends BaseService{
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -1521,6 +1524,8 @@ public class AvContentCfgService extends BaseService{
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -1566,6 +1571,9 @@ public class AvContentCfgService extends BaseService{
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg);
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
/**
@@ -1648,7 +1656,10 @@ public class AvContentCfgService extends BaseService{
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();

View File

@@ -170,6 +170,9 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -237,6 +240,9 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -297,7 +303,8 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
cfg.setTableName(AreaIpCfg.getTablename());
bgpCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -391,6 +398,10 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){

View File

@@ -93,12 +93,12 @@ public class DdosCfgService extends BaseService{
if(ppsThreadshold==null) {
entity.setPpsThreadshold(0l);
}
entity.setIsValid(0);
entity.setIsAudit(0);
//新增
if(entity.getCfgId()==null){
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
entity.setIsValid(0);
entity.setIsAudit(0);
if(entity.getCompileId()==null||entity.getCompileId().intValue()==0) {
//调用服务接口获取compileId
List<Integer> compileIds = new ArrayList<Integer>();
@@ -120,6 +120,8 @@ public class DdosCfgService extends BaseService{
}else {
throw new RuntimeException("Could not get compileId!");
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -128,12 +130,12 @@ public class DdosCfgService extends BaseService{
//修改
}else{
Date editTime=new Date();
entity.setIsValid(0);
entity.setIsAudit(0);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
ddosCfgDao.update(entity);
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -160,6 +162,8 @@ public class DdosCfgService extends BaseService{
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
ddosCfgDao.update(entity);
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
/**
@@ -288,7 +292,10 @@ public class DdosCfgService extends BaseService{
entity=this.getDdosIpCfg(entity.getCfgId(),entity.getCompileId());
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
if(entity.getIsAudit()==1){
List<DdosIpCfg> ipList=new ArrayList<DdosIpCfg>();
ipList.add(entity);

View File

@@ -483,6 +483,10 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -526,7 +530,9 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
@@ -568,113 +574,117 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
public void auditDomainCfg(CfgIndexInfo entity,Integer isAudit,Integer opAction) throws MaatConvertException{
// TODO Auto-generated method stub
//修改数据库审核状态信息
entity.setTableName(CfgIndexInfo.getTablename());
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
websiteCfgDao.auditCfg(entity);
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
List<IpCfg> ipRegionList = new ArrayList();
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
//查询子配置并修改审核状态
//entity = this.getDomainCfg(entity.getCfgId(),entity.getCompileId());
if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
HttpUrlCfg cfg = new HttpUrlCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpUrlCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpUrlList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}
//构造提交综合服务参数格式,一条配置提交一次综合服
if(isAudit==1){
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(opAction);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("domain配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("domain配置下发响应信息"+result.getMsg());
entity.setTableName(CfgIndexInfo.getTablename());
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
websiteCfgDao.auditCfg(entity);
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
List<IpCfg> ipRegionList = new ArrayList();
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
//查询子配置并修改审核状态
//entity = this.getDomainCfg(entity.getCfgId(),entity.getCompileId());
if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
HttpUrlCfg cfg = new HttpUrlCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpUrlCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpUrlList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(opAction);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("domain配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("domain配置下发响应信息"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("domain配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("domain配置取消配置响应信息"+result.getMsg());
}
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("domain配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("domain配置取消配置响应信息"+result.getMsg());
}
}
public Page<CfgIndexInfo> getDomainList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL

View File

@@ -172,6 +172,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -228,6 +230,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -276,6 +280,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
cfg.setTableName(AreaIpCfg.getTablename());
fileTransferCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
@@ -361,7 +367,10 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
@@ -485,6 +494,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -553,6 +564,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -585,6 +598,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
,"cfgId"
});
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -626,6 +641,10 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
if(isAudit==1){
Map<String,List> map = cfgConvert(digestRegionList,list,5,entity,groupRelationList);
@@ -775,6 +794,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
@@ -833,6 +854,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -841,8 +864,6 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}else{
// 审核未通过状态的配置 修改后状态改为未审核
entity.setIsValid(0);
entity.setIsAudit(0);
entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId());
fileTransferCfgDao.updateCfgIndex(entity);
@@ -899,6 +920,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
@@ -955,6 +978,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
cfg.setTableName(AreaIpCfg.getTablename());
fileTransferCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -1041,7 +1066,10 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();

View File

@@ -205,6 +205,10 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
// 处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -284,6 +288,9 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
// 处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -349,7 +356,8 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
// 处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -464,6 +472,11 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
}
}
if (isAudit != 1) {
// 处理定时任务【如果有定时任务则删除旧的,新增新的】
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();

View File

@@ -200,6 +200,8 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
@@ -275,6 +277,8 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
@@ -343,7 +347,8 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -484,6 +489,10 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
}
}
if (isAudit != 1) {
// 处理定时任务【如果有定时任务则删除旧的,新增新的】
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();

View File

@@ -197,7 +197,7 @@ public class IpCfgService extends CrudService<IpCfgDao, BaseIpCfg> {
}
}
// TODO 处理定时任务【如果有定时任务则新增】
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if (isValid == 1) {
@@ -280,7 +280,7 @@ public class IpCfgService extends CrudService<IpCfgDao, BaseIpCfg> {
}
}
// TODO 处理定时任务【如果有定时任务则删除旧的,新增新的】
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if (isValid == 1) {
@@ -329,7 +329,7 @@ public class IpCfgService extends CrudService<IpCfgDao, BaseIpCfg> {
cfg.setTableName(AreaIpCfg.getTablename());
ipCfgDao.updateCfgValid(cfg);
}
// TODO 处理定时任务【如果有定时任务则删除旧的,新增新的】
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
@@ -663,7 +663,7 @@ public class IpCfgService extends CrudService<IpCfgDao, BaseIpCfg> {
}
if (isAudit != 1) {
// 处理定时任务【如果有定时任务则删除旧的,新增新的】
// 处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}

View File

@@ -177,6 +177,9 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -241,6 +244,8 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -288,7 +293,8 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
cfg.setTableName(AreaIpCfg.getTablename());
mailCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -373,7 +379,10 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();

View File

@@ -288,6 +288,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -367,7 +369,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -432,7 +435,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -546,7 +550,10 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
@@ -764,6 +771,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -814,7 +823,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -862,7 +872,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -935,7 +946,10 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
@@ -1057,6 +1071,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -1110,7 +1126,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -1164,7 +1181,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
}
@@ -1243,6 +1261,10 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
areaIpRegionList=map.get("dstList");
}
}
if(isAudit!=1){
//处理定时任务
handelScheduleCfg(entity, entity.getIndexTable(), entity);
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){

View File

@@ -463,7 +463,7 @@
</td>
<td class="schedulerFlag">
<c:choose>
<c:when test="${not empty indexCfg.schedule }">
<c:when test="${not empty cfg.schedule }">
<span isScheduler="yes">
<i class="icon-clock icon-state-danger"></i>
</span>

View File

@@ -76,7 +76,9 @@ $(function(){
}
loading('onloading...');
//将disable属性的元素删除
$("#cron.disabled").remove();
$("#cron").find(".disabled").each(function(){
$(this).remove();
});
form.submit();
},
errorContainer: "#messageBox",