Package com.lgx8.management.entities

Examples of com.lgx8.management.entities.Advertisement


        entityUrl = brand.getImageUrl();
        entityName = brand.getName();
      }else if("2".equals(categoryType))
      {
        //广告
        Advertisement advertisment = gatewayService.findAdvertisementById(Long.parseLong(entityId));
        entityUrl = advertisment.getTPLJ();
        if(advertisment != null && advertisment.getMerchant() != null)
        {
          entityName = advertisment.getMerchant().getSJMC();
        }
       
      }else if("6".equals(categoryType))
      {
        //商家
        Advertisement advertisment = gatewayService.findAdvertisementById(Long.parseLong(entityId));
        entityUrl = advertisment.getTPLJ();
        if(advertisment.getMerchant() != null)
        {
          entityName = advertisment.getMerchant().getSJMC();
          entityId = advertisment.getMerchant().getID()+"";
        }
      }else if("8".equals(categoryType))
      {
        //商品分类
        Category area = gatewayService.findCategory(Long.parseLong(entityId));
View Full Code Here


              if(suc){
                File _new = new File(url+System.getProperty("file.separator")+_m.getID()+_ed);
                _new.createNewFile();
                BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(_new));
                Streams.copy( bis, bos, true);
                Advertisement ad = new Advertisement();
                ad.setMerchant(_m);
                ad.setUser(rtUser);
                ad.setTPLJ(_new.getPath());
                ad.setUrl(null);
                ad.setSJSJ(new Date());
                ad.setQX(10000);
                ad.setTplx("01");
                advertisementDao.createAdvertisement(ad);
                request.setAttribute("advertisement", ad);
              }
            }
          }
