(1)getList方法改名,原先版本的是根据编译ID获取配置列表,这里改成两个方法,getListByCfgId和getListByCompileId
(2)调整后台返回给界面的提示信息 (3)修复几处functionId没有传递的bug (4)nis.properties调整url (5)白名单的审核提交 (6)注释掉CrudService的sendTomaat的方法实现,在后续代码没有用到该方法时删除该方法
This commit is contained in:
@@ -3,31 +3,18 @@
|
||||
*/
|
||||
package com.nis.web.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatUnAuditBean;
|
||||
import com.nis.domain.maat.UnAuditBean;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
|
||||
@@ -206,7 +193,6 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* deleteBatch(批量删除全部数据)
|
||||
@@ -311,8 +297,8 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
}
|
||||
/**
|
||||
*
|
||||
* sendToMaatConvertorBatch(批量转换配置到maat转换工具)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* sendToMaatConvertorBatch(单域配置下发maat)
|
||||
* (cfgs里每条为一条配置,每条配置可能包含区域IP)
|
||||
* @param operation
|
||||
* @param cfgs
|
||||
* @return
|
||||
@@ -321,218 +307,11 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public boolean sendToMaatConvertorBatch(int operation,List<List<BaseCfg>> cfgs) throws Exception{
|
||||
if(cfgs==null){
|
||||
throw new RuntimeException("转换出错,配置为空");
|
||||
}
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
/*.setPrettyPrinting().serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
if(Constants.AUDIT_NOT_YES==operation){
|
||||
List<ToMaatUnAuditBean> beans=new ArrayList<ToMaatUnAuditBean>();
|
||||
for(List<BaseCfg> cfg:cfgs){
|
||||
ToMaatUnAuditBean toMaatUnAuditBean=new ToMaatUnAuditBean();
|
||||
toMaatUnAuditBean.setServiceCfg(new ArrayList<UnAuditBean>());
|
||||
for(BaseCfg c:cfg){
|
||||
if(c.getCompileId()==null||c.getCompileId()==0){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
}
|
||||
// if(StringUtils.isBlank(c.getMaatTable())){
|
||||
// throw new RuntimeException("转换出错,未获取到正确的maatTalbe");
|
||||
// }
|
||||
//针对含有多个maatTable的表
|
||||
// if(c.getMaatTable().contains(",")){
|
||||
// for(String maatTable:c.getMaatTable().split(",")){
|
||||
// UnAuditBean bean=new UnAuditBean();
|
||||
// bean.setCompileId(c.getCompileId());
|
||||
// bean.setMaatTable(maatTable);
|
||||
// toMaatUnAuditBean.getServiceCfg().add(bean);
|
||||
// }
|
||||
// }else{
|
||||
// UnAuditBean bean=new UnAuditBean();
|
||||
// bean.setCompileId(c.getCompileId());
|
||||
// toMaatUnAuditBean.getServiceCfg().add(bean);
|
||||
// }
|
||||
|
||||
}
|
||||
beans.add(toMaatUnAuditBean);
|
||||
}
|
||||
String json=gson.toJson(beans);
|
||||
logger.info("to maat json:"+json);
|
||||
@Deprecated
|
||||
public boolean sendToMaatConvertorBatch(int operation,List<? extends BaseCfg> cfgs) throws Exception{
|
||||
|
||||
//发送至maat,待完成
|
||||
return new ConvertTool().setConfigInValid(json);
|
||||
}else{
|
||||
List<ToMaatBean> beans=new ArrayList<ToMaatBean>();
|
||||
for(List<BaseCfg> cfg:cfgs){
|
||||
int compileId=0;
|
||||
ToMaatBean toMaatBean=new ToMaatBean();
|
||||
// toMaatBean.setServiceCfg(new ArrayList<MaatCfg>());
|
||||
MaatCfg maatCfg=new MaatCfg();
|
||||
for(BaseCfg c:cfg){
|
||||
if(c instanceof BaseIpCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
int protocolId= ((BaseIpCfg) c).getProtocolId().intValue();
|
||||
// String maatTable=c.getMaatTable();
|
||||
// if(maatTable.contains(",")){
|
||||
// if(protocolId!=0){
|
||||
// for(String _maatTable:maatTable.split(",")){
|
||||
// if(_maatTable.toLowerCase().indexOf("ip")>-1){
|
||||
// BaseIpCfg ipCfg=(BaseIpCfg)c.clone();
|
||||
// ipCfg.setMaatTable(_maatTable);
|
||||
// if(maatCfg.getIpCfg()==null){
|
||||
// List<BaseIpCfg> list=new ArrayList<>();
|
||||
// list.add(ipCfg);
|
||||
// maatCfg.setIpCfg(list);
|
||||
// }else{
|
||||
// List<BaseIpCfg> list=maatCfg.getIpCfg();
|
||||
// list.add(ipCfg);
|
||||
// }
|
||||
// }else{
|
||||
// NumBoundaryCfg numCfg=new NumBoundaryCfg();
|
||||
// numCfg.initDefaultValue();
|
||||
// numCfg.setLowBounadry((long)protocolId);
|
||||
// numCfg.setUpBoundary((long)protocolId);
|
||||
// numCfg.setMaatTable(_maatTable);
|
||||
// if(maatCfg.getNumCfg()==null){
|
||||
// List<NumBoundaryCfg> numlist=new ArrayList<>();
|
||||
// numlist.add(numCfg);
|
||||
// maatCfg.setNumCfg(numlist);
|
||||
// }else{
|
||||
// List<NumBoundaryCfg> numlist=maatCfg.getNumCfg();
|
||||
// numlist.add(numCfg);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// throw new RuntimeException("protocolId等于0,却对应两个maat_table "+maatTable);
|
||||
// }
|
||||
// }else{
|
||||
// if(maatCfg.getIpCfg()==null){
|
||||
// List<BaseIpCfg> list=new ArrayList<>();
|
||||
// list.add((BaseIpCfg)c);
|
||||
// maatCfg.setIpCfg(list);
|
||||
// }else{
|
||||
// List<BaseIpCfg> list=maatCfg.getIpCfg();
|
||||
// list.add((BaseIpCfg)c);
|
||||
// }
|
||||
// }
|
||||
}else if(c instanceof BaseStringCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
// String maatTable=c.getMaatTable();
|
||||
// if(maatTable.contains(",")){
|
||||
// for(String _maatTable:maatTable.split(",")){
|
||||
// BaseStringCfg strCfg=(BaseStringCfg)c.clone();
|
||||
// strCfg.setMaatTable(_maatTable);
|
||||
// if(maatCfg.getStrCfg()==null){
|
||||
// List<BaseStringCfg> list=new ArrayList<BaseStringCfg>();
|
||||
// list.add(strCfg);
|
||||
// maatCfg.setStrCfg(list);
|
||||
// }else{
|
||||
// List<BaseStringCfg> list=maatCfg.getStrCfg();
|
||||
// list.add(strCfg);
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// if(maatCfg.getStrCfg()==null){
|
||||
// List<BaseStringCfg> list=new ArrayList<BaseStringCfg>();
|
||||
// list.add((BaseStringCfg)c);
|
||||
// maatCfg.setStrCfg(list);
|
||||
// }else{
|
||||
// List<BaseStringCfg> list=maatCfg.getStrCfg();
|
||||
// list.add((BaseStringCfg)c);
|
||||
// }
|
||||
// }
|
||||
}else if(c instanceof ComplexkeywordCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
// String maatTable=c.getMaatTable();
|
||||
// if(maatTable.contains(",")){
|
||||
// for(String _maatTable:maatTable.split(",")){
|
||||
// ComplexkeywordCfg complexCfg=(ComplexkeywordCfg)c.clone();
|
||||
// complexCfg.setMaatTable(_maatTable);
|
||||
// if(maatCfg.getComplexStrCfg()==null){
|
||||
// List<ComplexkeywordCfg> list=new ArrayList<ComplexkeywordCfg>();
|
||||
// list.add(complexCfg);
|
||||
// maatCfg.setComplexStrCfg(list);
|
||||
// }else{
|
||||
// List<ComplexkeywordCfg> list=maatCfg.getComplexStrCfg();
|
||||
// list.add(complexCfg);
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// if(maatCfg.getComplexStrCfg()==null){
|
||||
// List<ComplexkeywordCfg> list=new ArrayList<ComplexkeywordCfg>();
|
||||
// list.add((ComplexkeywordCfg)c);
|
||||
// maatCfg.setComplexStrCfg(list);
|
||||
// }else{
|
||||
// List<ComplexkeywordCfg> list=maatCfg.getComplexStrCfg();
|
||||
// list.add((ComplexkeywordCfg)c);
|
||||
// }
|
||||
// }
|
||||
|
||||
}else if(c instanceof NumBoundaryCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
/*if(maatCfg.getNumCfg()==null){
|
||||
List<NumBoundaryCfg> list=new ArrayList<NumBoundaryCfg>();
|
||||
list.add((NumBoundaryCfg)c);
|
||||
maatCfg.setNumCfg(list);
|
||||
}else{
|
||||
List<NumBoundaryCfg> list=maatCfg.getNumCfg();
|
||||
list.add((NumBoundaryCfg)c);
|
||||
}*/
|
||||
}
|
||||
if(c.getAreaCfg()!=null){
|
||||
/*if(toMaatBean.getAreaCfg()!=null){
|
||||
toMaatBean.getAreaCfg().addAll(c.getAreaCfg());
|
||||
}else{
|
||||
toMaatBean.setAreaCfg(new ArrayList<AreaIpCfg>());
|
||||
toMaatBean.getAreaCfg().addAll(c.getAreaCfg());
|
||||
}*/
|
||||
}
|
||||
}
|
||||
// toMaatBean.getServiceCfg().add(maatCfg);
|
||||
BaseCfg baseCfg=cfg.get(0);
|
||||
if(compileId==0){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
}else{
|
||||
// toMaatBean.setCompileId(compileId);
|
||||
}
|
||||
if(baseCfg.getAction()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的action");
|
||||
}else{
|
||||
// toMaatBean.setAction(baseCfg.getAction());
|
||||
}
|
||||
if(baseCfg.getIsAreaEffective()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的isAreaEffective");
|
||||
}else{
|
||||
// toMaatBean.setIsAreaEffective(baseCfg.getIsAreaEffective());
|
||||
}
|
||||
if(baseCfg.getIsValid()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的isValid");
|
||||
}else{
|
||||
// toMaatBean.setIsValid(baseCfg.getIsValid());
|
||||
}
|
||||
if(baseCfg.getRequestId()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的requestId");
|
||||
}else{
|
||||
// toMaatBean.setRequestId(baseCfg.getRequestId());
|
||||
}
|
||||
if(baseCfg.getServiceId()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的serviceId");
|
||||
}else{
|
||||
// toMaatBean.setServiceId(baseCfg.getServiceId());
|
||||
}
|
||||
// toMaatBean.setAreaEffectiveIds(baseCfg.getAreaEffectiveIds()==null?"":baseCfg.getAreaEffectiveIds());
|
||||
// toMaatBean.setAttribute(baseCfg.getAttribute()==null?"":baseCfg.getAttribute());
|
||||
// toMaatBean.setClassify(baseCfg.getClassify()==null?"":baseCfg.getClassify());
|
||||
// toMaatBean.setLable(baseCfg.getLable()==null?"":baseCfg.getLable());
|
||||
beans.add(toMaatBean);
|
||||
}
|
||||
String json=gson.toJson(beans);
|
||||
logger.info("to maat json:"+json);
|
||||
//发送至maat,待完成
|
||||
return new ConvertTool().saveConfig(json);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -546,209 +325,8 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Deprecated
|
||||
public boolean sendToMaatConvertor(int operation,List<AreaIpCfg> areaCfg,BaseCfg ... cfg) throws Exception{
|
||||
if(cfg==null){
|
||||
throw new RuntimeException("转换出错,配置为空");
|
||||
}
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
/*.setPrettyPrinting().serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
if(Constants.AUDIT_NOT_YES==operation){
|
||||
ToMaatUnAuditBean toMaatUnAuditBean=new ToMaatUnAuditBean();
|
||||
toMaatUnAuditBean.setServiceCfg(new ArrayList<UnAuditBean>());
|
||||
for(BaseCfg c:cfg){
|
||||
|
||||
if(c.getCompileId()==null||c.getCompileId()==0){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
}
|
||||
// if(StringUtils.isBlank(c.getMaatTable())){
|
||||
// throw new RuntimeException("转换出错,未获取到正确的maatTalbe");
|
||||
// }
|
||||
//针对含有多个maatTable的表
|
||||
// if(c.getMaatTable().contains(",")){
|
||||
// for(String maatTable:c.getMaatTable().split(",")){
|
||||
// UnAuditBean bean=new UnAuditBean();
|
||||
// bean.setCompileId(c.getCompileId());
|
||||
// bean.setMaatTable(maatTable);
|
||||
// toMaatUnAuditBean.getServiceCfg().add(bean);
|
||||
// }
|
||||
// }else{
|
||||
// UnAuditBean bean=new UnAuditBean();
|
||||
// bean.setCompileId(c.getCompileId());
|
||||
// bean.setMaatTable(c.getMaatTable());
|
||||
// toMaatUnAuditBean.getServiceCfg().add(bean);
|
||||
// }
|
||||
|
||||
}
|
||||
String json=gson.toJson(toMaatUnAuditBean);
|
||||
logger.info("to maat json:"+json);
|
||||
//发送至maat,待完成
|
||||
return new ConvertTool().setConfigInValid(json);
|
||||
}else{
|
||||
int compileId=0;
|
||||
ToMaatBean toMaatBean=new ToMaatBean();
|
||||
// toMaatBean.setServiceCfg(new ArrayList<MaatCfg>());
|
||||
MaatCfg maatCfg=new MaatCfg();
|
||||
for(BaseCfg c:cfg){
|
||||
if(c instanceof BaseIpCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
int protocolId= ((BaseIpCfg) c).getProtocolId().intValue();
|
||||
// String maatTable=c.getMaatTable();
|
||||
// if(maatTable.contains(",")){
|
||||
// if(protocolId!=0){
|
||||
// for(String _maatTable:maatTable.split(",")){
|
||||
// if(_maatTable.toLowerCase().indexOf("ip")>-1){
|
||||
// BaseIpCfg ipCfg=(BaseIpCfg)c.clone();
|
||||
// ipCfg.setMaatTable(_maatTable);
|
||||
// if(maatCfg.getIpCfg()==null){
|
||||
// List<BaseIpCfg> list=new ArrayList<>();
|
||||
// list.add(ipCfg);
|
||||
// maatCfg.setIpCfg(list);
|
||||
// }else{
|
||||
// List<BaseIpCfg> list=maatCfg.getIpCfg();
|
||||
// list.add(ipCfg);
|
||||
// }
|
||||
// }else{
|
||||
// NumBoundaryCfg numCfg=new NumBoundaryCfg();
|
||||
// numCfg.initDefaultValue();
|
||||
// numCfg.setLowBounadry((long)protocolId);
|
||||
// numCfg.setUpBoundary((long)protocolId);
|
||||
// numCfg.setMaatTable(_maatTable);
|
||||
// if(maatCfg.getNumCfg()==null){
|
||||
// List<NumBoundaryCfg> numlist=new ArrayList<>();
|
||||
// numlist.add(numCfg);
|
||||
// maatCfg.setNumCfg(numlist);
|
||||
// }else{
|
||||
// List<NumBoundaryCfg> numlist=maatCfg.getNumCfg();
|
||||
// numlist.add(numCfg);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// throw new RuntimeException("protocolId等于0,却对应两个maat_table "+maatTable);
|
||||
// }
|
||||
// }else{
|
||||
// if(maatCfg.getIpCfg()==null){
|
||||
// List<BaseIpCfg> list=new ArrayList<>();
|
||||
// list.add((BaseIpCfg)c);
|
||||
// maatCfg.setIpCfg(list);
|
||||
// }else{
|
||||
// List<BaseIpCfg> list=maatCfg.getIpCfg();
|
||||
// list.add((BaseIpCfg)c);
|
||||
// }
|
||||
// }
|
||||
}else if(c instanceof BaseStringCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
// String maatTable=c.getMaatTable();
|
||||
// if(maatTable.contains(",")){
|
||||
// for(String _maatTable:maatTable.split(",")){
|
||||
// BaseStringCfg strCfg=(BaseStringCfg)c.clone();
|
||||
// strCfg.setMaatTable(_maatTable);
|
||||
// if(maatCfg.getStrCfg()==null){
|
||||
// List<BaseStringCfg> list=new ArrayList<BaseStringCfg>();
|
||||
// list.add(strCfg);
|
||||
// maatCfg.setStrCfg(list);
|
||||
// }else{
|
||||
// List<BaseStringCfg> list=maatCfg.getStrCfg();
|
||||
// list.add(strCfg);
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// if(maatCfg.getStrCfg()==null){
|
||||
// List<BaseStringCfg> list=new ArrayList<BaseStringCfg>();
|
||||
// list.add((BaseStringCfg)c);
|
||||
// maatCfg.setStrCfg(list);
|
||||
// }else{
|
||||
// List<BaseStringCfg> list=maatCfg.getStrCfg();
|
||||
// list.add((BaseStringCfg)c);
|
||||
// }
|
||||
// }
|
||||
}else if(c instanceof ComplexkeywordCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
// String maatTable=c.getMaatTable();
|
||||
// if(maatTable.contains(",")){
|
||||
// for(String _maatTable:maatTable.split(",")){
|
||||
// ComplexkeywordCfg complexCfg=(ComplexkeywordCfg)c.clone();
|
||||
// complexCfg.setMaatTable(_maatTable);
|
||||
// if(maatCfg.getComplexStrCfg()==null){
|
||||
// List<ComplexkeywordCfg> list=new ArrayList<ComplexkeywordCfg>();
|
||||
// list.add(complexCfg);
|
||||
// maatCfg.setComplexStrCfg(list);
|
||||
// }else{
|
||||
// List<ComplexkeywordCfg> list=maatCfg.getComplexStrCfg();
|
||||
// list.add(complexCfg);
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// if(maatCfg.getComplexStrCfg()==null){
|
||||
// List<ComplexkeywordCfg> list=new ArrayList<ComplexkeywordCfg>();
|
||||
// list.add((ComplexkeywordCfg)c);
|
||||
// maatCfg.setComplexStrCfg(list);
|
||||
// }else{
|
||||
// List<ComplexkeywordCfg> list=maatCfg.getComplexStrCfg();
|
||||
// list.add((ComplexkeywordCfg)c);
|
||||
// }
|
||||
// }
|
||||
|
||||
}else if(c instanceof NumBoundaryCfg){
|
||||
/*compileId=compileId==0?c.getCompileId():compileId;
|
||||
if(maatCfg.getNumCfg()==null){
|
||||
List<NumBoundaryCfg> list=new ArrayList<NumBoundaryCfg>();
|
||||
list.add((NumBoundaryCfg)c);
|
||||
maatCfg.setNumCfg(list);
|
||||
}else{
|
||||
List<NumBoundaryCfg> list=maatCfg.getNumCfg();
|
||||
list.add((NumBoundaryCfg)c);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
/*if(areaCfg!=null){
|
||||
toMaatBean.setAreaCfg(areaCfg);
|
||||
}else{
|
||||
toMaatBean.setAreaCfg(new ArrayList<AreaIpCfg>());
|
||||
}
|
||||
toMaatBean.getServiceCfg().add(maatCfg);
|
||||
BaseCfg baseCfg=(BaseCfg)cfg[0];
|
||||
if(compileId==0){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
}else{
|
||||
toMaatBean.setCompileId(compileId);
|
||||
}
|
||||
if(baseCfg.getAction()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的action");
|
||||
}else{
|
||||
toMaatBean.setAction(baseCfg.getAction());
|
||||
}
|
||||
if(baseCfg.getIsAreaEffective()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的isAreaEffective");
|
||||
}else{
|
||||
toMaatBean.setIsAreaEffective(baseCfg.getIsAreaEffective());
|
||||
}
|
||||
if(baseCfg.getIsValid()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的isValid");
|
||||
}else{
|
||||
toMaatBean.setIsValid(baseCfg.getIsValid());
|
||||
}
|
||||
if(baseCfg.getRequestId()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的requestId");
|
||||
}else{
|
||||
toMaatBean.setRequestId(baseCfg.getRequestId());
|
||||
}
|
||||
if(baseCfg.getServiceId()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的serviceId");
|
||||
}else{
|
||||
toMaatBean.setServiceId(baseCfg.getServiceId());
|
||||
}
|
||||
toMaatBean.setAreaEffectiveIds(baseCfg.getAreaEffectiveIds()==null?"":baseCfg.getAreaEffectiveIds());
|
||||
toMaatBean.setAttribute(baseCfg.getAttribute()==null?"":baseCfg.getAttribute());
|
||||
toMaatBean.setClassify(baseCfg.getClassify()==null?"":baseCfg.getClassify());
|
||||
toMaatBean.setLable(baseCfg.getLable()==null?"":baseCfg.getLable());*/
|
||||
|
||||
String json=gson.toJson(toMaatBean);
|
||||
logger.info("to maat json:"+json);
|
||||
//发送至maat,待完成
|
||||
return new ConvertTool().saveConfig(json);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user