Search in sources :

Example 1 with ExtraProductExample

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

the class ExtraProductReleaseController method updatePage.

// 修改页面
@RequestMapping(value = "/update/{id}", produces = "text/html")
public String updatePage(@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);
    List<ExtraProduct> allProducts = extraProductService.selectByExample(null);
    // 所有产品list
    uiModel.addAttribute("allProducts", allProducts);
    // 项目信息
    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/update";
}
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 2 with ExtraProductExample

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

the class ExtraBillServiceImpl method getExtraProductMapByUserInfoId.

/**
 * 根据用户id查询订单表中对应的产品Map
 *
 * @param userInfo
 * @return
 * @throws Exception
 */
public Map<Long, ExtraProduct> getExtraProductMapByUserInfoId(Long userInfo) throws Exception {
    Map<Long, ExtraProduct> productMap = new HashMap<Long, ExtraProduct>();
    List<Long> productIds = sqlSession.selectList("com.itrus.portal.db.ExtraBillMapper.selectExraProductsByUserInfo", userInfo);
    if (null != productIds && !productIds.isEmpty()) {
        ExtraProductExample example = new ExtraProductExample();
        ExtraProductExample.Criteria criteria = example.or();
        criteria.andIdIn(productIds);
        productMap = extraProductService.selectMapByExample(example);
    }
    return productMap;
}
Also used : ExtraProduct(com.itrus.portal.db.ExtraProduct) HashMap(java.util.HashMap) ExtraProductExample(com.itrus.portal.db.ExtraProductExample)

Example 3 with ExtraProductExample

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

the class ExtraProductServiceImpl method getProductsByServiceProviderId.

/**
 * 根据服务商id,获取服务商下面的产品
 * @param serviceProviderId
 * @return
 * @throws Exception
 */
public List<ExtraProduct> getProductsByServiceProviderId(Long serviceProviderId) throws Exception {
    List<ExtraProduct> extraProducts = new ArrayList<>();
    ExtraProductExample example = new ExtraProductExample();
    ExtraProductExample.Criteria criteria = example.or();
    criteria.andServiceProviderEqualTo(serviceProviderId);
    extraProducts = selectByExample(example);
    return extraProducts;
}
Also used : ExtraProduct(com.itrus.portal.db.ExtraProduct) ArrayList(java.util.ArrayList) ExtraProductExample(com.itrus.portal.db.ExtraProductExample)

Example 4 with ExtraProductExample

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

the class ExtraProductServiceImpl method getExtraProductBySIN.

/**
 * 根据服务商接口标识,返回对应的增值产品
 * @param serviceInterfaceName
 * @return
 * @throws Exception
 */
public List<ExtraProduct> getExtraProductBySIN(Long serviceInterfaceName) throws Exception {
    if (null == serviceInterfaceName) {
        return null;
    }
    List<ExtraProduct> extraProducts = new ArrayList<>();
    ExtraProductExample example = new ExtraProductExample();
    ExtraProductExample.Criteria criteria = example.or();
    criteria.andServiceInterfaceNameEqualTo(serviceInterfaceName);
    extraProducts = selectByExample(example);
    return extraProducts;
}
Also used : ExtraProduct(com.itrus.portal.db.ExtraProduct) ArrayList(java.util.ArrayList) ExtraProductExample(com.itrus.portal.db.ExtraProductExample)

Example 5 with ExtraProductExample

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

the class ClientWebController method myApp.

/**
 * 获取用户购买后的应用型产品(服务型产品需要排除掉)
 * @param request
 * @param uiModel
 * @return
 */
@RequestMapping("/myapp")
public String myApp(HttpServletRequest request, Model uiModel) {
    HttpSession session = request.getSession();
    UserInfo webuserInfo = (UserInfo) session.getAttribute("webuserInfo");
    Enterprise webenterprise = (Enterprise) session.getAttribute("webenterprise");
    if (null == webuserInfo || null == webenterprise) {
        uiModel.addAttribute("errorMsg", "登录已经失效,请重新登录");
        return "client/errorpage";
    }
    // UserInfo webuserInfo = userInfoService.getUserInfoByMphone("18878996651");
    // Enterprise webenterprise = enterpriseService.getEnterpriseById(600L);
    // TODO 1.选择用户已经付款的订单.并且接口类型是属于需要第三方应用的:(目前软著类的不需要,百旺的需要),若后期需要增加其他类型的应用,再进行增加
    // 选择该类型的产品
    List<Long> serviceInterfaceNames = new ArrayList<>();
    serviceInterfaceNames.add(ComNames.SERVICE_INTERFACE_NAME_BWFPTPT);
    ExtraProductExample pExample = new ExtraProductExample();
    ExtraProductExample.Criteria criteria = pExample.or();
    criteria.andServiceInterfaceNameIn(serviceInterfaceNames);
    List<Long> productIds = new ArrayList<>();
    Map<String, Object> param = new HashMap<String, Object>();
    List<Integer> billStatus = new ArrayList<>();
    List<Map<String, Object>> list = new ArrayList<>();
    try {
        // 获取用户已经付款后的订单.以及产品信息,返回给页面(用户+企业+产品(多个)+订单状态(多个))
        productIds = extraProductService.selectIdsByExample(pExample);
        param.put("hasProducts", productIds);
        param.put("userInfo", webuserInfo.getId());
        param.put("enterprise", webenterprise.getId());
        billStatus = myAppStatus();
        param.put("billStatus", billStatus);
        list = extraBillService.selectAppByMap(param);
        uiModel.addAttribute("appList", list);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return "client/wodeyingyong";
}
Also used : HashMap(java.util.HashMap) HttpSession(javax.servlet.http.HttpSession) ArrayList(java.util.ArrayList) UserInfo(com.itrus.portal.db.UserInfo) IOException(java.io.IOException) UserInfoServiceException(com.itrus.portal.exception.UserInfoServiceException) Enterprise(com.itrus.portal.db.Enterprise) UserinfoEnterprise(com.itrus.portal.db.UserinfoEnterprise) ExtraProductExample(com.itrus.portal.db.ExtraProductExample) Map(java.util.Map) HashMap(java.util.HashMap) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ExtraProductExample (com.itrus.portal.db.ExtraProductExample)9 ExtraProduct (com.itrus.portal.db.ExtraProduct)8 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 ExtraProductRelease (com.itrus.portal.db.ExtraProductRelease)2 Project (com.itrus.portal.db.Project)2 Enterprise (com.itrus.portal.db.Enterprise)1 ServiceProvider (com.itrus.portal.db.ServiceProvider)1 ServiceProviderExample (com.itrus.portal.db.ServiceProviderExample)1 UserInfo (com.itrus.portal.db.UserInfo)1 UserinfoEnterprise (com.itrus.portal.db.UserinfoEnterprise)1 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)1 IOException (java.io.IOException)1 Map (java.util.Map)1 HttpSession (javax.servlet.http.HttpSession)1