From e85afb07027de2f7ddd402a4f3eb03859c1b6d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=86=AC=E9=98=B3?= Date: Fri, 5 Jan 2024 18:36:00 +0800 Subject: [PATCH] =?UTF-8?q?BOM=E8=A3=85=E7=AE=B1=E5=8D=95=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=A1=AB=E5=86=99=E4=BB=A3=E7=A0=81=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .classpath | 7 + .project | 28 + .settings/org.eclipse.core.resources.prefs | 2 + .settings/org.eclipse.jdt.core.prefs | 9 + META-INF/MANIFEST.MF | 17 + bin/com/connor/cust/Activator.class | Bin 0 -> 866 bytes .../connor/cust/box/BoxReportHandler.class | Bin 0 -> 3375 bytes bin/com/connor/cust/box/PlmLocale.class | Bin 0 -> 1019 bytes bin/com/connor/cust/box/XYBOMDialog$1.class | Bin 0 -> 2972 bytes bin/com/connor/cust/box/XYBOMDialog$2.class | Bin 0 -> 868 bytes bin/com/connor/cust/box/XYBOMDialog.class | Bin 0 -> 3598 bytes bin/com/connor/cust/box/XYBOMHandler.class | Bin 0 -> 3083 bytes .../connor/cust/box/history_locale.properties | 8 + .../cust/box/history_locale_zh_CN.properties | 10 + bin/com/connor/cust/util/SqlUtil.class | Bin 0 -> 13839 bytes bin/com/connor/cust/util/TCUtil$1.class | Bin 0 -> 1485 bytes bin/com/connor/cust/util/TCUtil.class | Bin 0 -> 22519 bytes build.properties | 6 + icons/sample.png | Bin 0 -> 332 bytes icons/sample@2x.png | Bin 0 -> 526 bytes plugin.xml | 53 ++ src/com/connor/cust/Activator.java | 44 ++ src/com/connor/cust/box/BoxReportHandler.java | 53 ++ src/com/connor/cust/box/PlmLocale.java | 29 + src/com/connor/cust/box/XYBOMDialog.java | 105 +++ src/com/connor/cust/box/XYBOMHandler.java | 46 ++ .../connor/cust/box/history_locale.properties | 8 + .../cust/box/history_locale_zh_CN.properties | 10 + src/com/connor/cust/util/SqlUtil.java | 684 ++++++++++++++++++ src/com/connor/cust/util/TCUtil.java | 490 +++++++++++++ 30 files changed, 1609 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 META-INF/MANIFEST.MF create mode 100644 bin/com/connor/cust/Activator.class create mode 100644 bin/com/connor/cust/box/BoxReportHandler.class create mode 100644 bin/com/connor/cust/box/PlmLocale.class create mode 100644 bin/com/connor/cust/box/XYBOMDialog$1.class create mode 100644 bin/com/connor/cust/box/XYBOMDialog$2.class create mode 100644 bin/com/connor/cust/box/XYBOMDialog.class create mode 100644 bin/com/connor/cust/box/XYBOMHandler.class create mode 100644 bin/com/connor/cust/box/history_locale.properties create mode 100644 bin/com/connor/cust/box/history_locale_zh_CN.properties create mode 100644 bin/com/connor/cust/util/SqlUtil.class create mode 100644 bin/com/connor/cust/util/TCUtil$1.class create mode 100644 bin/com/connor/cust/util/TCUtil.class create mode 100644 build.properties create mode 100644 icons/sample.png create mode 100644 icons/sample@2x.png create mode 100644 plugin.xml create mode 100644 src/com/connor/cust/Activator.java create mode 100644 src/com/connor/cust/box/BoxReportHandler.java create mode 100644 src/com/connor/cust/box/PlmLocale.java create mode 100644 src/com/connor/cust/box/XYBOMDialog.java create mode 100644 src/com/connor/cust/box/XYBOMHandler.java create mode 100644 src/com/connor/cust/box/history_locale.properties create mode 100644 src/com/connor/cust/box/history_locale_zh_CN.properties create mode 100644 src/com/connor/cust/util/SqlUtil.java create mode 100644 src/com/connor/cust/util/TCUtil.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..e801ebf --- /dev/null +++ b/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..eb8f54c --- /dev/null +++ b/.project @@ -0,0 +1,28 @@ + + + com.connor.cust + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..bb29a1d --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=GBK diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..c9545f0 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +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=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 0000000..ddd09d3 --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Cust +Bundle-SymbolicName: com.connor.cust;singleton:=true +Bundle-Version: 1.0.0 +Bundle-Activator: com.connor.cust.Activator +Bundle-Vendor: CONNOR +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + com.teamcenter.rac.kernel;bundle-version="14000.3.0", + com.teamcenter.rac.aifrcp;bundle-version="14000.3.0", + com.teamcenter.rac.util;bundle-version="14000.3.0", + org.apache.poi;bundle-version="5.2.1", + TcSoaCoreRac;bundle-version="14000.3.0" +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Automatic-Module-Name: com.connor.cust +Bundle-ActivationPolicy: lazy diff --git a/bin/com/connor/cust/Activator.class b/bin/com/connor/cust/Activator.class new file mode 100644 index 0000000000000000000000000000000000000000..cc1df45a8a9c8386d4d63472156f20a9aa76088f GIT binary patch literal 866 zcmaiyUr!T36vfZC{fc)@?7z0lE*6LJLAk65!vJ6VR69V9frs6hX*IaJ%+{blQ!RX9gi87Zqi=gI5#T+9-`@i;Yk1=_ZaFF)?pYn z{x3zjGOMSK)CsVLCMn0#?#VNeCxlq-_U;^#f24C0$$jPWH?BYHz_~?-T$SlJD4~Ta zYE;#WYL1MORoYkRjD|_i230RLQ*C`>s^EAY@Rn9H;7E2h(2#nZwL&E$4EBd}9g|Chc- qUe<};xs&c;1J6jsg@0b8q72{B{z`QTF1s5V&?_h|52HSJxA_-r!l%Ok literal 0 HcmV?d00001 diff --git a/bin/com/connor/cust/box/BoxReportHandler.class b/bin/com/connor/cust/box/BoxReportHandler.class new file mode 100644 index 0000000000000000000000000000000000000000..90205c5eb7d7305a4eb0418def00c2def1668656 GIT binary patch literal 3375 zcma)8*;W)+6x~;bg0>vej;&GS42qUG1f`7$v=~tk0|**5rYJ60Qe9Q4sz%71n3%-O zb5@?R{DLG8#N~s_ZV1yKwfG*XP3czR(sYL%8EB{$X!L?nLt2jQhmszFy5#dT2#vO(FbYg- z+FYRasO{R(F@dUv#sPuqoHr~}s6xGt8q^9b>#|*WrjQ?!LBBcVNP%>hXPM4`8QAK* z^szd+YKHA52chu+^x+blN zP^pdyOZpLwLJetwriH*wyVPSPR%=)#u>3J}-((ocypA`)_LMwWIJ{=sbf2KFqcsowONrpE|1G_Eb@GT?G24_Q7RFX zd&w-T!Zqk<#4aX8kX#`M7_QCt9osS$xdI2~K`OPCN~m*&6LFicSHm6w)q_S-5_7of zFtCr+Wiov-4C4$A&Yi)S3|#4y` zFh?c3UdPKgNzL%RknCJ41v9Tl#-QyEd)Kp-p(?+0Cbs9SNbI8)oYHX`UF5|#Rc{LH zORh(`uCrMsN;A&r=)qZmmE`GcAV(yzEZHZ6aoeICH9rNj!i6HxE3o$TVD3s$iTh>V zcg#p$Ie($O=X?tN7|?J|U{3;}<+ohT0n;f+O6<<0nqI8rwGOYwDx+2y zq&Y_}>A0*KWKG^2lR3}jwjQ*jt9%M0(~ZIuuE5mr`m}7tDqGf89YgUrh-IrUGOe+G z3K1K1m=ehd%6mk|D6SUwY^h7gGYOp`twnuHL*SaqXH4L5!h$M25(=%p?{e*@g^HaW#gZd%D9M4MZ|?+P?5WCE*!uHk)w z%?bNLE%otq((oat&m3m+F`{9T-Pq?90!yB-)!}8;>|woE^=3T8y+|F6{B9Xt^@h0{ zKE*8!pK<;^?q1s+_r|1Al-J@GI>Ez~7jXVw#^(aR%Gq*?yB4;{IpB>5UvRZsnhpz-Oa|xBG!#9HGOd+6mx~>dzjv2Cp zHGI!QLa-Jm17y^mv=tM^XET!D}@L4ew}pPeYT2W(^+zOCMr`hL(p|qv6IQtUy)S nN?Bi7M~sh%v52|fA=#@Da$Ex)Ds{vCc`zM204X-v_q literal 0 HcmV?d00001 diff --git a/bin/com/connor/cust/box/PlmLocale.class b/bin/com/connor/cust/box/PlmLocale.class new file mode 100644 index 0000000000000000000000000000000000000000..e910da3df58fba2d6391dd4c29d4d13249c7ace9 GIT binary patch literal 1019 zcmah{OK;Oa5dJn!;>2~D)Fk0iO4{;B;y}$qh(jxcQ~{S15J5fkwlS-)#gF1_5dA6e z2e|Z5Kq?gnjvV++2r+&@TPUif_0G)hH}icn`~ByauK@1gmW~|5oE!R%8wNobIqqbv zoMHIJdE)u~(B+=ck!PrF^4Hw)crbDv4>yIY7_>-?7#906SPAaCB2Xf7BJMg9B|Yb< z7|F4UwwD=7E3PL4sqPZ0(_LrCuZGWsfhkmUm<;nLW^kjEMq@4As62#G{En6wxz2^aO*IXkO=$jQuQFTuI0q(9kqdM~MWe7jn$d zO6vW$btJt^lm{x30rl$2VZv#U7$0cJLIyEBZ(ZP+GyxEhO%q|Z?A980#1B@+&= zGZe+E3HPYL5w7WbS?+Ey7=v&Ux#EG02~PicVM{SnERbxCUL_+PG##??C_$%1T_mqd zd;FCxwh!YIY9GkS!J>aLIjZ7R5{XmLkTRGXik2|3h&0I3DY1bDS$!?(X5*I~25?{0_y_qN)7ZLt5%t Qp*Xz;W>JzGWae=57yjeZpa1{> literal 0 HcmV?d00001 diff --git a/bin/com/connor/cust/box/XYBOMDialog$1.class b/bin/com/connor/cust/box/XYBOMDialog$1.class new file mode 100644 index 0000000000000000000000000000000000000000..c325007ef8216dbfc41ccd3501a065f24ea1772c GIT binary patch literal 2972 zcmbVO+fx%)82=pz*$`KWDQHpa6_p?wwG}N`s~~7>xD;YQLF`bRKozC>34;?zbRAwMguGl{QDtjoCFY0r0r zaRAL44l-JbTDDB%*K59tcTmHv9yLZfmWscMa;~D zk54wEDsKp<1Zq@oj)ZXn?K(Pentem_1CCvgj<+CiuvDUAqW57yLqGd% zW!iPmXJkQ5H60(ScB?B8HjLfKOs6=KSd<~cSUQf9zN{my;1y4=X!>v=GLhSIb0h?#jK7I6WxP@{euF6ZNI}8TRoHg4kasx>`ZYw ztb|x95apTS6O}Uc3InuCvRN9+e14WVPLhqqeDxZI;uzAvw%hjNL88HY?!xi?)1Yg} zJy)C5lw;5N(=I$@&o~*`W2(^?DZ9UpC_5}$x0T7+E<3(gdQ)~*$1U)J+H7RAt1qqV zuhzn^Kj0&sw(Yr|V-$Q}+%RS^r(ss0X{9QrHEU1HxF5U^njQ{h+gVU(;?(@H95W?u zU*Sc=%I2iol(g;XnZnCEuG8iQwmj z5YQ7AzXiH-9FNk~aGO{AnjkB=t>JTloiAtQz3s=yiQXq&?;?i;uOK!gpBhw0BI*VO zB2jgJ7FXV$?8quU8?lL8b=;ldIl#5P<+H&|IkAGmx{UUcG-$8N%No?a= zFYfEH9Xoj9(8Nw(m-v@5>lwY;GhU?7mCUjEb2J6+zdKws~FDYg}gDh#c z8H3t|sC#*L_t{QT;~2tA{HV}02n`b&rXaYv$s8^*rYfJTe(Rg!lh81|#9D_+bSfa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-U`3hFABBBO-$e{3xxdZ_lj<& zK$^8C`D-JoKU!%I8#-b=&M9p1=A)RzvqJ55A@#Hg6I*3%ydETRh+S3IXHAlLs{uzL zwyr`_*0jz>F^6ZR))>$nVhT-kL)wSuiuc;pdD-<$EJy`~7c6_;K)#|YAs!7nIqgbU zjN&=?f~UxqO()vYa`b|UC0wLibaB*qp2&7o#c1s?>qn$tF!6CI$eolP)H7Bw>!&<# zzR%4JYn>g`wwJejoe|Mbns^Z}v7<`8cwTni@fEhQ)dd|@kX2U6s88c%1D_$0H}0AE zEM6(oXw=SY?Uo^KuU2ytV*@?>oQcol3-s`Ulkw+xyCnt87fpOg6dBU#=%q-0*~C{w zvTja0vvaVnJ6; zTfAW@QCST8a}H^^2-<=ftQRFU-- zrIRQe+SKS;xm1^3(7wn!>L7*#H8I?#pD;x{8oRZ64l`ogudloT2H-iP*=8V+B)J zV2Pkr5ws|nX*?xzc3CcSLvBXoW-4+sO?abPaBd=YXa(nk-S&PNh+j3bPaun(mgwUB%^zczeeReqF-5lA)_uo`|oY#Hqw? zOAx!eg99mYbQ-%D9r0^dS;-B*$o`67{3`nu!tVnO@8c>*VfST@@>?zs_yfnfV14<2 Drq11r literal 0 HcmV?d00001 diff --git a/bin/com/connor/cust/box/XYBOMHandler.class b/bin/com/connor/cust/box/XYBOMHandler.class new file mode 100644 index 0000000000000000000000000000000000000000..593c4b3452ae6b6b2309d6fa9ba59d57c48f3f88 GIT binary patch literal 3083 zcmbVOTUXRp7~O{fGEC!b6zzBc6)yutQ*US)YYPY!3qlzLsa6}p0V0_sO)^~CYHzmI zf6&#pKKa`AL0NV!SNqzx{-N5POu&H|sLPk+oaDQmefGD{`TO5z&jFmrBLy`A2Mwp7 z8IEl`o@NyNK$~8-k0*P$vm_TihGbK|IJq9n6|uDEKEvoRG+k@KzhJ2bZboa%y1rm ztPN&OU*Pb-{}q@MP~@UCiUC7i$_{K?YHws^I(F~8w1Zshz+HV_*DT$h(S|1PN+V#X zRPUl8-GD~Eg0w*UtAtx|X}~V*R?sN0{blI?TG7UW7^J7@c}&;kx|V6^A+Q2xHi;C|DJ-bJ%!zT^aZsfVW4Hrnt&1zV+We{kDj>JZNg1(2 z#k*jmD)YKklta@3$I2NL_e6P{#H32%efGKS1d~o7g>GC{&?9gltZKcK3|ob$yQPX= z^a(VCyAUN`mu-cwl@v}>uCA!)$5nwn1$|ETI5wFyZU(a)`GFoITIpH&rRrh^1nPQ6 zMutXGxQ1Z`LzJB=2p8EP+8`OE&&Y0PQN>3Xp}x6}&z8OwBd0F}+PG;?ISaYU?3G{o ztG3j-Ox*NQf#z!PMrv`{)GcQwg*?VWjU5-bovlW$^)$`B9tA^5nZQj2AFt?AB%!Oq zsp3|o^N}v)1KpS#rP9bGZd3oH=Y`&%s?af6YRVW=fn99MGTkf*SQ-LX2s2xVP2BeC z@=jh)tw>i(H8?1J<-*0{beA%BYD3$Nq=}jQ6=6AA&AS44dIXUsPzpL;Zx;jvX?Lz# zx^Q8eiU@sqR>r5$+RdX(Y>D=4PyU*!}G4^;*80*9(J&swk*6u9?!r|227 z&kXMXJIc?!lOYSJSKW>i_`F@XgEE+Pru-DX#C-+#c$B^5iD}O}b5bkmM@bs`cpq^* z9%cRbO5mq*QH!lh0ZVrl|Hy#j%oW|u8+MK3=#nd|nBOd;Zx!{7L-gpDl{W*K+g6V+ zlK58e9wvD5_uIDgdMw>1nG}4_1Gi$4)yh`zP@rjZQ>t}ojX1=1N>EUN8jg4&<5S^G z<6H1u*Y*_2-=g0sKEvO@ZoI*#S~B2!3ugjbv5i5tb6m^Wjxdb4&ybkti3+zN<)gUyS*h}|Cy4PR{pYy$y Wqpw-cH}Ug3eoJxw06*YIWc~v%mUM0a literal 0 HcmV?d00001 diff --git a/bin/com/connor/cust/box/history_locale.properties b/bin/com/connor/cust/box/history_locale.properties new file mode 100644 index 0000000..9a06b5a --- /dev/null +++ b/bin/com/connor/cust/box/history_locale.properties @@ -0,0 +1,8 @@ +preferr=preferences error! +#XYBOM +ok=ok +err=Error: +cel=cancel +notbom= is not BOMLine! +setbox=Set Box +boxfinish=Box set finished! \ No newline at end of file diff --git a/bin/com/connor/cust/box/history_locale_zh_CN.properties b/bin/com/connor/cust/box/history_locale_zh_CN.properties new file mode 100644 index 0000000..4b66227 --- /dev/null +++ b/bin/com/connor/cust/box/history_locale_zh_CN.properties @@ -0,0 +1,10 @@ +preferr=\u9996\u9009\u9879\u914D\u7F6E\u4E0D\u6B63\u786E +#XYBOM +ok=\u786E\u5B9A +err=\u9519\u8BEF\uFF1A +cel=\u53D6\u6D88 +notbom= \u4E0D\u662FBOM\u884C\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\uFF01 +setbox=\u8BBE\u7F6E\u88C5\u7BB1\u5355 +boxfinish=\u88C5\u7BB1\u5355\u8BBE\u7F6E\u5B8C\u6210\uFF01 +#BoxReport +nottop=\u9009\u4E2D\u5BF9\u8C61\u4E0D\u662FBOM\u9876\u5C42\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\uFF01 \ No newline at end of file diff --git a/bin/com/connor/cust/util/SqlUtil.class b/bin/com/connor/cust/util/SqlUtil.class new file mode 100644 index 0000000000000000000000000000000000000000..6c0eca0e45cb53126d8bc37d65de7a0504f383aa GIT binary patch literal 13839 zcmdU03w%`7ng6~!k2@J|5||KhFks}F$Aka^#e|2DLa);hTfog5}|0*T(W?8#aepV@zI|fL2GOiz&ZO4d~e#F0Zn?E19(J9*9reTpkT| z2cx03rdTi*>I`+oWK0xeMkdBIhI)F#v8IsRb1!RLSXEcU#I;OWO)Kh}Y8qQ=8kszE zTf-e)9kKaLj-uigCTCToEtEw}K7(B3mexpvbn-}RltEeKmDX7X4I@KZV+_hBgDJPJ zqbt3Yl^g zB6g>j#?wTdCNO2&P|09}CedUj5#QX=3GrCYQZJoDMFtg92_TqjtDAtd12vYhNTv_45J0KP^SyxLQ?fN zXc6Tyxmv@Ko{*QS=|Y{rK=XMDp_(17p>83*L5pQ*u6mw=zd0Ig#iUxgN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JtLGisGTx;v=WDb^zD{fAo3u;#9<7`Y zX>0j$Ex^xf>-df3Bew`mcaWMWp@_s-$I=%&dpK5h-jLDlYd=T*?`=chw zP>h4ycM%Rp@P8}(t&!w>k8=Nl@RY?5@;65&|~kB_Uw16#^c#-Shuh2!PXjn-b3dE}VaW zAJr(~{@?$2_iuyyhv5F3;Qk$O|IKj!Fxnmk zH)=cSX6;h?rgk~Ks_mkmX;;uMwW|;YuBCUi-Sk&&4`*rDbB=Zc7ic%}Ioi!!rrpBR zw0%5ZyOpc7+qh1#w`g~9w{{QrYWw+8?LLHo`w<2n;TyFbe5ZDp4`{vI zr#;3`X^-<4wa+KHf4}Yi{kHo*2={+Xx&MCK{rB1KzsGj}OKta$q`CjK*rq&=^9&E| z;T#nbvgl^|z;gdA+x_R;?q6rS|HUcpFXvpN;Z-;A=b=+Zr$78rPM-ml(|s`q2+{e*fyi9HhvI*j`= Ke+7Fc|9=A=^$U~$ literal 0 HcmV?d00001 diff --git a/bin/com/connor/cust/util/TCUtil$1.class b/bin/com/connor/cust/util/TCUtil$1.class new file mode 100644 index 0000000000000000000000000000000000000000..6afc74ab06652e7c1797efadd9d92edac07be51f GIT binary patch literal 1485 zcmbtUTTc@~6#k~Sg|f)CRY3%`Y8MJCczY-zF^$G11x={D_%tk&vbddXcBdxz8;pO# zS6_U==!4*ZI8>2{bKh(ILbhQVLH-A)(yYg;{jKGz))CsrK>g=vQ=w` zA=mKtL=jnxm@qKJFxGOV*y?w8MbPHEo?w`4`40DXc;M=DqRgp%H)NP^{k6P0gFyzA zoZ>83TW2M0@?PbsRKa0=pwenG3~##~$yHzbejMn#9%Wa8cO4;>2<(76_8SpMp%Kzu z`;sn_6cIq%DsW||zA-TEMdDe_5tMM*K$&4`K%XYA;3~sVN2nd{^{J=nsulO1nq1w$ z?74x)^%gOMITP10Pp~9_wta?D0!z9z4c$_zZ~Ry z5s(<}rYnxwnjTN0v6@AYt%-3=Fci1_e&C2_u4dy%O#KxNF~hsx5lq#r84&Y+J*7RR z-bFguAZm|2m5%3!g!86Q`~IGRWrkTA&!66_2^;t53AP)dA1H>s>g)ezu=TI53}#bG z5i~p=h9Wd@pJDVIK^gMVQzTMsiBLWFLxlyxKT9i5pQ0=+`ZmyMm?WEaMtgqo3yPmf z$iSrkf>yHk7$w<^4R8r#bRs@uf~+PZ+o>o>kIp)5dFd;r8ICbiI}wg>?GxQ(Q&B%e zQ5Ry5Br5q*kvF1DW!xkwgIhWx?eSgZ^sa);_!Fw)HfeMV%M?jxA6;BJMyW>Y2zPYS sR4ZhvThYPts78{Nw6KUJI_FTs3RX#)BrA=G{*|zX2ZdogBsqiHFR9Lh-v9sr literal 0 HcmV?d00001 diff --git a/bin/com/connor/cust/util/TCUtil.class b/bin/com/connor/cust/util/TCUtil.class new file mode 100644 index 0000000000000000000000000000000000000000..ce5060b3bd110b556b4fce7fdacb0c3cafaa5b61 GIT binary patch literal 22519 zcmcJ131C#!_4hgV&CHvbJhp@YBciCt5)#59K@$Wa1PLSo2@>N{7?KH$Br|bl!ctpT zT&s0oz?D`@>(bJy1A_+YEv#MZSCj%uBJC-RPMS1=sh|t1>>WQH1#+^Zf^;+; zW6~(56J!U6Aj+a+X*76%-7MSK9?25HG<$qa*JAalL^QU#zdMkbDoi?_X=-02WEacQ zE(3#f9F4K)L>dd0HYFnA6gU;>8{zCsOC#%|g7wml)<}P;&8`l-&7{pMrW5;QR)(b@ zalIo1llvTyrO>@va8S4^hq+Qk|N2*_B5fJ` z4+DFlydp@GX{t$6m?j;b#8@VR znjv=0lMJr|@BIl!_L-*jkG5_MgX}{ZZRjTTZ@eRRP@6#z!X?Q_M{|6BytO%!V2bq< z{fZ+tGVb*tKeK6$NvAN2V>eUDzB9-AJ1l`vj z2D=a?jLXHW-dlxyLN_vW*BHF|F*UuDQqe*Wkzs6@EG&46Lr5Q@5f`ue+iJ z%`0GVg49YelR!i++3(E@HwmJHai#^igz88jH0c7S2|)0mF;7 zwp1To9Sf&A5>S~9|8rVq_Ew|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pyW8zZ#497Zo2A>$}ebu8^SMjA)MY>lTq#whhK z2+`Rvezk@aL=$i>yNqKo$3|KPgE$mxTtcQXGZI$=v_M@X)#1x4MQi;Mp^}4AJnCdN4eJUz%94`j&M1liG2|Gt8)4+3H zbTj!Q{IiYR6p7>yIW2h%)EP+`V~i8=y_^Ob6N!yt{W(d0PS&4O_2)^h&oX^|vi>Z0 zUAtRm>h@X2X_&hlbhY3c|EUAU9HSCi@hQINk(_LpV^rbyTlk)j-=`bZ#v%%-jX0@L P;|mzI7=)*Gs^$LyVMR1} literal 0 HcmV?d00001 diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..0d3d3a7 --- /dev/null +++ b/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/ diff --git a/icons/sample.png b/icons/sample.png new file mode 100644 index 0000000000000000000000000000000000000000..02c4b79e10986d56bda97051eb0da2e9119c97f5 GIT binary patch literal 332 zcmV-S0ki&zP)o}PQ;SW4Q?|D@o|!n4bZ+dmjHl(fFnOU>N3Hz|3`e^PLI_Tklq z9dEUPF8GjIQ2+RLZpDrNq~L=3C%1s!j|YcCWZ+aA5&{s6WBjJ7phjchl+7dD zK%??C5t{FV)M8Cck-?KSfC{eT(i|B$Wp$+QOcA_!0hFXcX&$6FDqzZKU<%z0%uwCY e0aKi5l4}7X=XWJ6VmxR70000{ZT)6VX-X|e!skhH1SmmK(Q+8xOk9EsoDx9;%V9VIujLL74J^=XMJoq9 z1|@9VK_4(VhK80y5@pbo6ckI-X8va_ZhIdO!f9Fi&L*dB`%g;@wBtO?KClDIJKpgF zIsXR&gB_67@QMe>IbYQF_DWvOz5n#UMXhhIg6u>s=Yd5ht>Yhtu@=)Y0h1l*%f Qr~m)}07*qoM6N<$f|JJHQ2+n{ literal 0 HcmV?d00001 diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..d47df30 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + <--> + + + + + + + + + + + + + + + + + + + diff --git a/src/com/connor/cust/Activator.java b/src/com/connor/cust/Activator.java new file mode 100644 index 0000000..eb5d138 --- /dev/null +++ b/src/com/connor/cust/Activator.java @@ -0,0 +1,44 @@ +package com.connor.cust; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "com.connor.cust"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/src/com/connor/cust/box/BoxReportHandler.java b/src/com/connor/cust/box/BoxReportHandler.java new file mode 100644 index 0000000..cbd974f --- /dev/null +++ b/src/com/connor/cust/box/BoxReportHandler.java @@ -0,0 +1,53 @@ +package com.connor.cust.box; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; + +import com.teamcenter.rac.aif.AIFDesktop; +import com.teamcenter.rac.aif.AbstractAIFUIApplication; +import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent; +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCComponentBOMLine; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.MessageBox; +/** + * : װ䵥 + * :2024-01-05 + * @author  + * + * ޸ ޸ ޸ + * 2019-01-24 XXXX + */ +public class BoxReportHandler extends AbstractHandler{ + + @Override + public Object execute(ExecutionEvent arg0) throws ExecutionException { + System.out.println("BoxReportHandler"); + AIFDesktop desktop = AIFUtility.getActiveDesktop(); + try { + AbstractAIFUIApplication app = AIFUtility.getCurrentApplication(); + TCSession session = (TCSession) app.getSession(); + InterfaceAIFComponent target = app.getTargetComponent(); + if(target == null || !(target instanceof TCComponentBOMLine)) { + MessageBox.post(desktop, PlmLocale.getString("nottop"), "ERROR", MessageBox.ERROR);//ѡжBOM㣬ѡ + return null; + } + TCComponentBOMLine bom = (TCComponentBOMLine) target; + if(bom.parent() != null) { + MessageBox.post(desktop, PlmLocale.getString("nottop"), "ERROR", MessageBox.ERROR);//ѡжBOM㣬ѡ + return null; + } + String[] options = session.getPreferenceService().getStringValues("KWC_ReportTemplate_XYBOX"); + if(options == null || options.length < 2) { + MessageBox.post(desktop, "KWC_ReportTemplate_XYBOX" + PlmLocale.getString("preferr"), "ERROR", MessageBox.ERROR); + return null; + } +// new XYBOMDialog(session, targets); + } catch(Exception e) { + e.printStackTrace(); + MessageBox.post(desktop, PlmLocale.getString("err") + e.getMessage(), "ERROR", MessageBox.ERROR); + } + return null; + } +} diff --git a/src/com/connor/cust/box/PlmLocale.java b/src/com/connor/cust/box/PlmLocale.java new file mode 100644 index 0000000..f9314fd --- /dev/null +++ b/src/com/connor/cust/box/PlmLocale.java @@ -0,0 +1,29 @@ +package com.connor.cust.box; + +import com.teamcenter.rac.util.Registry; + +/** + * : ӢĻл + * :2019-02-26 + * @author + * + * ޸ ޸ ޸ + * 2019-01-24 XXXX + */ +public class PlmLocale { + + public static final Registry reg = Registry.getRegistry(PlmLocale.class); + + public static String getString(String title) { + if (isEmpty(title)) { + return ""; + } else { + String res = reg.getString(title); + return isEmpty(res) ? title : res; + } + } + + private static boolean isEmpty(String title) { + return title == null || "".equals(title.trim()); + } +} diff --git a/src/com/connor/cust/box/XYBOMDialog.java b/src/com/connor/cust/box/XYBOMDialog.java new file mode 100644 index 0000000..766d579 --- /dev/null +++ b/src/com/connor/cust/box/XYBOMDialog.java @@ -0,0 +1,105 @@ +package com.connor.cust.box; + +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JLabel; + +import com.connor.cust.util.TCUtil; +import com.teamcenter.rac.aif.AbstractAIFDialog; +import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent; +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCComponentBOMLine; +import com.teamcenter.rac.kernel.TCComponentListOfValues; +import com.teamcenter.rac.kernel.TCComponentListOfValuesType; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.MessageBox; +/** + * : BOMװ䵥д + * :2024-01-04 + * @author  + * + * ޸ ޸ ޸ + * 2019-01-24 XXXX + */ +public class XYBOMDialog extends AbstractAIFDialog { + private static final long serialVersionUID = 1L; +// private TCSession session; + private JButton cancelBtn; + private JButton okBtn; + private JComboBox box; + + public XYBOMDialog(TCSession session, InterfaceAIFComponent[] targets) throws Exception { + super(AIFUtility.getActiveDesktop()); +// this.session = session; + setTitle(PlmLocale.getString("setbox")); + +// JLabel label1 = new JLabel("Դ"); +// add(label1); +// label1.setBounds(20, 20, 90, 23); + box = new JComboBox<>(); + box.setEditable(true); + box.addItem(""); + TCComponentListOfValuesType lovType = (TCComponentListOfValuesType)session.getTypeComponent("ListOfValues"); + TCComponentListOfValues[] lovs = lovType.find("KWC6_DTLOV_ZXBOX"); + if(lovs.length > 0) { + for(String s : TCUtil.getDynamicLOV(session, lovs[0])) { + box.addItem(s); + } + } + add(box); + box.setBounds(30, 20, 200, 23); + + okBtn = new JButton(PlmLocale.getString("ok")); + add(okBtn); + okBtn.setBounds(30, 100, 80, 23); + cancelBtn = new JButton(PlmLocale.getString("cel")); + add(cancelBtn); + cancelBtn.setBounds(150, 100, 80, 23); + add(new JLabel("")); + + addActionListener(session, targets); + + pack(); + setSize(new Dimension(350, 200)); + setDefaultLookAndFeelDecorated(true); + Dimension screen = getToolkit().getScreenSize(); + setLocation((screen.width - getSize().width) / 2, (screen.height - getSize().height) / 2); +// setAlwaysOnTop(true); + setVisible(true); + } + + private void addActionListener(TCSession session, InterfaceAIFComponent[] targets) { + okBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + String value = box.getSelectedItem().toString(); + TCUtil.setByPass(session, true); + for(InterfaceAIFComponent t : targets) { + ((TCComponentBOMLine)t).setProperty("XYBOX", value); + } + MessageBox.post(XYBOMDialog.this, PlmLocale.getString("boxfinish"), "INFO", MessageBox.INFORMATION);//װ䵥ɣ + } catch (Exception e1) { + e1.printStackTrace(); + MessageBox.post(XYBOMDialog.this, PlmLocale.getString("err") + e1.getMessage(), "ERROR", MessageBox.ERROR); + }finally { + try { + TCUtil.setByPass(session, false); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + } + }); + cancelBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + dispose(); + } + }); + } +} \ No newline at end of file diff --git a/src/com/connor/cust/box/XYBOMHandler.java b/src/com/connor/cust/box/XYBOMHandler.java new file mode 100644 index 0000000..61c6302 --- /dev/null +++ b/src/com/connor/cust/box/XYBOMHandler.java @@ -0,0 +1,46 @@ +package com.connor.cust.box; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; + +import com.teamcenter.rac.aif.AIFDesktop; +import com.teamcenter.rac.aif.AbstractAIFUIApplication; +import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent; +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCComponentBOMLine; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.MessageBox; +/** + * : BOMװ䵥д + * :2024-01-04 + * @author  + * + * ޸ ޸ ޸ + * 2019-01-24 XXXX + */ +public class XYBOMHandler extends AbstractHandler{ + + @Override + public Object execute(ExecutionEvent arg0) throws ExecutionException { + System.out.println("XYBOMHandler"); + AIFDesktop desktop = AIFUtility.getActiveDesktop(); + try { + AbstractAIFUIApplication app = AIFUtility.getCurrentApplication(); + TCSession session = (TCSession) app.getSession(); + InterfaceAIFComponent[] targets = app.getTargetComponents(); + for(InterfaceAIFComponent t : targets) { + if(!(t instanceof TCComponentBOMLine)) { + MessageBox.post(desktop, t + PlmLocale.getString("notbom"), "ERROR", MessageBox.ERROR);// BOMУѡ + return null; + } + } + + new XYBOMDialog(session, targets); + } catch(Exception e) { + e.printStackTrace(); + MessageBox.post(desktop, PlmLocale.getString("err") + e.getMessage(), "ERROR", MessageBox.ERROR); + } + return null; + } +} diff --git a/src/com/connor/cust/box/history_locale.properties b/src/com/connor/cust/box/history_locale.properties new file mode 100644 index 0000000..9a06b5a --- /dev/null +++ b/src/com/connor/cust/box/history_locale.properties @@ -0,0 +1,8 @@ +preferr=preferences error! +#XYBOM +ok=ok +err=Error: +cel=cancel +notbom= is not BOMLine! +setbox=Set Box +boxfinish=Box set finished! \ No newline at end of file diff --git a/src/com/connor/cust/box/history_locale_zh_CN.properties b/src/com/connor/cust/box/history_locale_zh_CN.properties new file mode 100644 index 0000000..4b66227 --- /dev/null +++ b/src/com/connor/cust/box/history_locale_zh_CN.properties @@ -0,0 +1,10 @@ +preferr=\u9996\u9009\u9879\u914D\u7F6E\u4E0D\u6B63\u786E +#XYBOM +ok=\u786E\u5B9A +err=\u9519\u8BEF\uFF1A +cel=\u53D6\u6D88 +notbom= \u4E0D\u662FBOM\u884C\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\uFF01 +setbox=\u8BBE\u7F6E\u88C5\u7BB1\u5355 +boxfinish=\u88C5\u7BB1\u5355\u8BBE\u7F6E\u5B8C\u6210\uFF01 +#BoxReport +nottop=\u9009\u4E2D\u5BF9\u8C61\u4E0D\u662FBOM\u9876\u5C42\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\uFF01 \ No newline at end of file diff --git a/src/com/connor/cust/util/SqlUtil.java b/src/com/connor/cust/util/SqlUtil.java new file mode 100644 index 0000000..f03b763 --- /dev/null +++ b/src/com/connor/cust/util/SqlUtil.java @@ -0,0 +1,684 @@ +package com.connor.cust.util; + +import java.io.Reader; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.Statement; +import java.sql.Timestamp; +import java.sql.Types; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; + +public class SqlUtil { + + public static Connection connection = null; + public static PreparedStatement ps = null; + public static ResultSet rs = null; +// public static Registry reg = Registry.getRegistry(SqlUtil.class); + public static int ORACLE = 1; + public static int SQLSERVER = 2; + +// public static Connection getConnection(int dbType) { +// if (dbType == ORACLE) { +// return getOracleConnection(); +// } else if (dbType == SQLSERVER) { +// return getSqlserverConnection(); +// } +// return null; +// } + + public static Date getDate(java.sql.Date date) { + if (date == null) { + return null; + } + return new Date(date.getTime()); + } + + /** + * ݿ + + public static Connection getSqlserverConnection() { + String driver = reg.getString("SQL.SQLSERVER.DRIVER"); + String url = reg.getString("SQL.SQLSERVER.URL"); + String user = reg.getString("SQL.SQLSERVER.USER"); + String password = reg.getString("SQL.SQLSERVER.PASSWORD"); + System.out.println("ݿϢ"); + System.out.println("DRIVER: " + driver); + System.out.println("URL: " + url); + System.out.println("USER: " + user); + if (connection != null) { + try { + connection.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + connection = null; + } + try { + // + Class.forName(driver); + connection = DriverManager.getConnection(url, user, password); + connection.setAutoCommit(false); + } catch (Exception e) { + e.printStackTrace(); + } + return connection; + }*/ + + public static Connection getSqlserverConnection(String driver, String url, String user, String password) { +// String driver = reg.getString("SQL.SQLSERVER.DRIVER"); +// String url = reg.getString("SQL.SQLSERVER.URL"); +// String user = reg.getString("SQL.SQLSERVER.USER"); +// String password = reg.getString("SQL.SQLSERVER.PASSWORD"); + System.out.println("ݿϢ"); +// System.out.println("DRIVER: " + driver); +// System.out.println("URL: " + url); +// System.out.println("USER: " + user); + if (connection != null) { + try { + connection.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + connection = null; + } + try { + // + Class.forName(driver); + connection = DriverManager.getConnection(url, user, password); + connection.setAutoCommit(false); + } catch (Exception e) { + e.printStackTrace(); + } + return connection; + } + + public static Connection getOracleConnection(String url, String user, String password) throws Exception { + String driver = "oracle.jdbc.driver.OracleDriver"; + System.out.println("ݿϢ"); + System.out.println("DRIVER: " + driver); + System.out.println("URL: " + url); + System.out.println("USER: " + user); + if (connection != null) { + try { + connection.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + connection = null; + } + // + Class.forName(driver); + // 1.getConnection()MySQLݿ⣡ + connection = DriverManager.getConnection(url, user, password); + connection.setAutoCommit(false); + + return connection; + } + + /* + public static Connection getOracleConnection() { + // String driver = reg.getString("SQL.ORACLE.DRIVER"); + String url = reg.getString("SQL.ORACLE.URL"); + String user = reg.getString("SQL.ORACLE.USER"); + String password = reg.getString("SQL.ORACLE.PASSWORD"); +// if(prefs!=null&&prefs.length==5) { +// url = "jdbc:oracle:thin:@"+prefs[0]+":"+prefs[1]+":"+prefs[2]; +// user = prefs[3]; +// password = prefs[4]; +// } + return getOracleConnection(url, user, password); + }*/ + + /** + * ˽йnew󣬷ֹö + */ + private SqlUtil() { + } + + /** + * ƴSELECT + * + * @param tableName + * @param selectElement + * @param args + * @return + */ + public static String getSelectSql(String tableName, String[] selectElement, String... args) { + StringBuffer valuesSB = new StringBuffer("SELECT "); + if (selectElement != null) { + for (String element : selectElement) { + valuesSB.append(element).append(","); + } + valuesSB.delete(valuesSB.length() - 1, valuesSB.length()); + } + valuesSB.append(" FROM "); + valuesSB.append(tableName); + valuesSB.append(" WHERE"); + for (int i = 0; i < args.length; i++) { + valuesSB.append(" "); + valuesSB.append(args[i]); + valuesSB.append("=? "); + valuesSB.append("AND"); + } + + valuesSB.delete(valuesSB.length() - 3, valuesSB.length()); + return valuesSB.toString(); + } + + /** + * ƴSELECT + * + * @param tableName + * @param args + * @return + */ + public static String getSelectSql(String tableName, String... args) { + StringBuffer valuesSB = new StringBuffer("SELECT * FROM "); + valuesSB.append(tableName); + valuesSB.append(" WHERE"); + for (int i = 0; i < args.length; i++) { + valuesSB.append(" "); + valuesSB.append(args[i]); + valuesSB.append("=? "); + valuesSB.append("AND"); + } + + valuesSB.delete(valuesSB.length() - 3, valuesSB.length()); + return valuesSB.toString(); + } + + /** + * ƴӸ + * + * @param tableName + * @param args + * @param args2 + * @return + */ + public static String getUpdataSQL(String tableName, String[] args, String[] args2) { + StringBuffer updateSB = new StringBuffer("UPDATE "); + updateSB.append(tableName); + updateSB.append(" SET "); + // ƴӸ + for (int i = 0; i < args.length; i++) { + if (args[i].toUpperCase().equals("CREATED_DATE") || args[i].toUpperCase().equals("LAST_UPDATE_DATE")) { + updateSB.append(args[i]).append("=to_date(?,'yyyy-MM-dd HH24:mi:ss') ,"); + } else { + updateSB.append(args[i]).append("=? ,"); + } + } + updateSB.delete(updateSB.length() - 2, updateSB.length()); + ; + updateSB.append(" WHERE "); + for (int i = 0; i < args2.length; i++) { + updateSB.append(args2[i]).append("=? AND "); + } + updateSB.delete(updateSB.length() - 4, updateSB.length()); + return updateSB.toString(); + } + + /** + * ƴSQLinsert + * + * @param tableName + * @param args + * @return + */ + public static String getInsertSql(String tableName, String... args) { + StringBuffer insertSql = new StringBuffer("insert into "); + StringBuffer values = new StringBuffer("values("); + + if (tableName != null && args != null && args.length > 0) { + insertSql.append(tableName); + insertSql.append("("); + for (int i = 0; i < args.length; i++) { + insertSql.append(args[i]); + insertSql.append(", "); + if (args[i].toUpperCase().equals("LAST_UPDATE_DATE") || args[i].toUpperCase().equals("CREATED_DATE")) { + values.append("to_date(?,'yyyy-MM-dd HH24:mi:ss'), "); + } else { + values.append("?, "); + } + + } + } else { + return null; + } + insertSql.delete(insertSql.length() - 2, insertSql.length()); + values.delete(values.length() - 2, values.length()); + insertSql.append(") ").append(values).append(")"); + return insertSql.toString(); + } + + /** + * õݿ + * + * @param tableName + * @param args + * + * @param args2 + * + * @return ƴӺĴݿ + */ + public final static String GetCreateTableSQL(String tableName, String[] args, String[] args2) { + + if (args == null || args2 == null || args.length != args2.length) { + System.out.println("THE INPUT PRAGREMS IS ERROR"); + return null; + } + StringBuffer createSQL = new StringBuffer("create table "); + createSQL.append(tableName); + createSQL.append("("); + for (int i = 0; i < args.length; i++) { + createSQL.append(args[i] + " "); + createSQL.append(args2[i] + ", "); + } + createSQL.delete(createSQL.length() - 2, createSQL.length()); + createSQL.append(")"); + return createSQL.toString(); + } + + /** + * õStatement + */ + public final static PreparedStatement getPs(String sql) throws Exception { + return getPs(sql, null); + } + + /** + * õStatement + */ + public final static PreparedStatement getPs(Object[] argments, String sql) throws Exception { + return getPs(sql, argments); + } + + /** + * õStatement + */ + public final static PreparedStatement getPs(String sql, Object[] argments) throws Exception { + SqlUtil.ps = SqlUtil.connection.prepareStatement(sql); + if (argments != null) { + for (int i = 0; i < argments.length; i++) { + SqlUtil.ps.setObject(i + 1, argments[i]); + } + } + return SqlUtil.ps; + } + + /** + * + */ + public final static int write(String sql) { + return write(sql, null); + } + + /** + * + */ + public final static int write(Object[] argments, String sql) { + return write(sql, argments); + } + + /** + * + */ + public final static int write(String sql, Object[] argments) { + + return update(sql, argments); + } + + /** + * ɾ + */ + public final static int delete(String sql) { + return delete(sql, null); + } + + /** + * ɾ + */ + public final static int delete(Object[] argments, String sql) { + return delete(sql, argments); + } + + /** + * ɾ + */ + public final static int delete(String sql, Object[] argments) { + return update(sql, argments); + } + + /** + * ޸ + */ + public final static int update(String sql) { + return update(sql, null); + } + + /** + * ޸ + */ + public final static int update(String[] argments, String sql) { + return update(sql, argments); + } + + /** + * ޸(ɾնҪô˷˴쳣رճConnectionΪĶ) + */ + public final static int update(String sql, Object[] argments) { + int i = -1; + try { + i = SqlUtil.getPs(argments, sql).executeUpdate(); + SqlUtil.connection.commit(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + free(SqlUtil.rs, SqlUtil.ps); + } + return i; + } + + /** + * ѯ + */ + public final static ResultSet read(String sql) throws Exception { + return read(sql, null); + } + + /** + * ѯ + */ + public final static ResultSet read(Object[] argments, String sql) throws Exception { + return read(sql, argments); + } + + /** + * ѯ(вѯնҪô˷治쳣׳ɵߴfinallyͷԴ) + * + * @throws SQLException + */ + public final static ResultSet read(String sql, Object[] argments) throws Exception { + System.out.println("argments=" + argments.length); + return SqlUtil.rs = SqlUtil.getPs(argments, sql).executeQuery(); + } + + /** + * + */ + public final static boolean createTable(String sql) { + return go(sql, null); + } + + /** + * ɾ + */ + public final static boolean dropTable(String sql) { + return go(sql, null); + } + + /** + * ޸ı + */ + public final static boolean alterTable(String sql) { + return go(sql, null); + } + + /** + * ˷ִDDL(,޸ı,ɾ) + */ + private final static boolean go(String sql, Object[] argments) { + boolean flag = false; + try { + flag = SqlUtil.getPs(sql, argments).execute(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + free(SqlUtil.rs, SqlUtil.ps); + } + if (flag) { + try { + SqlUtil.connection.commit(); + } catch (Exception e) { + e.printStackTrace(); + } + } + return flag; + } + + /** + * ͷԴ + */ + public final static void free(ResultSet resultSet) { + free(resultSet, null, null); + } + + /** + * ͷԴ + */ + public final static void free(Statement statement) { + free(null, statement, null); + } + + /** + * ͷԴ + */ + public final static void free(Connection connection) { + free(null, null, connection); + } + + /** + * ͷԴ + */ + public final static void free(ResultSet resultSet, Statement statement) { + free(resultSet, statement, null); + } + + /** + * ͷԴ + */ + public final static void free(Statement statement, Connection connection) { + free(null, statement, connection); + } + + /** + * ͷԴ(Ĭϲ) + */ + public final static void free() { + free(SqlUtil.rs, SqlUtil.ps); + } + + /** + * ͷԴ(ȫͷ) + */ + public final static void freeAll() { + free(SqlUtil.rs, SqlUtil.ps, SqlUtil.connection); + } + + /** + * ͷԴ(ҲҪȫͷ) + */ + public final static void free(ResultSet resultSet, Statement statement, Connection connection) { + try { + if (resultSet != null) { + try { + resultSet.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } finally { + try { + if (statement != null) { + try { + statement.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } finally { + if (connection != null) { + try { + connection.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + } + public static ArrayList> getDBInfo(Connection connection, String sql) throws Exception { + if (connection == null) { + throw new Exception("޷ȡݿϢ"); + } + + ArrayList> vecData = new ArrayList>(); + Statement statement = connection.createStatement(); + ResultSet rs = statement.executeQuery(sql); + + ResultSetMetaData meta = rs.getMetaData(); + String[] columnNames = new String[meta.getColumnCount()]; + int[] columnTypes = new int[meta.getColumnCount()]; + + for (int i = 0; i < columnNames.length; i++) { + columnNames[i] = meta.getColumnName(i + 1); + columnTypes[i] = meta.getColumnType(i + 1); +// System.out.println("columnTypes"+i+"=="+columnTypes[i]); + } + + while (rs.next()) { + HashMap dataTable = new HashMap(); + + for (int i = 0; i < columnNames.length; i++) { + Object value = null; + switch (columnTypes[i]) { + case Types.NVARCHAR: + case Types.VARCHAR: + value = rs.getString(columnNames[i]); + if (value == null) { + value = ""; + } + break; + case Types.INTEGER: + case Types.NUMERIC: + value = rs.getInt(columnNames[i]); + break; + case Types.DATE: + Timestamp timestamp = rs.getTimestamp(columnNames[i]); + if (timestamp != null) { + value = new Date(timestamp.getTime()); + } + break; + case Types.TIMESTAMP: + value = rs.getTimestamp(columnNames[i]); + break; + case Types.CLOB: + Clob clob = rs.getClob(columnNames[i]); + if (clob != null) { + Reader inStream = clob.getCharacterStream(); + char[] c = new char[(int) clob.length()]; + inStream.read(c); + value = new String(c); + inStream.close(); + } + if (value == null) { + value = ""; + } + break; + default: + value = ""; + break; + } +// if (value == null) { +// value = ""; +// } + dataTable.put(columnNames[i], value); +// System.out.println("data"+columnNames[i]+"=="+columnTypes[i]); + } + vecData.add(dataTable); + } + rs.close(); + statement.close(); + return vecData; + } + public static List getArrayDBInfo(Connection connection, String sql) throws Exception { + if (connection == null) { + throw new Exception("޷ȡݿϢ"); + } + + List vecData = new LinkedList<>(); + Statement statement = connection.createStatement(); + ResultSet rs = statement.executeQuery(sql); + + ResultSetMetaData meta = rs.getMetaData(); + String[] columnNames = new String[meta.getColumnCount()]; + int[] columnTypes = new int[meta.getColumnCount()]; + + for (int i = 0; i < columnNames.length; i++) { + columnNames[i] = meta.getColumnName(i + 1); + columnTypes[i] = meta.getColumnType(i + 1); + } + + while (rs.next()) { + Object[] result = new Object[columnNames.length]; + + for (int i = 0; i < columnNames.length; i++) { + Object value = null; + switch (columnTypes[i]) { + case Types.VARCHAR: + value = rs.getString(columnNames[i]); + if (value == null) { + value = ""; + } + break; + case Types.INTEGER: + case Types.NUMERIC: + value = rs.getInt(columnNames[i]); + break; + case Types.DATE: + Timestamp timestamp = rs.getTimestamp(columnNames[i]); + if (timestamp != null) { + value = new Date(timestamp.getTime()); + } + break; + case Types.TIMESTAMP: + value = rs.getTimestamp(columnNames[i]); + break; + case Types.CLOB: + Clob clob = rs.getClob(columnNames[i]); + if (clob != null) { + Reader inStream = clob.getCharacterStream(); + char[] c = new char[(int) clob.length()]; + inStream.read(c); + value = new String(c); + inStream.close(); + } + if (value == null) { + value = ""; + } + break; + default: + value = ""; + break; + } +// if (value == null) { +// value = ""; +// } +// dataTable.put(columnNames[i], value); +// System.out.println("data"+columnNames[i]+"=="+columnTypes[i]); + result[i] = value; + } + vecData.add(result); + } + rs.close(); + statement.close(); + return vecData; + } +} diff --git a/src/com/connor/cust/util/TCUtil.java b/src/com/connor/cust/util/TCUtil.java new file mode 100644 index 0000000..08fbff1 --- /dev/null +++ b/src/com/connor/cust/util/TCUtil.java @@ -0,0 +1,490 @@ +package com.connor.cust.util; + +import java.awt.Frame; +import java.io.BufferedReader; +import java.io.File; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Vector; + +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JTable; +import javax.swing.filechooser.FileNameExtensionFilter; +import javax.swing.filechooser.FileSystemView; + +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; + +import com.teamcenter.rac.aif.kernel.AIFComponentContext; +import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent; +import com.teamcenter.rac.kernel.ListOfValuesInfo; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCComponentBOMLine; +import com.teamcenter.rac.kernel.TCComponentBOMWindow; +import com.teamcenter.rac.kernel.TCComponentBOMWindowType; +import com.teamcenter.rac.kernel.TCComponentContextList; +import com.teamcenter.rac.kernel.TCComponentDataset; +import com.teamcenter.rac.kernel.TCComponentDatasetType; +import com.teamcenter.rac.kernel.TCComponentForm; +import com.teamcenter.rac.kernel.TCComponentItemRevision; +import com.teamcenter.rac.kernel.TCComponentListOfValues; +import com.teamcenter.rac.kernel.TCComponentListOfValuesType; +import com.teamcenter.rac.kernel.TCComponentPseudoFolder; +import com.teamcenter.rac.kernel.TCComponentQuery; +import com.teamcenter.rac.kernel.TCComponentQueryType; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCQueryClause; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.MessageBox; +import com.teamcenter.services.rac.core.LOVService; +import com.teamcenter.services.rac.core._2013_05.LOV.InitialLovData; +import com.teamcenter.services.rac.core._2013_05.LOV.LOVSearchResults; +import com.teamcenter.services.rac.core._2013_05.LOV.LOVValueRow; +import com.teamcenter.services.rac.core._2013_05.LOV.LovFilterData; + +public class TCUtil { + public static final int MINWIDTH = 1280; + public static final int MINHEIGHT = 768; + + public static TCComponentBOMWindow getWindow(TCSession session) throws Exception{ + TCComponentBOMWindow window = null; + TCComponentBOMWindowType bomWinType = (TCComponentBOMWindowType) session.getTypeComponent("BOMWindow"); + window = bomWinType.create(null); + return window; + } + + public static TCComponentBOMLine getBOMLine(TCSession session,TCComponentBOMWindow window, TCComponentItemRevision revision) + throws Exception { + TCComponentBOMLine bomLine = window.setWindowTopLine(null, revision, null, null); + window.save(); + return bomLine; + } + public static TCComponentPseudoFolder getPseudoFolder(TCComponent parent, String relation) throws Exception { + TCComponentPseudoFolder pseudoFolder = null; + AIFComponentContext[] comps = parent.getChildren(); + if (comps != null && comps.length > 0 && comps[0] != null) { + for (int i = 0; i < comps.length; i++) { + TCComponent comp = (TCComponent) comps[i].getComponent(); + if (comp instanceof TCComponentPseudoFolder) { + if (comp.isTypeOf("PseudoFolder")) { +// System.out.println("PseudoFolder type:" + comp.getDefaultPasteRelation()); + if (comp.getDefaultPasteRelation().equalsIgnoreCase(relation)) { + pseudoFolder = (TCComponentPseudoFolder) comp; + break; + } + } + } + } + } + return pseudoFolder; + } + public static TCComponentForm getItemRevisionMasterForm(TCComponentItemRevision revision) throws Exception { + if (revision != null) { + AIFComponentContext[] contexts = revision.getChildren("IMAN_master_form_rev"); + if (contexts != null && contexts.length > 0) { + InterfaceAIFComponent component = contexts[0].getComponent(); + if (component instanceof TCComponentForm) { + return (TCComponentForm) component; + } + } + } + return null; + } + + public static LinkedHashMap getlovValues(TCSession session, String lovName) throws TCException { + LinkedHashMap lovVal = new LinkedHashMap(); + TCComponentListOfValuesType lovType = (TCComponentListOfValuesType) session.getTypeComponent("ListOfValues"); + TCComponentListOfValues[] lovs = lovType.find(lovName); + if (lovs != null && lovs.length > 0) { + TCComponentListOfValues lov = lovs[0]; + ListOfValuesInfo lovInfo = lov.getListOfValues(); + String[] code = lovInfo.getStringListOfValues(); + String[] name = lovInfo.getLOVDisplayValues(); + if (code != null && name != null) { + for (int i = 0; i < code.length; i++) { + // System.out.printf("code[%d]=%s name[%d]=%s \n", i, code[i], i, name[i]); + lovVal.put(code[i], name[i]); + } + } + return lovVal; + } + return null; + } + + public static String getTableValue(JTable table, int row, int col){ + Object val = table.getValueAt(row, col); + if(val==null) + return ""; + else + return val.toString(); + } + /** + * ѯѯ + * @param session TCSession + * @param queryName ѯ + * @param aKey ѯĿ + * @param aVal ѯֵ + * @return ѯ + */ + public static TCComponent[] query(TCSession session, String queryName, String[] aKey, String[] aVal) throws Exception { + TCComponentQueryType imanQueryType = (TCComponentQueryType) session.getTypeComponent("ImanQuery"); + TCComponentQuery imancomponentquery = (TCComponentQuery) imanQueryType.find(queryName); + if (imancomponentquery == null) { + throw new Exception("δҵѯ " + queryName + "!"); + } + aKey = session.getTextService().getTextValues(aKey); +// for (int i = 0; i < aKey.length; i++) { +// System.out.println(aKey[i] + "===============" + aVal[i]); +// } + TCComponentContextList componentContextList = imancomponentquery.getExecuteResultsList(aKey, aVal); + return componentContextList.toTCComponentArray(); + } + /** + * ѯѯֲ֧ѯĬ + * @param session TCSession + * @param queryName ѯ + * @param Keys ѯĿ + * @param Vals ѯֵ + * @return ѯ + */ + public static TCComponent[] query(TCSession session, String queryName, Vector Keys, Vector Vals) throws Exception { + TCComponentQueryType imanQueryType = (TCComponentQueryType) session.getTypeComponent("ImanQuery"); + TCComponentQuery imancomponentquery = (TCComponentQuery) imanQueryType.find(queryName); + if (imancomponentquery == null) { + System.out.println("δҵѯ" + queryName); + throw new Exception("Query:"+queryName+" cannot find"); + } + TCQueryClause[] qc = imancomponentquery.describe(); +// Map clauseMap = new HashMap<>(); + for(TCQueryClause c : qc) { + String key = c.getUserEntryNameDisplay(); + String value = c.getDefaultValue(); +// System.out.println(key + "==>" + c.getAttributeName()); + if(!value.trim().isEmpty() && !Keys.contains(key)) { + if(key.isEmpty()) + Keys.add(c.getAttributeName()); + else + Keys.add(key); + Vals.add(value); + } + } + int size = Keys.size(); + String[] keyA = new String[size]; + String[] valueA = new String[size]; + for(int i=0; i 0) { + Integer maxId = 0; + for (TCComponent comp : comps) { + String pid = comp.getProperty("item_id"); + System.out.println("pid:" + pid); + String pidSuffix = pid.substring(pid.length() - 3); + if (Integer.parseInt(pidSuffix) > maxId) { + maxId = Integer.parseInt(pidSuffix); + } + } + return String.format("%03d", maxId + 1); + } + return "001"; + } + + /** + * Excel·ѡ + * @return ѡExcel·ļ + */ + public static File saveExcelChooser() { + File dir = null; + JFileChooser chooser = new JFileChooser(); + chooser.setAcceptAllFileFilterUsed(false); +// File currentDir = FileSystemView.getFileSystemView().getDefaultDirectory(); + File desktopDir = FileSystemView.getFileSystemView().getHomeDirectory(); + chooser.setCurrentDirectory(desktopDir); + String saveType[] = { "xlsx" }; + chooser.setFileFilter(new FileNameExtensionFilter("Excel", saveType)); + Frame frame = new Frame(); + int returnVal = chooser.showSaveDialog(frame); + if (returnVal == JFileChooser.APPROVE_OPTION) { + dir = chooser.getSelectedFile(); + String path = dir.getPath(); + if(!path.toLowerCase().endsWith(".xlsx")) { + path += ".xlsx"; + dir = new File(path); + } + System.out.println("saveExcelChooser1:" + path); + } + return dir; + } + + /** + * Excel·ѡָĬ· + * @param defaultFile Ĭ· + * @return ѡExcel·ļ + */ + public static File saveExcelChooser(String defaultFile) { + File dir = null; + JFileChooser chooser = new JFileChooser(); + chooser.setAcceptAllFileFilterUsed(false); +// File currentDir = FileSystemView.getFileSystemView().getDefaultDirectory(); + File desktopDir = FileSystemView.getFileSystemView().getHomeDirectory(); + chooser.setCurrentDirectory(desktopDir); + chooser.setSelectedFile(new File(defaultFile)); + String saveType[] = { "xlsx" }; + chooser.setFileFilter(new FileNameExtensionFilter("Excel", saveType)); + int returnVal = chooser.showSaveDialog(new Frame()); + if (returnVal == JFileChooser.APPROVE_OPTION) { + dir = chooser.getSelectedFile(); + String path = dir.getPath(); + if(!path.toLowerCase().endsWith(".xlsx")) { + path += ".xlsx"; + dir = new File(path); + } + if(dir.exists()) + dir.delete(); +// System.out.println("saveExcelChooser1:" + dir.getPath()); + } + return dir; + } + + /** + * Excel·ѡָڣ + * @param defaultFile + * @return ѡExcel·ļ + */ + public static File saveExcelChooser(JDialog parent) { + File dir = null; + JFileChooser chooser = new JFileChooser(); + chooser.setAcceptAllFileFilterUsed(false); +// File currentDir = FileSystemView.getFileSystemView().getDefaultDirectory(); + File desktopDir = FileSystemView.getFileSystemView().getHomeDirectory(); + chooser.setCurrentDirectory(desktopDir); + String saveType[] = { "xlsx" }; + chooser.setFileFilter(new FileNameExtensionFilter("Excel", saveType)); + int returnVal = chooser.showSaveDialog(parent); + if (returnVal == JFileChooser.APPROVE_OPTION) { + dir = chooser.getSelectedFile(); + String path = dir.getPath(); + if(!path.toLowerCase().endsWith(".xlsx")) { + path += ".xlsx"; + dir = new File(path); + } + System.out.println("saveExcelChooser1:" + path); + } + return dir; + } + + public static boolean contains(Object[] array, Object str) { + for(Object s : array) { +// System.out.println("contains:"+s+"="+str); + if(s.equals(str)) + return true; + } + return false; + } + + public static Map executeToMap(InputStream in){ + System.out.println("Read properties file"); + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(in, "utf-8")); + String line = null; + Map resultMap = new LinkedHashMap<>(16); + if (reader.ready()) { + while (null != (line = reader.readLine())) { + if (line.length() <= 0 || line.startsWith("#") || !line.contains("=")) { + continue; + } + resultMap.put(line.substring(0, line.indexOf("=")), line.substring(line.indexOf("=") + 1)); + } + } + in.close(); + reader.close(); + return resultMap; + } catch (Exception e) { + e.printStackTrace(); + MessageBox.post("Find properties file failed", "ERROR", MessageBox.ERROR); + } + return null; + } + + public static TCComponentDataset createExcelDataset(TCSession session, File file, String datasetName) throws Exception { + String refType = null, objType = null, fileName = null; + fileName = file.getName().toLowerCase(); + if (fileName.endsWith("xls")) { + refType = "excel"; + objType = "MSExcel"; + } else if (fileName.endsWith("xlsx")) { + refType = "excel"; + objType = "MSExcelX"; + } + TCComponentDatasetType compType = (TCComponentDatasetType) session.getTypeService().getTypeComponent("Dataset"); + TCComponentDataset dataset = compType.create(datasetName, "description", objType); + dataset.setFiles(new String[] { file.getAbsolutePath() }, new String[] { refType }); + return dataset; + } + + public static Vector getChildren(TCComponent parent, String relation, String name) throws Exception { + Vector result = new Vector<>(); + AIFComponentContext[] children; + if(relation==null || relation.isEmpty()) + children = parent.getChildren(); + else + children = parent.getChildren(relation); + for(AIFComponentContext c : children) { + TCComponent comp = (TCComponent) c.getComponent(); + if(comp.getProperty("object_name").equals(name)) + result.add(comp); + } + return result; + } + /** + * ȡָϵӼnull + * @param parent + * @param relation ָϵ + * @return Ӽ + */ + public static AIFComponentContext[] getChildren(TCComponent parent, String relation) throws Exception { + AIFComponentContext[] fs = parent.getChildren(relation); + if(fs==null || fs.length==0) + return new AIFComponentContext[] { }; + if(fs.length>1) + return fs; + InterfaceAIFComponent fc = fs[0].getComponent(); + if(fc instanceof TCComponentPseudoFolder) + return fc.getChildren(); + return fs; + } + /** + * ΪTC + * @param TCComponent + * @param property ո + * @return ȷ˳ + */ + public static TCComponent[] TCsort(TCComponent[] TCComponent, String property) { + HashMap map = new HashMap<>(); + int count = TCComponent.length; + for(TCComponent Component : TCComponent) { + try { + map.put(Component, Component.getProperty(property)); + } catch (Exception e) { + e.printStackTrace(); + } + } + // ͨArrayList캯map.entrySet()תlist + ArrayList> list = new ArrayList>(map.entrySet()); + // ͨȽʵֱȽ + Collections.sort(list, new Comparator>() { + public int compare(Map.Entry mapping1, Map.Entry mapping2) { + return mapping1.getValue().compareTo(mapping2.getValue()); + } + }); + TCComponent = new TCComponent[count]; + int i=0; + for(Map.Entry mapping : list) { + TCComponent[i] = mapping.getKey(); + i++; + } + return TCComponent; + } + + public static String getStackTrace(Exception e) { + e.printStackTrace(); + StringBuilder rError = new StringBuilder(""+e.getMessage()); + for(StackTraceElement ste : e.getStackTrace()) { + rError.append("\n\t"+ste.toString()); + } +// System.out.println(rError.toString()); + return rError.toString(); + } + + /** + * ȡExcel + * @param sheet sheetҳ + * @param i к + * @return Excelж + */ + public static XSSFRow getRow(XSSFSheet sheet, int i) throws Exception { + XSSFRow row = sheet.getRow(i); + if(row==null) + row = sheet.createRow(i); + return row; + } + /** + * ȡExcelԪ + * @param row Ԫ + * @param i Ԫк + * @return ExcelԪ + */ + public static XSSFCell getCell(XSSFRow row, int col) throws Exception { + XSSFCell cell = row.getCell(col); + if(cell==null) + cell = row.createCell(col); + return cell; + } + + /** + * 򿪻ر· + * @param session TCSession + * @param open ΪtrueرΪfalse + */ + @SuppressWarnings("deprecation") + public static void setByPass(TCSession session, boolean open) throws Exception { + session.getUserService().call("setbypass", new Object[] { open ? "true" : "false" }); + } + /** + * ȡ̬LOVֵ + * @param session TCSession + * @param lov ָ̬LOV + * @return ̬LOVֵ + */ + public static String[] getDynamicLOV(TCSession session, TCComponentListOfValues lov) throws Exception { + Vector lovDisplayValueList = new Vector<>(); +// lovDisplayValueList.add(""); + Vector lovValueList = new Vector<>(); + LOVService lovService = LOVService.getService(session); + InitialLovData input = new InitialLovData(); + LovFilterData filter = new LovFilterData(); + filter.sortPropertyName = "object_name"; + filter.order = 1; + filter.numberToReturn = 100; + filter.maxResults = 100; + + input.lov = lov; + input.filterData = filter; + LOVSearchResults result = lovService.getInitialLOVValues(input); +// StringBuffer sb = new StringBuffer(); +// sb.append(">>"); + for (LOVValueRow row : result.lovValues) { + Map map = row.propDisplayValues; + Map realmap = row.propInternalValues; + for (String key : map.keySet()) { +// sb.append("UID:" + row.uid + ",key:" + key + "value:" + map.get(key)[0]); +// sb.append("\n"); + lovDisplayValueList.add(map.get(key)[0]); + lovValueList.add(realmap.get(key)[0]); + } + } +// System.out.println("StringBuffer:"+sb.toString()); + return lovDisplayValueList.toArray(new String[lovDisplayValueList.size()]); + } +}