use of com.itrus.portal.db.ExtraProductRelease in project portal by ixinportal.
the class ExtraProductReleaseController method show.
// 显示详情页面
@RequestMapping(value = "/show/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) throws Exception {
Project project = projectService.selectByPrimaryKey(id);
List<ExtraProductRelease> extraProductReleases = extraProductReleaseService.getByprojectId(id);
// 所有的增值产品信息,以id为主键.以便页面显示信息
Map<Long, ExtraProduct> extraProductMap = new HashMap<Long, ExtraProduct>();
extraProductMap = extraProductService.selectMapByExample(null);
// 项目信息
uiModel.addAttribute("project", project);
// 产品与项目之间的关系
uiModel.addAttribute("extraProductReleases", extraProductReleases);
// 所有的产品
uiModel.addAttribute("extraProductMap", extraProductMap);
// 显示新建的增值产品,还未与项目产生关联
ExtraProductExample epe = new ExtraProductExample();
ExtraProductExample.Criteria epec = epe.createCriteria();
List<Long> havedProductIds = new ArrayList<>();
for (ExtraProductRelease epr : extraProductReleases) {
havedProductIds.add(epr.getExtraProduct());
}
if (havedProductIds != null && havedProductIds.size() > 0) {
epec.andIdNotIn(havedProductIds);
}
epe.setOrderByClause("id asc");
// 没有与该项目产生关联关系的增值产品
List<ExtraProduct> remainingProducts = extraProductService.selectByExample(epe);
uiModel.addAttribute("remainingProducts", remainingProducts);
return "extraproductrelease/show";
}
use of com.itrus.portal.db.ExtraProductRelease in project portal by ixinportal.
the class ExtraProductReleaseServiceImpl method selectByExample.
public List<ExtraProductRelease> selectByExample(ExtraProductReleaseExample example) throws Exception {
ExtraProductReleaseMapper mapper = sqlSession.getMapper(ExtraProductReleaseMapper.class);
List<ExtraProductRelease> list = mapper.selectByExample(example);
return list;
}
use of com.itrus.portal.db.ExtraProductRelease in project portal by ixinportal.
the class ExtraProductReleaseServiceImpl method getByprojectIdAndProductId.
/**
* 选择项目和产品下所有的产品信息
*
* @param id
* @return
* @throws Exception
*/
public List<ExtraProductRelease> getByprojectIdAndProductId(Long projectId, Long productId) throws Exception {
List<ExtraProductRelease> extraProductReleases = new ArrayList<>();
ExtraProductReleaseExample example = new ExtraProductReleaseExample();
ExtraProductReleaseExample.Criteria criteria = example.or();
criteria.andProjectEqualTo(projectId);
criteria.andExtraProductEqualTo(productId);
example.setOrderByClause("priority asc");
extraProductReleases = selectByExample(example);
return extraProductReleases;
}
use of com.itrus.portal.db.ExtraProductRelease 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