Ejemplo n.º 1
0
  /**
   * 更新杂志logo
   *
   * @return
   */
  public String updatePublicationLogo() {
    Publisher publisher = this.getSessionPublisher();
    this.publication = publicationService.queryById(publicationId);
    publication.setLogo(
        "/" + publisher.getId() + "/" + publicationId + "/" + logoFileName); // 杂志logo
    publicationService.updateByIdAndPublisherId(publication);
    // 将文件拷贝到url
    this.jsonResult =
        publicationService.savePublicationLogo(
            publisher.getId(), publicationId, this.logoFileName, x, y, width, height);

    return JSON;
  }
Ejemplo n.º 2
0
  /**
   * 图片上传
   *
   * @return
   */
  public String uploadLogoJson() {
    Publisher publisher = this.getSessionPublisher();
    try {
      this.jsonResult =
          this.publicationService.uploadPublicationLogo(
              publisher.getId(), publicationId, logoFile, logoFileContentType, logoFileFileName);

      this.jsonResult.put("logoFileName", this.jsonResult.get("avatarFileName"));
      //			publication.setLogo((String)this.jsonResult
      //					.get("tempAvatarUrl"));
    } catch (Exception e) {
      e.printStackTrace();
    }
    return "upload_json";
  }
Ejemplo n.º 3
0
 /**
  * 杂志设置的起始页 、以及单个杂志 的数据初始化
  *
  * @return
  */
 public String to() {
   Publisher publisher = this.getSessionPublisher();
   Admin admin = this.getSessionAdmin();
   categoryList = categoryService.queryAllChildCategories();
   if (publisher != null
       && (publisher.getLevel().equals(PojoConstant.PUBLISHER.LEVEL_0)
           || publisher.getLevel().equals(PojoConstant.PUBLISHER.LEVEL_1))) {
     this.publicationList =
         publicationService.getListByNameAndPublisherId(null, publisher.getId(), null, null, -1);
     return "config";
   } else if (admin != null) {
     this.publicationList =
         publicationService.getListByNameAndPublisherId(null, null, null, null, -1);
     return "config";
   } else {
     return "deny";
   }
 }
Ejemplo n.º 4
0
  public String doPojoJson() {
    this.jsonResult = new JsonResult();
    this.jsonResult.setCode(JsonResult.CODE.FAILURE);
    this.jsonResult.setMessage(JsonResult.MESSAGE.FAILURE);
    // 如果是出版商检验其权利 begin
    Publisher pu = this.getSessionPublisher();
    boolean checkUser = false;
    if (pu != null) { // 出版商用户
      List<Publication> tpList = publicationService.queryAuditByPublisherId(pu.getId());
      if (tpList != null) {
        for (Publication puc : tpList) {
          String tempS = puc.getId() + "";
          if (tempS.equals(publicationId + "")) {
            checkUser = true;
          }
        }
      }

      if (!checkUser) {
        this.jsonResult.setMessage("没有权限");
        return JSON;
      }
    }

    // 如果是出版商检验其权利 end
    this.publication = publicationService.queryById(publicationId);
    pcRel = publicationCategoryRelService.getList(publicationId);
    //		this.generateJsonResult(JsonResult.CODE.SUCCESS,
    //                JsonResult.MESSAGE.SUCCESS, "publication", this.publication);

    this.jsonResult.setCode(JsonResult.CODE.SUCCESS);
    this.jsonResult.setMessage(JsonResult.MESSAGE.SUCCESS);
    Map<String, Object> objMap = new HashMap<String, Object>();
    objMap.put("publication", this.publication);
    objMap.put("pcRel", pcRel);
    this.jsonResult.setData(objMap);
    return JSON;
  }
Ejemplo n.º 5
0
  /**
   * 新建或编辑杂志信息
   *
   * @return
   */
  public String doJson() {
    Publisher publisher = this.getSessionPublisher();
    publication.setPublisherId(publisher.getId()); // 出版商id

    this.jsonResult =
        publicationService.savePublication(
            publication, this.getSessionPublisherId(), publisher.getLevel());
    // 获取对应的杂质集合
    if (publisher != null
        && (publisher.getLevel().equals(PojoConstant.PUBLISHER.LEVEL_0)
            || publisher.getLevel().equals(PojoConstant.PUBLISHER.LEVEL_1))) {
      this.publicationList =
          publicationService.getListByNameAndPublisherId(null, publisher.getId(), null, null, -1);
    } else if (publisher != null && publisher.getLevel().equals(PojoConstant.PUBLISHER.LEVEL_2)) {
      this.publicationList =
          publicationService.getListByNameAndPublisherId(null, null, null, null, -1);
    }
    Map<String, Object> objMap = new HashMap<String, Object>();
    objMap.put("publicationList", this.publicationList);
    this.jsonResult.setData(objMap);

    return JSON;
  }