Search in sources :

Example 11 with ExtraProductRelease

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";
}
Also used : Project(com.itrus.portal.db.Project) ExtraProduct(com.itrus.portal.db.ExtraProduct) ExtraProductRelease(com.itrus.portal.db.ExtraProductRelease) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ExtraProductExample(com.itrus.portal.db.ExtraProductExample) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 12 with ExtraProductRelease

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;
}
Also used : ExtraProductReleaseMapper(com.itrus.portal.db.ExtraProductReleaseMapper) ExtraProductRelease(com.itrus.portal.db.ExtraProductRelease)

Example 13 with ExtraProductRelease

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;
}
Also used : ExtraProductRelease(com.itrus.portal.db.ExtraProductRelease) ArrayList(java.util.ArrayList) ExtraProductReleaseExample(com.itrus.portal.db.ExtraProductReleaseExample)

Example 14 with ExtraProductRelease

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;
}
Also used : App(com.itrus.portal.db.App) ExtraProduct(com.itrus.portal.db.ExtraProduct) ExtraProductRelease(com.itrus.portal.db.ExtraProductRelease) ArrayList(java.util.ArrayList) AppBean(com.itrus.portal.entity.AppBean) AppExample(com.itrus.portal.db.AppExample)

Aggregations

ExtraProductRelease (com.itrus.portal.db.ExtraProductRelease)14 ArrayList (java.util.ArrayList)9 ExtraProduct (com.itrus.portal.db.ExtraProduct)8 Project (com.itrus.portal.db.Project)6 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)6 ExtraProductReleaseExample (com.itrus.portal.db.ExtraProductReleaseExample)5 HashMap (java.util.HashMap)5 Enterprise (com.itrus.portal.db.Enterprise)2 ExtraProductExample (com.itrus.portal.db.ExtraProductExample)2 ExtraProductReleaseMapper (com.itrus.portal.db.ExtraProductReleaseMapper)2 UserInfo (com.itrus.portal.db.UserInfo)2 UserinfoEnterprise (com.itrus.portal.db.UserinfoEnterprise)2 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)2 IOException (java.io.IOException)2 Date (java.util.Date)2 LinkedHashSet (java.util.LinkedHashSet)2 App (com.itrus.portal.db.App)1 AppExample (com.itrus.portal.db.AppExample)1 BusinessLicense (com.itrus.portal.db.BusinessLicense)1 Criteria (com.itrus.portal.db.ExtraProductReleaseExample.Criteria)1