/**
  * 覆写父的数据显示响应事件<br>
  * 逻辑为直接返回字段值<br>
  * 如果为null返回空串
  */
 @Override
 public Object onShow(DataField field, Object value) {
   if (value != null) {
     value = UploadUtil.replacePath(value.toString());
     return value;
   } else return "";
 }
 /*     */ public EopSite get(Integer id) /*     */ {
   /* 298 */ String sql = "select * from eop_site where  id = ?";
   /* 299 */ EopSite site =
       (EopSite) this.daoSupport.queryForObject(sql, EopSite.class, new Object[] {id});
   /* 300 */ String icofile = site.getIcofile();
   /* 301 */ if (icofile != null) /* 302 */ icofile = UploadUtil.replacePath(icofile);
   /* 303 */ site.setIcofile(icofile);
   /*     */
   /* 305 */ String logofile = site.getLogofile();
   /* 306 */ if (logofile != null) {
     /* 307 */ logofile = logofile.replaceAll(EopSetting.FILE_STORE_PREFIX, getContext(site));
     /*     */ }
   /* 309 */ site.setLogofile(logofile);
   /*     */
   /* 311 */ String bklogofile = site.getBklogofile();
   /* 312 */ if (bklogofile != null) {
     /* 313 */ bklogofile = bklogofile.replaceAll(EopSetting.FILE_STORE_PREFIX, getContext(site));
     /*     */ }
   /*     */
   /* 316 */ site.setBklogofile(bklogofile);
   /*     */
   /* 318 */ String bkloginpicfile = site.getBkloginpicfile();
   /* 319 */ if (bkloginpicfile != null) {
     /* 320 */ bkloginpicfile =
         bkloginpicfile.replaceAll(EopSetting.FILE_STORE_PREFIX, getContext(site));
     /*     */ }
   /*     */
   /* 323 */ site.setBkloginpicfile(bkloginpicfile);
   /* 324 */ return site;
   /*     */ }
Exemple #3
0
 public Adv getAdvDetail(Long advid) {
   Adv adv =
       this.baseDaoSupport.queryForObject("select * from adv where aid = ?", Adv.class, advid);
   String pic = adv.getAtturl();
   if (pic != null) {
     pic = UploadUtil.replacePath(pic);
     adv.setAtturl(pic);
   }
   return adv;
 }
  public void execute(
      Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body)
      throws TemplateException, IOException {

    String pic = params.get("pic").toString();
    if (StringUtil.isEmpty(pic))
      pic = "http://" + EopSetting.IMG_SERVER_DOMAIN + "/images/no_picture.jpg";
    if (pic.startsWith("fs:")) {
      pic = UploadUtil.replacePath(pic);
    }
    String postfix = params.get("postfix").toString();
    env.getOut().write(UploadUtil.getThumbPath(pic, postfix));
  }
 /*    */ public Map get(Integer valueId) /*    */ {
   /* 44 */ String sql =
       "select sv.*,s.spec_type from "
           + getTableName("spec_values")
           + " sv,"
           + getTableName("specification")
           + " s  where sv.spec_id=s.spec_id and sv.spec_value_id =?";
   /* 45 */ Map temp = this.daoSupport.queryForMap(sql, new Object[] {valueId});
   /* 46 */ String spec_image = (String) temp.get("spec_image");
   /* 47 */ if (spec_image != null) {
     /* 48 */ spec_image = UploadUtil.replacePath(spec_image);
     /*    */ }
   /* 50 */ temp.put("spec_image", spec_image);
   /* 51 */ return temp;
   /*    */ }
Exemple #6
0
  public Object mapRow(ResultSet rs, int rowNum) throws SQLException {

    CartItem cartItem = new CartItem();
    cartItem.setId(rs.getInt("cart_id"));
    cartItem.setProduct_id(rs.getInt("product_id"));
    cartItem.setGoods_id(rs.getInt("goods_id"));
    cartItem.setName(rs.getString("name"));
    cartItem.setMktprice(rs.getDouble("mktprice"));
    cartItem.setPrice(rs.getDouble("price"));
    cartItem.setCoupPrice(rs.getDouble("price")); // 优惠价格默认为销售价,则优惠规则去改变
    //	cartItem.setCatid(rs.getInt("catid"));

    String image_default = rs.getString("image_default");

    if (image_default != null) {
      image_default = UploadUtil.replacePath(image_default);
    }
    cartItem.setImage_default(image_default);
    cartItem.setNum(rs.getInt("num"));
    cartItem.setPoint(rs.getInt("point"));
    cartItem.setItemtype(rs.getInt("itemtype"));
    if (cartItem.getItemtype().intValue() == 0) {
      cartItem.setAddon(rs.getString("addon"));
    }
    // 赠品设置其限购数量
    if (cartItem.getItemtype().intValue() == 2) {
      cartItem.setLimitnum(rs.getInt("limitnum"));
    }

    if (cartItem.getItemtype().intValue() == 1) {
      cartItem.setSn(rs.getString("sn"));
    }

    if (cartItem.getItemtype().intValue() == 0) {
      String specs = rs.getString("specs");
      cartItem.setSpecs(specs);
      if (StringUtil.isEmpty(specs)) cartItem.setName(cartItem.getName());
      else cartItem.setName(cartItem.getName() + "(" + specs + ")");
    }

    return cartItem;
  }
  @Override
  public String onDisplay(DataField field, Object value) {
    StringBuffer html = new StringBuffer();
    html.append(
        "<textarea id=\""
            + field.getEnglish_name()
            + "\" name=\""
            + field.getEnglish_name()
            + "\">");
    if (value != null) {
      value = UploadUtil.replacePath(value.toString());
      html.append(value);
    }
    html.append("</textarea>");
    html.append("<script type=\"text/javascript\">");
    html.append("$('#" + field.getEnglish_name() + "' ).ckeditor( );");
    html.append("</script>");

    return html.toString();
  }
 /*     */ public String getEditHtml(Map goods, HttpServletRequest request) /*     */ {
   /*  48 */ String contextPath = request.getContextPath();
   /*     */
   /*  50 */ FreeMarkerPaser freeMarkerPaser = FreeMarkerPaser.getInstance();
   /*     */
   /*  53 */ String image_default = null;
   /*  54 */ if ((goods.get("image_file") != null) && (goods.get("image_file") != "")) {
     /*  55 */ String image_file = goods.get("image_file").toString();
     /*  56 */ String[] thumbnail_images = StringUtils.split(image_file, ",");
     /*     */
     /*  58 */ image_default = (String) goods.get("image_default");
     /*  59 */ if (!StringUtil.isEmpty(image_default)) {
       /*  60 */ image_default = UploadUtil.replacePath(image_default);
       /*     */ }
     /*     */
     /*  64 */ freeMarkerPaser.putData("ctx", contextPath);
     /*  65 */ freeMarkerPaser.putData("image_default", image_default);
     /*  66 */ freeMarkerPaser.putData("thumbnail_images", thumbnail_images);
     /*     */ }
   /*     */
   /*  69 */ freeMarkerPaser.setPageName("album");
   /*  70 */ String html = freeMarkerPaser.proessPageContent();
   /*  71 */ return html;
   /*     */ }