diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index 9eceff3de..7bedd441b 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -126,9 +126,9 @@ public class AppCfgController extends BaseController { */ @RequestMapping(value = "ajaxAppName", method = RequestMethod.POST) @ResponseBody - public List> ajaxAppName(Model model, String ids) { + public List> ajaxAppName(Model model, String ids,Integer cfgType) { List> dataList = new ArrayList<>(); - List serviceList = specificServiceCfgService.getBySpecServiceCodes(ids); + List serviceList = specificServiceCfgService.getBySpecServiceCodes(ids,cfgType); Map appMap = new HashMap<>(); Map behavMap = new HashMap<>(); for (SpecificServiceCfg cfg : serviceList) { @@ -192,6 +192,24 @@ public class AppCfgController extends BaseController { public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -356,8 +374,20 @@ public class AppCfgController extends BaseController { Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppIpList(searchPage, cfg); for (AppIpCfg entity : page.getList()) { - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); entity.setAppName(app.getSpecServiceName()); } } @@ -379,6 +409,24 @@ public class AppCfgController extends BaseController { public String ipCfgForm(Model model, String ids, AppIpCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppIpCfg(Long.parseLong(ids)); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -553,8 +601,20 @@ public class AppCfgController extends BaseController { Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppHttpList(searchPage, cfg); for (AppHttpCfg entity : page.getList()) { - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); entity.setAppName(app.getSpecServiceName()); } // entity.setCfgKeywords(entity.getCfgKeywords().replace(Constants.KEYWORD_EXPR, @@ -578,6 +638,24 @@ public class AppCfgController extends BaseController { public String httpCfgForm(Model model, String ids, AppHttpCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppHttpCfg(Long.parseLong(ids)); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -718,8 +796,20 @@ public class AppCfgController extends BaseController { Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppDomainList(searchPage, cfg); for (AppDomainCfg entity : page.getList()) { - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); entity.setAppName(app.getSpecServiceName()); } } @@ -741,6 +831,24 @@ public class AppCfgController extends BaseController { public String domainCfgForm(Model model, String ids, AppDomainCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppDomainCfg(Long.parseLong(ids)); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -903,8 +1011,20 @@ public class AppCfgController extends BaseController { Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppByteList(searchPage, cfg); for (AppByteCfg entity : page.getList()) { - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); entity.setAppName(app.getSpecServiceName()); } } @@ -926,6 +1046,24 @@ public class AppCfgController extends BaseController { public String byteCfgForm(Model model, String ids, AppByteCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppByteCfg(Long.parseLong(ids)); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -1042,8 +1180,20 @@ public class AppCfgController extends BaseController { Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppSslList(searchPage, cfg); for (AppSslCertCfg entity : page.getList()) { - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); entity.setAppName(app.getSpecServiceName()); } } @@ -1065,6 +1215,24 @@ public class AppCfgController extends BaseController { public String sslCfgForm(Model model, String ids, AppSslCertCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppSslCfg(Long.parseLong(ids)); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -1228,6 +1396,24 @@ public class AppCfgController extends BaseController { public String tcpCfgForm(Model model, String ids, AppTcpCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppTcpCfg(Long.parseLong(ids)); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -1343,8 +1529,20 @@ public class AppCfgController extends BaseController { Page searchPage = new Page(request, response, "r"); Page page = appCfgService.findAppHeaderList(searchPage, cfg); for (AppHeaderCfg entity : page.getList()) { - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); entity.setAppName(app.getSpecServiceName()); } } @@ -1366,6 +1564,24 @@ public class AppCfgController extends BaseController { public String headerCfgForm(Model model, String ids, AppHeaderCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppHeaderCfg(Long.parseLong(ids)); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -1862,8 +2078,20 @@ public class AppCfgController extends BaseController { logTotal.put("sum",0L); logTotals.add(logTotal); } - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); - if (app != null) { + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(policy.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); policy.setSocialName(app.getSpecServiceName()); } } @@ -2148,8 +2376,20 @@ public class AppCfgController extends BaseController { http.setIsCaseInsenstive(0); } http.setCfgKeywords(Functions.replace(http.getCfgKeywords(), "***and***", " ")); - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(http.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(http.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); http.setAppName(app.getSpecServiceName()); } } @@ -2223,8 +2463,20 @@ public class AppCfgController extends BaseController { }else{ domain.setIsCaseInsenstive(0); } - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(domain.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(domain.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); domain.setAppName(app.getSpecServiceName()); } } @@ -2300,8 +2552,20 @@ public class AppCfgController extends BaseController { ssl.setIsCaseInsenstive(0); } ssl.setCfgKeywords(Functions.replace(ssl.getCfgKeywords(), "***and***", " ")); - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(ssl.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(ssl.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); ssl.setAppName(app.getSpecServiceName()); } } diff --git a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java index 85d2e73b0..fc015a997 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java @@ -87,8 +87,20 @@ public class AppFeatureCfgController extends BaseController { Page searchPage = new Page(request, response, "r"); Page page = appMultiFeatureCfgService.findAppFeatureIndexList(searchPage, cfg); for (AppFeatureIndex entity : page.getList()) { - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); entity.setAppName(app.getSpecServiceName()); } } @@ -117,6 +129,24 @@ public class AppFeatureCfgController extends BaseController { entity.getFunctionId(), null)); entity.setNumCfgList( appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(), null)); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -353,8 +383,20 @@ public class AppFeatureCfgController extends BaseController { } for (AppFeatureIndex feature : ipLists) { - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId()); - if(app!=null){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(feature.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); feature.setAppName(app.getSpecServiceName()); } } diff --git a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java index e412f0e99..b110c37bf 100644 --- a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java +++ b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java @@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; +import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; @@ -36,6 +37,7 @@ import com.nis.exceptions.CallExternalProceduresException; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; +import com.nis.util.DictUtils; import com.nis.util.LogUtils; import com.nis.util.StringUtil; import com.nis.web.controller.BaseController; @@ -130,6 +132,25 @@ public class BasicProtocolController extends BaseController { public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null); + + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -323,8 +344,20 @@ public class BasicProtocolController extends BaseController { logTotal.put("sum",0L); logTotals.add(logTotal); } - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); - if (app != null) { + // 查找社交应用的所有有效一级特定服务 TODO + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(policy.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); policy.setAppName(app.getSpecServiceName()); } diff --git a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java index 9919d9d5d..91658821d 100644 --- a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java +++ b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java @@ -151,6 +151,24 @@ public class EncryptedTunnelBehaviorController extends BaseController { public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null); + + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(entity.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setSpecServiceId(app.getSpecServiceId()); + } + initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -347,8 +365,20 @@ public class EncryptedTunnelBehaviorController extends BaseController { logTotal.put("sum",0L); logTotals.add(logTotal); } - SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); - if (app != null) { + // 查找社交应用的所有有效一级特定服务 TODO + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceCode(policy.getAppCode()); + List appList = specificServiceCfgService.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); policy.setBehaviorName(app.getSpecServiceName()); } } diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 85164fbd5..cc4beb430 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -620,8 +620,13 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + AND r.app_code=#{appCode,jdbcType=INTEGER} + + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%') @@ -721,8 +726,13 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + AND r.app_code=#{appCode,jdbcType=INTEGER} + + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + AND r.ACTION=#{action,jdbcType=INTEGER} @@ -896,8 +906,13 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + AND r.app_code=#{appCode,jdbcType=INTEGER} + + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%') @@ -1067,8 +1082,13 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + AND r.app_code=#{appCode,jdbcType=INTEGER} + + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%') @@ -1186,8 +1206,13 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + AND r.app_code=#{appCode,jdbcType=INTEGER} + + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%') @@ -1457,8 +1482,13 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + AND r.app_code=#{appCode,jdbcType=INTEGER} + + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%') @@ -1652,8 +1682,13 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + AND r.app_code=#{appCode,jdbcType=INTEGER} + + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%') diff --git a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml index 6c8ce76e4..bd7c8e120 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml @@ -267,8 +267,13 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + + AND r.app_code=#{appCode,jdbcType=INTEGER} + + + + AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER} + AND r.ACTION=#{action,jdbcType=INTEGER} diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java index 13974d1f4..bb8c11572 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java @@ -20,7 +20,7 @@ public interface SpecificServiceCfgDao extends CrudDao { * @return */ SpecificServiceCfg getBySpecServiceId(Integer specServiceId); - List getBySpecServiceCodes(@Param("ids")String ids); + List getBySpecServiceCodes(@Param("ids")String ids,@Param("cfgType")Integer cfgType); /** * 查询所有符合条件顶层分页列表 * @param specificServiceCfg diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml index 772c4222d..33f7fc03e 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml @@ -39,11 +39,11 @@ - select - from specific_service_cfg s where s.spec_service_code in(${ids}) + from specific_service_cfg s where s.spec_service_code in(${ids}) and s.is_valid=1 and s.cfg_type=#{cfgType} diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index 43a365f57..fe9376671 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional; import com.google.common.collect.Lists; import com.nis.domain.Page; +import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.basics.AsnIpCfg; import com.nis.domain.basics.Varibles; import com.nis.domain.configuration.AppByteCfg; @@ -90,6 +91,32 @@ public class AppCfgService extends BaseService { public Page findAppPolicyList(Page page, AppPolicyCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (entity.getFunctionId() == 63 && Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + if (entity.getFunctionId() == 407 && Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + if (entity.getFunctionId() == 408 && Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } List list = appCfgDao.findAppPolicyList(entity); page.setList(list); return page; @@ -104,11 +131,59 @@ public class AppCfgService extends BaseService { public Page findAppIpList(Page page, AppIpCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appCfgDao.findAppIpList(entity); page.setList(list); return page; } public List findAppIpList(AppIpCfg entity) { + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (entity.getFunctionId() == 63 && Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + if (entity.getFunctionId() == 407 && Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + if (entity.getFunctionId() == 408 && Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appCfgDao.findAppIpList(entity); return list; } @@ -121,6 +196,26 @@ public class AppCfgService extends BaseService { public Page findAppHttpList(Page page, AppHttpCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appCfgDao.findAppHttpList(entity); page.setList(list); return page; @@ -134,6 +229,26 @@ public class AppCfgService extends BaseService { public Page findAppDomainList(Page page, AppDomainCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appCfgDao.findAppDomainList(entity); page.setList(list); return page; @@ -174,6 +289,26 @@ public class AppCfgService extends BaseService { public Page findAppByteList(Page page, AppByteCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appCfgDao.findAppByteList(entity); page.setList(list); return page; @@ -182,6 +317,26 @@ public class AppCfgService extends BaseService { public Page findAppSslList(Page page, AppSslCertCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appCfgDao.findAppSslList(entity); page.setList(list); return page; @@ -195,6 +350,26 @@ public class AppCfgService extends BaseService { public Page findAppTcpList(Page page, AppTcpCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appCfgDao.findAppTcpList(entity); page.setList(list); return page; @@ -2061,6 +2236,26 @@ public class AppCfgService extends BaseService { public Page findAppHeaderList(Page page, AppHeaderCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appCfgDao.findAppHeaderList(entity); page.setList(list); return page; @@ -2230,4 +2425,5 @@ public class AppCfgService extends BaseService { } + } diff --git a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java index 61b330c5d..695f1f0de 100644 --- a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.nis.domain.Page; +import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.configuration.AppComplexFeatureCfg; import com.nis.domain.configuration.AppFeatureIndex; import com.nis.domain.configuration.AppHttpCfg; @@ -34,6 +35,7 @@ import com.nis.domain.maat.MaatCfg.GroupCfg; import com.nis.domain.maat.MaatCfg.IpCfg; import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.domain.specific.SpecificServiceCfg; import com.nis.domain.maat.ToMaatBean; import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; @@ -42,6 +44,7 @@ import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.StringUtil; import com.nis.web.dao.configuration.AppMultiFeatureCfgDao; +import com.nis.web.dao.specific.SpecificServiceCfgDao; import com.nis.web.security.UserUtils; import com.nis.web.service.BaseService; @@ -55,11 +58,33 @@ import com.nis.web.service.BaseService; public class AppMultiFeatureCfgService extends BaseService { @Autowired protected AppMultiFeatureCfgDao appMultiFeatureCfgDao; + @Autowired + protected SpecificServiceCfgDao specificServiceCfgDao; //分页查询 public Page findAppFeatureIndexList(Page page, AppFeatureIndex entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); + + if(!StringUtil.isEmpty(entity.getSpecServiceId())){ + // 查找社交应用的所有有效一级特定服务 + SpecificServiceCfg appSpec = new SpecificServiceCfg(); + for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) { + if (Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equals(dict.getItemValue())) { + appSpec.setCfgType(Integer.parseInt(dict.getItemCode())); + break; + } + } + appSpec.setIsValid(Constants.VALID_YES); + appSpec.setIsLeaf(0); + appSpec.setSpecServiceId(entity.getSpecServiceId()); + List appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null); + if (!StringUtil.isEmpty(appList)) { + SpecificServiceCfg app = appList.get(0); + entity.setAppCode(app.getSpecServiceCode()); + } + } + List list = appMultiFeatureCfgDao.findAppFeatureIndexList(entity); page.setList(list); return page; diff --git a/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java index eeeca314e..b7224d4c4 100644 --- a/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java +++ b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java @@ -33,11 +33,11 @@ public class SpecificServiceCfgService extends BaseService{ public SpecificServiceCfg getBySpecServiceId(Integer specServiceId) { return specificServiceCfgDao.getBySpecServiceId(specServiceId); } - public List getBySpecServiceCodes(String specServiceCodes) { + public List getBySpecServiceCodes(String specServiceCodes,Integer cfgType) { for(String specServiceId:specServiceCodes.split(",")) { Integer.parseInt(specServiceId); } - return specificServiceCfgDao.getBySpecServiceCodes(specServiceCodes); + return specificServiceCfgDao.getBySpecServiceCodes(specServiceCodes,cfgType); } /** * 查询所有符合条件的顶层分页 diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp index 95364c9fa..26828259f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp @@ -100,6 +100,9 @@
+ + +