first commit

main
洪丞进 1 year ago
commit 65e10fc422

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/aspose-cells-18.9.jar"/>
<classpathentry kind="lib" path="lib/axiom-api-1.2.13.jar"/>
<classpathentry kind="lib" path="lib/axis2-kernel-1.6.2.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.13.jar"/>
<classpathentry kind="lib" path="lib/commons-collections4-4.4.jar"/>
<classpathentry kind="lib" path="lib/commons-compress-1.19.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.9.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="lib/commons-math3-3.6.1.jar"/>
<classpathentry kind="lib" path="lib/datepicker.jar"/>
<classpathentry kind="lib" path="lib/fastjson-1.2.9.jar"/>
<classpathentry kind="lib" path="lib/hutool-all-5.0.7.jar"/>
<classpathentry kind="lib" path="lib/jaxb-api-2.3.1.jar"/>
<classpathentry kind="lib" path="lib/jaxb-core-2.3.0.1.jar"/>
<classpathentry kind="lib" path="lib/jaxb-impl-2.3.2.jar"/>
<classpathentry kind="lib" path="lib/jfxrt.jar"/>
<classpathentry kind="lib" path="lib/json-lib-2.2.2-jdk15.jar"/>
<classpathentry kind="lib" path="lib/ojdbc6.jar"/>
<classpathentry kind="lib" path="lib/poi-4.1.1.jar"/>
<classpathentry kind="lib" path="lib/poi-examples-4.1.1.jar"/>
<classpathentry kind="lib" path="lib/poi-excelant-4.1.1.jar"/>
<classpathentry kind="lib" path="lib/poi-ooxml-4.1.1.jar"/>
<classpathentry kind="lib" path="lib/poi-ooxml-schemas-4.1.1.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-4.1.1.jar"/>
<classpathentry kind="lib" path="lib/xmlbeans-3.1.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/com/connor/ld/importsj/handlers/SoaUtils.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/com/connor/ld/sendBOMMesJc/SendBOMHandler.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/com/connor/ld/sendBOMMesJc/SendBOMOpertion.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/com/connor/ld/sendMesJc/SendGylxFram.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/com/connor/ld/sendMesJc/SendMesFram.java" charset="GBK" />
<file url="PROJECT" charset="GBK" />
</component>
</project>

@ -0,0 +1,443 @@
<component name="libraryTable">
<library name="applauncher">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/applauncher.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/ca.odell.glazedlists.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/CAE0SoaSimProcRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Cfg0SoaConfiguratorLoose_13000.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Cla0SoaClassificationCommonRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/cn.net.connor.std.aifrcp_13000.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/cn.net.connor.std.gdtex_12000.3.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/cn.net.connor.std.word_13000.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.google.gson.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.ibm.icu_63.1.0.v20181030-1705.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.jcraft.jsch_0.1.54.v20170116-1932.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.siemens.splm.browserinterop.infrastructure.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.siemens.splm.browserinterop.infrastructure.swt.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.siemens.splm.browserinterop.infrastructure.webview2.win32.x86.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.siemens.splm.browserinterop.solutions.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.sun.el_2.2.0.v201303151357.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.bce.core_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.bce.dialog_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.bce.editor_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.bce.model_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.accessmanager_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.activex.win32.win32.x86_64_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.activex_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.activity_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.adalicense_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.aif.registryeditor_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.aifrcp_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.appearanceconfiguration_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.applications.integration_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.aps0apscore.kernel_13000.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.architecturemodeler_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.auditmanager_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.authorization_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.barchart_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.basedon_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.bczownershipxferview_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.bom_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.briefcasebrowser_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cae.ase_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.caese_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.charts_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.classification.icadmin_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.classification.icm_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cm_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.accountabilitycheck.bom_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.accountabilitycheck.properties_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.accountabilitycheck.relations_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.accountabilitycheck_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.activity_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.assemblyincontext_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.biw.module_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.bvr.connect_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.ccadmin_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.changetracker_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.closureruleeditor_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.collaborationcontext_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.common_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.designpartalignment_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.ebop.module_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.exeposition_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.framework_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.fse_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.futurerevisions_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.graphics_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.idc_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.ipa_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.kernel_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.lb_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.legacy_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.license_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.mbm_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.mbomassessmentrepair_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.mbomrecipe_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.mcnmanagement_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.mpp_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.mrm_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.pad_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.pmp_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.processsimulate_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.resource_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.reusesubassembly_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.sequence_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.study_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.stylesheet_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.tcpublishwrapper_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.time_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.twod_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.twp_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.cme.variants_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.commands.report.reportdesigner_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.commandsuppression_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.common.win32.x86_64_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.common_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.commonclient_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.contextmenusuppression_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.crf_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.databaseutilities_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.datadic_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.debug_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.designcontext_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.diagramming.communication_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.diagramming.dtoolext_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.diagrammingtools_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.dpv_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ecmanagement_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.editcontext_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.effectivity_13000.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.emailpolling_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ets_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.express_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.gantt_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.gdis_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.geolus.results_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.geolus.search_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.grb_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.idc_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.issuemanager_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.kernel_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.massupdate_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ms.ui_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ms.util_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.multistructures_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ocspresence_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.officeapplauncher_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.operationaldata.docmgt_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.operationaldata.edaserver_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.operationaldata.options_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.operationaldata_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.organization_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.pca.kernel_13000.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.pca_13000.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.plmxmlexportimportadministration_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.pmmstylesheetviewer_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.por_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.presentation_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.processhistory_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.project_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.pse.pca_13000.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.pse_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.qualifications_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.querybuilder_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.requirementsmanager.win.embeddedword_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.requirementsmanager_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.rmoffice_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.schedule_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.se.core_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.search_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.setupwizard_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.siemens.theme_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.smartnavigator_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.smb_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.softwareanalytics_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.structure.search_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.subscriptionmanager_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.subscriptionmonitor_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.substitutegroup_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcapps_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcgrb_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.accountabilitycheck_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.analysis_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.common_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.composite_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.dashboard_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.derivativerules_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.desktopsupport_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.inspector_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.model_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.packages_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.product_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim.toolmanagement_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tcsim_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tctdv_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tdv_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.toolbar.customization_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.tracelinks.ui_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ui.advanced_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ui.commands_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ui.gridframework.extension.nebula_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ui.gridframework_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ui.views_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.ui_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.util_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.validation_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.viewer.win32_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.viewer_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.vis.api_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.vis.mv_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.vis_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.vm_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.vns_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.widgets_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.workflow.processdesigner_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.workflow.processviewer_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.teamcenter.rac.workflow_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Ex2SoaExpressAddonsRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaAuditManagerRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaConfigFilterCriteriaLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaConfigFilterCriteriaRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaDebugMonitorLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaDebugMonitorRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaDiagrammingRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaEditContextLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaNotificationRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaQualificationRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Fnd0SoaWProxyRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/icctstubs.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/javax.annotation_1.2.0.v201602091430.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/javax.el_2.2.0.v201303151357.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/javax.inject_1.0.0.v20091030.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/javax.servlet.jsp_2.2.0.v201112011158.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/javax.servlet_3.1.0.v201410161800.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/javax.wsdl_1.6.2.v201012040545.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/javax.xml_1.3.4.v201005080400.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Lis0SoaLdfRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.batik.constants_1.10.0.v20180703-1553.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.batik.css_1.10.0.v20180703-1553.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.batik.i18n_1.10.0.v20180703-1553.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.batik.util_1.10.0.v20180703-1553.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.commons.codec_1.10.0.v20180409-1845.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.commons.io_2.2.0.v201405211200.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.commons.jxpath_1.3.0.v200911051830.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.commons.lang_2.3.0.v200803061910.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.commons.logging_1.2.0.v20180409-1502.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.felix.gogo.command_1.0.2.v20170914-1324.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.felix.gogo.runtime_1.1.0.v20180713-1646.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.felix.gogo.shell_1.1.0.v20180713-1646.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.felix.scr_2.0.14.v20180822-1822.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.jasper.glassfish_2.2.2.v201501141630.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.lucene.analyzers-common_7.5.0.v20181003-1532.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.lucene.analyzers-smartcn_7.5.0.v20181003-1532.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.lucene.core_7.5.0.v20181003-1532.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.xalan_2.7.1.v201005080400.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.xerces_2.9.0.v201101211617.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.xml.resolver_1.2.0.v201005080400.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.xml.serializer_2.7.1.v201005080400.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.apache.xmlgraphics_2.2.0.v20180809-1640.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.aspectj.runtime_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ant.core_3.5.200.v20180822-0553.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.compare.core_3.6.300.v20180827-1041.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.compare.win32_1.2.300.v20180926-0905.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.compare_3.7.400.v20181109-1335.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.commands_3.9.200.v20180827-1727.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.contenttype_3.7.200.v20181107-1343.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.databinding.beans_1.4.300.v20181030-1443.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.databinding.observable_1.6.300.v20180827-2028.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.databinding.property_1.6.300.v20180827-2028.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.databinding_1.7.100.v20181030-1443.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.expressions_3.6.200.v20180817-1401.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.externaltools_1.1.200.v20180821-1744.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.filebuffers_3.6.400.v20181028-0633.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.filesystem.win32.x86_64_1.4.100.v20180828-0158.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.filesystem_1.7.200.v20180828-0158.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.jobs_3.10.200.v20180912-1356.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.net.win32.x86_64_1.1.300.v20181126-0635.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.net_1.3.400.v20181030-1645.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.resources.win32.x86_64_3.5.300.v20181030-1942.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.resources_3.13.200.v20181121-1020.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.runtime_3.15.100.v20181107-1343.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.core.variables_3.4.300.v20181028-0627.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.debug.core_3.13.100.v20181201-1650.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.draw2d_3.10.100.201606061308.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.core.commands_0.12.400.v20181119-1026.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.core.contexts_1.7.100.v20180817-1215.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.core.di.annotations_1.6.200.v20180817-1215.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.core.di.extensions.supplier_0.15.200.v20180817-1215.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.core.di.extensions_0.15.200.v20180817-1215.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.core.di_1.7.100.v20180817-1215.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.core.services_2.1.300.v20180930-0910.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.emf.xpath_0.2.200.v20180828-0227.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.bindings_0.12.300.v20180913-1535.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.css.core_0.12.400.v20180917-1628.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.css.swt.theme_0.12.100.v20180828-0227.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.css.swt_0.13.300.v20181030-1443.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.di_1.2.400.v20180920-1522.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.dialogs_1.1.300.v20180828-0227.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.model.workbench_2.1.200.v20180920-1522.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.services_1.3.300.v20180920-1522.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.widgets_1.2.300.v20180920-1522.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.workbench.addons.swt_1.3.300.v20181102-1042.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.workbench.renderers.swt_0.14.400.v20181112-1716.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.workbench.swt_0.14.400.v20181022-1348.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.workbench3_0.14.200.v20180828-0227.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.e4.ui.workbench_1.8.0.v20181119-1304.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.emf.common_2.15.0.v20180914-1817.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.emf.ecore.change_2.13.0.v20180706-1146.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.emf.ecore.xmi_2.15.0.v20180706-1146.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.emf.ecore_2.16.0.v20181124-0637.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.app_1.4.0.v20181009-1752.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.bidi_1.1.200.v20180827-1235.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.common_3.10.200.v20181021-1645.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.concurrent_1.1.200.v20180827-1235.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.console_1.3.200.v20181115-0906.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.event_1.5.0.v20181008-1938.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.frameworkadmin.equinox_1.1.100.v20180822-1258.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.frameworkadmin_2.1.100.v20180822-1258.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.http.jetty_3.6.200.v20181115-1346.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.http.registry_1.1.600.v20180827-1235.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.http.servlet_1.5.200.v20181008-1912.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.jsp.jasper.registry_1.1.100.v20180827-1235.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.jsp.jasper_1.1.100.v20180827-1235.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.artifact.repository_1.2.200.v20181119-1308.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.core_2.5.100.v20180822-1532.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.engine_2.6.100.v20180822-1302.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.garbagecollector_1.1.100.v20180822-1302.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.jarprocessor_1.1.200.v20180921-1009.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.metadata.repository_1.3.100.v20180822-1302.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.metadata_2.4.200.v20181102-0649.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.publisher_1.5.100.v20180822-1302.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.repository_2.4.200.v20181005-1131.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.p2.touchpoint.natives_1.3.200.v20180921-1019.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.preferences_3.7.200.v20180827-1235.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.registry_3.8.200.v20181008-1820.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.security.ui_1.2.200.v20181108-1420.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.security.win32.x86_64_1.1.100.v20180827-1235.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.security_1.3.0.v20181115-0746.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.simpleconfigurator_1.3.200.v20181101-1115.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.equinox.util_1.1.200.v20181008-1820.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.gef_3.11.0.201606061308.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.help.base_4.2.400.v20181206-0815.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.help.ui_4.1.300.v20181018-1136.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.help_3.8.200.v20180821-0700.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jetty.continuation_9.4.14.v20181113.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jetty.http_9.4.14.v20181113.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jetty.io_9.4.14.v20181113.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jetty.security_9.4.14.v20181113.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jetty.server_9.4.14.v20181113.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jetty.servlet_9.4.14.v20181113.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jetty.util_9.4.14.v20181113.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jface.databinding_1.8.400.v20181030-1443.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jface.text_3.15.0.v20181119-1708.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jface_3.15.0.v20181123-1505.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jsch.core_1.3.300.v20181030-1237.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.jsch.ui_1.3.300.v20181122-1141.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ltk.core.refactoring_3.9.200.v20181024-1629.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.nebula.cwt_1.1.0.201804281520.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.nebula.widgets.cdatetime_1.3.0.201804281520.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.nebula.widgets.gallery_1.0.0.201804281520.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.nebula.widgets.grid_1.1.0.201804281520.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.nebula.widgets.nattable.core_1.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.nebula.widgets.nattable.extension.glazedlists_1.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.nebula.widgets.nattable.extension.poi_1.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.nebula.widgets.tablecombo_1.2.0.201804281520.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.osgi.compatibility.state_1.1.300.v20181116-1550.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.osgi.services_3.7.100.v20180827-1536.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.osgi.util_3.5.100.v20180827-1536.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.osgi_3.13.200.v20181130-2106.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.swt.win32.win32.x86_64_3.109.0.v20181204-1801.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.team.genericeditor.diff.extension_1.0.200.v20180827-1041.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.text_3.8.0.v20180923-1636.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.console_3.8.300.v20181019-1609.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.editors_3.11.300.v20180914-0606.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.forms_3.7.400.v20181123-1505.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.genericeditor_1.1.200.v20180921-0739.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.ide_3.14.200.v20181205-2143.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.intro.quicklinks_1.0.300.v20180821-0700.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.intro_3.5.400.v20181107-2118.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.monitoring_1.1.300.v20180828-1350.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.navigator_3.7.300.v20181016-1531.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.net_1.3.300.v20180827-1041.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.views.log_1.2.400.v20181102-1400.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.views.properties.tabbed_3.8.300.v20180921-1036.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.views_3.9.200.v20180828-0837.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.win32_3.4.100.v20180828-0838.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.workbench.texteditor_3.11.200.v20181108-1458.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui.workbench_3.112.100.v20181127-1518.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.ui_3.111.0.v20181117-0847.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.update.configurator_3.4.100.v20180821-1913.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.eclipse.urischeme_1.0.100.v20181204-1430.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.hamcrest.core_1.3.0.v20180420-1519.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.sat4j.core_2.3.5.v201308161310.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.sat4j.pb_2.3.5.v201404071733.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.tukaani.xz_1.8.0.v20180207-1613.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.w3c.css.sac_1.3.1.v200903091627.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.w3c.dom.events_3.0.0.draft20060413_v201105210656.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.w3c.dom.smil_1.0.1.v200903091627.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.w3c.dom.svg_1.1.0.v201011041433.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/SingleEmbeddedViewer.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/Smc0SoaStructureManagementLoose_13000.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/tcgatewaystubs.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcGlobalMultiSiteRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/tcmemjavabinding.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/tcserverjavabinding.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaAdministrationLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaAdministrationRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaAiRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaAllocationsRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaAuthorizedDataAccessRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaBomLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaBomRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaBusinessModelerLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaBusinessModelerRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaCadBomAlignmentLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaCadRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaCaeRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaCalendarManagementRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaChangeManagementRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaClassificationLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaClassificationRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaClient_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaCommon_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaConfigurationRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaCoreLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaCoreRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaCoreTypes_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaDocumentManagementRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaGdisRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaGlobalMultiSiteLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaGlobalMultiSiteRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaImportExportRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaIssueManagementRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaManufacturingRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaMESRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaMultisiteRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaProductionManagementRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaProjectManagementLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaProjectManagementRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaProjectManagementTypes_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaQueryLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaQueryRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaRdvRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaReportsRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaRequirementsManagementRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaStructureManagementLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaStructureManagementRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaTranslationRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaValidationRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaVisualizationRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaWorkflowLoose_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/TcSoaWorkflowRac_13000.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/xmldto.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.swtchart_0.10.0.v20160212.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/icctstubs.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/org.swtchart_0.10.0.v20160212.jar!/src" />
</SOURCES>
</library>
</component>

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="plugins">
<CLASSES>
<root url="file://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins" />
</CLASSES>
<JAVADOC>
<root url="file://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins/com.siemens.softwareanalytics/javadocs" />
</JAVADOC>
<SOURCES>
<root url="file://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/../../../../WorkEnvironment/tc13JAVA/plugins" recursive="false" type="SOURCES" />
</library>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/com.connor.ld.importSJ.iml" filepath="$PROJECT_DIR$/com.connor.ld.importSJ.iml" />
</modules>
</component>
</project>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.fh.sap</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
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

@ -0,0 +1,89 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: fh.sap
Bundle-SymbolicName: com.fh.sap;singleton:=true
Bundle-Version: 1.0.0
Bundle-Vendor: fh
Require-Bundle: org.eclipse.ui,
com.teamcenter.rac.util;bundle-version="8000.3.0",
com.teamcenter.rac.aifrcp;bundle-version="8000.3.0",
TcSoaCoreRac;bundle-version="8000.3.0",
com.teamcenter.rac.common;bundle-version="8000.3.0",
com.teamcenter.rac.ui;bundle-version="8000.3.0",
com.teamcenter.rac.tcapps;bundle-version="8000.3.0",
com.teamcenter.rac.kernel;bundle-version="8000.3.0",
com.teamcenter.rac.workflow.processdesigner;bundle-version="8000.3.0",
org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.osgi.services;bundle-version="3.2.0"
Automatic-Module-Name: com.connor.ld.importSJ
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: lib/fastjson-1.2.66.jar,
.,
lib/okhttp-2.7.4.jar,
lib/okio-1.13.0.jar,
lib/sqljdbc4.jar,
lib/sapjco3.jar,
lib/fastjson2-2.0.34.jar,
lib/jackson-annotations-2.15.0.jar,
lib/jackson-core-2.15.2.jar,
lib/jackson-databind-2.15.0.jar,
lib/mssql-jdbc-7.0.0.jre8.jar,
lib/ojdbc7.jar,
lib/poi-3.7-20101029.jar,
lib/poi-4.1.2.jar,
lib/poi-examples-3.7-20101029.jar,
lib/poi-ooxml-3.7-20101029.jar,
lib/poi-ooxml-schemas-3.7-20101029.jar,
lib/gson-2.8.5.jar,
lib/datepicker.jar,
lib/mybatis-3.4.6.jar,
lib/activation-1.1.jar,
lib/antlr-2.7.7.jar,
lib/apache-commons-codec-1.4.jar,
lib/apache-mime4j-core-0.7.2.jar,
lib/axiom-api-1.2.13.jar,
lib/axiom-dom-1.2.13.jar,
lib/axiom-impl-1.2.13.jar,
lib/axis2-adb-1.6.2.jar,
lib/axis2-adb-codegen-1.6.2.jar,
lib/axis2-ant-plugin-1.6.2.jar,
lib/axis2-clustering-1.6.2.jar,
lib/axis2-codegen-1.6.2.jar,
lib/axis2-corba-1.6.2.jar,
lib/axis2-fastinfoset-1.6.2.jar,
lib/axis2-java2wsdl-1.6.2.jar,
lib/axis2-jaxbri-1.6.2.jar,
lib/axis2-jaxws-1.6.2.jar,
lib/axis2-jibx-1.6.2.jar,
lib/axis2-json-1.6.2.jar,
lib/axis2-kernel-1.6.2.jar,
lib/axis2-metadata-1.6.2.jar,
lib/axis2-mtompolicy-1.6.2.jar,
lib/axis2-saaj-1.6.2.jar,
lib/axis2-soapmonitor-servlet-1.6.2.jar,
lib/axis2-spring-1.6.2.jar,
lib/axis2-transport-http-1.6.2.jar,
lib/axis2-transport-local-1.6.2.jar,
lib/axis2-xmlbeans-1.6.2.jar,
lib/json-lib-2.2.2-jdk15.jar,
lib/aspose-cells-18.9.jar,
lib/commons-codec-1.13.jar,
lib/commons-collections4-4.4.jar,
lib/commons-compress-1.19.jar,
lib/commons-lang3-3.9.jar,
lib/commons-logging-1.2.jar,
lib/commons-math3-3.6.1.jar,
lib/fastjson-1.2.9.jar,
lib/hutool-all-5.0.7.jar,
lib/jaxb-api-2.3.1.jar,
lib/jaxb-core-2.3.0.1.jar,
lib/jaxb-impl-2.3.2.jar,
lib/jfxrt.jar,
lib/ojdbc6.jar,
lib/poi-4.1.1.jar,
lib/poi-examples-4.1.1.jar,
lib/poi-excelant-4.1.1.jar,
lib/poi-ooxml-4.1.1.jar,
lib/poi-ooxml-schemas-4.1.1.jar,
lib/poi-scratchpad-4.1.1.jar,
lib/xmlbeans-3.1.0.jar

1
bin/.gitignore vendored

@ -0,0 +1 @@
/com/

@ -0,0 +1,13 @@
#\u6D4B\u8BD5\u7CFB\u7EDF
JCO_ASHOST_STR=10.10.22.14
JCO_SYSNR_STR=00
JCO_CLIENT_STR=400
JCO_USER_STR=LDIT001
JCO_PASSWD_STR=LDIT@2022
#JCO_ASHOST_STR=10.200.1.192
#JCO_SYSNR_STR=00
#JCO_CLIENT_STR=800
#JCO_USER_STR=SAP_TC
#JCO_PASSWD_STR=Sap_RFC2020

