APP相关模块统一使用appCode作为检索条件

This commit is contained in:
duandongmei
2019-05-13 19:10:21 +08:00
parent 35ca1636ef
commit d4e153533a
15 changed files with 701 additions and 60 deletions

View File

@@ -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<AppPolicyCfg> findAppPolicyList(Page<AppPolicyCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppPolicyCfg> list = appCfgDao.findAppPolicyList(entity);
page.setList(list);
return page;
@@ -104,11 +131,59 @@ public class AppCfgService extends BaseService {
public Page<AppIpCfg> findAppIpList(Page<AppIpCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppIpCfg> list = appCfgDao.findAppIpList(entity);
page.setList(list);
return page;
}
public List<AppIpCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppIpCfg> list = appCfgDao.findAppIpList(entity);
return list;
}
@@ -121,6 +196,26 @@ public class AppCfgService extends BaseService {
public Page<AppHttpCfg> findAppHttpList(Page<AppHttpCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppHttpCfg> list = appCfgDao.findAppHttpList(entity);
page.setList(list);
return page;
@@ -134,6 +229,26 @@ public class AppCfgService extends BaseService {
public Page<AppDomainCfg> findAppDomainList(Page<AppDomainCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppDomainCfg> list = appCfgDao.findAppDomainList(entity);
page.setList(list);
return page;
@@ -174,6 +289,26 @@ public class AppCfgService extends BaseService {
public Page<AppByteCfg> findAppByteList(Page<AppByteCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppByteCfg> list = appCfgDao.findAppByteList(entity);
page.setList(list);
return page;
@@ -182,6 +317,26 @@ public class AppCfgService extends BaseService {
public Page<AppSslCertCfg> findAppSslList(Page<AppSslCertCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppSslCertCfg> list = appCfgDao.findAppSslList(entity);
page.setList(list);
return page;
@@ -195,6 +350,26 @@ public class AppCfgService extends BaseService {
public Page<AppTcpCfg> findAppTcpList(Page<AppTcpCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppTcpCfg> list = appCfgDao.findAppTcpList(entity);
page.setList(list);
return page;
@@ -2061,6 +2236,26 @@ public class AppCfgService extends BaseService {
public Page<AppHeaderCfg> findAppHeaderList(Page<AppHeaderCfg> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
if (!StringUtil.isEmpty(appList)) {
SpecificServiceCfg app = appList.get(0);
entity.setAppCode(app.getSpecServiceCode());
}
}
List<AppHeaderCfg> list = appCfgDao.findAppHeaderList(entity);
page.setList(list);
return page;
@@ -2230,4 +2425,5 @@ public class AppCfgService extends BaseService {
}
}