特定服务增加业务类别
基础协议,app策略以及app特征点击选择时展示业务类别的树
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.nis.web.controller.specific;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -18,7 +20,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -198,9 +202,29 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
map2.put("id", 0);
|
||||
map2.put("pId", 0);
|
||||
map2.put("type",0);
|
||||
map2.put("business",-2);
|
||||
map2.put("name","root_node");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
Properties props=this.getMsgProp();
|
||||
List<SysDataDictionaryItem> businessTypeList=Lists.newArrayList();
|
||||
if(cfgType==1) {
|
||||
businessTypeList=DictUtils.getDictList("APP_BUSINESS_TYPE");
|
||||
}else if(cfgType==3) {
|
||||
businessTypeList=DictUtils.getDictList("BASIC_PROTOCOL_BUSINESS_TYPE");
|
||||
}
|
||||
List<Map<String, Object>> businessList = Lists.newArrayList();
|
||||
for(SysDataDictionaryItem dict:businessTypeList) {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", dict.getItemCode());
|
||||
map.put("pId", 0);
|
||||
map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue()));
|
||||
map.put("serviceType",cfgType);
|
||||
map.put("businessType",-1);
|
||||
map.put("nodes", new ArrayList<Map<String, Object>>());
|
||||
businessList.add(map);
|
||||
}
|
||||
mapList.addAll(businessList);
|
||||
List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),"");
|
||||
for (int i=0; i<list.size(); i++){
|
||||
SpecificServiceCfg specificServiceCfg = list.get(i);
|
||||
@@ -210,14 +234,57 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
(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);
|
||||
if(businessList.size()>0) {
|
||||
for(Map<String, Object> business:businessList) {
|
||||
if(String.valueOf(business.get("id")).equals(specificServiceCfg.getBusinessType())) {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", specificServiceCfg.getSpecServiceId());
|
||||
map.put("pId", business.get("id"));
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
map.put("serviceType",specificServiceCfg.getCfgType());
|
||||
map.put("businessType",specificServiceCfg.getBusinessType());
|
||||
mapList.add(map);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", specificServiceCfg.getSpecServiceId());
|
||||
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
map.put("serviceType",specificServiceCfg.getCfgType());
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),"");
|
||||
//
|
||||
// for (int i=0; i<list.size(); i++){
|
||||
// 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))||
|
||||
// (cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){
|
||||
// continue;
|
||||
// }
|
||||
// for(Map<String, Object> business:businessList) {
|
||||
// if(String.valueOf(business.get("id")).equals(specificServiceCfg.getBusinessType())) {
|
||||
// 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());
|
||||
// map.put("business",specificServiceCfg.getBusinessType());
|
||||
// ((List<Map<String, Object>>)business.get("nodes")).add(map);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// map2.put("nodes", businessList);
|
||||
return mapList;
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user