Search in sources :

Example 6 with ProductExample

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

the class RegisterController method register.

@RequestMapping(value = "/s/{name}")
public String register(@PathVariable("name") String name, @RequestParam(value = "login", required = false) String login, HttpSession session, Model uiModel) {
    ProductExample productExample = new ProductExample();
    ProductExample.Criteria pe = productExample.createCriteria();
    pe.andProNameEqualTo(name);
    Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByExample", productExample);
    // return
    // "forward:/userInfoWeb/zhuce.html?projectId="+product.getProject()+"&productId="+product.getId();
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", product.getProject());
    uiModel.addAttribute("projectId", product.getProject());
    uiModel.addAttribute("productId", product.getId());
    uiModel.addAttribute("productName", product.getName());
    uiModel.addAttribute("projectName", project.getName());
    if (StringUtils.isNotBlank(login) && login.equals("1")) {
        List<String> allIssUerDn = new ArrayList<String>();
        allIssUerDn = sqlSession.selectList("com.itrus.portal.db.CrlContextMapper.selectAllIssUerDn");
        try {
            uiModel.addAttribute("allIssUerDn", jsonTool.writeValueAsString(allIssUerDn));
            // 返回随机数
            String random = UniqueIDUtils.genUUID();
            uiModel.addAttribute("random", random);
            session.setAttribute("webrandom", random);
        } catch (JsonGenerationException e) {
            e.printStackTrace();
        } catch (JsonMappingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "ixinweb/denglu2";
    }
    if (null != product.getIsBan() && product.getIsBan() == true) {
        EnterpriseQqExample enterprise1 = new EnterpriseQqExample();
        EnterpriseQqExample.Criteria qqEx = enterprise1.createCriteria();
        qqEx.andProjectIdEqualTo(product.getProject());
        EnterpriseQq enterpriseqq = sqlSession.selectOne("com.itrus.portal.db.EnterpriseQqMapper.selectByExample", enterprise1);
        if (enterpriseqq != null && enterpriseqq.getEnterpriseQq() != null) {
            uiModel.addAttribute("enterpriseqq", enterpriseqq.getEnterpriseQqLinks());
        }
        // 产品已经下架
        return "ixinweb/chanpinxiajia";
    }
    return "ixinweb/zhuce";
}
Also used : ProductExample(com.itrus.portal.db.ProductExample) Product(com.itrus.portal.db.Product) IOException(java.io.IOException) Project(com.itrus.portal.db.Project) EnterpriseQq(com.itrus.portal.db.EnterpriseQq) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) EnterpriseQqExample(com.itrus.portal.db.EnterpriseQqExample) JsonGenerationException(org.codehaus.jackson.JsonGenerationException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with ProductExample

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

the class HomeController method register.

// @RequestMapping(value = "/s/{name}")
public String register(@PathVariable("name") String name, @RequestParam(value = "login", required = false) String login, HttpSession session, Model uiModel) {
    ProductExample productExample = new ProductExample();
    ProductExample.Criteria pe = productExample.createCriteria();
    pe.andProNameEqualTo(name);
    Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByExample", productExample);
    // return
    // "forward:/userInfoWeb/zhuce.html?projectId="+product.getProject()+"&productId="+product.getId();
    uiModel.addAttribute("projectId", product.getProject());
    uiModel.addAttribute("productId", product.getId());
    if (StringUtils.isNotBlank(login) && login.equals("1")) {
        List<String> allIssUerDn = new ArrayList<String>();
        allIssUerDn = sqlSession.selectList("com.itrus.portal.db.CrlContextMapper.selectAllIssUerDn");
        try {
            uiModel.addAttribute("allIssUerDn", jsonTool.writeValueAsString(allIssUerDn));
            // 返回随机数
            String random = UniqueIDUtils.genUUID();
            uiModel.addAttribute("random", random);
            session.setAttribute("webrandom", random);
        } catch (JsonGenerationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (JsonMappingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return "ixinweb/denglu2";
    }
    if (null != product.getIsBan() && product.getIsBan() == true) {
        EnterpriseQqExample enterprise = new EnterpriseQqExample();
        EnterpriseQqExample.Criteria qqEx = enterprise.createCriteria();
        qqEx.andProjectIdEqualTo(product.getProject());
        EnterpriseQq enterpriseqq = sqlSession.selectOne("com.itrus.portal.db.EnterpriseQqMapper.selectByExample", enterprise);
        uiModel.addAttribute("enterpriseqq", enterpriseqq.getEnterpriseQqLinks());
        // 产品已经下架
        return "ixinweb/chanpinxiajia";
    }
    return "ixinweb/zhuce";
}
Also used : EnterpriseQq(com.itrus.portal.db.EnterpriseQq) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) ProductExample(com.itrus.portal.db.ProductExample) Product(com.itrus.portal.db.Product) EnterpriseQqExample(com.itrus.portal.db.EnterpriseQqExample) IOException(java.io.IOException) JsonGenerationException(org.codehaus.jackson.JsonGenerationException)

Example 8 with ProductExample

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

the class SubmitReviewServiceImpl method getAuditProduct.

/**
 * 获取需要送审的产品
 *
 * @return
 */
public List<Product> getAuditProduct() {
    List<Product> productList = new ArrayList<Product>();
    ProductExample example = new ProductExample();
    ProductExample.Criteria criteria = example.or();
    criteria.andIsAuthEqualTo(true);
    criteria.andAppIdIsNotNull();
    criteria.andAppsecretIsNotNull();
    productList = sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectByExample", example);
    return productList;
}
Also used : ArrayList(java.util.ArrayList) Product(com.itrus.portal.db.Product) ProductExample(com.itrus.portal.db.ProductExample)

Example 9 with ProductExample

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

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

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