commit 0095a9b4ac94d77aa39bd31bdaf7a1fb8e1ba888 Author: xiongcz Date: Tue Jun 3 19:11:01 2025 +0800 试制单看板备份 diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..5ee10c1 --- /dev/null +++ b/.classpath @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..322e683 --- /dev/null +++ b/.project @@ -0,0 +1,28 @@ + + + cn.net.connor.hzsb01 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0869a9b --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 0000000..730a370 --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,392 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Hzsb01 +Bundle-SymbolicName: cn.net.connor.hzsb01;singleton:=true +Bundle-Version: 1.0.0 +Export-Package: ., + cn.net.connor.plm.trialProductionContactForm, + com.microsoft.schemas.compatibility, + com.microsoft.schemas.compatibility.impl, + com.microsoft.schemas.office.drawing.x2008.diagram, + com.microsoft.schemas.office.drawing.x2008.diagram.impl, + com.microsoft.schemas.office.excel, + com.microsoft.schemas.office.excel.impl, + com.microsoft.schemas.office.office, + com.microsoft.schemas.office.office.impl, + com.microsoft.schemas.office.powerpoint, + com.microsoft.schemas.office.powerpoint.impl, + com.microsoft.schemas.office.spreadsheetml.x2018.threadedcomments, + com.microsoft.schemas.office.spreadsheetml.x2018.threadedcomments.impl, + com.microsoft.schemas.office.spreadsheetml.x2020.threadedcomments2, + com.microsoft.schemas.office.spreadsheetml.x2020.threadedcomments2.impl, + com.microsoft.schemas.office.visio.x2012.main, + com.microsoft.schemas.office.visio.x2012.main.impl, + com.microsoft.schemas.office.word, + com.microsoft.schemas.office.word.impl, + com.microsoft.schemas.office.word.x2012.wordml, + com.microsoft.schemas.office.word.x2012.wordml.impl, + com.microsoft.schemas.office.x2006.digsig, + com.microsoft.schemas.office.x2006.digsig.impl, + com.microsoft.schemas.vml, + com.microsoft.schemas.vml.impl, + org.apache.commons.collections4, + org.apache.commons.collections4.bag, + org.apache.commons.collections4.bidimap, + org.apache.commons.collections4.collection, + org.apache.commons.collections4.comparators, + org.apache.commons.collections4.functors, + org.apache.commons.collections4.iterators, + org.apache.commons.collections4.keyvalue, + org.apache.commons.collections4.list, + org.apache.commons.collections4.map, + org.apache.commons.collections4.multimap, + org.apache.commons.collections4.multiset, + org.apache.commons.collections4.properties, + org.apache.commons.collections4.queue, + org.apache.commons.collections4.sequence, + org.apache.commons.collections4.set, + org.apache.commons.collections4.splitmap, + org.apache.commons.collections4.trie, + org.apache.commons.collections4.trie.analyzer, + org.apache.commons.compress, + org.apache.commons.compress.archivers, + org.apache.commons.compress.archivers.ar, + org.apache.commons.compress.archivers.arj, + org.apache.commons.compress.archivers.cpio, + org.apache.commons.compress.archivers.dump, + org.apache.commons.compress.archivers.examples, + org.apache.commons.compress.archivers.jar, + org.apache.commons.compress.archivers.sevenz, + org.apache.commons.compress.archivers.tar, + org.apache.commons.compress.archivers.zip, + org.apache.commons.compress.changes, + org.apache.commons.compress.compressors, + org.apache.commons.compress.compressors.brotli, + org.apache.commons.compress.compressors.bzip2, + org.apache.commons.compress.compressors.deflate, + org.apache.commons.compress.compressors.deflate64, + org.apache.commons.compress.compressors.gzip, + org.apache.commons.compress.compressors.lz4, + org.apache.commons.compress.compressors.lz77support, + org.apache.commons.compress.compressors.lzma, + org.apache.commons.compress.compressors.lzw, + org.apache.commons.compress.compressors.pack200, + org.apache.commons.compress.compressors.snappy, + org.apache.commons.compress.compressors.xz, + org.apache.commons.compress.compressors.z, + org.apache.commons.compress.compressors.zstandard, + org.apache.commons.compress.harmony, + org.apache.commons.compress.harmony.archive.internal.nls, + org.apache.commons.compress.harmony.pack200, + org.apache.commons.compress.harmony.unpack200, + org.apache.commons.compress.harmony.unpack200.bytecode, + org.apache.commons.compress.harmony.unpack200.bytecode.forms, + org.apache.commons.compress.java.util.jar, + org.apache.commons.compress.parallel, + org.apache.commons.compress.utils, + org.apache.commons.io, + org.apache.commons.io.comparator, + org.apache.commons.io.file, + org.apache.commons.io.file.spi, + org.apache.commons.io.filefilter, + org.apache.commons.io.function, + org.apache.commons.io.input, + org.apache.commons.io.input.buffer, + org.apache.commons.io.monitor, + org.apache.commons.io.output, + org.apache.commons.io.serialization, + org.apache.logging.log4j, + org.apache.logging.log4j.core, + org.apache.logging.log4j.core.appender, + org.apache.logging.log4j.core.appender.db, + org.apache.logging.log4j.core.appender.db.jdbc, + org.apache.logging.log4j.core.appender.mom, + org.apache.logging.log4j.core.appender.mom.jeromq, + org.apache.logging.log4j.core.appender.mom.kafka, + org.apache.logging.log4j.core.appender.nosql, + org.apache.logging.log4j.core.appender.rewrite, + org.apache.logging.log4j.core.appender.rolling, + org.apache.logging.log4j.core.appender.rolling.action, + org.apache.logging.log4j.core.appender.routing, + org.apache.logging.log4j.core.async, + org.apache.logging.log4j.core.config, + org.apache.logging.log4j.core.config.arbiters, + org.apache.logging.log4j.core.config.builder.api, + org.apache.logging.log4j.core.config.builder.impl, + org.apache.logging.log4j.core.config.composite, + org.apache.logging.log4j.core.config.json, + org.apache.logging.log4j.core.config.plugins, + org.apache.logging.log4j.core.config.plugins.convert, + org.apache.logging.log4j.core.config.plugins.processor, + org.apache.logging.log4j.core.config.plugins.util, + org.apache.logging.log4j.core.config.plugins.validation, + org.apache.logging.log4j.core.config.plugins.validation.constraints, + org.apache.logging.log4j.core.config.plugins.validation.validators, + org.apache.logging.log4j.core.config.plugins.visitors, + org.apache.logging.log4j.core.config.properties, + org.apache.logging.log4j.core.config.status, + org.apache.logging.log4j.core.config.xml, + org.apache.logging.log4j.core.config.yaml, + org.apache.logging.log4j.core.context.internal, + org.apache.logging.log4j.core.filter, + org.apache.logging.log4j.core.filter.mutable, + org.apache.logging.log4j.core.impl, + org.apache.logging.log4j.core.jackson, + org.apache.logging.log4j.core.jmx, + org.apache.logging.log4j.core.jmx.internal, + org.apache.logging.log4j.core.layout, + org.apache.logging.log4j.core.layout.internal, + org.apache.logging.log4j.core.lookup, + org.apache.logging.log4j.core.message, + org.apache.logging.log4j.core.net, + org.apache.logging.log4j.core.net.ssl, + org.apache.logging.log4j.core.osgi, + org.apache.logging.log4j.core.parser, + org.apache.logging.log4j.core.pattern, + org.apache.logging.log4j.core.script, + org.apache.logging.log4j.core.selector, + org.apache.logging.log4j.core.time, + org.apache.logging.log4j.core.time.internal, + org.apache.logging.log4j.core.tools, + org.apache.logging.log4j.core.tools.picocli, + org.apache.logging.log4j.core.util, + org.apache.logging.log4j.core.util.datetime, + org.apache.logging.log4j.core.util.internal, + org.apache.logging.log4j.internal, + org.apache.logging.log4j.internal.map, + org.apache.logging.log4j.message, + org.apache.logging.log4j.simple, + org.apache.logging.log4j.simple.internal, + org.apache.logging.log4j.spi, + org.apache.logging.log4j.status, + org.apache.logging.log4j.util, + org.apache.logging.log4j.util.internal, + org.apache.poi, + org.apache.poi.common, + org.apache.poi.common.usermodel, + org.apache.poi.common.usermodel.fonts, + org.apache.poi.ddf, + org.apache.poi.extractor, + org.apache.poi.hpsf, + org.apache.poi.hpsf.extractor, + org.apache.poi.hpsf.wellknown, + org.apache.poi.hssf, + org.apache.poi.hssf.eventmodel, + org.apache.poi.hssf.eventusermodel, + org.apache.poi.hssf.eventusermodel.dummyrecord, + org.apache.poi.hssf.extractor, + org.apache.poi.hssf.model, + org.apache.poi.hssf.record, + org.apache.poi.hssf.record.aggregates, + org.apache.poi.hssf.record.cf, + org.apache.poi.hssf.record.chart, + org.apache.poi.hssf.record.common, + org.apache.poi.hssf.record.cont, + org.apache.poi.hssf.record.crypto, + org.apache.poi.hssf.record.pivottable, + org.apache.poi.hssf.usermodel, + org.apache.poi.hssf.usermodel.helpers, + org.apache.poi.hssf.util, + org.apache.poi.ooxml, + org.apache.poi.ooxml.dev, + org.apache.poi.ooxml.extractor, + org.apache.poi.ooxml.util, + org.apache.poi.openxml4j.exceptions, + org.apache.poi.openxml4j.opc, + org.apache.poi.openxml4j.opc.internal, + org.apache.poi.openxml4j.opc.internal.marshallers, + org.apache.poi.openxml4j.opc.internal.unmarshallers, + org.apache.poi.openxml4j.util, + org.apache.poi.poifs.common, + org.apache.poi.poifs.crypt, + org.apache.poi.poifs.crypt.agile, + org.apache.poi.poifs.crypt.binaryrc4, + org.apache.poi.poifs.crypt.cryptoapi, + org.apache.poi.poifs.crypt.dsig, + org.apache.poi.poifs.crypt.dsig.facets, + org.apache.poi.poifs.crypt.dsig.services, + org.apache.poi.poifs.crypt.standard, + org.apache.poi.poifs.crypt.temp, + org.apache.poi.poifs.crypt.xor, + org.apache.poi.poifs.dev, + org.apache.poi.poifs.eventfilesystem, + org.apache.poi.poifs.filesystem, + org.apache.poi.poifs.macros, + org.apache.poi.poifs.nio, + org.apache.poi.poifs.property, + org.apache.poi.poifs.storage, + org.apache.poi.schemas.ooxml.system.ooxml, + org.apache.poi.schemas.vmldrawing, + org.apache.poi.schemas.vmldrawing.impl, + org.apache.poi.sl.draw, + org.apache.poi.sl.draw.geom, + org.apache.poi.sl.extractor, + org.apache.poi.sl.image, + org.apache.poi.sl.usermodel, + org.apache.poi.ss, + org.apache.poi.ss.extractor, + org.apache.poi.ss.format, + org.apache.poi.ss.formula, + org.apache.poi.ss.formula.atp, + org.apache.poi.ss.formula.constant, + org.apache.poi.ss.formula.eval, + org.apache.poi.ss.formula.eval.forked, + org.apache.poi.ss.formula.function, + org.apache.poi.ss.formula.functions, + org.apache.poi.ss.formula.ptg, + org.apache.poi.ss.formula.udf, + org.apache.poi.ss.usermodel, + org.apache.poi.ss.usermodel.helpers, + org.apache.poi.ss.util, + org.apache.poi.ss.util.cellwalk, + org.apache.poi.util, + org.apache.poi.wp.usermodel, + org.apache.poi.xddf.usermodel, + org.apache.poi.xddf.usermodel.chart, + org.apache.poi.xddf.usermodel.text, + org.apache.poi.xdgf.exceptions, + org.apache.poi.xdgf.extractor, + org.apache.poi.xdgf.geom, + org.apache.poi.xdgf.usermodel, + org.apache.poi.xdgf.usermodel.section, + org.apache.poi.xdgf.usermodel.section.geometry, + org.apache.poi.xdgf.usermodel.shape, + org.apache.poi.xdgf.usermodel.shape.exceptions, + org.apache.poi.xdgf.util, + org.apache.poi.xdgf.xml, + org.apache.poi.xslf.draw, + org.apache.poi.xslf.draw.geom, + org.apache.poi.xslf.extractor, + org.apache.poi.xslf.model, + org.apache.poi.xslf.usermodel, + org.apache.poi.xslf.util, + org.apache.poi.xssf, + org.apache.poi.xssf.binary, + org.apache.poi.xssf.eventusermodel, + org.apache.poi.xssf.extractor, + org.apache.poi.xssf.model, + org.apache.poi.xssf.streaming, + org.apache.poi.xssf.usermodel, + org.apache.poi.xssf.usermodel.extensions, + org.apache.poi.xssf.usermodel.helpers, + org.apache.poi.xssf.util, + org.apache.poi.xwpf, + org.apache.poi.xwpf.extractor, + org.apache.poi.xwpf.model, + org.apache.poi.xwpf.usermodel, + org.apache.xmlbeans, + org.apache.xmlbeans.impl.common, + org.apache.xmlbeans.impl.config, + org.apache.xmlbeans.impl.inst2xsd, + org.apache.xmlbeans.impl.inst2xsd.util, + org.apache.xmlbeans.impl.regex, + org.apache.xmlbeans.impl.repackage, + org.apache.xmlbeans.impl.richParser, + org.apache.xmlbeans.impl.schema, + org.apache.xmlbeans.impl.soap, + org.apache.xmlbeans.impl.store, + org.apache.xmlbeans.impl.tool, + org.apache.xmlbeans.impl.util, + org.apache.xmlbeans.impl.validator, + org.apache.xmlbeans.impl.values, + org.apache.xmlbeans.impl.xb.ltgfmt, + org.apache.xmlbeans.impl.xb.ltgfmt.impl, + org.apache.xmlbeans.impl.xb.substwsdl, + org.apache.xmlbeans.impl.xb.substwsdl.impl, + org.apache.xmlbeans.impl.xb.xmlconfig, + org.apache.xmlbeans.impl.xb.xmlconfig.impl, + org.apache.xmlbeans.impl.xb.xmlschema, + org.apache.xmlbeans.impl.xb.xmlschema.impl, + org.apache.xmlbeans.impl.xb.xsdownload, + org.apache.xmlbeans.impl.xb.xsdownload.impl, + org.apache.xmlbeans.impl.xb.xsdschema, + org.apache.xmlbeans.impl.xb.xsdschema.impl, + org.apache.xmlbeans.impl.xpath, + org.apache.xmlbeans.impl.xpath.saxon, + org.apache.xmlbeans.impl.xpath.xmlbeans, + org.apache.xmlbeans.impl.xpathgen, + org.apache.xmlbeans.impl.xsd2inst, + org.apache.xmlbeans.metadata.system.sXMLCONFIG, + org.apache.xmlbeans.metadata.system.sXMLLANG, + org.apache.xmlbeans.metadata.system.sXMLSCHEMA, + org.apache.xmlbeans.metadata.system.sXMLTOOLS, + org.apache.xmlbeans.soap, + org.apache.xmlbeans.xml.stream, + org.apache.xmlbeans.xml.stream.events, + org.etsi.uri.x01903.v13, + org.etsi.uri.x01903.v13.impl, + org.etsi.uri.x01903.v14, + org.etsi.uri.x01903.v14.impl, + org.openxmlformats.schemas.drawingml.x2006.chart, + org.openxmlformats.schemas.drawingml.x2006.chart.impl, + org.openxmlformats.schemas.drawingml.x2006.chartDrawing, + org.openxmlformats.schemas.drawingml.x2006.chartDrawing.impl, + org.openxmlformats.schemas.drawingml.x2006.diagram, + org.openxmlformats.schemas.drawingml.x2006.diagram.impl, + org.openxmlformats.schemas.drawingml.x2006.lockedCanvas, + org.openxmlformats.schemas.drawingml.x2006.lockedCanvas.impl, + org.openxmlformats.schemas.drawingml.x2006.main, + org.openxmlformats.schemas.drawingml.x2006.main.impl, + org.openxmlformats.schemas.drawingml.x2006.picture, + org.openxmlformats.schemas.drawingml.x2006.picture.impl, + org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing, + org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.impl, + org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing, + org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.impl, + org.openxmlformats.schemas.officeDocument.x2006.bibliography, + org.openxmlformats.schemas.officeDocument.x2006.bibliography.impl, + org.openxmlformats.schemas.officeDocument.x2006.characteristics, + org.openxmlformats.schemas.officeDocument.x2006.characteristics.impl, + org.openxmlformats.schemas.officeDocument.x2006.customProperties, + org.openxmlformats.schemas.officeDocument.x2006.customProperties.impl, + org.openxmlformats.schemas.officeDocument.x2006.customXml, + org.openxmlformats.schemas.officeDocument.x2006.customXml.impl, + org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes, + org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes.impl, + org.openxmlformats.schemas.officeDocument.x2006.extendedProperties, + org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.impl, + org.openxmlformats.schemas.officeDocument.x2006.math, + org.openxmlformats.schemas.officeDocument.x2006.math.impl, + org.openxmlformats.schemas.officeDocument.x2006.relationships, + org.openxmlformats.schemas.officeDocument.x2006.relationships.impl, + org.openxmlformats.schemas.officeDocument.x2006.sharedTypes, + org.openxmlformats.schemas.officeDocument.x2006.sharedTypes.impl, + org.openxmlformats.schemas.presentationml.x2006.main, + org.openxmlformats.schemas.presentationml.x2006.main.impl, + org.openxmlformats.schemas.schemaLibrary.x2006.main, + org.openxmlformats.schemas.schemaLibrary.x2006.main.impl, + org.openxmlformats.schemas.spreadsheetml.x2006.main, + org.openxmlformats.schemas.spreadsheetml.x2006.main.impl, + org.openxmlformats.schemas.wordprocessingml.x2006.main, + org.openxmlformats.schemas.wordprocessingml.x2006.main.impl, + org.openxmlformats.schemas.xpackage.x2006.digitalSignature, + org.openxmlformats.schemas.xpackage.x2006.digitalSignature.impl, + org.openxmlformats.schemas.xpackage.x2006.relationships, + org.openxmlformats.schemas.xpackage.x2006.relationships.impl, + org.w3.x2000.x09.xmldsig, + org.w3.x2000.x09.xmldsig.impl +Require-Bundle: org.eclipse.swt, + org.eclipse.jface, + com.teamcenter.rac.aifrcp;bundle-version="12000.3.0", + com.teamcenter.rac.common;bundle-version="12000.3.0", + com.teamcenter.rac.external;bundle-version="12000.3.0", + com.teamcenter.rac.kernel;bundle-version="12000.3.0", + com.teamcenter.rac.tcapps;bundle-version="12000.3.0", + com.teamcenter.rac.util;bundle-version="12000.3.0", + k.util;bundle-version="1.0.0", + TcSoaCoreLoose;bundle-version="12000.3.0", + TcSoaCoreRac;bundle-version="12000.3.0", + TcSoaCoreTypes;bundle-version="12000.3.0", + org.eclipse.ui;bundle-version="3.111.0" +Automatic-Module-Name: cn.net.connor.hzsb01 +Bundle-ClassPath: ., + lib/commons-collections4-4.4.jar, + lib/poi-ooxml-5.2.3.jar, + lib/xmlbeans-5.2.2.jar, + lib/poi-5.2.3.jar, + lib/commons-io-2.11.0.jar, + lib/log4j-api-2.24.3.jar, + lib/log4j-core-2.24.3.jar, + lib/commons-compress-1.23.0.jar, + lib/poi-ooxml-full-5.2.3.jar +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportAction.class b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportAction.class new file mode 100644 index 0000000..118ae64 Binary files /dev/null and b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportAction.class differ diff --git a/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog$1.class b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog$1.class new file mode 100644 index 0000000..dc9f51d Binary files /dev/null and b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog$1.class differ diff --git a/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog$2.class b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog$2.class new file mode 100644 index 0000000..c044e04 Binary files /dev/null and b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog$2.class differ diff --git a/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog.class b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog.class new file mode 100644 index 0000000..52847ab Binary files /dev/null and b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog.class differ diff --git a/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportHandler.class b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportHandler.class new file mode 100644 index 0000000..0e30f2a Binary files /dev/null and b/bin/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportHandler.class differ diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..8087617 --- /dev/null +++ b/build.properties @@ -0,0 +1,14 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + lib/commons-collections4-4.4.jar,\ + lib/poi-ooxml-5.2.3.jar,\ + lib/xmlbeans-5.2.2.jar,\ + lib/poi-5.2.3.jar,\ + lib/commons-io-2.11.0.jar,\ + lib/log4j-api-2.24.3.jar,\ + lib/log4j-core-2.24.3.jar,\ + lib/commons-compress-1.23.0.jar,\ + lib/poi-ooxml-full-5.2.3.jar diff --git a/lib/commons-collections4-4.4.jar b/lib/commons-collections4-4.4.jar new file mode 100644 index 0000000..da06c3e Binary files /dev/null and b/lib/commons-collections4-4.4.jar differ diff --git a/lib/commons-compress-1.23.0.jar b/lib/commons-compress-1.23.0.jar new file mode 100644 index 0000000..38e5505 Binary files /dev/null and b/lib/commons-compress-1.23.0.jar differ diff --git a/lib/commons-io-2.11.0.jar b/lib/commons-io-2.11.0.jar new file mode 100644 index 0000000..be507d9 Binary files /dev/null and b/lib/commons-io-2.11.0.jar differ diff --git a/lib/log4j-api-2.24.3.jar b/lib/log4j-api-2.24.3.jar new file mode 100644 index 0000000..4af1681 Binary files /dev/null and b/lib/log4j-api-2.24.3.jar differ diff --git a/lib/log4j-core-2.24.3.jar b/lib/log4j-core-2.24.3.jar new file mode 100644 index 0000000..0007e4e Binary files /dev/null and b/lib/log4j-core-2.24.3.jar differ diff --git a/lib/poi-5.2.3.jar b/lib/poi-5.2.3.jar new file mode 100644 index 0000000..22b19a3 Binary files /dev/null and b/lib/poi-5.2.3.jar differ diff --git a/lib/poi-ooxml-5.2.3.jar b/lib/poi-ooxml-5.2.3.jar new file mode 100644 index 0000000..2daf4b0 Binary files /dev/null and b/lib/poi-ooxml-5.2.3.jar differ diff --git a/lib/poi-ooxml-full-5.2.3.jar b/lib/poi-ooxml-full-5.2.3.jar new file mode 100644 index 0000000..e1911be Binary files /dev/null and b/lib/poi-ooxml-full-5.2.3.jar differ diff --git a/lib/xmlbeans-5.2.2.jar b/lib/xmlbeans-5.2.2.jar new file mode 100644 index 0000000..d638d68 Binary files /dev/null and b/lib/xmlbeans-5.2.2.jar differ diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..39d7997 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportAction.java b/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportAction.java new file mode 100644 index 0000000..8d409f2 --- /dev/null +++ b/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportAction.java @@ -0,0 +1,31 @@ +package cn.net.connor.plm.trialProductionContactForm; + +import java.awt.Frame; + +import com.teamcenter.rac.aif.AbstractAIFApplication; +import com.teamcenter.rac.aif.common.actions.AbstractAIFAction; +import com.teamcenter.rac.kernel.TCSession; + +public class TrialProductionContactFormReportAction extends AbstractAIFAction { + + private AbstractAIFApplication application; + private TCSession session; + + public TrialProductionContactFormReportAction(AbstractAIFApplication application, Frame frame, String param) { + super(application, frame, param); + this.application = application; + this.session = (TCSession) this.application.getSession(); + } + + @Override + public void run() { + System.out.println(">>>TrialProductionContactFormReportAction"); + try { + TrialProductionContactFormReportDialog dialog = new TrialProductionContactFormReportDialog(this.session); + } catch (Exception e) { + e.printStackTrace(); + } + + } + +} diff --git a/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog.java b/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog.java new file mode 100644 index 0000000..1e478d7 --- /dev/null +++ b/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportDialog.java @@ -0,0 +1,683 @@ +package cn.net.connor.plm.trialProductionContactForm; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.Closeable; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.filechooser.FileSystemView; +import javax.swing.table.DefaultTableModel; + +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCComponentForm; +import com.teamcenter.rac.kernel.TCComponentItemRevision; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.DateButton; +import com.teamcenter.rac.util.MessageBox; +import com.teamcenter.rac.util.PropertyLayout; +import com.teamcenter.rac.util.UIUtilities; + +public class TrialProductionContactFormReportDialog extends JFrame implements ActionListener { + + + + //全局变量 + private TCSession session; + + //构造器 + public TrialProductionContactFormReportDialog(TCSession session) throws Exception{ + System.out.println(">>>TrialProductionContactFormReportDialog"); + this.session = session; + try { + initUI(); + + } catch (Exception e) { + System.out.println("初始化【试制联系单看板】失败:"); + e.printStackTrace(); + } + } + + private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + + private DefaultTableModel model; + private JTable table; + private String[] columnNames = { + "试制联系单号", + "试制样件图号", + "试制样件名称", + "要求试制数量", + "实际试制数量", + "要求交样时间", + "试制完成时间", + "是否按时交样", + "试制结果说明", + "试制类型", + "样件用途"}; + +// private JLabel companyLabel = new JLabel("公司"); +// private JLabel idLabel = new JLabel("试制联系单号"); +// private JLabel thLabel = new JLabel("试制样件图号"); +// private JLabel deLabel = new JLabel("创建时间晚于"); +// private JLabel dsLabel = new JLabel("创建时间早于"); +// private JLabel nameLabel = new JLabel("试制样件名称"); +// private JLabel personLabel = new JLabel("创建人"); + + private JButton searchButton = new JButton("搜索"); + private JButton exportButton = new JButton("导出"); + + private JComboBox companyBox;//公司选择框 + private JTextField idTextArea;//试制联系单号输入框 + private JTextField thTextArea;//试制样件图号输入框 + private DateButton deButton;//创建时间晚于 + private DateButton dsButton;//创建时间早于 + private JTextField nameTextArea;//试制样件名称输入框 + private JTextField personTextArea;//创建人输入框 + + private List tableDataList = new ArrayList();//渲染到表格的数据集合 + + private void initUI() throws Exception { + System.out.println("initUi~"); + this.setTitle("试制联系单看板"); + this.setSize(300, 200); + this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + JPanel mainPanel = new JPanel(new BorderLayout(10, 10)); + mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + JPanel queryPanel = getQueryPanel(); + JScrollPane scrollPanel = getTablePanel(); + + this.add(queryPanel,BorderLayout.WEST); + this.add(scrollPanel,BorderLayout.CENTER); + + + this.pack(); // 自动调整窗口大小以适应内部组件 + this.setPreferredSize(new Dimension(1850,850)); + //放到屏幕中央 + UIUtilities.centerToScreen(this); + this.setVisible(true); + } + + /** + * 创建查询容器 + * @return + */ + private JPanel getQueryPanel() { + this.companyBox = new JComboBox(); + this.companyBox.addItem("老世宝"); + this.companyBox.addItem("新世宝"); + this.idTextArea = new JTextField(); + this.thTextArea = new JTextField(); + this.dsButton = new DateButton(null, "yyyy-MM-dd", false, false, false); + this.deButton = new DateButton(null, "yyyy-MM-dd", false, false, false); + this.nameTextArea = new JTextField(); + this.personTextArea = new JTextField(); + + setQueryInputWidth(100); + + JPanel panel = new JPanel(new PropertyLayout()); + + panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); +// panel.setBorder(BorderFactory.createTitledBorder("查询条件")); + // 创建表单面板,使用GridBagLayout实现左右对齐 + JPanel formPanel = new JPanel(new GridBagLayout()); + GridBagConstraints gbc = new GridBagConstraints(); + gbc.insets = new Insets(5, 5, 5, 5); + gbc.fill = GridBagConstraints.HORIZONTAL; + gbc.weightx = 0.5; + + // 添加公司选择 + gbc.gridx = 0; + gbc.gridy = 0; + gbc.anchor = GridBagConstraints.LINE_START; + formPanel.add(new JLabel("公司"), gbc); + + gbc.gridx = 1; + formPanel.add(this.companyBox, gbc); + + // 添加其他字段... + addFormRow(formPanel, gbc, "试制联系单号", this.idTextArea, 1); + addFormRow(formPanel, gbc, "试制样件图号", this.thTextArea, 2); + addFormRow(formPanel, gbc, "创建时间晚于", this.dsButton, 3); + addFormRow(formPanel, gbc, "创建时间早于", this.deButton, 4); + addFormRow(formPanel, gbc, "试制样件名称", this.nameTextArea, 5); + addFormRow(formPanel, gbc, "创建人", this.personTextArea, 6); + + // 添加按钮面板 + JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 10)); + buttonPanel.add(this.searchButton); + buttonPanel.add(this.exportButton); + + this.searchButton.addActionListener(this); + this.exportButton.addActionListener(this); + + gbc.gridx = 0; + gbc.gridy = 7; + gbc.gridwidth = 2; + formPanel.add(buttonPanel, gbc); + + // 将表单面板添加到左侧面板 + panel.add(formPanel); + + // 设置固定大小 +// formPanel.setMaximumSize(formPanel.getPreferredSize()); + // 保持宽度自动适应,仅设置固定高度 + int fixedHeight = formPanel.getPreferredSize().height; // 获取首选高度作为固定高度 + formPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, fixedHeight)); + return panel; + } + + + /** + * 向指定的JPanel中添加一个表单行 + * 该方法用于在给定的JPanel上添加一个标签和一个组件,按照表单的布局方式排列 + * + * @param panel JPanel对象,表示要添加表单行的面板 + * @param gbc GridBagConstraints对象,用于指定组件的布局约束 + * @param labelText 字符串,表示要添加的标签的文本 + * @param component JComponent对象,表示要添加的组件 + * @param row 整数,表示当前行的行号 + */ + private static void addFormRow(JPanel panel, GridBagConstraints gbc, String labelText, JComponent component, int row) { + // 设置当前组件的网格位置为当前行的起始列 + gbc.gridx = 0; + // 设置当前组件的网格位置为当前行 + gbc.gridy = row; + // 设置组件在单元格中的位置为左对齐 + gbc.anchor = GridBagConstraints.LINE_START; + // 向面板中添加标签,并应用约束 + panel.add(new JLabel(labelText), gbc); + + // 设置当前组件的网格位置为当前行的下一列 + gbc.gridx = 1; + // 设置组件在单元格中的位置为右对齐 + gbc.anchor = GridBagConstraints.LINE_END; + // 向面板中添加组件,并应用约束 + panel.add(component, gbc); + } + + + /** + * 设置查询输入框的宽度 + * @param width 宽度(单位:像素) + */ + private void setQueryInputWidth(int width) { + // 设置 JTextArea 的宽度,保持默认高度 + this.idTextArea.setPreferredSize(new Dimension(width, this.idTextArea.getPreferredSize().height)); + this.idTextArea.setMaximumSize(new Dimension(width, this.idTextArea.getMaximumSize().height)); + + this.thTextArea.setPreferredSize(new Dimension(width, this.thTextArea.getPreferredSize().height)); + this.thTextArea.setMaximumSize(new Dimension(width, this.thTextArea.getMaximumSize().height)); + + this.nameTextArea.setPreferredSize(new Dimension(width, this.nameTextArea.getPreferredSize().height)); + this.nameTextArea.setMaximumSize(new Dimension(width, this.nameTextArea.getMaximumSize().height)); + + this.personTextArea.setPreferredSize(new Dimension(width, this.personTextArea.getPreferredSize().height)); + this.personTextArea.setMaximumSize(new Dimension(width, this.personTextArea.getMaximumSize().height)); + + // 设置 DateButton 的宽度 + this.deButton.setPreferredSize(new Dimension(width, this.deButton.getPreferredSize().height)); + this.deButton.setMaximumSize(new Dimension(width, this.deButton.getMaximumSize().height)); + + this.dsButton.setPreferredSize(new Dimension(width, this.dsButton.getPreferredSize().height)); + this.dsButton.setMaximumSize(new Dimension(width, this.dsButton.getMaximumSize().height)); + + // 设置 JComboBox 的宽度 + this.companyBox.setPreferredSize(new Dimension(width, this.companyBox.getPreferredSize().height)); + this.companyBox.setMaximumSize(new Dimension(width, this.companyBox.getMaximumSize().height)); + } + + + /** + * 创建表格容器 + * @return + */ + private JScrollPane getTablePanel() { + // 1. 创建表格模型 + this.model = new DefaultTableModel(this.columnNames, 0) { + @Override + public boolean isCellEditable(int row, int column) { + // 所有单元格都不可编辑 + return false; + } + }; + this.table = new JTable(this.model); + this.table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); // 禁用自动调整模式,以便支持水平滚动条 + + // 设置每列的宽度 + int columnWidth = 150; + for (int i = 0; i < table.getColumnCount(); i++) { + table.getColumnModel().getColumn(i).setPreferredWidth(columnWidth); + } + + // 添加鼠标双击监听 + this.table.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + if (e.getClickCount() == 2) { + System.out.println("触发表格行双击!"); + int selectedRow = table.getSelectedRow(); + if (selectedRow != -1) { + try { + handleTableRowDoubleClick(selectedRow); + } catch (Exception e1) { + System.out.println("打开双击选中对象失败:"); + e1.printStackTrace(); + } + } + } + } + }); + + JScrollPane scrollPane = new JScrollPane(this.table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); // 设置垂直滚动条 + scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // 设置水平滚动条 + scrollPane.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.BLUE)); + return scrollPane; + } + + private void handleTableRowDoubleClick(int selectedRow) throws Exception { + String id = table.getValueAt(selectedRow, 0).toString(); + //打开双击选中的零组件对象 + if (id!=null && !id.isEmpty()) { + System.out.println("Double-clicked ID: " + table.getValueAt(selectedRow, 0)); + com.teamcenter.rac.common.Activator.getDefault() + .openPerspective("com.teamcenter.rac.ui.perspectives.navigatorPerspective"); + com.teamcenter.rac.common.Activator.getDefault().openComponents( + "com.teamcenter.rac.ui.perspectives.navigatorPerspective", + new InterfaceAIFComponent[]{getItemById(id)}); + } + + + } + + private InterfaceAIFComponent getItemById(String id) throws Exception { + TCComponent[] findItems = session.search("零组件 ID", new String[] { "零组件 ID" }, new String[] { id + "*" }); + if (findItems != null && findItems.length>0) { + return findItems[0]; + }else { + System.out.println("未查询到itemID="+id+"的零组件!"); + } + return null; + } + + @Override + public void actionPerformed(ActionEvent e) { + Object s = e.getSource(); + if (s.equals(this.searchButton)){ + System.out.println("触发查询按钮!"); + //TODO 1.组织查询条件 + List entryNames = new ArrayList(); + List entryValues = new ArrayList(); + String companyInput = (String) this.companyBox.getSelectedItem(); + String idInput = this.idTextArea.getText(); + String thInput = this.thTextArea.getText(); + Date deDate = this.deButton.getDate(); + Date dsDate = this.dsButton.getDate(); + String nameInput = this.nameTextArea.getText(); + String personInput = this.personTextArea.getText(); + if (companyInput != null && !companyInput.isEmpty()){ + entryNames.add("company01"); + entryValues.add(companyInput); + System.out.println("公司:"+companyInput); + } + if (idInput != null && !idInput.isEmpty()){ + System.out.println("试制联系单号:"+idInput); + entryNames.add("ID01"); + entryValues.add(idInput); + } + if (thInput != null && !thInput.isEmpty()){ + System.out.println("试制样件图号:"+thInput); + entryNames.add("SZDRM01"); + entryValues.add(thInput); + } + if (deDate != null){ + String deInput = dateFormat.format(deDate).replaceAll("(\\d{4})-0(\\d)-", "$1-$2-") + " 00:00"; + System.out.println("创建时间晚于:"+deInput); + entryNames.add("createdate01"); + entryValues.add(deInput); + } + if (dsDate != null){ + String dsInput = dateFormat.format(dsDate).replaceAll("(\\d{4})-0(\\d)-", "$1-$2-") + " 00:00"; + System.out.println("创建时间早于:"+dsInput); + entryNames.add("createdate02"); + entryValues.add(dsInput); + } + if (nameInput != null && !nameInput.isEmpty()){ + System.out.println("试制样件名称:"+nameInput); + entryNames.add("SZDRM02"); + entryValues.add(nameInput); + } + if (personInput != null && !personInput.isEmpty()){ + System.out.println("创建人:"+personInput); + entryNames.add("SZDRM03"); + entryValues.add(personInput); + } + + if (entryNames != null && entryNames.size() > 0 && entryValues != null && entryValues.size() > 0 ) { + try { + //TODO 2.查询并组织数据 + List tableData = getTableData(entryNames.toArray(new String[entryNames.size()]),entryValues.toArray(new String[entryValues.size()])); + if (tableData!=null && tableData.size()>0) { + this.tableDataList.clear(); + this.tableDataList.addAll(tableData); + } + System.out.println("最终渲染数据条数1:"+this.tableDataList.size()); + //TODO 3.渲染数据到表格中 + drawTable(); + + } catch (Exception e1) { + System.out.println("组织数据失败:"); + e1.printStackTrace(); + } + }else { + System.out.println("未输入任何查询条件!查询失败"); + } + + } else if (s.equals(this.exportButton)) { + System.out.println("触发导出按钮!"); + if (this.tableDataList != null && this.tableDataList.size()>0) { + exportExcel(); + }else { + System.out.println("导出失败:没有可供导出的数据!"); + } + + } + + } + + /** + * 导出表格中的数据 + */ +// private void exportExcel() { +// String[] headLine = this.columnNames; +// List lineList = this.tableDataList; +// String filePath = chooseFilePath(); +// +// if (filePath == null || filePath.isEmpty()) { +// System.out.println("未选择文件路径,导出取消"); +// return; +// } +// +// Workbook workbook = null; +// FileOutputStream fileOut = null; +// +// try { +// workbook = new XSSFWorkbook(); +// fileOut = new FileOutputStream(filePath); +// +// Sheet sheet = workbook.createSheet("数据导出"); +// +// // 创建表头行 +// Row headerRow = sheet.createRow(0); +// for (int i = 0; i < headLine.length; i++) { +// Cell cell = headerRow.createCell(i); +// cell.setCellValue(headLine[i]); +// +// // 设置表头样式 +// CellStyle headerStyle = workbook.createCellStyle(); +// Font headerFont = workbook.createFont(); +// +// headerStyle.setFont(headerFont); +// cell.setCellStyle(headerStyle); +// } +// +// // 创建数据行 +// for (int i = 0; i < lineList.size(); i++) { +// Row dataRow = sheet.createRow(i + 1); +// String[] rowData = lineList.get(i); +// +// for (int j = 0; j < rowData.length; j++) { +// Cell cell = dataRow.createCell(j); +// cell.setCellValue(rowData[j]); +// } +// } +// +// // 自动调整列宽 +// for (int i = 0; i < headLine.length; i++) { +// sheet.autoSizeColumn(i); +// } +// +// // 写入文件 +// workbook.write(fileOut); +// System.out.println("Excel导出成功,文件路径:" + filePath); +// +// } catch (IOException e) { +// System.out.println("Excel导出失败:" + e.getMessage()); +// e.printStackTrace(); +// } finally { +// // 手动关闭资源 +// if (workbook instanceof Closeable) { +// try { +// ((Closeable) workbook).close(); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// } +// } +// } + private void exportExcel() { + String[] headLine = this.columnNames; + List lineList = this.tableDataList; + String filePath = chooseFilePath(); + + if (filePath == null || filePath.isEmpty()) { + System.out.println("未选择文件路径,导出取消"); + return; + } + + Workbook workbook = null; + FileOutputStream fileOut = null; + + try { + workbook = new XSSFWorkbook(); + fileOut = new FileOutputStream(filePath); + + Sheet sheet = workbook.createSheet("数据导出"); + + // 创建表头样式 + CellStyle headerStyle = workbook.createCellStyle(); + Font headerFont = workbook.createFont(); + headerFont.setBold(true); // 表头字体加粗 + headerStyle.setFont(headerFont); + + // 创建表头行 + Row headerRow = sheet.createRow(0); + for (int i = 0; i < headLine.length; i++) { + Cell cell = headerRow.createCell(i); + cell.setCellValue(headLine[i]); + cell.setCellStyle(headerStyle); + } + + // 创建数据行(先不设置内容,仅占位) + for (int i = 0; i < lineList.size(); i++) { + Row dataRow = sheet.createRow(i + 1); + String[] rowData = lineList.get(i); + + for (int j = 0; j < rowData.length; j++) { + dataRow.createCell(j); // 仅创建单元格,不设置值 + } + } + + // 第一次自适应列宽(基于空内容,只考虑表头) + for (int i = 0; i < headLine.length; i++) { + sheet.autoSizeColumn(i); + } + + // 第二次调整:增加表头额外宽度 + for (int i = 0; i < headLine.length; i++) { + int columnWidth = sheet.getColumnWidth(i); + // 为表头增加15%的宽度并额外添加5个字符宽度的余量 + sheet.setColumnWidth(i, Math.min(columnWidth + (columnWidth / 7) + 256 * 5, 255 * 256)); + } + + // 重新填充数据(此时列宽已根据表头确定) + for (int i = 0; i < lineList.size(); i++) { + Row dataRow = sheet.getRow(i + 1); + String[] rowData = lineList.get(i); + + for (int j = 0; j < rowData.length; j++) { + dataRow.getCell(j).setCellValue(rowData[j]); + } + } + + // 写入文件 + workbook.write(fileOut); + System.out.println("Excel导出成功,文件路径:" + filePath); + + } catch (IOException e) { + System.out.println("Excel导出失败:" + e.getMessage()); + e.printStackTrace(); + } finally { + // 确保资源关闭 + try { + if (fileOut != null) fileOut.close(); + if (workbook != null) workbook.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + + + /* + * 选择路径,生成文件全路径名 + */ + private String chooseFilePath() { + JFileChooser fileChooser = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory()); + fileChooser.setDialogTitle("Select a folder"); + fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + int returnValue = fileChooser.showOpenDialog(null); + String chooserPathString = null; + if (returnValue == JFileChooser.APPROVE_OPTION) { + File selectedFile = fileChooser.getSelectedFile(); + chooserPathString = selectedFile.getAbsolutePath(); + System.out.println("Selected directory: " + chooserPathString); + } + + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + String timestamp = dateFormat.format(new Date()); + String fileName = chooserPathString+"\\试制管理报表_" + timestamp + ".xlsx"; + + return fileName; + } + + /** + * 清空表格数据,并绘制新的数据 + */ + private void drawTable() { + // 清空表格数据 + if (this.model.getRowCount() > 0) { + // 清空表格数据,保留列标题 + System.out.println("开始清空表格数据,保留列标题"); + for (int i = this.model.getRowCount() - 1; i >= 0; i--) { + this.model.removeRow(i); + } + } + // 绘制新的表格数据 +// List finalData = this.tableDataList; + System.out.println("最终渲染数据条数:"+this.tableDataList.size()); + for (int i = 0; i < this.tableDataList.size(); i++) { + this.model.addRow(this.tableDataList.get(i)); + } + } + + /** + * 根据输入的查询条件查询并组织数据 + * @param entryValues + * @param entryNames + * @return + * @throws Exception + */ + private List getTableData(String[] entryNames, String[] entryValues) throws Exception { + List reList = new ArrayList(); + InterfaceAIFComponent[] resultComponents = session.search("6SB_SZLXD_DashBoard", + entryNames, + entryValues); + if(resultComponents != null && resultComponents.length>0) { +// MessageBox.post("数量:"+resultComponents.length,"查询结果",MessageBox.INFORMATION); + for (InterfaceAIFComponent component : resultComponents) { + List hList = new ArrayList(); + if (component instanceof TCComponentItemRevision) { + TCComponentItemRevision revision = (TCComponentItemRevision) component; + TCComponentForm form = (TCComponentForm) revision.getRelatedComponent("IMAN_master_form_rev"); + String idString = revision.getStringProperty("item_id"); + String thString = form.getStringProperty("sb6_SZDRM01"); + String nameString = form.getStringProperty("sb6_SZDRM02"); + String yqNumString = form.getStringProperty("sb6_SZDRM03"); + String sjNumString = form.getStringProperty("sb6_SZDRM04"); + String jyTimeString = dateFormat.format(form.getDateProperty("sb6_SZDRM05")); + String wcTimeString = dateFormat.format(form.getDateProperty("sb6_SZDRM06")); + String asjyString = form.getStringProperty("sb6_SZDRM10"); + String resultDesc = form.getStringProperty("sb6_SZDRM07"); + String typeString = form.getStringProperty("sb6_SZDRM08"); + String useFor = form.getStringProperty("sb6_SZDRM09"); + + hList.add(idString == null ? "" : idString); + hList.add(thString == null ? "" : thString); + hList.add(nameString == null ? "" : nameString); + hList.add(yqNumString == null ? "" : yqNumString); + hList.add(sjNumString == null ? "" : sjNumString); + hList.add(jyTimeString == null ? "" : jyTimeString); + hList.add(wcTimeString == null ? "" : wcTimeString); + hList.add(asjyString == null ? "" : asjyString); + hList.add(resultDesc == null ? "" : resultDesc); + hList.add(typeString == null ? "" : typeString); + hList.add(useFor == null ? "" : useFor); + + if (hList != null && hList.size() == this.columnNames.length) { + reList.add(hList.toArray(new String[hList.size()])); + }else { + System.out.println("异常:获取到的数据个数与表格列数不一致,请核对版本:" + idString); + } + }else { + System.out.println("查询到的结果非版本对象,跳过!"); + } + } + }else { + MessageBox.post("没有查询到数据","查询结果",MessageBox.INFORMATION); + } + + return reList; + } + +} diff --git a/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportHandler.java b/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportHandler.java new file mode 100644 index 0000000..d8fa4d8 --- /dev/null +++ b/src/cn/net/connor/plm/trialProductionContactForm/TrialProductionContactFormReportHandler.java @@ -0,0 +1,22 @@ +package cn.net.connor.plm.trialProductionContactForm; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; + +import com.teamcenter.rac.aif.AbstractAIFApplication; +import com.teamcenter.rac.aifrcp.AIFUtility; + +public class TrialProductionContactFormReportHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent arg0) throws ExecutionException { + System.out.println(">>>TrialProductionContactFormReportHandler"); + AbstractAIFApplication application = AIFUtility.getCurrentApplication(); + TrialProductionContactFormReportAction action = new TrialProductionContactFormReportAction(application, null, null); + + new Thread(action).start(); + return null; + } + +}