@ -0,0 +1,75 @@
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
lib/fastjson-1.2.66.jar,\
lib/okhttp-2.7.4.jar,\
lib/okio-1.13.0.jar,\
lib/sqljdbc4.jar,\
lib/sapjco3.jar,\
lib/fastjson2-2.0.34.jar,\
lib/jackson-annotations-2.15.0.jar,\
lib/jackson-core-2.15.2.jar,\
lib/jackson-databind-2.15.0.jar,\
lib/mssql-jdbc-7.0.0.jre8.jar,\
lib/ojdbc7.jar,\
lib/poi-3.7-20101029.jar,\
lib/poi-4.1.2.jar,\
lib/poi-examples-3.7-20101029.jar,\
lib/poi-ooxml-3.7-20101029.jar,\
lib/poi-ooxml-schemas-3.7-20101029.jar,\
lib/gson-2.8.5.jar,\
lib/datepicker.jar,\
lib/mybatis-3.4.6.jar,\
lib/activation-1.1.jar,\
lib/antlr-2.7.7.jar,\
lib/apache-commons-codec-1.4.jar,\
lib/apache-mime4j-core-0.7.2.jar,\
lib/axiom-api-1.2.13.jar,\
lib/axiom-dom-1.2.13.jar,\
lib/axiom-impl-1.2.13.jar,\
lib/axis2-adb-1.6.2.jar,\
lib/axis2-adb-codegen-1.6.2.jar,\
lib/axis2-ant-plugin-1.6.2.jar,\
lib/axis2-clustering-1.6.2.jar,\
lib/axis2-codegen-1.6.2.jar,\
lib/axis2-corba-1.6.2.jar,\
lib/axis2-fastinfoset-1.6.2.jar,\
lib/axis2-java2wsdl-1.6.2.jar,\
lib/axis2-jaxbri-1.6.2.jar,\
lib/axis2-jaxws-1.6.2.jar,\
lib/axis2-jibx-1.6.2.jar,\
lib/axis2-json-1.6.2.jar,\
lib/axis2-kernel-1.6.2.jar,\
lib/axis2-metadata-1.6.2.jar,\
lib/axis2-mtompolicy-1.6.2.jar,\
lib/axis2-saaj-1.6.2.jar,\
lib/axis2-soapmonitor-servlet-1.6.2.jar,\
lib/axis2-spring-1.6.2.jar,\
lib/axis2-transport-http-1.6.2.jar,\
lib/axis2-transport-local-1.6.2.jar,\
lib/axis2-xmlbeans-1.6.2.jar,\
lib/json-lib-2.2.2-jdk15.jar,\
lib/aspose-cells-18.9.jar,\
lib/commons-codec-1.13.jar,\
lib/commons-collections4-4.4.jar,\
lib/commons-compress-1.19.jar,\
lib/commons-lang3-3.9.jar,\
lib/commons-logging-1.2.jar,\
lib/commons-math3-3.6.1.jar,\
lib/fastjson-1.2.9.jar,\
lib/hutool-all-5.0.7.jar,\
lib/jaxb-api-2.3.1.jar,\
lib/jaxb-core-2.3.0.1.jar,\
lib/jaxb-impl-2.3.2.jar,\
lib/jfxrt.jar,\
lib/ojdbc6.jar,\
lib/poi-4.1.1.jar,\
lib/poi-examples-4.1.1.jar,\
lib/poi-excelant-4.1.1.jar,\
lib/poi-ooxml-4.1.1.jar,\
lib/poi-ooxml-schemas-4.1.1.jar,\
lib/poi-scratchpad-4.1.1.jar,\
lib/xmlbeans-3.1.0.jar

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.commands">
<!-- 功能菜单 -->
<command name="BOM批量管理" id="BOMManagement"></command>
<command name="批量创建物料" id="MateriaBatchCreate"></command>
<command name="批量创建BOM" id="BOMBatchCreate"></command>
<!-- 右键菜单 -->
<command name="批量新建流程" id="FlowBatchCreate"></command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler commandId="BOMManagement" class="com.connor.jd.plm.handlers.BOMManagementHandler"></handler>
<handler commandId="MateriaBatchCreate" class="com.connor.fh.plm.handlers.MateriaBatchCreateHandler"></handler>
<handler commandId="BOMBatchCreate" class="com.connor.fh.plm.handlers.BOMBatchCreateHandler"></handler>
<handler commandId="FlowBatchCreate" class="com.connor.fh.plm.handlers.FlowBatchCreateHandler"></handler>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=additions">
<menu label="BOM批量菜单" id="cn.net.connor.kwc.plm.seconddevelop.menus">
<command id="BOMManagement" commandId="BOMManagement"></command>
</menu>
<menu label="批处理功能菜单" id="cn.net.connor.fh.plm.seconddevelop.menus">
<command id="MateriaBatchCreate" commandId="MateriaBatchCreate"></command>
<command id="BOMBatchCreate" commandId="BOMBatchCreate"></command>
</menu>
</menuContribution>
<!-- 右键-->
<menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions">
<command id="FlowBatchCreate" commandId="FlowBatchCreate"/>
</menuContribution>
</extension>
</plugin>

@ -0,0 +1,33 @@
package com.connor.fh.plm.handlers;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.connor.fh.plm.operations.BOMBatchCreateOperation;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.kernel.AbstractAIFSession;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
/**
*
* @ClassName: BOMBatchCreateHandler
* @Description: BOM excelBOM
* @author hcj
* @date 2024415
*
*/
public class BOMBatchCreateHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
// 获取当前系统活动
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession)app.getSession();
session.queueOperation(new BOMBatchCreateOperation(session));
return null;
}
}

@ -0,0 +1,80 @@
package com.connor.fh.plm.handlers;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.connor.fh.plm.operations.MateriaBatchCreateOperation;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCProperty;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.workflow.commands.newprocess.NewProcessCommand;
/**
*
* @ClassName: FlowBatchCreateHandler
* @Description:
* @author hcj
* @date 2024415
*
*/
public class FlowBatchCreateHandler extends AbstractHandler{
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
// TODO Auto-generated method stub
new Thread() {
@Override
public void run() {
// TODO Auto-generated method stub
// 获取当前系统活动
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
// 获取tc当前选择的操作
InterfaceAIFComponent target = app.getTargetComponent();
if (target instanceof TCComponentFolder) {
TCComponentFolder folder = (TCComponentFolder) target;
//获取session
TCSession session = folder.getSession();
List<TCComponentItemRevision> revisions = new ArrayList<TCComponentItemRevision>();
//获取文件夹下所有未发布的最新版本
try {
AIFComponentContext[] children = folder.getChildren();
for(AIFComponentContext componentContext : children) {
TCComponent component = (TCComponent)componentContext.getComponent();
if(component instanceof TCComponentItemRevision) {
TCComponentItemRevision revision = (TCComponentItemRevision)component;
TCProperty tcProperty = revision.getTCProperty("release_status_list");
TCComponent[] refs = tcProperty.getReferenceValueArray();
if (refs == null || refs.length == 0) {
revisions.add(revision);
}
}
}
NewProcessCommand command = new NewProcessCommand(AIFUtility.getActiveDesktop(), app,
revisions.toArray(new TCComponentItemRevision[revisions.size()]));
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else {
MessageBox.post("请选择文件夹进行操作", "提示", MessageBox.INFORMATION);
}
}
}.start();
return null;
}
}

@ -0,0 +1,49 @@
package com.connor.fh.plm.handlers;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.connor.fh.plm.operations.MateriaBatchCreateOperation;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
/**
*
* @ClassName: MateriaBatchCreateHandler
* @Description: Excel
* @author hcj
* @date 2024415
*
*/
public class MateriaBatchCreateHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
// 获取当前系统活动
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
// 获取tc当前选择的操作
InterfaceAIFComponent target = app.getTargetComponent();
if (target instanceof TCComponentFolder) {
TCComponentFolder folder = (TCComponentFolder) target;
//获取session
TCSession session = folder.getSession();
MateriaBatchCreateOperation materiaBatchCreateOperation = new MateriaBatchCreateOperation(session,folder);
session.queueOperation(materiaBatchCreateOperation);
}else {
MessageBox.post("请选择文件夹进行操作", "提示", MessageBox.INFORMATION);
return null;
}
return null;
}
}

@ -0,0 +1,752 @@
package com.connor.fh.plm.operations;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.connor.jd.plm.util.Util;
import com.teamcenter.rac.aif.AbstractAIFOperation;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentBOMWindow;
import com.teamcenter.rac.kernel.TCComponentBOMWindowType;
import com.teamcenter.rac.kernel.TCComponentForm;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.kernel.TCUserService;
import com.teamcenter.rac.util.MessageBox;
/**
*
* @ClassName: BOMBatchCreateOperation
* @Description: BOM excel BOM
* @author hcj
* @date 2024423
*
*/
public class BOMBatchCreateOperation extends AbstractAIFOperation {
private TCSession session;
private String path = null;
private JLabel label = new JLabel("数据文件:");
private JTextField jtf = new JTextField(25);
private JButton button = new JButton("浏览");
private JButton button2 = new JButton("确定");
private JFrame jf;
private Map<String, Boolean> isMastSetMap = new HashMap<String, Boolean>();
private Map<String, String> itemAttrMap = new HashMap<String, String>();
private Map<String, String> itemMasterAttrMap = new HashMap<String, String>();
private Map<String, String> itemRevAttrMap = new HashMap<String, String>();
private Map<String, String> attrTypeMap = new HashMap<String, String>();
private Map<String, String> itemRevMasterAttrMap = new HashMap<String, String>();
private Map<String, String> bomlineAttrMap = new HashMap<String, String>();
public BOMBatchCreateOperation(TCSession session) {
this.session = session;
// 获取首选项的值
getSXX();
}
/**
*
* @Title: getSXX
* @Description:
* @param
* @return void
* @throws
*/
private void getSXX() {
// TODO Auto-generated method stub
String[] sxx = Util.getSXX(session, "PHZD_BOM_create");
for (String str : sxx) {
try {
String[] split = str.split("=");// 获取excel列名称
String[] split2 = split[1].split(":");// 获取属性位置已经真实名称 是否必填
// 判断属性是否必填和类型
String[] split3 = split2[1].split("#");
String[] split4 = split3[1].split("-");
isMastSetMap.put(split[0], Boolean.parseBoolean(split4[0]));
attrTypeMap.put(split3[0], split4[1]);
// 判断属性位置
if ("对象".equals(split2[0])) {
itemAttrMap.put(split[0], split3[0]);
} else if ("对象表单".equals(split2[0])) {
itemMasterAttrMap.put(split[0], split3[0]);
} else if ("版本".equals(split2[0])) {
itemRevAttrMap.put(split[0], split3[0]);
} else if ("版本表单".equals(split2[0])) {
itemRevMasterAttrMap.put(split[0], split3[0]);
} else if ("bomline".equals(split2[0])) {
bomlineAttrMap.put(split[0], split3[0]);
}
} catch (Exception e) {
// TODO Auto-generated catch block
MessageBox.post("首选项PHZD_materials_create【" + str + "】配置有误", "提示", MessageBox.ERROR);
return;
}
}
}
@Override
public void executeOperation() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
jf = new JFrame("导入BOM");
jf.setBounds(400, 200, 700, 150);
JPanel panel = new JPanel();
JPanel panel2 = new JPanel();
panel.add(this.label);
panel.add(this.jtf);
panel.add(this.button);
panel2.add(this.button2);
jf.add(panel, "North");
jf.add(panel2, "South");
jf.setVisible(true);
jf.setDefaultCloseOperation(2);
this.button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
try {
JFileChooser fc = new JFileChooser("C:\\");
// 设置为仅选择文件模式
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
int val = fc.showOpenDialog(null);
if (val == JFileChooser.APPROVE_OPTION) { // 对比值应为 JFileChooser.APPROVE_OPTION 而不是直接用 0
path = fc.getSelectedFile().getPath(); // 使用 getPath() 获取文件路径
jtf.setText(path);
// 获取选择文件类型是否为excel
File selectedFile = fc.getSelectedFile();
// 检查文件扩展名
String fileName = selectedFile.getName();
String extension = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
boolean isExcelByExtension = (extension.equals("xls") || extension.equals("xlsx")
|| extension.equals("xlsm"));
if (!isExcelByExtension) {
MessageBox.post("选择的文件不是excel文件 请重新选择", "提示", MessageBox.INFORMATION);
jtf.setText("");
}
} else {
jtf.setText("未选择文件");
}
} catch (Exception var4) {
var4.printStackTrace();
}
}
});
this.button2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
try {
if (path != null && path != "" && !"未选择文件".equals(path)) {
String errString = "";
Util.setByPass(true);
createBOM(errString);
Util.setByPass(false);
} else {
MessageBox.post("未选择文件!", "提示", MessageBox.INFORMATION);
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
*
* @Title: createBOM
* @Description: BOM
* @param @throws TCException
* @param @throws IOException
* @return void
* @throws
*/
protected void createBOM(String err) throws TCException, IOException {
// TODO Auto-generated method stub
// 读取excel
Map<TCComponentItem, List<TCComponentItem>> bomItemMap = new HashMap<TCComponentItem, List<TCComponentItem>>();
Map<TCComponentItem, Map<String, String>> lineattrMap = new HashMap<TCComponentItem, Map<String, String>>();
Map<String, Map<String, Map<String, String>>> readExcel = readExcel(path);
System.out.println("excel中的数据" + readExcel);
// 校验数据 判断id是否存在
for (Entry<String, Map<String, Map<String, String>>> entry : readExcel.entrySet()) {
String fId = entry.getKey();
System.out.println("父id" + fId);
TCComponent itemById = Util.getItemById(fId);
if (itemById == null) {
MessageBox.post("excel中的父ID【" + fId + "】不存在", "提示", MessageBox.ERROR);
return;
}
if (itemById instanceof TCComponentItem) {
TCComponentItem fItem = (TCComponentItem) itemById;
// 判断父对象是否发布
System.out.println("开始判断父对象是否发布");
TCComponent[] tcProperty = fItem.getLatestItemRevision().getTCProperty("release_status_list")
.getReferenceValueArray();
if (tcProperty != null && tcProperty.length > 0) {
MessageBox.post("父对象校验通过,对象" + fId + ",已发布,请升版再继续操作", "提示", MessageBox.ERROR);
return;
}
List<TCComponentItem> childItems = new ArrayList<TCComponentItem>();
// 循环获取对应子行
Map<String, Map<String, String>> childMap = entry.getValue();
for (Entry<String, Map<String, String>> child : childMap.entrySet()) {
String cId = child.getKey();
TCComponent itemById1 = Util.getItemById(cId);
if (itemById1 == null) {
MessageBox.post("excel中的子ID【" + cId + "】不存在", "提示", MessageBox.ERROR);
return;
}
if (itemById1 instanceof TCComponentItem) {
TCComponentItem cItem = (TCComponentItem) itemById1;
// 判断子对象是否发布
TCComponent[] tcProperty1 = fItem.getLatestItemRevision().getTCProperty("release_status_list")
.getReferenceValueArray();
if (tcProperty1 != null && tcProperty1.length > 0) {
MessageBox.post("子对象校验未通过,对象" + cId + ",已发布,请升版再继续操作", "提示", MessageBox.ERROR);
return;
}
// 获取属性
Map<String, String> attMap = child.getValue();
System.out.println("attMap==>" + attMap);
// 是否为必填
System.out.println(isMastSetMap);
for (Entry<String, String> entry1 : attMap.entrySet()) {
String key = entry1.getKey();
System.out.println("key:" + key);
if (isMastSetMap.get(key)) {
String value = entry1.getValue();
if (value == null || value.trim().equals("")) {
MessageBox.post("excel数据校验未通过" + key + ",为必填属性", "提示", MessageBox.ERROR);
return;
}
}
}
lineattrMap.put(cItem, attMap);
childItems.add(cItem);
} else {
MessageBox.post("子列sap物料编码填写错误找不到item对象" + cId, "提示", MessageBox.ERROR);
return;
}
}
bomItemMap.put(fItem, childItems);
} else {
System.out.println("填写的id不是itemID");
}
}
// 获取单位属性如果单位需要更改判断是否存在bom视图不存在则改存在则跳过
for (Entry<TCComponentItem, Map<String, String>> entry : lineattrMap.entrySet()) {
TCComponentItem rev = entry.getKey();
// 修改单位
System.out.println("开始修改单位");
System.out.println(entry.getValue());
if (entry.getValue().containsKey("单位")) {
String uomName = entry.getValue().get("单位");
try {
TCUserService userservice = session.getUserService();
userservice.call("connor_set_uom", new Object[] { rev, uomName });
entry.getValue().remove("单位");
} catch (Exception e) {
e.printStackTrace();
System.out.println("【connor_set_uom】命名的方法未注册有用户服务");
}
}
System.out.println("修改单位完毕");
}
System.out.println("搭建bom视图");
// 搭建bom视图
createBOMView(bomItemMap);
// 循环bom视图 发送bom填充属性
setPropertiesBOM(bomItemMap, lineattrMap);
jf.dispose();
MessageBox.post("BOM创建成功", "提示", MessageBox.INFORMATION);
return;
}
/**
*
* @Title: setPropertiesBOM
* @Description: bom bom
* @param @param bomItemMap
* @param @param lineattrMap
* @return void
* @throws TCException
* @throws
*/
private void setPropertiesBOM(Map<TCComponentItem, List<TCComponentItem>> bomItemMap,
Map<TCComponentItem, Map<String, String>> lineattrMap) throws TCException {
// TODO Auto-generated method stub
for (Entry<TCComponentItem, List<TCComponentItem>> entry : bomItemMap.entrySet()) {
TCComponentBOMWindowType winType = (TCComponentBOMWindowType) session.getTypeComponent("BOMWindow");
TCComponentBOMWindow view = winType.create(null);
TCComponentBOMLine bomLine = view.setWindowTopLine(entry.getKey(), entry.getKey().getLatestItemRevision(),
null, null);
for (AIFComponentContext componentContext : bomLine.getChildren()) {
TCComponentBOMLine childLine = (TCComponentBOMLine) componentContext.getComponent();
if (lineattrMap.containsKey(childLine.getItem())) {
Map<String, String> map = lineattrMap.get(childLine.getItem());
// 给对象赋值
Map<String, String> itemattrs = getattrs(map, itemAttrMap);
System.out.println("itemattrs:" + itemattrs);
if (itemattrs.size() > 0) {
// item.setProperties(itemattrs);
childLine.getItem().lock();
for (Entry<String, String> entry1 : itemattrs.entrySet()) {
System.out.println(entry1.getKey());
System.out.println(entry1.getValue());
Object typeForAttr = getTypeForAttr(entry1.getKey(), entry1.getValue());
Util.setTCPropertyValue(childLine.getItem(), entry1.getKey(), typeForAttr);
}
childLine.getItem().save();
childLine.getItem().unlock();
}
// 给对象表单赋值
Map<String, String> itemMasterattrs = getattrs(map, itemMasterAttrMap);
System.out.println("itemMasterattrs:" + itemMasterattrs);
if (itemMasterattrs.size() > 0) {
TCComponent[] masterFormItem = childLine.getItem().getReferenceListProperty("IMAN_master_form");
TCComponentForm itemform = (TCComponentForm) masterFormItem[0];
// itemform.setProperties(itemMasterattrs);
itemform.lock();
for (Entry<String, String> entry1 : itemMasterattrs.entrySet()) {
System.out.println(entry1.getKey());
System.out.println(entry1.getValue());
Object typeForAttr = getTypeForAttr(entry1.getKey(), entry1.getValue());
Util.setTCPropertyValue(itemform, entry1.getKey(), typeForAttr);
}
itemform.save();
itemform.unlock();
}
// 给版本赋值
Map<String, String> revattrs = getattrs(map, itemRevAttrMap);
System.out.println("revattrs:" + revattrs);
if (revattrs.size() > 0) {
// item.getLatestItemRevision().setProperties(revattrs);
childLine.getItemRevision().lock();
for (Entry<String, String> entry1 : revattrs.entrySet()) {
System.out.println(entry1.getKey());
System.out.println(entry1.getValue());
Object typeForAttr = getTypeForAttr(entry1.getKey(), entry1.getValue());
Util.setTCPropertyValue(childLine.getItemRevision(), entry1.getKey(), typeForAttr);
}
childLine.getItemRevision().save();
childLine.getItemRevision().unlock();
}
// 给版本表单赋值
Map<String, String> revMasterattrs = getattrs(map, itemRevMasterAttrMap);
System.out.println("revMasterattrs:" + revMasterattrs);
if (revMasterattrs.size() > 0) {
TCComponent[] referenceListProperty = childLine.getItemRevision()
.getReferenceListProperty("IMAN_master_form_rev");
TCComponentForm revForm = (TCComponentForm) referenceListProperty[0];
// revForm.setProperties(revMasterattrs);
revForm.lock();
for (Entry<String, String> entry1 : revMasterattrs.entrySet()) {
System.out.println(entry1.getKey());
System.out.println(entry1.getValue());
Object typeForAttr = getTypeForAttr(entry1.getKey(), entry1.getValue());
Util.setTCPropertyValue(revForm, entry1.getKey(), typeForAttr);
}
revForm.save();
revForm.unlock();
}
// 给bomline赋值
Map<String, String> bomattrMap = getattrs(map, bomlineAttrMap);
System.out.println("bomattrMap:" + bomattrMap);
if (bomattrMap.size() > 0) {
childLine.lock();
for (Entry<String, String> entry1 : bomattrMap.entrySet()) {
System.out.println(entry1.getKey());
System.out.println(entry1.getValue());
Object typeForAttr = getTypeForAttr(entry1.getKey(), entry1.getValue());
Util.setTCPropertyValue(childLine, entry1.getKey(), typeForAttr);
}
childLine.save();
childLine.unlock();
}
}
}
}
}
/**
*
* @Title: createBOMView
* @Description: mapbom
* @param @param bomItemMap
* @return void
* @throws TCException
* @throws
*/
private void createBOMView(Map<TCComponentItem, List<TCComponentItem>> bomItemMap) throws TCException {
// TODO Auto-generated method stub
for (Entry<TCComponentItem, List<TCComponentItem>> entry : bomItemMap.entrySet()) {
TCComponentBOMWindowType winType = (TCComponentBOMWindowType) session.getTypeComponent("BOMWindow");
TCComponentBOMWindow view = winType.create(null);
TCComponentBOMLine bomLine = view.setWindowTopLine(entry.getKey(), entry.getKey().getLatestItemRevision(),
null, null);
// 获取bomline的子件判断是新增还是替换 如果子行已经存在于bom中则更新 否则创建子行
AIFComponentContext[] children = bomLine.getChildren();
Map<String, TCComponentBOMLine> childMap = new HashMap<String, TCComponentBOMLine>();
if (children != null && children.length > 0) {
for (AIFComponentContext context : children) {
TCComponentBOMLine childLine = (TCComponentBOMLine) context.getComponent();
childMap.put(childLine.getItemRevision().getStringProperty("item_id"), childLine);
}
}
view.lock();
for (TCComponentItem childLine : entry.getValue()) {
if (childMap.size() > 0) {
if (childMap.containsKey(childLine.getLatestItemRevision().getStringProperty("item_id"))) {
// 替换bom行
TCComponentBOMLine oldBomLine = childMap
.get(childLine.getLatestItemRevision().getStringProperty("item_id"));
oldBomLine.replace(childLine, childLine.getLatestItemRevision(), null);
continue;
}
}
// 新增bom行
TCComponentItemRevision latestItemRevision = childLine.getLatestItemRevision();
bomLine.add(childLine, childLine.getLatestItemRevision(), null, false, "");
view.save();
}
// 开始修改属性
// 关闭视图
view.unlock();
view.save();
view.close();
}
}
/**
*
* @Title: getattrs
* @Description: map
* @param @param map
* @param @param itemAttrMap
* @param @return
* @return Map<String,String>
* @throws
*/
protected Map<String, String> getattrs(Map<String, String> map, Map<String, String> itemAttrMap) {
// 填充属性
Map<String, String> attrmap = new HashMap<String, String>();
for (Entry<String, String> entry : itemAttrMap.entrySet()) {
if (map.containsKey(entry.getKey())) {
String string = map.get(entry.getKey());
attrmap.put(entry.getValue(), removeTrailingZeros(string));
}
}
return attrmap;
}
/**
*
* @Title: removeTrailingZeros
* @Description: 0
* @param @param input
* @param @return
* @return String
* @throws
*/
public String removeTrailingZeros(String input) {
if (input != null && !input.isEmpty()) {
// 正则表达式匹配末尾的零,以及可能的.00形式
// $表示字符串的结束位置,\\.?表示可能存在的小数点0+表示一个或多个零
return input.replaceAll("(\\.0+|0+)$", "");
}
return input; // 如果输入为空或者null直接返回原值
}
/**
*
* @Title: setProperties
* @Description: map
* @param @param map
* @param @param item
* @param @throws TCException
* @return void
* @throws
*/
public void setProperties(Map<String, String> map, TCComponentItem item) throws TCException {
// 给对象赋值
Map<String, String> itemattrs = getattrs(map, itemAttrMap);
System.out.println("itemattrs:" + itemattrs);
if (itemattrs.size() > 0) {
// item.setProperties(itemattrs);
item.lock();
for (Entry<String, String> entry : itemattrs.entrySet()) {
System.out.println(entry.getKey());
System.out.println(entry.getValue());
Object typeForAttr = getTypeForAttr(entry.getKey(), entry.getValue());
Util.setTCPropertyValue(item, entry.getKey(), typeForAttr);
}
item.save();
item.unlock();
}
// 给对象表单赋值
Map<String, String> itemMasterattrs = getattrs(map, itemMasterAttrMap);
System.out.println("itemMasterattrs:" + itemMasterattrs);
if (itemMasterattrs.size() > 0) {
TCComponent[] masterFormItem = item.getReferenceListProperty("IMAN_master_form");
TCComponentForm itemform = (TCComponentForm) masterFormItem[0];
// itemform.setProperties(itemMasterattrs);
itemform.lock();
for (Entry<String, String> entry : itemMasterattrs.entrySet()) {
System.out.println(entry.getKey());
System.out.println(entry.getValue());
Object typeForAttr = getTypeForAttr(entry.getKey(), entry.getValue());
Util.setTCPropertyValue(itemform, entry.getKey(), typeForAttr);
}
itemform.save();
itemform.unlock();
}
// 给版本赋值
Map<String, String> revattrs = getattrs(map, itemRevAttrMap);
System.out.println("revattrs:" + revattrs);
if (revattrs.size() > 0) {
// item.getLatestItemRevision().setProperties(revattrs);
item.getLatestItemRevision().lock();
for (Entry<String, String> entry : revattrs.entrySet()) {
System.out.println(entry.getKey());
System.out.println(entry.getValue());
Object typeForAttr = getTypeForAttr(entry.getKey(), entry.getValue());
Util.setTCPropertyValue(item.getLatestItemRevision(), entry.getKey(), typeForAttr);
}
item.getLatestItemRevision().save();
item.getLatestItemRevision().unlock();
}
// 给版本表单赋值
Map<String, String> revMasterattrs = getattrs(map, itemRevMasterAttrMap);
System.out.println("revMasterattrs:" + revMasterattrs);
if (revMasterattrs.size() > 0) {
TCComponent[] referenceListProperty = item.getLatestItemRevision()
.getReferenceListProperty("IMAN_master_form_rev");
TCComponentForm revForm = (TCComponentForm) referenceListProperty[0];
// revForm.setProperties(revMasterattrs);
revForm.lock();
for (Entry<String, String> entry : revMasterattrs.entrySet()) {
System.out.println(entry.getKey());
System.out.println(entry.getValue());
Object typeForAttr = getTypeForAttr(entry.getKey(), entry.getValue());
Util.setTCPropertyValue(revForm, entry.getKey(), typeForAttr);
}
revForm.save();
revForm.unlock();
}
// 给bomline赋值
Map<String, String> bomattrMap = getattrs(map, bomlineAttrMap);
System.out.println("bomattrMap:" + bomattrMap);
if (bomattrMap.size() > 0) {
TCComponentBOMWindowType winType = (TCComponentBOMWindowType) session.getTypeComponent("BOMWindow");
TCComponentBOMWindow view = winType.create(null);
TCComponentItemRevision rev = item.getLatestItemRevision();
TCComponentBOMLine line = view.setWindowTopLine(rev.getItem(), rev, null, null);
line.lock();
for (Entry<String, String> entry : bomattrMap.entrySet()) {
System.out.println(entry.getKey());
System.out.println(entry.getValue());
Object typeForAttr = getTypeForAttr(entry.getKey(), entry.getValue());
Util.setTCPropertyValue(line, entry.getKey(), typeForAttr);
}
line.save();
line.unlock();
}
}
/**
*
* @Title: getTypeForAttr
* @Description:
* @param @param attrName
* @param @param attrProperty
* @param @return
* @return Object
* @throws
*/
public Object getTypeForAttr(String attrName, String attrProperty) {
if (attrTypeMap.containsKey(attrName)) {
String type = attrTypeMap.get(attrName);
if ("string".equals(type)) {
return attrProperty; // 直接返回字符串属性值
} else if ("strings".equals(type)) {
// 假设attrProperty是一个逗号分隔的字符串将其转换成字符串数组
return attrProperty.split(",");
} else if ("int".equals(type)) {
try {
return Integer.parseInt(attrProperty); // 将字符串转换成整数
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid integer value for attribute: " + attrName);
}
} else if ("double".equals(type)) {
try {
return Double.parseDouble(attrProperty); // 将字符串转换成浮点数
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid double value for attribute: " + attrName);
}
} else if ("date".equals(type)) {
// 假设attrProperty是符合某种日期格式的字符串这里简化处理实际应用中应使用更健壮的日期解析
try {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); // 根据实际格式调整
return formatter.parse(attrProperty);
} catch (ParseException e) {
throw new IllegalArgumentException("Invalid date format for attribute: " + attrName);
}
}
}
// 如果类型不匹配或不存在于map中根据实际情况处理这里简单返回null
return null;
}
/**
*
* @Title: readExcel
* @Description: excel
* @param @param path excel
* @param @return
* @param @throws IOException
* @return Map<String,List<BatchBomCreate>>
* @throws
*/
protected Map<String, Map<String, Map<String, String>>> readExcel(String path) throws IOException {
// TODO Auto-generated method stub
FileInputStream fis = new FileInputStream(path);
XSSFWorkbook workbook = new XSSFWorkbook(fis);
XSSFSheet sheet = workbook.getSheetAt(0); // 获取第一个工作表
// 假设第一行是标题行
XSSFRow headerRow = sheet.getRow(0);
Map<String, Map<String, Map<String, String>>> bomMap = new HashMap<String, Map<String, Map<String, String>>>();
for (int dataRowNum = 1; dataRowNum <= sheet.getLastRowNum(); dataRowNum++) {
XSSFRow dataRow = sheet.getRow(dataRowNum);
if (dataRow == null) {
continue; // 跳过空行
}
// 手动获取父件id 子件id
String fId = getCellValue(dataRow.getCell(0), dataRow);
String cId = getCellValue(dataRow.getCell(2), dataRow);
Map<String, Map<String, String>> chileMap = new HashMap<String, Map<String, String>>();
Map<String, String> attrMap = new HashMap<String, String>();
// 从第五列开始读取
for (int colNum = 4; colNum < headerRow.getLastCellNum(); colNum++) {
String key = getCellValue(headerRow.getCell(colNum), headerRow);
if (key == null || "".equals(key.trim())) {
break;
}
String value = getCellValue(dataRow.getCell(colNum), dataRow);
attrMap.put(key, value);
}
chileMap.put(cId, attrMap);
Map<String, String> childMap = new HashMap<String, String>();
// 获取单元格的内容
// 判断map中是否有父对象
if (bomMap.containsKey(fId)) {
bomMap.get(fId).putAll(chileMap);
} else {
bomMap.put(fId, chileMap);
}
}
workbook.close();
fis.close();
return bomMap;
}
/**
*
* @Title: getCellValue
* @Description: excel
* @param @param dataCell
* @param @param dataRow
* @param @return
* @return String
* @throws
*/
public String getCellValue(XSSFCell dataCell, XSSFRow dataRow) {
Object value;
if (dataCell == null) {
return "";
}
switch (dataCell.getCellType()) {
case STRING:
value = dataCell.getStringCellValue();
break;
case NUMERIC:
value = Double.toString(dataCell.getNumericCellValue());
break;
case BOOLEAN:
value = Boolean.toString(dataCell.getBooleanCellValue());
break;
default:
System.out.println("Warning: Unexpected cell type encountered, skipping this cell. Cell at ("
+ dataRow.getRowNum() + ")");
return "";
}
return value.toString();
}
}

