Search in sources :

Example 1 with MobileApplyConfigManage

use of com.itrus.portal.db.MobileApplyConfigManage in project portal by ixinportal.

the class MobileCertificateService method selectByMobileApplyConfigId.

// 根据对应的应用配置id得到相对的应用配置
public MobileApplyConfigManage selectByMobileApplyConfigId(Long id) {
    MobileApplyConfigManageExample applyConfigManageExample = new MobileApplyConfigManageExample();
    MobileApplyConfigManageExample.Criteria criteria = applyConfigManageExample.createCriteria();
    criteria.andIdEqualTo(id);
    MobileApplyConfigManage configManage = sqlSession.selectOne("com.itrus.portal.db.MobileApplyConfigManageMapper.selectByExample", applyConfigManageExample);
    return configManage;
}
Also used : MobileApplyConfigManageExample(com.itrus.portal.db.MobileApplyConfigManageExample) MobileApplyConfigManage(com.itrus.portal.db.MobileApplyConfigManage)

Example 2 with MobileApplyConfigManage

use of com.itrus.portal.db.MobileApplyConfigManage in project portal by ixinportal.

the class MobileCertificateService method revokeCert.

public MobileCertificate revokeCert(Long mobileCerId) throws MalformedURLException, RaServiceUnavailable_Exception, RaServiceUnavailable {
    Integer statu = 1;
    MobileCertificate certificate = sqlSession.selectOne("com.itrus.portal.db.MobileCertificateMapper.selectByPrimaryKey", mobileCerId);
    Long applyConfigId = certificate.getApplyConfigId();
    MobileApplyConfigManage applyConfigManage = sqlSession.selectOne("com.itrus.portal.db.MobileApplyConfigManageMapper.selectByPrimaryKey", applyConfigId);
    RaAccount account = sqlSession.selectOne("com.itrus.portal.db.RaAccountMapper.selectByPrimaryKey", applyConfigManage.getRaaccountId());
    if (certificate.getLoseefficacyTime().before(new Date()) || statu == certificate.getCertificateStatus()) {
    // 不需要吊销
    } else if (ComNames.RA_PROTOCOL_API.equals(account.getRaProtocol())) {
        revokeCertByApi(account, certificate);
    } else if (ComNames.RA_PROTOCOL_WS.equals(account.getRaProtocol())) {
        revokeCertByWs(account, certificate);
    }
    certificate.setCertificateStatus(1);
    sqlSession.update("com.itrus.portal.db.MobileCertificateMapper.updateByPrimaryKeySelective", certificate);
    return certificate;
}
Also used : MobileCertificate(com.itrus.portal.db.MobileCertificate) RaAccount(com.itrus.portal.db.RaAccount) Date(java.util.Date) MobileApplyConfigManage(com.itrus.portal.db.MobileApplyConfigManage)

Example 3 with MobileApplyConfigManage

use of com.itrus.portal.db.MobileApplyConfigManage in project portal by ixinportal.

the class MobileCertificateController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    MobileCertificate certificate = mobileCertificateService.selectById(id);
    uiModel.addAttribute("certificate", certificate);
    if (certificate.getAppId() != null) {
        ApplicationInfo app = mobileCertificateService.selectByAppId(certificate.getAppId());
        uiModel.addAttribute("app", app);
    }
    if (certificate.getUserId() != null) {
        MobileUser mobileUser = mobileCertificateService.selectByUserId(certificate.getUserId());
        uiModel.addAttribute("mobileUser", mobileUser);
    }
    if (certificate.getApplyConfigId() != null) {
        MobileApplyConfigManage applyConfigManage = mobileCertificateService.selectByMobileApplyConfigId(certificate.getApplyConfigId());
        uiModel.addAttribute("applyConfigManage", applyConfigManage);
    }
    return "mobilecertificate/show";
}
Also used : MobileCertificate(com.itrus.portal.db.MobileCertificate) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) MobileUser(com.itrus.portal.db.MobileUser) MobileApplyConfigManage(com.itrus.portal.db.MobileApplyConfigManage) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with MobileApplyConfigManage

use of com.itrus.portal.db.MobileApplyConfigManage in project portal by ixinportal.

the class MobileApplyConfigController method creatForm.

// 返回新建页面
@RequestMapping(params = "form", produces = "text/html")
public String creatForm(Model uiModel) {
    // 得到所有应用
    List<ApplicationInfo> applicationInfos = applicationInfoService.selectByExample(new ApplicationInfoExample());
    uiModel.addAttribute("applicationInfos", applicationInfos);
    Iterator<ApplicationInfo> iterator = applicationInfos.iterator();
    while (iterator.hasNext()) {
        ApplicationInfo mobileApply = iterator.next();
        MobileApplyConfigManage appserviceChargings = mobileApplyConfigService.selectByappId(mobileApply.getAppId());
        if (null != appserviceChargings) {
            iterator.remove();
        }
    }
    uiModel.addAttribute("applicationInfos", applicationInfos);
    // 得到所有RA 服务信息
    List<RaAccount> accounts = raAccountService.getRaAccounts();
    uiModel.addAttribute("accounts", accounts);
    return "applyconfig/create";
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) RaAccount(com.itrus.portal.db.RaAccount) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) MobileApplyConfigManage(com.itrus.portal.db.MobileApplyConfigManage) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with MobileApplyConfigManage

use of com.itrus.portal.db.MobileApplyConfigManage in project portal by ixinportal.

the class MobileApplyConfigController method update.

// 修改处理
@RequestMapping(method = RequestMethod.PUT, produces = "text/html")
public String update(@Valid MobileApplyConfigManage applyConfigManage, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
    if (bindingResult.hasErrors()) {
        uiModel.addAttribute("applyConfigManage", applyConfigManage);
        return "applyconfig/update";
    }
    MobileApplyConfigManage applyConfigManage0 = mobileApplyConfigService.selectMobileApplyConfigManageById(applyConfigManage.getId());
    applyConfigManage.setApId(applicationInfoService.selectById(applyConfigManage.getAppId()).getAppId());
    applyConfigManage.setCreator(applyConfigManage0.getCreator());
    applyConfigManage.setCreateTime(applyConfigManage0.getCreateTime());
    applyConfigManage.setModifyTime(new Date());
    applyConfigManage.setModifier(getAdmin().getId());
    sqlSession.update("com.itrus.portal.db.MobileApplyConfigManageMapper.updateByPrimaryKey", applyConfigManage);
    return "redirect:/applyconfig/" + applyConfigManage.getId();
}
Also used : Date(java.util.Date) MobileApplyConfigManage(com.itrus.portal.db.MobileApplyConfigManage) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

MobileApplyConfigManage (com.itrus.portal.db.MobileApplyConfigManage)7 ApplicationInfo (com.itrus.portal.db.ApplicationInfo)3 RaAccount (com.itrus.portal.db.RaAccount)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 MobileApplyConfigManageExample (com.itrus.portal.db.MobileApplyConfigManageExample)2 MobileCertificate (com.itrus.portal.db.MobileCertificate)2 Date (java.util.Date)2 CertInfo (cn.topca.tca.ra.service.CertInfo)1 UserInfo (cn.topca.tca.ra.service.UserInfo)1 JSONObject (com.alibaba.fastjson.JSONObject)1 ApplicationInfoExample (com.itrus.portal.db.ApplicationInfoExample)1 MobileUser (com.itrus.portal.db.MobileUser)1 CertUtlis (com.itrus.portal.utils.CertUtlis)1 HashMap (java.util.HashMap)1