View Full Code Here

      ServletFileUpload upload = new ServletFileUpload(factory);
      upload.setSizeMax(Constants.UPLOAD_MAX_SIZE);
      try {
        List fileItems = upload.parseRequest(request);
        Iterator iter = fileItems.iterator();
        Advertisement ad = new Advertisement();
        ad.setMerchant(_m);
        ad.setUser(rtUser);
        ad.setUrl(null);
        ad.setSJSJ(new Date());
        ad.setQX(10000);
        while (iter.hasNext()) {
          FileItem item = (FileItem) iter.next();
          if (!item.isFormField()){
            String fileName = item.getName();
            if (fileName != null && fileName.length() != 0) {
              BufferedInputStream bis = new BufferedInputStream(item.getInputStream());
              String _fn = fileName.substring(fileName.lastIndexOf(System.getProperty("file.separator"))+1);
              String _ed = _fn.substring(_fn.indexOf('.'));
              String path = ManagementAction.class.getClassLoader().getResource("/").getPath();
              File file = new File(path);
              File p_file = new File(file.getParent());
              String url = p_file.getParent()+System.getProperty("file.separator")+"merchant_picture"+System.getProperty("file.separator")+new Date().getTime()+"_"+_m.getID();
              boolean suc = new File(p_file.getParent()+System.getProperty("file.separator")+"merchant_picture"+System.getProperty("file.separator")+new Date().getTime()+"_"+_m.getID()).mkdirs();
              if(suc){
                File _new = new File(url+System.getProperty("file.separator")+_m.getID()+_ed);
                _new.createNewFile();
                BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(_new));
                Streams.copy( bis, bos, true);
                ad.setTPLJ(_new.getPath());
                ad.setTplx("02");
              }
            }
          }else{
            String tpmx = item.getString();
            ad.setTpmx(tpmx);
          }
        }
        advertisementDao.createAdvertisement(ad);
      } catch (FileUploadException e) {
        e.printStackTrace();
View Full Code Here

   * **/
  @RequestMapping("/advertisement/modifyAdvertisementIni.do")
  public ModelAndView modifyAdvertisementIni(HttpServletRequest request,HttpServletResponse response){
    String adId = request.getParameter("adId");
    if(isNumber(adId)){
      Advertisement ad = advertisementDao.findAdvertisementById(Long.parseLong(adId.trim()));
      request.setAttribute("advertisement", ad);
      if(User.USER_TYPE_MERCHANT==ad.getUser().getUsertype()){
        return  new ModelAndView("/management/advertisement/advertisement_merchant_add");
      }else if(User.USER_TYPE_YYCENTER==ad.getUser().getUsertype()
          ||User.USER_TYPE_TGCENTER==ad.getUser().getUsertype()
          ||User.USER_TYPE_TGSTATION==ad.getUser().getUsertype()){
        return  new ModelAndView("/management/advertisement/advertisement_organization_add");
      }
    }
    return null;
  }
View Full Code Here

   * **/
  @RequestMapping("/advertisement/deleteAdvertisement.do")
  public ModelAndView deleteAdvertisement(HttpServletRequest request,HttpServletResponse response){
    String adId = request.getParameter("adId");
    if(isNumber(adId)){
      Advertisement ad = new Advertisement();
      ad.setID(Long.parseLong(adId.trim()));
      ad.setUser(RunTimeUser.getRunTimeUser(request));
      advertisementDao.deleteAdvertisement(ad);
    }
    return  new ModelAndView("/management/advertisement/advertisement_generallist");
  }
View Full Code Here

      merchant = merchantDao.getMerchantById(mid);
    }
    if(merchant!=null){
      File picture = fileUpload(request,"picture",merchant);
      if(adId!=null&&isNumber(adId)){
        Advertisement ad = advertisementDao.findAdvertisementById(Long.parseLong(adId.trim()));
        if(ad!=null){
          try {
            String orignalFilePath = ad.getTPLJ();
            ad.setUser(rtUser);
            if(null!=picture)ad.setTPLJ(getSourceURL(picture.getPath()));
            if(null!=tpmx)ad.setTpmx(tpmx);
            if(null!=tplx)ad.setTplx(tplx);
            ad.setLayerOrder(layerOrder);
            advertisementDao.updateAdervertisement(ad);
            File orignalFile = new File(orignalFilePath);
            if(orignalFile.exists())orignalFile.delete();
          }catch (Exception e) {
            e.printStackTrace();
          }
        }
      }else{
        try {
          Advertisement ad = new Advertisement();
          ad.setMerchant(merchant);
          ad.setUser(rtUser);
          if(null!=picture)ad.setTPLJ(getSourceURL(picture.getPath()));
          ad.setUrl(null);
          ad.setSJSJ(new Date());
          ad.setQX(10000);
          ad.setTplx(tplx);
          ad.setTpmx(tpmx);
          ad.setLayerOrder(layerOrder);
          advertisementDao.createAdvertisement(ad);
        } catch (Exception e) {
          e.printStackTrace();
        }
     
View Full Code Here

    }
    if(null!=merchant){
      File picture = fileUpload(request,"picture",merchant);
      if(adId!=null&&isNumber(adId)){
        //修改
        Advertisement ad = advertisementDao.findAdvertisementById(Long.parseLong(adId.trim()));
        if(ad!=null){
          try {
            String orignalFilePath = ad.getTPLJ();
            ad.setMerchant(merchant);
            ad.setUser(rtUser);
            ad.setTplx(tplx);
            ad.setTpmx(tpmx);
            if(null!=picture)ad.setTPLJ(getSourceURL(picture.getPath()));
            advertisementDao.updateAdervertisement(ad);
            File orignalFile = new File(orignalFilePath);
            if(orignalFile.exists())orignalFile.delete();
          }catch (Exception e) {
            e.printStackTrace();
          }
        }
     
      }else{
        //添加
        try {
          Advertisement ad = new Advertisement();
          ad.setMerchant(merchant);
          ad.setUser(rtUser);
          ad.setTplx(tplx);
          ad.setTpmx(tpmx);
          if(null!=picture)ad.setTPLJ(getSourceURL(picture.getPath()));
          ad.setUrl(null);
          ad.setSJSJ(new Date());
          ad.setQX(10000);
          //ad.setTplx("01");
          advertisementDao.createAdvertisement(ad);
        } catch (Exception e) {
          e.printStackTrace();
        }
View Full Code Here

  @RequestMapping("/recharge/initrecharge.do")
  public String initRechargePage(HttpServletRequest request,HttpServletResponse response){
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(rtUser!=null&&rtUser.getUsertype()==User.USER_TYPE_MERCHANT){
      long _mid = rtUser.getOrganizationid();
      Merchant _m = merchantDao.getMerchantById(_mid);
      request.setAttribute("merchant", _m);
    }
    return "/management/recharge/create_rechargehistory";
  }
View Full Code Here

  @RequestMapping("/recharge/initrechargeapply.do")
  public String initRechargePageApply(HttpServletRequest request,HttpServletResponse response){
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(rtUser!=null&&rtUser.getUsertype()==User.USER_TYPE_MERCHANT){
      long _mid = rtUser.getOrganizationid();
      Merchant _m = merchantDao.getMerchantById(_mid);
      request.setAttribute("merchant", _m);
    }
    return "/management/recharge/create_rechargeapply";
  }
View Full Code Here

    String czje = request.getParameter("czje");
    String czjf = "";
    String[] is_nore = request.getParameterValues("is_nore");
    if(rtUser!=null&&rtUser.getUsertype()==User.USER_TYPE_MERCHANT){
      long _mid = rtUser.getOrganizationid();
      Merchant _m = merchantDao.getMerchantById(_mid);
      Rechargehistory rechargeh = new Rechargehistory();
      rechargeh.setCZYHBH(rtUser);
      rechargeh.setCZSJ(new Date());
      rechargeh.setRESERVATION01(Rechargehistory.RECHARGEHISTORY_CZLX_SDCZ);
      rechargeh.setCzzt(Rechargehistory.RECHARGEHISTORY_INIT);
View Full Code Here

TOP

Related Classes of com.lgx8.management.entities.Advertisement

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.