use of com.itrus.portal.db.ApplicationInfoExample in project portal by ixinportal.
the class AppServiceExtImpl method selectAppInfoConuntById.
/* public Object selectByAppServiceObject(String str, Long id){
return sqlSession.selectOne("com.itrus.portal.db."+str+"Mapper.selectByPrimaryKey", id);
}*/
/**
* 通过AppService id 查询是否关联计费配置
* @return
*/
public int selectAppInfoConuntById(Long id) {
ApplicationInfoExample applicationInfoExample = new ApplicationInfoExample();
ApplicationInfoExample.Criteria ae = applicationInfoExample.createCriteria();
ae.andAppServiceItemsLike("%" + id.toString() + "%");
return applicationInfoService.countByExample(applicationInfoExample);
}
use of com.itrus.portal.db.ApplicationInfoExample in project portal by ixinportal.
the class ApplicationInfoServiceImpl method getCert.
public String getCert(Long id) {
// 声明一个map
Map<Long, String> map = new HashMap<Long, String>();
ApplicationInfoExample applicationInfoExample = new ApplicationInfoExample();
ApplicationInfoExample.Criteria appInfoExampleCriteria = applicationInfoExample.createCriteria();
appInfoExampleCriteria.andCertBase64IsNotNull();
appInfoExampleCriteria.andIdEqualTo(id);
List<ApplicationInfo> applicationInfo = sqlSession.selectList("com.itrus.portal.db.ApplicationInfoMapper.selectByExample", applicationInfoExample);
if (applicationInfo.isEmpty()) {
return null;
}
EvidenceCert cert = sqlSession.selectOne("com.itrus.portal.db.EvidenceCertMapper.selectByPrimaryKey", Long.parseLong(applicationInfo.get(0).getCertBase64()));
if (cert != null) {
return cert.getCertBase64();
}
return null;
}
use of com.itrus.portal.db.ApplicationInfoExample in project portal by ixinportal.
the class ApplicationInfoServiceImpl method getCert.
public Map getCert() {
// 声明一个map
Map<Long, String> map = new HashMap<Long, String>();
ApplicationInfoExample applicationInfoExample = new ApplicationInfoExample();
ApplicationInfoExample.Criteria appInfoExampleCriteria = applicationInfoExample.createCriteria();
appInfoExampleCriteria.andCertBase64IsNotNull();
List<ApplicationInfo> applicationInfo = sqlSession.selectList("com.itrus.portal.db.ApplicationInfoMapper.selectByExample", applicationInfoExample);
if (applicationInfo.isEmpty()) {
return null;
}
for (ApplicationInfo app : applicationInfo) {
EvidenceCert cert = sqlSession.selectOne("com.itrus.portal.db.EvidenceCertMapper.selectByPrimaryKey", Long.parseLong(app.getCertBase64()));
map.put(app.getId(), cert.getCertBase64());
}
return map;
}
use of com.itrus.portal.db.ApplicationInfoExample in project portal by ixinportal.
the class ApplicationInfoServiceImpl method getApplicationInfo.
/**
* 通过appId获取应用信息
* @param appId
* @return
*/
public ApplicationInfo getApplicationInfo(String appId) {
Map<String, ApplicationInfo> appInfoMap = CacheCustomer.getAPP_INFO_MAP();
ApplicationInfo applicationInfo = appInfoMap.get(appId);
if (applicationInfo == null) {
ApplicationInfoExample applicationInfoExample = new ApplicationInfoExample();
ApplicationInfoExample.Criteria appInfoExampleCriteria = applicationInfoExample.createCriteria();
appInfoExampleCriteria.andAppIdEqualTo(appId);
applicationInfo = sqlSession.selectOne("com.itrus.portal.db.ApplicationInfoMapper.selectByExample", applicationInfoExample);
}
return applicationInfo;
}
use of com.itrus.portal.db.ApplicationInfoExample in project portal by ixinportal.
the class AppAuthConfigServiceImpl method setAppInfo.
/**
* 修改应用的linkFace配置
* @param appAuthConfig
* @throws Exception
* @throws EncDecException
*/
private void setAppInfo(AppAuthConfig appAuthConfig) throws Exception {
List<ApplicationInfo> applicationInfos = infoServiceImpl.selectByExample(new ApplicationInfoExample());
for (ApplicationInfo info : applicationInfos) {
info.setAppId2(AESencrp.encrypt(appAuthConfig.getAppId(), info.getSecretKey()));
info.setSecretKey2(AESencrp.encrypt(appAuthConfig.getSecretKey(), info.getSecretKey()));
infoServiceImpl.updateByApplicationInfo(info);
sqlSession.flushStatements();
}
}
Aggregations