Search in sources :

Example 11 with ProductExample

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

the class ProductServiceImpl method getRenewProduct.

/**
 * 查询证书所属的产品
 *
 * @param raId
 * @param projectId
 * @param type
 *            业务类型(更新、初购)
 * @return
 */
public Product getRenewProduct(Long raId, Long projectId, String type, String certDn) {
    List<Product> productList = new ArrayList<Product>();
    ProductExample example = new ProductExample();
    ProductExample.Criteria criteria = example.or();
    criteria.andRaEqualTo(raId);
    if (null != projectId)
        criteria.andProjectEqualTo(projectId);
    if (StringUtils.isNotBlank(type))
        criteria.andTypeEqualTo(type);
    example.setOrderByClause("create_time desc");
    productList = sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectByExample", example);
    return getProductByCertUid(productList, certDn);
}
Also used : ArrayList(java.util.ArrayList) Product(com.itrus.portal.db.Product) ProductExample(com.itrus.portal.db.ProductExample)

Example 12 with ProductExample

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

the class ProductServiceImpl method getProductByRa.

/**
 * 查询配置了某个ra的最新产品
 *
 * @param raId
 * @return
 */
public Product getProductByRa(Long raId) {
    ProductExample example = new ProductExample();
    ProductExample.Criteria criteria = example.or();
    criteria.andRaEqualTo(raId);
    example.setOrderByClause("create_time desc");
    example.setLimit(1);
    Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByExample", example);
    return product;
}
Also used : ProductExample(com.itrus.portal.db.ProductExample) Product(com.itrus.portal.db.Product)

Example 13 with ProductExample

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

the class ProductServiceImpl method getProductByOldProductId.

/**
 * 根据产品id,获取该产品对应的更新产品
 *
 * @param oldProductId
 * @return
 */
public Product getProductByOldProductId(Long oldProductId, String type) {
    ProductExample example = new ProductExample();
    ProductExample.Criteria criteria = example.or();
    criteria.andOldProNameEqualTo(oldProductId);
    criteria.andTypeEqualTo(type);
    example.setOrderByClause("create_time desc");
    example.setLimit(1);
    Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByExample", example);
    return product;
}
Also used : ProductExample(com.itrus.portal.db.ProductExample) Product(com.itrus.portal.db.Product)

Example 14 with ProductExample

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

the class ProductServiceImpl method getProductIdsByCertification.

/**
 * 根据认证等级查询产品id
 *
 * @param certificationIds
 * @return
 */
public List<Long> getProductIdsByCertification(List<Long> certificationIds) {
    ProductExample example = new ProductExample();
    ProductExample.Criteria criteria = example.or();
    criteria.andAuthenticationIn(certificationIds);
    List<Long> productIds = sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectProductIdsByLevel", example);
    return productIds;
}
Also used : ProductExample(com.itrus.portal.db.ProductExample)

Example 15 with ProductExample

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

the class ProductServiceImpl method getKeyUnlockProducts.

/**
 * 获取该项目下所有的未下架的解锁产品
 * @param projectId
 * @return
 */
public List<Product> getKeyUnlockProducts(Long projectId, Long userinfoId) {
    if (null == projectId) {
        return null;
    }
    List<Product> products = new ArrayList<>();
    ProductExample example = new ProductExample();
    ProductExample.Criteria criteria = example.or();
    criteria.andProjectEqualTo(projectId);
    criteria.andIsBanEqualTo(false);
    criteria.andKeyUnlockTypeIsNotNull();
    // 若证书没有绑定用户,则不返回自助解锁的产品
    if (null == userinfoId) {
        criteria.andKeyUnlockTypeNotEqualTo(1);
    }
    products = sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectByExample", example);
    return products;
}
Also used : ArrayList(java.util.ArrayList) Product(com.itrus.portal.db.Product) ProductExample(com.itrus.portal.db.ProductExample)

Aggregations

ProductExample (com.itrus.portal.db.ProductExample)17 Product (com.itrus.portal.db.Product)15 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)5 EnterpriseQq (com.itrus.portal.db.EnterpriseQq)2 EnterpriseQqExample (com.itrus.portal.db.EnterpriseQqExample)2 IOException (java.io.IOException)2 JsonGenerationException (org.codehaus.jackson.JsonGenerationException)2 JsonMappingException (org.codehaus.jackson.map.JsonMappingException)2 Bill (com.itrus.portal.db.Bill)1 Project (com.itrus.portal.db.Project)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1