(1)修复特定服务新增时无法选择上级节点的bug

(2)特定服务加入验证,当前节点的配置类型应当与上级配置一致
This commit is contained in:
wangxin
2018-07-25 15:19:24 +08:00
parent 4e0be5b70b
commit 76b7122c21
13 changed files with 68 additions and 13 deletions

View File

@@ -25,11 +25,18 @@ public class SpecificServiceCfg extends BaseEntity<SpecificServiceCfg>{
private SpecificServiceCfg parent; //parent_id 父节点id int N 0表示一级节点
private Integer isLeaf; //is_leaf 是否是叶子节点 int N 0否1是只有一级填0
private Integer groupId; //group_id maat端配置分组id int N 缺省0表示未与maat分组同步
private Integer cfgType;//配置类型1app;2,加密隧道协议
private Integer cfgType;//配置类型1app;2,加密隧道3基础协议
private Integer parentType;//父配置类型
private Date beginDate; // 开始日期
private Date endDate; // 结束日期
private String showSequence; //显示序号
public Integer getParentType() {
return parentType;
}
public void setParentType(Integer parentType) {
this.parentType = parentType;
}
public Integer getCfgType() {
return cfgType;
}

View File

@@ -129,6 +129,10 @@ public class SpecificServiceCfgController extends BaseController {
SpecificServiceCfg parent = new SpecificServiceCfg();
parent.setSpecServiceId(0);
specificServiceCfg.setParent(parent);
specificServiceCfg.setParentType(0);
}
if(specificServiceCfg!=null&&specificServiceCfg.getParent().getSpecServiceId()!=null){//获取父配置的id
specificServiceCfg.setParentType(specificServiceCfgService.getParentType(specificServiceCfg.getParent().getSpecServiceId()));
}
model.addAttribute("specificServiceCfg", specificServiceCfg);
if (doAction != null && doAction.equals("0")) {
@@ -195,6 +199,7 @@ public class SpecificServiceCfgController extends BaseController {
Map<String, Object> map2 = Maps.newHashMap();
map2.put("id", 0);
map2.put("pId", 0);
map2.put("type",0);
map2.put("name","root_node");
//map2.put("placeholder","0");
mapList.add(map2);
@@ -203,13 +208,15 @@ public class SpecificServiceCfgController extends BaseController {
SpecificServiceCfg specificServiceCfg = list.get(i);
if(StringUtils.isBlank(extId)||(extId!=null&&!extId.equals(specificServiceCfg.getSpecServiceId().toString()))){
if(specificServiceCfg.getIsValid().equals(0)||
(!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))||specificServiceCfg.getCfgType().intValue()!=cfgType){
(!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))||
(cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){
continue;
}
Map<String, Object> map = Maps.newHashMap();
map.put("id", specificServiceCfg.getSpecServiceId());
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("type",specificServiceCfg.getCfgType());
mapList.add(map);
}
}
@@ -230,6 +237,7 @@ public class SpecificServiceCfgController extends BaseController {
map.put("code", specificServiceCfg.getSpecServiceCode());
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("type",specificServiceCfg.getCfgType());
mapList.add(map);
}
}

View File

@@ -47,5 +47,6 @@ public interface SpecificServiceCfgDao extends CrudDao<SpecificServiceCfg> {
Integer insertConfigGroupInfo(ConfigGroupInfo entity);
Integer updateConfigGroupInfobyGroupId(ConfigGroupInfo entity);
Integer getParentType(Integer specServiceId);
}

View File

@@ -37,6 +37,10 @@
select <include refid="specificServiceCfgColumns" />
from specific_service_cfg s where s.spec_service_id = #{specServiceId}
</select>
<select id="getParentType" resultType="java.lang.Integer" parameterType="java.lang.Integer">
select cfg_type
from specific_service_cfg s where s.spec_service_id = #{specServiceId}
</select>
<!-- 查出所有符合条件的顶层数据 -->

View File

@@ -140,6 +140,8 @@ public class SpecificServiceCfgService extends BaseService{
return specificServiceCfgDao.getChildrenById(specServiceId);
}
public Integer getParentType(Integer specServiceId) {
return specificServiceCfgDao.getParentType(specServiceId);
}
}