Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
50
src/main/java/com/nis/domain/maat/EffectiveRangeCfg.java
Normal file
50
src/main/java/com/nis/domain/maat/EffectiveRangeCfg.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package com.nis.domain.maat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class EffectiveRangeCfg implements Serializable{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -4503782443649076836L;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("tag_sets")
|
||||||
|
private List<List<AreaIsp>> effectiveRangeList;
|
||||||
|
|
||||||
|
public List<List<AreaIsp>> getEffectiveRangeList() {
|
||||||
|
return effectiveRangeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEffectiveRangeList(List<List<AreaIsp>> effectiveRangeList) {
|
||||||
|
this.effectiveRangeList = effectiveRangeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class AreaIsp{
|
||||||
|
@Expose
|
||||||
|
private String tag;
|
||||||
|
@Expose
|
||||||
|
private List<String> value;
|
||||||
|
|
||||||
|
public String getTag() {
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
public void setTag(String tag) {
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
public List<String> getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
public void setValue(List<String> value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AreaIsp [tag=" + tag + ", value=" + value + "]";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,13 +12,14 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DateUtils;
|
import com.nis.util.DateUtils;
|
||||||
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.service.BaseService;
|
import com.nis.web.service.BaseService;
|
||||||
|
import com.nis.web.service.SpringContextHolder;
|
||||||
|
import com.nis.web.service.basics.SysDictInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: MaatCfg.java
|
* @ClassName: MaatCfg.java
|
||||||
@@ -543,8 +544,10 @@ public class MaatCfg implements Serializable {
|
|||||||
public void setAreaEffectiveIds(String areaEffectiveIds) {
|
public void setAreaEffectiveIds(String areaEffectiveIds) {
|
||||||
if(StringUtils.isEmpty(areaEffectiveIds)){
|
if(StringUtils.isEmpty(areaEffectiveIds)){
|
||||||
areaEffectiveIds="0";
|
areaEffectiveIds="0";
|
||||||
}else if(areaEffectiveIds.contains(":")){
|
}else {
|
||||||
areaEffectiveIds = areaEffectiveIds.replace(":", "");
|
// 组织区域、运营商配置下发格式
|
||||||
|
SysDictInfoService service = SpringContextHolder.getBean(SysDictInfoService.class);
|
||||||
|
areaEffectiveIds = service.setEffectiveRange(areaEffectiveIds);
|
||||||
}
|
}
|
||||||
this.areaEffectiveIds = areaEffectiveIds;
|
this.areaEffectiveIds = areaEffectiveIds;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -677,4 +677,8 @@ public final class Constants {
|
|||||||
public static final int HTTP_CONNECT_TIMEOUT= Configurations.getIntProperty("http_connect_timeout", 10000);
|
public static final int HTTP_CONNECT_TIMEOUT= Configurations.getIntProperty("http_connect_timeout", 10000);
|
||||||
public static final int HTTP_CONNECT_REQUEST_TIMEOUT = Configurations.getIntProperty("http_connect_request_timeout", 50000);
|
public static final int HTTP_CONNECT_REQUEST_TIMEOUT = Configurations.getIntProperty("http_connect_request_timeout", 50000);
|
||||||
public static final int HTTP_CONNECT_RETRY_TIMES = Configurations.getIntProperty("http_connect_retry_times", 3);
|
public static final int HTTP_CONNECT_RETRY_TIMES = Configurations.getIntProperty("http_connect_retry_times", 3);
|
||||||
|
|
||||||
|
// 区域/运营商配置下发时tag值
|
||||||
|
public static final String AREA_TAG=Configurations.getStringProperty("area_tag","location");
|
||||||
|
public static final String ISP_TAG=Configurations.getStringProperty("isp_tag","isp");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -503,4 +503,18 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String revertStr(String str,String regex){
|
||||||
|
String[] split = str.split(regex);
|
||||||
|
String value = "";
|
||||||
|
for (int i = split.length-1; i >= 0 ; i--) {
|
||||||
|
if( i != 0) {
|
||||||
|
value += split[i]+"/";
|
||||||
|
}else {
|
||||||
|
value += split[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -678,8 +678,19 @@ public class BaseController {
|
|||||||
}else{
|
}else{
|
||||||
// 判断是否是从配置界面过来的日志查询
|
// 判断是否是从配置界面过来的日志查询
|
||||||
if(StringUtils.isNotBlank(entry.getIsLogTotalSearch())) {
|
if(StringUtils.isNotBlank(entry.getIsLogTotalSearch())) {
|
||||||
|
Calendar time = Calendar.getInstance();
|
||||||
|
time.add(Calendar.MINUTE, -5);
|
||||||
|
String searchEndTime = DateUtils.formatDateTime(time.getTime());
|
||||||
|
params.put("searchFoundEndTime",searchEndTime);
|
||||||
|
entry.setSearchFoundEndTime(searchEndTime);
|
||||||
|
|
||||||
|
time.add(Calendar.MINUTE, -5);
|
||||||
|
String searchStartTime = DateUtils.formatDateTime(time.getTime());
|
||||||
|
params.put("searchFoundStartTime", searchStartTime);
|
||||||
|
entry.setSearchFoundStartTime(searchStartTime);
|
||||||
|
|
||||||
// 判断startTime是否有值
|
// 判断startTime是否有值
|
||||||
if(StringUtils.isNotBlank(Constants.LOG_TIME_START)) {
|
/*if(StringUtils.isNotBlank(Constants.LOG_TIME_START)) {
|
||||||
String endTime = Constants.LOG_TIME_END;
|
String endTime = Constants.LOG_TIME_END;
|
||||||
if(StringUtils.isBlank(endTime)) {
|
if(StringUtils.isBlank(endTime)) {
|
||||||
endTime = DateUtils.getDateTime();
|
endTime = DateUtils.getDateTime();
|
||||||
@@ -717,7 +728,7 @@ public class BaseController {
|
|||||||
params.put("searchFoundEndTime",searchEndTime);
|
params.put("searchFoundEndTime",searchEndTime);
|
||||||
entry.setSearchFoundStartTime(searchStartTime);
|
entry.setSearchFoundStartTime(searchStartTime);
|
||||||
entry.setSearchFoundEndTime(searchEndTime);
|
entry.setSearchFoundEndTime(searchEndTime);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
//设置默认查询当前时间及前五分钟
|
//设置默认查询当前时间及前五分钟
|
||||||
|
|||||||
@@ -120,9 +120,9 @@ public class AsnIpController extends BaseController{
|
|||||||
}
|
}
|
||||||
@RequestMapping(value="ajaxIsLast",method=RequestMethod.POST)
|
@RequestMapping(value="ajaxIsLast",method=RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public boolean ajaxIsLast(Model model,@RequestParam(required=true,value="serviceGroupIds")String serviceGroupIds){
|
public boolean ajaxIsLast(Model model,@RequestParam(required=true,value="serviceGroupIds")String serviceGroupIds,@RequestParam(required=true,value="ids")String ids){
|
||||||
if(StringUtils.isNotBlank(serviceGroupIds)) {
|
if(StringUtils.isNotBlank(serviceGroupIds)&&StringUtils.isNotBlank(ids)) {
|
||||||
return asnIpCfgService.hasLastIp(serviceGroupIds);
|
return asnIpCfgService.hasLastIp(serviceGroupIds,ids);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
|||||||
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
||||||
public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
||||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||||
public List<Integer> countValidIPs(@Param("ids")String ids);
|
public List<Integer> countValidIPs(@Param("groups")String groups,@Param("ids")String ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,7 +387,7 @@
|
|||||||
select 1 from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${ids}) limit 1
|
select 1 from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${ids}) limit 1
|
||||||
</select>
|
</select>
|
||||||
<select id="countValidIPs" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
<select id="countValidIPs" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||||
select count(1) from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${ids}) GROUP BY asn_ip_group;
|
select count(1) from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${groups}) and cfg_id not in(${ids}) GROUP BY asn_ip_group;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -85,9 +85,9 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
|
|||||||
*/
|
*/
|
||||||
List<SysDictInfo> getDistrictDict(String itemCode);
|
List<SysDictInfo> getDistrictDict(String itemCode);
|
||||||
|
|
||||||
|
List<SysDictInfo> getEffectiveArea(String itemCode);
|
||||||
|
|
||||||
|
SysDictInfo getDictByItemCode(String itemCode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -263,4 +263,22 @@
|
|||||||
FROM sys_dict_info s
|
FROM sys_dict_info s
|
||||||
WHERE s.is_valid = 1 AND item_type = 3 AND item_code like concat(#{itemCode,jdbcType=VARCHAR},'%')
|
WHERE s.is_valid = 1 AND item_type = 3 AND item_code like concat(#{itemCode,jdbcType=VARCHAR},'%')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getEffectiveArea" parameterType="java.lang.String" resultType="com.nis.domain.basics.SysDictInfo">
|
||||||
|
SELECT
|
||||||
|
<include refid="sysDictInfoColumns"/>
|
||||||
|
FROM
|
||||||
|
sys_dict_info s
|
||||||
|
WHERE
|
||||||
|
s.is_valid = 1 AND s.item_code = #{itemCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDictByItemCode" resultType="com.nis.domain.basics.SysDictInfo">
|
||||||
|
select
|
||||||
|
<include refid="sysDictInfoColumns"/>
|
||||||
|
from
|
||||||
|
sys_dict_info s
|
||||||
|
where
|
||||||
|
s.is_valid = 1 AND s.item_code = #{itemCode}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -178,14 +178,17 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
* @param serviceGroupIds
|
* @param serviceGroupIds
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean hasLastIp(String serviceGroupIds) {
|
public boolean hasLastIp(String serviceGroupIds,String ids) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
for(String groupId:serviceGroupIds.split(",")) {
|
for(String groupId:serviceGroupIds.split(",")) {
|
||||||
Long.parseLong(groupId);
|
Long.parseLong(groupId);
|
||||||
}
|
}
|
||||||
List<Integer> countList=asnIpCfgDao.countValidIPs(serviceGroupIds);
|
List<Integer> countList=asnIpCfgDao.countValidIPs(serviceGroupIds,ids);
|
||||||
|
if(countList.size()==0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for(Integer count:countList) {
|
for(Integer count:countList) {
|
||||||
if(count==1) {
|
if(count==0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.nis.web.service.basics;
|
package com.nis.web.service.basics;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -11,9 +12,13 @@ import com.google.common.collect.Lists;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.SysUser;
|
import com.nis.domain.SysUser;
|
||||||
import com.nis.domain.basics.SysDictInfo;
|
import com.nis.domain.basics.SysDictInfo;
|
||||||
|
import com.nis.domain.maat.EffectiveRangeCfg;
|
||||||
|
import com.nis.domain.maat.EffectiveRangeCfg.AreaIsp;
|
||||||
import com.nis.util.ConfigDictUtils;
|
import com.nis.util.ConfigDictUtils;
|
||||||
import com.nis.util.Configurations;
|
import com.nis.util.Configurations;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||||
import com.nis.web.security.UserUtils;
|
import com.nis.web.security.UserUtils;
|
||||||
import com.nis.web.service.BaseService;
|
import com.nis.web.service.BaseService;
|
||||||
@@ -22,7 +27,7 @@ import com.nis.web.service.BaseService;
|
|||||||
public class SysDictInfoService extends BaseService{
|
public class SysDictInfoService extends BaseService{
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDictInfoDao sysDictInfoDao;
|
private SysDictInfoDao sysDictInfoDao;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -216,17 +221,82 @@ public class SysDictInfoService extends BaseService{
|
|||||||
public List<SysDictInfo> getDistrictDict(String tableName){
|
public List<SysDictInfo> getDistrictDict(String tableName){
|
||||||
return sysDictInfoDao.getDistrictDict(tableName);
|
return sysDictInfoDao.getDistrictDict(tableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 组织区域、运营商配置下发格式
|
||||||
|
public String setEffectiveRange(String areaEffectiveIds){
|
||||||
|
EffectiveRangeCfg rangeCfg = new EffectiveRangeCfg();
|
||||||
|
List<AreaIsp> areaIspList = new ArrayList();
|
||||||
|
|
||||||
|
List<String> locaValueList = new ArrayList();
|
||||||
|
List<String> ispValueList = new ArrayList();
|
||||||
|
|
||||||
|
for (String areaEffectiveId : StringUtils.split(areaEffectiveIds, ",")) {
|
||||||
|
String area = "";
|
||||||
|
// 区域和运营商
|
||||||
|
if(areaEffectiveId.contains(":")) {
|
||||||
|
int index = areaEffectiveId.indexOf(":");
|
||||||
|
String areaCode = areaEffectiveId.substring(0, index);
|
||||||
|
String ispCode = areaEffectiveId.substring(index+1);
|
||||||
|
// 查询该区域信息及其所有父节点信息
|
||||||
|
List<SysDictInfo> list = sysDictInfoDao.getEffectiveArea(areaCode);
|
||||||
|
for (SysDictInfo sysDictInfo : list) {
|
||||||
|
area += sysDictInfo.getItemValue();
|
||||||
|
while(sysDictInfo.getParent().getSysDictId() != 0) {
|
||||||
|
sysDictInfo = sysDictInfoDao.getDictById(sysDictInfo.getParent().getSysDictId());
|
||||||
|
area += "/"+sysDictInfo.getItemValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String areaItemValue = StringUtils.revertStr(area, "/");
|
||||||
|
if(!locaValueList.contains(areaItemValue)) {
|
||||||
|
locaValueList.add(areaItemValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询运营商信息
|
||||||
|
SysDictInfo isp = sysDictInfoDao.getDictByItemCode(ispCode);
|
||||||
|
if(!ispValueList.contains(isp.getItemValue())) {
|
||||||
|
ispValueList.add(isp.getItemValue());
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
// 区域或运营商
|
||||||
|
SysDictInfo dict = sysDictInfoDao.getDictByItemCode(areaEffectiveId);
|
||||||
|
if(dict.getItemType() == 1) {
|
||||||
|
// 查询所有父节点区域信息
|
||||||
|
area += dict.getItemValue();
|
||||||
|
while(dict.getParent().getSysDictId() != 0) {
|
||||||
|
dict = sysDictInfoDao.getDictById(dict.getParent().getSysDictId());
|
||||||
|
area += "/"+dict.getItemValue();
|
||||||
|
}
|
||||||
|
String areaItemValue = StringUtils.revertStr(area, "/");
|
||||||
|
if(!locaValueList.contains(areaItemValue)) {
|
||||||
|
locaValueList.add(areaItemValue);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(!ispValueList.contains(dict.getItemValue())) {
|
||||||
|
ispValueList.add(dict.getItemValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(locaValueList.size() > 0) {
|
||||||
|
AreaIsp area = new AreaIsp();
|
||||||
|
area.setTag(Constants.AREA_TAG);
|
||||||
|
area.setValue(locaValueList);
|
||||||
|
areaIspList.add(area);
|
||||||
|
}
|
||||||
|
if(ispValueList.size() > 0) {
|
||||||
|
AreaIsp isp = new AreaIsp();
|
||||||
|
isp.setTag(Constants.ISP_TAG);
|
||||||
|
isp.setValue(ispValueList);
|
||||||
|
areaIspList.add(isp);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<List<AreaIsp>> effectiveRangeList = new ArrayList();
|
||||||
|
effectiveRangeList.add(areaIspList);
|
||||||
|
rangeCfg.setEffectiveRangeList(effectiveRangeList);
|
||||||
|
return gsonToJson(rangeCfg);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -521,4 +521,6 @@ app_spec_service_code_min_val=300001
|
|||||||
groupReuseSources=groupReuseSources
|
groupReuseSources=groupReuseSources
|
||||||
log_time_range=3600000
|
log_time_range=3600000
|
||||||
log_time_start=2018-08-01 00:00:00
|
log_time_start=2018-08-01 00:00:00
|
||||||
log_time_end=2018-10-01 00:00:00
|
log_time_end=2018-10-01 00:00:00
|
||||||
|
area_tag=location
|
||||||
|
isp_tag=isp
|
||||||
@@ -1,283 +1,286 @@
|
|||||||
<%@ tag language="java" pageEncoding="UTF-8"%>
|
<%@ tag language="java" pageEncoding="UTF-8"%>
|
||||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
<%@ attribute name="id" type="java.lang.String" required="true"%>
|
<%@ attribute name="id" type="java.lang.String" required="true"%>
|
||||||
<%@ attribute name="url" type="java.lang.String" required="true"%>
|
<%@ attribute name="url" type="java.lang.String" required="true"%>
|
||||||
<%@ attribute name="label" type="java.lang.String" required="false"%>
|
<%@ attribute name="label" type="java.lang.String" required="false"%>
|
||||||
<%@ attribute name="maxRow" type="java.lang.Long" required="false"%>
|
<%@ attribute name="maxRow" type="java.lang.Long" required="false"%>
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${label eq 'delete'}">
|
<c:when test="${label eq 'delete'}">
|
||||||
<a href="javascript:void(0);" class="btn btn-default" onclick="del('${url}')" data-toggle="tooltip" data-placement="top">
|
<a href="javascript:void(0);" class="btn btn-default" onclick="del('${url}')" data-toggle="tooltip" data-placement="top">
|
||||||
<i class="fa fa-trash"> <spring:message code="delete"/></i>
|
<i class="fa fa-trash"> <spring:message code="delete"/></i>
|
||||||
</a>
|
</a>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:when test="${label eq 'update'}">
|
<c:when test="${label eq 'update'}">
|
||||||
<a href="javascript:void(0);" onclick="update('${url}')" class="btn btn-default" data-toggle="tooltip" data-placement="top">
|
<a href="javascript:void(0);" onclick="update('${url}')" class="btn btn-default" data-toggle="tooltip" data-placement="top">
|
||||||
<i class="fa fa-check"></i> <spring:message code="edit"/>
|
<i class="fa fa-check"></i> <spring:message code="edit"/>
|
||||||
</a>
|
</a>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:when test="${label eq 'approved'}">
|
<c:when test="${label eq 'approved'}">
|
||||||
<a href="javascript:void(0);" onclick="passOpt('${url}')"><i class="fa fa-check"></i> <spring:message code="approved"/></a>
|
<a href="javascript:void(0);" onclick="passOpt('${url}')"><i class="fa fa-check"></i> <spring:message code="approved"/></a>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:when test="${label eq 'unapproved'}">
|
<c:when test="${label eq 'unapproved'}">
|
||||||
<a href="javascript:void(0);" onclick="noPassOpt('${url}')"><i class="fa fa-remove"></i> <spring:message code="unapproved"/></a>
|
<a href="javascript:void(0);" onclick="noPassOpt('${url}')"><i class="fa fa-remove"></i> <spring:message code="unapproved"/></a>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:when test="${label eq 'cancelPass'}">
|
<c:when test="${label eq 'cancelPass'}">
|
||||||
<a href="javascript:void(0);" onclick="cancelPassOpt('${url}')"><i class="fa fa-undo"></i> <spring:message code="cancel_approved"/></a>
|
<a href="javascript:void(0);" onclick="cancelPassOpt('${url}')"><i class="fa fa-undo"></i> <spring:message code="cancel_approved"/></a>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:when test="${label eq 'export'}">
|
<c:when test="${label eq 'export'}">
|
||||||
<a href="javascript:void(0);" class="btn btn-default" onclick="exportData('${url}',${maxRow })" data-toggle="tooltip" data-placement="top">
|
<a href="javascript:void(0);" class="btn btn-default" onclick="exportData('${url}',${maxRow })" data-toggle="tooltip" data-placement="top">
|
||||||
<i class="fa fa-download"> <spring:message code="export"/></i>
|
<i class="fa fa-download"> <spring:message code="export"/></i>
|
||||||
</a>
|
</a>
|
||||||
</c:when>
|
</c:when>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
<%-- 使用方法: 1.将本tag写在查询的form之前;2.传入table的id和controller的url --%>
|
<%-- 使用方法: 1.将本tag写在查询的form之前;2.传入table的id和controller的url --%>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#${id} thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
|
$('#${id} thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
|
||||||
$('#${id} tbody tr td input.i-checks').iCheck('check');
|
$('#${id} tbody tr td input.i-checks').iCheck('check');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#${id} thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
|
$('#${id} thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
|
||||||
$('#${id} tbody tr td input.i-checks').iCheck('uncheck');
|
$('#${id} tbody tr td input.i-checks').iCheck('uncheck');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
//删除
|
//删除
|
||||||
function del(url){
|
function del(url){
|
||||||
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||||
|
|
||||||
if($(checkboxes).filter(":checked").length>0){
|
if($(checkboxes).filter(":checked").length>0){
|
||||||
if(validateAllNoAudit(checkboxes)){
|
if(validateAllNoAudit(checkboxes)){
|
||||||
top.$.jBox.tip("<spring:message code='has_prohibit_delete'/>", "<spring:message code='info'/>");
|
top.$.jBox.tip("<spring:message code='has_prohibit_delete'/>", "<spring:message code='info'/>");
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
var serviceGroupIds=[],canDel=true;
|
var serviceGroupIds=[],ids=[],canDel=true;
|
||||||
$(checkboxes).filter(":checked").each(function(){
|
$(checkboxes).filter(":checked").each(function(){
|
||||||
if($(this).attr("serviceGroupId")){
|
if($(this).attr("serviceGroupId")&&$(this).attr("isValid")){
|
||||||
serviceGroupIds.push($(this).attr("serviceGroupId"));
|
if($(this).attr("isValid")==1){//下发过的组的ip才需要判断是否是组内最后一个IP
|
||||||
}
|
serviceGroupIds.push($(this).attr("serviceGroupId"));
|
||||||
})
|
}
|
||||||
if(serviceGroupIds.length>0){
|
ids.push($(this).attr("id"));
|
||||||
$.ajax({
|
}
|
||||||
type:'post',
|
})
|
||||||
url:'${ctx}/basics/asn/ajaxIsLast',
|
if(serviceGroupIds.length>0){
|
||||||
data:{"serviceGroupIds":serviceGroupIds.join(',')},
|
$.ajax({
|
||||||
async:false,
|
type:'post',
|
||||||
success:function(data,textStatus){//处理返回结果
|
url:'${ctx}/basics/asn/ajaxIsLast',
|
||||||
if(data){
|
data:{"serviceGroupIds":serviceGroupIds.join(','),"ids":ids.join(',')},
|
||||||
top.$.jBox.tip('<spring:message code="last_ip_in_asn_group"/>');
|
async:false,
|
||||||
canDel=false;
|
success:function(data,textStatus){//处理返回结果
|
||||||
}
|
if(data){
|
||||||
}
|
top.$.jBox.tip('<spring:message code="last_ip_in_asn_group"/>');
|
||||||
});
|
canDel=false;
|
||||||
}
|
}
|
||||||
if(canDel){
|
}
|
||||||
doAll(checkboxes,url);
|
});
|
||||||
}
|
}
|
||||||
}
|
if(canDel){
|
||||||
}else{
|
doAll(checkboxes,url);
|
||||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
}
|
||||||
return;
|
}
|
||||||
}
|
}else{
|
||||||
}
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||||
//修改配置
|
return;
|
||||||
function update(url){
|
}
|
||||||
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
}
|
||||||
var cked = $("tbody tr td input.i-checks:checkbox:checked");
|
//修改配置
|
||||||
if($(checkboxes).filter(":checked").length==1){
|
function update(url){
|
||||||
if(cked.val()==1){
|
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
var cked = $("tbody tr td input.i-checks:checkbox:checked");
|
||||||
return;
|
if($(checkboxes).filter(":checked").length==1){
|
||||||
}else if(cked.val()==3){
|
if(cked.val()==1){
|
||||||
top.$.jBox.tip("<spring:message code='cancel_approved'/>", "<spring:message code='info'/>");
|
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||||
return;
|
return;
|
||||||
}
|
}else if(cked.val()==3){
|
||||||
//处理asnIp,asn组下发过的ip配置不允许修改
|
top.$.jBox.tip("<spring:message code='cancel_approved'/>", "<spring:message code='info'/>");
|
||||||
if(cked.attr("serviceGroupId")&&cked.attr("isValid")){
|
return;
|
||||||
var serviceGroupId=cked.attr("serviceGroupId");
|
}
|
||||||
var _isValid=cked.attr("isValid");
|
//处理asnIp,asn组下发过的ip配置不允许修改
|
||||||
if(_isValid==1){
|
if(cked.attr("serviceGroupId")&&cked.attr("isValid")){
|
||||||
top.$.jBox.tip("<spring:message code='can_not_edit_issued_ans_ip'/>", "<spring:message code='info'/>");
|
var serviceGroupId=cked.attr("serviceGroupId");
|
||||||
return;
|
var _isValid=cked.attr("isValid");
|
||||||
}
|
if(_isValid==1){
|
||||||
}
|
top.$.jBox.tip("<spring:message code='can_not_edit_issued_ans_ip'/>", "<spring:message code='info'/>");
|
||||||
doAll(checkboxes,url);
|
return;
|
||||||
}else{
|
}
|
||||||
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
}
|
||||||
return;
|
doAll(checkboxes,url);
|
||||||
}
|
}else{
|
||||||
}
|
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||||
//通过
|
return;
|
||||||
function passOpt(url){
|
}
|
||||||
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
}
|
||||||
|
//通过
|
||||||
if($(checkboxes).filter(":checked").length>0){
|
function passOpt(url){
|
||||||
if(validateAllNoAudit(checkboxes)){
|
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||||
top.$.jBox.tip("<spring:message code='has_prohibit_pass'/>", "<spring:message code='info'/>");
|
|
||||||
return;
|
if($(checkboxes).filter(":checked").length>0){
|
||||||
}else{
|
if(validateAllNoAudit(checkboxes)){
|
||||||
doAll(checkboxes,url);
|
top.$.jBox.tip("<spring:message code='has_prohibit_pass'/>", "<spring:message code='info'/>");
|
||||||
}
|
return;
|
||||||
}else{
|
}else{
|
||||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
doAll(checkboxes,url);
|
||||||
return;
|
}
|
||||||
}
|
}else{
|
||||||
}
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||||
//未通过
|
return;
|
||||||
function noPassOpt(url){
|
}
|
||||||
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
}
|
||||||
|
//未通过
|
||||||
if($(checkboxes).filter(":checked").length>0){
|
function noPassOpt(url){
|
||||||
if(validateAllNoAudit(checkboxes)){
|
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||||
top.$.jBox.tip("<spring:message code='has_prohibit_nopass'/>", "<spring:message code='info'/>");
|
|
||||||
return;
|
if($(checkboxes).filter(":checked").length>0){
|
||||||
}else{
|
if(validateAllNoAudit(checkboxes)){
|
||||||
doAll(checkboxes,url);
|
top.$.jBox.tip("<spring:message code='has_prohibit_nopass'/>", "<spring:message code='info'/>");
|
||||||
}
|
return;
|
||||||
}else{
|
}else{
|
||||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
doAll(checkboxes,url);
|
||||||
return;
|
}
|
||||||
}
|
}else{
|
||||||
}
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||||
//配置取消
|
return;
|
||||||
function cancelPassOpt(url){
|
}
|
||||||
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
}
|
||||||
|
//配置取消
|
||||||
if($(checkboxes).filter(":checked").length>0){
|
function cancelPassOpt(url){
|
||||||
if(validateAllPass(checkboxes)){
|
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||||
doAll(checkboxes,url);
|
|
||||||
}else{
|
if($(checkboxes).filter(":checked").length>0){
|
||||||
top.$.jBox.tip("<spring:message code='hasnot_approved'/>", "<spring:message code='info'/>");
|
if(validateAllPass(checkboxes)){
|
||||||
return;
|
doAll(checkboxes,url);
|
||||||
}
|
}else{
|
||||||
}else{
|
top.$.jBox.tip("<spring:message code='hasnot_approved'/>", "<spring:message code='info'/>");
|
||||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
}else{
|
||||||
}
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||||
function doAll(checkboxes,url){
|
return;
|
||||||
// var url = $(this).attr('data-url');
|
}
|
||||||
var str="";
|
}
|
||||||
var compileIdStr="";
|
function doAll(checkboxes,url){
|
||||||
var ids="";
|
// var url = $(this).attr('data-url');
|
||||||
var compileIds="";
|
var str="";
|
||||||
var flag=false;//是否删除的为但是响应策略的无策略配置
|
var compileIdStr="";
|
||||||
checkboxes.each(function(){
|
var ids="";
|
||||||
if(true == $(this).is(':checked')){
|
var compileIds="";
|
||||||
var id=$(this).attr("id");
|
var flag=false;//是否删除的为但是响应策略的无策略配置
|
||||||
var serviceId=$(this).attr("id");
|
checkboxes.each(function(){
|
||||||
if($(this).attr("serviceId")){
|
if(true == $(this).is(':checked')){
|
||||||
serviceId=$(this).attr("serviceId");
|
var id=$(this).attr("id");
|
||||||
}
|
var serviceId=$(this).attr("id");
|
||||||
if(serviceId == 65 && id==0){
|
if($(this).attr("serviceId")){
|
||||||
flag=true;
|
serviceId=$(this).attr("serviceId");
|
||||||
}
|
}
|
||||||
str+=$(this).attr("id")+",";
|
if(serviceId == 65 && id==0){
|
||||||
if($(this).attr("compileId")){
|
flag=true;
|
||||||
compileIdStr +=$(this).attr("compileId")+",";
|
}
|
||||||
}
|
str+=$(this).attr("id")+",";
|
||||||
}
|
if($(this).attr("compileId")){
|
||||||
});
|
compileIdStr +=$(this).attr("compileId")+",";
|
||||||
|
}
|
||||||
|
}
|
||||||
if(flag && url.indexOf("?isAudit=3") > 1){
|
});
|
||||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
|
||||||
return;
|
|
||||||
}
|
if(flag && url.indexOf("?isAudit=3") > 1){
|
||||||
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||||
if(str.substr(str.length-1)== ','){
|
return;
|
||||||
ids = str.substr(0,str.length-1);
|
}
|
||||||
}
|
|
||||||
if(compileIdStr.substr(compileIdStr.length-1)== ','){
|
if(str.substr(str.length-1)== ','){
|
||||||
compileIds = compileIdStr.substr(0,compileIdStr.length-1);
|
ids = str.substr(0,str.length-1);
|
||||||
}
|
}
|
||||||
if(ids == ""){
|
if(compileIdStr.substr(compileIdStr.length-1)== ','){
|
||||||
//top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
|
compileIds = compileIdStr.substr(0,compileIdStr.length-1);
|
||||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
}
|
||||||
return;
|
if(ids == ""){
|
||||||
}
|
//top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
|
||||||
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||||
|
return;
|
||||||
if(v=="ok"){
|
}
|
||||||
if(url.indexOf("?")>0){
|
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||||
window.location = url+"&ids="+ids+"&compileIds="+compileIds;
|
|
||||||
}else{
|
if(v=="ok"){
|
||||||
window.location = url+"?ids="+ids+"&compileIds="+compileIds;
|
if(url.indexOf("?")>0){
|
||||||
}
|
window.location = url+"&ids="+ids+"&compileIds="+compileIds;
|
||||||
if(url.indexOf("?isAudit") > 1){
|
}else{
|
||||||
loading('<spring:message code="onloading"/>');
|
window.location = url+"?ids="+ids+"&compileIds="+compileIds;
|
||||||
}else if(url.indexOf("export") > 1){
|
}
|
||||||
closeTip();
|
if(url.indexOf("?isAudit") > 1){
|
||||||
}
|
loading('<spring:message code="onloading"/>');
|
||||||
//$("#searchForm").submit();
|
}else if(url.indexOf("export") > 1){
|
||||||
}
|
closeTip();
|
||||||
},{buttonsFocus:1});
|
}
|
||||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
//$("#searchForm").submit();
|
||||||
|
}
|
||||||
}
|
},{buttonsFocus:1});
|
||||||
//验证选择的配置,是否可删除或者审核未通过或者审核通过,只有未审核的配置可删除或审核未通过或审核通过
|
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||||
function validateAllNoAudit(checkboxes){
|
|
||||||
var flag = false;
|
}
|
||||||
$(checkboxes).filter(":checked").each(function(){
|
//验证选择的配置,是否可删除或者审核未通过或者审核通过,只有未审核的配置可删除或审核未通过或审核通过
|
||||||
if($(this).val()!=0){
|
function validateAllNoAudit(checkboxes){
|
||||||
flag = true;
|
var flag = false;
|
||||||
return;
|
$(checkboxes).filter(":checked").each(function(){
|
||||||
}
|
if($(this).val()!=0){
|
||||||
});
|
flag = true;
|
||||||
return flag;
|
return;
|
||||||
}
|
}
|
||||||
//验证选择的配置,是否有审核通过的
|
});
|
||||||
function validatePass(checkboxes){
|
return flag;
|
||||||
var flag = false;
|
}
|
||||||
$(checkboxes).filter(":checked").each(function(){
|
//验证选择的配置,是否有审核通过的
|
||||||
if($(this).val()==1){
|
function validatePass(checkboxes){
|
||||||
flag = true;
|
var flag = false;
|
||||||
return;
|
$(checkboxes).filter(":checked").each(function(){
|
||||||
}
|
if($(this).val()==1){
|
||||||
});
|
flag = true;
|
||||||
return flag;
|
return;
|
||||||
}
|
}
|
||||||
//验证选择的配置,是否全部为审核通过的
|
});
|
||||||
function validateAllPass(checkboxes){
|
return flag;
|
||||||
var flag = true;
|
}
|
||||||
$(checkboxes).filter(":checked").each(function(){
|
//验证选择的配置,是否全部为审核通过的
|
||||||
if($(this).val()!=1){
|
function validateAllPass(checkboxes){
|
||||||
flag = false;
|
var flag = true;
|
||||||
return;
|
$(checkboxes).filter(":checked").each(function(){
|
||||||
}
|
if($(this).val()!=1){
|
||||||
});
|
flag = false;
|
||||||
return flag;
|
return;
|
||||||
}
|
}
|
||||||
//删除
|
});
|
||||||
function exportData(url,maxRow){
|
return flag;
|
||||||
var column=[];
|
}
|
||||||
$("#${id} ${value} thead tr th").each(function(){
|
//删除
|
||||||
if($(this).attr("exportColumn")){
|
function exportData(url,maxRow){
|
||||||
column.push($(this).attr("exportColumn"));
|
var column=[];
|
||||||
}
|
$("#${id} ${value} thead tr th").each(function(){
|
||||||
});
|
if($(this).attr("exportColumn")){
|
||||||
if(column){
|
column.push($(this).attr("exportColumn"));
|
||||||
url+="&columns="+column.toString();
|
}
|
||||||
}
|
});
|
||||||
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
if(column){
|
||||||
//导出选中数据
|
url+="&columns="+column.toString();
|
||||||
if($(checkboxes).filter(":checked").length>0){
|
}
|
||||||
doAll(checkboxes,url);
|
var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||||
//导出检索条件下所有数据
|
//导出选中数据
|
||||||
}else{
|
if($(checkboxes).filter(":checked").length>0){
|
||||||
if($("#showTotalCount").html().trim() > maxRow){
|
doAll(checkboxes,url);
|
||||||
top.$.jBox.confirm("<spring:message code='export_confirm_message'/>"+maxRow+"!","<spring:message code='info'/>",function(v,h,f){
|
//导出检索条件下所有数据
|
||||||
if(v=="ok"){
|
}else{
|
||||||
$("#searchForm").attr("action",url);
|
if($("#showTotalCount").html().trim() > maxRow){
|
||||||
$("#searchForm").submit();
|
top.$.jBox.confirm("<spring:message code='export_confirm_message'/>"+maxRow+"!","<spring:message code='info'/>",function(v,h,f){
|
||||||
closeTip();
|
if(v=="ok"){
|
||||||
}
|
$("#searchForm").attr("action",url);
|
||||||
},{buttonsFocus:1});
|
$("#searchForm").submit();
|
||||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
closeTip();
|
||||||
}else{
|
}
|
||||||
$("#searchForm").attr("action",url);
|
},{buttonsFocus:1});
|
||||||
$("#searchForm").submit();
|
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||||
closeTip();
|
}else{
|
||||||
}
|
$("#searchForm").attr("action",url);
|
||||||
}
|
$("#searchForm").submit();
|
||||||
}
|
closeTip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user