app策略,加密隧道行为,基础协议,去掉多余循环,属性名获取采用ajax
This commit is contained in:
@@ -37,9 +37,7 @@ import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.AppSslCertCfg;
|
||||
import com.nis.domain.configuration.AppTcpCfg;
|
||||
import com.nis.domain.configuration.AppTopicDomainCfg;
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.DdosIpCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.configuration.WebsiteDomainTopic;
|
||||
@@ -77,38 +75,58 @@ public class AppCfgController extends BaseController {
|
||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||
for(AppPolicyCfg entity:page.getList()){
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if(app!=null) {
|
||||
entity.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
}
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// if(app!=null) {
|
||||
// entity.setAppName(app.getSpecServiceName());
|
||||
// }
|
||||
// }
|
||||
//查找社交应用的所有有效二级特定服务
|
||||
SpecificServiceCfg second=new SpecificServiceCfg();
|
||||
for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) {
|
||||
second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
second.setIsValid(Constants.VALID_YES);
|
||||
second.setIsLeaf(1);
|
||||
List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||
// SpecificServiceCfg second=new SpecificServiceCfg();
|
||||
// second.setCfgType(1);
|
||||
// second.setIsValid(Constants.VALID_YES);
|
||||
// second.setIsLeaf(1);
|
||||
// List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||
|
||||
//遍历,找到匹配项后将行为设置进去
|
||||
for(AppPolicyCfg entity:page.getList()){
|
||||
if(entity.getBehavCode()==null) continue;
|
||||
for(SpecificServiceCfg secondCfg:secondList) {
|
||||
if(secondCfg.getSpecServiceCode()==null) continue;
|
||||
if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) {
|
||||
entity.setBehavName(secondCfg.getSpecServiceName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// if(entity.getBehavCode()==null) continue;
|
||||
// for(SpecificServiceCfg secondCfg:secondList) {
|
||||
// if(secondCfg.getSpecServiceCode()==null) continue;
|
||||
// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) {
|
||||
// entity.setBehavName(secondCfg.getSpecServiceName());
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/app/appPolicyCfgList";
|
||||
}
|
||||
/**
|
||||
* ajax设置Name
|
||||
* @param model
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="ajaxAppName",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<Map<String, String>> ajaxAppName(Model model,String ids){
|
||||
List<Map<String, String>> dataList=new ArrayList<>();
|
||||
List<SpecificServiceCfg> serviceList=specificServiceCfgService.getBySpecServiceCodes(ids);
|
||||
Map<String, String> appMap=new HashMap<>();
|
||||
Map<String, String> behavMap=new HashMap<>();
|
||||
for(SpecificServiceCfg cfg:serviceList) {
|
||||
if(cfg.getIsLeaf().intValue()==0) {
|
||||
appMap.put(cfg.getSpecServiceCode().toString(), cfg.getSpecServiceName());
|
||||
}else {
|
||||
behavMap.put(cfg.getSpecServiceCode().toString(), cfg.getSpecServiceName());
|
||||
}
|
||||
}
|
||||
dataList.add(appMap);
|
||||
dataList.add(behavMap);
|
||||
return dataList;
|
||||
}
|
||||
/**
|
||||
* 查询APP策略IP子配置
|
||||
* @param model
|
||||
|
||||
@@ -52,13 +52,13 @@ public class BasicProtocolController extends BaseController {
|
||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||
for(AppPolicyCfg entity:page.getList()){
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if(app!=null) {
|
||||
entity.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
|
||||
}
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// if(app!=null) {
|
||||
// entity.setAppName(app.getSpecServiceName());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/basicprotocol/list";
|
||||
|
||||
@@ -15,6 +15,8 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
@@ -51,34 +53,34 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||
for(AppPolicyCfg entity:page.getList()){
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if(app!=null) {
|
||||
entity.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
}
|
||||
//查找社交应用的所有有效二级特定服务
|
||||
SpecificServiceCfg second=new SpecificServiceCfg();
|
||||
for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) {
|
||||
second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
second.setIsValid(Constants.VALID_YES);
|
||||
second.setIsLeaf(1);
|
||||
List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||
//遍历,找到匹配项后将行为设置进去
|
||||
for(AppPolicyCfg entity:page.getList()){
|
||||
if(entity.getBehavCode()==null) continue;
|
||||
for(SpecificServiceCfg secondCfg:secondList) {
|
||||
if(secondCfg.getSpecServiceCode()==null) continue;
|
||||
if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) {
|
||||
entity.setBehavName(secondCfg.getSpecServiceName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// if(app!=null) {
|
||||
// entity.setAppName(app.getSpecServiceName());
|
||||
// }
|
||||
// }
|
||||
// //查找社交应用的所有有效二级特定服务
|
||||
// SpecificServiceCfg second=new SpecificServiceCfg();
|
||||
// for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
// if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) {
|
||||
// second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// second.setIsValid(Constants.VALID_YES);
|
||||
// second.setIsLeaf(1);
|
||||
// List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||
// //遍历,找到匹配项后将行为设置进去
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// if(entity.getBehavCode()==null) continue;
|
||||
// for(SpecificServiceCfg secondCfg:secondList) {
|
||||
// if(secondCfg.getSpecServiceCode()==null) continue;
|
||||
// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) {
|
||||
// entity.setBehavName(secondCfg.getSpecServiceName());
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/encryptedtunnelbehav/list";
|
||||
|
||||
@@ -18,6 +18,7 @@ public interface SpecificServiceCfgDao extends CrudDao<SpecificServiceCfg> {
|
||||
* @return
|
||||
*/
|
||||
SpecificServiceCfg getBySpecServiceId(Integer specServiceId);
|
||||
List<SpecificServiceCfg> getBySpecServiceCodes(@Param("ids")String ids);
|
||||
/**
|
||||
* 查询所有符合条件顶层分页列表
|
||||
* @param specificServiceCfg
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
select <include refid="specificServiceCfgColumns" />
|
||||
from specific_service_cfg s where s.spec_service_id = #{specServiceId}
|
||||
</select>
|
||||
<select id="getBySpecServiceCodes" resultType="com.nis.domain.specific.SpecificServiceCfg" parameterType="java.lang.String">
|
||||
select <include refid="specificServiceCfgColumns" />
|
||||
from specific_service_cfg s where s.spec_service_code in(${ids})
|
||||
</select>
|
||||
<select id="getRepeat" resultType="com.nis.domain.specific.SpecificServiceCfg" >
|
||||
select <include refid="specificServiceCfgColumns" />
|
||||
from specific_service_cfg s where s.spec_service_code = #{specServiceCode} and s.cfg_type=#{cfgType} and s.is_valid=1
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.nis.web.service.BaseService;
|
||||
public class SpecificServiceCfgService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private SpecificServiceCfgDao specificServiceCfgDao;
|
||||
private SpecificServiceCfgDao specificServiceCfgDao;
|
||||
|
||||
/**
|
||||
* 根据id查询对象
|
||||
@@ -30,6 +30,12 @@ public class SpecificServiceCfgService extends BaseService{
|
||||
public SpecificServiceCfg getBySpecServiceId(Integer specServiceId) {
|
||||
return specificServiceCfgDao.getBySpecServiceId(specServiceId);
|
||||
}
|
||||
public List<SpecificServiceCfg> getBySpecServiceCodes(String specServiceCodes) {
|
||||
for(String specServiceId:specServiceCodes.split(",")) {
|
||||
Integer.parseInt(specServiceId);
|
||||
}
|
||||
return specificServiceCfgDao.getBySpecServiceCodes(specServiceCodes);
|
||||
}
|
||||
/**
|
||||
* 查询所有符合条件的顶层分页
|
||||
* @param page
|
||||
|
||||
Reference in New Issue
Block a user