APP相关模块统一使用appCode作为检索条件
This commit is contained in:
@@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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<AppFeatureIndex> findAppFeatureIndexList(Page<AppFeatureIndex> 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<SpecificServiceCfg> appList = specificServiceCfgDao.findAllSpecificServiceCfg(appSpec, null);
|
||||
if (!StringUtil.isEmpty(appList)) {
|
||||
SpecificServiceCfg app = appList.get(0);
|
||||
entity.setAppCode(app.getSpecServiceCode());
|
||||
}
|
||||
}
|
||||
|
||||
List<AppFeatureIndex> list = appMultiFeatureCfgDao.findAppFeatureIndexList(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
|
||||
Reference in New Issue
Block a user