Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into
develop Conflicts: src/main/resources/messages/message_en.properties src/main/resources/messages/message_ru.properties src/main/resources/messages/message_zh_CN.properties 关键字日志转http url配置功能完成
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package com.nis.web.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
@@ -9,8 +12,9 @@ import com.nis.web.dao.SysLogDao;
|
||||
|
||||
@Service
|
||||
public class LogService extends CrudService<SysLogDao, SysLog> {
|
||||
|
||||
public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
@Autowired
|
||||
protected SysLogDao sysLogDao;
|
||||
public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
// 设置默认时间范围,默认当前月
|
||||
if (sysLog.getBeginDate() == null){
|
||||
@@ -24,4 +28,17 @@ public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
}
|
||||
|
||||
public Page<SysLog> findCfgOperationLogPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
// 设置默认时间范围,默认当前月
|
||||
if (sysLog.getBeginDate() == null){
|
||||
sysLog.setBeginDate(DateUtils.setDays(DateUtils.parseDate(DateUtils.getDate()), 1));
|
||||
}
|
||||
if (sysLog.getEndDate() == null){
|
||||
sysLog.setEndDate(DateUtils.addMonths(sysLog.getBeginDate(), 1));
|
||||
}
|
||||
sysLog.setPage(page);
|
||||
List<SysLog> list = sysLogDao.findCfgOperationLogList(sysLog);
|
||||
return page.setList(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.nis.web.service.basics;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -10,8 +12,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
@@ -20,11 +25,15 @@ import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.CrudService;
|
||||
@Service
|
||||
public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
@@ -32,6 +41,8 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
private AsnIpCfgDao asnIpCfgDao;
|
||||
@Autowired
|
||||
private SpecificServiceCfgDao specificServiceCfgDao;
|
||||
@Autowired
|
||||
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
@@ -50,10 +61,13 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void save(List<AsnIpCfg> entitys){
|
||||
Date createTime=new Date();
|
||||
List<Integer> idList=ConfigServiceUtil.getId(3, entitys.size());
|
||||
int index=0;
|
||||
for(AsnIpCfg entity:entitys) {
|
||||
entity.setCreateTime(createTime);
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.setRegionId(ConfigServiceUtil.getId(3, 1).get(0));
|
||||
entity.setRegionId(idList.get(index));
|
||||
index++;
|
||||
}
|
||||
this.saveBatch(entitys, AsnIpCfgDao.class);
|
||||
}
|
||||
@@ -72,10 +86,117 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
throw new RuntimeException("asn group is issued, cannot update asn ip!");
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnIpBatch(Map<String,List<AsnIpCfg>> cfgs) {
|
||||
List<AsnIpCfg> toDelAsnIpCfgs=Lists.newArrayList();
|
||||
List<AsnIpCfg> toSaveAsnIpCfgs=Lists.newArrayList();
|
||||
List<SysDataDictionaryItem> isImportAll=DictUtils.getDictList("IS_ASN_IP_IMPORT_ALL");
|
||||
for(Entry<String,List<AsnIpCfg>> entry:cfgs.entrySet()) {
|
||||
Integer asnNo=Integer.parseInt(entry.getKey());
|
||||
ConfigGroupInfo configGroupInfo=this.getConfigGroupInfoByAsnNo(asnNo);
|
||||
if(configGroupInfo==null) {//不存在则新增
|
||||
PolicyGroupInfo info=new PolicyGroupInfo();
|
||||
info.setAsnNo(Integer.parseInt(entry.getKey()));
|
||||
info.setDescription("Create by import excel");
|
||||
info.setGroupName("Import"+asnNo);
|
||||
info.setGroupType(4);
|
||||
this.saveAsnGroup(info);
|
||||
configGroupInfo=this.getConfigGroupInfoByAsnNo(asnNo);
|
||||
}
|
||||
for(AsnIpCfg cfg:entry.getValue()) {
|
||||
cfg.setAsnIpGroup(configGroupInfo.getGroupId());
|
||||
if(configGroupInfo.getIsIssued()==0)
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
else
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
if(isImportAll.get(0).getItemCode().equals("1")) {//全量下发,删除已有的
|
||||
if(configGroupInfo.getIsIssued()==0) {//已下发
|
||||
List<AsnIpCfg> _toDelAsnIpCfgs=this.getByAsnGroup(configGroupInfo.getGroupId(), configGroupInfo.getAsnId());
|
||||
toDelAsnIpCfgs.addAll(_toDelAsnIpCfgs);
|
||||
}
|
||||
this.deleteByAsnGroup(configGroupInfo.getGroupId(), configGroupInfo.getAsnId());
|
||||
}
|
||||
toSaveAsnIpCfgs.addAll(entry.getValue());
|
||||
}
|
||||
this.save(toSaveAsnIpCfgs);
|
||||
if(toDelAsnIpCfgs.size()>0) {
|
||||
asnIPRegionSendToMaat(toDelAsnIpCfgs,Constants.VALID_NO);
|
||||
}
|
||||
if(toSaveAsnIpCfgs.size()>0) {
|
||||
asnIPRegionSendToMaat(toSaveAsnIpCfgs,Constants.VALID_YES);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* asn ip分组复用新增
|
||||
* @param asnIpCfgs
|
||||
*/
|
||||
public void asnIPRegionSendToMaat(List<AsnIpCfg> asnIpCfgs,Integer valid) {
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(asnIpCfgs,valid,null);
|
||||
List<StringCfg> strRegionList = new ArrayList<>();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(strRegionList);
|
||||
groupReuseCfg.setNumRegionList(numRegionList);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(new Date());
|
||||
maatBean.setCreatorName(UserUtils.getUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
if(valid==Constants.VALID_YES) {
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域新增配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result =ConfigServiceUtil.postGroupReuseSources(json);
|
||||
logger.info("asn ip复用域新增配置响应信息:"+result.getMsg());
|
||||
}else {
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域删除配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnGroup(PolicyGroupInfo entity) throws MaatConvertException{
|
||||
entity.setIsValid(1);
|
||||
//新增
|
||||
Date createTime=new Date();
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
entity.setCreateTime(createTime);
|
||||
//asn类型从综合服务获取groupId
|
||||
if(4==entity.getGroupType().intValue()) {
|
||||
int serviceGroupId=0;
|
||||
List<Integer> groupIds= ConfigServiceUtil.getId(2,1);
|
||||
if(groupIds.size()>0) {
|
||||
serviceGroupId=groupIds.get(0).intValue();
|
||||
}else {
|
||||
throw new MaatConvertException("Get asn group id failed");
|
||||
}
|
||||
entity.setServiceGroupId(serviceGroupId);
|
||||
//新增协议分组
|
||||
ConfigGroupInfo group = new ConfigGroupInfo();
|
||||
group.setGroupId(serviceGroupId);
|
||||
group.setGroupName(entity.getGroupName());
|
||||
group.setIsIssued(0);
|
||||
group.setGroupType(entity.getGroupType());
|
||||
group.setAsnId(entity.getAsnNo());
|
||||
specificServiceCfgDao.insertConfigGroupInfo(group);
|
||||
policyGroupInfoDao.insert(entity);
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnIpCfg(CfgIndexInfo entity) {
|
||||
Date crateTime=new Date();
|
||||
Date createTime=new Date();
|
||||
ConfigGroupInfo groupInfo=specificServiceCfgDao.getConfigGroupInfoByGroupId(entity.getAsnIpGroup().intValue());
|
||||
if(groupInfo==null) {
|
||||
throw new RuntimeException("ConfigGroupInfo is null!");
|
||||
@@ -89,39 +210,19 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId","cfgDesc"});
|
||||
}
|
||||
|
||||
cfg.setCreateTime(crateTime);
|
||||
cfg.setCreateTime(createTime);
|
||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||
cfg.setAsnIpGroup(entity.getAsnIpGroup());
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
}
|
||||
this.save(entity.getAsnIpCfgs());
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(entity.getAsnIpCfgs(),Constants.VALID_YES,null);
|
||||
List<StringCfg> strRegionList = new ArrayList<>();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(strRegionList);
|
||||
groupReuseCfg.setNumRegionList(numRegionList);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(crateTime);
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域新增配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.postGroupReuseSources(json);
|
||||
logger.info("asn ip复用域新增配置响应信息:"+result.getMsg());
|
||||
asnIPRegionSendToMaat(entity.getAsnIpCfgs(),Constants.VALID_YES);
|
||||
}else {
|
||||
if(entity.getAsnIpCfgs()!=null) {
|
||||
for(AsnIpCfg cfg:entity.getAsnIpCfgs()) {
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setCreateTime(crateTime);
|
||||
cfg.setCreateTime(createTime);
|
||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||
cfg.setAsnIpGroup(entity.getAsnIpGroup().intValue());
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
@@ -151,34 +252,14 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
if(issuedList.size()>0) {
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(issuedList,Constants.VALID_NO,null);
|
||||
List<StringCfg> strRegionList = new ArrayList<>();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(strRegionList);
|
||||
groupReuseCfg.setNumRegionList(numRegionList);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(new Date());
|
||||
maatBean.setCreatorName(new AsnIpCfg().getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip复用域删除配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||
asnIPRegionSendToMaat(issuedList,Constants.VALID_NO);
|
||||
}
|
||||
asnIpCfgDao.updateValid(isValid, ids);
|
||||
}
|
||||
public List<ConfigGroupInfo> findPolicyGroupInfosByType(Integer groupId) {
|
||||
// TODO Auto-generated method stub
|
||||
return asnIpCfgDao.findPolicyGroupInfosByType(groupId);
|
||||
}
|
||||
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(Integer groupId) {
|
||||
// // TODO Auto-generated method stub
|
||||
// return asnIpCfgDao.findPolicyGroupInfosByType(groupId);
|
||||
// }
|
||||
/**
|
||||
* 选中组中是否含有只剩一个未删除IP的组
|
||||
* @param serviceGroupIds
|
||||
@@ -200,4 +281,19 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public ConfigGroupInfo getConfigGroupInfoByAsnNo(Integer asnNo) {
|
||||
return asnIpCfgDao.getInfoByAsnNo(asnNo);
|
||||
}
|
||||
public List<AsnIpCfg> getByAsnGroup(Integer groupId,Integer asnNo) {
|
||||
if(groupId==null||asnNo==null) {
|
||||
throw new RuntimeException("groupId or asnNo is null!");
|
||||
}
|
||||
return asnIpCfgDao.getByAsnGroup(groupId,asnNo);
|
||||
}
|
||||
public void deleteByAsnGroup(Integer groupId,Integer asnNo) {
|
||||
if(groupId==null||asnNo==null) {
|
||||
throw new RuntimeException("groupId or asnNo is null!");
|
||||
}
|
||||
asnIpCfgDao.deleteByAsnGroup(groupId,asnNo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1558,6 +1558,7 @@ public class AvContentCfgService extends BaseService{
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(auditTime);
|
||||
avContentCfgDao.updateAvVoipIp(entity);
|
||||
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
|
||||
avContentCfgDao.updateCfgIndexInfo(entity);
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
@@ -1588,6 +1589,10 @@ public class AvContentCfgService extends BaseService{
|
||||
|
||||
if(isAudit==1){
|
||||
if(!StringUtil.isEmpty(ipPortList)){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[] { "cfgId" });
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
avContentCfgDao.updateCfgValid(cfg);
|
||||
Map<String,List> ipMap = cfgConvert(ipRegionList,ipPortList,1,entity,groupRelationList);
|
||||
groupRelationList=ipMap.get("groupList");
|
||||
ipRegionList=ipMap.get("dstList");
|
||||
|
||||
@@ -75,13 +75,13 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
|
||||
|
||||
public CfgIndexInfo exportbgp(CfgIndexInfo entity){
|
||||
List<IpPortCfg> ipPortList = bgpCfgDao.getIpPortList(entity);
|
||||
NtcSubscribeIdCfg subscribeId = new NtcSubscribeIdCfg();
|
||||
subscribeId.setCompileId(entity.getCompileId());
|
||||
subscribeId.setIsValid(entity.getIsValid());
|
||||
List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList = stringCfgDao.findSubscribeIdCfgList(subscribeId);
|
||||
// NtcSubscribeIdCfg subscribeId = new NtcSubscribeIdCfg();
|
||||
// subscribeId.setCompileId(entity.getCompileId());
|
||||
// subscribeId.setIsValid(entity.getIsValid());
|
||||
// List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList = stringCfgDao.findSubscribeIdCfgList(subscribeId);
|
||||
List<NtcBgpAsCfg> ntcBgpAsCfgList = bgpCfgDao.getNtcBgpAsList(entity);
|
||||
entity.setIpPortList(ipPortList);
|
||||
entity.setNtcSubscribeIdCfgList(ntcSubscribeIdCfgList);
|
||||
// entity.setNtcSubscribeIdCfgList(ntcSubscribeIdCfgList);
|
||||
entity.setNtcBgpAsCfgList(ntcBgpAsCfgList);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -523,4 +524,5 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
|
||||
logger.info("http配置取消配置响应信息:"+result.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||
import com.nis.web.dao.configuration.IpMultiplexPoolCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -191,6 +192,7 @@ public class IpMultiplexPoolCfgService extends BaseService{
|
||||
|
||||
public List<IpMultiplexPoolCfg> getIsp(List<IpMultiplexPoolCfg> ispList){
|
||||
for (IpMultiplexPoolCfg snat : ispList) {
|
||||
if(!StringUtil.isEmpty(snat.getAreaEffectiveIds())){
|
||||
if(snat.getAreaEffectiveIds().contains(":")){
|
||||
int index=snat.getAreaEffectiveIds().indexOf(":");
|
||||
String ispCode =snat.getAreaEffectiveIds().substring(index+1);
|
||||
@@ -198,6 +200,12 @@ public class IpMultiplexPoolCfgService extends BaseService{
|
||||
if(dict !=null){
|
||||
snat.setIspName(dict.getItemValue());
|
||||
}
|
||||
}else{
|
||||
SysDictInfo dict= sysDictInfoDao.getDictByItemCode(snat.getAreaEffectiveIds());
|
||||
if(dict !=null){
|
||||
snat.setIspName(dict.getItemValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ispList;
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.ServiceDictInfoDao;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.dao.configuration.WebsiteCfgDao;
|
||||
@@ -58,6 +59,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
protected AreaIpCfgDao areaIpCfgDao;
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
@Autowired
|
||||
private ServiceDictInfoDao serviceDictInfoDao;
|
||||
|
||||
public CfgIndexInfo getHttpCfg(Long cfgId){
|
||||
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId);
|
||||
@@ -377,7 +380,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
}
|
||||
|
||||
}
|
||||
public void auditHttpCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
|
||||
public void auditHttpCfg(CfgIndexInfo entity,Integer isAudit) throws Exception{
|
||||
//修改数据库审核状态信息
|
||||
entity.setTableName(CfgIndexInfo.getTablename());
|
||||
websiteCfgDao.auditCfg(entity);
|
||||
@@ -555,6 +558,14 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
maatCfg.setServiceId(entity.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
//http关键字配置失效时,需确认是否存在与之关联的HTTPURL配置
|
||||
List<MaatCfg> httpUrlCompile=new ArrayList<>();
|
||||
if(entity.getFunctionId().equals(635)){
|
||||
httpUrlCompile=auditHttpUrlByBodyId(maatCfg,httpUrlCompile,entity);
|
||||
}
|
||||
if(!StringUtil.isEmpty(httpUrlCompile)){
|
||||
configCompileList.addAll(httpUrlCompile);
|
||||
}
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
@@ -566,8 +577,122 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("http配置取消配置响应信息:"+result.getMsg());
|
||||
|
||||
}
|
||||
}
|
||||
public List<MaatCfg> auditHttpUrlByBodyId(MaatCfg maatCfgBody,List<MaatCfg> httpUrlCompile,CfgIndexInfo cfgHttpBody) throws Exception{
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
|
||||
CfgIndexInfo cfg=new CfgIndexInfo();
|
||||
cfg.setSourceCompileId(maatCfgBody.getCompileId());
|
||||
cfg.setFunctionId(6);//http url
|
||||
List<CfgIndexInfo> cfgs=websiteCfgDao.getCfgIndexInfos(cfg);
|
||||
//关键字包含的所有url配置
|
||||
for (CfgIndexInfo cfgIndexInfo : cfgs) {
|
||||
//查询所有httpurl配置
|
||||
List<HttpUrlCfg> httpUrlList=websiteCfgDao.getHttpUrlList(cfgIndexInfo);
|
||||
|
||||
//审核通过的,失效 3 0
|
||||
if(cfgIndexInfo.getIsAudit().equals(1)){
|
||||
cfgIndexInfo.setTableName(CfgIndexInfo.getTablename());
|
||||
cfgIndexInfo.setAuditorId(UserUtils.getUser().getId());
|
||||
cfgIndexInfo.setAuditTime(maatCfgBody.getAuditTime());
|
||||
cfgIndexInfo.setIsAudit(3);
|
||||
cfgIndexInfo.setIsValid(0);
|
||||
//设置配置取消的来函信息
|
||||
serviceDictInfoDao.auditCancleRequestInfo(cfgHttpBody.getCancelRequestId(),
|
||||
"cfg_index_info",
|
||||
cfgIndexInfo.getCfgId().toString());
|
||||
websiteCfgDao.auditCfg(cfgIndexInfo);
|
||||
for (BaseStringCfg httpUrlCfg : httpUrlList) {
|
||||
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
|
||||
httpUrlCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
httpUrlCfg.setAuditTime(maatCfgBody.getAuditTime());
|
||||
httpUrlCfg.setIsAudit(3);
|
||||
httpUrlCfg.setIsValid(0);
|
||||
websiteCfgDao.auditCfg(httpUrlCfg);
|
||||
}
|
||||
|
||||
}else if(!(cfgIndexInfo.getIsAudit().equals(3) || cfgIndexInfo.getIsValid().equals(-1))){
|
||||
//未审核和审核未通过,删除 0 -1
|
||||
cfgIndexInfo.setTableName(CfgIndexInfo.getTablename());
|
||||
cfgIndexInfo.setEditorId(UserUtils.getUser().getId());
|
||||
cfgIndexInfo.setEditTime(maatCfgBody.getAuditTime());
|
||||
cfgIndexInfo.setIsAudit(0);
|
||||
cfgIndexInfo.setIsValid(-1);
|
||||
websiteCfgDao.updateCfgValid(cfgIndexInfo);
|
||||
|
||||
for (BaseStringCfg httpUrlCfg : httpUrlList) {
|
||||
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
|
||||
httpUrlCfg.setEditorId(UserUtils.getUser().getId());
|
||||
httpUrlCfg.setEditTime(maatCfgBody.getAuditTime());
|
||||
httpUrlCfg.setIsAudit(0);
|
||||
httpUrlCfg.setIsValid(-1);
|
||||
websiteCfgDao.updateCfgValid(httpUrlCfg);
|
||||
}
|
||||
}
|
||||
//只有审核通过的配置需要下发失效动作
|
||||
if(cfgIndexInfo.getIsAudit().equals(3)){
|
||||
maatCfg.setCompileId(cfgIndexInfo.getCompileId());
|
||||
maatCfg.setServiceId(cfgIndexInfo.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
httpUrlCompile.add(maatCfg);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
List<HttpUrlCfg> httpUrlList=websiteCfgDao.getHttpUrlList(cfg);
|
||||
if(!StringUtil.isEmpty(httpUrlList)){}{
|
||||
for (BaseStringCfg httpUrlCfg : httpUrlList) {
|
||||
//失效中间表
|
||||
CfgIndexInfo entity=new CfgIndexInfo();
|
||||
entity.setTableName(CfgIndexInfo.getTablename());
|
||||
entity.setFunctionId(6);
|
||||
entity.setCompileId(httpUrlCfg.getCompileId());
|
||||
httpUrlCfg.setTableName(HttpUrlCfg.getTablename());
|
||||
//审核通过的,失效 3 0
|
||||
if(httpUrlCfg.getIsAudit().equals(1)){
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(maatCfgBody.getAuditTime());
|
||||
entity.setIsAudit(3);
|
||||
entity.setIsValid(0);
|
||||
|
||||
httpUrlCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
httpUrlCfg.setAuditTime(maatCfgBody.getAuditTime());
|
||||
httpUrlCfg.setIsAudit(3);
|
||||
httpUrlCfg.setIsValid(0);
|
||||
|
||||
websiteCfgDao.auditCfg(entity);
|
||||
websiteCfgDao.auditCfg(httpUrlCfg);
|
||||
//serviceDictInfoDao.auditCancleRequestInfo(cancelRequestId, "cfg_index_info", entity);
|
||||
}else if(!(httpUrlCfg.getIsAudit().equals(3) || httpUrlCfg.getIsValid().equals(-1))){
|
||||
//未审核和审核未通过,删除 0 -1
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
entity.setEditTime(maatCfgBody.getAuditTime());
|
||||
entity.setIsAudit(0);
|
||||
entity.setIsValid(-1);
|
||||
|
||||
httpUrlCfg.setEditorId(UserUtils.getUser().getId());
|
||||
httpUrlCfg.setEditTime(maatCfgBody.getAuditTime());
|
||||
httpUrlCfg.setIsAudit(0);
|
||||
httpUrlCfg.setIsValid(-1);
|
||||
|
||||
websiteCfgDao.updateCfgValid(entity);
|
||||
websiteCfgDao.updateCfgValid(httpUrlCfg);
|
||||
|
||||
}
|
||||
//只有审核通过的配置需要下发失效动作
|
||||
if(httpUrlCfg.getIsAudit().equals(3)){
|
||||
maatCfg.setCompileId(httpUrlCfg.getCompileId());
|
||||
maatCfg.setServiceId(httpUrlCfg.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
httpUrlCompile.add(maatCfg);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
return httpUrlCompile;
|
||||
}
|
||||
public void saveSslCfg(CfgIndexInfo entity){
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
|
||||
@@ -38,4 +38,7 @@ public class ConfigureStatisticsService extends CrudService<NumCfgDao,NumBoundar
|
||||
List<Object[]> dataList=configureStatisticsDao.getRequestStateStatistics(requestList,serviceList);
|
||||
return dataList;
|
||||
}
|
||||
public Integer getEffectiveCfgNum(Integer serviceId){
|
||||
return configureStatisticsDao.getEffectiveCfgNum(serviceId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user