修复DSNIP提交/删除的bug
This commit is contained in:
@@ -2,11 +2,17 @@ package com.nis.domain.maat;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class DnsIpRecvData implements Serializable {
|
public class DnsIpRecvData implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3438469380427993582L;
|
private static final long serialVersionUID = -3438469380427993582L;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("cfgId")
|
||||||
private Long cfgId;
|
private Long cfgId;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("fakeId")
|
||||||
private Integer fakeId;
|
private Integer fakeId;
|
||||||
|
|
||||||
public Long getCfgId() {
|
public Long getCfgId() {
|
||||||
|
|||||||
@@ -3,10 +3,14 @@ package com.nis.domain.maat;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class FromMaatBean implements Serializable {
|
public class FromMaatBean implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1277140754421705676L;
|
private static final long serialVersionUID = 1277140754421705676L;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("data")
|
||||||
private List<DnsIpRecvData> data;
|
private List<DnsIpRecvData> data;
|
||||||
|
|
||||||
public List<DnsIpRecvData> getData() {
|
public List<DnsIpRecvData> getData() {
|
||||||
|
|||||||
@@ -116,6 +116,9 @@
|
|||||||
#{isValid}, #{isAudit}, #{creator.id}, #{createTime}, #{request.id}, #{fakeId},
|
#{isValid}, #{isAudit}, #{creator.id}, #{createTime}, #{request.id}, #{fakeId},
|
||||||
#{classify}, #{attribute}, #{lable}
|
#{classify}, #{attribute}, #{lable}
|
||||||
)
|
)
|
||||||
|
<selectKey keyProperty="cfgId" resultType="java.lang.Long">
|
||||||
|
select LAST_INSERT_ID() as cfg_id
|
||||||
|
</selectKey>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="update">
|
<update id="update">
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ package com.nis.web.service.configuration;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
@@ -22,6 +24,7 @@ import com.nis.web.service.CrudService;
|
|||||||
public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
|
public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void save(DnsIpCfg dnsIpCfg) {
|
public void save(DnsIpCfg dnsIpCfg) {
|
||||||
dao.insert(dnsIpCfg);
|
dao.insert(dnsIpCfg);
|
||||||
|
|
||||||
@@ -48,7 +51,7 @@ public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
|
|||||||
throw new RuntimeException("欺骗ip配置新增下发失败:通讯异常");
|
throw new RuntimeException("欺骗ip配置新增下发失败:通讯异常");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!StringUtil.isEmpty(recvJson)) {
|
if (StringUtils.isBlank(recvJson)) {
|
||||||
logger.error("新增欺骗ip配置失败:收到空的返回结果,cfgId:" + dnsIpCfg.getCfgId());
|
logger.error("新增欺骗ip配置失败:收到空的返回结果,cfgId:" + dnsIpCfg.getCfgId());
|
||||||
throw new RuntimeException("新增欺骗ip配置失败:收到空的返回结果");
|
throw new RuntimeException("新增欺骗ip配置失败:收到空的返回结果");
|
||||||
}
|
}
|
||||||
@@ -70,6 +73,7 @@ public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void delete(String cfgIds) {
|
public void delete(String cfgIds) {
|
||||||
|
if(cfgIds.endsWith(","))cfgIds=cfgIds.substring(0,cfgIds.lastIndexOf(","));
|
||||||
String[] cfgIdsArr = cfgIds.split(",");
|
String[] cfgIdsArr = cfgIds.split(",");
|
||||||
for (String cfgId : cfgIdsArr) {
|
for (String cfgId : cfgIdsArr) {
|
||||||
DnsIpCfg d = new DnsIpCfg();
|
DnsIpCfg d = new DnsIpCfg();
|
||||||
|
|||||||
Reference in New Issue
Block a user