Search in sources :

Example 11 with ApplicationInfoExample

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);
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample)

Example 12 with 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;
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) EvidenceCert(com.itrus.portal.db.EvidenceCert) HashMap(java.util.HashMap) ApplicationInfo(com.itrus.portal.db.ApplicationInfo)

Example 13 with ApplicationInfoExample

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;
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) EvidenceCert(com.itrus.portal.db.EvidenceCert) HashMap(java.util.HashMap) ApplicationInfo(com.itrus.portal.db.ApplicationInfo)

Example 14 with ApplicationInfoExample

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;
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) ApplicationInfo(com.itrus.portal.db.ApplicationInfo)

Example 15 with ApplicationInfoExample

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();
    }
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) ApplicationInfo(com.itrus.portal.db.ApplicationInfo)

Aggregations

ApplicationInfoExample (com.itrus.portal.db.ApplicationInfoExample)31 ApplicationInfo (com.itrus.portal.db.ApplicationInfo)25 HashMap (java.util.HashMap)21 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)12 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)12 JSONObject (com.alibaba.fastjson.JSONObject)10 Map (java.util.Map)8 PostMapping (org.springframework.web.bind.annotation.PostMapping)8 Calendar (java.util.Calendar)7 Bill (com.itrus.portal.db.Bill)6 EvidenceBasicInformation (com.itrus.portal.db.EvidenceBasicInformation)6 Date (java.util.Date)6 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)5 ArrayList (java.util.ArrayList)5 JSONException (org.json.JSONException)5 Enterprise (com.itrus.portal.db.Enterprise)4 UserinfoEnterprise (com.itrus.portal.db.UserinfoEnterprise)4 IOException (java.io.IOException)4 List (java.util.List)4 Agent (com.itrus.portal.db.Agent)3