use of com.itrus.portal.sql.UdcDomainExample in project portal by ixinportal.
the class ActivityCollectService method isNeedUpdateCertInfo.
/**
* 判断是否需要更新用户所需证书信息
*
* @param uid
* @param endTime
* @return 当且仅当存在用户信息,并且主证书时间小于UKEY当前证书时间时,返回true
*/
private boolean isNeedUpdateCertInfo(String uid, long endTime) {
boolean ret = false;
if (StringUtils.isBlank(uid) || endTime <= 0)
return ret;
UdcDomainExample udcdExample = new UdcDomainExample();
UdcDomainExample.Criteria udcdCriteria = udcdExample.or();
udcdCriteria.andCertEqualToUdcUserCert();
udcdCriteria.andUserEqualToUdcUser();
udcdCriteria.andUserUniqueEqualTo(uid);
udcdCriteria.andIsMasterEqualTo(true);
udcdCriteria.andIsRevokedEqualTo(false);
UserCert userCert = sqlSession.selectOne("com.itrus.ukey.sql.UdcDomainMapper.selectCertByExample", udcdExample);
if (userCert != null && userCert.getCertEndTime().getTime() < endTime)
ret = true;
return ret;
}
use of com.itrus.portal.sql.UdcDomainExample in project portal by ixinportal.
the class RecordHanderController method isNeedUpdateCertInfo.
/**
* 判断是否需要更新用户所需证书信息
*
* @param uid
* @param endTime
* @return 当且仅当存在用户信息,并且主证书时间小于UKEY当前证书时间时,返回true
*/
private boolean isNeedUpdateCertInfo(String uid, long endTime) {
boolean ret = false;
if (StringUtils.isBlank(uid) || endTime <= 0)
return ret;
UdcDomainExample udcdExample = new UdcDomainExample();
UdcDomainExample.Criteria udcdCriteria = udcdExample.or();
udcdCriteria.andCertEqualToUdcUserCert();
udcdCriteria.andUserEqualToUdcUser();
udcdCriteria.andUserUniqueEqualTo(uid);
udcdCriteria.andIsMasterEqualTo(true);
udcdCriteria.andIsRevokedEqualTo(false);
UserCert userCert = sqlSession.selectOne("com.itrus.portal.sql.UdcDomainMapper.selectCertByExample", udcdExample);
if (userCert != null && userCert.getCertEndTime().getTime() < endTime)
ret = true;
return ret;
}
use of com.itrus.portal.sql.UdcDomainExample in project portal by ixinportal.
the class ActMsgCollectService method mMsgCollect.
public int mMsgCollect(MActivityCollectParam macParam) throws MobileHandlerServiceException {
// 先根据certsn查询所属项目
UdcDomainExample udcdExample = new UdcDomainExample();
UdcDomainExample.Criteria udcdCriteria = udcdExample.or();
udcdCriteria.andCertEqualToUdcUserCert();
udcdCriteria.andUserEqualToUdcUser();
udcdCriteria.andDeviceEqualToUdcDevice();
udcdCriteria.andIsMasterEqualTo(false);
udcdCriteria.andIsRevokedEqualTo(false);
// 证书序列号采用统一方式存储,所以这里进行一次转换
udcdCriteria.andCertSnEqualTo(CertUtilsOfUkey.getValidSerialNumber(macParam.getCertSn()));
String runStatus = macParam.getRunStatus();
if (StringUtils.isBlank(runStatus) || !runStatus.matches("[0,1,2]"))
throw new MobileHandlerServiceException("错误的程序状态标识");
UdcDomain udcDomain = sqlSession.selectOne("com.itrus.ukey.sql.UdcDomainMapper.selectUdcByExample", udcdExample);
if (udcDomain == null || udcDomain.getProject() == null)
throw new MobileHandlerServiceException("无法查询到关联项目");
ActivityMsgTemp am = new ActivityMsgTemp();
am.setProject(udcDomain.getProject());
am.setUkeyVersion(macParam.getSoftVersion());
am.setKeySn(macParam.getHostID());
am.setCertCn(macParam.getCertCn());
am.setThreadId(macParam.getRuningId());
am.setOsType(macParam.getDeviceType().toLowerCase());
try {
setAmTimes(am, runStatus, macParam.getLifeTime());
// 将活动信息添加到消息队列中
queueThread.putObjectQueue(am);
} catch (ServiceNullException e) {
// TODO... 什么也不需要处理
}
return 0;
}
Aggregations