diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$1.class b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$1.class
new file mode 100644
index 0000000..e9d0aba
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$2.class b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$2.class
new file mode 100644
index 0000000..52c73fc
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$2.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$3.class b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$3.class
new file mode 100644
index 0000000..fd0fa81
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/DetailsController$3.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/SearchSapController$1.class b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/SearchSapController$1.class
new file mode 100644
index 0000000..cdf27ad
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/SearchSapController$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/SearchSapController$2.class b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/SearchSapController$2.class
new file mode 100644
index 0000000..6d6a0df
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/SearchSapResult/SearchSapController$2.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/AssignIdController.class b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/AssignIdController.class
index d485546..55e0d9d 100644
Binary files a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/AssignIdController.class and b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/AssignIdController.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/CreateEcnController$1.class b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/CreateEcnController$1.class
index bb06ce4..a0b85df 100644
Binary files a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/CreateEcnController$1.class and b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/CreateEcnController$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/CreateEcnController.class b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/CreateEcnController.class
index 554ea03..0547b54 100644
Binary files a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/CreateEcnController.class and b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/CreateEcnController.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RefTableBean.class b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RefTableBean.class
index 6946eea..b775ba1 100644
Binary files a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RefTableBean.class and b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RefTableBean.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnBean.class b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnBean.class
index 1cce78e..681df11 100644
Binary files a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnBean.class and b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnBean.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnController.class b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnController.class
index ade0fc5..b4c70da 100644
Binary files a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnController.class and b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnController.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnDialog.class b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnDialog.class
index 3498b55..4036b64 100644
Binary files a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnDialog.class and b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/RelateEcnDialog.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/Util.class b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/Util.class
index 11fd432..e114908 100644
Binary files a/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/Util.class and b/com.connor.chint.wuhan/bin/com/chint/plm/createEcn/Util.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMCompareBean.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMCompareBean.class
new file mode 100644
index 0000000..c0e8911
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMCompareBean.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMCoutBean.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMCoutBean.class
new file mode 100644
index 0000000..2f2a7f0
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMCoutBean.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor$1.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor$1.class
new file mode 100644
index 0000000..6273a72
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor$2.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor$2.class
new file mode 100644
index 0000000..32e80e8
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor$2.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor.class
new file mode 100644
index 0000000..5ec754b
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifCellEditor.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifferenceBean.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifferenceBean.class
new file mode 100644
index 0000000..c40b8ab
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BOMDifferenceBean.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BomCompareComd.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BomCompareComd.class
new file mode 100644
index 0000000..f6b633a
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/BomCompareComd.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/ChangeDesignBean.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/ChangeDesignBean.class
new file mode 100644
index 0000000..5c94827
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/ChangeDesignBean.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$1.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$1.class
new file mode 100644
index 0000000..b042a9b
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$10.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$10.class
new file mode 100644
index 0000000..016e27c
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$10.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$2.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$2.class
new file mode 100644
index 0000000..a97d6f8
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$2.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$3.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$3.class
new file mode 100644
index 0000000..c8d0e70
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$3.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$4.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$4.class
new file mode 100644
index 0000000..3b08a1d
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$4.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$5.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$5.class
new file mode 100644
index 0000000..92162b5
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$5.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$6$1.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$6$1.class
new file mode 100644
index 0000000..8341153
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$6$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$6.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$6.class
new file mode 100644
index 0000000..69ed440
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$6.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$7.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$7.class
new file mode 100644
index 0000000..f52fcb3
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$7.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$8.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$8.class
new file mode 100644
index 0000000..0e60c52
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$8.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$9.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$9.class
new file mode 100644
index 0000000..b6a115e
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog$9.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog.class
new file mode 100644
index 0000000..f15f083
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifference_DYController.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifference_DYController.class
new file mode 100644
index 0000000..5fde73f
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/CreateBOMDifference_DYController.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/ExtractDiffComd.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/ExtractDiffComd.class
new file mode 100644
index 0000000..164646b
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/ExtractDiffComd.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/Message_zh_CN.properties b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/Message_zh_CN.properties
new file mode 100644
index 0000000..b97fb23
--- /dev/null
+++ b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/Message_zh_CN.properties
@@ -0,0 +1,3 @@
+ERROR_NOT_CHANGE=\u8BF7\u9009\u62E9\u66F4\u6539\u901A\u77E5\u5355\u5BF9\u8C61
+ERROR_NO_CHANGE=\u672A\u627E\u5230\u53D8\u66F4\u524D\u540E\u5BF9\u8C61,\u65E0\u6CD5\u63D0\u53D6\u5DEE\u5F02\u9879\uFF01
+SUCC_CHANGE=\u63D0\u53D6\u5B8C\u6210
\ No newline at end of file
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/PBomBean.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/PBomBean.class
new file mode 100644
index 0000000..42471e9
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/PBomBean.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/YCLMaterialBean.class b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/YCLMaterialBean.class
new file mode 100644
index 0000000..74e911f
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/createbomdifference/YCLMaterialBean.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/extractdraw/ExtractDrawComd$1.class b/com.connor.chint.wuhan/bin/com/chint/plm/extractdraw/ExtractDrawComd$1.class
new file mode 100644
index 0000000..6245ecd
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/extractdraw/ExtractDrawComd$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/chint/plm/extractdraw/ExtractDrawComd.class b/com.connor.chint.wuhan/bin/com/chint/plm/extractdraw/ExtractDrawComd.class
new file mode 100644
index 0000000..d95ba87
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/chint/plm/extractdraw/ExtractDrawComd.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$1.class b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$1.class
index 10b1374..288d3d9 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$1.class and b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$2.class b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$2.class
index 70e2d90..096f57f 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$2.class and b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$2.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$3.class b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$3.class
index 805fc5d..b6f6713 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$3.class and b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$3.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$4.class b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$4.class
index 530ccd0..09e0ca4 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$4.class and b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController$4.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController.class b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController.class
index 0f796d7..8b85efa 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController.class and b/com.connor.chint.wuhan/bin/com/connor/chint/JDBPackage/MySceneController.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomToSapUtil.class b/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomToSapUtil.class
index c184465..e5709e9 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomToSapUtil.class and b/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomToSapUtil.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh$1.class b/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh$1.class
index 97ccd96..a10614d 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh$1.class and b/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh$2.class b/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh$2.class
index 42c27e6..a85810e 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh$2.class and b/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh$2.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh.class b/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh.class
index cb196bf..40fb706 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh.class and b/com.connor.chint.wuhan/bin/com/connor/chint/sap2/util/BomUtilWh.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/AssignProcess.class b/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/AssignProcess.class
index 606c0b8..d90bd4b 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/AssignProcess.class and b/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/AssignProcess.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSapWhBjOp.class b/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSapWhBjOp.class
index 02769b3..1087a64 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSapWhBjOp.class and b/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSapWhBjOp.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSendSapController.class b/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSendSapController.class
index 71b05ef..ffa7a80 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSendSapController.class and b/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSendSapController.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSendSapOp.class b/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSendSapOp.class
index 1cd54c5..209afb2 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSendSapOp.class and b/com.connor.chint.wuhan/bin/com/connor/chint/yunpi/command/BomSendSapOp.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/ButtonCellEditor.class b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/ButtonCellEditor.class
index 70da761..494c81b 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/ButtonCellEditor.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/ButtonCellEditor.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/CostListManagementHandler$1.class b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/CostListManagementHandler$1.class
index 60f7df4..c688037 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/CostListManagementHandler$1.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/CostListManagementHandler$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/CostListManagementHandler.class b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/CostListManagementHandler.class
index 5237e5e..7dbb4bb 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/CostListManagementHandler.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/CostListManagementHandler.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/pojo/Cusquotation.class b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/pojo/Cusquotation.class
index aa3f258..a570e2c 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/pojo/Cusquotation.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/pojo/Cusquotation.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/pojo/QuotationMX.class b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/pojo/QuotationMX.class
index b75f470..5e114f9 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/pojo/QuotationMX.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CostListManagement/pojo/QuotationMX.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$1.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$1.class
index a376156..14b5630 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$1.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$1.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$2.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$2.class
index ab472b2..cc5cdc1 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$2.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$2.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$3.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$3.class
new file mode 100644
index 0000000..ef4d4e9
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$3.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$4.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$4.class
new file mode 100644
index 0000000..3fcc511
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$4.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$5.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$5.class
new file mode 100644
index 0000000..3c80959
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$5.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$6.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$6.class
new file mode 100644
index 0000000..4b6652e
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$6.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$7.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$7.class
new file mode 100644
index 0000000..738b525
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$7.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$8.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$8.class
new file mode 100644
index 0000000..5bb0ed5
Binary files /dev/null and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController$8.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController.class
index 836518a..9f15cdb 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/MyController.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/PersonOverview.fxml b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/PersonOverview.fxml
index 87923a0..65aaaf8 100644
--- a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/PersonOverview.fxml
+++ b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/PersonOverview.fxml
@@ -6,6 +6,7 @@
+
@@ -78,17 +79,19 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -97,13 +100,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -150,6 +182,8 @@
+
+
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/test.class b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/test.class
index d4c704c..8d8e30e 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/test.class and b/com.connor.chint.wuhan/bin/com/connor/plm/CreateOuotation/test.class differ
diff --git a/com.connor.chint.wuhan/bin/com/connor/plm/SendGXToMOM/sendGXToMOMOperation.class b/com.connor.chint.wuhan/bin/com/connor/plm/SendGXToMOM/sendGXToMOMOperation.class
index e2fd5da..8bb9960 100644
Binary files a/com.connor.chint.wuhan/bin/com/connor/plm/SendGXToMOM/sendGXToMOMOperation.class and b/com.connor.chint.wuhan/bin/com/connor/plm/SendGXToMOM/sendGXToMOMOperation.class differ
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/AssignIdController.java b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/AssignIdController.java
index 1542fac..753106b 100644
--- a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/AssignIdController.java
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/AssignIdController.java
@@ -26,6 +26,10 @@ import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
+/**
+ * @author cyh
+ * ָɱIDҳ
+ */
public class AssignIdController {
private String groupID;
private TCSession session;
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/CreateEcnController.java b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/CreateEcnController.java
index d121efa..bf3b0fd 100644
--- a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/CreateEcnController.java
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/CreateEcnController.java
@@ -84,6 +84,12 @@ import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
+/**
+ * @author cyh
+ *
+ * ECNҳ
+ *
+ */
public class CreateEcnController extends KFXPanelController {
@FXML
private TextField ecnId;
@@ -674,6 +680,8 @@ public class CreateEcnController extends KFXPanelController {
String result = read.getString("result");
if (result.equals("")) {
refTableBean.setShNo(true);
+ }else {
+ refTableBean.setShYes(true);
}
i = i + 1;
}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/RefTableBean.java b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/RefTableBean.java
index 5656019..8d961f1 100644
--- a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/RefTableBean.java
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/RefTableBean.java
@@ -82,8 +82,8 @@ public class RefTableBean {
return shYes;
}
- public void setShYes(CheckBox shYes) {
- this.shYes = shYes;
+ public void setShYes(boolean shYes) {
+ this.shYes.setSelected(shYes);
}
public CheckBox getShNo() {
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/RelateEcnController.java b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/RelateEcnController.java
index 454aea8..feff2ef 100644
--- a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/RelateEcnController.java
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/RelateEcnController.java
@@ -33,6 +33,11 @@ import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
+/**
+ * @author cyh
+ * Ӱҳ
+ *
+ */
public class RelateEcnController {
@FXML
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/Util.java b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/Util.java
index b9cf007..1e85e0b 100644
--- a/com.connor.chint.wuhan/src/com/chint/plm/createEcn/Util.java
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createEcn/Util.java
@@ -40,6 +40,8 @@ public class Util {
public static final String REPRESENTATION_FOR = "representation_for";
public static final String ZT_MATERIAL_NO = "zt2_MaterialNo";
public static final String ITEM_REVIISON_ID = "item_revision_id";
+ public static final String REVISION_RULE_ANY = "Any Status; Working";
+ public static final String BL_QTY = "bl_quantity";
public Connection connect(Connection conn, TCSession session) {
String[] database = session.getPreferenceService().getStringValues("database_tc");
String JdbcDriverClass = "oracle.jdbc.driver.OracleDriver";
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMCompareBean.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMCompareBean.java
new file mode 100644
index 0000000..0d87089
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMCompareBean.java
@@ -0,0 +1,126 @@
+package com.chint.plm.createbomdifference;
+
+public class BOMCompareBean {
+ private int index;
+ private String changeType; //
+ private String zt2_MaterialNo_Parent; // ϱ
+ private String object_desc_Parent; //
+ private String zt2_MaterialNo_Old; // ϱ
+ private String object_desc_Old; //
+ private String num_Old; //
+ private String zt2_MaterialNo_new; // ϱ
+ private String object_desc_new; //
+ private String num_new; //
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public String getZt2_MaterialNo_Parent() {
+ return zt2_MaterialNo_Parent;
+ }
+
+ public void setZt2_MaterialNo_Parent(String zt2_MaterialNo_Parent) {
+ this.zt2_MaterialNo_Parent = zt2_MaterialNo_Parent;
+ }
+
+ public String getObject_desc_Parent() {
+ return object_desc_Parent;
+ }
+
+ public void setObject_desc_Parent(String object_desc_Parent) {
+ this.object_desc_Parent = object_desc_Parent;
+ }
+
+ public String getZt2_MaterialNo_Old() {
+ return zt2_MaterialNo_Old;
+ }
+
+ public void setZt2_MaterialNo_Old(String zt2_MaterialNo_Old) {
+ this.zt2_MaterialNo_Old = zt2_MaterialNo_Old;
+ }
+
+ public String getObject_desc_Old() {
+ return object_desc_Old;
+ }
+
+ public void setObject_desc_Old(String object_desc_Old) {
+ this.object_desc_Old = object_desc_Old;
+ }
+
+ public String getNum_Old() {
+ return num_Old;
+ }
+
+ public void setNum_Old(String num_Old) {
+ this.num_Old = num_Old;
+ }
+
+ public String getZt2_MaterialNo_new() {
+ return zt2_MaterialNo_new;
+ }
+
+ public void setZt2_MaterialNo_new(String zt2_MaterialNo_new) {
+ this.zt2_MaterialNo_new = zt2_MaterialNo_new;
+ }
+
+ public String getObject_desc_new() {
+ return object_desc_new;
+ }
+
+ public void setObject_desc_new(String object_desc_new) {
+ this.object_desc_new = object_desc_new;
+ }
+
+ public String getNum_new() {
+ return num_new;
+ }
+
+ public void setNum_new(String num_new) {
+ this.num_new = num_new;
+ }
+
+ public String getChangeType() {
+ return changeType;
+ }
+
+ public void setChangeType(String changeType) {
+ this.changeType = changeType;
+ }
+
+ public BOMCompareBean(String changeType, String zt2_MaterialNo_Parent, String object_desc_Parent,
+ String zt2_MaterialNo_Old, String object_desc_Old, String num_Old, String zt2_MaterialNo_new,
+ String object_desc_new, String num_new) {
+ super();
+ this.changeType = changeType;
+ this.zt2_MaterialNo_Parent = zt2_MaterialNo_Parent;
+ this.object_desc_Parent = object_desc_Parent;
+ this.zt2_MaterialNo_Old = zt2_MaterialNo_Old;
+ this.object_desc_Old = object_desc_Old;
+ this.num_Old = num_Old;
+ this.zt2_MaterialNo_new = zt2_MaterialNo_new;
+ this.object_desc_new = object_desc_new;
+ this.num_new = num_new;
+ }
+
+ @Override
+ public String toString() {
+ return "BOMCompareBean [index=" + index + ", changeType=" + changeType + ", zt2_MaterialNo_Parent="
+ + zt2_MaterialNo_Parent + ", object_desc_Parent=" + object_desc_Parent + ", zt2_MaterialNo_Old="
+ + zt2_MaterialNo_Old + ", object_desc_Old=" + object_desc_Old + ", num_Old=" + num_Old
+ + ", zt2_MaterialNo_new=" + zt2_MaterialNo_new + ", object_desc_new=" + object_desc_new + ", num_new="
+ + num_new + "]";
+ }
+
+ public Object[] getRowData(int index) {
+ this.index = index;
+
+ return new Object[] { this.index, changeType, zt2_MaterialNo_Parent, object_desc_Parent, zt2_MaterialNo_Old,
+ object_desc_Old, num_Old, zt2_MaterialNo_new, object_desc_new, num_new, "", "", "" };
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMCoutBean.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMCoutBean.java
new file mode 100644
index 0000000..ca99a9f
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMCoutBean.java
@@ -0,0 +1,169 @@
+package com.chint.plm.createbomdifference;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.teamcenter.rac.kernel.TCComponentBOMLine;
+import com.teamcenter.rac.kernel.TCComponentItem;
+import com.teamcenter.rac.kernel.TCComponentItemRevision;
+
+public class BOMCoutBean {
+ private TCComponentItemRevision part_child_new; //
+ private TCComponentItemRevision part_child_old; //
+ private TCComponentBOMLine line_new; // BOMLine
+ private TCComponentBOMLine line_old; // BOMLine
+ private double num_new = 0; // BOM
+ private double num_old = 0; // BOM
+ private int index_num; //
+
+ private String zt2_DesignWeight_old;
+ private String zt2_DesignWeight_new;
+ private Map map_line_new = new HashMap<>();
+ private Map map_line_old = new HashMap<>();
+
+ private TCComponentItemRevision rev; //
+ private TCComponentItemRevision part_parent; //
+
+ public TCComponentItemRevision getPart_parent() {
+ return part_parent;
+ }
+
+ public void setPart_parent(TCComponentItemRevision part_parent) {
+ this.part_parent = part_parent;
+ }
+
+ public void addItemLineNew(TCComponentItem item, TCComponentBOMLine line) {
+ map_line_new.put(item, line);
+ }
+
+ public void addItemLineOld(TCComponentItem item, TCComponentBOMLine line) {
+ map_line_old.put(item, line);
+ }
+
+ public Map getMap_line_new() {
+ return map_line_new;
+ }
+
+ public void setMap_line_new(Map map_line_new) {
+ this.map_line_new = map_line_new;
+ }
+
+ public Map getMap_line_old() {
+ return map_line_old;
+ }
+
+ public void setMap_line_old(Map map_line_old) {
+ this.map_line_old = map_line_old;
+ }
+
+ public TCComponentItemRevision getRev() {
+ return rev;
+ }
+
+ public void setRev(TCComponentItemRevision rev) {
+ this.rev = rev;
+ }
+
+ public int getIndex_num() {
+ return index_num;
+ }
+
+ public void setIndex_num(int index_num) {
+ if (this.index_num == 0)
+ this.index_num = index_num;
+ }
+
+ public TCComponentItemRevision getPart_child_new() {
+ return part_child_new;
+ }
+
+ public void setPart_child_new(TCComponentItemRevision part_child_new) {
+ this.part_child_new = part_child_new;
+ }
+
+ public TCComponentItemRevision getPart_child_old() {
+ return part_child_old;
+ }
+
+ public void setPart_child_old(TCComponentItemRevision part_child_old) {
+ this.part_child_old = part_child_old;
+ }
+
+ public TCComponentBOMLine getLine_new() {
+ return line_new;
+ }
+
+ public void setLine_new(TCComponentBOMLine line_new) {
+ this.line_new = line_new;
+ }
+
+ public TCComponentBOMLine getLine_old() {
+ return line_old;
+ }
+
+ public void setLine_old(TCComponentBOMLine line_old) {
+ this.line_old = line_old;
+ }
+
+ public double getNum_new() {
+ return num_new;
+ }
+
+ public void setNum_new(double num_new) {
+ this.num_new = num_new;
+ }
+
+ public double getNum_old() {
+ return num_old;
+ }
+
+ public void setNum_old(double num_old) {
+ this.num_old = num_old;
+ }
+
+ public void addNum_new(double num) {
+ this.num_new += num;
+ }
+
+ public void addNum_old(double num) {
+ this.num_old += num;
+ }
+
+ public String getZt2_DesignWeight_old() {
+ return zt2_DesignWeight_old;
+ }
+
+ public void setZt2_DesignWeight_old(String zt2_DesignWeight_old) {
+ this.zt2_DesignWeight_old = zt2_DesignWeight_old;
+ }
+
+ public String getZt2_DesignWeight_new() {
+ return zt2_DesignWeight_new;
+ }
+
+ public void setZt2_DesignWeight_new(String zt2_DesignWeight_new) {
+ this.zt2_DesignWeight_new = zt2_DesignWeight_new;
+ }
+
+ /*
+ * @Override public String toString() { return "BOMCoutBean [part_child_new=" +
+ * part_child_new + ", part_child_old=" + part_child_old + ", line_new=" +
+ * line_new + ", line_old=" + line_old + ", num_new=" + num_new + ", num_old=" +
+ * num_old + ", index_num=" + index_num + ", zt2_DesignWeight_old=" +
+ * zt2_DesignWeight_old + ", zt2_DesignWeight_new=" + zt2_DesignWeight_new +
+ * ", map_line_new=" + map_line_new + ", map_line_old=" + map_line_old +
+ * ", rev=" + rev + "]"; }
+ */
+
+ public static void main(String[] args) {
+ BOMCoutBean bean = new BOMCoutBean();
+ System.out.println(bean.getIndex_num());
+ }
+
+ @Override
+ public String toString() {
+ return "BOMCoutBean [part_child_new=" + part_child_new + ", part_child_old=" + part_child_old + ", num_new="
+ + num_new + ", num_old=" + num_old + ", index_num=" + index_num + ", part_parent=" + part_parent + "]";
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMDifCellEditor.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMDifCellEditor.java
new file mode 100644
index 0000000..ceb9ce8
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMDifCellEditor.java
@@ -0,0 +1,137 @@
+package com.chint.plm.createbomdifference;
+
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.JComboBox;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.table.TableCellEditor;
+
+import com.connor.chint.sap2.util.KUtil;
+
+public class BOMDifCellEditor extends AbstractCellEditor implements TableCellEditor {
+
+ private static final long serialVersionUID = -6384535937264729978L;
+ private Map> class_subclass = new HashMap<>();// С
+ private List> jcom_subclass = new ArrayList<>(32); // С
+ private List jtf_subclass = new ArrayList<>(32); // Сı
+ private int size = 0;
+
+ private int row;
+ // private int col;
+ private JTable table;
+
+ private Map map_class;
+ private Map map_values;
+
+ public BOMDifCellEditor(Map> class_subclass, Map map_class, int size) {
+ this.class_subclass = class_subclass;
+ this.map_class = map_class;
+ this.size = size;
+ initUI();
+ }
+
+ private void initUI() {
+
+ JTextField jtf = null;
+
+ List> list = new ArrayList<>(map_class.entrySet());
+ String[] keys = new String[list.size() + 1];
+ Collections.sort(list, new Comparator>() {
+
+ @Override
+ public int compare(Entry o1, Entry o2) {
+ return o1.getValue().compareTo(o2.getValue());
+ }
+ });
+ keys[0] = "";
+
+ map_values = new HashMap<>(8);
+ List> list2 = null;
+ Map map = null;
+ String[] subclass = null;
+ for (Entry> entry : class_subclass.entrySet()) {
+ map = entry.getValue();
+ list2 = new ArrayList<>(map.entrySet());
+ Collections.sort(list2, new Comparator>() {
+
+ @Override
+ public int compare(Entry o1, Entry o2) {
+ return o1.getValue().compareTo(o2.getValue());
+ }
+ });
+ subclass = new String[list2.size() + 1];
+ subclass[0] = "";
+ for (int i = 0, len = list2.size(); i < len; i++) {
+ subclass[i + 1] = list2.get(i).getKey();
+ }
+ map_values.put(entry.getKey(), subclass);
+ }
+
+ for (int i = 0, len = list.size(); i < len; i++) {
+ keys[i + 1] = list.get(i).getKey();
+ }
+ JComboBox jcom = null;
+ for (int i = 0; i < size; i++) {
+ jcom = new JComboBox();
+ jtf = new JTextField();
+ jcom_subclass.add(jcom);
+ jtf_subclass.add(jtf);
+ }
+
+ }
+
+ @Override
+ public Object getCellEditorValue() {
+ String class_value = String.valueOf(table.getValueAt(row, 10));
+ Component comp = null;
+ if (!KUtil.isEmpty(class_value) && class_subclass.containsKey(class_value)) {
+ comp = jcom_subclass.get(row);
+ return ((JComboBox>) comp).getSelectedItem();
+ } else {
+ comp = jtf_subclass.get(row);
+ return ((JTextField) comp).getText();
+ }
+ }
+
+ @Override
+ public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
+ this.table = table;
+ this.row = row;
+ // this.col = column;
+ Map map = null;
+ if (row > -1) {
+ String class_value = String.valueOf(table.getValueAt(row, 10));
+ String subclass_value = String.valueOf(table.getValueAt(row, 11));
+ JComboBox jcom = jcom_subclass.get(row);
+ jcom.removeAllItems();
+ if (column == 11) {
+ if (!KUtil.isEmpty(class_value) && class_subclass.containsKey(class_value)) {
+ String[] values = map_values.get(class_value);
+ map = class_subclass.get(class_value);
+ for (int i = 0, len = values.length; i < len; i++) {
+ jcom.addItem(values[i]);
+ }
+
+ if (map.containsKey(subclass_value))
+ jcom.setSelectedItem(subclass_value);
+ return jcom;
+ }
+ JTextField jtf = jtf_subclass.get(row);
+ jtf.setText(subclass_value);
+ return jtf;
+ }
+ }
+
+ return null;
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMDifferenceBean.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMDifferenceBean.java
new file mode 100644
index 0000000..42fa22b
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BOMDifferenceBean.java
@@ -0,0 +1,279 @@
+package com.chint.plm.createbomdifference;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.teamcenter.rac.kernel.TCComponentBOMLine;
+import com.teamcenter.rac.kernel.TCComponentItem;
+import com.teamcenter.rac.kernel.TCComponentItemRevision;
+
+public class BOMDifferenceBean {
+ /**
+ * ɰ汾
+ */
+ public TCComponentItemRevision oldRev;
+ /**
+ * °汾
+ */
+ public TCComponentItemRevision newRev;
+ /**
+ *
+ */
+ public TCComponentItemRevision oldPartRev;
+ /**
+ *
+ */
+ public TCComponentItemRevision newPartRev;
+
+ /**
+ *
+ */
+ public TCComponentItemRevision parentPartRev;
+ /**
+ * Ϻ
+ */
+ public String zt2_MaterialNo_Parent;
+
+ /**
+ *
+ */
+ public String object_desc_Parent;
+ /**
+ *
+ */
+ public String object_name_Parent;
+
+ public String getObject_name_Parent() {
+ return object_name_Parent;
+ }
+
+ public void setObject_name_Parent(String object_name_Parent) {
+ this.object_name_Parent = object_name_Parent;
+ }
+
+ /**
+ *
+ */
+ public TCComponentItem item;
+ /**
+ * µBOMLine
+ */
+ TCComponentBOMLine oldBOMLine;
+ /**
+ * ɵBOMLine
+ */
+ TCComponentBOMLine newBOMLine;
+ /**
+ * 汾
+ */
+ private String rev_object_type;
+
+ private TCComponentItemRevision rev;
+
+ public TCComponentItem getItem() {
+ return item;
+ }
+
+ public void setItem(TCComponentItem item) {
+ this.item = item;
+ }
+
+ public TCComponentBOMLine getOldBOMLine() {
+ return oldBOMLine;
+ }
+
+ public void setOldBOMLine(TCComponentBOMLine oldBOMLine) {
+ this.oldBOMLine = oldBOMLine;
+ }
+
+ public TCComponentBOMLine getNewBOMLine() {
+ return newBOMLine;
+ }
+
+ public void setNewBOMLine(TCComponentBOMLine newBOMLine) {
+ this.newBOMLine = newBOMLine;
+ }
+
+ public String getRev_object_type() {
+ return rev_object_type;
+ }
+
+ public void setRev_object_type(String rev_object_type) {
+ this.rev_object_type = rev_object_type;
+ }
+
+ public TCComponentItemRevision getOldRev() {
+ return oldRev;
+ }
+
+ public void setOldRev(TCComponentItemRevision oldRev) {
+ this.oldRev = oldRev;
+ }
+
+ public TCComponentItemRevision getNewRev() {
+ return newRev;
+ }
+
+ public void setNewRev(TCComponentItemRevision newRev) {
+ this.newRev = newRev;
+ }
+
+ @Override
+ public String toString() {
+ return "BOMDifferenceBean [oldRev=" + oldRev + ", newRev=" + newRev + ", oldPartRev=" + oldPartRev
+ + ", newPartRev=" + newPartRev + ", parentPartRev=" + parentPartRev + ", zt2_MaterialNo_Parent="
+ + zt2_MaterialNo_Parent + ", object_desc_Parent=" + object_desc_Parent + ", item=" + item
+ + ", oldBOMLine=" + oldBOMLine + ", newBOMLine=" + newBOMLine + ", rev_object_type=" + rev_object_type
+ + ", level=" + level + ", Quantity=" + Quantity + ", oldQuantity=" + oldQuantity + ", newQuantity="
+ + newQuantity + ", m_virtualNode=" + m_virtualNode + ", current_rev=" + current_rev + ", childs="
+ + childs + "]";
+ }
+
+ /**
+ * 㼶
+ */
+ private int level;
+ /**
+ *
+ */
+ private double Quantity = 0;
+ /**
+ *
+ */
+ private double oldQuantity = 0;
+ /**
+ *
+ */
+ private double newQuantity = 0;
+ /**
+ * Ƿ
+ */
+ protected boolean m_virtualNode;
+
+ private TCComponentItemRevision current_rev;
+
+ private List childs = new ArrayList<>();
+
+ public int getLevel() {
+ return level;
+ }
+
+ public void setLevel(int level) {
+ this.level = level;
+ }
+
+ public double getQuantity() {
+ return Quantity;
+ }
+
+ public void setQuantity(double quantity) {
+ Quantity = quantity;
+ }
+
+ public boolean isM_virtualNode() {
+ return m_virtualNode;
+ }
+
+ public void setM_virtualNode(boolean m_virtualNode) {
+ this.m_virtualNode = m_virtualNode;
+ }
+
+ public TCComponentItemRevision getCurrent_rev() {
+ return current_rev;
+ }
+
+ public void setCurrent_rev(TCComponentItemRevision current_rev) {
+ this.current_rev = current_rev;
+ }
+
+ public List getChilds() {
+ return childs;
+ }
+
+ public void setChilds(List childs) {
+ this.childs = childs;
+ }
+
+ public void addChilds(List list) {
+ BOMDifferenceBean bean;
+ for (int i = 0, len = list.size(); i < len; i++) {
+ bean = list.get(i);
+ if (childs.indexOf(bean) == -1) {
+ childs.add(bean);
+ }
+ }
+ }
+
+ public TCComponentItemRevision getOldPartRev() {
+ return oldPartRev;
+ }
+
+ public void setOldPartRev(TCComponentItemRevision oldPartRev) {
+ this.oldPartRev = oldPartRev;
+ }
+
+ public TCComponentItemRevision getNewPartRev() {
+ return newPartRev;
+ }
+
+ public void setNewPartRev(TCComponentItemRevision newPartRev) {
+ this.newPartRev = newPartRev;
+ }
+
+ public double getOldQuantity() {
+ return oldQuantity;
+ }
+
+ public void setOldQuantity(double oldQuantity) {
+ this.oldQuantity = oldQuantity;
+ }
+
+ public double getNewQuantity() {
+ return newQuantity;
+ }
+
+ public void setNewQuantity(double newQuantity) {
+ this.newQuantity = newQuantity;
+ }
+
+ public void addOldQuantity(double num) {
+ this.oldQuantity += num;
+ }
+
+ public void addNewQuantity(double num) {
+ this.newQuantity += num;
+ }
+
+ public TCComponentItemRevision getParentPartRev() {
+ return parentPartRev;
+ }
+
+ public void setParentPartRev(TCComponentItemRevision parentPartRev) {
+ this.parentPartRev = parentPartRev;
+ }
+
+ public String getZt2_MaterialNo_Parent() {
+ return zt2_MaterialNo_Parent;
+ }
+
+ public void setZt2_MaterialNo_Parent(String zt2_MaterialNo_Parent) {
+ this.zt2_MaterialNo_Parent = zt2_MaterialNo_Parent;
+ }
+
+ public String getObject_desc_Parent() {
+ return object_desc_Parent;
+ }
+
+ public void setObject_desc_Parent(String object_desc_Parent) {
+ this.object_desc_Parent = object_desc_Parent;
+ }
+
+ public TCComponentItemRevision getRev() {
+ return rev;
+ }
+
+ public void setRev(TCComponentItemRevision rev) {
+ this.rev = rev;
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BomCompareComd.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BomCompareComd.java
new file mode 100644
index 0000000..daa9dbb
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/BomCompareComd.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright 2024 eSunny Info. Tech Ltd. All rights reserved.
+ *
+ * @Package: com.chint.plm.createbomdifference
+ * @author: cyh
+ * @date: 2024110 3:39:18
+ */
+package com.chint.plm.createbomdifference;
+
+import java.util.List;
+
+import com.connor.chint.sap2.util.BomToSapUtil;
+import com.connor.chint.sap2.util.MyProgressBarCompent;
+import com.connor.chint.yunpi.KCommand;
+import com.teamcenter.rac.aif.AbstractAIFApplication;
+import com.teamcenter.rac.aif.kernel.AIFComponentContext;
+import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
+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.TCComponentItem;
+import com.teamcenter.rac.kernel.TCComponentItemRevision;
+import com.teamcenter.rac.kernel.TCException;
+import com.teamcenter.rac.kernel.TCSession;
+import com.teamcenter.rac.util.MessageBox;
+
+/**
+ * @author cyh
+ * ֲɸIJļ
+ * ѹ ǰŵͼֽȡͼֽµPϻEϽжԱ
+ *
+ */
+public class BomCompareComd extends KCommand {
+
+ /**
+ * @param app
+ * @param commandId
+ * @param actionInfo
+ * @function 췽
+ */
+ public BomCompareComd(AbstractAIFApplication app, String commandId, String actionInfo) {
+ super(app, commandId, actionInfo);
+ this.setRunnable(new CreateBOMDifferenceDialog(app));
+ }
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/ChangeDesignBean.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/ChangeDesignBean.java
new file mode 100644
index 0000000..bd54bc7
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/ChangeDesignBean.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright 2024 eSunny Info. Tech Ltd. All rights reserved.
+ *
+ * @Package: com.chint.plm.createbomdifference
+ * @author: cyh
+ * @date: 2024112 4:04:10
+ */
+package com.chint.plm.createbomdifference;
+
+import com.teamcenter.rac.kernel.TCComponent;
+import com.teamcenter.rac.kernel.TCComponentItemRevision;
+
+/**
+ * @author cyh
+ * ¼ǰͼֽͱ
+ *
+ */
+public class ChangeDesignBean {
+
+ private TCComponentItemRevision oldDesgin;
+ private TCComponentItemRevision newDesgin;
+
+ @Override
+ public String toString() {
+ return "ChangeDesignBean [oldDesgin=" + oldDesgin + ", newDesgin=" + newDesgin + "]";
+ }
+ public TCComponentItemRevision getOldDesgin() {
+ return oldDesgin;
+ }
+ public void setOldDesgin(TCComponentItemRevision oldDesgin) {
+ this.oldDesgin = oldDesgin;
+ }
+ public TCComponentItemRevision getNewDesgin() {
+ return newDesgin;
+ }
+ public void setNewDesgin(TCComponentItemRevision newDesgin) {
+ this.newDesgin = newDesgin;
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog.java
new file mode 100644
index 0000000..17c33fa
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/CreateBOMDifferenceDialog.java
@@ -0,0 +1,708 @@
+package com.chint.plm.createbomdifference;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.swing.DefaultCellEditor;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableColumnModel;
+
+import com.chint.plm.createEcn.Util;
+import com.connor.chint.sap2.util.KUtil;
+import com.connor.chint.sap2.util.POIUtil;
+import com.connor.chint.sap2.util.ProgressBar;
+import com.connor.chint.sap2.util.SAPUtil;
+import com.teamcenter.rac.aif.AbstractAIFApplication;
+import com.teamcenter.rac.aif.AbstractAIFDialog;
+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.TCComponentForm;
+import com.teamcenter.rac.kernel.TCComponentFormType;
+import com.teamcenter.rac.kernel.TCComponentGroup;
+import com.teamcenter.rac.kernel.TCComponentItem;
+import com.teamcenter.rac.kernel.TCComponentItemRevision;
+import com.teamcenter.rac.kernel.TCComponentListOfValues;
+import com.teamcenter.rac.kernel.TCException;
+import com.teamcenter.rac.kernel.TCSession;
+import com.teamcenter.rac.util.MessageBox;
+
+/*
+ * BOM
+ *
+ */
+public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
+
+ private static final long serialVersionUID = 1190944518442503011L;
+ public static final String[] HEADER = { "", "", "ϱ", "", "ϱ", "", "", "ϱ",
+ "", "", "ԭ", "ԭС", "" };
+ public static final int[] HEADERWIDTH = new int[] { 50, 80, 120, 220, 120, 180, 80, 120, 180, 80, 100, 100, 100 };
+ private AbstractAIFApplication app;
+ private TCSession session;
+
+ private final JButton btn_ok = new JButton("ȷ");
+ private final JButton btn_cel = new JButton("ȡ");
+
+ private JTable t_part;
+ private DefaultTableModel tm_part;
+ // private JComboBox jcom_Subclass = null; //С
+ private TCComponent tar = null;
+ // 켯
+ private List compares = new ArrayList<>();
+ private ProgressBar pb = null;
+// private Map map_material = new HashMap<>(6); // ԭϿ
+// private Map map_Materials = null; // ԭ
+
+ private Map processType = new HashMap<>(32); //
+ private Map map_indexs = new HashMap<>(8); //
+ private Map> class_subclass = new HashMap<>(8);
+ private Map map_class = new HashMap<>(8); //
+ private Map map_subclass = new HashMap<>(64); // С
+
+ // ѡ༭
+ JPanel selectPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
+ private JComboBox box_class = new JComboBox();
+ private JComboBox box_subClass = new JComboBox();
+ private JComboBox box_processType = new JComboBox();
+ private JTextField field_subClass = new JTextField();
+ private String selectClassItemString = new String();
+ private String selectSubClassItemString = new String();
+ private String selectProcessTypeItemString = new String();
+
+ public CreateBOMDifferenceDialog(AbstractAIFApplication app) {
+ super(false);
+ this.app = app;
+ this.session = (TCSession) app.getSession();
+ }
+
+ private void initUI() {
+ this.setTitle("BOM");
+ this.setLayout(new BorderLayout());
+ this.setPreferredSize(new Dimension(1400, 400));
+ this.setMinimumSize(new Dimension(1300, 300));
+ this.add(BorderLayout.NORTH, getSelectPanel());
+ this.add(BorderLayout.CENTER, getTablePanel());
+ this.add(BorderLayout.SOUTH, getButtonPanel());
+ addListener();
+ }
+
+ private Component getSelectPanel() {
+ box_class.setPreferredSize(new Dimension(85, 25));
+ box_subClass.setPreferredSize(new Dimension(85, 25));
+ box_processType.setPreferredSize(new Dimension(85, 25));
+ field_subClass.setPreferredSize(new Dimension(85, 25));
+ selectPanel.add(box_class);
+ selectPanel.add(box_subClass);
+ selectPanel.add(field_subClass);
+ selectPanel.add(box_processType);
+ box_subClass.setVisible(false);
+ selectPanel.setVisible(false);
+ return selectPanel;
+ }
+
+ private void initMap(TCSession session) throws Exception {
+ //
+ // map_indexs.put("1-", "1"); //ѹ
+ // map_indexs.put("2-ɾ", "2"); //ѹ
+ // map_indexs.put("3-", "3"); //ѹ豸
+ // map_indexs.put("4-ϱ", "4");
+ // map_indexs.put("5-", "5");
+ map_indexs = KUtil.getLOVDisplay_value(session, "ZT2_ChangeCategory");
+
+ System.out.println("map_indexs:" + map_indexs);
+ // ԭϷ
+// map_material.put("M005", "ICM0802"); // ѹ
+// map_material.put("M006", "ICM0104"); // ѹ
+// map_material.put("M007", "ICM1202"); //
+// map_material.put("M034", "ICM0801"); // ѹ豸
+// map_material.put("M030", "ICM1102");
+
+ //
+ processType = KUtil.getLOVDisplay_value(session, "ZT2_ProcessType");
+ System.out.println("processType:" + processType);
+
+ TCComponentListOfValues lov = KUtil.getLov(session, "ZT2_ReasonCategories");
+ Map map = null;
+ String disval = "";
+ String disval2 = "";
+ if (lov != null) {
+ TCComponentListOfValues[] ff = lov.getListOfFilters();
+ ListOfValuesInfo listOfValues = lov.getListOfValues();
+ String[] realval = listOfValues.getStringListOfValues();
+ for (int i = 0, len = realval.length; i < len; i++) {
+ disval = listOfValues.getDisplayableValue(realval[i]);
+ ListOfValuesInfo listOfValues2 = ff[i].getListOfValues();
+ String[] realval2 = listOfValues2.getStringListOfValues();
+ map = new HashMap<>(realval2.length);
+ for (int j = 0, len2 = realval2.length; j < len2; j++) {
+ disval2 = listOfValues2.getDisplayableValue(realval2[j]);
+ map.put(disval2, realval2[j]);
+ map_subclass.put(disval2, realval2[j]);
+ }
+ class_subclass.put(disval, map);
+ map_class.put(disval, realval[i]);
+ }
+ }
+ System.out.println("class_subclass:" + class_subclass);
+
+ }
+
+ @Override
+ public void run() {
+ try {
+ InterfaceAIFComponent target = app.getTargetComponent();
+ if (target == null || !target.getType().equals("ZT2_Change")) {
+ MessageBox.post("ѡ֪ͨ", "", 2);
+ return;
+ }
+ tar = (TCComponent) target;
+ TCComponent[] oldComponents = tar.getRelatedComponents("ZT2_ChangeBefore");
+ TCComponent[] newComponents = tar.getRelatedComponents("ZT2_ChangeAfter");
+ if (oldComponents.length == 0 && newComponents.length == 0) {
+ MessageBox.post("δҵǰ,BOM!", "", 2);
+ return;
+ }
+ String str = "";
+ for (int i = 0, len = oldComponents.length; i < len; i++) {
+ if (!(oldComponents[i] instanceof TCComponentItemRevision)) {
+ str += "ǰ";
+ break;
+ }
+ }
+ for (int i = 0, len = newComponents.length; i < len; i++) {
+ if (!(newComponents[i] instanceof TCComponentItemRevision)) {
+ if (str.length() > 0) {
+ str += "";
+ }
+ str += "ĺ";
+ break;
+ }
+ }
+
+ if (!KUtil.isEmpty(str)) {
+ System.out.println(":" + str);
+ MessageBox.post("" + tar + "[" + str + "]ڷǰ汾", "", 2);
+ return;
+ }
+
+ initMap(session);
+// int icsId = -1;
+ TCComponentGroup group = (TCComponentGroup) tar.getRelatedComponent("owning_group");
+ String groupID = group.getTCProperty("name").getStringValue();
+ System.out.println("groupID:" + groupID);
+ String codeRemark = "";
+ System.out.println("codeRemark:" + codeRemark);
+
+// if (map_material.containsKey(groupID)) {
+// codeRemark = map_material.get(groupID);
+//// icsId = SAPUtil.getIcsId(codeRemark, "ϱ", session);
+// map_Materials = new HashMap<>();
+// }
+ initUI();
+ pb = new ProgressBar(new Dimension(250, 50));
+ pb.startProgress();
+ pb.setText("ڽBOMȽ...");
+ showDialog();
+
+ // ȡѹ豸
+ if ("M060".equals(groupID)) {
+ KUtil.setByPass(true);
+ // ǰͼֽȡϣĺͼֽȡ
+ TCComponent[] oldMaterialComps = getPMaterial(oldComponents);
+ for(TCComponent oldMaterialComp:oldMaterialComps) {
+ System.out.println(oldMaterialComp);
+ }
+ for(TCComponent oldMaterialComp:oldMaterialComps) {
+ System.out.println("new=====>"+oldMaterialComp);
+ }
+ TCComponent[] newMaterialComps = getPMaterial(newComponents);
+ CreateBOMDifference_DYController.getRevMap(session, oldMaterialComps, newMaterialComps, compares,
+ groupID);
+ }
+
+ if (pb != null)
+ pb.disposeDialog();
+ int size = compares.size();
+ if (size == 0) {
+ disposeDialog();
+ MessageBox.post("ǰûBOM", "", 2);
+ return;
+ }
+
+ BOMDifCellEditor cellEditor = new BOMDifCellEditor(class_subclass, map_class, size);
+
+ t_part.getColumnModel().getColumn(11).setCellEditor(cellEditor);
+ new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ pb = new ProgressBar(CreateBOMDifferenceDialog.this, new Dimension(250, 50));
+ pb.startProgress();
+ pb.setText("BOM...");
+ pb.showDialog();
+ for (int i = 0, len = compares.size(); i < len; i++) {
+ System.out.println(i + "--" + compares.get(i));
+ tm_part.addRow(compares.get(i).getRowData(i + 1));
+ }
+ pb.disposeDialog();
+ } catch (Exception e) {
+ pb.disposeDialog();
+ e.printStackTrace();
+
+ }
+
+ }
+ }).start();
+
+ System.out.println(":" + compares.size());
+
+ } catch (Exception e) {
+ if (pb != null) {
+ pb.disposeDialog();
+ }
+ MessageBox.post("ʼʧ:" + e.getMessage(), "", 2);
+ e.printStackTrace();
+ disposeDialog();
+ } finally {
+ KUtil.setByPass(false);
+ if (pb != null) {
+ pb.disposeDialog();
+ }
+ }
+ }
+
+ /**
+ * ͼֽȡϢȡP
+ *
+ * @param oldComponents ǰ
+ * @throws TCException
+ * @function
+ */
+ private TCComponent[] getPMaterial(TCComponent[] oldComponents) throws TCException {
+ // TODO Auto-generated method stub
+// Util.ZT_PROP_PBOM;
+ // ϱ - EP
+ Map pbomMap = new HashMap<>();
+ for (TCComponent oldComponent : oldComponents) {
+ if (!oldComponent.getType().equals(Util.ZT_DESIGN_TYPE)) {
+ String[] matnrProps = oldComponent.getProperties(
+ new String[] { Util.ZT_MATERIAL_NO, Util.ZT_PROP_PBOM, Util.ITEM_REVIISON_ID });
+ String materialNo = matnrProps[0];// material.getProperty(Util.ZT_MATERIAL_NO);
+ if (pbomMap.containsKey(materialNo)) {
+ PBomBean pBomBean = pbomMap.get(materialNo);
+ if (matnrProps[1].equals(Util.ZT_VAL_PBOM) && matnrProps[2].compareTo(pBomBean.getpRevision()) > 0) {
+ pBomBean.setpMaterial(oldComponent);
+ } else if (matnrProps[2].compareTo(pBomBean.geteRevision()) > 0) {
+ pBomBean.seteMaterial(oldComponent);
+ }
+ } else {
+ PBomBean pBomBean = new PBomBean();
+ if (matnrProps[1].equals(Util.ZT_VAL_PBOM)) {
+ pBomBean.setpMaterial(oldComponent);
+ pBomBean.setpRevision(matnrProps[2]);
+ } else {
+ pBomBean.seteMaterial(oldComponent);
+ pBomBean.seteRevision(matnrProps[2]);
+ }
+ pbomMap.put(materialNo, pBomBean);
+ }
+// TCComponent[] materials = oldComponent.getRelatedComponents(Util.REPRESENTATION_FOR);
+// for (TCComponent material : materials) {
+ // ȡϱ
+
+// }
+ }
+ }
+ TCComponent[] comps = new TCComponent[pbomMap.keySet().size()];
+ int ind = 0;
+ for (String materialNo : pbomMap.keySet()) {
+ PBomBean pBomBean = pbomMap.get(materialNo);
+ if (pBomBean.getpMaterial() == null) {
+ comps[ind] = pBomBean.geteMaterial();
+ } else {
+ comps[ind] = pBomBean.getpMaterial();
+ }
+ ind++;
+ }
+ return comps;
+ }
+
+ // ҳʼ
+ private JPanel getTablePanel() {
+ JPanel panel = new JPanel(new BorderLayout());
+ tm_part = new DefaultTableModel();
+ t_part = new JTable(tm_part) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public boolean isCellEditable(int row, int column) {
+ // TODO Auto-generated method stub
+ if (column > 9) {
+ return true;
+ }
+ return false;
+ }
+ };
+ tm_part.setDataVector(null, HEADER);
+ t_part.getTableHeader().setReorderingAllowed(false); // вƶᷢתУ
+ this.t_part.setRowHeight(23);
+ TableColumnModel colModel = this.t_part.getColumnModel();
+ int colCnt = HEADERWIDTH.length;
+ for (int i = 0; i < colCnt; i++) {
+ colModel.getColumn(i).setPreferredWidth(HEADERWIDTH[i]);
+ }
+
+ List> list = new ArrayList<>(map_class.entrySet());
+
+ JComboBox jcm_reason = new JComboBox();
+ jcm_reason.addItem("");
+ box_class.addItem("");
+ Collections.sort(list, new Comparator>() {
+ @Override
+ public int compare(Entry o1, Entry o2) {
+ // TODO Auto-generated method stub
+ return o1.getValue().compareTo(o2.getValue());
+ }
+
+ });
+
+ for (int i = 0, len = list.size(); i < len; i++) {
+ jcm_reason.addItem(list.get(i).getKey());
+ box_class.addItem(list.get(i).getKey());
+ }
+ t_part.getColumnModel().getColumn(10).setCellEditor(new DefaultCellEditor(jcm_reason));
+
+ t_part.getModel().addTableModelListener(new TableModelListener() {
+
+ @Override
+ public void tableChanged(TableModelEvent e) {
+ int col = e.getColumn();
+ int row = e.getFirstRow();
+ if (col == 10 && row > -1) {
+ String value = String.valueOf(t_part.getValueAt(row, col));
+ if (KUtil.isEmpty(value)) {
+ t_part.setValueAt("", row, 11);
+ return;
+ }
+ }
+ }
+ });
+
+ System.out.println("processType:" + processType);
+ if (processType.size() > 0) {
+ int size = processType.size() + 1;
+ List list2 = new ArrayList<>(size);
+
+ list2.add("");
+ List keys = new ArrayList<>(processType.keySet());
+ for (int i = 0; i < size - 1; i++) {
+ list2.add(keys.get(i));
+ }
+ Collections.sort(list2);
+ JComboBox jcom_Type = new JComboBox(list2.toArray(new String[size]));
+ t_part.getColumnModel().getColumn(12).setCellEditor(new DefaultCellEditor(jcom_Type));
+
+ for (String processType : list2) {
+ box_processType.addItem(processType);
+ }
+ }
+
+ JScrollPane scroll = new JScrollPane(t_part);
+ panel.add(BorderLayout.CENTER, scroll);
+ return panel;
+ }
+
+ private JPanel getButtonPanel() {
+ JPanel panel = new JPanel(new FlowLayout());
+ panel.add(btn_ok);
+ for (int i = 0; i < 4; i++) {
+ panel.add(new JLabel(" "));
+ }
+ panel.add(btn_cel);
+ return panel;
+ }
+
+ private void addListener() {
+ btn_cel.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ // TODO Auto-generated method stub
+ disposeDialog();
+ }
+ });
+ // OK ʾдzt2_BOMEC,ص֪ͨ
+ btn_ok.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ // ֹͣ༭״̬
+ KUtil.stopTableEditing(t_part);
+ // ֯
+ try {
+ createBOMEC(t_part.getRowCount());
+ btn_ok.setEnabled(false);
+ MessageBox.post("BOMɳɹ", "", 2);
+ disposeDialog();
+ } catch (Exception e) {
+ e.printStackTrace();
+ MessageBox.post("BOMʧ:" + e.getMessage(), "", 2);
+ }
+
+ }
+ }).start();
+ }
+ });
+ t_part.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+
+ @Override
+ public void valueChanged(ListSelectionEvent e) {
+ if (t_part.getSelectedRowCount() >= 2) {
+ selectPanel.setVisible(true);
+ } else {
+ selectPanel.setVisible(false);
+ }
+ }
+ });
+ box_class.addItemListener(new ItemListener() {
+
+ @Override
+ public void itemStateChanged(ItemEvent e) {
+
+ // ʹTable༭ʧȥ
+ TableCellEditor tableCellEditor = t_part.getCellEditor();
+ if (tableCellEditor != null) {
+ tableCellEditor.stopCellEditing();
+ }
+
+ if (selectClassItemString == null) {
+ selectClassItemString = (String) e.getItem();
+ } else if (!selectClassItemString.equals((String) e.getItem())) {
+ selectClassItemString = (String) e.getItem();
+ setSubClassBoxValue();
+ }
+ }
+
+ private void setSubClassBoxValue() {
+
+ if (selectClassItemString != "") {
+
+ field_subClass.setVisible(false);
+ box_subClass.setVisible(true);
+ box_subClass.removeAllItems();
+ Map subClassMap = class_subclass.get(selectClassItemString);
+ box_subClass.addItem("");
+ for (String item : subClassMap.keySet()) {
+ box_subClass.addItem(item);
+ }
+
+ } else {
+ field_subClass.setVisible(true);
+ box_subClass.setVisible(false);
+ box_subClass.removeAllItems();
+ }
+ setTableClassCellValue();
+ selectClassItemString = null;
+ }
+
+ private void setTableClassCellValue() {
+ int[] selectRowsIndex = t_part.getSelectedRows();
+ for (int index : selectRowsIndex) {
+ t_part.setValueAt(selectClassItemString, index, 10);
+ }
+ }
+ });
+
+ box_subClass.addItemListener(new ItemListener() {
+
+ @Override
+ public void itemStateChanged(ItemEvent e) {
+ // ʹTable༭ʧȥ
+ TableCellEditor tableCellEditor = t_part.getCellEditor();
+ if (tableCellEditor != null) {
+ tableCellEditor.stopCellEditing();
+ }
+
+ if (selectSubClassItemString == null) {
+ selectSubClassItemString = (String) e.getItem();
+ } else if (!selectSubClassItemString.equals((String) e.getItem())) {
+ selectSubClassItemString = (String) e.getItem();
+ setTableSubClassCellValue();
+ selectSubClassItemString = null;
+ }
+
+ }
+
+ private void setTableSubClassCellValue() {
+ int[] selectRowsIndex = t_part.getSelectedRows();
+ for (int index : selectRowsIndex) {
+ t_part.setValueAt(selectSubClassItemString, index, 11);
+ }
+
+ }
+ });
+ box_processType.addItemListener(new ItemListener() {
+
+ @Override
+ public void itemStateChanged(ItemEvent e) {
+ // ʹTable༭ʧȥ
+ TableCellEditor tableCellEditor = t_part.getCellEditor();
+ if (tableCellEditor != null) {
+ tableCellEditor.stopCellEditing();
+ }
+
+ if (selectProcessTypeItemString == null) {
+ selectProcessTypeItemString = (String) e.getItem();
+ } else if (!selectProcessTypeItemString.equals((String) e.getItem())) {
+ selectProcessTypeItemString = (String) e.getItem();
+ setTableSubClassCellValue();
+ selectProcessTypeItemString = null;
+ }
+
+ }
+
+ private void setTableSubClassCellValue() {
+ int[] selectRowsIndex = t_part.getSelectedRows();
+ for (int index : selectRowsIndex) {
+ t_part.setValueAt(selectProcessTypeItemString, index, 12);
+ }
+
+ }
+ });
+
+ }
+
+ public TCComponentForm createBOMEC(int rowCout) throws Exception {
+ TCComponentForm form = null;
+ TCComponent[] comps = tar.getRelatedComponents("IMAN_reference");
+ for (int i = 0, len = comps.length; i < len; i++) {
+ if ("ZT2_BOMEC".equals(comps[i].getType())) {
+ form = (TCComponentForm) comps[i];
+ break;
+ }
+ }
+ if (form == null) {
+ TCComponentFormType formTyep = (TCComponentFormType) session.getTypeComponent("ZT2_BOMEC");
+ form = formTyep.create("BOM", "", "ZT2_BOMEC");
+ tar.add("IMAN_reference", form);
+ }
+ System.out.println("form uid:" + form.getUid());
+ List list = new ArrayList<>(rowCout);
+ for (int i = 0; i < 13; i++) {
+ String[] values = KUtil.getColumnValues(rowCout, i, list, t_part).toArray(new String[rowCout]);
+ System.out.println("ֵ:" + "zt2_property" + (i + 1) + ";" + Arrays.toString(values));
+ switch (i) {
+ case 1:
+ for (int j = 0; j < values.length; j++) {
+ if (map_indexs.containsKey(values[j]))
+ values[j] = map_indexs.get(values[j]);
+ }
+ break;
+ case 10:
+ for (int j = 0; j < values.length; j++) {
+ if (map_class.containsKey(values[j]))
+ values[j] = map_class.get(values[j]);
+ }
+ form.getTCProperty("zt2_property12").setStringValueArray(new String[] {});
+ break;
+ case 11:
+ for (int j = 0; j < values.length; j++) {
+ if (map_subclass.containsKey(values[j]))
+ values[j] = map_subclass.get(values[j]);
+ }
+ break;
+
+ case 12:
+ for (int j = 0; j < values.length; j++) {
+ if (processType.containsKey(values[j]))
+ values[j] = processType.get(values[j]);
+ }
+ break;
+ default:
+ break;
+ }
+ System.out.println("ֵ:" + "zt2_property" + (i + 1) + ";" + Arrays.toString(values));
+ KUtil.setProperty(form, "zt2_property" + (i + 1), values);
+ form.unlock();
+ }
+
+ tar.unlock();
+ return form;
+ }
+
+ /**
+ * Ϊװͼ,ҵӦIJƷ,װͼΪBOM ͼֽ,Ϊװͼ
+ *
+ * @param rev
+ * @return
+ * @throws Exception
+ */
+// public List getAssembly(TCComponentItemRevision rev) throws Exception {
+// List revs = new ArrayList<>();
+// List items = new ArrayList<>();
+// if (rev.getType().equals("ZT2_Design3DRevision")) {
+// TCComponent[] factoryNos = rev.getRelatedComponents("ZT2_FactoryNumber");
+// TCComponentItem item;
+// TCComponentItemRevision ccp;
+// if (factoryNos.length > 0) {
+// AIFComponentContext[] refs;
+// for (int i = 0, len = factoryNos.length; i < len; i++) {
+// refs = factoryNos[i].whereReferencedByTypeRelation(new String[] { "Part Revision" },
+// new String[] { "ZT2_FactoryNumber" });
+// for (int j = 0, len2 = refs.length; j < len2; j++) {
+// if (!KUtil.isEmpty(refs[j].getComponent().getProperty("zt2_WBSNo"))) {
+// ccp = (TCComponentItemRevision) refs[j].getComponent();
+// item = ccp.getItem();
+// if (items.indexOf(item) == -1) {
+// revs.add(ccp);
+// items.add(item);
+// }
+// }
+// }
+// }
+// if (revs.size() == 0)
+// throw new Exception("װͼ[" + rev + "]δҵIJƷ!");
+// }
+// }
+//
+// return revs;
+// }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/CreateBOMDifference_DYController.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/CreateBOMDifference_DYController.java
new file mode 100644
index 0000000..f12c3be
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/CreateBOMDifference_DYController.java
@@ -0,0 +1,512 @@
+package com.chint.plm.createbomdifference;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+//import com.connor.chint.sap2.assignfactoryno.FactoryController;
+import com.connor.chint.sap2.util.SAPUtil;
+import com.teamcenter.rac.aif.kernel.AIFComponentContext;
+import com.teamcenter.rac.kernel.TCComponent;
+import com.teamcenter.rac.kernel.TCComponentBOMLine;
+import com.teamcenter.rac.kernel.TCComponentBOMWindow;
+import com.teamcenter.rac.kernel.TCComponentBOMWindowType;
+import com.teamcenter.rac.kernel.TCComponentItem;
+import com.teamcenter.rac.kernel.TCComponentItemRevision;
+import com.teamcenter.rac.kernel.TCException;
+import com.teamcenter.rac.kernel.TCSession;
+
+/**
+ * ѹ첿
+ *
+ * @author xiaol
+ *
+ */
+public class CreateBOMDifference_DYController {
+
+ /**
+ *
+ * @param oldComponents ǰ
+ * @param newComponents
+ * @throws TCException
+ */
+ public static void getRevMap(TCSession session, TCComponent[] oldComponents, TCComponent[] newComponents,
+ List beans, String groupID) throws TCException {
+// Map map_types = new HashMap<>();
+// Map map_num = new HashMap<>();
+// FactoryController.getFactoryType(session, map_types, map_num, groupID);
+
+ TCComponentItem item = null;
+ TCComponentItemRevision rev = null;
+ BOMDifferenceBean bean;
+ /**
+ * -
+ */
+ Map map_item_beans = new HashMap<>();
+ /**
+ * -ǰ
+ */
+ Map> map_factoryNo_beans = new HashMap<>();
+ /**
+ * Ʒ-
+ */
+ Map> map_ccp_factoryNo = new HashMap<>();
+ TCComponent factoryNo = null;
+ TCComponent comps[] = null;
+ List list_beans;
+ List list_comps;
+ for (TCComponent comp : oldComponents) {
+ if (comp instanceof TCComponentItemRevision) {
+ rev = (TCComponentItemRevision) comp;
+ item = rev.getItem();
+ bean = map_item_beans.get(item);
+ if (bean == null) {
+ bean = new BOMDifferenceBean();
+ bean.setOldRev(rev);
+ }
+ bean.setItem(item);
+ map_item_beans.put(item, bean);
+ if (("Part Revision").equals(rev.getType())) {
+ comps = rev.getRelatedComponents("ZT2_FactoryNumber");
+ if (comps.length > 0) {
+ factoryNo = comps[0];
+ // DzƷŷȽ
+ list_beans = map_factoryNo_beans.get(factoryNo);
+ if (list_beans == null) {
+ list_beans = new ArrayList<>();
+ }
+ if (list_beans.indexOf(bean) == -1) {
+ list_beans.add(bean);
+ }
+ map_factoryNo_beans.put(factoryNo, list_beans);
+// if (isCCP(rev, map_types)) {
+// bean.setRev(rev);
+// list_comps = map_ccp_factoryNo.get(item);
+// if (list_comps == null) {
+// list_comps = new ArrayList<>();
+// }
+// if (list_comps.indexOf(factoryNo) == -1) {
+// list_comps.add(factoryNo);
+// }
+// map_ccp_factoryNo.put(item, list_comps);
+// } else {
+//
+// }
+
+ }
+ }
+
+ }
+ }
+ for (TCComponent comp : newComponents) {
+ if (comp instanceof TCComponentItemRevision) {
+ rev = (TCComponentItemRevision) comp;
+ item = rev.getItem();
+ bean = map_item_beans.get(item);
+ if (bean == null) {
+ bean = new BOMDifferenceBean();
+ }
+ bean.setItem(item);
+ bean.setNewRev(rev);
+ map_item_beans.put(item, bean);
+
+ if (("Part Revision").equals(rev.getType())) {
+ comps = rev.getRelatedComponents("ZT2_FactoryNumber");
+ if (comps.length > 0) {
+
+ factoryNo = comps[0];
+// if (isCCP(rev, map_types)) {
+// bean.setRev(rev);
+// list_comps = map_ccp_factoryNo.get(item);
+// if (list_comps == null) {
+// list_comps = new ArrayList<>();
+// }
+// if (list_comps.indexOf(factoryNo) == -1) {
+// list_comps.add(factoryNo);
+// }
+// map_ccp_factoryNo.put(item, list_comps);
+// } else {
+ list_beans = map_factoryNo_beans.get(factoryNo);
+ if (list_beans == null) {
+ list_beans = new ArrayList<>();
+ }
+ if (list_beans.indexOf(bean) == -1) {
+ list_beans.add(bean);
+ }
+ map_factoryNo_beans.put(factoryNo, list_beans);
+// }
+ }
+ }
+ }
+ }
+ System.out.println("ű-------ʼ");
+ for (Entry> entry : map_factoryNo_beans.entrySet()) {
+ factoryNo = entry.getKey();
+ System.out.println("--------" + factoryNo);
+ list_beans = entry.getValue();
+ for (int i = 0, len = list_beans.size(); i < len; i++) {
+ System.out.println(i + "--" + list_beans.get(i));
+ }
+ }
+ System.out.println("ű-------");
+ // ҵƷ
+ List list_ccps = new ArrayList<>();
+ if (map_ccp_factoryNo.size() > 0) {
+ List childs = new ArrayList<>();
+ for (Entry> entry : map_ccp_factoryNo.entrySet()) {
+ item = (TCComponentItem) entry.getKey();
+ list_comps = entry.getValue();
+ bean = map_item_beans.get(item);
+ // ȷƷ ǰŽȥ
+ if (bean.getOldRev() == null || bean.getNewRev() == null)
+ continue;
+
+ for (int i = 0, len = list_comps.size(); i < len; i++) {
+ factoryNo = list_comps.get(i);
+ // System.out.println(""+item+";:"+factoryNo);
+ list_beans = map_factoryNo_beans.get(factoryNo);
+ // System.out.println("------"+list_beans);
+ if (list_beans != null && list_beans.size() > 0) {
+ //
+ bean.addChilds(list_beans);
+ for (int j = 0, len2 = list_beans.size(); j < len2; j++) {
+ childs.add(list_beans.get(j).getItem());
+ }
+ }
+ }
+ // ƷȽ
+ if (bean.getChilds().size() > 0) {
+ childs.add(item);
+ list_ccps.add(bean);
+ }
+ }
+ for (int i = 0, len = childs.size(); i < len; i++) {
+ item = childs.get(i);
+ map_item_beans.remove(item);
+ }
+ }
+ // Ʒ һһȽ
+ TCComponentItemRevision oldRev = null;
+ TCComponentItemRevision newRev = null;
+
+ BOMDifferenceBean childBean;
+ List list_items = new ArrayList<>();
+ String zt2_MaterialNo_Parent;
+ String object_desc_Parent;
+
+ String zt2_MaterialNo;
+ String object_desc;
+
+ BOMCompareBean compareBean;
+ TCComponentBOMWindowType bomWinType;
+ // BOMDifferenceBean parentBean;
+ bomWinType = (TCComponentBOMWindowType) session.getTypeComponent("BOMWindow");
+ TCComponentBOMWindow win = bomWinType.create(null);
+ win.lock();
+ TCComponentBOMWindow win2 = bomWinType.create(null);
+ win2.lock();
+ TCComponentItemRevision parentRev;
+ try {
+ for (int i = 0, len = list_ccps.size(); i < len; i++) {
+ bean = list_ccps.get(i);
+ item = bean.getItem();
+ System.out.println("Ʒ:" + item);
+ if (list_items.indexOf(item) != -1) {
+ continue;
+ }
+ list_items.add(item);
+ rev = bean.getRev();
+ zt2_MaterialNo_Parent = rev.getProperty("zt2_MaterialNo");
+ object_desc_Parent = rev.getProperty("object_desc");
+ list_beans = bean.getChilds();
+ for (int j = 0, len2 = list_beans.size(); j < len2; j++) {
+
+ childBean = list_beans.get(j);
+ System.out.println(":" + childBean);
+ if (item == childBean.getItem())
+ continue;
+
+ item = childBean.getItem();
+ // System.out.println(":"+item);
+ if (list_items.indexOf(item) != -1) {
+ continue;
+ }
+ list_items.add(item);
+ oldRev = childBean.getOldRev();
+ newRev = childBean.getNewRev();
+ // Ԫ
+ if (oldRev == null && newRev != null) {
+ zt2_MaterialNo = newRev.getProperty("zt2_MaterialNo");
+ object_desc = newRev.getProperty("object_desc");
+ compareBean = new BOMCompareBean("", zt2_MaterialNo_Parent, object_desc_Parent, "", "", "",
+ zt2_MaterialNo, object_desc, "1");
+ beans.add(compareBean);
+ }
+ // Ԫɾ
+ if (oldRev != null && newRev == null) {
+ zt2_MaterialNo = oldRev.getProperty("zt2_MaterialNo");
+ object_desc = oldRev.getProperty("object_desc");
+ compareBean = new BOMCompareBean("ɾ", zt2_MaterialNo_Parent, object_desc_Parent,
+ zt2_MaterialNo, object_desc, "1", "", "", "");
+ beans.add(compareBean);
+ }
+ // BOMչȽ
+ if (oldRev != null && newRev != null) {
+ // Ƚ
+ win.setWindowTopLine(item, bean.getOldRev(), null, null);
+ win2.setWindowTopLine(item, bean.getNewRev(), null, null);
+ win.refresh();
+ win2.refresh();
+ childBean.setNewBOMLine(win2.getTopBOMLine());
+ childBean.setOldBOMLine(win.getTopBOMLine());
+ zt2_MaterialNo = newRev.getProperty("zt2_MaterialNo");
+ object_desc = newRev.getProperty("object_desc");
+ childBean.setZt2_MaterialNo_Parent(zt2_MaterialNo);
+ childBean.setObject_desc_Parent(object_desc);
+ childBean.setParentPartRev(newRev);
+
+ bomCompare_M030(childBean, session, 1, 1, beans, list_items);
+ }
+
+ }
+ }
+
+ for (Entry entry : map_item_beans.entrySet()) {
+ bean = entry.getValue();
+ oldRev = bean.getOldRev();
+ newRev = bean.getNewRev();
+ if (oldRev != null && newRev != null && oldRev != newRev) {
+ win.setWindowTopLine(item, bean.getOldRev(), null, null);
+ win2.setWindowTopLine(item, bean.getNewRev(), null, null);
+ win.refresh();
+ win2.refresh();
+ bean.setNewBOMLine(win2.getTopBOMLine());
+ bean.setOldBOMLine(win.getTopBOMLine());
+ zt2_MaterialNo = "";
+ object_desc = "";
+ parentRev = null;
+ parentRev = SAPUtil.getSAPPart(bean.getNewBOMLine(), session);
+ if (parentRev != null) {
+ zt2_MaterialNo = parentRev.getProperty("zt2_MaterialNo");
+ object_desc = parentRev.getProperty("object_desc");
+ }
+ bean.setZt2_MaterialNo_Parent(zt2_MaterialNo);
+ bean.setObject_desc_Parent(object_desc);
+ bean.setParentPartRev(newRev);
+
+ bomCompare_M030(bean, session, 1, 1, beans, list_items);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * жǷΪƷ
+ *
+ * @param rev
+ * @param map_types
+ * @return
+ * @throws TCException
+ */
+ public static boolean isCCP(TCComponentItemRevision rev, Map map_types) throws TCException {
+ String object_name = rev.getProperty("object_name");
+ System.out.println(":" + rev + ";map_types:" + map_types);
+ for (Entry entry : map_types.entrySet()) {
+ if (object_name.indexOf(entry.getKey()) != -1) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static void bomCompare_M030(BOMDifferenceBean parentBean, TCSession session, double parent_quantity_old,
+ double parent_quantity_new, List beans, List item_compares)
+ throws TCException, SQLException {
+ if (item_compares.indexOf(parentBean.getItem()) != -1) {
+ System.out.println("ӹ" + parentBean.getItem());
+ return;
+ }
+ System.out.println("δӹ:" + parentBean.getItem());
+ item_compares.add(parentBean.getItem());
+ TCComponentBOMLine parentLine_new = parentBean.getNewBOMLine();
+ TCComponentBOMLine parentLine_old = parentBean.getOldBOMLine();
+ System.out.println("Ƚ:" + parentLine_old + "--" + parent_quantity_old + "||" + parentLine_new + "--"
+ + parent_quantity_new);
+ BOMDifferenceBean bean;
+ Map map_child_beans = new HashMap<>();
+ TCComponentItem item = null;
+ TCComponentItemRevision rev = null;
+ TCComponentBOMLine line;
+ TCComponentItemRevision oldPartRev = null;
+ TCComponentItemRevision newPartRev = null;
+ //
+ String bl_quantity;
+ double quantity;
+ String rev_object_type;
+ if (parentLine_new != null) {
+ AIFComponentContext[] childs_new = parentLine_new.getChildren();
+ for (int i = 0, len = childs_new.length; i < len; i++) {
+ line = (TCComponentBOMLine) childs_new[i].getComponent();
+ rev = line.getItemRevision();
+ item = rev.getItem();
+ bean = map_child_beans.get(item);
+ newPartRev = SAPUtil.getSAPPart(line, session);
+ // System.out.println(":" + rev + ";:" + newPartRev);
+ if (newPartRev == null) {
+ continue;
+ }
+ bl_quantity = line.getProperty("bl_quantity");
+ System.out.println(rev + "-bl_quantity:" + bl_quantity);
+ if (bl_quantity == null || bl_quantity.trim().length() == 0) {
+ bl_quantity = "1";
+ }
+ quantity = Double.parseDouble(bl_quantity) * parent_quantity_new;
+ if (bean == null) {
+ bean = new BOMDifferenceBean();
+ bean.setItem(item);
+ bean.setNewRev(rev);
+ bean.setNewBOMLine(line);
+ rev_object_type = rev.getType();
+ bean.setRev_object_type(rev_object_type);
+ bean.setNewPartRev(newPartRev);
+ }
+ bean.addNewQuantity(quantity);
+ map_child_beans.put(item, bean);
+ }
+ }
+
+ if (parentLine_old != null) {
+ AIFComponentContext[] childs_old = parentLine_old.getChildren();
+ for (int i = 0, len = childs_old.length; i < len; i++) {
+ line = (TCComponentBOMLine) childs_old[i].getComponent();
+ rev = line.getItemRevision();
+ item = rev.getItem();
+ bean = map_child_beans.get(item);
+ oldPartRev = SAPUtil.getSAPPart(line, session);
+ // System.out.println(":" + rev + ";:" + oldPartRev);
+ if (oldPartRev == null) {
+ continue;
+ }
+ bl_quantity = line.getProperty("bl_quantity");
+ System.out.println(rev + "-bl_quantity:" + bl_quantity);
+ if (bl_quantity == null || bl_quantity.trim().length() == 0) {
+ bl_quantity = "1";
+ }
+ quantity = Double.parseDouble(bl_quantity) * parent_quantity_old;
+
+ if (bean == null) {
+ bean = new BOMDifferenceBean();
+ bean.setItem(item);
+ rev_object_type = rev.getType();
+ bean.setRev_object_type(rev_object_type);
+ }
+ bean.setOldRev(rev);
+ bean.setOldBOMLine(line);
+ bean.setOldPartRev(oldPartRev);
+ bean.addOldQuantity(quantity);
+ map_child_beans.put(item, bean);
+ }
+ }
+
+ BOMCompareBean compareBean;
+ // ϱ
+ String zt2_MaterialNo_Parent;
+
+ // 汾
+ String object_desc_Parent = "";
+
+ // Ϻ
+ String zt2_MaterialNo_Old;
+ String object_desc_Old;
+ String num_Old;
+ // Ϻ
+ String zt2_MaterialNo_New;
+ String object_desc_New;
+ String num_New;
+ zt2_MaterialNo_Parent = parentBean.getZt2_MaterialNo_Parent();
+ object_desc_Parent = parentBean.getObject_desc_Parent();
+ for (Entry entry : map_child_beans.entrySet()) {
+ bean = entry.getValue();
+ newPartRev = bean.getNewPartRev();
+ oldPartRev = bean.getOldPartRev();
+ System.out.println(bean.getItem() + "BOMDifferenceBean:" + bean);
+ if (newPartRev == null && oldPartRev != null) {
+ zt2_MaterialNo_Old = oldPartRev.getProperty("zt2_MaterialNo");
+ object_desc_Old = oldPartRev.getProperty("object_desc");
+ num_Old = String.format("%.1f", bean.getOldQuantity());
+ bean.setParentPartRev(oldPartRev);
+ bean.setZt2_MaterialNo_Parent(zt2_MaterialNo_Old);
+ bean.setObject_desc_Parent(object_desc_Old);
+ rev = bean.getOldRev();
+ compareBean = new BOMCompareBean("ɾ", zt2_MaterialNo_Parent, object_desc_Parent, zt2_MaterialNo_Old,
+ object_desc_Old, num_Old, "", "", "");
+ beans.add(compareBean);
+ // ɾ
+ bomCompare_M030(bean, session, 1, 1, beans, item_compares);
+ }
+ if (newPartRev != null && oldPartRev == null) {
+ // Ϊ¼
+ zt2_MaterialNo_New = newPartRev.getProperty("zt2_MaterialNo");
+ object_desc_New = newPartRev.getProperty("object_desc");
+ num_New = String.format("%.1f", bean.getNewQuantity());
+ bean.setParentPartRev(newPartRev);
+ bean.setZt2_MaterialNo_Parent(zt2_MaterialNo_New);
+ bean.setObject_desc_Parent(object_desc_New);
+ compareBean = new BOMCompareBean("", zt2_MaterialNo_Parent, object_desc_Parent, "", "", "",
+ zt2_MaterialNo_New, object_desc_New, num_New);
+ beans.add(compareBean);
+ //
+ bomCompare_M030(bean, session, 1, 1, beans, item_compares);
+ }
+
+ if (newPartRev != null && oldPartRev != null) {
+ zt2_MaterialNo_New = newPartRev.getProperty("zt2_MaterialNo");
+ object_desc_New = newPartRev.getProperty("object_desc");
+ zt2_MaterialNo_Old = oldPartRev.getProperty("zt2_MaterialNo");
+ object_desc_Old = oldPartRev.getProperty("object_desc");
+
+ if (newPartRev != oldPartRev) {
+ // ϱ
+ num_New = String.format("%.1f", bean.getNewQuantity());
+ num_Old = String.format("%.1f", bean.getOldQuantity());
+ compareBean = new BOMCompareBean("", zt2_MaterialNo_Parent, object_desc_Parent,
+ zt2_MaterialNo_Old, object_desc_Old, num_Old, zt2_MaterialNo_New, object_desc_New, num_New);
+ beans.add(compareBean);
+ //
+ bomCompare_M030(bean, session, 1, 1, beans, item_compares);
+ } else {
+ if (bean.getOldQuantity() > bean.getNewQuantity()) {
+ System.out.println("-ɾ-" + bean.getItem());
+ num_New = String.format("%.1f", bean.getNewQuantity());
+ num_Old = String.format("%.1f", bean.getOldQuantity());
+ compareBean = new BOMCompareBean("", zt2_MaterialNo_Parent, object_desc_Parent,
+ zt2_MaterialNo_Old, object_desc_Old, num_Old, zt2_MaterialNo_New, object_desc_New,
+ num_New);
+ beans.add(compareBean);
+ }
+
+ // ->
+ if (bean.getOldQuantity() < bean.getNewQuantity()) {
+ System.out.println("-" + bean.getItem());
+ num_New = String.format("%.1f", bean.getNewQuantity() - bean.getOldQuantity());
+ num_Old = String.format("%.1f", bean.getOldQuantity());
+ compareBean = new BOMCompareBean("", zt2_MaterialNo_Parent, object_desc_Parent,
+ zt2_MaterialNo_Old, object_desc_New, num_Old, zt2_MaterialNo_New, object_desc_New,
+ num_New);
+ beans.add(compareBean);
+ }
+ bomCompare_M030(bean, session, 1, 1, beans, item_compares);
+ }
+ }
+
+ }
+
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/ExtractDiffComd.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/ExtractDiffComd.java
new file mode 100644
index 0000000..96aa7ff
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/ExtractDiffComd.java
@@ -0,0 +1,345 @@
+/**
+ * Copyright 2024 eSunny Info. Tech Ltd. All rights reserved.
+ *
+ * @Package: com.chint.plm.createbomdifference
+ * @author: cyh
+ * @date: 2024112 3:34:11
+ */
+package com.chint.plm.createbomdifference;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import com.chint.plm.createEcn.Util;
+import com.connor.chint.sap2.util.BomToSapUtil;
+import com.connor.chint.yunpi.KCommand;
+import com.teamcenter.rac.aif.AbstractAIFApplication;
+import com.teamcenter.rac.aif.kernel.AbstractAIFSession;
+import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
+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.TCComponentItem;
+import com.teamcenter.rac.kernel.TCComponentItemRevision;
+import com.teamcenter.rac.kernel.TCComponentRevisionRule;
+import com.teamcenter.rac.kernel.TCComponentRevisionRuleType;
+import com.teamcenter.rac.kernel.TCException;
+import com.teamcenter.rac.kernel.TCSession;
+import com.teamcenter.rac.util.MessageBox;
+import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData;
+
+/**
+ * @author cyh ȡǰBOMϵ ѡִв
+ */
+public class ExtractDiffComd extends KCommand {
+ // ĵ
+ public static final String ZT_CHANGE = "ZT2_Change";
+ // ǰϵļ
+ public static final String ZT_CHANGE_BEF = "ZT2_ChangeBefore";
+ // ĺϵļ
+ public static final String ZT_CHANGE_AFT = "ZT2_ChangeAfter";
+ public static final String ZT_DESIGN3D = "ZT2_Design3DRevision";
+ public static final String ITEM_REV_ID = "item_revision_id";
+ public static final String REF_LIST = "ref_list";
+ public static final String REPRESENTATION_FOR = "representation_for";
+ private TCSession session;
+
+ /**
+ * @param app
+ * @param commandId
+ * @param actionInfo
+ * @function 췽
+ */
+ public ExtractDiffComd(AbstractAIFApplication app, String commandId, String actionInfo) {
+ super(app, commandId, actionInfo);
+ try {
+ InterfaceAIFComponent target = app.getTargetComponent();
+ this.session = (TCSession) app.getSession();
+ ResourceBundle resource = ResourceBundle.getBundle("com.chint.plm.createbomdifference.Message",
+ Locale.getDefault());
+ if (target == null || !target.getType().equals(ZT_CHANGE)) {
+ MessageBox.post(resource.getString("ERROR_NOT_CHANGE"), "", 2);
+ return;
+ }
+
+ TCComponent tar = (TCComponent) target;
+ TCComponent[] oldComponents = tar.getRelatedComponents(ZT_CHANGE_BEF);
+ TCComponent[] newComponents = tar.getRelatedComponents(ZT_CHANGE_AFT);
+ if (oldComponents.length == 0 && newComponents.length == 0) {
+ MessageBox.post(resource.getString("ERROR_NO_CHANGE"), "", 2);
+ return;
+ }
+ readChangeDesign(oldComponents, newComponents, tar);
+ MessageBox.post(resource.getString("SUCC_CHANGE"), "", 2);
+ } catch (TCException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * ǰͱϢ
+ *
+ * @param oldComponents ǰͼֽ
+ * @param newComponents ͼֽ
+ * @param tar 汾
+ * @throws TCException
+ * @function
+ */
+ private void readChangeDesign(TCComponent[] oldComponents, TCComponent[] newComponents, TCComponent tar)
+ throws TCException {
+ // TODO Auto-generated method stub
+ Map itemChangeMap = new HashMap<>();
+ for (TCComponent oldComponent : oldComponents) {
+ if (oldComponent.getType().equals(ZT_DESIGN3D)) {
+ TCComponentItemRevision rev = (TCComponentItemRevision) oldComponent;
+ TCComponentItem item = rev.getItem();
+ if (itemChangeMap.containsKey(item)) {
+ itemChangeMap.get(item).setOldDesgin(rev);
+ } else {
+ ChangeDesignBean changeDesignBean = new ChangeDesignBean();
+ changeDesignBean.setOldDesgin(rev);
+ itemChangeMap.put(item, changeDesignBean);
+ }
+ }
+ }
+ for (TCComponent newComponent : newComponents) {
+ if (newComponent.getType().equals(ZT_DESIGN3D)) {
+ TCComponentItemRevision rev = (TCComponentItemRevision) newComponent;
+ TCComponentItem item = rev.getItem();
+ if (itemChangeMap.containsKey(item)) {
+ itemChangeMap.get(item).setNewDesgin(rev);
+ } else {
+ ChangeDesignBean changeDesignBean = new ChangeDesignBean();
+ changeDesignBean.setNewDesgin(rev);
+ itemChangeMap.put(item, changeDesignBean);
+ }
+ }
+ }
+ // ǰͼֽ汾ǷӦӦӵǰ
+ for (TCComponentItem keyItem : itemChangeMap.keySet()) {
+ ChangeDesignBean changeDesignBean = itemChangeMap.get(keyItem);
+ TCComponentItemRevision newDesgin = changeDesignBean.getNewDesgin();
+ if (newDesgin == null) {
+ TCComponentItemRevision latestItemRevision = keyItem.getLatestItemRevision();
+ changeDesignBean.setNewDesgin(latestItemRevision);
+ tar.add(ZT_CHANGE_AFT, latestItemRevision);
+ }
+ if (changeDesignBean.getOldDesgin() == null) {
+ String revId = newDesgin.getProperty(ITEM_REV_ID);
+ TCComponent[] refs = keyItem.getReferenceListProperty("revision_list");
+ for (TCComponent ref : refs) {
+ String property = ref.getProperty(ITEM_REV_ID);
+ System.out.println("property===>" + property);
+ if (revId.equals(property)) {
+ break;
+ }
+ changeDesignBean.setOldDesgin((TCComponentItemRevision) ref);
+ }
+ System.out.println("changeDesignBean.getOldDesgin()===>" + changeDesignBean.getOldDesgin());
+
+ tar.add(ZT_CHANGE_BEF, changeDesignBean.getOldDesgin());
+ }
+ }
+ // ȡͼֽµϣȽBOMͼϢ
+ for (TCComponentItem keyItem : itemChangeMap.keySet()) {
+ ChangeDesignBean changeDesignBean = itemChangeMap.get(keyItem);
+ TCComponentItemRevision oldDesgin = changeDesignBean.getOldDesgin();
+ Map materialOld = getMaterialByDesign(oldDesgin);
+ System.out.println("materialOld===>" + materialOld.toString());
+ TCComponentItemRevision newDesgin = changeDesignBean.getNewDesgin();
+ Map materialNew = getMaterialByDesign(newDesgin);
+
+ System.out.println("materialNew===>" + materialNew.toString());
+ // ȽϱǰBOM
+ for (String materialNo : materialOld.keySet()) {
+ if (!materialNew.containsKey(materialNo))
+ continue;
+ PBomBean pBomBeanOld = materialOld.get(materialNo);
+ PBomBean pBomBeanNew = materialNew.get(materialNo);
+ // PϻȡPûбEBOM
+ TCComponent oldMaterial = pBomBeanOld.getpMaterial() == null ? pBomBeanOld.geteMaterial()
+ : pBomBeanOld.getpMaterial();
+ TCComponent newMaterial = pBomBeanNew.getpMaterial() == null ? pBomBeanNew.geteMaterial()
+ : pBomBeanNew.getpMaterial();
+ // ȫչ֮Ƚϵϱ
+ // ɵbomİ汾
+ TCComponentBOMLine oldBomLine = sendToStructureManager((TCComponentItemRevision) oldMaterial,
+ Util.REVISION_RULE_ANY);
+ TCComponentBOMLine newBomLine = sendToStructureManager((TCComponentItemRevision) newMaterial, null);
+ // BOMȫչ
+ Map oldBomMap = BomToSapUtil.getBomLineTreeNodeSOA(oldBomLine);
+ Map newBomMap = BomToSapUtil.getBomLineTreeNodeSOA(newBomLine);
+ addChangeBom(oldBomMap, oldBomLine, newBomMap, newBomLine, tar);
+ System.out.println("oldBomMap===>" + oldBomMap.toString());
+ System.out.println("newBomMap===>" + newBomMap.toString());
+ }
+ }
+ System.out.println("itemChangeMap===>" + itemChangeMap.toString());
+ }
+
+ /**
+ * ԱȱǰͱBOMṹвӵǰ
+ *
+ * @param oldBomMap
+ * @param oldBomLine
+ * @param newBomMap
+ * @param newBomLine µBOM
+ * @param changeTag
+ * @throws TCException
+ * @function
+ */
+ private void addChangeBom(Map oldBomMap, TCComponentBOMLine oldBomLine,
+ Map newBomMap, TCComponentBOMLine newBomLine, TCComponent changeTag)
+ throws TCException {
+ // TODO Auto-generated method stub
+ String oldUid = oldBomLine.getUid();
+ ExpandPSData[] expandPSDatasOld = oldBomMap.get(oldUid);
+ ExpandPSData[] expandPSDatasNew = newBomMap.get(newBomLine.getUid());
+ if (expandPSDatasNew.length == 0 && expandPSDatasOld.length == 0) {
+ return;
+ }
+ Map oldMaterialMap = new HashMap<>();
+ Map newMaterialMap = new HashMap<>();
+ // ¼ǰϱͶӦBOM
+ Map oldBomLineMap = new HashMap<>();
+ for (ExpandPSData expandPSData : expandPSDatasOld) {
+ TCComponentBOMLine bomLine = expandPSData.bomLine;
+ TCComponentItemRevision itemRevOfBOMLine = expandPSData.itemRevOfBOMLine;
+ // ¼ǰϱ
+ String materialNo = itemRevOfBOMLine.getProperty(Util.ZT_MATERIAL_NO);
+ String blQty = bomLine.getProperty(Util.BL_QTY);
+ if (blQty.isEmpty()) {
+ blQty = "0";
+ }
+ oldBomLineMap.put(materialNo, bomLine);
+ if (oldMaterialMap.containsKey(materialNo)) {
+ oldMaterialMap.put(materialNo, oldMaterialMap.get(materialNo) + Double.parseDouble(blQty));
+ } else {
+ oldMaterialMap.put(materialNo, Double.parseDouble(blQty));
+ }
+ }
+ for (ExpandPSData expandPSData : expandPSDatasNew) {
+ TCComponentBOMLine bomLine = expandPSData.bomLine;
+ TCComponentItemRevision itemRevOfBOMLine = expandPSData.itemRevOfBOMLine;
+ // ¼ϱ
+ String materialNo = itemRevOfBOMLine.getProperty(Util.ZT_MATERIAL_NO);
+ String blQty = bomLine.getProperty(Util.BL_QTY);
+ if (blQty.isEmpty()) {
+ blQty = "0";
+ }
+ if (newMaterialMap.containsKey(materialNo)) {
+ newMaterialMap.put(materialNo, newMaterialMap.get(materialNo) + Double.parseDouble(blQty));
+ } else {
+ newMaterialMap.put(materialNo, Double.parseDouble(blQty));
+ }
+ if (oldBomLineMap.containsKey(materialNo)) {
+ System.out.println("oldBom===>" + oldBomLineMap.get(materialNo));
+ System.out.println("bomLine===>" + bomLine);
+ addChangeBom(oldBomMap, oldBomLineMap.get(materialNo), newBomMap, bomLine, changeTag);
+ }
+ }
+ // ԱǰϱӦDzһ
+ if (oldMaterialMap.size() != newMaterialMap.size()) {
+ try {
+ // ӵ
+ System.out.println("oldMaterialMap1===>" + oldMaterialMap.toString());
+ System.out.println("newMaterialMap1===>" + newMaterialMap.toString());
+ changeTag.add(ZT_CHANGE_BEF, oldBomLine.getItemRevision());
+ changeTag.add(ZT_CHANGE_AFT, newBomLine.getItemRevision());
+ } catch (Exception e) {
+ }
+ } else {
+ for (String materNo : oldMaterialMap.keySet()) {
+ Double double1 = oldMaterialMap.get(materNo);
+
+ if (!newMaterialMap.containsKey(materNo) || newMaterialMap.get(materNo).doubleValue() != double1.doubleValue()) {
+ try {
+ System.out.println("oldMaterialMap2===>" + oldMaterialMap.toString());
+ System.out.println("newMaterialMap2===>" + newMaterialMap.toString());
+ changeTag.add(ZT_CHANGE_BEF, oldBomLine.getItemRevision());
+ changeTag.add(ZT_CHANGE_AFT, newBomLine.getItemRevision());
+ } catch (Exception e) {
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * ͵ṹ
+ *
+ * @param tcComponentItem
+ * @param revisionRuleName 汾
+ * @return
+ */
+ public TCComponentBOMLine sendToStructureManager(TCComponentItemRevision tcComponentItemRev,
+ String revisionRuleName) {
+ try {
+ TCComponentBOMWindowType bomWindowType = (TCComponentBOMWindowType) session.getTypeComponent("BOMWindow");
+ TCComponentBOMWindow bomWindow = bomWindowType.create(null);
+ if (revisionRuleName != null) {
+ TCComponentRevisionRule[] listAllRules = TCComponentRevisionRule.listAllRules(session);
+ for (TCComponentRevisionRule rule : listAllRules) {
+ if (rule.toString().equals(revisionRuleName)) {
+ bomWindow.setRevisionRule(rule);
+ }
+ }
+ }
+
+ return bomWindow.setWindowTopLine(null, tcComponentItemRev, null, null);
+ } catch (TCException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * ͼֽȡ,ȡµİ汾 Pϵ»ȡP
+ *
+ * @param designRev ͼֽ汾
+ * @throws TCException
+ * @function
+ */
+ private Map getMaterialByDesign(TCComponentItemRevision designRev) throws TCException {
+ // TODO Auto-generated method stub
+ Map pbomMap = new HashMap<>();
+ // ͼֽ
+ TCComponent[] represents = designRev.getReferenceListProperty(REPRESENTATION_FOR);
+ for (TCComponent represent : represents) {
+ String[] matnrProps = represent
+ .getProperties(new String[] { Util.ZT_MATERIAL_NO, Util.ZT_PROP_PBOM, Util.ITEM_REVIISON_ID });
+ String materialNo = matnrProps[0];// material.getProperty(Util.ZT_MATERIAL_NO);
+ if (pbomMap.containsKey(materialNo)) {
+ PBomBean pBomBean = pbomMap.get(materialNo);
+ // ǷPBOM
+ System.out.println("matnrProps[1]===>" + matnrProps[1]);
+ System.out.println("matnrProps[2]===>" + matnrProps[2] + "pBomBean.getpRevision()"+pBomBean.getpRevision());
+ if (matnrProps[1].equals(Util.ZT_VAL_PBOM) && matnrProps[2].compareTo(pBomBean.getpRevision()) > 0) {
+ pBomBean.setpMaterial(represent);
+ pBomBean.setpRevision(matnrProps[2]);
+ } else if (!matnrProps[1].equals(Util.ZT_VAL_PBOM)
+ && matnrProps[2].compareTo(pBomBean.geteRevision()) > 0) {
+ pBomBean.seteMaterial(represent);
+ pBomBean.seteRevision(matnrProps[2]);
+ }
+ } else {
+ PBomBean pBomBean = new PBomBean();
+ if (matnrProps[1].equals(Util.ZT_VAL_PBOM)) {
+ pBomBean.setpMaterial(represent);
+ pBomBean.setpRevision(matnrProps[2]);
+ } else {
+ pBomBean.seteMaterial(represent);
+ pBomBean.seteRevision(matnrProps[2]);
+ }
+ pbomMap.put(materialNo, pBomBean);
+ }
+ }
+ return pbomMap;
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/Message_zh_CN.properties b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/Message_zh_CN.properties
new file mode 100644
index 0000000..b97fb23
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/Message_zh_CN.properties
@@ -0,0 +1,3 @@
+ERROR_NOT_CHANGE=\u8BF7\u9009\u62E9\u66F4\u6539\u901A\u77E5\u5355\u5BF9\u8C61
+ERROR_NO_CHANGE=\u672A\u627E\u5230\u53D8\u66F4\u524D\u540E\u5BF9\u8C61,\u65E0\u6CD5\u63D0\u53D6\u5DEE\u5F02\u9879\uFF01
+SUCC_CHANGE=\u63D0\u53D6\u5B8C\u6210
\ No newline at end of file
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/PBomBean.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/PBomBean.java
new file mode 100644
index 0000000..80b52fb
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/PBomBean.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright 2024 eSunny Info. Tech Ltd. All rights reserved.
+ *
+ * @Package: com.chint.plm.createbomdifference
+ * @author: cyh
+ * @date: 2024110 2:21:11
+ */
+package com.chint.plm.createbomdifference;
+
+import com.teamcenter.rac.kernel.TCComponent;
+
+/**
+ * @author cyh
+ *
+ */
+public class PBomBean {
+ //¼ E P ͬϱ
+ private TCComponent eMaterial;
+ private String eRevision = "";
+ private TCComponent pMaterial;
+ private String pRevision = "";
+
+ @Override
+ public String toString() {
+ return "PBomBean [eMaterial=" + eMaterial + ", eRevision=" + eRevision + ", pMaterial=" + pMaterial
+ + ", pRevision=" + pRevision + "]";
+ }
+ public String geteRevision() {
+ return eRevision;
+ }
+ public void seteRevision(String eRevision) {
+ this.eRevision = eRevision;
+ }
+ public String getpRevision() {
+ return pRevision;
+ }
+ public void setpRevision(String pRevision) {
+ this.pRevision = pRevision;
+ }
+ public TCComponent geteMaterial() {
+ return eMaterial;
+ }
+ public void seteMaterial(TCComponent eMaterial) {
+ this.eMaterial = eMaterial;
+ }
+ public TCComponent getpMaterial() {
+ return pMaterial;
+ }
+ public void setpMaterial(TCComponent pMaterial) {
+ this.pMaterial = pMaterial;
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/YCLMaterialBean.java b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/YCLMaterialBean.java
new file mode 100644
index 0000000..2ba122c
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/createbomdifference/YCLMaterialBean.java
@@ -0,0 +1,49 @@
+package com.chint.plm.createbomdifference;
+
+public class YCLMaterialBean {
+ private String materialNo; // ϱ
+ private String materialutilization; //
+ private String materialunit; // ԭϵλ
+ private String materialmark; // ϱ
+
+ public String getMaterialNo() {
+ return materialNo;
+ }
+
+ public void setMaterialNo(String materialNo) {
+ this.materialNo = materialNo;
+ }
+
+ public String getMaterialutilization() {
+ return materialutilization;
+ }
+
+ public void setMaterialutilization(String materialutilization) {
+ this.materialutilization = materialutilization;
+ }
+
+ public String getMaterialunit() {
+ return materialunit;
+ }
+
+ public void setMaterialunit(String materialunit) {
+ this.materialunit = materialunit;
+ }
+
+ public String getMaterialmark() {
+ return materialmark;
+ }
+
+ public void setMaterialmark(String materialmark) {
+ this.materialmark = materialmark;
+ }
+
+ public YCLMaterialBean(String materialNo, String materialutilization, String materialunit, String materialmark) {
+ super();
+ this.materialNo = materialNo;
+ this.materialutilization = materialutilization;
+ this.materialunit = materialunit;
+ this.materialmark = materialmark;
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/chint/plm/extractdraw/ExtractDrawComd.java b/com.connor.chint.wuhan/src/com/chint/plm/extractdraw/ExtractDrawComd.java
new file mode 100644
index 0000000..29f5eea
--- /dev/null
+++ b/com.connor.chint.wuhan/src/com/chint/plm/extractdraw/ExtractDrawComd.java
@@ -0,0 +1,120 @@
+/**
+ * Copyright 2023 eSunny Info. Tech Ltd. All rights reserved.
+ *
+ * @Package: com.chint.plm.extractDraw
+ * @author: cyh
+ * @date: 20231225 4:38:03
+ */
+package com.chint.plm.extractdraw;
+
+import java.util.List;
+
+import com.chint.plm.createEcn.CreateEcnFrame;
+import com.connor.chint.sap2.util.BomToSapUtil;
+import com.connor.chint.sap2.util.MyProgressBarCompent;
+import com.connor.chint.sap2.util.SAPMessageUtilFram;
+import com.connor.chint.yunpi.KCommand;
+import com.teamcenter.rac.aif.AbstractAIFApplication;
+import com.teamcenter.rac.aif.kernel.AIFComponentContext;
+import com.teamcenter.rac.aif.kernel.AbstractAIFSession;
+import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
+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.TCComponentItem;
+import com.teamcenter.rac.kernel.TCComponentItemRevision;
+import com.teamcenter.rac.kernel.TCException;
+import com.teamcenter.rac.kernel.TCSession;
+import com.teamcenter.rac.kernel.TCUserService;
+import com.teamcenter.rac.util.MessageBox;
+
+/**
+ * @author cyh һȡͼֽ ݼµͼֽŵĿеָļ
+ */
+public class ExtractDrawComd extends KCommand {
+
+ /**
+ * @param app
+ * @param commandId
+ * @param actionInfo
+ * @function 췽
+ */
+ public ExtractDrawComd(AbstractAIFApplication app, String commandId, String actionInfo) {
+ super(app, commandId, actionInfo);
+ try {
+ TCSession session = (TCSession) app.getSession();
+ InterfaceAIFComponent targetComponent = app.getTargetComponent();
+ if (targetComponent.getType().equals("ZT2_Design3DRevision")) {
+
+ new Thread() {
+ @Override
+ public void run() {
+ MyProgressBarCompent my = new MyProgressBarCompent("", "һȡͼֽ......");
+ try {
+ // 汾ȡڵļ
+ TCComponentItemRevision itemRev = (TCComponentItemRevision) targetComponent;
+ TCComponentItem item = itemRev.getItem();
+ AIFComponentContext[] projectFolders = item.whereReferenced();
+ TCComponent projectFolder = null;
+ for (AIFComponentContext context : projectFolders) {
+ if (context.getComponent().getType().equals("ZT2_ProjectFolder")) {
+ projectFolder = (TCComponent) context.getComponent();
+ }
+ }
+ System.out.println("projectFolders====>" + projectFolders.length);
+ System.out.println("projectFolder====>" + projectFolder);
+ if (projectFolder != null) {
+ // ݶȡBOM
+ TCComponentBOMWindowType bomWinType = (TCComponentBOMWindowType) session
+ .getTypeComponent("BOMWindow");
+ TCComponentBOMWindow win = bomWinType.create(null);
+ TCComponentItemRevision rev = (TCComponentItemRevision) itemRev;
+ win.setWindowTopLine(rev.getItem(), rev, null, null);
+ TCComponentBOMLine bomline = win.getTopBOMLine();
+ // BOM
+ List childLines = BomToSapUtil.getBomLineTreeNodeSOA2(bomline);
+ childLines.add(rev);
+ System.out.println("childLines====>" + childLines);
+ // 2ZDBͷ ȡPDFļ ȡprojectFolder
+ for (TCComponentItemRevision childLine : childLines) {
+ if (childLine.getProperty("item_id").startsWith("2ZD")) {
+ continue;
+ }
+ TCComponent[] datasets = childLine.getRelatedComponents("IMAN_specification");
+ for (TCComponent dataset : datasets) {
+ String dsType = dataset.getProperty("object_type");
+ if (dsType.equals("PDF")) {
+ try {
+ projectFolder.add("contents", dataset);
+ } catch (Exception e) {
+ // ļѾھ
+ }
+ }
+ }
+ }
+ win.close();
+ }
+ my.setVisible(false);
+ MessageBox.post("һȡ....", "", MessageBox.INFORMATION);
+ } catch (TCException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ if (my != null) {
+ my.setVisible(false);
+ }
+ }
+ }.start();
+
+// new CreateEcnFrame();
+ } else {
+ MessageBox.post("ѡͼֽ汾ִй..", "", MessageBox.ERROR);
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/com.connor.chint.wuhan/src/com/connor/chint/JDBPackage/MySceneController.java b/com.connor.chint.wuhan/src/com/connor/chint/JDBPackage/MySceneController.java
index 37f0eef..3366956 100644
--- a/com.connor.chint.wuhan/src/com/connor/chint/JDBPackage/MySceneController.java
+++ b/com.connor.chint.wuhan/src/com/connor/chint/JDBPackage/MySceneController.java
@@ -151,29 +151,19 @@ public class MySceneController extends KFXPanelController {
private String updMsgString = "UPDATE CHINT_CHECK_DETAILS SET designresult = ?,proofreadresult = ?,design = ?,proofread = ?,\"AUDIT\" = ? where checkno = ? and no = ? and modelversion = ? and numberofchecks = ? ";
private String getTempString = "SELECT no,imcheckproject,ipcheckdetials,designresultrule,proofreadresultrule,designrule,proofreadrule,auditrule"
+ " FROM CHINT_CHECK_DETAILS_TEMPLATE where code = ? and modelversion = ? order by no asc";
-// @FXML
-// public void tableClick(MouseEvent event) {
-//
-// }
-// @FXML
-// void queryBtnClick(ActionEvent event) {
-//// table.get
-// System.out.println("clickBtn1");
-// //ижǷһβ
-// }
-// private String updMsgString = "UPDATE CHINT_CHECK_DETAILS SET designresult = ?,proofreadresult = ?,design = ?,proofread = ?,audit = ? where checkno = ? and no = ? and modelversion = ? ";
-// private String addMsgString = "INSERT INTO CHINT_CHECK_DETAILS (no,imcheckproject,ipcheckdetials,designresult,proofreadresult,design,proofread,"
-// + "audit,checkno,modelversion) VALUES (?,?,?,?,?,?,?,?,?,?)";
+ //Уԡˡ
private String upRowStrin2 = "UPDATE CHINT_CHECK_TITLE set datastatus = ?,PROOFREADISSUE = ?,AUDITISSUE = ?,DESIGNISSUE = ? ,"
+ " PROOFREADDATE = to_date(?,'yyyy-mm-ddhh24:mi:ss') where checkno = ? and modelversion = ? and numberofchecks = ? ";
private String upRowStrin1 = "UPDATE CHINT_CHECK_TITLE set datastatus = ?,PROOFREADISSUE = ?,AUDITISSUE = ?,DESIGNISSUE = ? ,"
+ " DESIGNDATE = to_date(?,'yyyy-mm-ddhh24:mi:ss') where checkno = ? and modelversion = ? and numberofchecks = ? ";
private String upRowStrin3 = "UPDATE CHINT_CHECK_TITLE set datastatus = ?,PROOFREADISSUE = ?,AUDITISSUE = ?,DESIGNISSUE = ? ,"
+ " AUDITDATE = to_date(?,'yyyy-mm-ddhh24:mi:ss') where checkno = ? and modelversion = ? and numberofchecks = ? ";
+ //
private String insertRow = "INSERT into CHINT_CHECK_TITLE (checkno,code,modelversion,name,"
+ "drawingno,spec,datastatus,createdate,owninguser,modedate,designdate,numberofchecks,PROOFREADISSUE,AUDITISSUE,DESIGNISSUE,drawingversion)"
+ " VALUES (?,?,?,?,?,?,?,to_date(?,'yyyy-mm-ddhh24:mi:ss'),?,to_date(?,'yyyy-mm-ddhh24:mi:ss'),to_date(?,'yyyy-mm-ddhh24:mi:ss'),'1',?,?,?,?) ";
+ //ѯģ
private String selectTitle = "select * from CHINT_CHECK_TITLE where checkno = ? and modelversion=? and numberofchecks = ? ";
void saveRows(String checkno,String modelversion,String type,String str_jclx,String str_thqd) {
String[] prefs = ChintPreferenceUtil.getPreferences("database_tc", session);
@@ -467,7 +457,7 @@ public class MySceneController extends KFXPanelController {
}
@FXML
private TabPane TestPane;
- private String bhSql = "select CODE,DRAWINGNO,name,modelversion from CHINT_CHECK_TITLE_TEMPLATE";
+ private String bhSql = "select CODE,DRAWINGNO,name,modelversion from CHINT_CHECK_TITLE_TEMPLATE order by modelversion desc";
private JDBFrame dialog;
protected AbstractAIFApplication app;
protected TCSession session;
@@ -522,18 +512,7 @@ public class MySceneController extends KFXPanelController {
}
});
-// frame.addComponentListener(new ComponentAdapter() {//ôӦСı¼
-// @Override
-// public void componentResized(ComponentEvent e) {
-// double width = scene.getWidth();;//ȡ
-//// double width = primaryStage.getWidth();
-// System.out.println("==============");
-// System.out.println("width==>"+width+"dialog"+dialog.getPreferredSize().getWidth());
-// double width2 = scene.getWindow().getWidth();
-// System.out.println("width2"+width2+"scollPane"+scollPane.getWidth()+"stackPane"+stackPane.getWidth());
-//
-// }
-// });
+
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
@@ -596,13 +575,25 @@ public class MySceneController extends KFXPanelController {
SqlUtil.getTCDataConnection(prefs);
ResultSet read = SqlUtil.read(bhSql);
+ //¼ģźͶӦͼ
Map drawCode = new HashMap<>();
+ //¼°汾
+ Map titleCodeMap = new HashMap<>();
while(read.next()) {
String code = read.getString(1);
String drawNo = read.getString(2);
String name = read.getString(3);
String modelversion = read.getString(4);
- drawCode.put(drawNo, new String[] { code,name,modelversion});
+ //ģ֮ ȡµ
+ if(titleCodeMap.containsKey(code)) {
+ continue;
+ }
+ titleCodeMap.put(code, modelversion);
+ if(!drawCode.containsKey(drawNo)) {
+ System.out.println("drawNo==>"+drawNo);
+ System.out.println("modelversion==>"+modelversion);
+ drawCode.put(drawNo, new String[] { code,name,modelversion});
+ }
}
SqlUtil.free();
System.out.println("drawCode==>"+drawCode.toString());
diff --git a/com.connor.chint.wuhan/src/com/connor/chint/sap2/util/BomToSapUtil.java b/com.connor.chint.wuhan/src/com/connor/chint/sap2/util/BomToSapUtil.java
index c8e287d..0fc96f4 100644
--- a/com.connor.chint.wuhan/src/com/connor/chint/sap2/util/BomToSapUtil.java
+++ b/com.connor.chint.wuhan/src/com/connor/chint/sap2/util/BomToSapUtil.java
@@ -66,7 +66,7 @@ public class BomToSapUtil {
List listBoms = new ArrayList<>();
try {
TCComponentItemRevision object = bomLine.getItemRevision();
- String object_type = object.getType();
+// String object_type = object.getType();
com.teamcenter.services.rac.cad._2007_01.StructureManagement structureService = com.teamcenter.services.rac.cad.StructureManagementService
.getService(RACUIUtil.getTCSession());
com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSAllLevelsInfo levelInfo = new com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSAllLevelsInfo();
diff --git a/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/AssignProcess.java b/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/AssignProcess.java
index 76792d8..ad36d1d 100644
--- a/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/AssignProcess.java
+++ b/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/AssignProcess.java
@@ -83,7 +83,7 @@ public class AssignProcess extends KCommand {
}
for(TCComponentItemRevision revP:revPs) {
- if(whereUsed.length>1) {
+ if(revPs.size()>1) {
// TCComponentItemRevision revP = (TCComponentItemRevision)whereUsed[i];
String property = revP.getProperty("zt2_ifpbom");
if(property==null||!property.equals("P")) {