⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cataloguecreater.java

📁 dgbas公文管理核心java源码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*
 * Copyright (c) 1989-2003 Jasson Technology. All Rights Reserved.
 * Version: 1.0
 * Date: 2003/00/00
 * Author: Joe Kuei
 * Note:
 */

package com.jasson.business.archive;

import com.jasson.common.DateUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;

import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.jasson.common.XmlException;
import com.jasson.common.XmlUtil;
import com.jasson.business.archive.vo.CatalogueVO;
import com.jasson.business.common.DbConn;

public class CatalogueCreater
    implements ArchiveCatalogueIF {

    public static final int SUBMIT_FORMAT = 1;
    public static final int NONE_SUBMIT_FORMAT = 2;

    public CatalogueCreater() {
    }

    public Document createCatalogue(String sql, int format) {
        try {
            Document document = XmlUtil.createDomDocument();
            Element root = XmlUtil.createElement(document, ROOT_TAG, "");
            Vector data = new Vector();
            CatalogueVO[] vo= CatalogueVO.find(sql);
            System.out.println(vo);
            if(vo!=null)
             for(int i=0;i<vo.length;i++)
             {
             	vo[0].setMerage(true);
            	data.add(vo[i]);
            	
            }	

            int count = 1;
            Iterator iterator = data.iterator();
            while (iterator.hasNext()) {
            	System.out.println("ok");
                CatalogueVO catalogue = (CatalogueVO) iterator.next();
                Element archive = XmlUtil.createElement(document, "ROW", "");
                XmlUtil.setAttributeByInt(archive, "num", count);
                count++;
                Element name = XmlUtil.createElement(document,
                    TRANSFER_NAME_TAG, catalogue.getCatalogueName());
                archive.appendChild(name);
                Element function = XmlUtil.createElement(document,
                    FUNCTION_NAME_TAG, catalogue.getCatalogueFunction());
                archive.appendChild(function);
                Element caseReason = XmlUtil.createElement(document,
                    CASE_REASON_TAG, catalogue.getCaseReason());
                archive.appendChild(caseReason);

                if (catalogue.getAbreastName() != null) {
                    Element abreastName = XmlUtil.createElement(document,
                        ABREAST_NAME_TAG, catalogue.getAbreastName());
                    archive.appendChild(abreastName);
                }
                if (catalogue.getAlternativeName() != null) {
                    Element alternativeName = XmlUtil.createElement(
                        document,
                        ALTERNATIVE_NAME_TAG, catalogue.getAlternativeName());
                    archive.appendChild(alternativeName);
                }
                if (catalogue.getCaseName() != null) {
                    Element caseName = XmlUtil.createElement(document,
                        CASE_NAME_TAG, catalogue.getCaseName());
                    archive.appendChild(caseName);
                }
                if (catalogue.getRelativeCase() != null) {
                    Element relativeCase = XmlUtil.createElement(document,
                        RELATIVE_CASE_TAG, catalogue.getRelativeCase());
                    archive.appendChild(relativeCase);
                }
                if (catalogue.getPrimarySender() != null) {
                    Element primarySender = XmlUtil.createElement(document,
                        PRIMARY_TRANSFER_TAG, catalogue.getPrimarySender());
                    archive.appendChild(primarySender);
                }

                if (catalogue.getPrimaryReceiver() != null) {
                    Element primaryTransfer = XmlUtil.createElement(
                        document,
                        PRIMARY_SENDER_TAG, catalogue.getPrimaryReceiver());
                    archive.appendChild(primaryTransfer);
                }

                if (catalogue.getSecondarySender() != null) {
                    Element secondarySender = XmlUtil.createElement(
                        document,
                        SECONDARY_TRANSFER_TAG,
                        catalogue.getSecondarySender());
                    archive.appendChild(secondarySender);
                }
                if (catalogue.getSecondaryReceiver() != null) {
                    Element secondaryTransfer = XmlUtil.createElement(
                        document,
                        SECONDARY_SENDER_TAG,
                        catalogue.getSecondaryReceiver());
                    archive.appendChild(secondaryTransfer);
                }

                if (catalogue.getSenderAdjustment() != null) {
                    Element senderAdjustment = XmlUtil.createElement(
                        document,
                        SENDER_ADJUSTMENT_TAG,
                        catalogue.getSenderAdjustment());
                    archive.appendChild(senderAdjustment);
                }
                if (catalogue.getReceiverAdjustment() != null) {
                    Element transferAdjustment = XmlUtil.createElement(
                        document,
                        TRANSFER_ADJUSTMENT_TAG,
                        catalogue.getReceiverAdjustment());
                    archive.appendChild(transferAdjustment);
                }

                if (!catalogue.getDocumentType().equals("")) {
                    Element documentType = XmlUtil.createElement(document,
                        DOCUMENT_TYPE_TAG, catalogue.getDocumentType());
                    archive.appendChild(documentType);
                }
                if (!catalogue.getCopyType().equals("")) {
                    Element copyType = XmlUtil.createElement(document,
                        COPY_TYPE_TAG, catalogue.getCopyType());
                    archive.appendChild(copyType);
                }
                if (!catalogue.getSecurityLevel().equals("")) {
                    Element securityLevel = XmlUtil.createElement(document,
                        SECURITY_LEVEL_TAG, catalogue.getSecurityLevel());
                    archive.appendChild(securityLevel);
                }

                if (catalogue.getDecryptRestriction() != null) {
                    Element decyptRestriction = XmlUtil.createElement(
                        document,
                        DECYPT_RESTRITION_TAG,
                        catalogue.getDecryptRestriction());
                    archive.appendChild(decyptRestriction);
                }
                if (catalogue.getKeepingYears() != 0) {
                    Element keepingYears = XmlUtil.createElement(document,
                        KEEPING_YEAR_TAG, catalogue.getKeepingYears());
                    archive.appendChild(keepingYears);
                }
                if (catalogue.getAppliedRestriction() != null) {
                    Element appliedRestriction = XmlUtil.createElement(
                        document,
                        APPLYIED_RESTRICTION_TAG,
                        catalogue.getAppliedRestriction());
                    archive.appendChild(appliedRestriction);
                }
                if (catalogue.getStatus() != null) {
                    Element status = XmlUtil.createElement(document,
                        STATUS_TAG,
                        catalogue.getStatus());
                    archive.appendChild(status);
                }

                if (catalogue.getAdjustedKeepingYears() != 0) {
                    Element adjustedKeepingYears = XmlUtil.createElement(
                        document, ADJUSTED_KEEPING_YEARS_TAG,
                        catalogue.getAdjustedKeepingYears());
                    archive.appendChild(adjustedKeepingYears);
                }
                if (catalogue.getAdjustReason() != null) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -