2018-05-25 13:25:21 +08:00
|
|
|
|
package com.nis.web.service.configuration;
|
|
|
|
|
|
|
|
|
|
|
|
import java.beans.PropertyDescriptor;
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
|
import java.lang.reflect.Modifier;
|
2018-05-29 12:48:27 +08:00
|
|
|
|
import java.util.ArrayList;
|
2018-05-25 13:25:21 +08:00
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
import java.util.List;
|
2018-05-29 12:48:27 +08:00
|
|
|
|
import java.util.Map;
|
2018-05-25 13:25:21 +08:00
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
import org.springframework.beans.BeansException;
|
|
|
|
|
|
import org.springframework.beans.FatalBeanException;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
import org.springframework.util.ClassUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import com.nis.domain.Page;
|
2018-05-28 15:47:33 +08:00
|
|
|
|
import com.nis.domain.configuration.AreaIpCfg;
|
2018-05-29 12:48:27 +08:00
|
|
|
|
import com.nis.domain.configuration.AvFileSampleCfg;
|
|
|
|
|
|
import com.nis.domain.configuration.AvSignSampleCfg;
|
2018-05-25 13:25:21 +08:00
|
|
|
|
import com.nis.domain.configuration.BaseIpCfg;
|
|
|
|
|
|
import com.nis.domain.configuration.CfgIndexInfo;
|
|
|
|
|
|
import com.nis.domain.configuration.HttpBodyCfg;
|
|
|
|
|
|
import com.nis.domain.configuration.HttpReqHeadCfg;
|
|
|
|
|
|
import com.nis.domain.configuration.HttpResHeadCfg;
|
|
|
|
|
|
import com.nis.domain.configuration.HttpUrlCfg;
|
|
|
|
|
|
import com.nis.domain.configuration.IpPortCfg;
|
2018-05-29 12:48:27 +08:00
|
|
|
|
import com.nis.domain.maat.MaatCfg;
|
|
|
|
|
|
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
|
|
|
|
|
import com.nis.domain.maat.ToMaatBean;
|
|
|
|
|
|
import com.nis.domain.maat.ToMaatResult;
|
|
|
|
|
|
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
|
|
|
|
|
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
|
|
|
|
|
import com.nis.domain.maat.MaatCfg.IpCfg;
|
|
|
|
|
|
import com.nis.domain.maat.MaatCfg.StringCfg;
|
2018-05-25 13:25:21 +08:00
|
|
|
|
import com.nis.exceptions.MaatConvertException;
|
|
|
|
|
|
import com.nis.util.ConfigServiceUtil;
|
2018-05-29 12:48:27 +08:00
|
|
|
|
import com.nis.util.Constants;
|
|
|
|
|
|
import com.nis.util.IpUtil;
|
2018-05-28 15:47:33 +08:00
|
|
|
|
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
2018-05-25 13:25:21 +08:00
|
|
|
|
import com.nis.web.dao.configuration.IpCfgDao;
|
|
|
|
|
|
import com.nis.web.dao.configuration.WebsiteCfgDao;
|
2018-05-29 12:48:27 +08:00
|
|
|
|
import com.nis.web.security.UserUtils;
|
2018-05-25 13:25:21 +08:00
|
|
|
|
import com.nis.web.service.BaseService;
|
|
|
|
|
|
import com.nis.web.service.CrudService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 网站相关配置事务类
|
|
|
|
|
|
* @author dell
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Service
|
|
|
|
|
|
public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
protected WebsiteCfgDao websiteCfgDao;
|
2018-05-28 15:47:33 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
protected AreaIpCfgDao areaIpCfgDao;
|
2018-05-25 13:25:21 +08:00
|
|
|
|
|
|
|
|
|
|
public CfgIndexInfo getHttpCfg(Long cfgId){
|
|
|
|
|
|
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId);
|
|
|
|
|
|
List<IpPortCfg> ipPortList = websiteCfgDao.getIpPortList(entity);
|
|
|
|
|
|
List<HttpUrlCfg> httpUrlList = websiteCfgDao.getHttpUrlList(entity);
|
|
|
|
|
|
List<HttpReqHeadCfg> httpReqHdrList = websiteCfgDao.getHttpReqHdrList(entity);
|
|
|
|
|
|
List<HttpResHeadCfg> httpResHdrList = websiteCfgDao.getHttpResHdrList(entity);
|
|
|
|
|
|
List<HttpBodyCfg> httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity);
|
|
|
|
|
|
List<HttpBodyCfg> httpResBodyList = websiteCfgDao.getHttpResBodyList(entity);
|
2018-05-28 15:47:33 +08:00
|
|
|
|
List<AreaIpCfg> areaCfg = areaIpCfgDao.getByCompileId(entity.getCompileId());
|
2018-05-25 13:25:21 +08:00
|
|
|
|
entity.setIpPortList(ipPortList);
|
|
|
|
|
|
entity.setHttpReqBodyList(httpReqBodyList);
|
|
|
|
|
|
entity.setHttpReqHdrList(httpReqHdrList);
|
|
|
|
|
|
entity.setHttpResBodyList(httpResBodyList);
|
|
|
|
|
|
entity.setHttpResHdrList(httpResHdrList);
|
|
|
|
|
|
entity.setHttpUrlList(httpUrlList);
|
2018-05-28 15:47:33 +08:00
|
|
|
|
entity.setAreaCfg(areaCfg);
|
2018-05-25 13:25:21 +08:00
|
|
|
|
return entity;
|
|
|
|
|
|
}
|
|
|
|
|
|
public Page<CfgIndexInfo> getHttpList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
|
|
|
|
|
|
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
|
|
|
|
|
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
|
|
|
|
|
|
entity.setPage(page);
|
|
|
|
|
|
List<CfgIndexInfo> list = websiteCfgDao.getHttpList(entity);
|
|
|
|
|
|
page.setList(list);
|
|
|
|
|
|
return page;
|
|
|
|
|
|
}
|
|
|
|
|
|
public List<IpPortCfg> getHttpIpList(IpPortCfg entity){
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
public List<HttpUrlCfg> getHttpUrlList(HttpUrlCfg entity){
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
public List<HttpResHeadCfg> getHttpResHdrList(HttpResHeadCfg entity){
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
public List<HttpBodyCfg> getHttpResBodyList(HttpBodyCfg entity){
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
public List<HttpReqHeadCfg> getHttpReqHdrList(HttpReqHeadCfg entity){
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
public List<HttpBodyCfg> getHttpReqBodyList(HttpBodyCfg entity){
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
public void saveHttpCfg(CfgIndexInfo entity){
|
|
|
|
|
|
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());
|
|
|
|
|
|
websiteCfgDao.saveCfgIndex(entity);
|
|
|
|
|
|
if(entity.getIpPortList()!=null){
|
|
|
|
|
|
for(IpPortCfg cfg:entity.getIpPortList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpIpCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpUrlList()!=null){
|
|
|
|
|
|
for(HttpUrlCfg cfg:entity.getHttpUrlList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpUrlCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpReqHdrList()!=null){
|
|
|
|
|
|
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpReqHdrCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpResHdrList()!=null){
|
|
|
|
|
|
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpResHdrCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpReqBodyList()!=null){
|
|
|
|
|
|
for(HttpBodyCfg cfg:entity.getHttpReqBodyList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpBodyCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpResBodyList()!=null){
|
|
|
|
|
|
for(HttpBodyCfg cfg:entity.getHttpResBodyList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpBodyCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-05-28 15:47:33 +08:00
|
|
|
|
//保存区域IP信息
|
|
|
|
|
|
if(entity.getAreaCfg()!=null){
|
|
|
|
|
|
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
2018-05-29 12:48:27 +08:00
|
|
|
|
cfg.initDefaultValue();
|
2018-05-28 15:47:33 +08:00
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
areaIpCfgDao.saveAreaIpCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-05-25 13:25:21 +08:00
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
logger.info("获取编译ID出错");
|
|
|
|
|
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
websiteCfgDao.updateCfgIndex(entity);
|
|
|
|
|
|
// entity = websiteCfgDao.getCfgIndexInfo(entity.getCfgId());
|
|
|
|
|
|
//无效子配置后,再新增子配置
|
|
|
|
|
|
websiteCfgDao.deleteHttpIpCfg(entity);
|
|
|
|
|
|
websiteCfgDao.deleteHttpUrlCfg(entity);
|
|
|
|
|
|
websiteCfgDao.deleteHttpReqHdrCfg(entity);
|
|
|
|
|
|
websiteCfgDao.deleteHttpResHdrCfg(entity);
|
|
|
|
|
|
websiteCfgDao.deleteHttpBodyCfg(entity);
|
2018-05-28 15:47:33 +08:00
|
|
|
|
AreaIpCfg area = new AreaIpCfg();
|
|
|
|
|
|
area.setCompileId(entity.getCompileId());
|
|
|
|
|
|
area.setFunctionId(entity.getFunctionId());
|
|
|
|
|
|
areaIpCfgDao.deleteAreaIpCfg(area);
|
2018-05-25 13:25:21 +08:00
|
|
|
|
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"});
|
|
|
|
|
|
websiteCfgDao.saveHttpIpCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpUrlList()!=null){
|
|
|
|
|
|
for(HttpUrlCfg cfg:entity.getHttpUrlList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpUrlCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpReqHdrList()!=null){
|
|
|
|
|
|
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpReqHdrCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpResHdrList()!=null){
|
|
|
|
|
|
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpResHdrCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpReqBodyList()!=null){
|
|
|
|
|
|
for(HttpBodyCfg cfg:entity.getHttpReqBodyList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpBodyCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpResBodyList()!=null){
|
|
|
|
|
|
for(HttpBodyCfg cfg:entity.getHttpResBodyList()){
|
|
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
|
|
|
|
websiteCfgDao.saveHttpBodyCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-05-28 15:47:33 +08:00
|
|
|
|
//保存区域IP信息
|
|
|
|
|
|
if(entity.getAreaCfg()!=null){
|
|
|
|
|
|
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
2018-05-29 12:48:27 +08:00
|
|
|
|
cfg.initDefaultValue();
|
2018-05-28 15:47:33 +08:00
|
|
|
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
|
|
|
|
|
|
areaIpCfgDao.saveAreaIpCfg(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-05-25 13:25:21 +08:00
|
|
|
|
}
|
2018-05-29 12:48:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
public void updateHttpCfgValid(Integer isAudit,Integer isValid,String ids){
|
|
|
|
|
|
CfgIndexInfo entity = new CfgIndexInfo();
|
|
|
|
|
|
String[] idArray = ids.split(",");
|
|
|
|
|
|
for(String id :idArray){
|
|
|
|
|
|
entity.setCfgId(Long.parseLong(id));
|
|
|
|
|
|
entity.setIsAudit(isAudit);
|
|
|
|
|
|
entity.setIsValid(isValid);
|
|
|
|
|
|
entity.setEditorId(UserUtils.getUser().getId());
|
|
|
|
|
|
entity.setEditTime(new Date());
|
|
|
|
|
|
websiteCfgDao.updateHttpCfgValid(entity);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public void auditHttpCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
|
|
|
|
|
|
//修改数据库审核状态信息
|
|
|
|
|
|
websiteCfgDao.auditHttpCfg(entity);
|
2018-05-25 13:25:21 +08:00
|
|
|
|
|
2018-05-29 12:48:27 +08:00
|
|
|
|
ToMaatBean maatBean = new ToMaatBean();
|
|
|
|
|
|
MaatCfg maatCfg = new MaatCfg();
|
|
|
|
|
|
maatCfg.initDefaultValue();
|
|
|
|
|
|
BeanUtils.copyProperties(entity, maatCfg);
|
2018-05-25 13:25:21 +08:00
|
|
|
|
|
2018-05-29 12:48:27 +08:00
|
|
|
|
//一条配置提交一次综合服务
|
|
|
|
|
|
if(isAudit==1){
|
|
|
|
|
|
entity = this.getHttpCfg(entity.getCfgId());
|
|
|
|
|
|
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();
|
|
|
|
|
|
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
|
|
|
|
|
Map<String,List> map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList);
|
|
|
|
|
|
groupRelationList=map.get("groupList");
|
|
|
|
|
|
ipRegionList=map.get("dstList");
|
|
|
|
|
|
numRegionList.addAll(map.get("numRegionList"));
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
|
|
|
|
|
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpUrlList(),2,entity,groupRelationList);
|
|
|
|
|
|
groupRelationList=map.get("groupList");
|
|
|
|
|
|
strRegionList=map.get("dstList");
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
|
|
|
|
|
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpReqHdrList(),2,entity,groupRelationList);
|
|
|
|
|
|
groupRelationList=map.get("groupList");
|
|
|
|
|
|
strRegionList=map.get("dstList");
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpResHdrList(),2,entity,groupRelationList);
|
|
|
|
|
|
groupRelationList=map.get("groupList");
|
|
|
|
|
|
strRegionList=map.get("dstList");
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpReqBodyList()!=null && entity.getHttpReqBodyList().size()>0){
|
|
|
|
|
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpReqBodyList(),2,entity,groupRelationList);
|
|
|
|
|
|
groupRelationList=map.get("groupList");
|
|
|
|
|
|
strRegionList=map.get("dstList");
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.getHttpResBodyList()!=null && entity.getHttpResBodyList().size()>0){
|
|
|
|
|
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpResBodyList(),2,entity,groupRelationList);
|
|
|
|
|
|
groupRelationList=map.get("groupList");
|
|
|
|
|
|
strRegionList=map.get("dstList");
|
|
|
|
|
|
}
|
|
|
|
|
|
//保存区域IP信息
|
|
|
|
|
|
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
|
|
|
|
|
Map<String,List> map = cfgConvert(areaIpRegionList,entity.getAreaCfg(),1,entity,groupRelationList);
|
|
|
|
|
|
groupRelationList=map.get("groupList");
|
|
|
|
|
|
areaIpRegionList=map.get("dstList");
|
|
|
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
|
configCompileList.add(maatCfg);
|
|
|
|
|
|
maatBean.setConfigCompileList(configCompileList);
|
|
|
|
|
|
maatBean.setAuditTime(entity.getAuditTime());
|
|
|
|
|
|
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
|
|
|
|
|
maatBean.setVersion(Constants.MAAT_VERSION);
|
|
|
|
|
|
//调用服务接口下发配置数据
|
|
|
|
|
|
String json=gsonToJson(maatBean);
|
|
|
|
|
|
logger.info("http配置下发配置参数:"+json);
|
|
|
|
|
|
//调用服务接口下发配置
|
|
|
|
|
|
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
|
|
|
|
|
logger.info("http配置下发响应信息:"+result.getMsg());
|
|
|
|
|
|
|
|
|
|
|
|
}else if(isAudit==3){
|
|
|
|
|
|
//调用服务接口取消配置
|
|
|
|
|
|
String json=gsonToJson(maatBean);
|
|
|
|
|
|
logger.info("http配置下发配置参数:"+json);
|
|
|
|
|
|
//调用服务接口下发配置
|
|
|
|
|
|
ToMaatResult result = ConfigServiceUtil.put(json,2);
|
|
|
|
|
|
logger.info("http配置取消配置响应信息:"+result.getMsg());
|
|
|
|
|
|
}
|
2018-05-25 13:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|