(1)导入配置获取编译ID改为一次获取多个
(2)DNS IP导入修复 (3)DNS欺骗IP导入提交 (4)SNAT IP池模板提交
This commit is contained in:
@@ -5,12 +5,14 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.callback.InlineIp;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
@@ -43,6 +45,13 @@ public class DnsIpCfgService extends BaseService{
|
||||
public DnsIpCfg getDnsIpCfg(Long cfgId) {
|
||||
return dnsIpCfgDao.getDnsIpCfg(cfgId);
|
||||
}
|
||||
public void saveDnsIpCfg(List<BaseIpCfg> cfgs) {
|
||||
for(BaseIpCfg cfg:cfgs) {
|
||||
DnsIpCfg _cfg=new DnsIpCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg);
|
||||
saveOrUpdate(_cfg);
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdate(DnsIpCfg entity){
|
||||
Date createTime=new Date();
|
||||
@@ -54,20 +63,27 @@ public class DnsIpCfgService extends BaseService{
|
||||
entity.setCreateTime(createTime);
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
//调用服务接口获取compileId
|
||||
List<Integer> compileIds = new ArrayList<Integer>();
|
||||
try {
|
||||
compileIds = ConfigServiceUtil.getId(1,1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
if(entity.getCompileId()==null||entity.getCompileId()==0) {
|
||||
//调用服务接口获取compileId
|
||||
List<Integer> compileIds = new ArrayList<Integer>();
|
||||
try {
|
||||
compileIds = ConfigServiceUtil.getId(1,1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
||||
entity.setCompileId(compileIds.get(0));
|
||||
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
}
|
||||
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
||||
entity.setCompileId(compileIds.get(0));
|
||||
if(entity.getCompileId()!=null&&entity.getCompileId()>0) {
|
||||
dnsIpCfgDao.insert(entity);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
throw new RuntimeException("Could not get compileId!");
|
||||
}
|
||||
|
||||
//修改
|
||||
|
||||
Reference in New Issue
Block a user