commit f9ead762cde9fe85beaf30ac66e360189fdae17f
Author: ChenZichaoczc <2974997276@qq.com>
Date: Tue Jun 3 16:09:27 2025 +0800
first commit
diff --git a/SBsendERP/.project b/SBsendERP/.project
new file mode 100644
index 0000000..30dd242
--- /dev/null
+++ b/SBsendERP/.project
@@ -0,0 +1,17 @@
+
+
+ SbSendProcess
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/SBsendERP/bin/.project b/SBsendERP/bin/.project
new file mode 100644
index 0000000..30dd242
--- /dev/null
+++ b/SBsendERP/bin/.project
@@ -0,0 +1,17 @@
+
+
+ SbSendProcess
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/SBsendEmail/.classpath b/SBsendEmail/.classpath
new file mode 100644
index 0000000..c5d9308
--- /dev/null
+++ b/SBsendEmail/.classpath
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SBsendEmail/.project b/SBsendEmail/.project
new file mode 100644
index 0000000..83a46c5
--- /dev/null
+++ b/SBsendEmail/.project
@@ -0,0 +1,17 @@
+
+
+ SbSendEmail
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/SBsendEmail/.settings/org.eclipse.core.resources.prefs b/SBsendEmail/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..4f1dad7
--- /dev/null
+++ b/SBsendEmail/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//src/com/cn/sb/sendMail/entity/DingTalkResponse.java=UTF-8
diff --git a/SBsendEmail/.settings/org.eclipse.jdt.core.prefs b/SBsendEmail/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0fee6a9
--- /dev/null
+++ b/SBsendEmail/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,15 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/SBsendEmail/bin/com/cn/sb/sendMail/MainClassSendMail.class b/SBsendEmail/bin/com/cn/sb/sendMail/MainClassSendMail.class
new file mode 100644
index 0000000..21c7f03
Binary files /dev/null and b/SBsendEmail/bin/com/cn/sb/sendMail/MainClassSendMail.class differ
diff --git a/SBsendEmail/bin/com/cn/sb/sendMail/ReadMe b/SBsendEmail/bin/com/cn/sb/sendMail/ReadMe
new file mode 100644
index 0000000..9e1496f
--- /dev/null
+++ b/SBsendEmail/bin/com/cn/sb/sendMail/ReadMe
@@ -0,0 +1 @@
+世宝:临时图纸、临时物料即将到达有效期时消息提醒(钉钉+TC内部邮件)
\ No newline at end of file
diff --git a/SBsendEmail/bin/com/cn/sb/sendMail/entity/DingTalkResponse.class b/SBsendEmail/bin/com/cn/sb/sendMail/entity/DingTalkResponse.class
new file mode 100644
index 0000000..7c91914
Binary files /dev/null and b/SBsendEmail/bin/com/cn/sb/sendMail/entity/DingTalkResponse.class differ
diff --git a/SBsendEmail/bin/com/cn/sb/sendMail/entity/Propty.class b/SBsendEmail/bin/com/cn/sb/sendMail/entity/Propty.class
new file mode 100644
index 0000000..eee3fe0
Binary files /dev/null and b/SBsendEmail/bin/com/cn/sb/sendMail/entity/Propty.class differ
diff --git a/SBsendEmail/bin/com/cn/sb/sendMail/util/EnvelopeManagement.class b/SBsendEmail/bin/com/cn/sb/sendMail/util/EnvelopeManagement.class
new file mode 100644
index 0000000..0e61246
Binary files /dev/null and b/SBsendEmail/bin/com/cn/sb/sendMail/util/EnvelopeManagement.class differ
diff --git a/SBsendEmail/bin/com/cn/sb/sendMail/util/Utils.class b/SBsendEmail/bin/com/cn/sb/sendMail/util/Utils.class
new file mode 100644
index 0000000..5d34d69
Binary files /dev/null and b/SBsendEmail/bin/com/cn/sb/sendMail/util/Utils.class differ
diff --git a/SBsendEmail/bin/com/teamcenter/clientx/AppXCredentialManager.class b/SBsendEmail/bin/com/teamcenter/clientx/AppXCredentialManager.class
new file mode 100644
index 0000000..8586ebe
Binary files /dev/null and b/SBsendEmail/bin/com/teamcenter/clientx/AppXCredentialManager.class differ
diff --git a/SBsendEmail/bin/com/teamcenter/clientx/AppXExceptionHandler.class b/SBsendEmail/bin/com/teamcenter/clientx/AppXExceptionHandler.class
new file mode 100644
index 0000000..e148187
Binary files /dev/null and b/SBsendEmail/bin/com/teamcenter/clientx/AppXExceptionHandler.class differ
diff --git a/SBsendEmail/bin/com/teamcenter/clientx/AppXModelEventListener.class b/SBsendEmail/bin/com/teamcenter/clientx/AppXModelEventListener.class
new file mode 100644
index 0000000..4024a55
Binary files /dev/null and b/SBsendEmail/bin/com/teamcenter/clientx/AppXModelEventListener.class differ
diff --git a/SBsendEmail/bin/com/teamcenter/clientx/AppXPartialErrorListener.class b/SBsendEmail/bin/com/teamcenter/clientx/AppXPartialErrorListener.class
new file mode 100644
index 0000000..1def491
Binary files /dev/null and b/SBsendEmail/bin/com/teamcenter/clientx/AppXPartialErrorListener.class differ
diff --git a/SBsendEmail/bin/com/teamcenter/clientx/AppXRequestListener.class b/SBsendEmail/bin/com/teamcenter/clientx/AppXRequestListener.class
new file mode 100644
index 0000000..f61ec97
Binary files /dev/null and b/SBsendEmail/bin/com/teamcenter/clientx/AppXRequestListener.class differ
diff --git a/SBsendEmail/bin/com/teamcenter/clientx/AppXSession.class b/SBsendEmail/bin/com/teamcenter/clientx/AppXSession.class
new file mode 100644
index 0000000..ae8435e
Binary files /dev/null and b/SBsendEmail/bin/com/teamcenter/clientx/AppXSession.class differ
diff --git a/SBsendEmail/bin/com/teamcenter/clientx/SessionFactory.class b/SBsendEmail/bin/com/teamcenter/clientx/SessionFactory.class
new file mode 100644
index 0000000..ba3ca1f
Binary files /dev/null and b/SBsendEmail/bin/com/teamcenter/clientx/SessionFactory.class differ
diff --git a/SBsendEmail/lib/TcSoaClient_12000.2.0.jar b/SBsendEmail/lib/TcSoaClient_12000.2.0.jar
new file mode 100644
index 0000000..4a8850c
Binary files /dev/null and b/SBsendEmail/lib/TcSoaClient_12000.2.0.jar differ
diff --git a/SBsendEmail/lib/TcSoaCommon_12000.2.0.jar b/SBsendEmail/lib/TcSoaCommon_12000.2.0.jar
new file mode 100644
index 0000000..f935151
Binary files /dev/null and b/SBsendEmail/lib/TcSoaCommon_12000.2.0.jar differ
diff --git a/SBsendEmail/lib/TcSoaCoreStrong_12000.2.0.jar b/SBsendEmail/lib/TcSoaCoreStrong_12000.2.0.jar
new file mode 100644
index 0000000..e411a9c
Binary files /dev/null and b/SBsendEmail/lib/TcSoaCoreStrong_12000.2.0.jar differ
diff --git a/SBsendEmail/lib/TcSoaCoreTypes_12000.2.0.jar b/SBsendEmail/lib/TcSoaCoreTypes_12000.2.0.jar
new file mode 100644
index 0000000..d61ae14
Binary files /dev/null and b/SBsendEmail/lib/TcSoaCoreTypes_12000.2.0.jar differ
diff --git a/SBsendEmail/lib/TcSoaStrongModel_12000.2.0.jar b/SBsendEmail/lib/TcSoaStrongModel_12000.2.0.jar
new file mode 100644
index 0000000..1a7a624
Binary files /dev/null and b/SBsendEmail/lib/TcSoaStrongModel_12000.2.0.jar differ
diff --git a/SBsendEmail/lib/TcSoaWorkflowRac_12000.2.0.jar b/SBsendEmail/lib/TcSoaWorkflowRac_12000.2.0.jar
new file mode 100644
index 0000000..df95b47
Binary files /dev/null and b/SBsendEmail/lib/TcSoaWorkflowRac_12000.2.0.jar differ
diff --git a/SBsendEmail/lib/XmlSchema-1.4.7.jar b/SBsendEmail/lib/XmlSchema-1.4.7.jar
new file mode 100644
index 0000000..79251c6
Binary files /dev/null and b/SBsendEmail/lib/XmlSchema-1.4.7.jar differ
diff --git a/SBsendEmail/lib/activation-1.1.jar b/SBsendEmail/lib/activation-1.1.jar
new file mode 100644
index 0000000..53f82a1
Binary files /dev/null and b/SBsendEmail/lib/activation-1.1.jar differ
diff --git a/SBsendEmail/lib/ant-commons-logging.jar b/SBsendEmail/lib/ant-commons-logging.jar
new file mode 100644
index 0000000..d3c381c
Binary files /dev/null and b/SBsendEmail/lib/ant-commons-logging.jar differ
diff --git a/SBsendEmail/lib/antlr-2.7.7.jar b/SBsendEmail/lib/antlr-2.7.7.jar
new file mode 100644
index 0000000..5e5f14b
Binary files /dev/null and b/SBsendEmail/lib/antlr-2.7.7.jar differ
diff --git a/SBsendEmail/lib/apache-commons-codec-1.4.jar b/SBsendEmail/lib/apache-commons-codec-1.4.jar
new file mode 100644
index 0000000..422c42b
Binary files /dev/null and b/SBsendEmail/lib/apache-commons-codec-1.4.jar differ
diff --git a/SBsendEmail/lib/apache-mime4j-core-0.7.2.jar b/SBsendEmail/lib/apache-mime4j-core-0.7.2.jar
new file mode 100644
index 0000000..b5c225b
Binary files /dev/null and b/SBsendEmail/lib/apache-mime4j-core-0.7.2.jar differ
diff --git a/SBsendEmail/lib/axiom-api-1.2.12.jar b/SBsendEmail/lib/axiom-api-1.2.12.jar
new file mode 100644
index 0000000..4ee047d
Binary files /dev/null and b/SBsendEmail/lib/axiom-api-1.2.12.jar differ
diff --git a/SBsendEmail/lib/axiom-dom-1.2.12.jar b/SBsendEmail/lib/axiom-dom-1.2.12.jar
new file mode 100644
index 0000000..b2ff444
Binary files /dev/null and b/SBsendEmail/lib/axiom-dom-1.2.12.jar differ
diff --git a/SBsendEmail/lib/axiom-impl-1.2.12.jar b/SBsendEmail/lib/axiom-impl-1.2.12.jar
new file mode 100644
index 0000000..0929d8c
Binary files /dev/null and b/SBsendEmail/lib/axiom-impl-1.2.12.jar differ
diff --git a/SBsendEmail/lib/axis2-adb-1.6.2.jar b/SBsendEmail/lib/axis2-adb-1.6.2.jar
new file mode 100644
index 0000000..6234fdb
Binary files /dev/null and b/SBsendEmail/lib/axis2-adb-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-adb-codegen-1.6.2.jar b/SBsendEmail/lib/axis2-adb-codegen-1.6.2.jar
new file mode 100644
index 0000000..7d037d4
Binary files /dev/null and b/SBsendEmail/lib/axis2-adb-codegen-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-ant-plugin-1.6.2.jar b/SBsendEmail/lib/axis2-ant-plugin-1.6.2.jar
new file mode 100644
index 0000000..771b222
Binary files /dev/null and b/SBsendEmail/lib/axis2-ant-plugin-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-clustering-1.6.2.jar b/SBsendEmail/lib/axis2-clustering-1.6.2.jar
new file mode 100644
index 0000000..e45be99
Binary files /dev/null and b/SBsendEmail/lib/axis2-clustering-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-codegen-1.6.2.jar b/SBsendEmail/lib/axis2-codegen-1.6.2.jar
new file mode 100644
index 0000000..f742f19
Binary files /dev/null and b/SBsendEmail/lib/axis2-codegen-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-corba-1.6.2.jar b/SBsendEmail/lib/axis2-corba-1.6.2.jar
new file mode 100644
index 0000000..ee3c78e
Binary files /dev/null and b/SBsendEmail/lib/axis2-corba-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-fastinfoset-1.6.2.jar b/SBsendEmail/lib/axis2-fastinfoset-1.6.2.jar
new file mode 100644
index 0000000..d10c36a
Binary files /dev/null and b/SBsendEmail/lib/axis2-fastinfoset-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-java2wsdl-1.6.2.jar b/SBsendEmail/lib/axis2-java2wsdl-1.6.2.jar
new file mode 100644
index 0000000..0bb869d
Binary files /dev/null and b/SBsendEmail/lib/axis2-java2wsdl-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-jaxbri-1.6.2.jar b/SBsendEmail/lib/axis2-jaxbri-1.6.2.jar
new file mode 100644
index 0000000..616eec9
Binary files /dev/null and b/SBsendEmail/lib/axis2-jaxbri-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-jaxws-1.6.2.jar b/SBsendEmail/lib/axis2-jaxws-1.6.2.jar
new file mode 100644
index 0000000..064351a
Binary files /dev/null and b/SBsendEmail/lib/axis2-jaxws-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-jibx-1.6.2.jar b/SBsendEmail/lib/axis2-jibx-1.6.2.jar
new file mode 100644
index 0000000..75f9d1a
Binary files /dev/null and b/SBsendEmail/lib/axis2-jibx-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-json-1.6.2.jar b/SBsendEmail/lib/axis2-json-1.6.2.jar
new file mode 100644
index 0000000..edd7936
Binary files /dev/null and b/SBsendEmail/lib/axis2-json-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-kernel-1.6.2.jar b/SBsendEmail/lib/axis2-kernel-1.6.2.jar
new file mode 100644
index 0000000..3ae5f7a
Binary files /dev/null and b/SBsendEmail/lib/axis2-kernel-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-metadata-1.6.2.jar b/SBsendEmail/lib/axis2-metadata-1.6.2.jar
new file mode 100644
index 0000000..492f1ac
Binary files /dev/null and b/SBsendEmail/lib/axis2-metadata-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-mtompolicy-1.6.2.jar b/SBsendEmail/lib/axis2-mtompolicy-1.6.2.jar
new file mode 100644
index 0000000..561e84a
Binary files /dev/null and b/SBsendEmail/lib/axis2-mtompolicy-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-saaj-1.6.2.jar b/SBsendEmail/lib/axis2-saaj-1.6.2.jar
new file mode 100644
index 0000000..c14531d
Binary files /dev/null and b/SBsendEmail/lib/axis2-saaj-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-soapmonitor-servlet-1.6.2.jar b/SBsendEmail/lib/axis2-soapmonitor-servlet-1.6.2.jar
new file mode 100644
index 0000000..276dac7
Binary files /dev/null and b/SBsendEmail/lib/axis2-soapmonitor-servlet-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-spring-1.6.2.jar b/SBsendEmail/lib/axis2-spring-1.6.2.jar
new file mode 100644
index 0000000..30b9baa
Binary files /dev/null and b/SBsendEmail/lib/axis2-spring-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-transport-http-1.6.2.jar b/SBsendEmail/lib/axis2-transport-http-1.6.2.jar
new file mode 100644
index 0000000..b1dad78
Binary files /dev/null and b/SBsendEmail/lib/axis2-transport-http-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-transport-local-1.6.2.jar b/SBsendEmail/lib/axis2-transport-local-1.6.2.jar
new file mode 100644
index 0000000..34a7073
Binary files /dev/null and b/SBsendEmail/lib/axis2-transport-local-1.6.2.jar differ
diff --git a/SBsendEmail/lib/axis2-xmlbeans-1.6.2.jar b/SBsendEmail/lib/axis2-xmlbeans-1.6.2.jar
new file mode 100644
index 0000000..58fba9b
Binary files /dev/null and b/SBsendEmail/lib/axis2-xmlbeans-1.6.2.jar differ
diff --git a/SBsendEmail/lib/bcel-5.1.jar b/SBsendEmail/lib/bcel-5.1.jar
new file mode 100644
index 0000000..524e375
Binary files /dev/null and b/SBsendEmail/lib/bcel-5.1.jar differ
diff --git a/SBsendEmail/lib/cn.com.origin.autocode_1.0.0.jar b/SBsendEmail/lib/cn.com.origin.autocode_1.0.0.jar
new file mode 100644
index 0000000..8de9029
Binary files /dev/null and b/SBsendEmail/lib/cn.com.origin.autocode_1.0.0.jar differ
diff --git a/SBsendEmail/lib/cn.com.origin.autocodemanager_1.0.0.jar b/SBsendEmail/lib/cn.com.origin.autocodemanager_1.0.0.jar
new file mode 100644
index 0000000..9e1d54e
Binary files /dev/null and b/SBsendEmail/lib/cn.com.origin.autocodemanager_1.0.0.jar differ
diff --git a/SBsendEmail/lib/com.teamcenter.rac.aifrcp_12000.2.0.jar b/SBsendEmail/lib/com.teamcenter.rac.aifrcp_12000.2.0.jar
new file mode 100644
index 0000000..f1cfb20
Binary files /dev/null and b/SBsendEmail/lib/com.teamcenter.rac.aifrcp_12000.2.0.jar differ
diff --git a/SBsendEmail/lib/com.teamcenter.rac.workflow_12000.2.0.jar b/SBsendEmail/lib/com.teamcenter.rac.workflow_12000.2.0.jar
new file mode 100644
index 0000000..af8e377
Binary files /dev/null and b/SBsendEmail/lib/com.teamcenter.rac.workflow_12000.2.0.jar differ
diff --git a/SBsendEmail/lib/commons-beanutils-1.7.0.jar b/SBsendEmail/lib/commons-beanutils-1.7.0.jar
new file mode 100644
index 0000000..b1b89c9
Binary files /dev/null and b/SBsendEmail/lib/commons-beanutils-1.7.0.jar differ
diff --git a/SBsendEmail/lib/commons-cli-1.2.jar b/SBsendEmail/lib/commons-cli-1.2.jar
new file mode 100644
index 0000000..ce4b9ff
Binary files /dev/null and b/SBsendEmail/lib/commons-cli-1.2.jar differ
diff --git a/SBsendEmail/lib/commons-codec-1.3.jar b/SBsendEmail/lib/commons-codec-1.3.jar
new file mode 100644
index 0000000..957b675
Binary files /dev/null and b/SBsendEmail/lib/commons-codec-1.3.jar differ
diff --git a/SBsendEmail/lib/commons-codec-1.9.jar b/SBsendEmail/lib/commons-codec-1.9.jar
new file mode 100644
index 0000000..ef35f1c
Binary files /dev/null and b/SBsendEmail/lib/commons-codec-1.9.jar differ
diff --git a/SBsendEmail/lib/commons-collections-3.2.jar b/SBsendEmail/lib/commons-collections-3.2.jar
new file mode 100644
index 0000000..75580be
Binary files /dev/null and b/SBsendEmail/lib/commons-collections-3.2.jar differ
diff --git a/SBsendEmail/lib/commons-fileupload-1.2.jar b/SBsendEmail/lib/commons-fileupload-1.2.jar
new file mode 100644
index 0000000..12539f5
Binary files /dev/null and b/SBsendEmail/lib/commons-fileupload-1.2.jar differ
diff --git a/SBsendEmail/lib/commons-httpclient-3.1.jar b/SBsendEmail/lib/commons-httpclient-3.1.jar
new file mode 100644
index 0000000..7c59774
Binary files /dev/null and b/SBsendEmail/lib/commons-httpclient-3.1.jar differ
diff --git a/SBsendEmail/lib/commons-httpclient-contrib-3.1.jar b/SBsendEmail/lib/commons-httpclient-contrib-3.1.jar
new file mode 100644
index 0000000..af5c5de
Binary files /dev/null and b/SBsendEmail/lib/commons-httpclient-contrib-3.1.jar differ
diff --git a/SBsendEmail/lib/commons-io-1.4.jar b/SBsendEmail/lib/commons-io-1.4.jar
new file mode 100644
index 0000000..133dc6c
Binary files /dev/null and b/SBsendEmail/lib/commons-io-1.4.jar differ
diff --git a/SBsendEmail/lib/commons-lang-2.4.jar b/SBsendEmail/lib/commons-lang-2.4.jar
new file mode 100644
index 0000000..532939e
Binary files /dev/null and b/SBsendEmail/lib/commons-lang-2.4.jar differ
diff --git a/SBsendEmail/lib/commons-lang3-3.12.0.jar b/SBsendEmail/lib/commons-lang3-3.12.0.jar
new file mode 100644
index 0000000..4d434a2
Binary files /dev/null and b/SBsendEmail/lib/commons-lang3-3.12.0.jar differ
diff --git a/SBsendEmail/lib/commons-logging-1.1.1.jar b/SBsendEmail/lib/commons-logging-1.1.1.jar
new file mode 100644
index 0000000..1deef14
Binary files /dev/null and b/SBsendEmail/lib/commons-logging-1.1.1.jar differ
diff --git a/SBsendEmail/lib/commons-logging-1.1.jar b/SBsendEmail/lib/commons-logging-1.1.jar
new file mode 100644
index 0000000..2ff9bbd
Binary files /dev/null and b/SBsendEmail/lib/commons-logging-1.1.jar differ
diff --git a/SBsendEmail/lib/commons-logging-1.2.jar b/SBsendEmail/lib/commons-logging-1.2.jar
new file mode 100644
index 0000000..93a3b9f
Binary files /dev/null and b/SBsendEmail/lib/commons-logging-1.2.jar differ
diff --git a/SBsendEmail/lib/commons-logging.jar b/SBsendEmail/lib/commons-logging.jar
new file mode 100644
index 0000000..b73a80f
Binary files /dev/null and b/SBsendEmail/lib/commons-logging.jar differ
diff --git a/SBsendEmail/lib/commons-net-3.6-sources.jar b/SBsendEmail/lib/commons-net-3.6-sources.jar
new file mode 100644
index 0000000..3e0acce
Binary files /dev/null and b/SBsendEmail/lib/commons-net-3.6-sources.jar differ
diff --git a/SBsendEmail/lib/commons-net-3.6.jar b/SBsendEmail/lib/commons-net-3.6.jar
new file mode 100644
index 0000000..4537623
Binary files /dev/null and b/SBsendEmail/lib/commons-net-3.6.jar differ
diff --git a/SBsendEmail/lib/commons-net-examples-3.6.jar b/SBsendEmail/lib/commons-net-examples-3.6.jar
new file mode 100644
index 0000000..27a9969
Binary files /dev/null and b/SBsendEmail/lib/commons-net-examples-3.6.jar differ
diff --git a/SBsendEmail/lib/dom4j-1.6.1.jar b/SBsendEmail/lib/dom4j-1.6.1.jar
new file mode 100644
index 0000000..c8c4dbb
Binary files /dev/null and b/SBsendEmail/lib/dom4j-1.6.1.jar differ
diff --git a/SBsendEmail/lib/ezmorph-1.0.4.jar b/SBsendEmail/lib/ezmorph-1.0.4.jar
new file mode 100644
index 0000000..7625af6
Binary files /dev/null and b/SBsendEmail/lib/ezmorph-1.0.4.jar differ
diff --git a/SBsendEmail/lib/fccjavaclientproxy.jar b/SBsendEmail/lib/fccjavaclientproxy.jar
new file mode 100644
index 0000000..365a165
Binary files /dev/null and b/SBsendEmail/lib/fccjavaclientproxy.jar differ
diff --git a/SBsendEmail/lib/fmsclientcache.jar b/SBsendEmail/lib/fmsclientcache.jar
new file mode 100644
index 0000000..ddd9f59
Binary files /dev/null and b/SBsendEmail/lib/fmsclientcache.jar differ
diff --git a/SBsendEmail/lib/fmsservercache.jar b/SBsendEmail/lib/fmsservercache.jar
new file mode 100644
index 0000000..5db715d
Binary files /dev/null and b/SBsendEmail/lib/fmsservercache.jar differ
diff --git a/SBsendEmail/lib/fmsutil.jar b/SBsendEmail/lib/fmsutil.jar
new file mode 100644
index 0000000..7a51893
Binary files /dev/null and b/SBsendEmail/lib/fmsutil.jar differ
diff --git a/SBsendEmail/lib/fscjavaclientproxy.jar b/SBsendEmail/lib/fscjavaclientproxy.jar
new file mode 100644
index 0000000..822203c
Binary files /dev/null and b/SBsendEmail/lib/fscjavaclientproxy.jar differ
diff --git a/SBsendEmail/lib/geronimo-annotation_1.0_spec-1.1.jar b/SBsendEmail/lib/geronimo-annotation_1.0_spec-1.1.jar
new file mode 100644
index 0000000..7a6f529
Binary files /dev/null and b/SBsendEmail/lib/geronimo-annotation_1.0_spec-1.1.jar differ
diff --git a/SBsendEmail/lib/geronimo-jaxws_2.2_spec-1.0.jar b/SBsendEmail/lib/geronimo-jaxws_2.2_spec-1.0.jar
new file mode 100644
index 0000000..888f839
Binary files /dev/null and b/SBsendEmail/lib/geronimo-jaxws_2.2_spec-1.0.jar differ
diff --git a/SBsendEmail/lib/geronimo-jta_1.1_spec-1.1.jar b/SBsendEmail/lib/geronimo-jta_1.1_spec-1.1.jar
new file mode 100644
index 0000000..bba9290
Binary files /dev/null and b/SBsendEmail/lib/geronimo-jta_1.1_spec-1.1.jar differ
diff --git a/SBsendEmail/lib/geronimo-saaj_1.3_spec-1.0.1.jar b/SBsendEmail/lib/geronimo-saaj_1.3_spec-1.0.1.jar
new file mode 100644
index 0000000..b2f6e81
Binary files /dev/null and b/SBsendEmail/lib/geronimo-saaj_1.3_spec-1.0.1.jar differ
diff --git a/SBsendEmail/lib/geronimo-stax-api_1.0_spec-1.0.1.jar b/SBsendEmail/lib/geronimo-stax-api_1.0_spec-1.0.1.jar
new file mode 100644
index 0000000..ab1ee3b
Binary files /dev/null and b/SBsendEmail/lib/geronimo-stax-api_1.0_spec-1.0.1.jar differ
diff --git a/SBsendEmail/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar b/SBsendEmail/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar
new file mode 100644
index 0000000..c8a795a
Binary files /dev/null and b/SBsendEmail/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar differ
diff --git a/SBsendEmail/lib/gson-2.8.5.jar b/SBsendEmail/lib/gson-2.8.5.jar
new file mode 100644
index 0000000..0d5baf3
Binary files /dev/null and b/SBsendEmail/lib/gson-2.8.5.jar differ
diff --git a/SBsendEmail/lib/httpclient-4.5.2.jar b/SBsendEmail/lib/httpclient-4.5.2.jar
new file mode 100644
index 0000000..701609f
Binary files /dev/null and b/SBsendEmail/lib/httpclient-4.5.2.jar differ
diff --git a/SBsendEmail/lib/httpcore-4.0.jar b/SBsendEmail/lib/httpcore-4.0.jar
new file mode 100644
index 0000000..37eb7d4
Binary files /dev/null and b/SBsendEmail/lib/httpcore-4.0.jar differ
diff --git a/SBsendEmail/lib/httpcore-4.4.4.jar b/SBsendEmail/lib/httpcore-4.4.4.jar
new file mode 100644
index 0000000..ac4a877
Binary files /dev/null and b/SBsendEmail/lib/httpcore-4.4.4.jar differ
diff --git a/SBsendEmail/lib/httpmime-4.5.2.jar b/SBsendEmail/lib/httpmime-4.5.2.jar
new file mode 100644
index 0000000..474670a
Binary files /dev/null and b/SBsendEmail/lib/httpmime-4.5.2.jar differ
diff --git a/SBsendEmail/lib/iText-5.0.2.jar b/SBsendEmail/lib/iText-5.0.2.jar
new file mode 100644
index 0000000..ed95653
Binary files /dev/null and b/SBsendEmail/lib/iText-5.0.2.jar differ
diff --git a/SBsendEmail/lib/iTextAsian.jar b/SBsendEmail/lib/iTextAsian.jar
new file mode 100644
index 0000000..3fa2157
Binary files /dev/null and b/SBsendEmail/lib/iTextAsian.jar differ
diff --git a/SBsendEmail/lib/itext-2.0.3.jar b/SBsendEmail/lib/itext-2.0.3.jar
new file mode 100644
index 0000000..9c6179d
Binary files /dev/null and b/SBsendEmail/lib/itext-2.0.3.jar differ
diff --git a/SBsendEmail/lib/jacorb.jar b/SBsendEmail/lib/jacorb.jar
new file mode 100644
index 0000000..72bff94
Binary files /dev/null and b/SBsendEmail/lib/jacorb.jar differ
diff --git a/SBsendEmail/lib/jalopy-1.5rc3.jar b/SBsendEmail/lib/jalopy-1.5rc3.jar
new file mode 100644
index 0000000..fe51ce2
Binary files /dev/null and b/SBsendEmail/lib/jalopy-1.5rc3.jar differ
diff --git a/SBsendEmail/lib/jaxb-api-2.1.jar b/SBsendEmail/lib/jaxb-api-2.1.jar
new file mode 100644
index 0000000..be3d6dc
Binary files /dev/null and b/SBsendEmail/lib/jaxb-api-2.1.jar differ
diff --git a/SBsendEmail/lib/jaxb-impl-2.1.7.jar b/SBsendEmail/lib/jaxb-impl-2.1.7.jar
new file mode 100644
index 0000000..034c158
Binary files /dev/null and b/SBsendEmail/lib/jaxb-impl-2.1.7.jar differ
diff --git a/SBsendEmail/lib/jaxb-xjc-2.1.7.jar b/SBsendEmail/lib/jaxb-xjc-2.1.7.jar
new file mode 100644
index 0000000..ba2ec46
Binary files /dev/null and b/SBsendEmail/lib/jaxb-xjc-2.1.7.jar differ
diff --git a/SBsendEmail/lib/jaxen-1.1.6.jar b/SBsendEmail/lib/jaxen-1.1.6.jar
new file mode 100644
index 0000000..52f47a4
Binary files /dev/null and b/SBsendEmail/lib/jaxen-1.1.6.jar differ
diff --git a/SBsendEmail/lib/jaxws-tools-2.1.3.jar b/SBsendEmail/lib/jaxws-tools-2.1.3.jar
new file mode 100644
index 0000000..1006bfd
Binary files /dev/null and b/SBsendEmail/lib/jaxws-tools-2.1.3.jar differ
diff --git a/SBsendEmail/lib/jdom.jar b/SBsendEmail/lib/jdom.jar
new file mode 100644
index 0000000..65a1b3f
Binary files /dev/null and b/SBsendEmail/lib/jdom.jar differ
diff --git a/SBsendEmail/lib/jettison-1.0-RC2.jar b/SBsendEmail/lib/jettison-1.0-RC2.jar
new file mode 100644
index 0000000..3a00ed2
Binary files /dev/null and b/SBsendEmail/lib/jettison-1.0-RC2.jar differ
diff --git a/SBsendEmail/lib/jibx-bind-1.2.jar b/SBsendEmail/lib/jibx-bind-1.2.jar
new file mode 100644
index 0000000..c8d3887
Binary files /dev/null and b/SBsendEmail/lib/jibx-bind-1.2.jar differ
diff --git a/SBsendEmail/lib/jibx-run-1.2.jar b/SBsendEmail/lib/jibx-run-1.2.jar
new file mode 100644
index 0000000..6b467d3
Binary files /dev/null and b/SBsendEmail/lib/jibx-run-1.2.jar differ
diff --git a/SBsendEmail/lib/json-lib-2.2.2-jdk15.jar b/SBsendEmail/lib/json-lib-2.2.2-jdk15.jar
new file mode 100644
index 0000000..27e7c7c
Binary files /dev/null and b/SBsendEmail/lib/json-lib-2.2.2-jdk15.jar differ
diff --git a/SBsendEmail/lib/json-lib-2.2.3-jdk13.jar b/SBsendEmail/lib/json-lib-2.2.3-jdk13.jar
new file mode 100644
index 0000000..a6513db
Binary files /dev/null and b/SBsendEmail/lib/json-lib-2.2.3-jdk13.jar differ
diff --git a/SBsendEmail/lib/jsr311-api-1.0.jar b/SBsendEmail/lib/jsr311-api-1.0.jar
new file mode 100644
index 0000000..2bede66
Binary files /dev/null and b/SBsendEmail/lib/jsr311-api-1.0.jar differ
diff --git a/SBsendEmail/lib/juli-6.0.16.jar b/SBsendEmail/lib/juli-6.0.16.jar
new file mode 100644
index 0000000..c3fe977
Binary files /dev/null and b/SBsendEmail/lib/juli-6.0.16.jar differ
diff --git a/SBsendEmail/lib/k.util_1.0.0.jar b/SBsendEmail/lib/k.util_1.0.0.jar
new file mode 100644
index 0000000..a38eab4
Binary files /dev/null and b/SBsendEmail/lib/k.util_1.0.0.jar differ
diff --git a/SBsendEmail/lib/log4j-1.2.15.jar b/SBsendEmail/lib/log4j-1.2.15.jar
new file mode 100644
index 0000000..c930a6a
Binary files /dev/null and b/SBsendEmail/lib/log4j-1.2.15.jar differ
diff --git a/SBsendEmail/lib/log4j-api-2.8.2.jar b/SBsendEmail/lib/log4j-api-2.8.2.jar
new file mode 100644
index 0000000..9694c29
Binary files /dev/null and b/SBsendEmail/lib/log4j-api-2.8.2.jar differ
diff --git a/SBsendEmail/lib/log4j-core-2.8.2.jar b/SBsendEmail/lib/log4j-core-2.8.2.jar
new file mode 100644
index 0000000..eb658af
Binary files /dev/null and b/SBsendEmail/lib/log4j-core-2.8.2.jar differ
diff --git a/SBsendEmail/lib/logkit.jar b/SBsendEmail/lib/logkit.jar
new file mode 100644
index 0000000..67d4866
Binary files /dev/null and b/SBsendEmail/lib/logkit.jar differ
diff --git a/SBsendEmail/lib/mail-1.4.jar b/SBsendEmail/lib/mail-1.4.jar
new file mode 100644
index 0000000..fd4555b
Binary files /dev/null and b/SBsendEmail/lib/mail-1.4.jar differ
diff --git a/SBsendEmail/lib/mex-1.6.2-impl.jar b/SBsendEmail/lib/mex-1.6.2-impl.jar
new file mode 100644
index 0000000..ed67cf3
Binary files /dev/null and b/SBsendEmail/lib/mex-1.6.2-impl.jar differ
diff --git a/SBsendEmail/lib/neethi-3.0.2.jar b/SBsendEmail/lib/neethi-3.0.2.jar
new file mode 100644
index 0000000..383efde
Binary files /dev/null and b/SBsendEmail/lib/neethi-3.0.2.jar differ
diff --git a/SBsendEmail/lib/ojdbc6.jar b/SBsendEmail/lib/ojdbc6.jar
new file mode 100644
index 0000000..ec3d6f1
Binary files /dev/null and b/SBsendEmail/lib/ojdbc6.jar differ
diff --git a/SBsendEmail/lib/org.apache.commons.httpclient.jar b/SBsendEmail/lib/org.apache.commons.httpclient.jar
new file mode 100644
index 0000000..09fe533
Binary files /dev/null and b/SBsendEmail/lib/org.apache.commons.httpclient.jar differ
diff --git a/SBsendEmail/lib/regexp-1.2.jar b/SBsendEmail/lib/regexp-1.2.jar
new file mode 100644
index 0000000..713441c
Binary files /dev/null and b/SBsendEmail/lib/regexp-1.2.jar differ
diff --git a/SBsendEmail/lib/resolver.jar b/SBsendEmail/lib/resolver.jar
new file mode 100644
index 0000000..073d789
Binary files /dev/null and b/SBsendEmail/lib/resolver.jar differ
diff --git a/SBsendEmail/lib/tcgatewaystubs.jar b/SBsendEmail/lib/tcgatewaystubs.jar
new file mode 100644
index 0000000..72feb84
Binary files /dev/null and b/SBsendEmail/lib/tcgatewaystubs.jar differ
diff --git a/SBsendEmail/lib/tribes-6.0.16.jar b/SBsendEmail/lib/tribes-6.0.16.jar
new file mode 100644
index 0000000..bb85de1
Binary files /dev/null and b/SBsendEmail/lib/tribes-6.0.16.jar differ
diff --git a/SBsendEmail/lib/woden-api-1.0M9.jar b/SBsendEmail/lib/woden-api-1.0M9.jar
new file mode 100644
index 0000000..3b07e8e
Binary files /dev/null and b/SBsendEmail/lib/woden-api-1.0M9.jar differ
diff --git a/SBsendEmail/lib/woden-impl-commons-1.0M9.jar b/SBsendEmail/lib/woden-impl-commons-1.0M9.jar
new file mode 100644
index 0000000..f99c8d7
Binary files /dev/null and b/SBsendEmail/lib/woden-impl-commons-1.0M9.jar differ
diff --git a/SBsendEmail/lib/woden-impl-dom-1.0M9.jar b/SBsendEmail/lib/woden-impl-dom-1.0M9.jar
new file mode 100644
index 0000000..0e3fff5
Binary files /dev/null and b/SBsendEmail/lib/woden-impl-dom-1.0M9.jar differ
diff --git a/SBsendEmail/lib/wsdl4j-1.6.2.jar b/SBsendEmail/lib/wsdl4j-1.6.2.jar
new file mode 100644
index 0000000..b9ffc36
Binary files /dev/null and b/SBsendEmail/lib/wsdl4j-1.6.2.jar differ
diff --git a/SBsendEmail/lib/wstx-asl-3.2.9.jar b/SBsendEmail/lib/wstx-asl-3.2.9.jar
new file mode 100644
index 0000000..ffdbd1f
Binary files /dev/null and b/SBsendEmail/lib/wstx-asl-3.2.9.jar differ
diff --git a/SBsendEmail/lib/xalan-2.7.0.jar b/SBsendEmail/lib/xalan-2.7.0.jar
new file mode 100644
index 0000000..007be39
Binary files /dev/null and b/SBsendEmail/lib/xalan-2.7.0.jar differ
diff --git a/SBsendEmail/lib/xerces.jar b/SBsendEmail/lib/xerces.jar
new file mode 100644
index 0000000..33990e8
Binary files /dev/null and b/SBsendEmail/lib/xerces.jar differ
diff --git a/SBsendEmail/lib/xercesImpl.jar b/SBsendEmail/lib/xercesImpl.jar
new file mode 100644
index 0000000..33990e8
Binary files /dev/null and b/SBsendEmail/lib/xercesImpl.jar differ
diff --git a/SBsendEmail/lib/xml-apis.jar b/SBsendEmail/lib/xml-apis.jar
new file mode 100644
index 0000000..b338fb6
Binary files /dev/null and b/SBsendEmail/lib/xml-apis.jar differ
diff --git a/SBsendEmail/lib/xml-resolver-1.2.jar b/SBsendEmail/lib/xml-resolver-1.2.jar
new file mode 100644
index 0000000..e535bdc
Binary files /dev/null and b/SBsendEmail/lib/xml-resolver-1.2.jar differ
diff --git a/SBsendEmail/lib/xmlbeans-2.3.0.jar b/SBsendEmail/lib/xmlbeans-2.3.0.jar
new file mode 100644
index 0000000..ccd8163
Binary files /dev/null and b/SBsendEmail/lib/xmlbeans-2.3.0.jar differ
diff --git a/SBsendEmail/src/com/cn/sb/sendMail/MainClassSendMail.java b/SBsendEmail/src/com/cn/sb/sendMail/MainClassSendMail.java
new file mode 100644
index 0000000..d951c41
--- /dev/null
+++ b/SBsendEmail/src/com/cn/sb/sendMail/MainClassSendMail.java
@@ -0,0 +1,342 @@
+package com.cn.sb.sendMail;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeFormatterBuilder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.cn.sb.sendMail.entity.DingTalkResponse;
+import com.cn.sb.sendMail.entity.Propty;
+import com.cn.sb.sendMail.util.EnvelopeManagement;
+import com.cn.sb.sendMail.util.Utils;
+import com.teamcenter.clientx.AppXSession;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonSyntaxException;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.List;
+
+import static java.time.format.DateTimeFormatter.ofPattern;
+
+public class MainClassSendMail {
+
+ static String sql = "SELECT POM.FROM_UID puid,PWORK.POBJECT_TYPE ptype,PWORK.POBJECT_NAME objname,PART.psb6_ifls isLs,PART.psb6_creator creator,PART.psb6_validuntil validDate,ppom.ROWNING_USERU owner\r\n"
+ + "FROM pom_backpointer POM\r\n"
+ + "INNER JOIN pdesignVerMaster PART ON PART.PUID = POM.TO_UID\r\n"
+ + "INNER JOIN Pworkspaceobject PWORK ON PWORK.PUID = POM.FROM_UID\r\n"
+ + "INNER JOIN ppom_application_object ppom on ppom.PUID = POM.FROM_UID\r\n"
+ + "WHERE psb6_ifls is not null \r\n"
+ + "AND POBJECT_TYPE IN (\r\n"
+ + "'SB6_CatiaDesignXRevisionMaster', 'SB6_AutocadDXRevisionMaster', 'SB6_CatiaAssDXRevisionMaster',\r\n"
+ + "'SB6_CatiaSDXRevisionMaster', 'SB6_AutocadAssDXRevisionMaster', 'SB6_AutocadSDXRevisionMaster',\r\n"
+ + "'SB6_CatiaDesignLRevisionMaster', 'SB6_AutocadDLRevisionMaster', 'SB6_CatiaAssDLRevisionMaster',\r\n"
+ + "'SB6_CatiaSDLRevisionMaster', 'SB6_AutocadAssDLRevisionMaster', 'SB6_AutocadSDLRevisionMaster',\r\n"
+ + "'SB6_PItemRevisionMaster')\r\n"
+ + "AND psb6_validuntil is not null ";
+
+ public static void main(String[] args) {
+ // 检查格式正确否
+ if(args==null || args.length !=3) {
+ System.out.println("格式不正确!");
+ return;
+ }
+ String userId = args[0];
+ String passWord = args[1];
+ String deadlineDaysStr = args[2];
+
+ // 获取当前日期
+ LocalDate currentDate = LocalDate.now();
+ // 加天
+ LocalDate newDate = currentDate.plusDays(Integer.parseInt(deadlineDaysStr));
+
+ // 格式化输出(可选)
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+ String newDateStr = newDate.format(formatter);
+
+ System.out.println("开始登录");
+ // 格式正确,开始登录TC
+ AppXSession session = new AppXSession("http://127.0.0.1:7001/tc",userId,passWord);
+ System.out.println("登录成功");
+
+ try {
+ // 登录成功,连接数据库
+ System.out.println("登录成功,连接数据库");
+ Connection connection = connectOracle();
+ System.out.println("连接数据库成功");
+
+ // 连接数据库成功,获取需要发送的人员信息
+ Map> map = getSqlMessage(connection,deadlineDaysStr);
+
+ if (map.size() == 0) {
+ // 退出登录
+ System.out.println("无过期时间!");
+ session.logout();
+ return;
+ }
+ System.out.println("发送邮件");
+
+ Set keySet = map.keySet();
+ // 发送邮件
+ EnvelopeManagement em = new EnvelopeManagement();
+
+ String webhookUrl = "fa5b9de905dd4e2297aeded759fef800df7cab1c62fddd16ec2c27261e909b56";
+ String secret = "SECd7d0bbfacbac04112be4195c65cf4f6dee3d1a4052df7ba44241c633a0b17e31";
+ webhookUrl = signUrl(webhookUrl, secret);
+
+ for (String creator : keySet) {
+ List list = map.get(creator);
+ String userUID = "";
+ if(list!=null && list.size()>=1) {
+ userUID = list.get(0).getOwner();
+ }
+ String mailMessage = jugdeIfSendMail(list);
+ String message = mailMessage + " 将于" + newDateStr + "到期,请及时处理";
+ String tcTheme = mailMessage + " 到期提醒";
+ System.out.println("creator : "+ creator);
+ System.out.println("userUID : "+ userUID);
+ System.out.println("message : "+ message);
+ System.out.println("tcTheme : "+ tcTheme);
+ if(!userUID.isEmpty()) {
+ em.create(tcTheme, message, userUID, null, null);
+ }
+ try {
+// ArrayList list = new ArrayList<>();
+// list.add("18110541580");
+ sendTextMessage(webhookUrl, message, true, null);
+ System.out.println("消息发送成功");
+ } catch (IOException e) {
+ System.err.println("消息发送失败: " + e.getMessage());
+ }
+ }
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // 退出登录
+ session.logout();
+ }
+
+ public static String jugdeIfSendMail(List list) {
+ StringBuffer message1 = new StringBuffer();
+ StringBuffer message2 = new StringBuffer();
+ StringBuffer message = new StringBuffer();
+ boolean flag1 = false;
+ boolean flag2 = false;
+ message1.append("物料:");
+ message2.append(" 图纸:");
+ for (int i = 0; i < list.size(); i++) {
+ Propty propty = list.get(i);
+ if (propty.getPtype().equals("SB6_PItemRevisionMaster")) {
+ flag1 = true;
+ message1.append(propty.getObjName());
+ message1.append("、");
+ } else {
+ flag2 = true;
+ message2.append(propty.getObjName());
+ message2.append("、");
+ }
+ }
+
+ if (flag1) {
+ if (flag2) {
+ message.append(message1.substring(0, message1.length() - 1).toString());
+ message.append(message2.substring(0, message2.length() - 1).toString());
+
+ } else {
+ message.append(message1.substring(0, message1.length() - 1).toString());
+ }
+ } else {
+ if (flag2) {
+ message.append(message2.substring(0, message2.length() - 1).toString());
+ } else {
+ return "";
+ }
+ }
+ return message.toString();
+ }
+
+ public static boolean validateDeadline(String targetDateTimeStr, String deadlineDaysStr) {
+ try {
+ // 日期解析与转换
+ DateTimeFormatter formatter = new DateTimeFormatterBuilder()
+ .appendPattern("yyyy-MM-dd")
+ .appendOptional(ofPattern(" ")) // 双空格
+ .appendOptional(ofPattern(" ")) // 单空格
+ .appendPattern("HH:mm:ss.S")
+ .toFormatter();
+ LocalDateTime targetDateTime = LocalDateTime.parse(targetDateTimeStr, formatter);
+ LocalDate targetDate = targetDateTime.toLocalDate();
+
+ // 天数有效性验证
+ int daysToAdd = Integer.parseInt(deadlineDaysStr);
+ if (daysToAdd < 0) throw new IllegalArgumentException("天数不能为负");
+
+ // 时间计算与对比
+ LocalDate currentDate = LocalDate.now();
+ return currentDate.plusDays(daysToAdd).isEqual(targetDate);
+ } catch (NumberFormatException e) {
+ System.err.println(" 错误:天数参数需为整数");
+ return false;
+ } catch (Exception e) {
+ System.err.println(" 日期格式错误:" + e.getMessage());
+ return false;
+ }
+ }
+
+ private static Map> getSqlMessage(Connection connection,String deadlineDaysStr) throws SQLException {
+ // TODO Auto-generated method stub
+ PreparedStatement pstmt = connection.prepareStatement(sql);
+ ResultSet rs = pstmt.executeQuery();
+
+ Map> map = new HashMap<>();
+ while (rs.next()) {
+ String puid = rs.getString("puid");
+ String type = rs.getString("ptype");
+ String objName = rs.getString("objname");
+ String isLs = rs.getString("isLs");
+ String creator = rs.getString("creator");
+ String validDate = rs.getString("validDate");
+ String ownerUID = rs.getString("owner");
+
+ System.out.println("puid=" + puid + " || type=" + type + " || objName=" + objName + " || isLs=" + isLs
+ + " || creator=" + creator + " || validDate=" + validDate+ " || ownerUID=" + ownerUID);
+
+ if (creator !=null && !creator.isEmpty() && validateDeadline(validDate,deadlineDaysStr)) {
+ Propty propty = new Propty(puid, type, objName, isLs, creator, validDate,ownerUID);
+ List list = map.get(creator);
+ if (list == null) {
+ list = new ArrayList<>();
+ }
+ list.add(propty);
+ map.put(creator, list);
+ }
+ }
+ return map;
+ }
+
+ public static void login(AppXSession session, String userId, String passWord) {
+ try {
+ Utils.writeLog("发送邮件", "登录tc准备发邮件");
+ session.mylogin(userId, passWord);
+ Utils.writeLog("发送邮件", "邮件发送完毕");
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public static Connection connectOracle() throws ClassNotFoundException, SQLException {
+ Class.forName("oracle.jdbc.driver.OracleDriver");
+ // 建立连接,这里假设服务名为ORCLCDB,用户名是system,密码是password
+ String url = "jdbc:oracle:thin:@192.168.78.131:1521:tc12";
+ System.out.println("成功连接到Oracle数据库");
+ return DriverManager.getConnection(url, "infodba", "infodba");
+ }
+
+ /**
+ * 发送钉钉机器人消息
+ *
+ * @param webhookUrl 钉钉机器人Webhook地址
+ * @param content 消息内容
+ * @param atAll 是否@全体成员
+ * @param atMobiles 需要@的成员手机号列表(可选)
+ * @throws IOException 网络或IO异常
+ */
+ public static void sendTextMessage(String webhookUrl, String content,
+ boolean atAll, List atMobiles) throws IOException {
+ // 1. 构造消息体
+ JsonObject text = new JsonObject();
+ text.addProperty("content", content);
+
+ JsonObject at = new JsonObject();
+ at.addProperty("isAtAll", atAll);
+ if (atMobiles != null && !atMobiles.isEmpty()) {
+ at.add("atMobiles", new Gson().toJsonTree(atMobiles));
+ }
+
+ JsonObject message = new JsonObject();
+ message.addProperty("msgtype", "text");
+ message.add("text", text);
+ message.add("at", at);
+
+ // 2. 发送HTTP POST请求
+ URL url = new URL(webhookUrl);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
+ conn.setDoOutput(true);
+
+ try (OutputStream os = conn.getOutputStream()) {
+ os.write(message.toString().getBytes(StandardCharsets.UTF_8));
+ }
+
+ // 3. 处理响应
+ int code = conn.getResponseCode();
+ if (code != HttpURLConnection.HTTP_OK) {
+ throw new IOException("请求失败,HTTP状态码: " + code);
+ }
+
+ try (BufferedReader br = new BufferedReader(
+ new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
+ StringBuilder response = new StringBuilder();
+ String line;
+ while ((line = br.readLine()) != null) {
+ response.append(line);
+ }
+ Gson gson = new GsonBuilder()
+ .disableHtmlEscaping() // 关闭HTML转义(保障特殊字符显示)
+ .create();
+
+ try {
+ // 类型安全解析(自动处理Unicode/特殊符号)
+ DingTalkResponse result = gson.fromJson(response.toString(), DingTalkResponse.class);
+
+ if (result.getErrCode() != 0) {
+ throw new IOException(String.format(" 钉钉接口异常 [%d] : %s",
+ result.getErrCode(), result.getErrMsg()));
+ }
+ } catch (JsonSyntaxException e) {
+ // 处理JSON格式错误(如字段类型不匹配)
+ throw new IOException("响应数据格式异常", e);
+ }
+ }
+ }
+
+ public static String signUrl(String accessToken, String secret) throws Exception {
+ long timestamp = System.currentTimeMillis();
+ String stringToSign = timestamp + "\n" + secret;
+
+ Mac mac = Mac.getInstance("HmacSHA256");
+ mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
+ byte[] signData = mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8));
+ String sign = URLEncoder.encode(Base64.getEncoder().encodeToString(signData), "UTF-8");
+
+ return "https://oapi.dingtalk.com/robot/send?access_token=" + accessToken
+ + "×tamp=" + timestamp + "&sign=" + sign;
+ }
+}
diff --git a/SBsendEmail/src/com/cn/sb/sendMail/ReadMe b/SBsendEmail/src/com/cn/sb/sendMail/ReadMe
new file mode 100644
index 0000000..9e1496f
--- /dev/null
+++ b/SBsendEmail/src/com/cn/sb/sendMail/ReadMe
@@ -0,0 +1 @@
+世宝:临时图纸、临时物料即将到达有效期时消息提醒(钉钉+TC内部邮件)
\ No newline at end of file
diff --git a/SBsendEmail/src/com/cn/sb/sendMail/entity/DingTalkResponse.java b/SBsendEmail/src/com/cn/sb/sendMail/entity/DingTalkResponse.java
new file mode 100644
index 0000000..02269e1
--- /dev/null
+++ b/SBsendEmail/src/com/cn/sb/sendMail/entity/DingTalkResponse.java
@@ -0,0 +1,46 @@
+package com.cn.sb.sendMail.entity;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @ClassName DingTalkResponse
+ * @Description TODO
+ * @Author chenzc
+ * @Date 2025/5/7 10:36
+ **/
+public class DingTalkResponse {
+ @SerializedName("errcode")
+ private int errCode;
+
+ @SerializedName("errmsg")
+ private String errMsg;
+
+ // 缁岀儤鐎柅鐘叉珤娣囨繈娈伴崣宥呯碍閸掓瀵
+ public DingTalkResponse() {}
+
+ // Getter閺傝纭堕惇浣烘殣閿涘湙son闁俺绻冮崣宥呯殸鐠佸潡妫剁涙顔岄敍锟
+
+ public int getErrCode() {
+ return errCode;
+ }
+
+ public void setErrCode(int errCode) {
+ this.errCode = errCode;
+ }
+
+ public String getErrMsg() {
+ return errMsg;
+ }
+
+ public void setErrMsg(String errMsg) {
+ this.errMsg = errMsg;
+ }
+
+ @Override
+ public String toString() {
+ return "DingTalkResponse{" +
+ "errCode=" + errCode +
+ ", errMsg='" + errMsg + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/SBsendEmail/src/com/cn/sb/sendMail/entity/Propty.java b/SBsendEmail/src/com/cn/sb/sendMail/entity/Propty.java
new file mode 100644
index 0000000..2c74f9b
--- /dev/null
+++ b/SBsendEmail/src/com/cn/sb/sendMail/entity/Propty.java
@@ -0,0 +1,84 @@
+package com.cn.sb.sendMail.entity;
+
+public class Propty {
+ private String puid;
+ private String ptype;
+ private String objName;
+ private String isLs;
+ private String creator;
+ private String validDate;
+ private String owner;
+
+ public Propty(String puid, String ptype, String objName, String isLs, String creator, String validDate,String owner) {
+ super();
+ this.puid = puid;
+ this.ptype = ptype;
+ this.objName = objName;
+ this.isLs = isLs;
+ this.creator = creator;
+ this.validDate = validDate;
+ this.owner = owner;
+ }
+
+ public String getPuid() {
+ return puid;
+ }
+
+ public void setPuid(String puid) {
+ this.puid = puid;
+ }
+
+ public String getIsLs() {
+ return isLs;
+ }
+
+ public void setIsLs(String isLs) {
+ this.isLs = isLs;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getValidDate() {
+ return validDate;
+ }
+
+ public void setValidDate(String validDate) {
+ this.validDate = validDate;
+ }
+
+ public String getPtype() {
+ return ptype;
+ }
+
+ public void setPtype(String ptype) {
+ this.ptype = ptype;
+ }
+
+ public String getObjName() {
+ return objName;
+ }
+
+ public void setObjName(String objName) {
+ this.objName = objName;
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ @Override
+ public String toString() {
+ return "Propty [puid=" + puid + ", ptype=" + ptype + ", objName=" + objName + ", isLs=" + isLs + ", creator="
+ + creator + ", validDate=" + validDate + ", owner=" + owner + "]";
+ }
+}
diff --git a/SBsendEmail/src/com/cn/sb/sendMail/util/EnvelopeManagement.java b/SBsendEmail/src/com/cn/sb/sendMail/util/EnvelopeManagement.java
new file mode 100644
index 0000000..f628731
--- /dev/null
+++ b/SBsendEmail/src/com/cn/sb/sendMail/util/EnvelopeManagement.java
@@ -0,0 +1,74 @@
+package com.cn.sb.sendMail.util;
+
+import com.teamcenter.clientx.AppXSession;
+import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
+import com.teamcenter.soa.client.model.ModelObject;
+import com.teamcenter.soa.client.model.ServiceData;
+import com.teamcenter.soa.client.model.strong.Envelope;
+import com.teamcenter.soa.client.model.strong.Person;
+import com.teamcenter.soa.client.model.strong.User;
+import com.teamcenter.soa.exceptions.NotLoadedException;
+import com.teamcenter.services.strong.core.DataManagementService;
+import com.teamcenter.services.strong.core.EnvelopeService;
+import com.teamcenter.services.strong.core._2008_06.DataManagement.CreateIn;
+import com.teamcenter.services.strong.core._2008_06.DataManagement.CreateInput;
+import com.teamcenter.services.strong.core._2008_06.DataManagement.CreateResponse;
+
+public class EnvelopeManagement {
+
+ public void create(String paramString1, String paramString2, String uid, String[] paramArrayOfString1,
+ String[] paramArrayOfString2) {
+ CreateResponse createResponse = null;
+ CreateIn[] arrayOfCreateIn = null;
+ CreateInput createInput = null;
+ DataManagementService dataManagementService = DataManagementService.getService(AppXSession.getConnection());
+ arrayOfCreateIn = new CreateIn[1];
+ arrayOfCreateIn[0] = new CreateIn();
+ createInput = new CreateInput();
+ createInput.stringProps.put("object_name", paramString1);
+ createInput.stringProps.put("object_desc", paramString2);
+ createInput.boName = "Envelope";
+ ServiceData data = dataManagementService.loadObjects(new String[] { uid });
+ if (data.sizeOfPlainObjects() > 0) {
+ User user = (User) data.getPlainObject(0);
+ try {
+ String name = user.get_user_name();
+ System.out.println("name===============" + name);
+ } catch (NotLoadedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (user != null) {
+ createInput.tagArrayProps.put("listOfReceivers", new ModelObject[] { user });
+ }
+ }
+ if (paramArrayOfString1 != null && paramArrayOfString1.length > 0)
+ createInput.stringArrayProps.put("fnd0ListOfExtRecipients", paramArrayOfString1);
+ if (paramArrayOfString2 != null && paramArrayOfString2.length > 0)
+ createInput.stringArrayProps.put("fnd0ListOfCcExtRecipients", paramArrayOfString2);
+ (arrayOfCreateIn[0]).data = createInput;
+ try {
+ createResponse = dataManagementService.createObjects(arrayOfCreateIn);
+ } catch (ServiceException serviceException) {
+ System.out.println("EnvelopeManagement create returned partial errors: "
+ + createResponse.serviceData.sizeOfPartialErrors());
+ }
+ Envelope e = (Envelope) (createResponse.output[0]).objects[0];
+ String uid2 = e.getUid();
+ System.out.println("uid2====================" + uid2);
+ sendAndDeleteEnvelopes(e);
+ }
+
+ public void sendAndDeleteEnvelopes(Envelope paramTCComponentEnvelope) {
+ Envelope[] arrayOfTCComponentEnvelope = new Envelope[1];
+ ServiceData serviceData = null;
+ arrayOfTCComponentEnvelope[0] = paramTCComponentEnvelope;
+ EnvelopeService envelopeService = EnvelopeService.getService(AppXSession.getConnection());
+ try {
+ serviceData = (ServiceData) envelopeService.sendAndDeleteEnvelopes(arrayOfTCComponentEnvelope);
+ } catch (Exception exception) {
+ System.out
+ .println("EnvelopeManagement create returned partial errors: " + serviceData.sizeOfPartialErrors());
+ }
+ }
+}
diff --git a/SBsendEmail/src/com/cn/sb/sendMail/util/Utils.java b/SBsendEmail/src/com/cn/sb/sendMail/util/Utils.java
new file mode 100644
index 0000000..fcd2c69
--- /dev/null
+++ b/SBsendEmail/src/com/cn/sb/sendMail/util/Utils.java
@@ -0,0 +1,38 @@
+package com.cn.sb.sendMail.util;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class Utils {
+ public static void writeLog(String filePreFix, String txt) {
+ System.out.println(txt);
+ BufferedWriter writer = null;
+ try {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+ SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
+ Date now = new Date();
+ String time = dateFormat.format(now);
+ String now1 = timeFormat.format(now);
+ String filePath = System.getenv("TEMP") + "\\" + filePreFix + "_" + time + ".txt";
+ // 获得字节数组
+ String content = "[" + now1 + "]" + txt + "\r\n";
+ writer = new BufferedWriter(new FileWriter(new File(filePath), true));
+ writer.write(content);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (writer != null) {
+ try {
+ writer.flush();
+ writer.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+}
diff --git a/SBsendEmail/src/com/teamcenter/clientx/AppXCredentialManager.java b/SBsendEmail/src/com/teamcenter/clientx/AppXCredentialManager.java
new file mode 100644
index 0000000..0e087f1
--- /dev/null
+++ b/SBsendEmail/src/com/teamcenter/clientx/AppXCredentialManager.java
@@ -0,0 +1,138 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+
+import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException;
+import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidUserException;
+import com.teamcenter.soa.client.CredentialManager;
+import com.teamcenter.soa.exceptions.CanceledOperationException;
+
+/**
+ * The CredentialManager is used by the Teamcenter Services framework to get the
+ * user's credentials when challenged by the server. This can occur after a
+ * period of inactivity and the server has timed-out the user's session, at
+ * which time the client application will need to re-authenticate. The framework
+ * will call one of the getCredentials methods (depending on circumstances) and
+ * will send the SessionService.login service request. Upon successful
+ * completion of the login service request. The last service request (one that
+ * caused the challenge) will be resent.
+ *
+ * The framework will also call the setUserPassword setGroupRole methods when
+ * ever these credentials change, thus allowing this implementation of the
+ * CredentialManager to cache these values so prompting of the user is not
+ * required for re-authentication.
+ *
+ */
+public class AppXCredentialManager implements CredentialManager {
+
+ private String name = null;
+ private String password = null;
+ private String group = ""; // default group
+ private String role = ""; // default role
+ private String discriminator = "SoaAppX"; // always connect same user
+ // to same instance of server
+
+ public AppXCredentialManager(String name, String password) {
+ super();
+ this.name = name;
+ this.password = password;
+ }
+
+ public AppXCredentialManager() {
+ super();
+ }
+
+ /**
+ * Return the type of credentials this implementation provides, standard
+ * (user/password) or Single-Sign-On. In this case Standard credentials are
+ * returned.
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#getCredentialType()
+ */
+ public int getCredentialType() {
+ return CredentialManager.CLIENT_CREDENTIAL_TYPE_STD;
+ }
+
+ /**
+ * Prompt's the user for credentials. This method will only be called by the
+ * framework when a login attempt has failed.
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException)
+ */
+ public String[] getCredentials(InvalidCredentialsException e) throws CanceledOperationException {
+ System.out.println(e.getMessage());
+ return promptForCredentials();
+ }
+
+ /**
+ * Return the cached credentials. This method will be called when a service
+ * request is sent without a valid session ( session has expired on the server).
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.InvalidUserException)
+ */
+ public String[] getCredentials(InvalidUserException e) throws CanceledOperationException {
+ // Have not logged in yet, should not happen but just in case
+ if (name == null)
+ return promptForCredentials();
+
+ // Return cached credentials
+ String[] tokens = { name, password, group, role, discriminator };
+ return tokens;
+ }
+
+ /**
+ * Cache the group and role This is called after the
+ * SessionService.setSessionGroupMember service operation is called.
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#setGroupRole(java.lang.String,
+ * java.lang.String)
+ */
+ public void setGroupRole(String group, String role) {
+ this.group = group;
+ this.role = role;
+ }
+
+ /**
+ * Cache the User and Password This is called after the SessionService.login
+ * service operation is called.
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#setUserPassword(java.lang.String,
+ * java.lang.String, java.lang.String)
+ */
+ public void setUserPassword(String user, String password, String discriminator) {
+ this.name = user;
+ this.password = password;
+ this.discriminator = discriminator;
+ }
+
+ public String[] promptForCredentials() throws CanceledOperationException {
+ try {
+ LineNumberReader reader = new LineNumberReader(new InputStreamReader(System.in));
+ System.out.println("Please enter user credentials (return to quit):");
+ System.out.print("User Name: ");
+ name = reader.readLine();
+
+ if (name.length() == 0)
+ throw new CanceledOperationException("");
+
+ System.out.print("Password: ");
+ password = reader.readLine();
+ } catch (IOException e) {
+ String message = "Failed to get the name and password.\n" + e.getMessage();
+ System.out.println(message);
+ throw new CanceledOperationException(message);
+ }
+
+ String[] tokens = { name, password, group, role, discriminator };
+ return tokens;
+ }
+
+}
diff --git a/SBsendEmail/src/com/teamcenter/clientx/AppXExceptionHandler.java b/SBsendEmail/src/com/teamcenter/clientx/AppXExceptionHandler.java
new file mode 100644
index 0000000..265b725
--- /dev/null
+++ b/SBsendEmail/src/com/teamcenter/clientx/AppXExceptionHandler.java
@@ -0,0 +1,117 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+
+import javax.transaction.SystemException;
+
+import com.teamcenter.schemas.soa._2006_03.exceptions.ConnectionException;
+import com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException;
+import com.teamcenter.schemas.soa._2006_03.exceptions.ProtocolException;
+import com.teamcenter.soa.client.ExceptionHandler;
+import com.teamcenter.soa.exceptions.CanceledOperationException;
+
+/**
+ * Implementation of the ExceptionHandler. For ConnectionExceptions (server
+ * temporarily down .etc) prompts the user to retry the last request. For other
+ * exceptions convert to a RunTime exception.
+ */
+public class AppXExceptionHandler implements ExceptionHandler
+{
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException)
+ */
+ public void handleException(InternalServerException ise)
+ {
+ System.out.println("");
+ System.out.println("*****");
+ System.out
+ .println("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(InternalServerException).");
+
+ LineNumberReader reader = new LineNumberReader(new InputStreamReader(System.in));
+
+ if (ise instanceof ConnectionException)
+ {
+ // ConnectionException are typically due to a network error (server
+ // down .etc) and can be recovered from (the last request can be sent again,
+ // after the problem is corrected).
+// System.out.print("\nThe server returned an connection error.\n" + ise.getMessage()
+// + "\nDo you wish to retry the last service request?[y/n]");
+ try {
+ throw new SystemException("\nThe server returned an connection error.\n" + ise.getMessage());
+ } catch (SystemException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ else
+ if (ise instanceof ProtocolException)
+ {
+ // ProtocolException are typically due to programming errors
+ // (content of HTTP
+ // request is incorrect). These are generally can not be
+ // recovered from.
+// System.out.print("\nThe server returned an protocol error.\n" + ise.getMessage()
+// + "\nThis is most likely the result of a programming error."
+// + "\nDo you wish to retry the last service request?[y/n]");
+ try {
+ throw new SystemException("\nThe server returned an protocol error.\n" + ise.getMessage()
+ + "\nThis is most likely the result of a programming error.");
+ } catch (SystemException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ else
+ {
+ System.out.println("\nThe server returned an internal server error.\n"
+ + ise.getMessage()
+ + "\nThis is most likely the result of a programming error."
+ + "\nA RuntimeException will be thrown.");
+ throw new RuntimeException(ise.getMessage());
+ }
+
+// try
+// {
+// String retry = reader.readLine();
+// // If yes, return to the calling SOA client framework, where the
+// // last service request will be resent.
+// if (retry.equalsIgnoreCase("y") || retry.equalsIgnoreCase("yes")) return;
+//
+// throw new RuntimeException("The user has opted not to retry the last request");
+// }
+// catch (IOException e)
+// {
+// System.err.println("Failed to read user response.\nA RuntimeException will be thrown.");
+// throw new RuntimeException(e.getMessage());
+// }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.soa.exceptions.CanceledOperationException)
+ */
+ public void handleException(CanceledOperationException coe)
+ {
+ System.out.println("");
+ System.out.println("*****");
+ System.out.println("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(CanceledOperationException).");
+
+ // Expecting this from the login tests with bad credentials, and the
+ // AnyUserCredentials class not
+ // prompting for different credentials
+ throw new RuntimeException(coe);
+ }
+
+}
diff --git a/SBsendEmail/src/com/teamcenter/clientx/AppXModelEventListener.java b/SBsendEmail/src/com/teamcenter/clientx/AppXModelEventListener.java
new file mode 100644
index 0000000..2210109
--- /dev/null
+++ b/SBsendEmail/src/com/teamcenter/clientx/AppXModelEventListener.java
@@ -0,0 +1,64 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+
+import com.teamcenter.soa.client.model.ModelEventListener;
+import com.teamcenter.soa.client.model.ModelObject;
+import com.teamcenter.soa.exceptions.NotLoadedException;
+
+/**
+ * Implementation of the ChangeListener. Print out all objects that have been updated.
+ *
+ */
+public class AppXModelEventListener extends ModelEventListener
+{
+
+ @Override
+ public void localObjectChange(ModelObject[] objects)
+ {
+
+ if (objects.length == 0) return;
+ System.out.println("");
+ System.out.println("Modified Objects handled in com.teamcenter.clientx.AppXUpdateObjectListener.modelObjectChange");
+ System.out.println("The following objects have been updated in the client data model:");
+ for (int i = 0; i < objects.length; i++)
+ {
+ String uid = objects[i].getUid();
+ String type = objects[i].getTypeObject().getName();
+ String name = "";
+ if (objects[i].getTypeObject().isInstanceOf("WorkspaceObject"))
+ {
+ ModelObject wo = objects[i];
+ try
+ {
+ name = wo.getPropertyObject("object_string").getStringValue();
+ }
+ catch (NotLoadedException e) {} // just ignore
+ }
+ System.out.println(" " + uid + " " + type + " " + name);
+ }
+ }
+
+ @Override
+ public void localObjectDelete(String[] uids)
+ {
+
+ if (uids.length == 0)
+ return;
+
+ System.out.println("");
+ System.out.println("Deleted Objects handled in com.teamcenter.clientx.AppXDeletedObjectListener.modelObjectDelete");
+ System.out.println("The following objects have been deleted from the server and removed from the client data model:");
+ for (int i = 0; i < uids.length; i++)
+ {
+ System.out.println(" " + uids[i]);
+ }
+
+ }
+
+}
diff --git a/SBsendEmail/src/com/teamcenter/clientx/AppXPartialErrorListener.java b/SBsendEmail/src/com/teamcenter/clientx/AppXPartialErrorListener.java
new file mode 100644
index 0000000..726e052
--- /dev/null
+++ b/SBsendEmail/src/com/teamcenter/clientx/AppXPartialErrorListener.java
@@ -0,0 +1,61 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+
+package com.teamcenter.clientx;
+
+import com.teamcenter.soa.client.model.ErrorStack;
+import com.teamcenter.soa.client.model.ErrorValue;
+import com.teamcenter.soa.client.model.PartialErrorListener;
+
+/**
+ * Implementation of the PartialErrorListener. Print out any partial errors
+ * returned.
+ *
+ */
+public class AppXPartialErrorListener implements PartialErrorListener
+{
+
+ @Override
+ public void handlePartialError(ErrorStack[] stacks)
+ {
+ if (stacks.length == 0) return;
+
+ System.out.println("");
+ System.out.println("*****");
+ System.out.println("Partial Errors caught in com.teamcenter.clientx.AppXPartialErrorListener.");
+
+
+ for (int i = 0; i < stacks.length; i++)
+ {
+ ErrorValue[] errors = stacks[i].getErrorValues();
+ System.out.print("Partial Error for ");
+
+ // The different service implementation may optionally associate
+ // an ModelObject, client ID, or nothing, with each partial error
+ if (stacks[i].hasAssociatedObject())
+ {
+ System.out.println( "object " + stacks[i].getAssociatedObject().getUid() );
+ }
+ else if (stacks[i].hasClientId())
+ {
+ System.out.println( "client id " + stacks[i].getClientId() );
+ }
+ else if (stacks[i].hasClientIndex())
+ System.out.println( "client index " + stacks[i].getClientIndex() );
+
+
+ // Each Partial Error will have one or more contributing error messages
+ for (int j = 0; j < errors.length; j++)
+ {
+ System.out.println(" Code: " + errors[j].getCode() + "\tSeverity: "
+ + errors[j].getLevel() + "\t" + errors[j].getMessage());
+ }
+ }
+
+ }
+
+}
diff --git a/SBsendEmail/src/com/teamcenter/clientx/AppXRequestListener.java b/SBsendEmail/src/com/teamcenter/clientx/AppXRequestListener.java
new file mode 100644
index 0000000..c08fd23
--- /dev/null
+++ b/SBsendEmail/src/com/teamcenter/clientx/AppXRequestListener.java
@@ -0,0 +1,36 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+import com.teamcenter.soa.client.RequestListener;
+
+/**
+ * This implementation of the RequestListener, logs each service request
+ * to the console.
+ *
+ */
+public class AppXRequestListener implements RequestListener
+{
+
+ /**
+ * Called before each request is sent to the server.
+ */
+ public void serviceRequest ( final Info info )
+ {
+ // will log the service name when done
+ }
+
+ /**
+ * Called after each response from the server.
+ * Log the service operation to the console.
+ */
+ public void serviceResponse( final Info info )
+ {
+ System.out.println( info.id +": "+info.service+"."+info.operation);
+ }
+
+}
diff --git a/SBsendEmail/src/com/teamcenter/clientx/AppXSession.java b/SBsendEmail/src/com/teamcenter/clientx/AppXSession.java
new file mode 100644
index 0000000..efe7ba2
--- /dev/null
+++ b/SBsendEmail/src/com/teamcenter/clientx/AppXSession.java
@@ -0,0 +1,311 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Locale;
+import java.util.Vector;
+
+import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException;
+import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
+import com.teamcenter.services.strong.core.DataManagementService;
+import com.teamcenter.services.strong.core.SessionService;
+import com.teamcenter.services.strong.core._2006_03.Session.LoginResponse;
+import com.teamcenter.soa.SoaConstants;
+import com.teamcenter.soa.client.Connection;
+import com.teamcenter.soa.client.model.ModelObject;
+import com.teamcenter.soa.client.model.strong.User;
+import com.teamcenter.soa.client.model.strong.WorkspaceObject;
+import com.teamcenter.soa.exceptions.CanceledOperationException;
+import com.teamcenter.soa.exceptions.NotLoadedException;
+
+public class AppXSession {
+ /**
+ * Single instance of the Connection object that is shared throughout the
+ * application. This Connection object is needed whenever a Service stub is
+ * instantiated.
+ */
+ private static Connection connection;
+
+ /**
+ * The credentialManager is used both by the Session class and the Teamcenter
+ * Services Framework to get user credentials.
+ *
+ */
+ private static AppXCredentialManager credentialManager;
+
+ /**
+ * Create an instance of the Session with a connection to the specified server.
+ *
+ * Add implementations of the ExceptionHandler, PartialErrorListener,
+ * ChangeListener, and DeleteListeners.
+ *
+ * @param host Address of the host to connect to, http://serverName:port/tc
+ */
+ public AppXSession(String host) {
+ // Create an instance of the CredentialManager, this is used
+ // by the SOA Framework to get the user's credentials when
+ // challenged by the server (session timeout on the web tier).
+ credentialManager = new AppXCredentialManager();
+ System.out.println("1111111111111111111111111111111111");
+ String protocol = null;
+ String envNameTccs = null;
+ if (host.startsWith("http")) {
+ protocol = SoaConstants.HTTP;
+ } else if (host.startsWith("tccs")) {
+ protocol = SoaConstants.TCCS;
+ host = host.trim();
+ int envNameStart = host.indexOf('/') + 2;
+ envNameTccs = host.substring(envNameStart, host.length());
+ host = "";
+ } else {
+ protocol = SoaConstants.IIOP;
+ }
+
+ System.out.println("111122111111111111111111");
+ // Create the Connection object, no contact is made with the server
+ // until a service request is made
+ connection = new Connection(host, credentialManager, SoaConstants.REST, protocol);
+
+ if (protocol == SoaConstants.TCCS) {
+ connection.setOption(Connection.TCCS_ENV_NAME, envNameTccs);
+ }
+
+ // Add an ExceptionHandler to the Connection, this will handle any
+ // InternalServerException, communication errors, XML marshaling errors
+ // .etc
+ connection.setExceptionHandler(new AppXExceptionHandler());
+
+ // While the above ExceptionHandler is required, all of the following
+ // Listeners are optional. Client application can add as many or as few
+ // Listeners
+ // of each type that they want.
+
+ // Add a Partial Error Listener, this will be notified when ever a
+ // a service returns partial errors.
+ connection.getModelManager().addPartialErrorListener(new AppXPartialErrorListener());
+
+ // Add a Change and Delete Listener, this will be notified when ever a
+ // a service returns model objects that have been updated or deleted.
+ connection.getModelManager().addModelEventListener(new AppXModelEventListener());
+
+ // Add a Request Listener, this will be notified before and after each
+ // service request is sent to the server.
+ Connection.addRequestListener(new AppXRequestListener());
+
+ }
+
+ public AppXSession(String host,String userName,String password) {
+ // Create an instance of the CredentialManager, this is used
+ // by the SOA Framework to get the user's credentials when
+ // challenged by the server (session timeout on the web tier).
+ credentialManager = new AppXCredentialManager(userName,password);
+ System.out.println("1111111111111111111111111111111111");
+ String protocol = null;
+ String envNameTccs = null;
+ if (host.startsWith("http")) {
+ protocol = SoaConstants.HTTP;
+ } else if (host.startsWith("tccs")) {
+ protocol = SoaConstants.TCCS;
+ host = host.trim();
+ int envNameStart = host.indexOf('/') + 2;
+ envNameTccs = host.substring(envNameStart, host.length());
+ host = "";
+ } else {
+ protocol = SoaConstants.IIOP;
+ }
+
+ System.out.println("111122111111111111111111");
+ // Create the Connection object, no contact is made with the server
+ // until a service request is made
+ connection = new Connection(host, credentialManager, SoaConstants.REST, protocol);
+
+ if (protocol == SoaConstants.TCCS) {
+ connection.setOption(Connection.TCCS_ENV_NAME, envNameTccs);
+ }
+
+ // Add an ExceptionHandler to the Connection, this will handle any
+ // InternalServerException, communication errors, XML marshaling errors
+ // .etc
+ connection.setExceptionHandler(new AppXExceptionHandler());
+
+ // While the above ExceptionHandler is required, all of the following
+ // Listeners are optional. Client application can add as many or as few
+ // Listeners
+ // of each type that they want.
+
+ // Add a Partial Error Listener, this will be notified when ever a
+ // a service returns partial errors.
+ connection.getModelManager().addPartialErrorListener(new AppXPartialErrorListener());
+
+ // Add a Change and Delete Listener, this will be notified when ever a
+ // a service returns model objects that have been updated or deleted.
+ connection.getModelManager().addModelEventListener(new AppXModelEventListener());
+
+ // Add a Request Listener, this will be notified before and after each
+ // service request is sent to the server.
+ Connection.addRequestListener(new AppXRequestListener());
+
+ }
+
+ /**
+ * Get the single Connection object for the application
+ *
+ * @return connection
+ */
+ public static Connection getConnection() {
+ return connection;
+ }
+
+ /**
+ * Login to the Teamcenter Server
+ *
+ */
+ public User login() {
+ // Get the service stub
+ SessionService sessionService = SessionService.getService(connection);
+
+ try {
+ // Prompt for credentials until they are right, or until user
+ // cancels
+ String[] credentials = credentialManager.promptForCredentials();
+ while (true) {
+ try {
+
+ // *****************************
+ // Execute the service operation
+ // *****************************
+ LoginResponse out = sessionService.login(credentials[0], credentials[1], credentials[2],
+ credentials[3], "", credentials[4]);
+
+ return out.user;
+ } catch (InvalidCredentialsException e) {
+ credentials = credentialManager.getCredentials(e);
+ }
+ }
+ }
+ // User canceled the operation, don't need to tell him again
+ catch (CanceledOperationException e) {
+ }
+
+ // Exit the application
+ System.exit(0);
+ return null;
+ }
+
+ public User mylogin(String name, String password) {
+ // Get the service stub
+ SessionService sessionService = SessionService.getService(connection);
+
+ // Prompt for credentials until they are right, or until user
+ // cancels
+ // *****************************
+ // Execute the service operation
+ // *****************************
+ LoginResponse out;
+ try {
+ out = sessionService.login(name, password, "", "", "", "");
+ return out.user;
+ } catch (InvalidCredentialsException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // Exit the application
+ return null;
+ }
+
+ /**
+ * Terminate the session with the Teamcenter Server
+ *
+ */
+ public void logout() {
+ // Get the service stub
+ SessionService sessionService = SessionService.getService(connection);
+ try {
+ // *****************************
+ // Execute the service operation
+ // *****************************
+ sessionService.logout();
+ } catch (ServiceException e) {
+ }
+ }
+
+ /**
+ * Print some basic information for a list of objects
+ *
+ * @param objects
+ */
+ public static void printObjects(ModelObject[] objects) {
+ if (objects == null)
+ return;
+
+ SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US")); // Simple no time
+ // zone
+
+ // Ensure that the referenced User objects that we will use below are loaded
+ getUsers(objects);
+
+ System.out.println("Name\t\tOwner\t\tLast Modified");
+ System.out.println("====\t\t=====\t\t=============");
+ for (int i = 0; i < objects.length; i++) {
+ if (!(objects[i] instanceof WorkspaceObject))
+ continue;
+
+ WorkspaceObject wo = (WorkspaceObject) objects[i];
+ try {
+ String name = wo.get_object_string();
+ User owner = (User) wo.get_owning_user();
+ Calendar lastModified = wo.get_last_mod_date();
+
+ System.out.println(name + "\t" + owner.get_user_name() + "\t" + format.format(lastModified.getTime()));
+ } catch (NotLoadedException e) {
+ // Print out a message, and skip to the next item in the folder
+ // Could do a DataManagementService.getProperties call at this point
+ System.out.println(e.getMessage());
+ System.out.println(
+ "The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
+ }
+ }
+
+ }
+
+ private static void getUsers(ModelObject[] objects) {
+ if (objects == null)
+ return;
+
+ DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
+
+ List unKnownUsers = new Vector();
+ for (int i = 0; i < objects.length; i++) {
+ if (!(objects[i] instanceof WorkspaceObject))
+ continue;
+
+ WorkspaceObject wo = (WorkspaceObject) objects[i];
+
+ User owner = null;
+ try {
+ owner = (User) wo.get_owning_user();
+ owner.get_user_name();
+ } catch (NotLoadedException e) {
+ if (owner != null)
+ unKnownUsers.add(owner);
+ }
+ }
+ User[] users = (User[]) unKnownUsers.toArray(new User[unKnownUsers.size()]);
+ String[] attributes = { "user_name" };
+
+ // *****************************
+ // Execute the service operation
+ // *****************************
+ dmService.getProperties(users, attributes);
+
+ }
+
+}
diff --git a/SBsendEmail/src/com/teamcenter/clientx/SessionFactory.java b/SBsendEmail/src/com/teamcenter/clientx/SessionFactory.java
new file mode 100644
index 0000000..3be2491
--- /dev/null
+++ b/SBsendEmail/src/com/teamcenter/clientx/SessionFactory.java
@@ -0,0 +1,51 @@
+package com.teamcenter.clientx;
+
+
+import com.teamcenter.soa.client.Connection;
+import com.teamcenter.soa.client.model.strong.User;
+
+public class SessionFactory {
+ private static SessionFactory m_connect= null;
+ private AppXSession m_session = null;
+ private User m_user = null;
+
+ public SessionFactory(String host,String usr,String psw)
+ {
+ m_session = new AppXSession (host);
+ m_user = m_session.mylogin(usr, psw);
+ }
+
+ public static SessionFactory getM_connect() {
+ return m_connect;
+ }
+
+ public static void setM_connect(SessionFactory m_connect) {
+ SessionFactory.m_connect = m_connect;
+ }
+
+ public AppXSession getM_session() {
+ return m_session;
+ }
+
+ public void setM_session(AppXSession m_session) {
+ this.m_session = m_session;
+ }
+
+ public User getM_user() {
+ return m_user;
+ }
+
+ public void setM_user(User m_user) {
+ this.m_user = m_user;
+ }
+
+ public Connection GetTCConnect()
+ {
+ return AppXSession.getConnection();
+ }
+
+ public User GetTCUser()
+ {
+ return m_user;
+ }
+}
diff --git a/SBsendProcess/.classpath b/SBsendProcess/.classpath
new file mode 100644
index 0000000..d019792
--- /dev/null
+++ b/SBsendProcess/.classpath
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SBsendProcess/.project b/SBsendProcess/.project
new file mode 100644
index 0000000..30dd242
--- /dev/null
+++ b/SBsendProcess/.project
@@ -0,0 +1,17 @@
+
+
+ SbSendProcess
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/SBsendProcess/.settings/org.eclipse.core.resources.prefs b/SBsendProcess/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..4f1dad7
--- /dev/null
+++ b/SBsendProcess/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//src/com/cn/sb/sendMail/entity/DingTalkResponse.java=UTF-8
diff --git a/SBsendProcess/.settings/org.eclipse.jdt.core.prefs b/SBsendProcess/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0fee6a9
--- /dev/null
+++ b/SBsendProcess/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,15 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/SBsendProcess/bin/com/cn/sb/sendMail/MainClassSendProcess.class b/SBsendProcess/bin/com/cn/sb/sendMail/MainClassSendProcess.class
new file mode 100644
index 0000000..b640a20
Binary files /dev/null and b/SBsendProcess/bin/com/cn/sb/sendMail/MainClassSendProcess.class differ
diff --git a/SBsendProcess/bin/com/cn/sb/sendMail/ReadMe b/SBsendProcess/bin/com/cn/sb/sendMail/ReadMe
new file mode 100644
index 0000000..e6f3241
--- /dev/null
+++ b/SBsendProcess/bin/com/cn/sb/sendMail/ReadMe
@@ -0,0 +1 @@
+世宝:临时图纸\临时物料即将到达有效期时自动发起失效流程
\ No newline at end of file
diff --git a/SBsendProcess/bin/com/cn/sb/sendMail/entity/DingTalkResponse.class b/SBsendProcess/bin/com/cn/sb/sendMail/entity/DingTalkResponse.class
new file mode 100644
index 0000000..7c91914
Binary files /dev/null and b/SBsendProcess/bin/com/cn/sb/sendMail/entity/DingTalkResponse.class differ
diff --git a/SBsendProcess/bin/com/cn/sb/sendMail/entity/Propty.class b/SBsendProcess/bin/com/cn/sb/sendMail/entity/Propty.class
new file mode 100644
index 0000000..1ee407b
Binary files /dev/null and b/SBsendProcess/bin/com/cn/sb/sendMail/entity/Propty.class differ
diff --git a/SBsendProcess/bin/com/cn/sb/sendMail/util/EnvelopeManagement.class b/SBsendProcess/bin/com/cn/sb/sendMail/util/EnvelopeManagement.class
new file mode 100644
index 0000000..0e61246
Binary files /dev/null and b/SBsendProcess/bin/com/cn/sb/sendMail/util/EnvelopeManagement.class differ
diff --git a/SBsendProcess/bin/com/cn/sb/sendMail/util/Utils.class b/SBsendProcess/bin/com/cn/sb/sendMail/util/Utils.class
new file mode 100644
index 0000000..5d34d69
Binary files /dev/null and b/SBsendProcess/bin/com/cn/sb/sendMail/util/Utils.class differ
diff --git a/SBsendProcess/bin/com/teamcenter/clientx/AppXCredentialManager.class b/SBsendProcess/bin/com/teamcenter/clientx/AppXCredentialManager.class
new file mode 100644
index 0000000..8586ebe
Binary files /dev/null and b/SBsendProcess/bin/com/teamcenter/clientx/AppXCredentialManager.class differ
diff --git a/SBsendProcess/bin/com/teamcenter/clientx/AppXExceptionHandler.class b/SBsendProcess/bin/com/teamcenter/clientx/AppXExceptionHandler.class
new file mode 100644
index 0000000..e148187
Binary files /dev/null and b/SBsendProcess/bin/com/teamcenter/clientx/AppXExceptionHandler.class differ
diff --git a/SBsendProcess/bin/com/teamcenter/clientx/AppXModelEventListener.class b/SBsendProcess/bin/com/teamcenter/clientx/AppXModelEventListener.class
new file mode 100644
index 0000000..4024a55
Binary files /dev/null and b/SBsendProcess/bin/com/teamcenter/clientx/AppXModelEventListener.class differ
diff --git a/SBsendProcess/bin/com/teamcenter/clientx/AppXPartialErrorListener.class b/SBsendProcess/bin/com/teamcenter/clientx/AppXPartialErrorListener.class
new file mode 100644
index 0000000..1def491
Binary files /dev/null and b/SBsendProcess/bin/com/teamcenter/clientx/AppXPartialErrorListener.class differ
diff --git a/SBsendProcess/bin/com/teamcenter/clientx/AppXRequestListener.class b/SBsendProcess/bin/com/teamcenter/clientx/AppXRequestListener.class
new file mode 100644
index 0000000..f61ec97
Binary files /dev/null and b/SBsendProcess/bin/com/teamcenter/clientx/AppXRequestListener.class differ
diff --git a/SBsendProcess/bin/com/teamcenter/clientx/AppXSession.class b/SBsendProcess/bin/com/teamcenter/clientx/AppXSession.class
new file mode 100644
index 0000000..ae8435e
Binary files /dev/null and b/SBsendProcess/bin/com/teamcenter/clientx/AppXSession.class differ
diff --git a/SBsendProcess/bin/com/teamcenter/clientx/SessionFactory.class b/SBsendProcess/bin/com/teamcenter/clientx/SessionFactory.class
new file mode 100644
index 0000000..ba3ca1f
Binary files /dev/null and b/SBsendProcess/bin/com/teamcenter/clientx/SessionFactory.class differ
diff --git a/SBsendProcess/lib/TcSoaClient_12000.2.0.jar b/SBsendProcess/lib/TcSoaClient_12000.2.0.jar
new file mode 100644
index 0000000..4a8850c
Binary files /dev/null and b/SBsendProcess/lib/TcSoaClient_12000.2.0.jar differ
diff --git a/SBsendProcess/lib/TcSoaCommon_12000.2.0.jar b/SBsendProcess/lib/TcSoaCommon_12000.2.0.jar
new file mode 100644
index 0000000..f935151
Binary files /dev/null and b/SBsendProcess/lib/TcSoaCommon_12000.2.0.jar differ
diff --git a/SBsendProcess/lib/TcSoaCoreStrong_12000.2.0.jar b/SBsendProcess/lib/TcSoaCoreStrong_12000.2.0.jar
new file mode 100644
index 0000000..e411a9c
Binary files /dev/null and b/SBsendProcess/lib/TcSoaCoreStrong_12000.2.0.jar differ
diff --git a/SBsendProcess/lib/TcSoaCoreTypes_12000.2.0.jar b/SBsendProcess/lib/TcSoaCoreTypes_12000.2.0.jar
new file mode 100644
index 0000000..d61ae14
Binary files /dev/null and b/SBsendProcess/lib/TcSoaCoreTypes_12000.2.0.jar differ
diff --git a/SBsendProcess/lib/TcSoaStrongModel_12000.2.0.jar b/SBsendProcess/lib/TcSoaStrongModel_12000.2.0.jar
new file mode 100644
index 0000000..1a7a624
Binary files /dev/null and b/SBsendProcess/lib/TcSoaStrongModel_12000.2.0.jar differ
diff --git a/SBsendProcess/lib/TcSoaWorkflowRac_12000.2.0.jar b/SBsendProcess/lib/TcSoaWorkflowRac_12000.2.0.jar
new file mode 100644
index 0000000..df95b47
Binary files /dev/null and b/SBsendProcess/lib/TcSoaWorkflowRac_12000.2.0.jar differ
diff --git a/SBsendProcess/lib/TcSoaWorkflowStrong-13.1.0.jar b/SBsendProcess/lib/TcSoaWorkflowStrong-13.1.0.jar
new file mode 100644
index 0000000..9c17a3b
Binary files /dev/null and b/SBsendProcess/lib/TcSoaWorkflowStrong-13.1.0.jar differ
diff --git a/SBsendProcess/lib/XmlSchema-1.4.7.jar b/SBsendProcess/lib/XmlSchema-1.4.7.jar
new file mode 100644
index 0000000..79251c6
Binary files /dev/null and b/SBsendProcess/lib/XmlSchema-1.4.7.jar differ
diff --git a/SBsendProcess/lib/activation-1.1.jar b/SBsendProcess/lib/activation-1.1.jar
new file mode 100644
index 0000000..53f82a1
Binary files /dev/null and b/SBsendProcess/lib/activation-1.1.jar differ
diff --git a/SBsendProcess/lib/ant-commons-logging.jar b/SBsendProcess/lib/ant-commons-logging.jar
new file mode 100644
index 0000000..d3c381c
Binary files /dev/null and b/SBsendProcess/lib/ant-commons-logging.jar differ
diff --git a/SBsendProcess/lib/antlr-2.7.7.jar b/SBsendProcess/lib/antlr-2.7.7.jar
new file mode 100644
index 0000000..5e5f14b
Binary files /dev/null and b/SBsendProcess/lib/antlr-2.7.7.jar differ
diff --git a/SBsendProcess/lib/apache-commons-codec-1.4.jar b/SBsendProcess/lib/apache-commons-codec-1.4.jar
new file mode 100644
index 0000000..422c42b
Binary files /dev/null and b/SBsendProcess/lib/apache-commons-codec-1.4.jar differ
diff --git a/SBsendProcess/lib/apache-mime4j-core-0.7.2.jar b/SBsendProcess/lib/apache-mime4j-core-0.7.2.jar
new file mode 100644
index 0000000..b5c225b
Binary files /dev/null and b/SBsendProcess/lib/apache-mime4j-core-0.7.2.jar differ
diff --git a/SBsendProcess/lib/axiom-api-1.2.12.jar b/SBsendProcess/lib/axiom-api-1.2.12.jar
new file mode 100644
index 0000000..4ee047d
Binary files /dev/null and b/SBsendProcess/lib/axiom-api-1.2.12.jar differ
diff --git a/SBsendProcess/lib/axiom-dom-1.2.12.jar b/SBsendProcess/lib/axiom-dom-1.2.12.jar
new file mode 100644
index 0000000..b2ff444
Binary files /dev/null and b/SBsendProcess/lib/axiom-dom-1.2.12.jar differ
diff --git a/SBsendProcess/lib/axiom-impl-1.2.12.jar b/SBsendProcess/lib/axiom-impl-1.2.12.jar
new file mode 100644
index 0000000..0929d8c
Binary files /dev/null and b/SBsendProcess/lib/axiom-impl-1.2.12.jar differ
diff --git a/SBsendProcess/lib/axis2-adb-1.6.2.jar b/SBsendProcess/lib/axis2-adb-1.6.2.jar
new file mode 100644
index 0000000..6234fdb
Binary files /dev/null and b/SBsendProcess/lib/axis2-adb-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-adb-codegen-1.6.2.jar b/SBsendProcess/lib/axis2-adb-codegen-1.6.2.jar
new file mode 100644
index 0000000..7d037d4
Binary files /dev/null and b/SBsendProcess/lib/axis2-adb-codegen-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-ant-plugin-1.6.2.jar b/SBsendProcess/lib/axis2-ant-plugin-1.6.2.jar
new file mode 100644
index 0000000..771b222
Binary files /dev/null and b/SBsendProcess/lib/axis2-ant-plugin-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-clustering-1.6.2.jar b/SBsendProcess/lib/axis2-clustering-1.6.2.jar
new file mode 100644
index 0000000..e45be99
Binary files /dev/null and b/SBsendProcess/lib/axis2-clustering-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-codegen-1.6.2.jar b/SBsendProcess/lib/axis2-codegen-1.6.2.jar
new file mode 100644
index 0000000..f742f19
Binary files /dev/null and b/SBsendProcess/lib/axis2-codegen-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-corba-1.6.2.jar b/SBsendProcess/lib/axis2-corba-1.6.2.jar
new file mode 100644
index 0000000..ee3c78e
Binary files /dev/null and b/SBsendProcess/lib/axis2-corba-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-fastinfoset-1.6.2.jar b/SBsendProcess/lib/axis2-fastinfoset-1.6.2.jar
new file mode 100644
index 0000000..d10c36a
Binary files /dev/null and b/SBsendProcess/lib/axis2-fastinfoset-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-java2wsdl-1.6.2.jar b/SBsendProcess/lib/axis2-java2wsdl-1.6.2.jar
new file mode 100644
index 0000000..0bb869d
Binary files /dev/null and b/SBsendProcess/lib/axis2-java2wsdl-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-jaxbri-1.6.2.jar b/SBsendProcess/lib/axis2-jaxbri-1.6.2.jar
new file mode 100644
index 0000000..616eec9
Binary files /dev/null and b/SBsendProcess/lib/axis2-jaxbri-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-jaxws-1.6.2.jar b/SBsendProcess/lib/axis2-jaxws-1.6.2.jar
new file mode 100644
index 0000000..064351a
Binary files /dev/null and b/SBsendProcess/lib/axis2-jaxws-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-jibx-1.6.2.jar b/SBsendProcess/lib/axis2-jibx-1.6.2.jar
new file mode 100644
index 0000000..75f9d1a
Binary files /dev/null and b/SBsendProcess/lib/axis2-jibx-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-json-1.6.2.jar b/SBsendProcess/lib/axis2-json-1.6.2.jar
new file mode 100644
index 0000000..edd7936
Binary files /dev/null and b/SBsendProcess/lib/axis2-json-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-kernel-1.6.2.jar b/SBsendProcess/lib/axis2-kernel-1.6.2.jar
new file mode 100644
index 0000000..3ae5f7a
Binary files /dev/null and b/SBsendProcess/lib/axis2-kernel-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-metadata-1.6.2.jar b/SBsendProcess/lib/axis2-metadata-1.6.2.jar
new file mode 100644
index 0000000..492f1ac
Binary files /dev/null and b/SBsendProcess/lib/axis2-metadata-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-mtompolicy-1.6.2.jar b/SBsendProcess/lib/axis2-mtompolicy-1.6.2.jar
new file mode 100644
index 0000000..561e84a
Binary files /dev/null and b/SBsendProcess/lib/axis2-mtompolicy-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-saaj-1.6.2.jar b/SBsendProcess/lib/axis2-saaj-1.6.2.jar
new file mode 100644
index 0000000..c14531d
Binary files /dev/null and b/SBsendProcess/lib/axis2-saaj-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-soapmonitor-servlet-1.6.2.jar b/SBsendProcess/lib/axis2-soapmonitor-servlet-1.6.2.jar
new file mode 100644
index 0000000..276dac7
Binary files /dev/null and b/SBsendProcess/lib/axis2-soapmonitor-servlet-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-spring-1.6.2.jar b/SBsendProcess/lib/axis2-spring-1.6.2.jar
new file mode 100644
index 0000000..30b9baa
Binary files /dev/null and b/SBsendProcess/lib/axis2-spring-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-transport-http-1.6.2.jar b/SBsendProcess/lib/axis2-transport-http-1.6.2.jar
new file mode 100644
index 0000000..b1dad78
Binary files /dev/null and b/SBsendProcess/lib/axis2-transport-http-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-transport-local-1.6.2.jar b/SBsendProcess/lib/axis2-transport-local-1.6.2.jar
new file mode 100644
index 0000000..34a7073
Binary files /dev/null and b/SBsendProcess/lib/axis2-transport-local-1.6.2.jar differ
diff --git a/SBsendProcess/lib/axis2-xmlbeans-1.6.2.jar b/SBsendProcess/lib/axis2-xmlbeans-1.6.2.jar
new file mode 100644
index 0000000..58fba9b
Binary files /dev/null and b/SBsendProcess/lib/axis2-xmlbeans-1.6.2.jar differ
diff --git a/SBsendProcess/lib/bcel-5.1.jar b/SBsendProcess/lib/bcel-5.1.jar
new file mode 100644
index 0000000..524e375
Binary files /dev/null and b/SBsendProcess/lib/bcel-5.1.jar differ
diff --git a/SBsendProcess/lib/cn.com.origin.autocode_1.0.0.jar b/SBsendProcess/lib/cn.com.origin.autocode_1.0.0.jar
new file mode 100644
index 0000000..8de9029
Binary files /dev/null and b/SBsendProcess/lib/cn.com.origin.autocode_1.0.0.jar differ
diff --git a/SBsendProcess/lib/cn.com.origin.autocodemanager_1.0.0.jar b/SBsendProcess/lib/cn.com.origin.autocodemanager_1.0.0.jar
new file mode 100644
index 0000000..9e1d54e
Binary files /dev/null and b/SBsendProcess/lib/cn.com.origin.autocodemanager_1.0.0.jar differ
diff --git a/SBsendProcess/lib/com.teamcenter.rac.aifrcp_12000.2.0.jar b/SBsendProcess/lib/com.teamcenter.rac.aifrcp_12000.2.0.jar
new file mode 100644
index 0000000..f1cfb20
Binary files /dev/null and b/SBsendProcess/lib/com.teamcenter.rac.aifrcp_12000.2.0.jar differ
diff --git a/SBsendProcess/lib/com.teamcenter.rac.workflow_12000.2.0.jar b/SBsendProcess/lib/com.teamcenter.rac.workflow_12000.2.0.jar
new file mode 100644
index 0000000..af8e377
Binary files /dev/null and b/SBsendProcess/lib/com.teamcenter.rac.workflow_12000.2.0.jar differ
diff --git a/SBsendProcess/lib/commons-beanutils-1.7.0.jar b/SBsendProcess/lib/commons-beanutils-1.7.0.jar
new file mode 100644
index 0000000..b1b89c9
Binary files /dev/null and b/SBsendProcess/lib/commons-beanutils-1.7.0.jar differ
diff --git a/SBsendProcess/lib/commons-cli-1.2.jar b/SBsendProcess/lib/commons-cli-1.2.jar
new file mode 100644
index 0000000..ce4b9ff
Binary files /dev/null and b/SBsendProcess/lib/commons-cli-1.2.jar differ
diff --git a/SBsendProcess/lib/commons-codec-1.3.jar b/SBsendProcess/lib/commons-codec-1.3.jar
new file mode 100644
index 0000000..957b675
Binary files /dev/null and b/SBsendProcess/lib/commons-codec-1.3.jar differ
diff --git a/SBsendProcess/lib/commons-codec-1.9.jar b/SBsendProcess/lib/commons-codec-1.9.jar
new file mode 100644
index 0000000..ef35f1c
Binary files /dev/null and b/SBsendProcess/lib/commons-codec-1.9.jar differ
diff --git a/SBsendProcess/lib/commons-collections-3.2.jar b/SBsendProcess/lib/commons-collections-3.2.jar
new file mode 100644
index 0000000..75580be
Binary files /dev/null and b/SBsendProcess/lib/commons-collections-3.2.jar differ
diff --git a/SBsendProcess/lib/commons-fileupload-1.2.jar b/SBsendProcess/lib/commons-fileupload-1.2.jar
new file mode 100644
index 0000000..12539f5
Binary files /dev/null and b/SBsendProcess/lib/commons-fileupload-1.2.jar differ
diff --git a/SBsendProcess/lib/commons-httpclient-3.1.jar b/SBsendProcess/lib/commons-httpclient-3.1.jar
new file mode 100644
index 0000000..7c59774
Binary files /dev/null and b/SBsendProcess/lib/commons-httpclient-3.1.jar differ
diff --git a/SBsendProcess/lib/commons-httpclient-contrib-3.1.jar b/SBsendProcess/lib/commons-httpclient-contrib-3.1.jar
new file mode 100644
index 0000000..af5c5de
Binary files /dev/null and b/SBsendProcess/lib/commons-httpclient-contrib-3.1.jar differ
diff --git a/SBsendProcess/lib/commons-io-1.4.jar b/SBsendProcess/lib/commons-io-1.4.jar
new file mode 100644
index 0000000..133dc6c
Binary files /dev/null and b/SBsendProcess/lib/commons-io-1.4.jar differ
diff --git a/SBsendProcess/lib/commons-lang-2.4.jar b/SBsendProcess/lib/commons-lang-2.4.jar
new file mode 100644
index 0000000..532939e
Binary files /dev/null and b/SBsendProcess/lib/commons-lang-2.4.jar differ
diff --git a/SBsendProcess/lib/commons-lang3-3.12.0.jar b/SBsendProcess/lib/commons-lang3-3.12.0.jar
new file mode 100644
index 0000000..4d434a2
Binary files /dev/null and b/SBsendProcess/lib/commons-lang3-3.12.0.jar differ
diff --git a/SBsendProcess/lib/commons-logging-1.1.1.jar b/SBsendProcess/lib/commons-logging-1.1.1.jar
new file mode 100644
index 0000000..1deef14
Binary files /dev/null and b/SBsendProcess/lib/commons-logging-1.1.1.jar differ
diff --git a/SBsendProcess/lib/commons-logging-1.1.jar b/SBsendProcess/lib/commons-logging-1.1.jar
new file mode 100644
index 0000000..2ff9bbd
Binary files /dev/null and b/SBsendProcess/lib/commons-logging-1.1.jar differ
diff --git a/SBsendProcess/lib/commons-logging-1.2.jar b/SBsendProcess/lib/commons-logging-1.2.jar
new file mode 100644
index 0000000..93a3b9f
Binary files /dev/null and b/SBsendProcess/lib/commons-logging-1.2.jar differ
diff --git a/SBsendProcess/lib/commons-logging.jar b/SBsendProcess/lib/commons-logging.jar
new file mode 100644
index 0000000..b73a80f
Binary files /dev/null and b/SBsendProcess/lib/commons-logging.jar differ
diff --git a/SBsendProcess/lib/commons-net-3.6-sources.jar b/SBsendProcess/lib/commons-net-3.6-sources.jar
new file mode 100644
index 0000000..3e0acce
Binary files /dev/null and b/SBsendProcess/lib/commons-net-3.6-sources.jar differ
diff --git a/SBsendProcess/lib/commons-net-3.6.jar b/SBsendProcess/lib/commons-net-3.6.jar
new file mode 100644
index 0000000..4537623
Binary files /dev/null and b/SBsendProcess/lib/commons-net-3.6.jar differ
diff --git a/SBsendProcess/lib/commons-net-examples-3.6.jar b/SBsendProcess/lib/commons-net-examples-3.6.jar
new file mode 100644
index 0000000..27a9969
Binary files /dev/null and b/SBsendProcess/lib/commons-net-examples-3.6.jar differ
diff --git a/SBsendProcess/lib/dom4j-1.6.1.jar b/SBsendProcess/lib/dom4j-1.6.1.jar
new file mode 100644
index 0000000..c8c4dbb
Binary files /dev/null and b/SBsendProcess/lib/dom4j-1.6.1.jar differ
diff --git a/SBsendProcess/lib/ezmorph-1.0.4.jar b/SBsendProcess/lib/ezmorph-1.0.4.jar
new file mode 100644
index 0000000..7625af6
Binary files /dev/null and b/SBsendProcess/lib/ezmorph-1.0.4.jar differ
diff --git a/SBsendProcess/lib/fccjavaclientproxy.jar b/SBsendProcess/lib/fccjavaclientproxy.jar
new file mode 100644
index 0000000..365a165
Binary files /dev/null and b/SBsendProcess/lib/fccjavaclientproxy.jar differ
diff --git a/SBsendProcess/lib/fmsclientcache.jar b/SBsendProcess/lib/fmsclientcache.jar
new file mode 100644
index 0000000..ddd9f59
Binary files /dev/null and b/SBsendProcess/lib/fmsclientcache.jar differ
diff --git a/SBsendProcess/lib/fmsservercache.jar b/SBsendProcess/lib/fmsservercache.jar
new file mode 100644
index 0000000..5db715d
Binary files /dev/null and b/SBsendProcess/lib/fmsservercache.jar differ
diff --git a/SBsendProcess/lib/fmsutil.jar b/SBsendProcess/lib/fmsutil.jar
new file mode 100644
index 0000000..7a51893
Binary files /dev/null and b/SBsendProcess/lib/fmsutil.jar differ
diff --git a/SBsendProcess/lib/fscjavaclientproxy.jar b/SBsendProcess/lib/fscjavaclientproxy.jar
new file mode 100644
index 0000000..822203c
Binary files /dev/null and b/SBsendProcess/lib/fscjavaclientproxy.jar differ
diff --git a/SBsendProcess/lib/geronimo-annotation_1.0_spec-1.1.jar b/SBsendProcess/lib/geronimo-annotation_1.0_spec-1.1.jar
new file mode 100644
index 0000000..7a6f529
Binary files /dev/null and b/SBsendProcess/lib/geronimo-annotation_1.0_spec-1.1.jar differ
diff --git a/SBsendProcess/lib/geronimo-jaxws_2.2_spec-1.0.jar b/SBsendProcess/lib/geronimo-jaxws_2.2_spec-1.0.jar
new file mode 100644
index 0000000..888f839
Binary files /dev/null and b/SBsendProcess/lib/geronimo-jaxws_2.2_spec-1.0.jar differ
diff --git a/SBsendProcess/lib/geronimo-jta_1.1_spec-1.1.jar b/SBsendProcess/lib/geronimo-jta_1.1_spec-1.1.jar
new file mode 100644
index 0000000..bba9290
Binary files /dev/null and b/SBsendProcess/lib/geronimo-jta_1.1_spec-1.1.jar differ
diff --git a/SBsendProcess/lib/geronimo-saaj_1.3_spec-1.0.1.jar b/SBsendProcess/lib/geronimo-saaj_1.3_spec-1.0.1.jar
new file mode 100644
index 0000000..b2f6e81
Binary files /dev/null and b/SBsendProcess/lib/geronimo-saaj_1.3_spec-1.0.1.jar differ
diff --git a/SBsendProcess/lib/geronimo-stax-api_1.0_spec-1.0.1.jar b/SBsendProcess/lib/geronimo-stax-api_1.0_spec-1.0.1.jar
new file mode 100644
index 0000000..ab1ee3b
Binary files /dev/null and b/SBsendProcess/lib/geronimo-stax-api_1.0_spec-1.0.1.jar differ
diff --git a/SBsendProcess/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar b/SBsendProcess/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar
new file mode 100644
index 0000000..c8a795a
Binary files /dev/null and b/SBsendProcess/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar differ
diff --git a/SBsendProcess/lib/gson-2.8.5.jar b/SBsendProcess/lib/gson-2.8.5.jar
new file mode 100644
index 0000000..0d5baf3
Binary files /dev/null and b/SBsendProcess/lib/gson-2.8.5.jar differ
diff --git a/SBsendProcess/lib/httpclient-4.5.2.jar b/SBsendProcess/lib/httpclient-4.5.2.jar
new file mode 100644
index 0000000..701609f
Binary files /dev/null and b/SBsendProcess/lib/httpclient-4.5.2.jar differ
diff --git a/SBsendProcess/lib/httpcore-4.0.jar b/SBsendProcess/lib/httpcore-4.0.jar
new file mode 100644
index 0000000..37eb7d4
Binary files /dev/null and b/SBsendProcess/lib/httpcore-4.0.jar differ
diff --git a/SBsendProcess/lib/httpcore-4.4.4.jar b/SBsendProcess/lib/httpcore-4.4.4.jar
new file mode 100644
index 0000000..ac4a877
Binary files /dev/null and b/SBsendProcess/lib/httpcore-4.4.4.jar differ
diff --git a/SBsendProcess/lib/httpmime-4.5.2.jar b/SBsendProcess/lib/httpmime-4.5.2.jar
new file mode 100644
index 0000000..474670a
Binary files /dev/null and b/SBsendProcess/lib/httpmime-4.5.2.jar differ
diff --git a/SBsendProcess/lib/iText-5.0.2.jar b/SBsendProcess/lib/iText-5.0.2.jar
new file mode 100644
index 0000000..ed95653
Binary files /dev/null and b/SBsendProcess/lib/iText-5.0.2.jar differ
diff --git a/SBsendProcess/lib/iTextAsian.jar b/SBsendProcess/lib/iTextAsian.jar
new file mode 100644
index 0000000..3fa2157
Binary files /dev/null and b/SBsendProcess/lib/iTextAsian.jar differ
diff --git a/SBsendProcess/lib/itext-2.0.3.jar b/SBsendProcess/lib/itext-2.0.3.jar
new file mode 100644
index 0000000..9c6179d
Binary files /dev/null and b/SBsendProcess/lib/itext-2.0.3.jar differ
diff --git a/SBsendProcess/lib/jacorb.jar b/SBsendProcess/lib/jacorb.jar
new file mode 100644
index 0000000..72bff94
Binary files /dev/null and b/SBsendProcess/lib/jacorb.jar differ
diff --git a/SBsendProcess/lib/jalopy-1.5rc3.jar b/SBsendProcess/lib/jalopy-1.5rc3.jar
new file mode 100644
index 0000000..fe51ce2
Binary files /dev/null and b/SBsendProcess/lib/jalopy-1.5rc3.jar differ
diff --git a/SBsendProcess/lib/jaxb-api-2.1.jar b/SBsendProcess/lib/jaxb-api-2.1.jar
new file mode 100644
index 0000000..be3d6dc
Binary files /dev/null and b/SBsendProcess/lib/jaxb-api-2.1.jar differ
diff --git a/SBsendProcess/lib/jaxb-impl-2.1.7.jar b/SBsendProcess/lib/jaxb-impl-2.1.7.jar
new file mode 100644
index 0000000..034c158
Binary files /dev/null and b/SBsendProcess/lib/jaxb-impl-2.1.7.jar differ
diff --git a/SBsendProcess/lib/jaxb-xjc-2.1.7.jar b/SBsendProcess/lib/jaxb-xjc-2.1.7.jar
new file mode 100644
index 0000000..ba2ec46
Binary files /dev/null and b/SBsendProcess/lib/jaxb-xjc-2.1.7.jar differ
diff --git a/SBsendProcess/lib/jaxen-1.1.6.jar b/SBsendProcess/lib/jaxen-1.1.6.jar
new file mode 100644
index 0000000..52f47a4
Binary files /dev/null and b/SBsendProcess/lib/jaxen-1.1.6.jar differ
diff --git a/SBsendProcess/lib/jaxws-tools-2.1.3.jar b/SBsendProcess/lib/jaxws-tools-2.1.3.jar
new file mode 100644
index 0000000..1006bfd
Binary files /dev/null and b/SBsendProcess/lib/jaxws-tools-2.1.3.jar differ
diff --git a/SBsendProcess/lib/jdom.jar b/SBsendProcess/lib/jdom.jar
new file mode 100644
index 0000000..65a1b3f
Binary files /dev/null and b/SBsendProcess/lib/jdom.jar differ
diff --git a/SBsendProcess/lib/jettison-1.0-RC2.jar b/SBsendProcess/lib/jettison-1.0-RC2.jar
new file mode 100644
index 0000000..3a00ed2
Binary files /dev/null and b/SBsendProcess/lib/jettison-1.0-RC2.jar differ
diff --git a/SBsendProcess/lib/jibx-bind-1.2.jar b/SBsendProcess/lib/jibx-bind-1.2.jar
new file mode 100644
index 0000000..c8d3887
Binary files /dev/null and b/SBsendProcess/lib/jibx-bind-1.2.jar differ
diff --git a/SBsendProcess/lib/jibx-run-1.2.jar b/SBsendProcess/lib/jibx-run-1.2.jar
new file mode 100644
index 0000000..6b467d3
Binary files /dev/null and b/SBsendProcess/lib/jibx-run-1.2.jar differ
diff --git a/SBsendProcess/lib/json-lib-2.2.2-jdk15.jar b/SBsendProcess/lib/json-lib-2.2.2-jdk15.jar
new file mode 100644
index 0000000..27e7c7c
Binary files /dev/null and b/SBsendProcess/lib/json-lib-2.2.2-jdk15.jar differ
diff --git a/SBsendProcess/lib/json-lib-2.2.3-jdk13.jar b/SBsendProcess/lib/json-lib-2.2.3-jdk13.jar
new file mode 100644
index 0000000..a6513db
Binary files /dev/null and b/SBsendProcess/lib/json-lib-2.2.3-jdk13.jar differ
diff --git a/SBsendProcess/lib/jsr311-api-1.0.jar b/SBsendProcess/lib/jsr311-api-1.0.jar
new file mode 100644
index 0000000..2bede66
Binary files /dev/null and b/SBsendProcess/lib/jsr311-api-1.0.jar differ
diff --git a/SBsendProcess/lib/juli-6.0.16.jar b/SBsendProcess/lib/juli-6.0.16.jar
new file mode 100644
index 0000000..c3fe977
Binary files /dev/null and b/SBsendProcess/lib/juli-6.0.16.jar differ
diff --git a/SBsendProcess/lib/k.util_1.0.0.jar b/SBsendProcess/lib/k.util_1.0.0.jar
new file mode 100644
index 0000000..a38eab4
Binary files /dev/null and b/SBsendProcess/lib/k.util_1.0.0.jar differ
diff --git a/SBsendProcess/lib/log4j-1.2.15.jar b/SBsendProcess/lib/log4j-1.2.15.jar
new file mode 100644
index 0000000..c930a6a
Binary files /dev/null and b/SBsendProcess/lib/log4j-1.2.15.jar differ
diff --git a/SBsendProcess/lib/log4j-api-2.8.2.jar b/SBsendProcess/lib/log4j-api-2.8.2.jar
new file mode 100644
index 0000000..9694c29
Binary files /dev/null and b/SBsendProcess/lib/log4j-api-2.8.2.jar differ
diff --git a/SBsendProcess/lib/log4j-core-2.8.2.jar b/SBsendProcess/lib/log4j-core-2.8.2.jar
new file mode 100644
index 0000000..eb658af
Binary files /dev/null and b/SBsendProcess/lib/log4j-core-2.8.2.jar differ
diff --git a/SBsendProcess/lib/logkit.jar b/SBsendProcess/lib/logkit.jar
new file mode 100644
index 0000000..67d4866
Binary files /dev/null and b/SBsendProcess/lib/logkit.jar differ
diff --git a/SBsendProcess/lib/mail-1.4.jar b/SBsendProcess/lib/mail-1.4.jar
new file mode 100644
index 0000000..fd4555b
Binary files /dev/null and b/SBsendProcess/lib/mail-1.4.jar differ
diff --git a/SBsendProcess/lib/mex-1.6.2-impl.jar b/SBsendProcess/lib/mex-1.6.2-impl.jar
new file mode 100644
index 0000000..ed67cf3
Binary files /dev/null and b/SBsendProcess/lib/mex-1.6.2-impl.jar differ
diff --git a/SBsendProcess/lib/neethi-3.0.2.jar b/SBsendProcess/lib/neethi-3.0.2.jar
new file mode 100644
index 0000000..383efde
Binary files /dev/null and b/SBsendProcess/lib/neethi-3.0.2.jar differ
diff --git a/SBsendProcess/lib/ojdbc6.jar b/SBsendProcess/lib/ojdbc6.jar
new file mode 100644
index 0000000..ec3d6f1
Binary files /dev/null and b/SBsendProcess/lib/ojdbc6.jar differ
diff --git a/SBsendProcess/lib/org.apache.commons.httpclient.jar b/SBsendProcess/lib/org.apache.commons.httpclient.jar
new file mode 100644
index 0000000..09fe533
Binary files /dev/null and b/SBsendProcess/lib/org.apache.commons.httpclient.jar differ
diff --git a/SBsendProcess/lib/regexp-1.2.jar b/SBsendProcess/lib/regexp-1.2.jar
new file mode 100644
index 0000000..713441c
Binary files /dev/null and b/SBsendProcess/lib/regexp-1.2.jar differ
diff --git a/SBsendProcess/lib/resolver.jar b/SBsendProcess/lib/resolver.jar
new file mode 100644
index 0000000..073d789
Binary files /dev/null and b/SBsendProcess/lib/resolver.jar differ
diff --git a/SBsendProcess/lib/tcgatewaystubs.jar b/SBsendProcess/lib/tcgatewaystubs.jar
new file mode 100644
index 0000000..72feb84
Binary files /dev/null and b/SBsendProcess/lib/tcgatewaystubs.jar differ
diff --git a/SBsendProcess/lib/tribes-6.0.16.jar b/SBsendProcess/lib/tribes-6.0.16.jar
new file mode 100644
index 0000000..bb85de1
Binary files /dev/null and b/SBsendProcess/lib/tribes-6.0.16.jar differ
diff --git a/SBsendProcess/lib/woden-api-1.0M9.jar b/SBsendProcess/lib/woden-api-1.0M9.jar
new file mode 100644
index 0000000..3b07e8e
Binary files /dev/null and b/SBsendProcess/lib/woden-api-1.0M9.jar differ
diff --git a/SBsendProcess/lib/woden-impl-commons-1.0M9.jar b/SBsendProcess/lib/woden-impl-commons-1.0M9.jar
new file mode 100644
index 0000000..f99c8d7
Binary files /dev/null and b/SBsendProcess/lib/woden-impl-commons-1.0M9.jar differ
diff --git a/SBsendProcess/lib/woden-impl-dom-1.0M9.jar b/SBsendProcess/lib/woden-impl-dom-1.0M9.jar
new file mode 100644
index 0000000..0e3fff5
Binary files /dev/null and b/SBsendProcess/lib/woden-impl-dom-1.0M9.jar differ
diff --git a/SBsendProcess/lib/wsdl4j-1.6.2.jar b/SBsendProcess/lib/wsdl4j-1.6.2.jar
new file mode 100644
index 0000000..b9ffc36
Binary files /dev/null and b/SBsendProcess/lib/wsdl4j-1.6.2.jar differ
diff --git a/SBsendProcess/lib/wstx-asl-3.2.9.jar b/SBsendProcess/lib/wstx-asl-3.2.9.jar
new file mode 100644
index 0000000..ffdbd1f
Binary files /dev/null and b/SBsendProcess/lib/wstx-asl-3.2.9.jar differ
diff --git a/SBsendProcess/lib/xalan-2.7.0.jar b/SBsendProcess/lib/xalan-2.7.0.jar
new file mode 100644
index 0000000..007be39
Binary files /dev/null and b/SBsendProcess/lib/xalan-2.7.0.jar differ
diff --git a/SBsendProcess/lib/xerces.jar b/SBsendProcess/lib/xerces.jar
new file mode 100644
index 0000000..33990e8
Binary files /dev/null and b/SBsendProcess/lib/xerces.jar differ
diff --git a/SBsendProcess/lib/xercesImpl.jar b/SBsendProcess/lib/xercesImpl.jar
new file mode 100644
index 0000000..33990e8
Binary files /dev/null and b/SBsendProcess/lib/xercesImpl.jar differ
diff --git a/SBsendProcess/lib/xml-apis.jar b/SBsendProcess/lib/xml-apis.jar
new file mode 100644
index 0000000..b338fb6
Binary files /dev/null and b/SBsendProcess/lib/xml-apis.jar differ
diff --git a/SBsendProcess/lib/xml-resolver-1.2.jar b/SBsendProcess/lib/xml-resolver-1.2.jar
new file mode 100644
index 0000000..e535bdc
Binary files /dev/null and b/SBsendProcess/lib/xml-resolver-1.2.jar differ
diff --git a/SBsendProcess/lib/xmlbeans-2.3.0.jar b/SBsendProcess/lib/xmlbeans-2.3.0.jar
new file mode 100644
index 0000000..ccd8163
Binary files /dev/null and b/SBsendProcess/lib/xmlbeans-2.3.0.jar differ
diff --git a/SBsendProcess/src/com/cn/sb/sendMail/MainClassSendProcess.java b/SBsendProcess/src/com/cn/sb/sendMail/MainClassSendProcess.java
new file mode 100644
index 0000000..1f18326
--- /dev/null
+++ b/SBsendProcess/src/com/cn/sb/sendMail/MainClassSendProcess.java
@@ -0,0 +1,198 @@
+package com.cn.sb.sendMail;
+
+import static java.time.format.DateTimeFormatter.ofPattern;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeFormatterBuilder;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.cn.sb.sendMail.entity.Propty;
+import com.cn.sb.sendMail.util.Utils;
+import com.teamcenter.clientx.AppXSession;
+import com.teamcenter.services.strong.workflow.WorkflowService;
+import com.teamcenter.services.strong.workflow._2008_06.Workflow;
+
+public class MainClassSendProcess {
+
+ static String xinSBsql = "SELECT POM.FROM_UID puid,PWORK.POBJECT_TYPE ptype,PWORK.POBJECT_NAME objname,PART.psb6_ifls isLs,PART.psb6_creator creator,PART.psb6_validuntil validDate,PIMAM.RPRIMARY_OBJECTU rev_uid\r\n"
+ + "FROM pom_backpointer POM\r\n" + "INNER JOIN pdesignVerMaster PART ON PART.PUID = POM.TO_UID\r\n"
+ + "INNER JOIN Pworkspaceobject PWORK ON PWORK.PUID = POM.FROM_UID\r\n"
+ + "INNER JOIN PIMANRELATION PIMAM ON PIMAM.RSECONDARY_OBJECTU = POM.FROM_UID\r\n"
+ + "WHERE psb6_ifls is not null \r\n" + "AND psb6_validuntil is not null \r\n" + "AND POBJECT_TYPE IN (\r\n"
+ + "'SB6_CatiaDesignXRevisionMaster','SB6_AutocadDXRevisionMaster','SB6_CatiaAssDXRevisionMaster',\r\n"
+ + "'SB6_CatiaSDXRevisionMaster','SB6_AutocadAssDXRevisionMaster','SB6_AutocadSDXRevisionMaster',\r\n"
+ + "'SB6_PItemRevisionMaster' )";
+
+ static String laoSBsql = "SELECT POM.FROM_UID puid,PWORK.POBJECT_TYPE ptype,PWORK.POBJECT_NAME objname,PART.psb6_ifls isLs,PART.psb6_creator creator,PART.psb6_validuntil validDate,PIMAM.RPRIMARY_OBJECTU rev_uid\r\n"
+ + "FROM pom_backpointer POM\r\n" + "INNER JOIN pdesignVerMaster PART ON PART.PUID = POM.TO_UID\r\n"
+ + "INNER JOIN Pworkspaceobject PWORK ON PWORK.PUID = POM.FROM_UID\r\n"
+ + "INNER JOIN PIMANRELATION PIMAM ON PIMAM.RSECONDARY_OBJECTU = POM.FROM_UID\r\n"
+ + "WHERE psb6_ifls is not null \r\n" + "AND psb6_validuntil is not null \r\n" + "AND POBJECT_TYPE IN (\r\n"
+ + "'SB6_CatiaDesignLRevisionMaster','SB6_AutocadDLRevisionMaster','SB6_CatiaAssDLRevisionMaster',\r\n"
+ + "'SB6_CatiaSDLRevisionMaster','SB6_AutocadAssDLRevisionMaster','SB6_AutocadSDLRevisionMaster',\r\n"
+ + "'SB6_PItemRevisionMaster' )";
+
+ public static void main(String[] args) {
+ // 检查格式正确否
+ if (args == null || args.length != 5) {
+ System.out.println("格式不正确!");
+ return;
+ }
+ String userId = args[0];
+ String passWord = args[1];
+ String deadlineDaysStr = args[2];
+ String processTemplateName = args[3];
+ String type = args[4];
+
+ System.out.println("开始登录");
+ // 格式正确,开始登录TC
+ AppXSession session = new AppXSession("http://127.0.0.1:7001/tc", userId, passWord);
+ System.out.println("登录成功");
+
+ try {
+ // 登录成功,连接数据库
+ System.out.println("登录成功,连接数据库");
+ Connection connection = connectOracle();
+ System.out.println("连接数据库成功");
+
+ // 连接数据库成功,获取需要发起流程的对象
+ List list = getSqlMessage(connection, deadlineDaysStr);
+ if (list.size() == 0) {
+ // 退出登录
+ System.out.println("无过期时间!");
+ session.logout();
+ return;
+ }
+ System.out.println("发送流程");
+ for (Propty propty : list) {
+ createProcess(new String[] { propty.getRevUid() }, processTemplateName, processTemplateName);
+ }
+ System.out.println("ending!");
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // 退出登录
+ session.logout();
+ }
+
+ public static void createProcess(String[] uids, String process_name, String process_temp) {
+ try {
+ com.teamcenter.soa.client.Connection connection = (com.teamcenter.soa.client.Connection) AppXSession
+ .getConnection();
+ System.out.println("process_temp:" + process_temp);
+ System.out.println("revisionUid:" + uids.length);
+ // 创建流程
+ WorkflowService wfService = WorkflowService.getService(connection);
+
+ Workflow.ContextData contextData = new Workflow.ContextData();
+
+ String observerKey = "";
+ String name = process_name;
+ String subject = "";
+ String description = "";
+
+ contextData.processTemplate = process_temp; // update with your own ProcessTemplate.
+ contextData.subscribeToEvents = false;
+ contextData.subscriptionEventCount = 0;
+ contextData.attachmentCount = uids.length;
+ contextData.attachments = uids;
+
+ int[] typeInts = new int[] { uids.length };
+ for (int a = 0; a < uids.length; a++) {
+ typeInts[a] = 1;
+ }
+ contextData.attachmentTypes = typeInts;
+ // 创建流程
+ Workflow.InstanceInfo instanceInfo = wfService.createInstance(true, observerKey, name, subject, description,
+ contextData);
+
+ System.out.println("创建流程完成!");
+ } catch (Exception ex) {
+ System.out.println(ex.getMessage());
+ }
+ }
+
+ public static boolean validateDeadline(String targetDateTimeStr, String deadlineDaysStr) {
+ try {
+ // 日期解析与转换
+ DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendPattern("yyyy-MM-dd")
+ .appendOptional(ofPattern(" ")) // 双空格
+ .appendOptional(ofPattern(" ")) // 单空格
+ .appendPattern("HH:mm:ss.S").toFormatter();
+ LocalDateTime targetDateTime = LocalDateTime.parse(targetDateTimeStr, formatter);
+ LocalDate targetDate = targetDateTime.toLocalDate();
+
+ // 天数有效性验证
+ int daysToAdd = Integer.parseInt(deadlineDaysStr);
+ if (daysToAdd < 0)
+ throw new IllegalArgumentException("天数不能为负");
+
+ // 时间计算与对比
+ LocalDate currentDate = LocalDate.now();
+ return currentDate.plusDays(daysToAdd).isEqual(targetDate);
+ } catch (NumberFormatException e) {
+ System.err.println(" 错误:天数参数需为整数");
+ return false;
+ } catch (Exception e) {
+ System.err.println(" 日期格式错误:" + e.getMessage());
+ return false;
+ }
+ }
+
+ private static List getSqlMessage(Connection connection, String deadlineDaysStr) throws SQLException {
+ // TODO Auto-generated method stub
+// PreparedStatement pstmt = connection.prepareStatement(xinSBsql);
+ PreparedStatement pstmt = connection.prepareStatement(laoSBsql);
+ ResultSet rs = pstmt.executeQuery();
+ List list = new ArrayList<>();
+ while (rs.next()) {
+ String puid = rs.getString("puid");
+ String type = rs.getString("ptype");
+ String objName = rs.getString("objname");
+ String isLs = rs.getString("isLs");
+ String creator = rs.getString("creator");
+ String validDate = rs.getString("validDate");
+ String revUid = rs.getString("rev_uid");
+
+ System.out.println("puid=" + puid + " || type=" + type + " || objName=" + objName + " || isLs=" + isLs
+ + " || creator=" + creator + " || validDate=" + validDate + " || ownerUID="
+ + " || revUid=" + revUid);
+
+ if (isLs.equals("Y") && validateDeadline(validDate, deadlineDaysStr)) {
+ Propty propty = new Propty(puid, type, objName, isLs, creator, validDate, "",revUid);
+ list.add(propty);
+ }
+ }
+ return list;
+ }
+
+ public static void login(AppXSession session, String userId, String passWord) {
+ try {
+ Utils.writeLog("发送邮件", "登录tc准备发邮件");
+ session.mylogin(userId, passWord);
+ Utils.writeLog("发送邮件", "邮件发送完毕");
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public static Connection connectOracle() throws ClassNotFoundException, SQLException {
+ Class.forName("oracle.jdbc.driver.OracleDriver");
+ // 建立连接,这里假设服务名为ORCLCDB,用户名是system,密码是password
+ String url = "jdbc:oracle:thin:@192.168.78.131:1521:tc12";
+ System.out.println("成功连接到Oracle数据库");
+ return DriverManager.getConnection(url, "infodba", "infodba");
+ }
+}
diff --git a/SBsendProcess/src/com/cn/sb/sendMail/ReadMe b/SBsendProcess/src/com/cn/sb/sendMail/ReadMe
new file mode 100644
index 0000000..e6f3241
--- /dev/null
+++ b/SBsendProcess/src/com/cn/sb/sendMail/ReadMe
@@ -0,0 +1 @@
+世宝:临时图纸\临时物料即将到达有效期时自动发起失效流程
\ No newline at end of file
diff --git a/SBsendProcess/src/com/cn/sb/sendMail/entity/DingTalkResponse.java b/SBsendProcess/src/com/cn/sb/sendMail/entity/DingTalkResponse.java
new file mode 100644
index 0000000..02269e1
--- /dev/null
+++ b/SBsendProcess/src/com/cn/sb/sendMail/entity/DingTalkResponse.java
@@ -0,0 +1,46 @@
+package com.cn.sb.sendMail.entity;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @ClassName DingTalkResponse
+ * @Description TODO
+ * @Author chenzc
+ * @Date 2025/5/7 10:36
+ **/
+public class DingTalkResponse {
+ @SerializedName("errcode")
+ private int errCode;
+
+ @SerializedName("errmsg")
+ private String errMsg;
+
+ // 缁岀儤鐎柅鐘叉珤娣囨繈娈伴崣宥呯碍閸掓瀵
+ public DingTalkResponse() {}
+
+ // Getter閺傝纭堕惇浣烘殣閿涘湙son闁俺绻冮崣宥呯殸鐠佸潡妫剁涙顔岄敍锟
+
+ public int getErrCode() {
+ return errCode;
+ }
+
+ public void setErrCode(int errCode) {
+ this.errCode = errCode;
+ }
+
+ public String getErrMsg() {
+ return errMsg;
+ }
+
+ public void setErrMsg(String errMsg) {
+ this.errMsg = errMsg;
+ }
+
+ @Override
+ public String toString() {
+ return "DingTalkResponse{" +
+ "errCode=" + errCode +
+ ", errMsg='" + errMsg + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/SBsendProcess/src/com/cn/sb/sendMail/entity/Propty.java b/SBsendProcess/src/com/cn/sb/sendMail/entity/Propty.java
new file mode 100644
index 0000000..8431f92
--- /dev/null
+++ b/SBsendProcess/src/com/cn/sb/sendMail/entity/Propty.java
@@ -0,0 +1,94 @@
+package com.cn.sb.sendMail.entity;
+
+public class Propty {
+ private String puid;
+ private String ptype;
+ private String objName;
+ private String isLs;
+ private String creator;
+ private String validDate;
+ private String owner;
+ private String revUid;
+
+ public Propty(String puid, String ptype, String objName, String isLs, String creator, String validDate,String owner,String revUid) {
+ super();
+ this.puid = puid;
+ this.ptype = ptype;
+ this.objName = objName;
+ this.isLs = isLs;
+ this.creator = creator;
+ this.validDate = validDate;
+ this.owner = owner;
+ this.revUid = revUid;
+ }
+
+ public String getPuid() {
+ return puid;
+ }
+
+ public void setPuid(String puid) {
+ this.puid = puid;
+ }
+
+ public String getIsLs() {
+ return isLs;
+ }
+
+ public void setIsLs(String isLs) {
+ this.isLs = isLs;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getValidDate() {
+ return validDate;
+ }
+
+ public void setValidDate(String validDate) {
+ this.validDate = validDate;
+ }
+
+ public String getPtype() {
+ return ptype;
+ }
+
+ public void setPtype(String ptype) {
+ this.ptype = ptype;
+ }
+
+ public String getObjName() {
+ return objName;
+ }
+
+ public void setObjName(String objName) {
+ this.objName = objName;
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ public String getRevUid() {
+ return revUid;
+ }
+
+ public void setRevUid(String revUid) {
+ this.revUid = revUid;
+ }
+
+ @Override
+ public String toString() {
+ return "Propty [puid=" + puid + ", ptype=" + ptype + ", objName=" + objName + ", isLs=" + isLs + ", creator="
+ + creator + ", validDate=" + validDate + ", owner=" + owner + ", revUid=" + revUid + "]";
+ }
+}
diff --git a/SBsendProcess/src/com/cn/sb/sendMail/util/EnvelopeManagement.java b/SBsendProcess/src/com/cn/sb/sendMail/util/EnvelopeManagement.java
new file mode 100644
index 0000000..f628731
--- /dev/null
+++ b/SBsendProcess/src/com/cn/sb/sendMail/util/EnvelopeManagement.java
@@ -0,0 +1,74 @@
+package com.cn.sb.sendMail.util;
+
+import com.teamcenter.clientx.AppXSession;
+import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
+import com.teamcenter.soa.client.model.ModelObject;
+import com.teamcenter.soa.client.model.ServiceData;
+import com.teamcenter.soa.client.model.strong.Envelope;
+import com.teamcenter.soa.client.model.strong.Person;
+import com.teamcenter.soa.client.model.strong.User;
+import com.teamcenter.soa.exceptions.NotLoadedException;
+import com.teamcenter.services.strong.core.DataManagementService;
+import com.teamcenter.services.strong.core.EnvelopeService;
+import com.teamcenter.services.strong.core._2008_06.DataManagement.CreateIn;
+import com.teamcenter.services.strong.core._2008_06.DataManagement.CreateInput;
+import com.teamcenter.services.strong.core._2008_06.DataManagement.CreateResponse;
+
+public class EnvelopeManagement {
+
+ public void create(String paramString1, String paramString2, String uid, String[] paramArrayOfString1,
+ String[] paramArrayOfString2) {
+ CreateResponse createResponse = null;
+ CreateIn[] arrayOfCreateIn = null;
+ CreateInput createInput = null;
+ DataManagementService dataManagementService = DataManagementService.getService(AppXSession.getConnection());
+ arrayOfCreateIn = new CreateIn[1];
+ arrayOfCreateIn[0] = new CreateIn();
+ createInput = new CreateInput();
+ createInput.stringProps.put("object_name", paramString1);
+ createInput.stringProps.put("object_desc", paramString2);
+ createInput.boName = "Envelope";
+ ServiceData data = dataManagementService.loadObjects(new String[] { uid });
+ if (data.sizeOfPlainObjects() > 0) {
+ User user = (User) data.getPlainObject(0);
+ try {
+ String name = user.get_user_name();
+ System.out.println("name===============" + name);
+ } catch (NotLoadedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (user != null) {
+ createInput.tagArrayProps.put("listOfReceivers", new ModelObject[] { user });
+ }
+ }
+ if (paramArrayOfString1 != null && paramArrayOfString1.length > 0)
+ createInput.stringArrayProps.put("fnd0ListOfExtRecipients", paramArrayOfString1);
+ if (paramArrayOfString2 != null && paramArrayOfString2.length > 0)
+ createInput.stringArrayProps.put("fnd0ListOfCcExtRecipients", paramArrayOfString2);
+ (arrayOfCreateIn[0]).data = createInput;
+ try {
+ createResponse = dataManagementService.createObjects(arrayOfCreateIn);
+ } catch (ServiceException serviceException) {
+ System.out.println("EnvelopeManagement create returned partial errors: "
+ + createResponse.serviceData.sizeOfPartialErrors());
+ }
+ Envelope e = (Envelope) (createResponse.output[0]).objects[0];
+ String uid2 = e.getUid();
+ System.out.println("uid2====================" + uid2);
+ sendAndDeleteEnvelopes(e);
+ }
+
+ public void sendAndDeleteEnvelopes(Envelope paramTCComponentEnvelope) {
+ Envelope[] arrayOfTCComponentEnvelope = new Envelope[1];
+ ServiceData serviceData = null;
+ arrayOfTCComponentEnvelope[0] = paramTCComponentEnvelope;
+ EnvelopeService envelopeService = EnvelopeService.getService(AppXSession.getConnection());
+ try {
+ serviceData = (ServiceData) envelopeService.sendAndDeleteEnvelopes(arrayOfTCComponentEnvelope);
+ } catch (Exception exception) {
+ System.out
+ .println("EnvelopeManagement create returned partial errors: " + serviceData.sizeOfPartialErrors());
+ }
+ }
+}
diff --git a/SBsendProcess/src/com/cn/sb/sendMail/util/Utils.java b/SBsendProcess/src/com/cn/sb/sendMail/util/Utils.java
new file mode 100644
index 0000000..fcd2c69
--- /dev/null
+++ b/SBsendProcess/src/com/cn/sb/sendMail/util/Utils.java
@@ -0,0 +1,38 @@
+package com.cn.sb.sendMail.util;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class Utils {
+ public static void writeLog(String filePreFix, String txt) {
+ System.out.println(txt);
+ BufferedWriter writer = null;
+ try {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+ SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
+ Date now = new Date();
+ String time = dateFormat.format(now);
+ String now1 = timeFormat.format(now);
+ String filePath = System.getenv("TEMP") + "\\" + filePreFix + "_" + time + ".txt";
+ // 获得字节数组
+ String content = "[" + now1 + "]" + txt + "\r\n";
+ writer = new BufferedWriter(new FileWriter(new File(filePath), true));
+ writer.write(content);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (writer != null) {
+ try {
+ writer.flush();
+ writer.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+}
diff --git a/SBsendProcess/src/com/teamcenter/clientx/AppXCredentialManager.java b/SBsendProcess/src/com/teamcenter/clientx/AppXCredentialManager.java
new file mode 100644
index 0000000..0e087f1
--- /dev/null
+++ b/SBsendProcess/src/com/teamcenter/clientx/AppXCredentialManager.java
@@ -0,0 +1,138 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+
+import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException;
+import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidUserException;
+import com.teamcenter.soa.client.CredentialManager;
+import com.teamcenter.soa.exceptions.CanceledOperationException;
+
+/**
+ * The CredentialManager is used by the Teamcenter Services framework to get the
+ * user's credentials when challenged by the server. This can occur after a
+ * period of inactivity and the server has timed-out the user's session, at
+ * which time the client application will need to re-authenticate. The framework
+ * will call one of the getCredentials methods (depending on circumstances) and
+ * will send the SessionService.login service request. Upon successful
+ * completion of the login service request. The last service request (one that
+ * caused the challenge) will be resent.
+ *
+ * The framework will also call the setUserPassword setGroupRole methods when
+ * ever these credentials change, thus allowing this implementation of the
+ * CredentialManager to cache these values so prompting of the user is not
+ * required for re-authentication.
+ *
+ */
+public class AppXCredentialManager implements CredentialManager {
+
+ private String name = null;
+ private String password = null;
+ private String group = ""; // default group
+ private String role = ""; // default role
+ private String discriminator = "SoaAppX"; // always connect same user
+ // to same instance of server
+
+ public AppXCredentialManager(String name, String password) {
+ super();
+ this.name = name;
+ this.password = password;
+ }
+
+ public AppXCredentialManager() {
+ super();
+ }
+
+ /**
+ * Return the type of credentials this implementation provides, standard
+ * (user/password) or Single-Sign-On. In this case Standard credentials are
+ * returned.
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#getCredentialType()
+ */
+ public int getCredentialType() {
+ return CredentialManager.CLIENT_CREDENTIAL_TYPE_STD;
+ }
+
+ /**
+ * Prompt's the user for credentials. This method will only be called by the
+ * framework when a login attempt has failed.
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException)
+ */
+ public String[] getCredentials(InvalidCredentialsException e) throws CanceledOperationException {
+ System.out.println(e.getMessage());
+ return promptForCredentials();
+ }
+
+ /**
+ * Return the cached credentials. This method will be called when a service
+ * request is sent without a valid session ( session has expired on the server).
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.InvalidUserException)
+ */
+ public String[] getCredentials(InvalidUserException e) throws CanceledOperationException {
+ // Have not logged in yet, should not happen but just in case
+ if (name == null)
+ return promptForCredentials();
+
+ // Return cached credentials
+ String[] tokens = { name, password, group, role, discriminator };
+ return tokens;
+ }
+
+ /**
+ * Cache the group and role This is called after the
+ * SessionService.setSessionGroupMember service operation is called.
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#setGroupRole(java.lang.String,
+ * java.lang.String)
+ */
+ public void setGroupRole(String group, String role) {
+ this.group = group;
+ this.role = role;
+ }
+
+ /**
+ * Cache the User and Password This is called after the SessionService.login
+ * service operation is called.
+ *
+ * @see com.teamcenter.soa.client.CredentialManager#setUserPassword(java.lang.String,
+ * java.lang.String, java.lang.String)
+ */
+ public void setUserPassword(String user, String password, String discriminator) {
+ this.name = user;
+ this.password = password;
+ this.discriminator = discriminator;
+ }
+
+ public String[] promptForCredentials() throws CanceledOperationException {
+ try {
+ LineNumberReader reader = new LineNumberReader(new InputStreamReader(System.in));
+ System.out.println("Please enter user credentials (return to quit):");
+ System.out.print("User Name: ");
+ name = reader.readLine();
+
+ if (name.length() == 0)
+ throw new CanceledOperationException("");
+
+ System.out.print("Password: ");
+ password = reader.readLine();
+ } catch (IOException e) {
+ String message = "Failed to get the name and password.\n" + e.getMessage();
+ System.out.println(message);
+ throw new CanceledOperationException(message);
+ }
+
+ String[] tokens = { name, password, group, role, discriminator };
+ return tokens;
+ }
+
+}
diff --git a/SBsendProcess/src/com/teamcenter/clientx/AppXExceptionHandler.java b/SBsendProcess/src/com/teamcenter/clientx/AppXExceptionHandler.java
new file mode 100644
index 0000000..265b725
--- /dev/null
+++ b/SBsendProcess/src/com/teamcenter/clientx/AppXExceptionHandler.java
@@ -0,0 +1,117 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+
+import javax.transaction.SystemException;
+
+import com.teamcenter.schemas.soa._2006_03.exceptions.ConnectionException;
+import com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException;
+import com.teamcenter.schemas.soa._2006_03.exceptions.ProtocolException;
+import com.teamcenter.soa.client.ExceptionHandler;
+import com.teamcenter.soa.exceptions.CanceledOperationException;
+
+/**
+ * Implementation of the ExceptionHandler. For ConnectionExceptions (server
+ * temporarily down .etc) prompts the user to retry the last request. For other
+ * exceptions convert to a RunTime exception.
+ */
+public class AppXExceptionHandler implements ExceptionHandler
+{
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException)
+ */
+ public void handleException(InternalServerException ise)
+ {
+ System.out.println("");
+ System.out.println("*****");
+ System.out
+ .println("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(InternalServerException).");
+
+ LineNumberReader reader = new LineNumberReader(new InputStreamReader(System.in));
+
+ if (ise instanceof ConnectionException)
+ {
+ // ConnectionException are typically due to a network error (server
+ // down .etc) and can be recovered from (the last request can be sent again,
+ // after the problem is corrected).
+// System.out.print("\nThe server returned an connection error.\n" + ise.getMessage()
+// + "\nDo you wish to retry the last service request?[y/n]");
+ try {
+ throw new SystemException("\nThe server returned an connection error.\n" + ise.getMessage());
+ } catch (SystemException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ else
+ if (ise instanceof ProtocolException)
+ {
+ // ProtocolException are typically due to programming errors
+ // (content of HTTP
+ // request is incorrect). These are generally can not be
+ // recovered from.
+// System.out.print("\nThe server returned an protocol error.\n" + ise.getMessage()
+// + "\nThis is most likely the result of a programming error."
+// + "\nDo you wish to retry the last service request?[y/n]");
+ try {
+ throw new SystemException("\nThe server returned an protocol error.\n" + ise.getMessage()
+ + "\nThis is most likely the result of a programming error.");
+ } catch (SystemException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ else
+ {
+ System.out.println("\nThe server returned an internal server error.\n"
+ + ise.getMessage()
+ + "\nThis is most likely the result of a programming error."
+ + "\nA RuntimeException will be thrown.");
+ throw new RuntimeException(ise.getMessage());
+ }
+
+// try
+// {
+// String retry = reader.readLine();
+// // If yes, return to the calling SOA client framework, where the
+// // last service request will be resent.
+// if (retry.equalsIgnoreCase("y") || retry.equalsIgnoreCase("yes")) return;
+//
+// throw new RuntimeException("The user has opted not to retry the last request");
+// }
+// catch (IOException e)
+// {
+// System.err.println("Failed to read user response.\nA RuntimeException will be thrown.");
+// throw new RuntimeException(e.getMessage());
+// }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.soa.exceptions.CanceledOperationException)
+ */
+ public void handleException(CanceledOperationException coe)
+ {
+ System.out.println("");
+ System.out.println("*****");
+ System.out.println("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(CanceledOperationException).");
+
+ // Expecting this from the login tests with bad credentials, and the
+ // AnyUserCredentials class not
+ // prompting for different credentials
+ throw new RuntimeException(coe);
+ }
+
+}
diff --git a/SBsendProcess/src/com/teamcenter/clientx/AppXModelEventListener.java b/SBsendProcess/src/com/teamcenter/clientx/AppXModelEventListener.java
new file mode 100644
index 0000000..2210109
--- /dev/null
+++ b/SBsendProcess/src/com/teamcenter/clientx/AppXModelEventListener.java
@@ -0,0 +1,64 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+
+import com.teamcenter.soa.client.model.ModelEventListener;
+import com.teamcenter.soa.client.model.ModelObject;
+import com.teamcenter.soa.exceptions.NotLoadedException;
+
+/**
+ * Implementation of the ChangeListener. Print out all objects that have been updated.
+ *
+ */
+public class AppXModelEventListener extends ModelEventListener
+{
+
+ @Override
+ public void localObjectChange(ModelObject[] objects)
+ {
+
+ if (objects.length == 0) return;
+ System.out.println("");
+ System.out.println("Modified Objects handled in com.teamcenter.clientx.AppXUpdateObjectListener.modelObjectChange");
+ System.out.println("The following objects have been updated in the client data model:");
+ for (int i = 0; i < objects.length; i++)
+ {
+ String uid = objects[i].getUid();
+ String type = objects[i].getTypeObject().getName();
+ String name = "";
+ if (objects[i].getTypeObject().isInstanceOf("WorkspaceObject"))
+ {
+ ModelObject wo = objects[i];
+ try
+ {
+ name = wo.getPropertyObject("object_string").getStringValue();
+ }
+ catch (NotLoadedException e) {} // just ignore
+ }
+ System.out.println(" " + uid + " " + type + " " + name);
+ }
+ }
+
+ @Override
+ public void localObjectDelete(String[] uids)
+ {
+
+ if (uids.length == 0)
+ return;
+
+ System.out.println("");
+ System.out.println("Deleted Objects handled in com.teamcenter.clientx.AppXDeletedObjectListener.modelObjectDelete");
+ System.out.println("The following objects have been deleted from the server and removed from the client data model:");
+ for (int i = 0; i < uids.length; i++)
+ {
+ System.out.println(" " + uids[i]);
+ }
+
+ }
+
+}
diff --git a/SBsendProcess/src/com/teamcenter/clientx/AppXPartialErrorListener.java b/SBsendProcess/src/com/teamcenter/clientx/AppXPartialErrorListener.java
new file mode 100644
index 0000000..726e052
--- /dev/null
+++ b/SBsendProcess/src/com/teamcenter/clientx/AppXPartialErrorListener.java
@@ -0,0 +1,61 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+
+package com.teamcenter.clientx;
+
+import com.teamcenter.soa.client.model.ErrorStack;
+import com.teamcenter.soa.client.model.ErrorValue;
+import com.teamcenter.soa.client.model.PartialErrorListener;
+
+/**
+ * Implementation of the PartialErrorListener. Print out any partial errors
+ * returned.
+ *
+ */
+public class AppXPartialErrorListener implements PartialErrorListener
+{
+
+ @Override
+ public void handlePartialError(ErrorStack[] stacks)
+ {
+ if (stacks.length == 0) return;
+
+ System.out.println("");
+ System.out.println("*****");
+ System.out.println("Partial Errors caught in com.teamcenter.clientx.AppXPartialErrorListener.");
+
+
+ for (int i = 0; i < stacks.length; i++)
+ {
+ ErrorValue[] errors = stacks[i].getErrorValues();
+ System.out.print("Partial Error for ");
+
+ // The different service implementation may optionally associate
+ // an ModelObject, client ID, or nothing, with each partial error
+ if (stacks[i].hasAssociatedObject())
+ {
+ System.out.println( "object " + stacks[i].getAssociatedObject().getUid() );
+ }
+ else if (stacks[i].hasClientId())
+ {
+ System.out.println( "client id " + stacks[i].getClientId() );
+ }
+ else if (stacks[i].hasClientIndex())
+ System.out.println( "client index " + stacks[i].getClientIndex() );
+
+
+ // Each Partial Error will have one or more contributing error messages
+ for (int j = 0; j < errors.length; j++)
+ {
+ System.out.println(" Code: " + errors[j].getCode() + "\tSeverity: "
+ + errors[j].getLevel() + "\t" + errors[j].getMessage());
+ }
+ }
+
+ }
+
+}
diff --git a/SBsendProcess/src/com/teamcenter/clientx/AppXRequestListener.java b/SBsendProcess/src/com/teamcenter/clientx/AppXRequestListener.java
new file mode 100644
index 0000000..c08fd23
--- /dev/null
+++ b/SBsendProcess/src/com/teamcenter/clientx/AppXRequestListener.java
@@ -0,0 +1,36 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+import com.teamcenter.soa.client.RequestListener;
+
+/**
+ * This implementation of the RequestListener, logs each service request
+ * to the console.
+ *
+ */
+public class AppXRequestListener implements RequestListener
+{
+
+ /**
+ * Called before each request is sent to the server.
+ */
+ public void serviceRequest ( final Info info )
+ {
+ // will log the service name when done
+ }
+
+ /**
+ * Called after each response from the server.
+ * Log the service operation to the console.
+ */
+ public void serviceResponse( final Info info )
+ {
+ System.out.println( info.id +": "+info.service+"."+info.operation);
+ }
+
+}
diff --git a/SBsendProcess/src/com/teamcenter/clientx/AppXSession.java b/SBsendProcess/src/com/teamcenter/clientx/AppXSession.java
new file mode 100644
index 0000000..efe7ba2
--- /dev/null
+++ b/SBsendProcess/src/com/teamcenter/clientx/AppXSession.java
@@ -0,0 +1,311 @@
+//==================================================
+//
+// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
+//
+//==================================================
+
+package com.teamcenter.clientx;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Locale;
+import java.util.Vector;
+
+import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException;
+import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
+import com.teamcenter.services.strong.core.DataManagementService;
+import com.teamcenter.services.strong.core.SessionService;
+import com.teamcenter.services.strong.core._2006_03.Session.LoginResponse;
+import com.teamcenter.soa.SoaConstants;
+import com.teamcenter.soa.client.Connection;
+import com.teamcenter.soa.client.model.ModelObject;
+import com.teamcenter.soa.client.model.strong.User;
+import com.teamcenter.soa.client.model.strong.WorkspaceObject;
+import com.teamcenter.soa.exceptions.CanceledOperationException;
+import com.teamcenter.soa.exceptions.NotLoadedException;
+
+public class AppXSession {
+ /**
+ * Single instance of the Connection object that is shared throughout the
+ * application. This Connection object is needed whenever a Service stub is
+ * instantiated.
+ */
+ private static Connection connection;
+
+ /**
+ * The credentialManager is used both by the Session class and the Teamcenter
+ * Services Framework to get user credentials.
+ *
+ */
+ private static AppXCredentialManager credentialManager;
+
+ /**
+ * Create an instance of the Session with a connection to the specified server.
+ *
+ * Add implementations of the ExceptionHandler, PartialErrorListener,
+ * ChangeListener, and DeleteListeners.
+ *
+ * @param host Address of the host to connect to, http://serverName:port/tc
+ */
+ public AppXSession(String host) {
+ // Create an instance of the CredentialManager, this is used
+ // by the SOA Framework to get the user's credentials when
+ // challenged by the server (session timeout on the web tier).
+ credentialManager = new AppXCredentialManager();
+ System.out.println("1111111111111111111111111111111111");
+ String protocol = null;
+ String envNameTccs = null;
+ if (host.startsWith("http")) {
+ protocol = SoaConstants.HTTP;
+ } else if (host.startsWith("tccs")) {
+ protocol = SoaConstants.TCCS;
+ host = host.trim();
+ int envNameStart = host.indexOf('/') + 2;
+ envNameTccs = host.substring(envNameStart, host.length());
+ host = "";
+ } else {
+ protocol = SoaConstants.IIOP;
+ }
+
+ System.out.println("111122111111111111111111");
+ // Create the Connection object, no contact is made with the server
+ // until a service request is made
+ connection = new Connection(host, credentialManager, SoaConstants.REST, protocol);
+
+ if (protocol == SoaConstants.TCCS) {
+ connection.setOption(Connection.TCCS_ENV_NAME, envNameTccs);
+ }
+
+ // Add an ExceptionHandler to the Connection, this will handle any
+ // InternalServerException, communication errors, XML marshaling errors
+ // .etc
+ connection.setExceptionHandler(new AppXExceptionHandler());
+
+ // While the above ExceptionHandler is required, all of the following
+ // Listeners are optional. Client application can add as many or as few
+ // Listeners
+ // of each type that they want.
+
+ // Add a Partial Error Listener, this will be notified when ever a
+ // a service returns partial errors.
+ connection.getModelManager().addPartialErrorListener(new AppXPartialErrorListener());
+
+ // Add a Change and Delete Listener, this will be notified when ever a
+ // a service returns model objects that have been updated or deleted.
+ connection.getModelManager().addModelEventListener(new AppXModelEventListener());
+
+ // Add a Request Listener, this will be notified before and after each
+ // service request is sent to the server.
+ Connection.addRequestListener(new AppXRequestListener());
+
+ }
+
+ public AppXSession(String host,String userName,String password) {
+ // Create an instance of the CredentialManager, this is used
+ // by the SOA Framework to get the user's credentials when
+ // challenged by the server (session timeout on the web tier).
+ credentialManager = new AppXCredentialManager(userName,password);
+ System.out.println("1111111111111111111111111111111111");
+ String protocol = null;
+ String envNameTccs = null;
+ if (host.startsWith("http")) {
+ protocol = SoaConstants.HTTP;
+ } else if (host.startsWith("tccs")) {
+ protocol = SoaConstants.TCCS;
+ host = host.trim();
+ int envNameStart = host.indexOf('/') + 2;
+ envNameTccs = host.substring(envNameStart, host.length());
+ host = "";
+ } else {
+ protocol = SoaConstants.IIOP;
+ }
+
+ System.out.println("111122111111111111111111");
+ // Create the Connection object, no contact is made with the server
+ // until a service request is made
+ connection = new Connection(host, credentialManager, SoaConstants.REST, protocol);
+
+ if (protocol == SoaConstants.TCCS) {
+ connection.setOption(Connection.TCCS_ENV_NAME, envNameTccs);
+ }
+
+ // Add an ExceptionHandler to the Connection, this will handle any
+ // InternalServerException, communication errors, XML marshaling errors
+ // .etc
+ connection.setExceptionHandler(new AppXExceptionHandler());
+
+ // While the above ExceptionHandler is required, all of the following
+ // Listeners are optional. Client application can add as many or as few
+ // Listeners
+ // of each type that they want.
+
+ // Add a Partial Error Listener, this will be notified when ever a
+ // a service returns partial errors.
+ connection.getModelManager().addPartialErrorListener(new AppXPartialErrorListener());
+
+ // Add a Change and Delete Listener, this will be notified when ever a
+ // a service returns model objects that have been updated or deleted.
+ connection.getModelManager().addModelEventListener(new AppXModelEventListener());
+
+ // Add a Request Listener, this will be notified before and after each
+ // service request is sent to the server.
+ Connection.addRequestListener(new AppXRequestListener());
+
+ }
+
+ /**
+ * Get the single Connection object for the application
+ *
+ * @return connection
+ */
+ public static Connection getConnection() {
+ return connection;
+ }
+
+ /**
+ * Login to the Teamcenter Server
+ *
+ */
+ public User login() {
+ // Get the service stub
+ SessionService sessionService = SessionService.getService(connection);
+
+ try {
+ // Prompt for credentials until they are right, or until user
+ // cancels
+ String[] credentials = credentialManager.promptForCredentials();
+ while (true) {
+ try {
+
+ // *****************************
+ // Execute the service operation
+ // *****************************
+ LoginResponse out = sessionService.login(credentials[0], credentials[1], credentials[2],
+ credentials[3], "", credentials[4]);
+
+ return out.user;
+ } catch (InvalidCredentialsException e) {
+ credentials = credentialManager.getCredentials(e);
+ }
+ }
+ }
+ // User canceled the operation, don't need to tell him again
+ catch (CanceledOperationException e) {
+ }
+
+ // Exit the application
+ System.exit(0);
+ return null;
+ }
+
+ public User mylogin(String name, String password) {
+ // Get the service stub
+ SessionService sessionService = SessionService.getService(connection);
+
+ // Prompt for credentials until they are right, or until user
+ // cancels
+ // *****************************
+ // Execute the service operation
+ // *****************************
+ LoginResponse out;
+ try {
+ out = sessionService.login(name, password, "", "", "", "");
+ return out.user;
+ } catch (InvalidCredentialsException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // Exit the application
+ return null;
+ }
+
+ /**
+ * Terminate the session with the Teamcenter Server
+ *
+ */
+ public void logout() {
+ // Get the service stub
+ SessionService sessionService = SessionService.getService(connection);
+ try {
+ // *****************************
+ // Execute the service operation
+ // *****************************
+ sessionService.logout();
+ } catch (ServiceException e) {
+ }
+ }
+
+ /**
+ * Print some basic information for a list of objects
+ *
+ * @param objects
+ */
+ public static void printObjects(ModelObject[] objects) {
+ if (objects == null)
+ return;
+
+ SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US")); // Simple no time
+ // zone
+
+ // Ensure that the referenced User objects that we will use below are loaded
+ getUsers(objects);
+
+ System.out.println("Name\t\tOwner\t\tLast Modified");
+ System.out.println("====\t\t=====\t\t=============");
+ for (int i = 0; i < objects.length; i++) {
+ if (!(objects[i] instanceof WorkspaceObject))
+ continue;
+
+ WorkspaceObject wo = (WorkspaceObject) objects[i];
+ try {
+ String name = wo.get_object_string();
+ User owner = (User) wo.get_owning_user();
+ Calendar lastModified = wo.get_last_mod_date();
+
+ System.out.println(name + "\t" + owner.get_user_name() + "\t" + format.format(lastModified.getTime()));
+ } catch (NotLoadedException e) {
+ // Print out a message, and skip to the next item in the folder
+ // Could do a DataManagementService.getProperties call at this point
+ System.out.println(e.getMessage());
+ System.out.println(
+ "The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
+ }
+ }
+
+ }
+
+ private static void getUsers(ModelObject[] objects) {
+ if (objects == null)
+ return;
+
+ DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
+
+ List unKnownUsers = new Vector();
+ for (int i = 0; i < objects.length; i++) {
+ if (!(objects[i] instanceof WorkspaceObject))
+ continue;
+
+ WorkspaceObject wo = (WorkspaceObject) objects[i];
+
+ User owner = null;
+ try {
+ owner = (User) wo.get_owning_user();
+ owner.get_user_name();
+ } catch (NotLoadedException e) {
+ if (owner != null)
+ unKnownUsers.add(owner);
+ }
+ }
+ User[] users = (User[]) unKnownUsers.toArray(new User[unKnownUsers.size()]);
+ String[] attributes = { "user_name" };
+
+ // *****************************
+ // Execute the service operation
+ // *****************************
+ dmService.getProperties(users, attributes);
+
+ }
+
+}
diff --git a/SBsendProcess/src/com/teamcenter/clientx/SessionFactory.java b/SBsendProcess/src/com/teamcenter/clientx/SessionFactory.java
new file mode 100644
index 0000000..3be2491
--- /dev/null
+++ b/SBsendProcess/src/com/teamcenter/clientx/SessionFactory.java
@@ -0,0 +1,51 @@
+package com.teamcenter.clientx;
+
+
+import com.teamcenter.soa.client.Connection;
+import com.teamcenter.soa.client.model.strong.User;
+
+public class SessionFactory {
+ private static SessionFactory m_connect= null;
+ private AppXSession m_session = null;
+ private User m_user = null;
+
+ public SessionFactory(String host,String usr,String psw)
+ {
+ m_session = new AppXSession (host);
+ m_user = m_session.mylogin(usr, psw);
+ }
+
+ public static SessionFactory getM_connect() {
+ return m_connect;
+ }
+
+ public static void setM_connect(SessionFactory m_connect) {
+ SessionFactory.m_connect = m_connect;
+ }
+
+ public AppXSession getM_session() {
+ return m_session;
+ }
+
+ public void setM_session(AppXSession m_session) {
+ this.m_session = m_session;
+ }
+
+ public User getM_user() {
+ return m_user;
+ }
+
+ public void setM_user(User m_user) {
+ this.m_user = m_user;
+ }
+
+ public Connection GetTCConnect()
+ {
+ return AppXSession.getConnection();
+ }
+
+ public User GetTCUser()
+ {
+ return m_user;
+ }
+}