@ -0,0 +1,91 @@
package com.connor.fh.plm.operations;
import java.util.List;
public class BatchBomCreate {
private String fId;
private String fName;
private String fWork;
private String fPurpose;
private String fNum;
private String fProjId;
private String fProjType;
private ChildLine childLines;
public BatchBomCreate() {
super();
}
public BatchBomCreate(String fId, String fName, String fWork, String fPurpose, String fNum, String fProjId,
String fProjType, ChildLine childLines) {
super();
this.fId = fId;
this.fName = fName;
this.fWork = fWork;
this.fPurpose = fPurpose;
this.fNum = fNum;
this.fProjId = fProjId;
this.fProjType = fProjType;
this.childLines = childLines;
}
public String getfId() {
return fId;
}
public void setfId(String fId) {
this.fId = fId;
}
public String getfName() {
return fName;
}
public void setfName(String fName) {
this.fName = fName;
}
public String getfWork() {
return fWork;
}
public void setfWork(String fWork) {
this.fWork = fWork;
}
public String getfPurpose() {
return fPurpose;
}
public void setfPurpose(String fPurpose) {
this.fPurpose = fPurpose;
}
public String getfNum() {
return fNum;
}
public void setfNum(String fNum) {
this.fNum = fNum;
}
public String getfProjId() {
return fProjId;
}
public void setfProjId(String fProjId) {
this.fProjId = fProjId;
}
public String getfProjType() {
return fProjType;
}
public void setfProjType(String fProjType) {
this.fProjType = fProjType;
}
public ChildLine getChildLines() {
return childLines;
}
public void setChildLines(ChildLine childLines) {
this.childLines = childLines;
}
@Override
public String toString() {
return "BatchBomCreate [fId=" + fId + ", fName=" + fName + ", fWork=" + fWork + ", fPurpose=" + fPurpose
+ ", fNum=" + fNum + ", fProjId=" + fProjId + ", fProjType=" + fProjType + ", childLines=" + childLines
+ "]";
}
}

@ -0,0 +1,255 @@
package com.connor.fh.plm.operations;
public class ChildLine {
private String cId;
private String cName;
private String cNum;
private String cUnit;
private String cGXBFL;
private String cJId;
private String cGdz;
private String cFCKCDD;
private String cTSHQ;
private String cBZ;
private String cTDXMZ;
private String cYXJ;
private String cCL;
private String cCYKNX;
private String cWLGYBS;
private String cSZWL;
public ChildLine() {
super();
}
public ChildLine(String cId, String cName, String cNum, String cUnit, String cGXBFL, String cJId, String cGdz,
String cFCKCDD, String cTSHQ, String cBZ, String cTDXMZ, String cYXJ, String cCL, String cCYKNX,
String cWLGYBS, String cSZWL) {
super();
this.cId = cId;
this.cName = cName;
this.cNum = cNum;
this.cUnit = cUnit;
this.cGXBFL = cGXBFL;
this.cJId = cJId;
this.cGdz = cGdz;
this.cFCKCDD = cFCKCDD;
this.cTSHQ = cTSHQ;
this.cBZ = cBZ;
this.cTDXMZ = cTDXMZ;
this.cYXJ = cYXJ;
this.cCL = cCL;
this.cCYKNX = cCYKNX;
this.cWLGYBS = cWLGYBS;
this.cSZWL = cSZWL;
}
public String getcId() {
return cId;
}
public void setcId(String cId) {
this.cId = cId;
}
public String getcName() {
return cName;
}
public void setcName(String cName) {
this.cName = cName;
}
public String getcNum() {
return cNum;
}
public void setcNum(String cNum) {
this.cNum = cNum;
}
public String getcUnit() {
return cUnit;
}
public void setcUnit(String cUnit) {
this.cUnit = cUnit;
}
public String getcGXBFL() {
return cGXBFL;
}
public void setcGXBFL(String cGXBFL) {
this.cGXBFL = cGXBFL;
}
public String getcJId() {
return cJId;
}
public void setcJId(String cJId) {
this.cJId = cJId;
}
public String getcGdz() {
return cGdz;
}
public void setcGdz(String cGdz) {
this.cGdz = cGdz;
}
public String getcFCKCDD() {
return cFCKCDD;
}
public void setcFCKCDD(String cFCKCDD) {
this.cFCKCDD = cFCKCDD;
}
public String getcTSHQ() {
return cTSHQ;
}
public void setcTSHQ(String cTSHQ) {
this.cTSHQ = cTSHQ;
}
public String getcBZ() {
return cBZ;
}
public void setcBZ(String cBZ) {
this.cBZ = cBZ;
}
public String getcTDXMZ() {
return cTDXMZ;
}
public void setcTDXMZ(String cTDXMZ) {
this.cTDXMZ = cTDXMZ;
}
public String getcYXJ() {
return cYXJ;
}
public void setcYXJ(String cYXJ) {
this.cYXJ = cYXJ;
}
public String getcCL() {
return cCL;
}
public void setcCL(String cCL) {
this.cCL = cCL;
}
public String getcCYKNX() {
return cCYKNX;
}
public void setcCYKNX(String cCYKNX) {
this.cCYKNX = cCYKNX;
}
public String getcWLGYBS() {
return cWLGYBS;
}
public void setcWLGYBS(String cWLGYBS) {
this.cWLGYBS = cWLGYBS;
}
public String getcSZWL() {
return cSZWL;
}
public void setcSZWL(String cSZWL) {
this.cSZWL = cSZWL;
}
@Override
public String toString() {
return "ChildLine [cId=" + cId + ", cName=" + cName + ", cNum=" + cNum + ", cUnit=" + cUnit + ", cGXBFL="
+ cGXBFL + ", cJId=" + cJId + ", cGdz=" + cGdz + ", cFCKCDD=" + cFCKCDD + ", cTSHQ=" + cTSHQ + ", cBZ="
+ cBZ + ", cTDXMZ=" + cTDXMZ + ", cYXJ=" + cYXJ + ", cCL=" + cCL + ", cCYKNX=" + cCYKNX + ", cWLGYBS="
+ cWLGYBS + ", cSZWL=" + cSZWL + "]";
}
}

@ -0,0 +1,481 @@
package com.connor.fh.plm.operations;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.eclipse.jface.bindings.keys.formatting.EmacsKeyFormatter;
import com.connor.jd.plm.util.Util;
import com.teamcenter.rac.aif.AbstractAIFOperation;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCComponentForm;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemType;
import com.teamcenter.rac.kernel.TCComponentType;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCProperty;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
/**
*
* @ClassName: MateriaBatchCreateOperation
* @Description:
* @author hcj
* @date 2024415
*
*/
public class MateriaBatchCreateOperation extends AbstractAIFOperation {
private TCSession session;
private TCComponentFolder folder;
private String path = null;
private JLabel label = new JLabel("数据文件:");
private JTextField jtf = new JTextField(25);
private JButton button = new JButton("浏览");
private JButton button2 = new JButton("确定");
private JFrame jf;
private Map<String, String> itemTypeMap = new HashMap<String, String>();
private Map<String, Boolean> isMastSetMap = new HashMap<String, Boolean>();
private Map<String, String> attrTypeMap = new HashMap<String, String>();
private Map<String, String> itemAttrMap = new HashMap<String, String>();
private Map<String, String> itemMasterAttrMap = new HashMap<String, String>();
private Map<String, String> itemRevAttrMap = new HashMap<String, String>();
private Map<String, String> itemRevMasterAttrMap = new HashMap<String, String>();
public MateriaBatchCreateOperation(TCSession session, TCComponentFolder folder) {
this.session = session;
this.folder = folder;
// 获取首选项的值
getSXX();
}
/**
*
* @Title: getSXX
* @Description:
* @param
* @return void
* @throws
*/
private void getSXX() {
// TODO Auto-generated method stub
String[] sxx = Util.getSXX(session, "PHZD_materials_create");
for (String str : sxx) {
try {
String[] split = str.split("=");// 获取excel列名称
String[] split2 = split[1].split(":");// 获取属性位置已经真实名称 是否必填
// 判断属性是否必填和类型
String[] split3 = split2[1].split("#");
String[] split4 = split3[1].split("-");
isMastSetMap.put(split[0], Boolean.parseBoolean(split4[0]));
attrTypeMap.put(split3[0], split4[1]);
// 判断属性位置
if ("对象".equals(split2[0])) {
itemAttrMap.put(split[0], split3[0]);
} else if ("对象表单".equals(split2[0])) {
itemMasterAttrMap.put(split[0], split3[0]);
} else if ("版本".equals(split2[0])) {
itemRevAttrMap.put(split[0], split3[0]);
} else if ("版本表单".equals(split2[0])) {
itemRevMasterAttrMap.put(split[0], split3[0]);
}
} catch (Exception e) {
// TODO Auto-generated catch block
MessageBox.post("首选项PHZD_materials_create【" + str + "】配置有误", "提示", MessageBox.ERROR);
return;
}
}
String[] sxx2 = Util.getSXX(session, "PHZD_Mtype_Itemtype");
for (String str : sxx2) {
try {
String[] split = str.split("=");
itemTypeMap.put(split[0], split[1]);
} catch (Exception e) {
// TODO Auto-generated catch block
MessageBox.post("首选项PHZD_Mtype_Itemtype【" + str + "】配置有误", "提示", MessageBox.ERROR);
return;
}
}
}
@Override
public void executeOperation() throws Exception {
// TODO Auto-generated method stub
jf = new JFrame("导入对象");
jf.setBounds(400, 200, 700, 150);
JPanel panel = new JPanel();
JPanel panel2 = new JPanel();
panel.add(this.label);
panel.add(this.jtf);
panel.add(this.button);
panel2.add(this.button2);
jf.add(panel, "North");
jf.add(panel2, "South");
jf.setVisible(true);
jf.setDefaultCloseOperation(2);
this.button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
try {
JFileChooser fc = new JFileChooser("C:\\");
// 设置为仅选择文件模式
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
int val = fc.showOpenDialog(null);
if (val == JFileChooser.APPROVE_OPTION) { // 对比值应为 JFileChooser.APPROVE_OPTION 而不是直接用 0
path = fc.getSelectedFile().getPath(); // 使用 getPath() 获取文件路径
jtf.setText(path);
// 获取选择文件类型是否为excel
File selectedFile = fc.getSelectedFile();
// 检查文件扩展名
String fileName = selectedFile.getName();
String extension = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
boolean isExcelByExtension = (extension.equals("xls") || extension.equals("xlsx")
|| extension.equals("xlsm"));
if (!isExcelByExtension) {
MessageBox.post("选择的文件不是excel文件 请重新选择", "提示", MessageBox.INFORMATION);
jtf.setText("");
}
} else {
jtf.setText("未选择文件");
}
} catch (Exception var4) {
var4.printStackTrace();
}
}
});
this.button2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
try {
if (path != null && path != "" && !"未选择文件".equals(path)) {
createMaterial();
} else {
MessageBox.post("未选择文件!", "提示", MessageBox.INFORMATION);
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
protected void createMaterial() throws TCException, IOException {
// TODO Auto-generated method stub
// 读取excel
System.out.println("开始读取Excel");
List<Map<String, String>> readExcel = readExcel(path);
System.out.println("Excel数据" + readExcel);
// 校验数据,遍历excel数据判断是否必填值为空
System.out.println("校验数据,遍历excel数据判断是否必填值为空");
for (Map<String, String> map : readExcel) {
for (Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
System.out.println("key:" + key);
System.out.println("isMastSetMap:" + isMastSetMap);
if (isMastSetMap.get(key)) {
String value = entry.getValue();
if (value == null || value.trim().equals("")) {
MessageBox.post("excel数据校验未通过" + key + ",为必填属性", "提示", MessageBox.ERROR);
return;
}
}
}
}
// 判断excel是否有物料类型代码
System.out.println("判断excel是否有物料类型代码");
for (Map<String, String> map : readExcel) {
System.out.println("map:" + map);
if (map == null || map.size() == 0) {
readExcel.remove(map);
continue;
}
if (map.containsKey("物料类型代码")) {
String string = map.get("物料类型代码");
if (string == null || string.isEmpty()) {
MessageBox.post("物料类型代码不能为空", "提示", MessageBox.ERROR);
return;
}
} else {
MessageBox.post("物料类型代码不能为空", "提示", MessageBox.ERROR);
return;
}
}
// 创建对象
System.out.println("开始创建对象");
System.out.println("attrType"+attrTypeMap);
//获取单位
Map<String, TCComponent> uomTags = new HashMap<String, TCComponent>();
TCComponentType typeComponent = session.getTypeComponent("UnitOfMeasure");
TCComponent[] extent = typeComponent.extent();
for(int t=0;t<extent.length;t++) {
uomTags.put(extent[t].getStringProperty("symbol"), extent[t]);
}
// Util.setByPass(true);
for (Map<String, String> map : readExcel) {
try {
String code = map.get("物料类型代码");
String type = itemTypeMap.get(code);
System.out.println("创建物料type:" + type);
// 获取Item类型的type
TCComponentItemType tccomponentitemtype = (TCComponentItemType) (session.getTypeComponent(type));
System.out.println("Item类型的type" + tccomponentitemtype);
// 获取流水码
String itemId = tccomponentitemtype.getNewID();
System.out.println("流水码" + itemId);
// 获取版本号
String itemRev = tccomponentitemtype.getNewRev(null);
System.out.println("版本号" + itemRev);
// 获取excel的名称
String name = "物料名称";
Map<String, String> itemattrs = getattrs(map, itemAttrMap);
Map<String, String> itemattrs2 = Util.convertValuesToUtf8(itemattrs);
System.out.println("item属性" + itemattrs2);
if (itemattrs2.containsKey("object_name")) {
System.out.println("包含object_name");
name = itemattrs2.get("object_name");
System.out.println("name:" + name);
// itemattrs2.remove("object_name");
}
// 获取单位可以为null
String unit = null;
TCComponent[] uoms = null;
if (itemattrs2.containsKey("uom_tag")) {
System.out.println("包含uom_tag");
System.out.println(itemattrs2.get("uom_tag") + "==>单位");
unit = itemattrs2.get("uom_tag");
// itemattrs2.remove("uom_tag");
}
//获取版本属性
Map<String, String> revattrs = getattrs(map, itemRevAttrMap);
Map<String, String> revattrs2 = Util.convertValuesToUtf8(revattrs);
//获取版本表单属性
Map<String, String> revMasterattrs = getattrs(map, itemRevMasterAttrMap);
Map<String, String> revMasterattrs2 = Util.convertValuesToUtf8(revMasterattrs);
// Item的idItem的版本号Item的类型零组件的名称零组件的描述零组件的单位(可以为null)
// TCComponentItem item = tccomponentitemtype.create(itemId, itemRev, type, name, "", null);
System.out.println("item属性"+itemattrs2);
System.out.println("itemRev属性"+revattrs2);
System.out.println("itemRevMast属性"+revMasterattrs2);
TCComponentItem item = (TCComponentItem) Util.createMaterialBySOA(session, itemId, itemRev, type, name, "", unit,itemattrs2,revattrs2,revMasterattrs2,uomTags);
System.out.println("对象【"+item.getStringProperty("item_id")+"】创建成功,开始赋值");
// 给对象表单赋值
Map<String, String> itemMasterattrs = getattrs(map, itemMasterAttrMap);
System.out.println("item表单属性" + itemMasterattrs);
if (itemMasterattrs.size() > 0) {
TCComponent[] masterFormItem = item.getReferenceListProperty("IMAN_master_form");
TCComponentForm itemform = (TCComponentForm) masterFormItem[0];
itemform.lock();
for (Entry<String, String> entry : itemMasterattrs.entrySet()) {
System.out.println(entry.getKey() + "==>" + entry.getValue());
Object typeForAttr = getTypeForAttr(entry.getKey(), entry.getValue());
Util.setTCPropertyValue(itemform, entry.getKey(), typeForAttr);
}
itemform.save();
itemform.unlock();
}
folder.add("contents", item);
} catch (Exception e) {
System.out.println("属性赋值失败!");
}
}
// Util.setByPass(false);
jf.dispose();
MessageBox.post("创建成功", "提示", MessageBox.INFORMATION);
return;
}
protected Map<String, String> getattrs(Map<String, String> map, Map<String, String> itemAttrMap) {
// 填充属性
Map<String, String> attrmap = new HashMap<String, String>();
for (Entry<String, String> entry : itemAttrMap.entrySet()) {
if (map.containsKey(entry.getKey())) {
String string = map.get(entry.getKey());
attrmap.put(entry.getValue(), string);
}
}
return attrmap;
}
public Object getTypeForAttr(String attrName, String attrProperty) {
if (attrTypeMap.containsKey(attrName)) {
String type = attrTypeMap.get(attrName);
if ("string".equals(type)) {
System.out.println("string属性");
return attrProperty; // 直接返回字符串属性值
} else if ("strings".equals(type)) {
System.out.println("strings属性");
// 假设attrProperty是一个逗号分隔的字符串将其转换成字符串数组
return attrProperty.split(",");
} else if ("int".equals(type)) {
System.out.println("int属性");
try {
return Integer.parseInt(attrProperty); // 将字符串转换成整数
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid integer value for attribute: " + attrName);
}
} else if ("double".equals(type)) {
System.out.println("double属性");
try {
return Double.parseDouble(attrProperty); // 将字符串转换成浮点数
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid double value for attribute: " + attrName);
}
} else if ("date".equals(type)) {
// 假设attrProperty是符合某种日期格式的字符串这里简化处理实际应用中应使用更健壮的日期解析
System.out.println("date属性");
try {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); // 根据实际格式调整
return formatter.parse(attrProperty);
} catch (ParseException e) {
throw new IllegalArgumentException("Invalid date format for attribute: " + attrName);
}
}
}
// 如果类型不匹配或不存在于map中根据实际情况处理这里简单返回null
return null;
}
/**
*
* @Title: readExcel
* @Description: excel
* @param @param path excel
* @return void
* @throws IOException
* @throws
*/
protected List<Map<String, String>> readExcel(String path) throws IOException {
// TODO Auto-generated method stub
FileInputStream fis = new FileInputStream(path);
XSSFWorkbook workbook = new XSSFWorkbook(fis);
XSSFSheet sheet = workbook.getSheetAt(0); // 获取第一个工作表
// 假设第一行是标题行
XSSFRow headerRow = sheet.getRow(0);
List<Map<String, String>> list = new ArrayList<>();
for (int dataRowNum = 1; dataRowNum <= sheet.getLastRowNum(); dataRowNum++) {
XSSFRow dataRow = sheet.getRow(dataRowNum);
if (dataRow == null) {
break;
}
Map<String, String> dataMap = new HashMap<>();
// 从第二列开始读取
for (int colNum = 1; colNum < headerRow.getLastCellNum(); colNum++) {
XSSFCell headerCell = headerRow.getCell(colNum);
XSSFCell dataCell = dataRow.getCell(colNum);
if (headerCell != null && dataCell != null) {
String key;
Object value;
switch (headerCell.getCellType()) {
case STRING:
key = headerCell.getStringCellValue();
break;
// 如果假设标题行不可能是数字或其他类型,可以在这里直接抛异常或者给默认值
default:
throw new IllegalStateException("Header cell type is not string");
}
switch (dataCell.getCellType()) {
case STRING:
value = dataCell.getStringCellValue();
break;
case NUMERIC:
value = Double.toString(dataCell.getNumericCellValue());
// 如果有可能包含日期,可以使用如下方式处理日期单元格
// if (DateUtil.isCellDateFormatted(dataCell)) {
// value = new
// SimpleDateFormat("yyyy-MM-dd").format(dataCell.getDateCellValue());
// } else {
// value = Double.toString(dataCell.getNumericCellValue());
// }
break;
case BOOLEAN:
value = Boolean.toString(dataCell.getBooleanCellValue());
break;
// 添加对其他类型的支持,例如 FORMULA
// case FORMULA:
// value = dataCell.getCellFormula();
// break;
default:
// 对于未知或不支持的单元格类型,可以选择忽略、记录日志或者提供默认值
// 这里我们选择打印警告并跳过此次循环
System.out.println("Warning: Unexpected cell type encountered, skipping this cell. Cell at ("
+ dataRow.getRowNum() + ", " + colNum + ")");
continue;
}
dataMap.put(key, value.toString());
}
}
list.add(dataMap);
}
workbook.close();
fis.close();
// 输出或处理生成的List<Map<String, String>>
System.out.println(list);
return list.stream().filter(map -> !map.isEmpty()).collect(Collectors.toList());// 去除这些里面的空map
}
}

