Ejemplo n.º 1
0
  /**
   * 方法描述:修改团购商品表信息
   *
   * @return
   * @throws Exception
   */
  public String update() throws Exception {
    // 将处理后的所属分类串注入到buy对象中
    groupgoods.setCat_attr(cat_attr);
    groupgoods.setCust_id(this.session_cust_id);
    groupgoods.setUser_id(this.session_user_id);
    super.commonValidateField(groupgoods);
    if (super.ifvalidatepass) {
      return view();
    }

    this.groupgoodsService.update(groupgoods);
    this.addActionMessage("修改团购商品表成功!");
    return list();
  }
Ejemplo n.º 2
0
  /**
   * @author : 林俊钦
   * @date : Mar 19, 2012 12:53:59 PM @Method Description :审核团购
   */
  public String audit() throws Exception {
    String id = this.groupgoods.getGroup_id();

    if (id == null || id.equals("")) {
      groupgoods = new Groupgoods();
    } else {
      groupgoods = this.groupgoodsService.get(id);
    }

    if (groupname == null || groupname.equals("")) {
      goods = this.goodsService.get(groupgoods.getGoods_id());
      if (goods.getGoods_name() != null) {
        groupname = goods.getGoods_name();
      }
    }

    // 将从数据库中查询的所属分类存入分类隐藏域中
    backCategory(groupgoods.getCat_attr());
    return goUrl(AUDIT);
  }
Ejemplo n.º 3
0
  /**
   * 方法描述:新增团购商品表
   *
   * @return
   * @throws Exception
   */
  public String insert() throws Exception {
    // 用于所属分类的回选开始
    loadCategory();
    // 验证分类是选择
    validateCategoryIfSelect();
    // 将处理后的所属分类串注入到buy对象中
    groupgoods.setCat_attr(cat_attr);
    groupgoods.setCust_id(this.session_cust_id);
    groupgoods.setUser_id(this.session_user_id);

    if (groupgoods.getContact_way() != null && !groupgoods.equals("")) {
      String c_way = groupgoods.getContact_way();
      if (validate.isMobile(c_way) && validate.isTelephone(c_way)) {
        this.addFieldError("groupgoods.contact_way", "请输入正确的联系方式");
      }
    }
    // 发布信息数量控制
    if (this.session_cust_type.equals(Constants.MEMBER_TYPE)) {
      if (controlInfoNum()) {
        return add();
      }
    }

    super.commonValidateField(groupgoods);
    if (super.ifvalidatepass) {
      return add();
    }
    this.groupgoodsService.insert(groupgoods);
    this.addActionMessage("新增团购商品表成功!");
    this.groupgoods = null;
    is_crotorl = true;
    return INPUT;
  }
Ejemplo n.º 4
0
 /**
  * @author : 林俊钦
  * @date : Mar 19, 2012 1:31:20 PM @Method Description :审核状态
  */
 public String auditState() throws Exception {
   String info_state = "", no_reason = "";
   String id = this.groupgoods.getGroup_id();
   if (id == null || id.equals("")) {
     return auditList();
   }
   // 获取数据库对象
   Groupgoods gd = this.groupgoodsService.get(id);
   if (this.groupgoods.getInfo_state() != null && !this.groupgoods.getInfo_state().equals("")) {
     info_state = this.groupgoods.getInfo_state();
     // 设置状态值
     gd.setInfo_state(info_state);
   }
   if (this.groupgoods.getNo_reason() != null) {
     no_reason = this.groupgoods.getNo_reason();
     // 设置拒绝理由
     gd.setNo_reason(no_reason);
   }
   // 更新数据库供应列表
   this.groupgoodsService.update(gd);
   this.addActionMessage("审核团购商品信息成功");
   return auditList();
 }
Ejemplo n.º 5
0
  /**
   * 方法描述:根据主键找出团购商品表信息
   *
   * @return
   * @throws Exception
   */
  public String view() throws Exception {
    if (groupgoods.getCust_id() != null) {
      if (accessControl(groupgoods.getCust_id())) {
        return list();
      }
    }
    String id = this.groupgoods.getGroup_id();
    if (id == null || id.equals("")) {
      groupgoods = new Groupgoods();
    } else {
      groupgoods = this.groupgoodsService.get(id);
    }

    if (groupname == null || groupname.equals("")) {
      goods = this.goodsService.get(groupgoods.getGoods_id());
      if (goods != null && goods.getGoods_name() != null) {
        groupname = goods.getGoods_name();
      }
    }

    // 将从数据库中查询的所属分类存入分类隐藏域中
    backCategory(groupgoods.getCat_attr());
    return goUrl(VIEW);
  }