use of com.itrus.portal.entity.AppBean in project portal by ixinportal.
the class UserFromClientLoginController method toClientHomePage.
/**
* 服务型客户端首页
* type,类型.web.app,客户端,目前是客户端,跟发布平台的值相同:{1:"web", 2:"客户端", 3:"app"}
* @param keySn
* @param certSn
* @param enterpriseName
* @param request
* @param uiModel
* @return
*/
@RequestMapping("/toClientHomePage")
public String toClientHomePage(@RequestParam(value = "type", required = true) String type, @RequestParam(value = "keySn", required = false) String keySn, @RequestParam(value = "certSn", required = false) String certSn, @RequestParam(value = "enterpriseName", required = false) String enterpriseName, HttpServletRequest request, Model uiModel) {
HttpSession session = request.getSession();
try {
UserInfo userInfo = (UserInfo) session.getAttribute(ComNames.WEB_USER_INFO);
if (null == userInfo) {
return ComNames.DENG_LU_CLIENT;
}
Enterprise enterprise = (Enterprise) session.getAttribute(ComNames.WEB_ENTERPRISE);
if (null == enterprise && StringUtils.isNotBlank(enterpriseName)) {
enterprise = enterpriseService.getEntByName(enterpriseName);
}
UserCert userCert = (UserCert) session.getAttribute("userCert");
if (null == userCert && StringUtils.isNotBlank(certSn)) {
userCert = userCertService.getUserCertByCertSn(certSn);
}
uiModel.addAttribute("userCert", userCert);
Project project = null;
if (StringUtils.isNotBlank(keySn)) {
ProjectKeyInfo projectKeyInfo = cacheCustomer.findProjectByKey(keySn);
project = projectService.selectByPrimaryKey(projectKeyInfo.getProject());
} else {
project = projectService.selectByPrimaryKey(userInfo.getProject());
}
if (project.getId() != null) {
List<AppBean> appBeanList = appService.getAppList(project.getId(), type);
uiModel.addAttribute("appBeanList", appBeanList);
}
// TODO 返回足迹信息
if (enterprise.getId() != null) {
Records record = signatureRecordService.getRecord(enterprise.getId());
uiModel.addAttribute("record", record);
}
} catch (Exception e) {
uiModel.addAttribute("errorMsg", "出现异常,异常信息:" + e.getMessage());
return ComNames.CLIENTFW_ERRORPAGE;
}
// 跳转客户端首页
return "clientFW/index";
}
use of com.itrus.portal.entity.AppBean in project portal by ixinportal.
the class AppServiceImpl method getAppList.
/**
* 根据项目id返回应用管理和增值应用的相关信息
* @param id
* @param type 类型.web.app,客户端,目前是客户端,跟发布平台的值相同:{1:"web", 2:"客户端", 3:"app"}
* @return
*/
public List<AppBean> getAppList(Long id, String type) throws Exception {
// 查询当前项目下的应用信息
List<AppBean> appBeanList = new ArrayList<>();
List<ExtraProduct> extraProductList = null;
AppExample appExample = new AppExample();
AppExample.Criteria ac = appExample.createCriteria();
ac.andProjectEqualTo(id);
if ("1".equals(type)) {
ac.andPcEqualTo(true);
} else if (("2".equals(type))) {
ac.andWindowsEqualTo(true);
} else if (("3".equals(type))) {
// TODO 未区分app 默认为安卓
ac.andAndroidEqualTo(true);
}
List<App> appList = sqlSession.selectList("com.itrus.portal.db.AppMapper.selectByExample", appExample);
// 查询当前项目下增值应用信息
List<ExtraProductRelease> extraProductReleases = extraProductReleaseService.getByprojectAndType(id, type);
// 增值应用集合
if (extraProductReleases != null) {
extraProductList = extraProductService.getproductByEPR(extraProductReleases);
}
if (appList != null) {
for (App app : appList) {
AppBean appBean = new AppBean();
appBean.setType("1");
appBean.setName(app.getName());
appBean.setAppId(app.getId());
appBean.setUrl(app.getAppUrl());
appBean.setOpenType(app.getOpenType());
appBean.setShortName(app.getShortName());
appBeanList.add(appBean);
}
}
// }
return appBeanList;
}
Aggregations