Search in sources :

Example 66 with Product

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

the class ProductServiceImpl method getProductByproName.

/**
 * 根据产品缩写获取产品
 *
 * @param productId
 * @return
 */
public Product getProductByproName(String proName) {
    ProductExample example = new ProductExample();
    ProductExample.Criteria criteria = example.or();
    criteria.andProNameEqualTo(proName);
    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 67 with Product

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

the class ProductServiceImpl method getProductById.

/**
 * 根据产品ID获取产品
 *
 * @param productId
 * @return
 */
public Product getProductById(Long productId) {
    ProductExample example = new ProductExample();
    ProductExample.Criteria criteria = example.or();
    criteria.andIdEqualTo(productId);
    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 68 with Product

use of com.itrus.portal.db.Product 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 69 with Product

use of com.itrus.portal.db.Product 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 70 with Product

use of com.itrus.portal.db.Product 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)

Aggregations

Product (com.itrus.portal.db.Product)77 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)43 HashMap (java.util.HashMap)42 Bill (com.itrus.portal.db.Bill)39 Enterprise (com.itrus.portal.db.Enterprise)27 UserInfo (com.itrus.portal.db.UserInfo)27 DigitalCert (com.itrus.portal.db.DigitalCert)24 JSONObject (com.alibaba.fastjson.JSONObject)19 UserCert (com.itrus.portal.db.UserCert)19 ArrayList (java.util.ArrayList)19 IOException (java.io.IOException)18 Map (java.util.Map)17 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)17 ProductExample (com.itrus.portal.db.ProductExample)15 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)15 Date (java.util.Date)15 List (java.util.List)14 HttpSession (javax.servlet.http.HttpSession)14 BillExample (com.itrus.portal.db.BillExample)10 Project (com.itrus.portal.db.Project)10