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;
}
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;
}
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";
}
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";
}
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();
}
Aggregations