Search in sources :

Example 1 with UdcDomain

use of com.itrus.portal.sql.UdcDomain 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;
}
Also used : UdcDomainExample(com.itrus.portal.sql.UdcDomainExample) MobileHandlerServiceException(com.itrus.portal.exception.MobileHandlerServiceException) ActivityMsgTemp(com.itrus.portal.db.ActivityMsgTemp) UdcDomain(com.itrus.portal.sql.UdcDomain) ServiceNullException(com.itrus.portal.exception.ServiceNullException)

Aggregations

ActivityMsgTemp (com.itrus.portal.db.ActivityMsgTemp)1 MobileHandlerServiceException (com.itrus.portal.exception.MobileHandlerServiceException)1 ServiceNullException (com.itrus.portal.exception.ServiceNullException)1 UdcDomain (com.itrus.portal.sql.UdcDomain)1 UdcDomainExample (com.itrus.portal.sql.UdcDomainExample)1