示例#1
0
  public Number preEditNewspaper(String mode, Number docId, String compCode) {
    this.getDBTransaction().getSession().getUserData().put("compCode", compCode);
    Number result = null;
    CmsNewspaperTVOImpl newspaperTVO = this.getCmsNewspaperTVO();
    if ("CREATE".equals(mode)) {
      CmsDocTVOImpl docVO = this.getCmsDocTVO();
      CmsDocTVORowImpl docNewRow = (CmsDocTVORowImpl) docVO.createRow();
      docNewRow.setStatus("TO_GATHER_NEWSPAPER");
      docNewRow.setLibCode("NEWSPAPER");
      docNewRow.setLibTypeCode("END_PROD_LIB");
      docNewRow.setCompCode(compCode);
      docVO.insertRow(docNewRow);

      CmsNewspaperTVORowImpl newRow = (CmsNewspaperTVORowImpl) newspaperTVO.createRow();

      // 初始化
      CmsNewspaperCategoryVOImpl newspaperCategoryVO = this.getCmsNewspaperCategoryVO();
      CmsNewspaperCategoryVORowImpl row =
          (CmsNewspaperCategoryVORowImpl) newspaperCategoryVO.first();
      if (row != null) {
        newRow.setNewspaperCategoryId(row.getNewspaperCategoryId());
        newRow.setDocId(docNewRow.getDocId());
        newRow.setPrice(row.getPrice());
        newRow.setNewspaperType(row.getNewspaperType());
        newRow.setNewspaperTypeMeaning(row.getNewspaperTypeMeaning());
        newRow.setIssn(row.getIssn());
        newRow.setCn(row.getCn());
        newRow.setLang(row.getLang());
        newRow.setLangMeaning(row.getLangMeaning());
        newRow.setChiefEditor(row.getChiefEditor());
        newRow.setBookSize(row.getBookSize());
        newRow.setBookSizeMeaning(row.getBookSizeMeaning());
        newRow.setProdSize(row.getProdSize());
        newRow.setProdSizeMeaning(row.getProdSizeMeaning());
        newRow.setReaderGroup(row.getReaderGroup());
        newRow.setReaderGroupMeaning(row.getReaderGroupMeaning());
        newspaperTVO.insertRow(newRow);
        preDocCategroupRel(mode, docNewRow.getDocId(), row.getNewspaperCategoryId());
      }

      result = newRow.getDocId();
    } else {
      result = docId;
      newspaperTVO.setbvDocId(docId);
      newspaperTVO.executeQuery();
      Row row = newspaperTVO.first();
      if (row != null) {
        row.setAttribute("LastUpdateDate", new Date());
        newspaperTVO.setCurrentRow(row);
      }
      preDocCategroupRel(mode, docId, null);
    }
    return result;
  }
示例#2
0
 public void initYear(Number categoryId) {
   CmsNewspaperTVOImpl newspaperTVO = this.getCmsNewspaperTVO();
   CmsNewspaperTVORowImpl currentRow = (CmsNewspaperTVORowImpl) newspaperTVO.getCurrentRow();
   // 初始化
   CmsNewspaperCategoryVOImpl newspaperCategoryVO = this.getCmsNewspaperCategoryVO();
   Row[] categoryRows = newspaperCategoryVO.getFilteredRows("NewspaperCategoryId", categoryId);
   if (categoryRows.length > 0) {
     CmsNewspaperCategoryVORowImpl row = (CmsNewspaperCategoryVORowImpl) categoryRows[0];
     currentRow.setNewspaperCategoryId(row.getNewspaperCategoryId());
     currentRow.setPrice(row.getPrice());
     currentRow.setNewspaperType(row.getNewspaperTypeMeaning());
     currentRow.setIssn(row.getIssn());
     currentRow.setCn(row.getCn());
     currentRow.setLang(row.getLangMeaning());
     currentRow.setChiefEditor(row.getChiefEditor());
     currentRow.setBookSize(row.getBookSizeMeaning());
     newspaperTVO.setCurrentRow(currentRow);
   }
 }