Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
@@ -165,6 +165,25 @@ public class IpAddrPoolController extends BaseController{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验所有地址池配置IP不可重复
|
||||
* @param cfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/checkAddrPoolIp"})
|
||||
public boolean checkAddrPoolIp(String ips, HttpServletRequest request, HttpServletResponse response){
|
||||
for (String ip : ips.split(",")) {
|
||||
Long cfgId = ipAddrPoolCfgService.checkAddrPoolIp(ip);
|
||||
if(cfgId != null){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/getCGIInfo"})
|
||||
public Map<String,Object> getUserInfo(Integer addrPoolId,String cmd,HttpServletRequest request,HttpServletResponse response){
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.IpReuseIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
@@ -34,6 +35,8 @@ public interface IpAddrPoolCfgDao extends CrudDao<IpAddrPoolCfgDao>{
|
||||
|
||||
Long getAddrPoolIdByName(String addrPoolName);
|
||||
|
||||
Long checkAddrPoolIp(@Param("srcIpAddress")String ip);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -477,4 +477,13 @@
|
||||
WHERE
|
||||
r.addr_pool_name = #{addrPoolName} AND r.is_valid != -1
|
||||
</select>
|
||||
|
||||
<select id="checkAddrPoolIp" resultType="java.lang.Long">
|
||||
SELECT
|
||||
r.cfg_id
|
||||
FROM
|
||||
ip_reuse_ip_cfg r
|
||||
WHERE
|
||||
r.src_ip_address = #{srcIpAddress} AND r.is_valid != -1 AND r.is_audit != 3
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.IpReuseIpCfg;
|
||||
import com.nis.domain.callback.IpAddrPool;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||
@@ -286,5 +287,9 @@ public class IpAddrPoolCfgService extends BaseService{
|
||||
public List<IpAddrPoolCfg> getEffectiveAddrPool() {
|
||||
return ipAddrPoolCfgDao.findAddrPoolCfg();
|
||||
}
|
||||
|
||||
public Long checkAddrPoolIp(String ip) {
|
||||
return ipAddrPoolCfgDao.checkAddrPoolIp(ip);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user