Package com.lgx8.common

Examples of com.lgx8.common.PageList


  @Transactional
  public ProductProperty createProductProperty(Long categoryId, String value) {
    ProductProperty property = new ProductProperty();
    property.setEnabled(true);
   
    ProductPropertyCategory category = productPropertyCategoryDao.findProductPropertyCategoryById(categoryId);
   
    property.setCategory(category);
    property.setValue(value);
    getHibernateTemplate().persist(property);
    return property;
View Full Code Here


public class ProductPropertyCategoryDao extends BaseDao implements IProductPropertyCategoryDao {

  @Transactional
  public ProductPropertyCategory createProductPropertyCategory(String name) {
    ProductPropertyCategory category = new ProductPropertyCategory();
    category.setEnabled(true);
    category.setName(name);
    getHibernateTemplate().persist(category);
    return category;
  }
View Full Code Here

  }

  @Transactional
  public void deleteProductPropertyCategory(Long id)
  {
    ProductPropertyCategory category = findProductPropertyCategoryById(id);
    category.setEnabled(false);
    getHibernateTemplate().update(category);
//    getHibernateTemplate().delete(findProductPropertyCategoryById(id));
  }
View Full Code Here

    List<ProductPropertyCategory> categorys = getHibernateTemplate().find(hql);
    return categorys;
  }

  public ProductPropertyCategory findProductPropertyCategoryById(Long id) {
    ProductPropertyCategory category = getHibernateTemplate().get(ProductPropertyCategory.class, id);
    return category;
  }
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    List<Category> categorys = gatewayService.findAllCategory();
    System.out.println(categorys.get(0).getChilds());
   
    /*AreaCategory areaCategory = new AreaCategory();
    areaCategory.setName("共享良品");
    areaCategory.setDescription("共享良品");
View Full Code Here

    } catch (Exception e) {
      lbrandid = -1;
    }
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
 
    PageList page = null;
    if("all".equals(areacategoryid)&&"all".equals(categoryid)&&"all".equals(brandid)) {
     
    } else if("all".equals(areacategoryid)&&"all".equals(categoryid)) {
      //查商品
      if("1".equals(type)) {
        page = gatewayService.findProduct(keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
      //查品牌
      } else {
        if(brandid!=null&&!"".equals(brandid)&&lbrandid!=-1) {
          page = gatewayService.findProductByBrand(lbrandid, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
        } else {
          page = gatewayService.findProductByBrand(keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
        }
      }
      //查询指定商品分类下面所有分区商品
    } else if("all".equals(areacategoryid)&&categoryid!=null) {
      page = gatewayService.findProduct(new Long(categoryid), keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
      //查询指定分区下面所有商品分类
    } else if("all".equals(categoryid)&&areacategoryid!=null) {
      page = gatewayService.findProductAllCategory(new Long(areacategoryid), keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
    } else if(categoryid!=null&&areacategoryid!=null) {
      page = gatewayService.findProduct(new Long(areacategoryid), new Long(categoryid), keys, pagenum, Constants.SEARCH_RESULT_PAGE_SIZE, orderStr);
    }
     
   
   
   
    Template temp = null;
   
    //TODO 假数据
    List<Product> lastWeekHotProduct = gatewayService.findLastWeekHotProduct(Constants.LAST_WEEK_HOT_PRODUCT_SIZE);
    if(lastWeekHotProduct!=null) {
      root.put("lastWeekHotProduct", lastWeekHotProduct);
    }
   
    //TODO 猜你喜欢的商品,先做假数据
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    User user = new User();
    user.setUsername("czt");
    user.setPassword("czt");
    user.setEmail("www15119258@qq.com");
    user.setRegistertime(new Date());
    user.setLastlogin(new Date());
    user.setNickname("苍之涛");
    user.setTruename("李晖");
    user.setSex(User.SEX_NULL);
    user.setIp("127.0.0.1");
    user.setMobile("15015531354");
   
   
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
   
    IUserCardService userCardService = (IUserCardService) ac.getBean("userCardService");
//    userCardService.createUser(user);
//   
    user = userCardService.findUser("username", "czt");
   
    System.out.println(user.getCard().getScore());
   
//    IConfigDao dao = (IConfigDao) ac.getBean("configDao");
//    System.out.println(dao.findGatewayConfig());
   
  }
View Full Code Here

    this.xfhy = xfhy;
  }
  public String toJSON() {
    JSONObject jObj = new JSONObject();
    Merchant _mr = getMerchant();
    User _u = getXfhy();
    try {
      jObj.put("id", getID());
      jObj.put("xfsjmc", _mr==null?"":_mr.getSJMC());
      jObj.put("hyxm", _u==null?"":_u.getUsername());
      jObj.put("hynickName", _u==null?"":_u.getTruename());
      jObj.put("hych", _u==null?"":(_u.getCard()==null?"":_u.getCard().getId()));
      jObj.put("xfje", getXFJE());
      jObj.put("zsjf", getHDJFS());
      jObj.put("xfsj", getXFSJ());
      //jObj.put("", arg1)
    } catch (JSONException e) {
View Full Code Here

  }
 
  public String toJSON(){
    JSONObject jObj = new JSONObject();
    Merchant _m = getMerchant();
    User _czyh = getCZYHBH();
    User _u = getCZQDR();
    try {
      jObj.put("id", getID());
      jObj.put("user_id", _czyh!=null?"":_czyh.getId());
      jObj.put("user_name", _czyh==null?"":_czyh.getUsername());
      jObj.put("merchat_id", _m==null?"":_m.getID());
      jObj.put("m_name", _m==null?"":_m.getSJMC());
      jObj.put("czlx", changetoCN(getRESERVATION01()));
      jObj.put("czje", getCZJE());
      jObj.put("dhjf", getCZDHJFS());
      jObj.put("czsj", getCZSJ());
      jObj.put("czzt", changeToCN(getCzzt()));
      jObj.put("czqdr", _u==null?"":_u.getUsername());
      jObj.put("czqrrq", getCzqdrq());
    } catch (JSONException e) {
      e.printStackTrace();
    }
    return jObj.toString();
View Full Code Here

    user.setMobile("15015531354");
   
   
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
   
    IUserCardService userCardService = (IUserCardService) ac.getBean("userCardService");
//    userCardService.createUser(user);
//   
    user = userCardService.findUser("username", "czt");
   
    System.out.println(user.getCard().getScore());
   
//    IConfigDao dao = (IConfigDao) ac.getBean("configDao");
//    System.out.println(dao.findGatewayConfig());
View Full Code Here

TOP

Related Classes of com.lgx8.common.PageList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.