@ -0,0 +1,73 @@
package com.connor.jd.operations;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.connor.jd.plm.utils.DBConnectionUtil;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
public class CreateTableOperation {
private static Connection con = null;
private static Statement ps = null;
private static ResultSet rs = null;
private static TCSession session;
public static void create() {
session = (TCSession) AIFUtility.getCurrentApplication().getSession();
String createTable1 = "CREATE TABLE JD2_Component (test_type VARCHAR(255),test_project VARCHAR(255),test_time VARCHAR(255),test_num NUMBER,test_cost FLOAT, test_id NUMBER primary key)";
String createSeq1 = "CREATE sequence component_id_seq minvalue 1 nomaxvalue INCREMENT BY 1 START WITH 1 nocache";
String createTRG1 = "CREATE or REPLACE TRIGGER component_id_ins_trg before INSERT ON JD2_COMPONENT for each ROW BEGIN SELECT component_id_seq.Nextval into : new.TEST_ID from dual; END;";
String createTable2 = "CREATE TABLE JD2_Machine (test_type VARCHAR(255),test_project VARCHAR(255),test_cost FLOAT, test_id NUMBER primary key)";
String createSeq2 = "CREATE sequence machine_id_seq minvalue 1 nomaxvalue INCREMENT BY 1 START WITH 1 nocache";
String createTRG2 = "CREATE or REPLACE TRIGGER machine_id_ins_trg before INSERT ON JD2_MACHINE for each ROW BEGIN SELECT machine_id_seq.Nextval into : new.TEST_ID from dual; END;";
String[] sqls = { createTable1, createSeq1, createTRG1, createTable2, createSeq2, createTRG2 };
try {
con = DBConnectionUtil.dbConn(session);
String sqlString = "SELECT count(*) from user_tables WHERE table_name='JD2_COMPONENT'";
if (con == null) {
System.out.print("Á¬½Óʧ°Ü");
} else {
ps = con.createStatement();
rs = ps.executeQuery(sqlString);
while (rs.next()) {
System.out.println(rs.getInt(1));
if (rs.getInt(1) == 0) {
for (int i = 0; i < sqls.length; i++) {
ps = con.createStatement();
ps.execute(sqls[i]);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (ps != null) {
try {
ps.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (con != null) {
try {
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
}

@ -0,0 +1,203 @@
package com.connor.jd.operations;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
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.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class ExcelImportServiceImpl {
public String importExcel(InputStream inputStream, String fileName) throws Exception {
String message = "Import success";
boolean isE2007 = false;
// 判断是否是excel2007格式
if (fileName.endsWith("xlsx")) {
isE2007 = true;
}
int rowIndex = 0;
try {
InputStream input = inputStream; // 建立输入流
Workbook wb;
// 根据文件格式(2003或者2007)来初始化
if (isE2007) {
wb = new XSSFWorkbook(input);
} else {
wb = new HSSFWorkbook(input);
}
Sheet sheet = wb.getSheetAt(0); // 获得第一个表单
int rowCount = sheet.getLastRowNum() + 1;
for (int i = 1; i < rowCount; i++) {
rowIndex = i;
Row row;
for (int j = 0; j < 26; j++) {
if (isMergedRegion(sheet, i, j)) {
System.out.print(getMergedRegionValue(sheet, i, j) + "\t");
} else {
row = sheet.getRow(i);
System.out.print(row.getCell(j) + "\t");
}
}
System.out.print("\n");
}
} catch (Exception ex) {
message = "Import failed, please check the data in " + rowIndex + " rows ";
}
return message;
}
/**
*
*
* @param cell
* @return
*/
public String getCellValue(Cell cell) {
if (cell == null)
return "";
return cell.getStringCellValue();
}
/**
* ,
*
* @param sheet
* @return List<CellRangeAddress>
*/
public List<CellRangeAddress> getCombineCell(Sheet sheet) {
List<CellRangeAddress> list = new ArrayList<>();
// 获得一个 sheet 中合并单元格的数量
int sheetmergerCount = sheet.getNumMergedRegions();
// 遍历所有的合并单元格
for (int i = 0; i < sheetmergerCount; i++) {
// 获得合并单元格保存进list中
CellRangeAddress ca = sheet.getMergedRegion(i);
list.add(ca);
}
return list;
}
private int getRowNum(List<CellRangeAddress> listCombineCell, Cell cell, Sheet sheet) {
int xr = 0;
int firstC = 0;
int lastC = 0;
int firstR = 0;
int lastR = 0;
for (CellRangeAddress ca : listCombineCell) {
// 获得合并单元格的起始行, 结束行, 起始列, 结束列
firstC = ca.getFirstColumn();
lastC = ca.getLastColumn();
firstR = ca.getFirstRow();
lastR = ca.getLastRow();
if (cell.getRowIndex() >= firstR && cell.getRowIndex() <= lastR) {
if (cell.getColumnIndex() >= firstC && cell.getColumnIndex() <= lastC) {
xr = lastR;
}
}
}
return xr;
}
/**
*
*
* @param listCombineCell list
* @param cell
* @param sheet sheet
* @return
*/
public String isCombineCell(List<CellRangeAddress> listCombineCell, Cell cell, Sheet sheet) throws Exception {
int firstC = 0;
int lastC = 0;
int firstR = 0;
int lastR = 0;
String cellValue = null;
for (CellRangeAddress ca : listCombineCell) {
// 获得合并单元格的起始行, 结束行, 起始列, 结束列
firstC = ca.getFirstColumn();
lastC = ca.getLastColumn();
firstR = ca.getFirstRow();
lastR = ca.getLastRow();
if (cell.getRowIndex() >= firstR && cell.getRowIndex() <= lastR) {
if (cell.getColumnIndex() >= firstC && cell.getColumnIndex() <= lastC) {
Row fRow = sheet.getRow(firstR);
Cell fCell = fRow.getCell(firstC);
cellValue = getCellValue(fCell);
break;
}
} else {
cellValue = "";
}
}
return cellValue;
}
/**
*
*
* @param sheet
* @param row
* @param column
* @return
*/
public String getMergedRegionValue(Sheet sheet, int row, int column) {
int sheetMergeCount = sheet.getNumMergedRegions();
for (int i = 0; i < sheetMergeCount; i++) {
CellRangeAddress ca = sheet.getMergedRegion(i);
int firstColumn = ca.getFirstColumn();
int lastColumn = ca.getLastColumn();
int firstRow = ca.getFirstRow();
int lastRow = ca.getLastRow();
if (row >= firstRow && row <= lastRow) {
if (column >= firstColumn && column <= lastColumn) {
Row fRow = sheet.getRow(firstRow);
Cell fCell = fRow.getCell(firstColumn);
return getCellValue(fCell);
}
}
}
return null;
}
/**
*
*
* @param sheet
* @param row
* @param column
* @return
*/
private boolean isMergedRegion(Sheet sheet, int row, int column) {
int sheetMergeCount = sheet.getNumMergedRegions();
for (int i = 0; i < sheetMergeCount; i++) {
CellRangeAddress range = sheet.getMergedRegion(i);
int firstColumn = range.getFirstColumn();
int lastColumn = range.getLastColumn();
int firstRow = range.getFirstRow();
int lastRow = range.getLastRow();
if (row >= firstRow && row <= lastRow) {
if (column >= firstColumn && column <= lastColumn) {
return true;
}
}
}
return false;
}
}

@ -0,0 +1,264 @@
package com.connor.jd.operations;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
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.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.teamcenter.rac.kernel.TCComponent;
public class ExcelOperation {
private static final String XLS = "xls";
private static final String XLSX = "xlsx";
public static void writeExcel(File file, String outpath, Map<String, List<TCComponent>> jfw) {
if (jfw.size() == 1) {
writeoneExcel(file, outpath, jfw);
} else {
writeallExcel(file, outpath, jfw);
}
}
public static void writeallExcel(File file, String outpath, Map<String, List<TCComponent>> jfw) {
Workbook workbook;
try {
workbook = getworkbook(file);
System.out.println("已有文件");
Workbook newwb = getWorkbook(outpath);
Sheet newsheet = newwb.createSheet();
Sheet sheet = workbook.getSheetAt(0);
CellStyle style = workbook.createCellStyle();
Row row = sheet.getRow(0);
row.setRowStyle(style);
Row newrow0 = newsheet.createRow(0);
for (int i = 0; i < row.getLastCellNum(); i++) {
// Cell newCell = newrow0.createCell(i);
// newCell.setCellValue(row.getCell(i).getStringCellValue());
}
List<CellRangeAddress> cellRangeList = getCombineCell(sheet);
for (Entry<String, List<TCComponent>> ever : jfw.entrySet()) {
List<TCComponent> itemList = ever.getValue();
String sfname = ever.getKey();
System.out.println("itemList长度" + itemList.size());
for (int i = 0; i < cellRangeList.size(); i++) {
CellRangeAddress ca = cellRangeList.get(i);
int firstColumn = 0;
int firstRow = ca.getFirstRow();
int lastRow = ca.getLastRow();
Row fRow = sheet.getRow(firstRow);
Cell fCell = fRow.getCell(firstColumn);
String cellVelue = fCell.getStringCellValue();
System.out.println("合并单元格的内容" + cellVelue);
System.out.println("起始行" + firstRow + "最后行" + lastRow);
if (sfname.equals(cellVelue)) {
for (int z = firstRow; z <= lastRow; z++) {
Row newRow = sheet.getRow(z);
String value = newRow.getCell(1).getStringCellValue();
System.out.println("表格内容" + value);
for (int p = 0; p < itemList.size(); p++) {
if (itemList.get(p).getTCProperty("object_type").getDisplayableValue().equals(value)) {
TCComponent[] revlist = itemList.get(p).getTCProperty("revision_list")
.getReferenceValueArray();
TCComponent component = null;
for (int revlength = 0; revlength < revlist.length; revlength++) {
String status = revlist[revlength].getProperty("release_status_list");
if (!status.equals("")) {
component = revlist[revlength];
}
}
String[] info = new String[4];
if (component != null) {
info[0] = component.getProperty("owning_group");
info[1] = component.getProperty("owning_user");
info[2] = component.getProperty("creation_date");
info[3] = component.getProperty("item_id");
} else {
info[0] = "";
info[1] = "";
info[2] = "";
info[3] = "";
}
for (int v = 0; v < info.length; v++) {
Cell cellvalue = newRow.createCell(v + 2);
// cellvalue.setCellValue(info[v]);
System.out.println("内容是" + info[v]);
}
}
}
}
}
}
}
FileOutputStream fos = new FileOutputStream(outpath);
workbook.write(fos);
workbook.close();
fos.close();
} catch (Exception e) {
}
}
public static void writeoneExcel(File file, String outpath, Map<String, List<TCComponent>> jfw) {
Workbook workbook;
try {
workbook = getworkbook(file);
System.out.println("已有文件");
Workbook newwb = getWorkbook(outpath);
Sheet newsheet = newwb.createSheet();
Sheet sheet = workbook.getSheetAt(0);
CellStyle style = newwb.createCellStyle();
Row row = sheet.getRow(0);
Row newrow0 = newsheet.createRow(0);
for (int i = 0; i < row.getLastCellNum(); i++) {
Cell oldCell = row.getCell(i);
style.cloneStyleFrom(oldCell.getCellStyle());
Cell newCell = newrow0.createCell(i);
newCell.setCellStyle(style);
// newCell.setCellValue(oldCell.getStringCellValue());
}
List<CellRangeAddress> cellRangeList = getCombineCell(sheet);
for (Entry<String, List<TCComponent>> ever : jfw.entrySet()) {
List<TCComponent> itemList = ever.getValue();
String sfname = ever.getKey();
System.out.println("itemList长度" + itemList.size());
for (int i = 0; i < cellRangeList.size(); i++) {
CellRangeAddress ca = cellRangeList.get(i);
int firstColumn = 0;
int firstRow = ca.getFirstRow();
int lastRow = ca.getLastRow();
Row fRow = sheet.getRow(firstRow);
Cell fCell = fRow.getCell(firstColumn);
String cellVelue = fCell.getStringCellValue();
System.out.println("合并单元格的内容" + cellVelue);
System.out.println("起始行" + firstRow + "最后行" + lastRow);
if (sfname.equals(cellVelue)) {
List<String> valueList = new ArrayList<String>();
for (int z = firstRow; z <= lastRow; z++) {
Row oldRow = sheet.getRow(z);
String value = oldRow.getCell(1).getStringCellValue();
valueList.add(value);
}
for (int j = 1; j <= lastRow - firstRow + 1; j++) {
Row newRow = newsheet.createRow(j);
Cell cell = newRow.createCell(0);
// cell.setCellValue(cellVelue);
Cell cell2 = newRow.createCell(1);
// cell2.setCellValue(valueList.get(j - 1));
System.out.println("特殊表格内容" + valueList.get(j - 1));
for (int p = 0; p < itemList.size(); p++) {
if (itemList.get(p).getTCProperty("object_type").getDisplayableValue()
.equals(valueList.get(j - 1))) {
System.out.println(
"类型:" + itemList.get(p).getTCProperty("object_type").getDisplayableValue());
TCComponent[] revlist = itemList.get(p).getTCProperty("revision_list")
.getReferenceValueArray();
TCComponent component = null;
for (int revlength = 0; revlength < revlist.length; revlength++) {
String status = revlist[revlength].getProperty("release_status_list");
if (!status.equals("")) {
component = revlist[revlength];
}
}
String[] info = new String[4];
if (component != null) {
info[0] = component.getProperty("owning_group");
info[1] = component.getProperty("owning_user");
info[2] = component.getProperty("creation_date");
info[3] = component.getProperty("item_id");
} else {
info[0] = "";
info[1] = "";
info[2] = "";
info[3] = "";
}
for (int v = 0; v < info.length; v++) {
System.out.println("开始创建内容");
Cell cellvalue = newRow.createCell(v + 2);
// cellvalue.setCellValue(info[v]);
System.out.println("内容是" + info[v]);
}
}
}
}
CellRangeAddress region = new CellRangeAddress(1, lastRow - firstRow + 1, 0, 0);
newsheet.addMergedRegion(region);
}
}
}
FileOutputStream fos = new FileOutputStream(outpath);
newwb.write(fos);
newwb.close();
fos.close();
} catch (Exception e) {
}
}
/**
* ,
*
* @param sheet
* @return List<CellRangeAddress>
*/
public static List<CellRangeAddress> getCombineCell(Sheet sheet) {
List<CellRangeAddress> list = new ArrayList<>();
// 获得一个 sheet 中合并单元格的数量
int sheetmergerCount = sheet.getNumMergedRegions();
// 遍历所有的合并单元格
for (int i = 0; i < sheetmergerCount; i++) {
// 获得合并单元格保存进list中
CellRangeAddress ca = sheet.getMergedRegion(i);
list.add(ca);
}
return list;
}
public static Workbook getWorkbook(String file) throws IOException {
Workbook workbook = null;
// FileInputStream in = new FileInputStream(file);
if (file.endsWith(XLS)) {
System.out.println("xls");
workbook = new HSSFWorkbook();
} else if (file.endsWith(XLSX)) {
System.out.println("xlsx");
workbook = new XSSFWorkbook();
} else {
System.out.println("格式错误");
}
return workbook;
}
public static Workbook getworkbook(File file) throws IOException {
Workbook workbook = null;
FileInputStream in = new FileInputStream(file);
if (file.getName().endsWith(XLS)) {
System.out.println("xls");
workbook = new HSSFWorkbook(in);
} else if (file.getName().endsWith(XLSX)) {
System.out.println("xlsx");
workbook = new XSSFWorkbook(in);
} else {
System.out.println("格式错误");
}
in.close();
return workbook;
}
}

@ -0,0 +1,25 @@
package com.connor.jd.plm.action;
import com.connor.jd.plm.dialogs.BOMManagementFrame;
import com.teamcenter.rac.aif.AIFDesktop;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.common.actions.AbstractAIFAction;
public class BOMManagementAction extends AbstractAIFAction {
private AIFDesktop app;
private AbstractAIFApplication arg2;
public BOMManagementAction(AIFDesktop arg0, String arg1,AbstractAIFApplication arg2) {
super(arg0, arg1);
// TODO Auto-generated constructor stub
this.app = arg0;
this.arg2 = arg2;
}
@Override
public void run() {
// TODO Auto-generated method stub
new BOMManagementFrame(arg2);
}
}

@ -0,0 +1 @@
package com.connor.jd.plm.action;

@ -0,0 +1,96 @@
package com.connor.jd.plm.beans;
import cn.hutool.core.util.StrUtil;
public class BOMExportBean {
private String pid;// 父id
private String prev;// 父版本
private String cid;// 子id
private String crev;// 子版本
private String childCount;// 子数量
private String childUnit;// 子单位
private String HLCount;// 回料数量
private String SN;// 编号
public BOMExportBean(String pid, String prev, String cid, String crev, String childCount, String childUnit,
String HLCount, String SN) {
super();
this.pid = pid;
this.prev = prev;
this.cid = cid;
this.crev = crev;
this.childCount = childCount;
this.childUnit = childUnit;
this.HLCount = HLCount;
this.SN = SN;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getPrev() {
return prev;
}
public void setPrev(String prev) {
this.prev = prev;
}
public String getCid() {
return cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public String getCrev() {
return crev;
}
public void setCrev(String crev) {
this.crev = crev;
}
public String getChildCount() {
return childCount;
}
public void setChildCount(String childCount) {
this.childCount = childCount;
}
public String getChildUnit() {
return childUnit;
}
public void setChildUnit(String childUnit) {
this.childUnit = childUnit;
}
public String getHLCount() {
return HLCount;
}
public void setHLCount(String HLCount) {
this.HLCount = HLCount;
}
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
public int isNegative() {
return StrUtil.isBlank(HLCount) ? 0 : Integer.parseInt(HLCount) < 0 ? 1 : 0;
}
}

@ -0,0 +1,80 @@
package com.connor.jd.plm.beans;
public class BOMLogBean {
private String target1;
private String target2;
private String parent;
private String operation;
private String unit;
private String oldNum;
private String num;
public BOMLogBean(String target1, String target2, String parent, String operation, String unit, String oldNum,
String num) {
super();
this.target1 = target1;
this.target2 = target2;
this.parent = parent;
this.operation = operation;
this.unit = unit;
this.oldNum = oldNum;
this.num = num;
}
public String getTarget1() {
return target1;
}
public void setTarget1(String target1) {
this.target1 = target1;
}
public String getTarget2() {
return target2;
}
public void setTarget2(String target2) {
this.target2 = target2;
}
public String getParent() {
return parent;
}
public void setParent(String parent) {
this.parent = parent;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getOldNum() {
return oldNum;
}
public void setOldNum(String oldNum) {
this.oldNum = oldNum;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
}

@ -0,0 +1,74 @@
package com.connor.jd.plm.beans;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
public class BOMManageTableBean {
private String parentString;
private String childString;
private TCComponentItemRevision parentRev;
private TCComponentItemRevision childRev;
private TCComponentBOMLine parentLine;
private TCComponentBOMLine childLine;
public BOMManageTableBean(String parentString, String childString, TCComponentItemRevision parentRev,
TCComponentItemRevision childRev, TCComponentBOMLine parentLine, TCComponentBOMLine childLine) {
super();
this.parentString = parentString;
this.childString = childString;
this.parentRev = parentRev;
this.childRev = childRev;
this.parentLine = parentLine;
this.childLine = childLine;
}
public String getParentString() {
return parentString;
}
public void setParentString(String parentString) {
this.parentString = parentString;
}
public String getChildString() {
return childString;
}
public void setChildString(String childString) {
this.childString = childString;
}
public TCComponentItemRevision getParentRev() {
return parentRev;
}
public void setParentRev(TCComponentItemRevision parentRev) {
this.parentRev = parentRev;
}
public TCComponentItemRevision getChildRev() {
return childRev;
}
public void setChildRev(TCComponentItemRevision childRev) {
this.childRev = childRev;
}
public TCComponentBOMLine getParentLine() {
return parentLine;
}
public void setParentLine(TCComponentBOMLine parentLine) {
this.parentLine = parentLine;
}
public TCComponentBOMLine getChildLine() {
return childLine;
}
public void setChildLine(TCComponentBOMLine childLine) {
this.childLine = childLine;
}
}

@ -0,0 +1,14 @@
package com.connor.jd.plm.beans;
public class CheckBoxPo {
public Object value = null;
public String text = null;
public CheckBoxPo() {
}
public CheckBoxPo(String text, Object value) {
this.value = value;
this.text = text;
}
}

@ -0,0 +1,39 @@
package com.connor.jd.plm.beans;
public class ClassPropBean {
private int id;
private String name;
private String value;
public ClassPropBean(int id, String name, String value) {
super();
this.id = id;
this.name = name;
this.value = value;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

@ -0,0 +1,101 @@
package com.connor.jd.plm.beans;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
public class ComponentBean {
private int compId;
private SimpleStringProperty type;
private SimpleStringProperty project;
private SimpleStringProperty time;
private SimpleStringProperty number;
private SimpleStringProperty cost;
private int addId;// 只用于添加所用
private int stage;// 状态 0为从数据库中取出的1为新增的2为从数据库取出但被修改了的
public int getAddId() {
return addId;
}
public void setAddId(int addId) {
this.addId = addId;
}
public int getStage() {
return stage;
}
public void setStage(int stage) {
this.stage = stage;
}
public ObservableValue<String> typeProperty() {
return type;
}
public ObservableValue<String> projectProperty() {
return project;
}
public ObservableValue<String> timeProperty() {
return time;
}
public ObservableValue<String> numberProperty() {
return number;
}
public ObservableValue<String> costProperty() {
return cost;
}
public int getCompId() {
return compId;
}
public void setCompId(int compId) {
this.compId = compId;
}
public String getType() {
return type.get();
}
public void setType(String type) {
this.type = new SimpleStringProperty(type);
}
public String getProject() {
return project.get();
}
public void setProject(String project) {
this.project = new SimpleStringProperty(project);
}
public String getTime() {
return time.get();
}
public void setTime(String time) {
this.time = new SimpleStringProperty(time);
}
public String getNumber() {
return number.get();
}
public void setNumber(String number) {
this.number = new SimpleStringProperty(number);
}
public String getCost() {
return cost.get();
}
public void setCost(String cost) {
this.cost = new SimpleStringProperty(cost);
}
}

@ -0,0 +1,38 @@
package com.connor.jd.plm.beans;
import java.util.ArrayList;
import java.util.List;
public class CustomLovBean {
private List<CustomLovBean> sub = new ArrayList<CustomLovBean>();
public String displayName = "";
public CustomLovBean(String displayName) {
super();
this.displayName = displayName;
}
public CustomLovBean(String displayName, String[] subArray) {
super();
this.displayName = displayName;
translateArrayToSub(subArray);
}
public void translateArrayToSub(String[] subArray) {
for (int i = 0; i < subArray.length; i++) {
sub.add(new CustomLovBean(subArray[i]));
}
}
public List<CustomLovBean> getSub() {
return sub;
}
public boolean hasChild() {
return sub.size() != 0;
}
public void addSub(CustomLovBean clb) {
sub.add(clb);
}
}

@ -0,0 +1,38 @@
package com.connor.jd.plm.beans;
public class JG {
int row;
int times;
String jg;
public JG(int row, int times, String jg) {
super();
this.row = row;
this.times = times;
this.jg = jg;
}
public int getTimes() {
return times;
}
public void setTimes(int times) {
this.times = times;
}
public String getJg() {
return jg;
}
public void setJg(String jg) {
this.jg = jg;
}
public int getRow() {
return row;
}
public void setRow(int row) {
this.row = row;
}
}

@ -0,0 +1,75 @@
package com.connor.jd.plm.beans;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
public class MachineBean {
private int macId;
private SimpleStringProperty type;
private SimpleStringProperty project;
private SimpleStringProperty cost;
private int addId;// 只用于添加所用
private int stage;// 状态 0为从数据库中取出的1为新增的2为从数据库取出但被修改了的
public int getMacId() {
return macId;
}
public void setMacId(int macId) {
this.macId = macId;
}
public int getAddId() {
return addId;
}
public void setAddId(int addId) {
this.addId = addId;
}
public int getStage() {
return stage;
}
public void setStage(int stage) {
this.stage = stage;
}
public ObservableValue<String> typeProperty() {
return type;
}
public ObservableValue<String> projectProperty() {
return project;
}
public ObservableValue<String> costProperty() {
return cost;
}
public String getType() {
return type.get();
}
public void setType(String type) {
this.type = new SimpleStringProperty(type);
}
public String getProject() {
return project.get();
}
public void setProject(String project) {
this.project = new SimpleStringProperty(project);
}
public String getCost() {
return cost.get();
}
public void setCost(String cost) {
this.cost = new SimpleStringProperty(cost);
;
}
}

@ -0,0 +1,39 @@
package com.connor.jd.plm.beans;
public class ResultData {
private boolean res;
private String Message;
private Object data;
public ResultData(boolean res, String message, Object data) {
super();
this.res = res;
Message = message;
this.data = data;
}
public boolean isRes() {
return res;
}
public void setRes(boolean res) {
this.res = res;
}
public String getMessage() {
return Message;
}
public void setMessage(String message) {
Message = message;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}

@ -0,0 +1,36 @@
package com.connor.jd.plm.beans;
import java.util.HashMap;
import java.util.Map;
import javax.swing.Icon;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCException;
public class TransformBomBean {
public String displayName;
public TCComponentBOMLine line;
public TCComponentItemRevision selectRev;
public Map<String, TCComponentItemRevision> map=new HashMap<>();
public TransformBomBean(TCComponentBOMLine line) {
// TODO Auto-generated constructor stub
try {
this.line = line;
this.displayName=line.getProperty("object_string");
} catch (TCException e) {
// TODO Auto-generated catch blocks
e.printStackTrace();
}
}
@Override
public String toString() {
// TODO Auto-generated method stub
return displayName;
}
}

@ -0,0 +1,39 @@
package com.connor.jd.plm.dialog;
public class DocumentTemplate {
private String type;// 模板类型
private String[] relation;// 数据集关系
private String uid;// 模板uid
public DocumentTemplate(String type, String uid, String[] relation) {
super();
this.type = type;
this.relation = relation;
this.uid = uid;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String[] getRelation() {
return relation;
}
public void setRelation(String[] relation) {
this.relation = relation;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
}

@ -0,0 +1,399 @@
package com.connor.jd.plm.dialog;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import com.connor.jd.plm.beans.ClassPropBean;
import com.connor.jd.plm.utils.ExcelInfoScanner;
import com.connor.jd.plm.utils.JDMethodUtil;
import com.connor.jd.plm.utils.StringCreateUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.AbstractAIFDialog;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCClassificationService;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCComponentForm;
import com.teamcenter.rac.kernel.TCComponentICO;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.kernel.ics.ICSAdminClass;
import com.teamcenter.rac.kernel.ics.ICSProperty;
import com.teamcenter.rac.kernel.ics.ICSPropertyDescription;
import com.teamcenter.rac.util.MessageBox;
import cn.hutool.json.JSONObject;
/**
*
*/
public class EditClassificationDialog extends AbstractAIFDialog {
private static final long serialVersionUID = 1L;
private AbstractAIFApplication app;
private TCSession session;
private TCComponent target;
private Map<String, JComponent> propMap;
private TCClassificationService myService;
final EditClassificationDialog DIALOG = this;
private TCComponentItemRevision rev;
private int[] ids;
private String[] values;
private String[] names;
private boolean finished;
public EditClassificationDialog(AbstractAIFApplication app) throws TCException {
this.app = app;
this.session = (TCSession) app.getSession();
this.myService = session.getClassificationService();
this.target = (TCComponent) AIFUtility.getCurrentApplication().getTargetComponent();
System.out.println(target.getType());
System.out.println(target instanceof TCComponentItemRevision ? "是" : "否");
if (target instanceof TCComponentItemRevision) {
try {
rev = (TCComponentItemRevision) target;
boolean isAccess = session.getTCAccessControlService().checkPrivilege(rev, "WRITE");
if (!isAccess) {
JOptionPane.showMessageDialog(this, "没有版本修改权限,请联系系统管理员", "提示", JOptionPane.WARNING_MESSAGE);
return;
}
initUI();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
MessageBox.post("请选择版本", "错误", MessageBox.ERROR);
}
}
private void initUI() {
this.setTitle("修改分类属性");
this.setAutoRequestFocus(true);
this.setResizable(false);
this.setAlwaysOnTop(true);
JPanel rootPanel = new JPanel();
rootPanel.setLayout(null);
rootPanel.setPreferredSize(new Dimension(300, 350));
Map<Integer, ClassPropBean> displayMap = new LinkedHashMap<Integer, ClassPropBean>();
propMap = new HashMap<String, JComponent>();
try {
if (rev.getClassificationClass() != null && !"".equals(rev.getClassificationClass())) {
try {
rev.refresh();
TCComponentICO ico = rev.getClassificationObjects()[0];
ICSProperty[] props = ico.getICSProperties(true);
ICSPropertyDescription[] desc = ico.getICSPropertyDescriptors();
for (int i = 0; i < props.length; i++) {
System.out.println(props[i].getId() + "===>" + props[i].getValue());
displayMap.put(props[i].getId(),
new ClassPropBean(props[i].getId(), desc[i].getName(), props[i].getValue()));
}
} catch (TCException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
} else {
MessageBox.post("当前版本未被分类", "错误", MessageBox.ERROR);
return;
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (displayMap.size() == 0) {
return;
}
String uid = JDMethodUtil.getPrefStr("jd_class_prop_option", session);
System.out.println("uid======>" + uid);
Map<Integer, String> propOption = null;
try {
TCComponent comp = session.stringToComponent(uid);
if (comp != null) {
TCComponentDataset op = (TCComponentDataset) comp;
String temp = System.getenv("temp");
String[] types = op.getProperty("ref_names").split(",");
File optionFile = op.getFiles(types[0], temp)[0];
optionFile.deleteOnExit();
System.out.println(rev.getItem().getProperty("object_type"));
propOption = ExcelInfoScanner.getClassPropOptions(optionFile.getPath(),
rev.getItem().getProperty("object_type"));
System.out.println("propOption count======>" + propOption.size());
}
} catch (TCException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
JPanel content = new JPanel();
content.setLayout(null);
content.setPreferredSize(new Dimension(300, displayMap.size() * (25 + 10)));
int num = 0;
for (Entry<Integer, ClassPropBean> entry : displayMap.entrySet()) {
JLabel label = new JLabel(entry.getValue().getName() + "");
label.setBounds(10, num * 35 + 10, 100, 25);
if (propOption != null && propOption.containsKey(entry.getKey())) {
String[] items = propOption.get(entry.getKey()).split(",");
JComboBox<String> combo = new JComboBox<String>();
combo.addItem(" ");
for (String s : items) {
combo.addItem(s);
}
String v = entry.getValue().getValue();
combo.setSelectedItem(v);
if (!Arrays.asList(items).contains(v)) {
combo.addItem(v);
combo.setSelectedItem(v);
}
combo.setBounds(130, num * 35 + 10, 150, 25);
propMap.put(entry.getValue().getName(), combo);
content.add(combo);
} else {
JTextField text = new JTextField(entry.getValue().getValue());
text.setBounds(130, num * 35 + 10, 150, 25);
propMap.put(entry.getValue().getName(), text);
content.add(text);
}
content.add(label);
num++;
}
JButton okBtn = new JButton("确认");
okBtn.setBounds(40, 310, 100, 25);
okBtn.setSelected(true);
okBtn.addActionListener(ok());
JButton cancelBtn = new JButton("取消");
cancelBtn.setBounds(160, 310, 100, 25);
cancelBtn.addActionListener(cancel());
JScrollPane jsp = new JScrollPane(content);
jsp.getVerticalScrollBar().setUnitIncrement(16);
jsp.setBounds(0, 0, 300, 300);
jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
rootPanel.add(jsp);
rootPanel.add(okBtn);
rootPanel.add(cancelBtn);
this.add(rootPanel);
this.pack();
this.centerToScreen();
this.showDialog();
}
private ActionListener ok() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
((JButton) e.getSource()).setEnabled(false);
rev = (TCComponentItemRevision) target;
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
int i = 1;
while (!DIALOG.finished) {
try {
DIALOG.setTitle("正在修改分类属性 " + StringCreateUtil.createPoint(i++ % 3));
Thread.sleep(200);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}).start();
saveClassification(rev);
// try {
// System.out.println(rev.getProperty("object_string"));
// if (rev.getType().equals("JD2_GTBJRevision")) {
// TCComponent[] comps = rev.getReferenceListProperty("TC_Is_Represented_By");
// System.out.println(comps.length);
// for (int i = 0; i < comps.length; i++) {
// if (comps[i].getType().equals("JD2_XYJTZRevision")) {
// System.out.println("object_string:" + comps[i].getProperty("object_string"));
// TCComponentItemRevision tzrev = (TCComponentItemRevision) comps[i];
// saveClassification(tzrev);
// }
// }
// }
// } catch (TCException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
}
};
}
private ActionListener cancel() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
DIALOG.disposeDialog();
}
};
}
private boolean saveClassification(TCComponentItemRevision rev) {
try {
TCComponentForm form = (TCComponentForm) rev.getRelatedComponents("IMAN_master_form_rev")[0];
TCComponent[] status = form.getRelatedComponents("release_status_list");
for (TCComponent comp : status) {
if (comp.getProperty("object_name").contains("正式")) {
JOptionPane.showMessageDialog(this, "版本表单已正式发布,不允许修改分类属性", "提示", JOptionPane.WARNING_MESSAGE);
return false;
}
}
TCComponentICO[] icoS = rev.getClassificationObjects();
System.out.println("======>获取的分类对象有:" + icoS.length);
String classID = rev.getClassificationClass();
if (icoS == null || icoS.length == 0) {
return false;
}
for (int i = 0; i < icoS.length; i++) {
TCComponentICO ico = icoS[i];
ICSPropertyDescription[] desc = ico.getICSPropertyDescriptors();
ICSProperty[] oldICSProps = ico.getICSProperties(true);
ids = new int[oldICSProps.length];
values = new String[oldICSProps.length];
names = new String[oldICSProps.length];
for (int j = 0; j < oldICSProps.length; j++) {
ids[j] = oldICSProps[j].getId();
if (propMap.get(desc[j].getName()) instanceof JComboBox) {
String str = ((JComboBox<String>) propMap.get(desc[j].getName())).getSelectedItem().toString();
values[j] = " ".equals(str) ? "" : str;
} else {
values[j] = ((JTextField) propMap.get(desc[j].getName())).getText();
}
names[j] = desc[j].getName();
}
JSONObject obj = new JSONObject();
obj.put("ids", ids);
obj.put("values", values);
String prop = obj.toString();
// prop = prop.replace("\"", "\\\"");
String server = JDMethodUtil.getPrefStr("jd2_server_ip", session);
if (server == null || "".equals(server)) {
MessageBox.post("未配置jd2_server_ip首选项", "错误", MessageBox.ERROR);
return false;
}
String url = "http://" + server + ":8880/api/sendClassification";
Map<String, Object> paramMap = new HashMap<String, Object>();
String uid = rev.getUid();
paramMap.put("uid", uid);
paramMap.put("cid", classID);
paramMap.put("prop", prop);
System.out.println(url);
System.out.println(prop);
final String URL = url;
final Map<String, Object> PARAMMAP = paramMap;
final TCComponentItemRevision REV = rev;
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
String res = cn.hutool.http.HttpUtil.post(URL, PARAMMAP);
System.out.println("uid===>" + "" + " res===>" + res);
finish();
}
}).start();
}
} catch (TCException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
JOptionPane.showMessageDialog(null, e1, "错误", JOptionPane.ERROR_MESSAGE);
}
return true;
}
private void finish() {
try {
rev.refresh();
String[] prefArr = JDMethodUtil.getPrefStrArray("jd2_custom_display_name", session);
String classAddress = getClassificationAddress(rev.getClassificationClass());
System.out.println("classAddress=====>" + classAddress);
for (String pref : prefArr) {
String[] className = pref.split(":")[0].split("/");
if (classAddress.contains(className[0]) && classAddress.contains(className[1])) {
String[] prefClassNamesArr = pref.split(":")[1].split(",");
System.out.println("pref class porp names=====>" + Arrays.toString(prefClassNamesArr));
StringBuilder builder = new StringBuilder();
for (int i = 0; i < prefClassNamesArr.length; i++) {
System.out.println(prefClassNamesArr[i]);
for (int ii = 0; ii < names.length; ii++) {
System.out.println(names[ii]);
if (prefClassNamesArr[i].equals(names[ii]) && !"".equals(values[ii].trim())) {
builder.append(values[ii] + ",");
}
}
}
String temp = builder.length() > 0
? builder.toString().substring(0, builder.toString().length() - 1)
: "";
System.out.println("class porp values=====>" + temp);
// session.getUserService().call("bs_bypass", new Object[] { true });
rev.lock();
rev.setProperty("jd2_flfh", temp);
rev.save();
rev.unlock();
rev.refresh();
// session.getUserService().call("bs_bypass", new Object[] { false });
break;
}
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null, "首选项jd2_custom_display_name配置有误请检查\r\n" + e.getMessage(), "提示",
JOptionPane.WARNING_MESSAGE);
return;
}
DIALOG.finished = true;
DIALOG.disposeDialog();
JOptionPane.showMessageDialog(null, "修改分类成功", "提示", JOptionPane.WARNING_MESSAGE);
System.out.println("success");
}
private String getClassificationAddress(String classId) throws TCException {
ICSAdminClass clazz = session.getClassificationService().newICSAdminClass();
clazz.load(classId);
if ("ICM".equals(clazz.askClassId())) {
return "根";
}
return clazz.getName() + "=>" + getClassificationAddress(clazz.getParent());
}
}

@ -0,0 +1 @@
package com.connor.jd.plm.dialog;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,107 @@
package com.connor.jd.plm.dialogs;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
import javax.swing.tree.TreeCellRenderer;
import com.connor.jd.plm.beans.TransformBomBean;
import com.teamcenter.rac.kernel.TCException;
public class CheckBoxTreeCellRenderer extends JPanel implements TreeCellRenderer {
protected JCheckBox check;
protected CheckBoxTreeLabel label;
public CheckBoxTreeCellRenderer() {
setLayout(null);
add(check = new JCheckBox());
add(label = new CheckBoxTreeLabel());
// 设置不可编辑
check.setEnabled(false);
check.setBackground(UIManager.getColor("Tree.textBackground"));
label.setForeground(UIManager.getColor("Tree.textForeground"));
}
/**
* <code>JPanel</code><code>JCheckBox</code>
* <code>JLabel</code><code>JCheckBox</code>
*/
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded,
boolean leaf, int row, boolean hasFocus) {
String stringValue = tree.convertValueToText(value, selected, expanded, leaf, row, hasFocus);
setEnabled(tree.isEnabled());
check.setSelected(((CheckBoxTreeNode) value).isSelected());
label.setFont(tree.getFont());
label.setText(stringValue);
label.setSelected(selected);
label.setFocus(hasFocus);
CheckBoxTreeNode node = (CheckBoxTreeNode) value;
TransformBomBean bean = (TransformBomBean) node.getUserObject();
try {
String type = bean.line.getItemRevision().getType();
if (type.equals("WX3_ZPTRevision")) {
URL resource = CheckBoxTreeCellRenderer.class.getResource("/com/connor/wxplm/utils/WX3_zptrev.png");
label.setIcon(new ImageIcon(resource));
} else if (type.equals("WX3_LJTRevision")) {
URL resource = CheckBoxTreeCellRenderer.class.getResource("/com/connor/wxplm/utils/WX3_ljtrev.png");
label.setIcon(new ImageIcon(resource));
} else if (type.equals("WX3_WLRevision")) {
URL resource = CheckBoxTreeCellRenderer.class.getResource("/com/connor/wxplm/utils/WX3_WLRev.png");
label.setIcon(new ImageIcon(resource));
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/*
* if(leaf) label.setIcon(UIManager.getIcon("Tree.leafIcon")); else if(expanded)
* label.setIcon(UIManager.getIcon("Tree.expandedIcon")); else
* label.setIcon(UIManager.getIcon("Tree.closedIcon"));
*/
return this;
}
@Override
public Dimension getPreferredSize() {
Dimension dCheck = check.getPreferredSize();
Dimension dLabel = label.getPreferredSize();
return new Dimension(dCheck.width + dLabel.width,
dCheck.height < dLabel.height ? dLabel.height : dCheck.height);
}
@Override
public void doLayout() {
Dimension dCheck = check.getPreferredSize();
Dimension dLabel = label.getPreferredSize();
int yCheck = 0;
int yLabel = 0;
if (dCheck.height < dLabel.height)
yCheck = (dLabel.height - dCheck.height) / 2;
else
yLabel = (dCheck.height - dLabel.height) / 2;
check.setLocation(0, yCheck);
check.setBounds(0, yCheck, dCheck.width, dCheck.height);
label.setLocation(dCheck.width, yLabel);
label.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height);
}
@Override
public void setBackground(Color color) {
if (color instanceof ColorUIResource)
color = null;
super.setBackground(color);
}
}

@ -0,0 +1,66 @@
package com.connor.jd.plm.dialogs;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
public class CheckBoxTreeLabel extends JLabel {
private boolean isSelected;
private boolean hasFocus;
public CheckBoxTreeLabel() {
}
@Override
public void setBackground(Color color) {
if (color instanceof ColorUIResource)
color = null;
super.setBackground(color);
}
@Override
public void paint(Graphics g) {
String str;
if ((str = getText()) != null) {
if (0 < str.length()) {
if (isSelected)
g.setColor(UIManager.getColor("Tree.selectionBackground"));
else
g.setColor(UIManager.getColor("Tree.textBackground"));
Dimension d = getPreferredSize();
int imageOffset = 0;
Icon currentIcon = getIcon();
if (currentIcon != null)
imageOffset = currentIcon.getIconWidth() + Math.max(0, getIconTextGap() - 1);
g.fillRect(imageOffset, 0, d.width - 1 - imageOffset, d.height);
if (hasFocus) {
g.setColor(UIManager.getColor("Tree.selectionBorderColor"));
g.drawRect(imageOffset, 0, d.width - 1 - imageOffset, d.height - 1);
}
}
}
super.paint(g);
}
@Override
public Dimension getPreferredSize() {
Dimension retDimension = super.getPreferredSize();
if (retDimension != null)
retDimension = new Dimension(retDimension.width + 3, retDimension.height);
return retDimension;
}
public void setSelected(boolean isSelected) {
this.isSelected = isSelected;
}
public void setFocus(boolean hasFocus) {
this.hasFocus = hasFocus;
}
}

@ -0,0 +1,92 @@
package com.connor.jd.plm.dialogs;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;
public class CheckBoxTreeNode extends DefaultMutableTreeNode {
protected boolean isSelected;
protected boolean isSelectable = true;
public CheckBoxTreeNode() {
this(null);
}
public CheckBoxTreeNode(Object userObject) {
this(userObject, true, false);
}
public CheckBoxTreeNode(Object userObject, boolean allowsChildren, boolean isSelected) {
super(userObject, allowsChildren);
this.isSelected = isSelected;
}
public boolean isSelected() {
return isSelected;
}
public void setSelected(boolean _isSelected) {
this.isSelected = _isSelected;
/*if (_isSelected) {
// 如果选中,则将其所有的子结点都选中
if (children != null) {
for (Object obj : children) {
CheckBoxTreeNode node = (CheckBoxTreeNode) obj;
if (_isSelected != node.isSelected())
node.setSelected(_isSelected);
}
}
// 向上检查,如果父结点的所有子结点都被选中,那么将父结点也选中
CheckBoxTreeNode pNode = (CheckBoxTreeNode) parent;
// 开始检查pNode的所有子节点是否都被选中
if (pNode != null) {
int index = 0;
for (; index < pNode.children.size(); ++index) {
CheckBoxTreeNode pChildNode = (CheckBoxTreeNode) pNode.children.get(index);
if (!pChildNode.isSelected())
break;
}
* pNode
*
if (index == pNode.children.size()) {
if (pNode.isSelected() != _isSelected)
pNode.setSelected(_isSelected);
}
}
} else {
*
*
if (children != null) {
int index = 0;
for (; index < children.size(); ++index) {
CheckBoxTreeNode childNode = (CheckBoxTreeNode) children.get(index);
if (!childNode.isSelected())
break;
}
// 从上向下取消的时候
if (index == children.size()) {
for (int i = 0; i < children.size(); ++i) {
CheckBoxTreeNode node = (CheckBoxTreeNode) children.get(i);
if (node.isSelected() != _isSelected)
node.setSelected(_isSelected);
}
}
}
// 向上取消,只要存在一个子节点不是选上的,那么父节点就不应该被选上。
CheckBoxTreeNode pNode = (CheckBoxTreeNode) parent;
if (pNode != null && pNode.isSelected() != _isSelected)
pNode.setSelected(_isSelected);
}*/
}
// 不可编辑
public boolean setSelectable(boolean bol) {
return isSelectable = bol;
}
}

@ -0,0 +1,30 @@
package com.connor.jd.plm.dialogs;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
public class CheckBoxTreeNodeSelectionListener extends MouseAdapter {
@Override
public void mouseClicked(MouseEvent event) {
JTree tree = (JTree) event.getSource();
int x = event.getX();
int y = event.getY();
int row = tree.getRowForLocation(x, y);
TreePath path = tree.getPathForRow(row);
if (path != null) {
CheckBoxTreeNode node = (CheckBoxTreeNode) path.getLastPathComponent();
if (node != null&&node.isSelectable) {
boolean isSelected = !node.isSelected();
node.setSelected(isSelected);
((DefaultTreeModel) tree.getModel()).nodeStructureChanged(node);
}
}
}
}

@ -0,0 +1,14 @@
package com.connor.jd.plm.dialogs;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
public class ColorMaterialBean {
public List<String[]> colorMaterial = new ArrayList<String[]>();
public Map<TCComponentItemRevision, Object[]> data = new HashMap<TCComponentItemRevision, Object[]>();
}

@ -0,0 +1,40 @@
package com.connor.jd.plm.dialogs;
import java.awt.Component;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import com.teamcenter.rac.kernel.TCSession;
public class MyTreeCellRenderer extends DefaultTreeCellRenderer {
private TCSession session;
public MyTreeCellRenderer(TCSession session) {
this.session = session;
}
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf,
int row, boolean hasFocus) {
super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
setText(value.toString());
if (sel) {
setForeground(getTextSelectionColor());
} else {
setForeground(getTextNonSelectionColor());
}
DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
String str = node.toString();
if (!"".equals(str)) {
// session.search(arg0, arg1, arg2)
}
return this;
}
}

@ -0,0 +1,887 @@
package com.connor.jd.plm.dialogs;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.ScrollPaneConstants;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import com.connor.jd.plm.beans.TransformBomBean;
import com.connor.jd.plm.utils.DialogUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.AbstractAIFDialog;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentBOMViewRevision;
import com.teamcenter.rac.kernel.TCComponentBOMWindow;
import com.teamcenter.rac.kernel.TCComponentBOMWindowType;
import com.teamcenter.rac.kernel.TCComponentICO;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.kernel.TCTypeService;
import com.teamcenter.rac.kernel.ics.ICSProperty;
import com.teamcenter.rac.util.ButtonLayout;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.util.PropertyLayout;
/**
* bombom
*
* @author conner.mcc
*
*/
public class TransformDesignToPartDialog extends AbstractAIFDialog implements ActionListener {
private AbstractAIFApplication app;
private TCSession session;
private TCComponentBOMLine topBomline;
private JButton okButton;
private JButton celButton;
private JTree tree;
private CheckBoxTreeNode topTree;
private List<JComboBox<String>> comboxList;
private JPanel rightJPanel;
private Map<CheckBoxTreeNode, JComboBox<String>> checkBoxTreeNodelMap;
private Map<JComboBox<String>, JButton> boxJButtonMap;
private JPanel leftJPanel;
private int index = 1;
private String[] types;
TCComponentBOMWindow win;
public TransformDesignToPartDialog(AbstractAIFApplication app, TCComponentBOMLine topBomline, String[] types) {
// TODO Auto-generated constructor stub
System.out.println("step:-3------------------");
comboxList = new ArrayList<>();
this.app = app;
this.session = (TCSession) app.getSession();
this.topBomline = topBomline;
this.types = types;
createWindow();
initUI();
}
private void createWindow() {
try {
TCTypeService service = session.getTypeService();
TCComponentBOMWindowType winType = (TCComponentBOMWindowType) service.getTypeComponent("BOMWindow");
win = winType.create(null);
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
private void initUI() {
this.setTitle("DBOM转EBOM");
this.setSize(new Dimension(700, 400));
JPanel rightroot = new JPanel(new BorderLayout());
rightJPanel = new JPanel(new PropertyLayout());
rightroot.setBorder(BorderFactory.createTitledBorder("物料"));
leftJPanel = new JPanel(new BorderLayout());
leftJPanel.setBorder(BorderFactory.createTitledBorder("图纸"));
leftJPanel.setPreferredSize(new Dimension(350, 300));
rightroot.setPreferredSize(new Dimension(350, 300));
getBOMTreeAndwl();
JScrollPane leftpane = new JScrollPane(tree);
leftpane.setBorder(null);
leftJPanel.add(leftpane);
JScrollPane rightpane = new JScrollPane(rightJPanel);
rightroot.add(rightpane);
rightpane.setBorder(null);
final JScrollBar bar2 = rightpane.getVerticalScrollBar();
final JScrollBar bar1 = leftpane.getVerticalScrollBar();
rightpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
leftpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
bar2.addAdjustmentListener(new AdjustmentListener() {
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
// TODO Auto-generated method stub
if (e.getValueIsAdjusting()) {
bar1.setValue(e.getValue());
}
}
});
bar1.addAdjustmentListener(new AdjustmentListener() {
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
// TODO Auto-generated method stub
if (e.getValueIsAdjusting()) {
bar2.setValue(e.getValue());
}
}
});
leftpane.getVerticalScrollBar().setUnitIncrement(10);
leftpane.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
if (e.getScrollType() == e.WHEEL_UNIT_SCROLL && bar1.getValue() >= 0
&& bar1.getValue() <= bar1.getVisibleAmount()) {
int scroll = e.getUnitsToScroll();
bar2.setValue(scroll * bar1.getUnitIncrement());
}
}
});
rightpane.getVerticalScrollBar().setUnitIncrement(10);
rightpane.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
if (e.getScrollType() == e.WHEEL_UNIT_SCROLL && bar1.getValue() >= 0
&& bar1.getValue() <= bar1.getVisibleAmount()) {
int scroll = e.getUnitsToScroll();
bar1.setValue(scroll * bar2.getUnitIncrement());
}
}
});
JPanel botomJPanel = new JPanel(new ButtonLayout());
okButton = new JButton("转换");
okButton.addActionListener(this);
celButton = new JButton("退出");
celButton.addActionListener(this);
botomJPanel.add("1.1.left.top", okButton);
botomJPanel.add("1.2.left.top", new JLabel(" "));
botomJPanel.add("1.3.left.top", celButton);
JPanel rootJPanel = new JPanel(new PropertyLayout());
rootJPanel.add("1.1.left.top", leftJPanel);
rootJPanel.add("1.2.left.top", rightroot);
this.setLayout(new BorderLayout());
this.add(rootJPanel, BorderLayout.CENTER);
this.add(botomJPanel, BorderLayout.SOUTH);
this.pack();
this.centerToScreen();
this.showDialog();
this.setResizable(false);
}
/**
* @param line BOM
* @param node
* @throws TCException
*/
public void treeModel(TCComponentBOMLine line, CheckBoxTreeNode node) throws TCException {
System.out.println(line.getProperty("object_string") + "-------------------");
AIFComponentContext[] children = line.getChildren();
for (AIFComponentContext conetext : children) {
TCComponentBOMLine childLine = (TCComponentBOMLine) conetext.getComponent();
final CheckBoxTreeNode childNode = new CheckBoxTreeNode(new TransformBomBean(childLine));
childNode.setSelectable(false);
node.add(childNode);
setCombox(childLine, childNode);
treeModel(childLine, childNode);
}
}
private void getBOMTreeAndwl() {
try {
checkBoxTreeNodelMap = new HashMap<>();
boxJButtonMap = new HashMap<>();
topTree = new CheckBoxTreeNode(new TransformBomBean(topBomline));
setCombox(topBomline, topTree);
System.out.println("##########" + topTree.toString() + "##########");
treeModel(topBomline, topTree);
tree = new JTree();
tree.setEnabled(false);
tree.setRowHeight(30);
DefaultTreeModel model = new DefaultTreeModel(topTree);
tree.addMouseListener(new CheckBoxTreeNodeSelectionListener());
tree.setModel(model);
tree.setCellRenderer(new CheckBoxTreeCellRenderer());
tree.putClientProperty("JTree.lineStyle", "Angled");
topTree.setSelectable(false);
tree.expandPath(new TreePath(topTree.getPath()));
Enumeration<?> enumeration = topTree.preorderEnumeration();
while (enumeration.hasMoreElements()) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) enumeration.nextElement();
if (!node.isLeaf()) {
TreePath path = new TreePath(node.getPath());
tree.expandPath(path);
}
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if (e.getSource().equals(okButton)) {
try {
System.out.println("进行转换");
if (win == null)
createWindow();
ColorMaterialBean bean = new ColorMaterialBean();
createMaterialBom(topTree, bean);
if (bean.colorMaterial.size() != 0) {
System.out.println(
Arrays.deepToString(bean.colorMaterial.toArray(new String[bean.colorMaterial.size()][])));
JScrollPane msgPanel = DialogUtil.createTableMsg(new String[] { "ID", "版本", "名称", "颜色" },
bean.colorMaterial).panel;
int r = JOptionPane.showConfirmDialog((Component) e.getSource(), msgPanel, "颜色件确认",
JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
if (r == JOptionPane.OK_OPTION) {
createBom1(bean);
} else {
System.out.println("cancel");
return;
}
} else {
createBom1(bean);
}
MessageBox.post("转换bom成功", "提示", MessageBox.INFORMATION);
this.dispose();
} catch (TCException e1) {
// TODO Auto-generated catch block
MessageBox.post(e1.getMessage(), "转换bom失败", MessageBox.INFORMATION);
e1.printStackTrace();
} finally {
try {
win.close();
win = null;
} catch (TCException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
} else if (e.getSource().equals(celButton)) {
dispose();
}
}
@SuppressWarnings("unchecked")
private void createBom1(ColorMaterialBean bean) throws TCException {
for (Entry<TCComponentItemRevision, Object[]> entry : bean.data.entrySet()) {
List<TCComponentItemRevision> arg1 = entry.getValue()[1] == null ? null
: (List<TCComponentItemRevision>) entry.getValue()[1];
List<String> arg2 = entry.getValue()[2] == null ? null : (List<String>) entry.getValue()[2];
List<String> arg3 = entry.getValue()[3] == null ? null : (List<String>) entry.getValue()[3];
createBom(entry.getKey(), arg1, arg2, arg3);
}
}
/**
* Treeitem
*
* @param wl
*//*
* private void checkSelected(String wl) { for (TransformBomBean bean : bomlist)
* { if (bean.map.containsKey(wl)) { bean.selectCount++; if (bean.selectCount >
* 1) { MessageBox.post("只能为当前图纸选择一个物料进行设计BOM的转换", "警告", MessageBox.WARNING);
* return; } System.out.println(bean.displayName + "选中显示名");
* System.out.println(checkBoxTreeNodelMap.containsKey(bean.displayName) );
* checkBoxTreeNodelMap.get(bean.displayName).setSelected(true);
* findInTree(bean.displayName); TransformBomBean bean1 = (TransformBomBean)
* checkBoxTreeNodelMap.get(bean.displayName).getUserObject(); bean1.selectRev =
* (TCComponentItemRevision) bean.map.get(wl); } } }
*/
/**
* Treeitem
*
* @param wl
*//*
* private void checkDisSelected(String wl) { for (TransformBomBean bean :
* bomlist) { if (bean.map.containsKey(wl)) { bean.selectCount--;
* checkBoxTreeNodelMap.get(bean.displayName).setSelected(false); } } }
*/
/**
* BOM
*
* @param node
* @throws TCException
*/
private void createMaterialBom(CheckBoxTreeNode node, ColorMaterialBean colorMaterialBean) throws TCException {
// System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
TransformBomBean bean = (TransformBomBean) node.getUserObject();
TCComponentItemRevision materialRev = bean.selectRev;
// 存在已经发布的物料的bom
/*
* if (WXMethodUtil.isRevBomReleased(materialRev)) { System.out.println("发布");
* return; }
*/
if (isLoopBom(node)) {
MessageBox.post("存在循环BOM结构", "警告", MessageBox.WARNING);
return;
}
int childCount = node.getChildCount();
List<TCComponentItemRevision> childrenList = new ArrayList<>();
List<String> quantityList = new ArrayList<>();
for (int i = 0; i < childCount; i++) {
CheckBoxTreeNode childNode = (CheckBoxTreeNode) node.getChildAt(i);
if (childNode.isSelected()) {
TransformBomBean bean1 = (TransformBomBean) childNode.getUserObject();
childrenList.add(bean1.selectRev);
quantityList.add(bean1.line.getProperty("bl_quantity"));
// 判断是否发布
if (isRevBomReleased(bean1.selectRev)) {
// 发布就搭建原来的bom
System.out.println("原来搭建》》》》》》》》》》》》》》》");
if (isLoopBom(childNode)) {
MessageBox.post("存在循环BOM结构", "警告", MessageBox.WARNING);
return;
}
} else {
createMaterialBom(childNode, colorMaterialBean);
}
}
}
for (TCComponentItemRevision material : childrenList) {
if (material.getClassificationObjects().length > 0) {
String ys = null;
TCComponentICO ico = material.getClassificationObjects()[0];
ICSProperty[] props = ico.getICSProperties(true);
for (ICSProperty prop : props) {
if (prop.getId() == 1007) {
ys = prop.getValue();
break;
}
}
if (ys != null && !"".equals(ys)) {
System.out.println("颜色件:" + material.getProperty("object_string"));
colorMaterialBean.colorMaterial.add(new String[] { material.getProperty("item_id"),
material.getProperty("item_revision_id"), material.getProperty("object_name"), ys });
}
}
}
colorMaterialBean.data.put(materialRev, new Object[] { materialRev, childrenList, null, quantityList });
}
private TreePath findInPath(TreePath treePath, String str) {
Object object = treePath.getLastPathComponent();
if (object == null) {
return null;
}
String value = object.toString();
if (str.equals(value)) {
return treePath;
} else {
TreeModel model = tree.getModel();
int n = model.getChildCount(object);
for (int i = 0; i < n; i++) {
Object child = model.getChild(object, i);
TreePath path = treePath.pathByAddingChild(child);
path = findInPath(path, str);
if (path != null) {
return path;
}
}
return null;
}
}
private void findInTree(String str) {
Object root = tree.getModel().getRoot();
TreePath treePath = new TreePath(root);
treePath = findInPath(treePath, str);
if (treePath != null) {
tree.setSelectionPath(treePath);
CheckBoxTreeNode node = (CheckBoxTreeNode) tree.getLastSelectedPathComponent();
tree.scrollPathToVisible(treePath);
}
}
/**
* @param line
* @param childNode
* @return
*/
public String[] getBomRef(TCComponentBOMLine line, CheckBoxTreeNode childNode) {
try {
if (line == null) {
return null;
}
AIFComponentContext[] aifContext = line.getItemRevision().whereReferencedByTypeRelation(types,
new String[] { "TC_Is_Represented_By" });
if (aifContext == null || aifContext.length == 0) {
return new String[] { "" };
} else {
AIFComponentContext[] newContext = isNewRev(aifContext);
String[] wl = new String[newContext.length];
TransformBomBean bean = (TransformBomBean) childNode.getUserObject();
for (int i = 0; i < wl.length; i++) {
TCComponentItemRevision comp = (TCComponentItemRevision) newContext[i].getComponent();
wl[i] = comp.getProperty("object_string");
bean.map.put(wl[i], comp);
}
return wl;
}
} catch (TCException e) {
e.printStackTrace();
}
return new String[] { "" };
}
/**
*
*
* @param childLine
* @param childNode
*/
private void setCombox(TCComponentBOMLine childLine, final CheckBoxTreeNode childNode) {
try {
System.out.println(childLine.getItemRevision().getType() + "<<<<<<<<<<");
final String[] bomRef = getBomRef(childLine, childNode);
final DefaultComboBoxModel model = new DefaultComboBoxModel();
model.addElement("");
for (String str : bomRef) {
model.addElement(str);
}
final JComboBox<String> childbox = new JComboBox();
// 模糊搜索按钮
final JButton search = new JButton("搜索");
checkBoxTreeNodelMap.put(childNode, childbox);
boxJButtonMap.put(childbox, search);
childbox.setModel(model);
childbox.setSelectedIndex(-1);
childbox.setEditable(true);
if (childbox.getItemCount() <= 2 && childbox.getItemAt(1) != null && !childbox.getItemAt(1).equals("")) {
childbox.setSelectedIndex(1);
childbox.setEditable(false);
childNode.setSelected(true);
search.setEnabled(false);
childbox.enable(false);
TransformBomBean bean = (TransformBomBean) childNode.getUserObject();
bean.selectRev = bean.map.get(childbox.getSelectedItem().toString());
} else if (childbox.getItemCount() <= 2) {
childbox.setEditable(false);
search.setEnabled(false);
childbox.enable(false);
}
if (childLine.getItemRevision().getType().equals("PartRevision")) {
childbox.setEditable(false);
search.setEnabled(false);
childNode.setSelected(true);
childbox.enable(false);
TransformBomBean bean = (TransformBomBean) childNode.getUserObject();
bean.selectRev = childLine.getItemRevision();
}
childbox.setPreferredSize(new Dimension(240, 23));
search.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
if (childbox.isEditable() && search.isEnabled()) {
String str = childbox.getEditor().getItem().toString();
model.removeAllElements();
model.addElement("");
for (int i = 0; i < bomRef.length; i++) {
if (bomRef[i].contains(str)) {
model.addElement(bomRef[i]);
}
}
childbox.setModel(model);
childbox.setPopupVisible(true);
}
}
});
childbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
// TODO Auto-generated method stub
try {
if (e.getStateChange() == 1) {
if (childbox.getSelectedIndex() > 0) {
TransformBomBean bean = (TransformBomBean) childNode.getUserObject();
bean.selectRev = bean.map.get(childbox.getSelectedItem().toString());
childNode.setSelected(true);
System.out.println("-----------" + bean.displayName);
// 判断是否布 发布子类全部不可选择
boolean released = isReleased(bean.selectRev, childNode);
System.out.println("<<<<<<<<<<是否发布:" + released);
tree.repaint();
} else {
System.out.println("<<<<<<<<<<选择空:");
restoreSelect(childNode);
childNode.setSelected(false);
tree.repaint();
}
}
} catch (TCException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
comboxList.add(childbox);
rightJPanel.add((index) + ".1.left.top", childbox);
rightJPanel.add((index++) + ".2.left.top", search);
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*
* @param rev
* @param childNode
* @return
*/
private boolean isReleased(TCComponentItemRevision rev, CheckBoxTreeNode childNode) {
try {
System.out.println("执行判断" + rev.getProperty("object_name"));
if (rev != null && isRevBomReleased(rev)) {
setUnable(childNode);
return true;
} else {
restoreSelect(childNode);
return false;
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
private void setUnable(CheckBoxTreeNode childNode) {
int childCount = childNode.getChildCount();
for (int i = 0; i < childCount; i++) {
CheckBoxTreeNode node = (CheckBoxTreeNode) childNode.getChildAt(i);
JComboBox<String> box = checkBoxTreeNodelMap.get(node);
box.setSelectedIndex(-1);
box.setEditable(false);
box.setEnabled(false);
node.setSelected(false);
boxJButtonMap.get(box).setEnabled(false);
setUnable(node);
}
}
/**
*
*
* @param childNode
* @throws TCException
*/
private void restoreSelect(CheckBoxTreeNode childNode) throws TCException {
int childCount = childNode.getChildCount();
for (int i = 0; i < childCount; i++) {
CheckBoxTreeNode node = (CheckBoxTreeNode) childNode.getChildAt(i);
JComboBox<String> childbox = checkBoxTreeNodelMap.get(node);
TransformBomBean bean = (TransformBomBean) node.getUserObject();
childbox.setEditable(true);
childbox.setEnabled(true);
childbox.setSelectedIndex(-1);
if (childbox.getItemCount() <= 2 && !childbox.getItemAt(1).equals("")) {
childbox.setSelectedIndex(1);
childbox.setEditable(false);
childbox.setEnabled(false);
node.setSelected(true);
boxJButtonMap.get(childbox).setEnabled(false);
bean.selectRev = bean.map.get(childbox.getSelectedItem().toString());
} else if (childbox.getItemCount() <= 2) {
childbox.setEditable(false);
childbox.setEnabled(false);
boxJButtonMap.get(childbox).setEnabled(false);
}
if (bean.line.getItemRevision().isTypeOf("PartRevision")) {
childbox.setEditable(false);
boxJButtonMap.get(childbox).setEnabled(false);
node.setSelected(true);
childbox.setEnabled(false);
bean.selectRev = bean.line.getItemRevision();
}
restoreSelect(node);
}
}
/**
*
*
* @param aifContext
* @return
*/
private AIFComponentContext[] isNewRev(AIFComponentContext[] aifContext) {
try {
List<AIFComponentContext> list = new ArrayList<>();
for (int i = 0; i < aifContext.length; i++) {
TCComponentItemRevision rev = (TCComponentItemRevision) aifContext[i].getComponent();
if (rev.getItem().getLatestItemRevision().equals(rev)) {
list.add(aifContext[i]);
}
}
AIFComponentContext[] newContext = new AIFComponentContext[list.size()];
for (int i = 0; i < list.size(); i++) {
newContext[i] = list.get(i);
}
return newContext;
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
/**
*
*
* @param node
* @return
*/
private boolean isLoopBom(CheckBoxTreeNode node) {
try {
HashSet<TCComponentItemRevision> loopSet = new HashSet<>();
boolean checkLoop = checkLoop(node, loopSet);
return checkLoop;
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
/**
* ,
*
* @param node
* @param loopSet
* @return
* @throws TCException
*/
private boolean checkLoop(CheckBoxTreeNode node, HashSet<TCComponentItemRevision> loopSet) throws TCException {
TransformBomBean bean = (TransformBomBean) node.getUserObject();
TCComponentItemRevision materialRev = bean.selectRev;
boolean add = loopSet.add(materialRev);
if (!add) {
return true;
} else {
CheckBoxTreeNode parent = (CheckBoxTreeNode) node.getParent();
if (parent == null) {
return false;
} else {
return checkLoop(parent, loopSet);
}
}
}
public void getAllBomItemByBomline(TCComponentBOMLine line, List<TCComponentItem> itemList) throws TCException {
if (line == null) {
return;
}
itemList.add(line.getItem());
AIFComponentContext[] contextS = line.getChildren();
for (AIFComponentContext context : contextS) {
TCComponentBOMLine child = (TCComponentBOMLine) context.getComponent();
getAllBomItemByBomline(child, itemList);
}
}
/**
* bom
*
* @param selectIndex
* @throws TCException
*/
public void createBom(TCComponentItemRevision parentRev, List<TCComponentItemRevision> childRevList,
List<String> queryNoList, List<String> countNoList) throws TCException {
if (childRevList == null || childRevList.size() == 0) {
return;
}
if (parentRev == null) {
return;
}
String[] setProps = { "bl_quantity" };
TCComponentBOMLine line = win.setWindowTopLine(parentRev.getItem(), parentRev, null, null);
AIFComponentContext[] childrenContext = line.getChildren();
win.lock();
// 移出所有的子bomline
if (childrenContext.length != 0) {
for (AIFComponentContext child : childrenContext) {
line.lock();
line.remove("", (TCComponent) child.getComponent());
line.save();
line.unlock();
}
// return;
}
for (int i = 0; i < childRevList.size(); i++) {
TCComponentItemRevision rev = childRevList.get(i);
line.lock();
TCComponentBOMLine childBomLine = line.add(rev.getItem(), rev, null, false, "");
line.save();
line.unlock();
if (countNoList.get(i) != null && !countNoList.get(i).equals("")) {
childBomLine.lock();
childBomLine.setProperties(setProps, new String[] { countNoList.get(i) });
childBomLine.save();
childBomLine.unlock();
}
}
try {
win.save();
win.unlock();
} catch (Exception e) {
win.unlock();
win.close();
win = null;
System.out.println("windows close");
TCComponent[] comps = parentRev.getTCProperty("structure_revisions").getReferenceValueArray();
if (comps.length > 0) {
parentRev.remove("structure_revisions", comps[0]);
comps[0].delete();
;
}
e.printStackTrace();
throw e;
}
}
/**
*
*
* @param comp
* @return
* @throws TCException
*/
public boolean isCompReleased(TCComponent comp) throws TCException {
TCComponent[] comps = comp.getRelatedComponents("release_status_list");
if (comps != null && comps.length > 0) {
return true;
}
return false;
}
/**
* BOM
*
* @param rev
* @return
*/
public boolean isRevHadBom(TCComponentItemRevision rev) {
boolean isHad = false;
if (rev != null) {
try {
TCComponentBOMLine topLine = win.setWindowTopLine(rev.getItem(), rev, null, null);
if (topLine != null) {
if (topLine.getChildren().length > 0) {
isHad = true;
}
}
} catch (TCException e) {
e.printStackTrace();
}
}
return isHad;
}
/**
* BOM
*
* @param rev
* @return
*/
public boolean isRevBomReleased(TCComponentItemRevision rev) {
boolean isReleased = false;
try {
if (isCompReleased(rev)) {
win.setWindowTopLine(rev.getItem(), rev, null, null);
// TCComponentBOMLine line = window.getTopBOMLine();
// if(line.getChildren().length!=0){
// isReleased = true;
// }
if (isRevHadBom(rev)) {
TCComponentBOMViewRevision bvr = win.askBvr();
if (bvr != null) {
TCComponent[] status = bvr.getReferenceListProperty("release_status_list");
if (status != null && status.length != 0) {
isReleased = true;
}
}
}
}
} catch (TCException e) {
e.printStackTrace();
isReleased = true;
}
return isReleased;
}
private boolean isYSMaterial(TCComponentItemRevision rev) {
try {
Map<String, String> map = rev.getClassificationAttributes();
if (map.get("颜色") != null && !"".equals(map.get("颜色"))) {
return true;
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
}

@ -0,0 +1,6 @@
package com.connor.jd.plm.form;
public interface MyCallBack {
public void execute(String itemId);
}

@ -0,0 +1,79 @@
package com.connor.jd.plm.form;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
public class PhotoFrame extends JFrame {
private static final long serialVersionUID = -2216276219179107707L;
private Container con;
private ZPanel zPanel;
private JScrollPane imgSp;
private static PhotoFrame instance;
public static PhotoFrame getInstance(String imgPath) {
if (instance == null) {
instance = new PhotoFrame(imgPath);
} else {
instance.zPanel.setImagePath(imgPath);
instance.setVisible(true);
instance.zPanel.setPreferredSize(
new Dimension(instance.zPanel.getImgWidth(),
instance.zPanel.getImgHeight()));
}
return instance;
}
private PhotoFrame(String imgPath) {
init(imgPath);
finalSetting();
}
private void init(String imgPath) {
con = getContentPane();
zPanel = new ZPanel();
zPanel.setImagePath(imgPath);
zPanel.setPreferredSize(
new Dimension(zPanel.getImgWidth(), zPanel.getImgHeight()));
imgSp = new JScrollPane();
imgSp.setViewportView(zPanel);
imgSp.setHorizontalScrollBarPolicy(
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
imgSp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
con.add(imgSp, BorderLayout.CENTER);
}
private void finalSetting() {
setTitle("Ô¤ÀÀ");
Toolkit kit = Toolkit.getDefaultToolkit();
Dimension screenSize = kit.getScreenSize();
int screenHeight = screenSize.height;
int screenWidth = screenSize.width;
int frameH = getHeight();
int frameW = getWidth();
setLocation((screenWidth - frameW) / 2 - 250,
(screenHeight - frameH) / 2 - 250);
setSize(screenWidth / 2, screenHeight / 2);
setVisible(true);
setResizable(true);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
@Override
public void dispose() {
// TODO Auto-generated method stub
super.dispose();
System.out.println("Ô¤ÀÀ¹Ø±Õ");
zPanel.clear();
}
}

@ -0,0 +1,79 @@
package com.connor.jd.plm.form;
import java.awt.Graphics;
import java.awt.Image;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.imageio.ImageIO;
public class ZPanel extends javax.swing.JPanel {
private static final long serialVersionUID = 1L;
private Image image;
private int imgWidth;
private int imgHeight;
private FileInputStream input;
public int getImgWidth() {
return imgWidth;
}
public void setImgWidth(int imgWidth) {
this.imgWidth = imgWidth;
}
public int getImgHeight() {
return imgHeight;
}
public void setImgHeight(int imgHeight) {
this.imgHeight = imgHeight;
}
public ZPanel() {
}
public void setImagePath(String imgPath) {
// 该方法不推荐使用,该方法是懒加载,图像并不加载到内存,当拿图像的宽和高时会返回-1
// image = Toolkit.getDefaultToolkit().getImage(imgPath);
try {
// 该方法会将图像加载到内存,从而拿到图像的详细信息。
input = new FileInputStream(imgPath);
image = ImageIO.read(input);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
setImgWidth(image.getWidth(this));
setImgHeight(image.getHeight(this));
}
@Override
public void paintComponent(Graphics g1) {
int x = 0;
int y = 0;
Graphics g = g1;
if (null == image) {
return;
}
g.drawImage(image, x, y, image.getWidth(this), image.getHeight(this),
this);
g = null;
}
public void clear() {
if (input != null) {
try {
image = null;
input.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

@ -0,0 +1,22 @@
package com.connor.jd.plm.handlers;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.connor.jd.plm.action.BOMManagementAction;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
public class BOMManagementHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
// TODO Auto-generated method stub
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
BOMManagementAction action = new BOMManagementAction(AIFUtility.getActiveDesktop(), "",app);
new Thread(action).start();
return null;
}
}

@ -0,0 +1,54 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.DefaultCellEditor;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import com.teamcenter.rac.util.DateButton;
public class ButtonEditor extends DefaultCellEditor {
protected DateButton button;
private String label;
private boolean isPushed;
public ButtonEditor(JCheckBox checkBox) {
super(checkBox);
button = new DateButton();
}
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
if (isSelected) {
button.setForeground(table.getSelectionForeground());
button.setBackground(table.getSelectionBackground());
} else {
button.setForeground(table.getForeground());
button.setBackground(table.getBackground());
}
return button;
}
public Object getCellEditorValue() {
//yyyyÄêMMÔÂddÈÕ
SimpleDateFormat format=new SimpleDateFormat("yyyyÄêMMÔÂddÈÕ");
SimpleDateFormat format2=new SimpleDateFormat("MMÔÂ");
SimpleDateFormat format3=new SimpleDateFormat("ddÈÕ");
Date data = new Date();
System.out.println("aaa===>"+format2.format(data));
System.out.println("bbb===>"+format3.format(data));
System.out.println("ccc===>"+format.format(data));
return format.format(button.getDate());
}
}

@ -0,0 +1,48 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JTable;
import com.teamcenter.rac.util.DateButton;
public class ButtonEditor2 extends DefaultCellEditor {
protected DateButton button;
private String label;
private boolean isPushed;
public ButtonEditor2(JCheckBox checkBox) {
super(checkBox);
button = new DateButton();
}
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
if (isSelected) {
button.setForeground(table.getSelectionForeground());
button.setBackground(table.getSelectionBackground());
} else {
button.setForeground(table.getForeground());
button.setBackground(table.getBackground());
}
return button;
}
public Object getCellEditorValue() {
//yyyyÄêMMÔÂddÈÕ HH:mm
SimpleDateFormat format=new SimpleDateFormat("HH:mm");
Date data = new Date();
System.out.println("ccc===>"+format.format(data));
return format.format(button.getDate());
}
}

@ -0,0 +1,207 @@
package com.connor.jd.plm.table;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Point;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
import javax.swing.event.TableModelEvent;
import javax.swing.table.DefaultTableModel;
public class CTMap extends DefaultTableModel implements CellSpan {
protected int rowSize;
protected int columnSize;
protected int[][][] span; // CellSpan
@Override
public int[] getSpan(int row, int column) {
// TODO Auto-generated method stub
if (isOutOfBounds(row, column)) {
int[] ret_code = { 1, 1 };
return ret_code;
}
return span[row][column];
}
@Override
public void setSpan(int[] span, int row, int column) {
// TODO Auto-generated method stub
if (isOutOfBounds(row, column))
return;
this.span[row][column] = span;
}
@Override
public boolean isVisible(int row, int column) {
// TODO Auto-generated method stub
if (isOutOfBounds(row, column))
return false;
if ((span[row][column][CellSpan.COLUMN] < 1) || (span[row][column][CellSpan.ROW] < 1))
return false;
return true;
}
@Override
public void combine(int[] rows, int[] columns) {
// TODO Auto-generated method stub
int rowSpan = rows.length;
int columnSpan = columns.length;
int startRow = rows[0];
int startColumn = columns[0];
for (int i = 0; i < rowSpan; i++) {
for (int j = 0; j < columnSpan; j++) {
if ((span[startRow + i][startColumn + j][CellSpan.COLUMN] != 1)
|| (span[startRow + i][startColumn + j][CellSpan.ROW] != 1)) {
// System.out.println("can't combine");
return;
}
}
}
for (int i = 0, ii = 0; i < rowSpan; i++, ii--) {
for (int j = 0, jj = 0; j < columnSpan; j++, jj--) {
span[startRow + i][startColumn + j][CellSpan.COLUMN] = jj;
span[startRow + i][startColumn + j][CellSpan.ROW] = ii;
// System.out.println("r " +ii +" c " +jj);
}
}
span[startRow][startColumn][CellSpan.COLUMN] = columnSpan;
span[startRow][startColumn][CellSpan.ROW] = rowSpan;
}
public void setSize(Dimension size) {
columnSize = size.width;
rowSize = size.height;
span = new int[rowSize][columnSize][2]; // 2: COLUMN,ROW
initValue();
}
protected boolean isOutOfBounds(int row, int column) {
if ((row < 0) || (rowSize <= row) || (column < 0) || (columnSize <= column)) {
return true;
}
return false;
}
public void addRow() {
Vector newData = new Vector(getColumnCount());
dataVector.add(newData);
//
newRowsAdded(new TableModelEvent(this, getRowCount() - 1, getRowCount() - 1, TableModelEvent.ALL_COLUMNS,
TableModelEvent.INSERT));
int[][][] oldSpan = span;
int numRows = oldSpan.length;
int numColumns = oldSpan[0].length;
span = new int[numRows + 1][numColumns][2];
System.arraycopy(oldSpan, 0, span, 0, numRows);
for (int i = 0; i < numColumns; i++) {
span[numRows][i][CellSpan.COLUMN] = 1;
span[numRows][i][CellSpan.ROW] = 1;
}
rowSize = span.length;
}
public void addColumn(Object columnName) {
int[][][] oldSpan = span;
int numRows = oldSpan.length;
int numColumns = oldSpan[0].length;
span = new int[numRows][numColumns + 1][2];
for (int i = 0; i < span.length; i++) {
for (int j = 0; j < span[0].length; j++) {
span[i][j][CellSpan.COLUMN] = 1;
span[i][j][CellSpan.ROW] = 1;
}
}
columnSize = span[0].length;
addColumn(columnName, (Vector) null);
}
public void insertRow(int row) {
Vector rowData = new Vector(getColumnCount());
dataVector.insertElementAt(rowData, row);
System.out.println("size:" + dataVector.size());
//
newRowsAdded(new TableModelEvent(this, row, row, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT));
int[][][] newSpan = new int[span.length + 1][span[0].length][2];
int numRows = span.length;
int numColumns = span[0].length;
for (int i = 0; i < newSpan.length; i++) {
if (i < row) {
for (int j = 0; j < numColumns; j++) {
newSpan[i][j][0] = span[i][j][0];
newSpan[i][j][1] = span[i][j][1];
}
} else if (i == row) {
for (int j = 0; j < numColumns; j++) {
newSpan[i][j][0] = 1;
newSpan[i][j][1] = 1;
}
} else {
for (int j = 0; j < numColumns; j++) {
newSpan[i][j][0] = span[i - 1][j][0];
newSpan[i][j][1] = span[i - 1][j][1];
}
}
}
span = newSpan;
rowSize = span.length;
}
public CTMap(int numRows, int numColumns) {
Vector names = new Vector(numColumns);
names.setSize(numColumns);
setColumnIdentifiers(names);
dataVector = new Vector();
setNumRows(numRows);
setSize(new Dimension(numColumns, numRows));
}
protected void initValue() {
System.out.println(span.length);
for (int i = 0; i < span.length; i++) {
for (int j = 0; j < span[i].length; j++) {
span[i][j][CellSpan.COLUMN] = 1;
span[i][j][CellSpan.ROW] = 1;
}
}
}
public void split(int row, int column) {
if (isOutOfBounds(row, column))
return;
int columnSpan = span[row][column][CellSpan.COLUMN];
int rowSpan = span[row][column][CellSpan.ROW];
for (int i = 0; i < rowSpan; i++) {
for (int j = 0; j < columnSpan; j++) {
span[row + i][column + j][CellSpan.COLUMN] = 1;
span[row + i][column + j][CellSpan.ROW] = 1;
}
}
}
public void removeCol() {
columnIdentifiers.removeElementAt(columnIdentifiers.size()-1);
dataVector.setSize(getRowCount());
for (int i = 0; i < getRowCount()-1; i++) {
((Vector)dataVector.elementAt(i)).setSize(getColumnCount());
}
fireTableStructureChanged();
}
}

@ -0,0 +1,94 @@
package com.connor.jd.plm.table;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import javax.swing.JComponent;
import javax.swing.plaf.basic.BasicTableUI;
import javax.swing.table.TableCellRenderer;
public class CTUI extends BasicTableUI {
public void paint(Graphics g, JComponent c){
Rectangle oldClipBounds = g.getClipBounds();
Rectangle clipBounds = new Rectangle(oldClipBounds);
int tableWidth = table.getColumnModel().getTotalColumnWidth();
clipBounds.width = Math.min(clipBounds.width, tableWidth);
g.setClip(clipBounds);
int firstIndex = table.rowAtPoint(new Point(0, clipBounds.y));
int lastIndex = table.getRowCount() - 1;
Rectangle rowRect = new Rectangle(0, 0, tableWidth, table.getRowHeight() + table.getRowMargin());
rowRect.y = firstIndex * rowRect.height;
for (int index = firstIndex; index <= lastIndex; index++) {
if (rowRect.intersects(clipBounds)) {
// System.out.println(); // debug
// System.out.print("" + index +": "); // row
paintRow(g, index);
}
rowRect.y += rowRect.height;
}
g.setClip(oldClipBounds);
}
private void paintRow(Graphics g, int row) {
Rectangle rect = g.getClipBounds();
boolean drawn = false;
CellSpan cellAtt = (CellSpan) table.getModel();
int numColumns = table.getColumnCount();
for (int column = 0; column < numColumns; column++) {
Rectangle cellRect = table.getCellRect(row, column, true);
int cellRow, cellColumn;
if (cellAtt.isVisible(row, column)) {
cellRow = row;
cellColumn = column;
// System.out.print(" "+column+" "); // debug
} else {
cellRow = row + cellAtt.getSpan(row, column)[CellSpan.ROW];
cellColumn = column + cellAtt.getSpan(row, column)[CellSpan.COLUMN];
// System.out.print(" ("+column+")"); // debug
}
if (cellRect.intersects(rect)) {
drawn = true;
paintCell(g, cellRect, cellRow, cellColumn);
} else {
if (drawn)
break;
}
}
}
private void paintCell(Graphics g, Rectangle cellRect, int row, int column) {
int spacingHeight = table.getRowMargin();
int spacingWidth = table.getColumnModel().getColumnMargin();
Color c = g.getColor();
g.setColor(table.getGridColor());
g.drawRect(cellRect.x, cellRect.y, cellRect.width - 1, cellRect.height - 1);
g.setColor(c);
cellRect.setBounds(cellRect.x + spacingWidth / 2, cellRect.y + spacingHeight / 2, cellRect.width - spacingWidth,
cellRect.height - spacingHeight);
if (table.isEditing() && table.getEditingRow() == row && table.getEditingColumn() == column) {
Component component = table.getEditorComponent();
component.setBounds(cellRect);
component.validate();
} else {
TableCellRenderer renderer = table.getCellRenderer(row, column);
Component component = table.prepareRenderer(renderer, row, column);
if (component.getParent() == null) {
rendererPane.add(component);
}
rendererPane.paintComponent(g, component, table, cellRect.x, cellRect.y, cellRect.width, cellRect.height,
true);
}
}
}

@ -0,0 +1,145 @@
package com.connor.jd.plm.table;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
public class CTable extends JTable {
Map<Point,TableCellEditor> map;
public CTable(TableModel model) {
super(model);
setUI(new CTUI());
getTableHeader().setReorderingAllowed(false);
setCellSelectionEnabled(true);
setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
map=new HashMap();
}
public String getToolTipText(MouseEvent e) {
int row=this.rowAtPoint(e.getPoint());
int col=this.columnAtPoint(e.getPoint());
String tiptextString=null;
if(row>-1 && col>-1){
Object value=this.getValueAt(row, col);
if(null!=value && !"".equals(value))
tiptextString=value.toString();//Ðü¸¡ÏÔʾµ¥Ôª¸ñÄÚÈÝ
}
return tiptextString;
}
public Rectangle getCellRect(int row, int column, boolean includeSpacing) {
Rectangle sRect = super.getCellRect(row, column, includeSpacing);
if ((row < 0) || (column < 0) || (getRowCount() <= row) || (getColumnCount() <= column)) {
return sRect;
}
CellSpan cellAtt = (CellSpan) getModel();
if (!cellAtt.isVisible(row, column)) {
int temp_row = row;
int temp_column = column;
row += cellAtt.getSpan(temp_row, temp_column)[CellSpan.ROW];
column += cellAtt.getSpan(temp_row, temp_column)[CellSpan.COLUMN];
}
int[] n = cellAtt.getSpan(row, column);
int index = 0;
int columnMargin = getColumnModel().getColumnMargin();
Rectangle cellFrame = new Rectangle();
int aCellHeight = rowHeight + rowMargin;
cellFrame.y = row * aCellHeight;
cellFrame.height = n[CellSpan.ROW] * aCellHeight;
Enumeration eeration = getColumnModel().getColumns();
while (eeration.hasMoreElements()) {
TableColumn aColumn = (TableColumn) eeration.nextElement();
cellFrame.width = aColumn.getWidth() + columnMargin;
if (index == column)
break;
cellFrame.x += cellFrame.width;
index++;
}
for (int i = 0; i < n[CellSpan.COLUMN] - 1; i++) {
TableColumn aColumn = (TableColumn) eeration.nextElement();
cellFrame.width += aColumn.getWidth() + columnMargin;
}
if (!includeSpacing) {
Dimension spacing = getIntercellSpacing();
cellFrame.setBounds(cellFrame.x + spacing.width / 2, cellFrame.y + spacing.height / 2,
cellFrame.width - spacing.width, cellFrame.height - spacing.height);
}
return cellFrame;
}
private int[] rowColumnAtPoint(Point point) {
int[] retValue = { -1, -1 };
int row = point.y / (rowHeight + rowMargin);
if ((row < 0) || (getRowCount() <= row))
return retValue;
int column = getColumnModel().getColumnIndexAtX(point.x);
CellSpan cellAtt = (CellSpan) getModel();
if (cellAtt.isVisible(row, column)) {
retValue[CellSpan.COLUMN] = column;
retValue[CellSpan.ROW] = row;
return retValue;
}
retValue[CellSpan.COLUMN] = column + cellAtt.getSpan(row, column)[CellSpan.COLUMN];
retValue[CellSpan.ROW] = row + cellAtt.getSpan(row, column)[CellSpan.ROW];
return retValue;
}
public int rowAtPoint(Point point) {
return rowColumnAtPoint(point)[CellSpan.ROW];
}
public int columnAtPoint(Point point) {
return rowColumnAtPoint(point)[CellSpan.COLUMN];
}
public void columnSelectionChanged(ListSelectionEvent e) {
repaint();
}
public void valueChanged(ListSelectionEvent e) {
int firstIndex = e.getFirstIndex();
int lastIndex = e.getLastIndex();
if (firstIndex == -1 && lastIndex == -1) { // Selection cleared.
repaint();
}
Rectangle dirtyRegion = getCellRect(firstIndex, 0, false);
int numCoumns = getColumnCount();
int index = firstIndex;
for (int i = 0; i < numCoumns; i++) {
dirtyRegion.add(getCellRect(index, i, false));
}
index = lastIndex;
for (int i = 0; i < numCoumns; i++) {
dirtyRegion.add(getCellRect(index, i, false));
}
repaint(dirtyRegion.x, dirtyRegion.y, dirtyRegion.width, dirtyRegion.height);
}
public void setCombo(int row,int col,TableCellEditor ce){
map.put(new Point(row,col), ce);
}
public TableCellEditor getCellEditor(int row, int column){
Point point = new Point(row,column);
if(map.containsKey(point)){
return map.get(point);
}else{
return super.getCellEditor(row, column);
}
}
public void setRowHeight(int row, int rowHeight) {
super.setRowHeight(row, rowHeight);
}
}

@ -0,0 +1,42 @@
package com.connor.jd.plm.table;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JScrollPane;
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class CTest {
static int[] rows;
static JScrollPane pane;
public static void main(String args[]) {
final CTMap map = new CTMap(5, 5);
final CTable table = new CTable(map);
table.setDefaultRenderer(Object.class, new TableCellTextAreaRenderer());
pane = new JScrollPane(table);
JButton button = new JButton("add");
table.setShowGrid(false);
final JDialog dialog = new JDialog();
dialog.setLayout(new BorderLayout());
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
table.setRowHeight(2, 50);
table.revalidate();
table.repaint();
}
});
dialog.add(pane, BorderLayout.CENTER);
dialog.add(button, BorderLayout.SOUTH);
dialog.setPreferredSize(new Dimension(500, 500));
dialog.show();
}
}

@ -0,0 +1,14 @@
package com.connor.jd.plm.table;
interface CellSpan {
public final int ROW = 0;
public final int COLUMN = 1;
public int[] getSpan(int row, int column);
public void setSpan(int[] span, int row, int column);
public boolean isVisible(int row, int column);
public void combine(int[] rows, int[] columns);
}

@ -0,0 +1,34 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JTable;
import javax.swing.JTextField;
import com.connor.jd.plm.utils.DatePickerUtil;
import com.eltima.components.ui.DatePicker;
public class DatePickerCellEditor extends DefaultCellEditor {
private DatePicker datePicker;
public DatePickerCellEditor(JTextField arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
// TODO Auto-generated method stub
datePicker = DatePickerUtil.getDatePicker(null);
return datePicker;
}
@Override
public Object getCellEditorValue() {
// TODO Auto-generated method stub
return datePicker.getText();
}
}

@ -0,0 +1,100 @@
package com.connor.jd.plm.table;
import java.awt.Dimension;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;
public class DefaultModel extends DefaultTableModel implements CellSpan {
protected int rowSize;
protected int columnSize;
protected int[][][] span; // CellSpan
@Override
public int[] getSpan(int row, int column) {
// TODO Auto-generated method stub
if (isOutOfBounds(row, column)) {
int[] ret_code = { 1, 1 };
return ret_code;
}
return span[row][column];
}
@Override
public void setSpan(int[] span, int row, int column) {
// TODO Auto-generated method stub
if (isOutOfBounds(row, column))
return;
this.span[row][column] = span;
}
@Override
public boolean isVisible(int row, int column) {
// TODO Auto-generated method stub
if (isOutOfBounds(row, column))
return false;
if ((span[row][column][CellSpan.COLUMN] < 1) || (span[row][column][CellSpan.ROW] < 1))
return false;
return true;
}
@Override
public void combine(int[] rows, int[] columns) {
// TODO Auto-generated method stub
int rowSpan = rows.length;
int columnSpan = columns.length;
int startRow = rows[0];
int startColumn = columns[0];
for (int i = 0; i < rowSpan; i++) {
for (int j = 0; j < columnSpan; j++) {
if ((span[startRow + i][startColumn + j][CellSpan.COLUMN] != 1)
|| (span[startRow + i][startColumn + j][CellSpan.ROW] != 1)) {
// System.out.println("can't combine");
return;
}
}
}
for (int i = 0, ii = 0; i < rowSpan; i++, ii--) {
for (int j = 0, jj = 0; j < columnSpan; j++, jj--) {
span[startRow + i][startColumn + j][CellSpan.COLUMN] = jj;
span[startRow + i][startColumn + j][CellSpan.ROW] = ii;
// System.out.println("r " +ii +" c " +jj);
}
}
span[startRow][startColumn][CellSpan.COLUMN] = columnSpan;
span[startRow][startColumn][CellSpan.ROW] = rowSpan;
}
public void setSize(Dimension size) {
columnSize = size.width;
rowSize = size.height;
span = new int[rowSize][columnSize][2]; // 2: COLUMN,ROW
initValue();
}
protected void initValue() {
System.out.println(span.length);
for (int i = 0; i < span.length; i++) {
for (int j = 0; j < span[i].length; j++) {
span[i][j][CellSpan.COLUMN] = 1;
span[i][j][CellSpan.ROW] = 1;
}
}
}
protected boolean isOutOfBounds(int row, int column) {
if ((row < 0) || (rowSize <= row) || (column < 0) || (columnSize <= column)) {
return true;
}
return false;
}
public DefaultModel(int numRows, int numColumns) {
Vector names = new Vector(numColumns);
names.setSize(numColumns);
setColumnIdentifiers(names);
dataVector = new Vector();
setNumRows(numRows);
setSize(new Dimension(numColumns, numRows));
}
}

@ -0,0 +1,83 @@
package com.connor.jd.plm.table;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
public class JCheckPanel extends JPanel {
private JCheckBox[] buttons = null;
private ButtonGroup buttonGroup = new ButtonGroup();
public JCheckPanel(String[] text) {
super();
buttons = new JCheckBox[text.length];
for (int i = 0; i < text.length; i++) {
buttons[i] = new JCheckBox(text[i]);
buttons[i].setPreferredSize(new Dimension(100, 25));
buttonGroup.add(buttons[i]);
add(buttons[i]);
}
setLayout(new FlowLayout(FlowLayout.LEFT));
}
public JCheckPanel(String[] text, boolean isSingle) {
buttons = new JCheckBox[text.length];
for (int i = 0; i < text.length; i++) {
buttons[i] = new JCheckBox(text[i]);
buttons[i].setPreferredSize(new Dimension(60, 25));
if (isSingle) {
buttonGroup.add(buttons[i]);
}
add(buttons[i]);
}
setLayout(new FlowLayout(FlowLayout.LEFT));
}
public JCheckBox[] getButtons() {
return buttons;
}
public List<JCheckBox> getSelected() {
List<JCheckBox> list = new ArrayList<JCheckBox>();
for (JCheckBox check : buttons) {
if (check.isSelected()) {
list.add(check);
}
}
return list;
}
public String getSelectedText() {
List<JCheckBox> list = getSelected();
if (list.size() == 0) {
return null;
}
String str = "";
for (JCheckBox jcb : list) {
str += jcb.getText();
str += ",";
}
return str.substring(0, str.length() - 1);
}
public void setSelected(int index) {
buttons[index].setSelected(true);
}
public void setSelected(String value) {
String[] arr = value.split(",");
for (int i = 0; i < arr.length; i++) {
for (int ii = 0; ii < buttons.length; ii++) {
if (buttons[ii].getText().equals(arr[i])) {
buttons[ii].setSelected(true);
break;
}
}
}
}
}

@ -0,0 +1,47 @@
package com.connor.jd.plm.table;
import java.awt.FlowLayout;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
public class JRadioPanel extends JPanel {
private JRadioButton[] buttons = null;
private ButtonGroup buttonGroup = new ButtonGroup();
public JRadioPanel(String[] text) {
super();
buttons = new JRadioButton[text.length];
for (int i = 0; i < text.length; i++) {
buttons[i] = new JRadioButton(text[i]);
buttonGroup.add(buttons[i]);
add(buttons[i]);
}
setLayout(new FlowLayout(FlowLayout.LEFT));
}
public JRadioButton[] getButtons() {
return buttons;
}
public JRadioButton getSelected() {
for (JRadioButton jb : buttons) {
if (jb.isSelected()) {
return jb;
}
}
return null;
}
public void setSelected(int index) {
buttons[index].setSelected(true);
}
public void setSelected(String value) {
for (int i = 0; i < buttons.length; i++) {
buttons[i].setSelected(buttons[i].getText().equals(value.trim()));
}
}
}

@ -0,0 +1,39 @@
package com.connor.jd.plm.table;
import javax.swing.JOptionPane;
public class MessageBox2 {
private static String Title = "Ìáʾ";
public static final int DEFAULT_OPTION = -1;
public static final int YES_NO_OPTION = 10;
public static final int YES_NO_CANCEL_OPTION = 11;
public static final int OK_CANCEL_OPTION = 12;
public static final int YES_OPTION = 0;
public static final int NO_OPTION = 1;
public static final int CANCEL_OPTION = 2;
public static final int OK_OPTION = 0;
public static final int CLOSED_OPTION = -1;
public static final int ERROR_MESSAGE = 0;
public static final int INFORMATION_MESSAGE = 1;
public static final int WARNING_MESSAGE = 2;
public static final int QUESTION_MESSAGE = 3;
public static final int PLAIN_MESSAGE = -1;
public static int Show(String Msg, int Option) {
switch (Option) {
case YES_NO_OPTION:
case YES_NO_CANCEL_OPTION:
case OK_CANCEL_OPTION:
return JOptionPane.showConfirmDialog(null, Msg, Title, Option - 10);
default:
JOptionPane.showMessageDialog(null, Msg, Title, Option);
}
return 0;
}
public static int Show(String Msg) {
return Show(Msg, INFORMATION_MESSAGE);
}
}

@ -0,0 +1,122 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.JTextField;
import com.teamcenter.rac.util.MessageBox;
public class MyCellEditor extends DefaultCellEditor {
private JRadioPanel radio = null;
private JCheckPanel check = null;
private JComboBox<String> comboBox = null;
private int type = -1;
private int row;
private int col;
private int top;
private int end;
private int bottom;
private JTable table;
public MyCellEditor(JTextField var1) {
super(var1);
// TODO Auto-generated constructor stub
}
public MyCellEditor(JTextField var1, int top, int end, int bottom) {
super(var1);
// TODO Auto-generated constructor stub
this.top = top;
this.end = end;
this.bottom = bottom;
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (value instanceof JRadioPanel) {
radio = (JRadioPanel) value;
type = 1;
return radio;
} else if (value instanceof JCheckPanel) {
check = (JCheckPanel) value;
type = 2;
return check;
} else if (value instanceof JComboBox) {
comboBox = (JComboBox<String>) value;
type = 3;
return comboBox;
}
this.row = row;
this.col = column;
this.bottom = table.getRowCount() - end;
this.table = table;
type = 0;
return super.getTableCellEditorComponent(table, value, isSelected, row, column);
}
@Override
public Object getCellEditorValue() {
if (type == 1) {
return radio;
}
if (type == 2) {
return check;
}
if (type == 3) {
return comboBox;
}
Object obj = super.getCellEditorValue();
if (obj != null && !"".equals(obj.toString().trim()) && row >= top && row <= bottom && col >= 7
&& col < table.getColumnCount() - 3) {
try {
Double.parseDouble(obj.toString().trim());
} catch (Exception e) {
MessageBox.post("检查数据只能输入数字", "错误", MessageBox.ERROR);
return null;
}
}
return obj;
}
@Override
public boolean stopCellEditing() {
// TODO Auto-generated method stub
if (row >= top && row <= bottom && col >= 7 && col < table.getColumnCount() - 3) {
double min = Double.MAX_VALUE;
double max = Double.MIN_VALUE;
Object obj;
for (int i = 7; i < col; i++) {
obj = table.getValueAt(row, i);
if (obj != null && !"".equals(obj.toString().trim())) {
min = Math.min(min, Double.parseDouble(obj.toString().trim()));
max = Math.max(max, Double.parseDouble(obj.toString().trim()));
}
}
obj = getCellEditorValue();
if (obj != null && !"".equals(obj.toString().trim())) {
min = Math.min(min, Double.parseDouble(obj.toString().trim()));
max = Math.max(max, Double.parseDouble(obj.toString().trim()));
}
for (int i = col + 1; i < table.getColumnCount() - 3; i++) {
obj = table.getValueAt(row, i);
if (obj != null && !"".equals(obj.toString().trim())) {
min = Math.min(min, Double.parseDouble(obj.toString().trim()));
max = Math.max(max, Double.parseDouble(obj.toString().trim()));
}
}
if (max > Double.MIN_VALUE) {
table.setValueAt(String.format("%.2f", min), row, table.getColumnCount() - 3);
table.setValueAt(String.format("%.2f", max), row, table.getColumnCount() - 2);
} else {
table.setValueAt("", row, table.getColumnCount() - 3);
table.setValueAt("", row, table.getColumnCount() - 2);
}
}
return super.stopCellEditing();
}
}

@ -0,0 +1,300 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.DefaultCellEditor;
import javax.swing.JTable;
import javax.swing.JTextField;
import com.teamcenter.rac.util.MessageBox;
public class MyCellEditor1 extends DefaultCellEditor {
private int col;
private int row;
private JTable table;
private int top;
private int end;
private int bottom;
private List<Double> data;
private double low = 0.0;
private double up = 0.0;
private int cnt = 0;
private int lowCnt = 0;
private int upCnt = 0;
public MyCellEditor1(JTextField paramJTextField) {
super(paramJTextField);
// TODO Auto-generated constructor stub
}
public MyCellEditor1(JTextField paramJTextField, int top, int end, int bottom) {
super(paramJTextField);
// TODO Auto-generated constructor stub
this.top = top;
this.end = end;
this.bottom = bottom;
}
public double getLow() {
return low;
}
public void setLow(double low) {
this.low = low;
}
public double getUp() {
return up;
}
public void setUp(double up) {
this.up = up;
}
public int getCnt() {
return cnt;
}
public void setCnt(int cnt) {
this.cnt = cnt;
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
this.col = column;
this.row = row;
this.table = table;
bottom = table.getRowCount() - end;
return super.getTableCellEditorComponent(table, value, isSelected, row, column);
}
@Override
public Object getCellEditorValue() {
// TODO Auto-generated method stub
Object obj = super.getCellEditorValue();
if (obj != null && !"".equals(obj.toString().trim()) && row >= top - 3 && row <= bottom) {
try {
Double.parseDouble(obj.toString().trim());
} catch (Exception e) {
MessageBox.post("计算区域只能输入数字", "错误", MessageBox.ERROR);
return null;
}
}
return obj;
}
@Override
public boolean stopCellEditing() {
// TODO Auto-generated method stub
System.out.println("top:" + top + ",end:" + end + ",bottom:" + bottom + " 重新计算列:" + col);
data = new ArrayList<Double>();
Object now = getCellEditorValue();
Object obj = null;
if (row == 2) {
if (now != null && !"".equals(now.toString().trim())) {
low = Double.parseDouble(now.toString().trim());
lowCnt = 1;
} else {
low = 0.0;
lowCnt = 0;
}
}
if (row == 3) {
if (now != null && !"".equals(now.toString().trim())) {
up = Double.parseDouble(now.toString().trim());
upCnt = 1;
} else {
up = 0.0;
upCnt = 0;
}
}
cnt = lowCnt + upCnt;
System.out.println("lowCnt===>" + lowCnt);
System.out.println("upCnt====>" + upCnt);
for (int i = top; i < row && i <= bottom; i++) {
obj = table.getModel().getValueAt(i, col);
if (obj != null && !"".equals(obj.toString().trim())) {
data.add(Double.parseDouble(obj.toString().trim()));
}
}
if (row >= top && row <= bottom && now != null && !"".equals(now.toString().trim())) {
data.add(Double.parseDouble(now.toString().trim()));
}
if (row + 1 >= top) {
for (int i = row + 1; i <= bottom; i++) {
obj = table.getModel().getValueAt(i, col);
if (obj != null && !"".equals(obj.toString().trim())) {
data.add(Double.parseDouble(obj.toString().trim()));
}
}
} else {
for (int i = top; i <= bottom; i++) {
obj = table.getModel().getValueAt(i, col);
if (obj != null && !"".equals(obj.toString().trim())) {
data.add(Double.parseDouble(obj.toString().trim()));
}
}
}
System.out.println(Arrays.toString(data.toArray()));
double sum = 0;
double max = Double.MIN_VALUE;
double min = Double.MAX_VALUE;
for (Double d : data) {
sum += d;
max = Math.max(max, d);
min = Math.min(min, d);
}
if (sum != 0) {
double r = max - min;
double avg = sum / data.size();
table.getModel().setValueAt(String.format("%.2f", min), bottom + 1, col);
table.getModel().setValueAt(String.format("%.2f", max), bottom + 2, col);
table.getModel().setValueAt(String.format("%.2f", r), bottom + 3, col);
table.getModel().setValueAt(String.format("%.2f", avg), bottom + 5, col);
if (data.size() - 1 > 0) {
double stdevSum = 0;
for (Double d : data) {
stdevSum += Math.pow(d - avg, 2);
}
double stdev = Math.sqrt(stdevSum / (data.size() - 1));
double bar1 = avg - 3 * stdev;
double bar2 = avg + 3 * stdev;
table.getModel().setValueAt(String.format("%.2f", stdev), bottom + 4, col);
table.getModel().setValueAt(String.format("%.2f", bar1), bottom + 6, col);
table.getModel().setValueAt(String.format("%.2f", bar2), bottom + 7, col);
double cp = 0.0;
if (cnt == 0) {
table.getModel().setValueAt("", bottom + 8, col);
} else if (cnt == 2) {
cp = (up - low) / (6 * stdev);
table.getModel().setValueAt(String.format("%.2f", cp), bottom + 8, col);
} else if (doubleIsEqual(up, 0.0)) {
cp = (avg - low) / (3 * stdev);
table.getModel().setValueAt(String.format("%.2f", cp), bottom + 8, col);
} else {
cp = (up - avg) / (3 * stdev);
table.getModel().setValueAt(String.format("%.2f", cp), bottom + 8, col);
}
double cpu = 0.0;
if (doubleIsEqual(up, 0.0)) {
table.getModel().setValueAt("", bottom + 9, col);
} else {
cpu = (up - avg) / (3 * stdev);
table.getModel().setValueAt(String.format("%.2f", cpu), bottom + 9, col);
}
double cpl = 0.0;
if (doubleIsEqual(low, 0.0)) {
table.getModel().setValueAt("", bottom + 10, col);
} else {
cpl = (avg - low) / (3 * stdev);
table.getModel().setValueAt(String.format("%.2f", cpl), bottom + 10, col);
}
double cpk = 0.0;
if (cnt == 2) {
cpk = (1 - 2 * Math.abs(((low + up) / 2 - avg)) / (up - low)) * cp;
table.getModel().setValueAt(String.format("%.2f", cpk), bottom + 11, col);
} else {
cpk = cp;
table.getModel().setValueAt(doubleIsEqual(cpk, 0.0) ? "" : String.format("%.2f", cpk), bottom + 11,
col);
}
double su = 0.0;
if (doubleIsEqual(cpu, 0.0)) {
table.getModel().setValueAt("", bottom + 12, col);
} else {
su = (1 - normSDist(cpu * 3)) * 1000000;
table.getModel().setValueAt(String.format("%.2f", su), bottom + 12, col);
}
double sl = 0.0;
if (doubleIsEqual(cpl, 0.0)) {
table.getModel().setValueAt("", bottom + 13, col);
} else {
sl = (1 - normSDist(cpl * 3)) * 1000000;
table.getModel().setValueAt(String.format("%.2f", sl), bottom + 13, col);
}
if (cnt == 0) {
table.getModel().setValueAt("", bottom + 14, col);
} else {
table.getModel().setValueAt(String.format("%.2f", su + sl), bottom + 14, col);
}
if (cnt == 0) {
table.getModel().setValueAt("", bottom + 15, col);
} else if (cpk > 1.99) {
table.getModel().setValueAt("非常好", bottom + 15, col);
} else if (cpk > 1.66) {
table.getModel().setValueAt("很好", bottom + 15, col);
} else if (cpk > 1.32) {
table.getModel().setValueAt("好", bottom + 15, col);
} else if (cpk > 0.99) {
table.getModel().setValueAt("有能力", bottom + 15, col);
} else {
table.getModel().setValueAt("能力不足", bottom + 15, col);
}
System.out.println("cp:" + cp + ",cpu:" + cpu + ",cpl:" + cpl + ",cpk:" + cpk + ",su:" + su + ",sl:"
+ sl + ",ppm:" + (su + sl));
} else {
table.getModel().setValueAt("", bottom + 4, col);
table.getModel().setValueAt("", bottom + 6, col);
table.getModel().setValueAt("", bottom + 7, col);
table.getModel().setValueAt("", bottom + 8, col);
table.getModel().setValueAt("", bottom + 9, col);
table.getModel().setValueAt("", bottom + 10, col);
table.getModel().setValueAt("", bottom + 11, col);
table.getModel().setValueAt("", bottom + 12, col);
table.getModel().setValueAt("", bottom + 13, col);
table.getModel().setValueAt("", bottom + 14, col);
table.getModel().setValueAt("", bottom + 15, col);
}
} else {
table.getModel().setValueAt("", bottom + 1, col);
table.getModel().setValueAt("", bottom + 2, col);
table.getModel().setValueAt("", bottom + 3, col);
table.getModel().setValueAt("", bottom + 5, col);
table.getModel().setValueAt("", bottom + 4, col);
table.getModel().setValueAt("", bottom + 6, col);
table.getModel().setValueAt("", bottom + 7, col);
table.getModel().setValueAt("", bottom + 8, col);
table.getModel().setValueAt("", bottom + 9, col);
table.getModel().setValueAt("", bottom + 10, col);
table.getModel().setValueAt("", bottom + 11, col);
table.getModel().setValueAt("", bottom + 12, col);
table.getModel().setValueAt("", bottom + 13, col);
table.getModel().setValueAt("", bottom + 14, col);
table.getModel().setValueAt("", bottom + 15, col);
}
return super.stopCellEditing();
}
private boolean doubleIsEqual(double a, double b) {
return Math.abs(a - b) < 0.000001;
}
private double normSDist(double z) {
// this guards against overflow
if (z > 6)
return 1;
if (z < -6)
return 0;
double gamma = 0.231641900, a1 = 0.319381530, a2 = -0.356563782, a3 = 1.781477973, a4 = -1.821255978,
a5 = 1.330274429;
double x = Math.abs(z);
double t = 1 / (1 + gamma * x);
double n = 1 - (1 / (Math.sqrt(2 * Math.PI)) * Math.exp(-z * z / 2))
* (a1 * t + a2 * Math.pow(t, 2) + a3 * Math.pow(t, 3) + a4 * Math.pow(t, 4) + a5 * Math.pow(t, 5));
if (z < 0)
return 1.0 - n;
return n;
}
}

@ -0,0 +1,48 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JTextField;
public class MyCellEditor2 extends DefaultCellEditor {
private JLabel img = null;
private JComboBox<String> jued = null;
private int type = -1;
public MyCellEditor2(JTextField var1) {
super(var1);
// TODO Auto-generated constructor stub
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (value instanceof JLabel) {
img = (JLabel) value;
type = 1;
return img;
}
if (value instanceof JComboBox) {
jued = (JComboBox<String>) value;
type = 2;
return jued;
}
type = 0;
return super.getTableCellEditorComponent(table, value, isSelected, row, column);
}
@Override
public Object getCellEditorValue() {
if (type == 1) {
return img;
}
if (type == 2) {
return jued;
}
return super.getCellEditorValue();
}
}

@ -0,0 +1,39 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JTable;
import javax.swing.JTextField;
public class MyCellEditor3 extends DefaultCellEditor {
private JCheckPanel check = null;
private int type = -1;
public MyCellEditor3(JTextField arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
// TODO Auto-generated method stub
if (value instanceof JCheckPanel) {
check = (JCheckPanel) value;
type = 1;
return check;
}
type = 0;
return super.getTableCellEditorComponent(table, value, isSelected, row, column);
}
@Override
public Object getCellEditorValue() {
// TODO Auto-generated method stub
if (type == 1) {
return check;
}
return super.getCellEditorValue();
}
}

@ -0,0 +1,38 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JTable;
import javax.swing.JTextField;
public class MyCellEditor4 extends DefaultCellEditor {
private int type = -1;
private JCheckBox check;
public MyCellEditor4(JTextField arg0) {
super(arg0);
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (value instanceof JCheckBox) {
System.out.println("123456789abcdefg");
check = (JCheckBox) value;
type = 1;
return check;
}
type = 0;
return super.getTableCellEditorComponent(table, value, isSelected, row, column);
}
@Override
public Object getCellEditorValue() {
if (type == 1) {
return check;
}
return super.getCellEditorValue();
}
}

@ -0,0 +1,19 @@
package com.connor.jd.plm.table;
import java.awt.Component;
import javax.swing.JCheckBox;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
public class MyCellRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
// TODO Auto-generated method stub
if (value instanceof JCheckBox) {
return (JCheckBox) value;
}
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
}
}

@ -0,0 +1,24 @@
package com.connor.jd.plm.table;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import javax.swing.SwingConstants;
public class MyComboBoxRenderer extends JLabel implements ListCellRenderer {
public MyComboBoxRenderer() {
setOpaque(true);
}
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
setBackground(isSelected ? new Color(0xff0078D7) : Color.WHITE);
setHorizontalAlignment(SwingConstants.CENTER);
setText(value.toString());
return this;
}
}

@ -0,0 +1,72 @@
package com.connor.jd.plm.table;
import java.awt.Color;
import java.awt.Component;
import javax.swing.BorderFactory;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.table.TableCellRenderer;
public class TableCellTextAreaRenderer extends JTextArea implements TableCellRenderer {
public TableCellTextAreaRenderer() {
setLineWrap(true);
setWrapStyleWord(true);
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
// TODO Auto-generated method stub
int maxPreferredHeight = 0;
for (int i = 0; i < table.getColumnCount(); i++) {
setText("" + table.getValueAt(row, i));
setSize(table.getColumnModel().getColumn(column).getWidth(), 0);
maxPreferredHeight = Math.max(maxPreferredHeight, getPreferredSize().height);
}
setBackground(Color.white);
setForeground(Color.black);
if(isSelected){
setBackground(new Color(0, 120, 215));
setForeground(Color.white);
}
if (table.getRowHeight(row) != maxPreferredHeight) // ÉÙÁËÕâÐÐÔò´¦ÀíÆ÷Ϲæ
table.setRowHeight(row, maxPreferredHeight);
setText(value == null ? "" : value.toString());
return this;
}
// @Override
// public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
// int row, int column) {
// // TODO Auto-generated method stub
// int maxPreferredHeight = 0;
// for (int i = 0; i < table.getColumnCount(); i++) {
// setText("" + table.getValueAt(row, i));
// setSize(table.getColumnModel().getColumn(column).getWidth(), 0);
// maxPreferredHeight = Math.max(maxPreferredHeight, getPreferredSize().height);
// }
// setBorder(BorderFactory.createLineBorder(Color.white));
// setBackground(Color.white);
// setForeground(Color.black);
// if(isSelected){
// setBackground(new Color(0, 120, 215));
// setForeground(Color.white);
// }
// String val=(String) table.getValueAt(row, column);
// int w=0;
// if(val!=null){
// w=val.length()*6/table.getColumn(table.getColumnName(column)).getWidth();
// }
// if(w!=0){
// //System.out.println("height:"+table.getRowHeight()*(w+1));
// table.setRowHeight(row,table.getRowHeight()*(w+1));
// }
//
//
// setText(value == null ? "" : value.toString());
// return this;
// }
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save