Compare commits

..

52 Commits
ljh ... main

Author SHA1 Message Date
李冬阳 9900f547db 20250603代码上传
2 weeks ago
李冬阳 4de2e69a26 1ZDB300000P-逻辑修改前备份
2 months ago
李建辉 08b1c7d229 20241223——1
6 months ago
李建辉 06ce605cc3 20241223
6 months ago
李冬阳 64c15090ce Merge pull request '创建编辑更改通知单双击输入弹出单独大的输入框' (#32) from ldy into main
6 months ago
李冬阳 88f6b62971 创建编辑更改通知单双击输入弹出单独大的输入框
6 months ago
李冬阳 8142db5be0 Merge pull request '创建编辑更改通知单输入字段超出限制报错逻辑调整' (#31) from ldy into main
7 months ago
李冬阳 fa0df61922 创建编辑更改通知单输入字段超出限制报错逻辑调整
7 months ago
李冬阳 9806e11b62 Merge pull request '创建编辑更改通知单修改excel文件名称避免重复' (#30) from ldy into main
7 months ago
李冬阳 1bf1794302 创建编辑更改通知单修改excel文件名称避免重复
7 months ago
李冬阳 7455e2334d Merge pull request '更改通知单中引用更改申请单时,影响分析人员信息需要特殊处理。1、将:更改为;存储在数据库里 2.去掉数据库中多余的;' (#29) from ldy into main
7 months ago
李冬阳 dfea5b3496 更改通知单中引用更改申请单时,影响分析人员信息需要特殊处理。1、将:更改为;存储在数据库里 2.去掉数据库中多余的;
7 months ago
李冬阳 5abec9e98d Merge pull request '创建框架BOM云派接口报错逻辑优化' (#28) from ldy into main
8 months ago
李冬阳 169ce3d50a 创建框架BOM云派接口报错逻辑优化
8 months ago
李建辉 0b5e29dae1 commit
8 months ago
李冬阳 91c8cadc6e Merge pull request '1、创建编辑更改通知单下拉框去重' (#27) from ldy into main
8 months ago
李冬阳 2ddfd4cf70 1、创建编辑更改通知单下拉框去重
8 months ago
李冬阳 234f4aeed1 Merge pull request '武汉创建框架BOM无法读取首选项分类信息问题修改' (#26) from ldy into main
9 months ago
李冬阳 487b1bdad9 武汉创建框架BOM无法读取首选项分类信息问题修改
9 months ago
李冬阳 45e3a05384 Merge pull request '1、更改单中的更改类型默认值改为“临时更改”特性等级默认为“C”' (#25) from ldy into main
9 months ago
李冬阳 79d21d17b0 1、更改单中的更改类型默认值改为“临时更改”特性等级默认为“C”
9 months ago
李冬阳 cc4da5d194 Merge pull request '1、变更单创建/编辑时,填写了名字,没点指派,点到其他地方,提示进行指派。' (#24) from ldy into main
10 months ago
李冬阳 79aec2398d 1、变更单创建/编辑时,填写了名字,没点指派,点到其他地方,提示进行指派。
10 months ago
李冬阳 9aeac26390 Merge pull request '创建/编辑更改通知单功能增加选文件夹进行创建的逻辑' (#23) from ldy into main
10 months ago
李冬阳 1914fabab5 创建/编辑更改通知单功能增加选文件夹进行创建的逻辑
10 months ago
李建辉 05f255483b RDM项目创建
10 months ago
李建辉 b897f349f2 20240808更新自制外购属性
10 months ago
李冬阳 e3ee0e25b6 Merge pull request '创建/编辑更改通知单如果受影响分析的地方没有勾一个是,不允许点击指派人员,指派人员按钮为灰色,人员填写也不让写,如果部门下都改了否,那么也清空掉后面的人员信息' (#22) from ldy into main
10 months ago
李冬阳 57055d7b83 创建/编辑更改通知单如果受影响分析的地方没有勾一个是,不允许点击指派人员,指派人员按钮为灰色,人员填写也不让写,如果部门下都改了否,那么也清空掉后面的人员信息
10 months ago
李冬阳 dd24df7010 Merge pull request '武汉生成更改差异文件功能报错修改' (#21) from ldy into main
11 months ago
李冬阳 f23f48629f 武汉生成更改差异文件功能报错修改
11 months ago
李冬阳 eaaeca590f Merge pull request '创建/编辑更改通知单 影响分析,指派,数据库写邮箱前缀的修改点' (#20) from ldy into main
11 months ago
李冬阳 4aaa73ecc4 创建/编辑更改通知单 影响分析,指派,数据库写邮箱前缀的修改点
11 months ago
李建辉 aabd198422 贴心
11 months ago
李建辉 7f030fa8e3 铁心
11 months ago
李冬阳 736c63cb9d Merge pull request '1、变更界面,影响分析责任人,清空人员后,点击指派,增加弹框:请输入用户名' (#19) from ldy into main
11 months ago
李冬阳 cfd3ae18a9 1、变更界面,影响分析责任人,清空人员后,点击指派,增加弹框:请输入用户名
11 months ago
李建辉 2811ff7d92 装箱集成和工装需求
11 months ago
李建辉 92113227ea 装箱集成和工装需求
11 months ago
李冬阳 be67b3d060 Merge pull request '创建/编辑更改通知单1、增加时间的必填检查2、OA获取用户增加多人选择界面' (#18) from ldy into main
12 months ago
李冬阳 f75edad6e7 创建/编辑更改通知单1、增加时间的必填检查2、OA获取用户增加多人选择界面
12 months ago
李建辉 46057e6823 20240704装箱调整
12 months ago
李建辉 dc52c69198 工装需求
12 months ago
李冬阳 bbcac57a9a Merge pull request '工艺路线指派功能查找P物料顶层逻辑修改' (#17) from ldy into main
1 year ago
李冬阳 3fce8a3a3b 工艺路线指派功能查找P物料顶层逻辑修改
1 year ago
李建辉 e1e43dd81e 工装需求添加分页,制造部过滤
1 year ago
李冬阳 14b2c8ef95 Merge pull request '1、校对表填写功能增加null处理逻辑' (#16) from ldy into main
1 year ago
李冬阳 29488495c0 1、校对表填写功能增加null处理逻辑
1 year ago
李冬阳 7070568d24 Merge pull request '武汉异步增加根据图纸指派批次号的逻辑' (#15) from ldy into main
1 year ago
李冬阳 143a29a2d9 武汉异步增加根据图纸指派批次号的逻辑
1 year ago
李冬阳 b173978853 Merge pull request '1、生成更改差异文件增加过滤类型及类名修改' (#14) from ldy into main
1 year ago
李冬阳 b002d508e3 1、生成更改差异文件增加过滤类型及类名修改
1 year ago

@ -48,7 +48,6 @@ Require-Bundle: org.eclipse.ui,
com.teamcenter.rac.util;bundle-version="11000.2.0",
org.eclipse.osgi.services;bundle-version="3.3.100",
TcSoaCaeRac;bundle-version="11000.2.0",
com.teamcenter.rac.project;bundle-version="11000.2.0",
org.apache.poi.39;bundle-version="3.9.0"
Automatic-Module-Name: com.connor.chint.yunpi
Bundle-RequiredExecutionEnvironment: JavaSE-1.8,
@ -116,3 +115,5 @@ Bundle-ClassPath: .,
poi/okhttp-2.7.4.jar,
json_lib/jfxrt.jar,
poi/Spire.Xls.jar
Export-Package: com.chint.plm.applyMatnr,
com.chint.plm.createbomdifference

@ -1,4 +0,0 @@
/com/
/mes/
/nc/
/plm/

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import tornadofx.control.*?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult.DetailsController">
<children>
<GridPane fx:id="girdPane">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="100.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<FlowPane fx:id="flowPane" alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<children>
<CheckBox fx:id="cb_errBtn" mnemonicParsing="false" text="仅显示错误数据" />
</children>
</FlowPane>
<ScrollPane fx:id="scrollPane" prefHeight="1200.0" prefWidth="1200.0" style="-fx-padding: 5;" GridPane.rowIndex="1">
<content>
<TableView fx:id="tableView" prefHeight="660.0" prefWidth="1180.0" style="-fx-faint-focus-color: transparent;">
<columns>
<TableColumn fx:id="tc_xh" prefWidth="75.0" text="序号" />
<TableColumn fx:id="tc_batch" prefWidth="75.0" text="批次号" />
<TableColumn fx:id="tc_material" prefWidth="162.0" text="父物料编码" />
<TableColumn fx:id="tc_wbs" minWidth="0.0" prefWidth="127.0" text="WBS号" />
<TableColumn fx:id="tc_SapResult" minWidth="0.0" prefWidth="99.0" text="SAP处理结果" />
<TableColumn fx:id="tc_msg" prefWidth="126.0" text="结果内容" />
<TableColumn fx:id="tc_cDate" prefWidth="114.0" text="BOM创建日期" />
<TableColumn fx:id="tc_cTime" prefWidth="110.0" text="BOM创建时间" />
<TableColumn fx:id="tc_returnDate" prefWidth="110.0" text="BOM同步日期" />
<TableColumn fx:id="tc_returnTime" prefWidth="104.0" text="BOM同步时间" />
<TableColumn fx:id="tc_plm" prefWidth="82.0" text="PLM状态" />
</columns>
</TableView>
</content>
</ScrollPane>
<BorderPane prefHeight="100.0" prefWidth="200.0" style="-fx-padding: 10;" GridPane.rowIndex="2">
<left>
<FlowPane hgap="15.0" prefHeight="140.0" prefWidth="552.0" style="-fx-padding: 0;" BorderPane.alignment="CENTER">
<children>
<Button fx:id="bt_first" mnemonicParsing="false" onAction="#firstAction" prefHeight="30.0" prefWidth="80.0" text="首页" />
<Button fx:id="bt_last" mnemonicParsing="false" onAction="#lastAction" prefHeight="30.0" prefWidth="80.0" text="上一页" />
<Button fx:id="bt_next" mnemonicParsing="false" onAction="#nextAction" prefWidth="80.0" text="下一页" />
<Button fx:id="bt_tail" mnemonicParsing="false" onAction="#tailAction" prefWidth="80.0" text="尾页" />
<Button fx:id="bt_all" mnemonicParsing="false" onAction="#allAction" text="本页全部加载" />
</children>
<BorderPane.margin>
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0" />
</BorderPane.margin>
<padding>
<Insets left="10.0" right="10.0" />
</padding>
</FlowPane>
</left>
<right>
<FlowPane alignment="TOP_CENTER" prefHeight="140.0" prefWidth="589.0" BorderPane.alignment="CENTER">
<children>
<TextField fx:id="pageNumTxt" alignment="TOP_RIGHT" prefHeight="30.0" prefWidth="154.0" text="1" />
<Label fx:id="lb_page" prefWidth="80.0" text="/" />
<Button mnemonicParsing="false" onAction="#outputAction" text="结果导出" />
</children>
<BorderPane.margin>
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0" />
</BorderPane.margin>
</FlowPane>
</right>
</BorderPane>
</children>
</GridPane>
</children>
</StackPane>

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import tornadofx.control.*?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1600.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult.SearchSapController">
<children>
<ScrollPane fx:id="scrollPane" prefHeight="200.0">
<content>
<BorderPane fx:id="topBorder" prefHeight="200.0" prefWidth="200.0">
<top>
<TitledPane fx:id="tp_sxtj" prefHeight="650.0" text="筛选条件" BorderPane.alignment="CENTER">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="10.0" />
</padding>
<content>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<top>
<TitledPane fx:id="rwtjPane" prefHeight="300.0" prefWidth="200.0" text="任务条件" BorderPane.alignment="CENTER">
<content>
<GridPane fx:id="gridPane" style="-fx-padding: 15;">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="40.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="60.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<padding>
<Insets bottom="5.0" left="5.0" right="10.0" top="5.0" />
</padding>
<children>
<Label text="任务编号:" />
<Label text="工厂:" GridPane.rowIndex="1" />
<Label text="发起人:" GridPane.rowIndex="2" />
<Label text="发起时间晚于:" GridPane.rowIndex="3" />
<Label text="发起时间早于:" GridPane.rowIndex="4" />
<Label text="项目名称:" GridPane.columnIndex="3" GridPane.rowIndex="4" />
<Label text="WBS号:" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<Label text="数据状态:" GridPane.columnIndex="3" GridPane.rowIndex="5" />
<Label text="是否仅查看错误数据:" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label text="是否仅查看错误任务:" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<Label text="任务SAP处理结果:" GridPane.columnIndex="3" />
<TextField fx:id="tx_bh" GridPane.columnIndex="1" />
<TextField fx:id="tx_user" promptText="用户名称或用户ID" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="tx_wbs" promptText="wbs号" GridPane.columnIndex="4" GridPane.rowIndex="3" />
<TextField fx:id="tx_projectName" promptText="项目名称" GridPane.columnIndex="4" GridPane.rowIndex="4" />
<ComboBox fx:id="cb_factory" prefWidth="250.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<ComboBox fx:id="cb_status" prefWidth="250.0" GridPane.columnIndex="4" GridPane.rowIndex="5" />
<ComboBox fx:id="cb_sapState" prefWidth="250.0" GridPane.columnIndex="4" />
<CheckBox fx:id="bt_errMsg" mnemonicParsing="false" text="是" GridPane.columnIndex="4" GridPane.rowIndex="2" />
<CheckBox fx:id="bt_errTask" mnemonicParsing="false" text="是" GridPane.columnIndex="4" GridPane.rowIndex="1" />
</children>
</GridPane>
</content>
</TitledPane>
</top>
<center>
<TitledPane fx:id="mxtjPane" prefHeight="200.0" prefWidth="200.0" text="明细条件" BorderPane.alignment="CENTER">
<content>
<GridPane style="-fx-padding: 15;">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="40.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="60.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="父物料编码:" />
<Label text="SAP数据状态:" GridPane.rowIndex="1" />
<Label text="SAP返回信息" GridPane.rowIndex="2" />
<TextField fx:id="tx_pcode" promptText="多个物料以;隔开" GridPane.columnIndex="1" />
<TextField fx:id="tx_sapReturn" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<ComboBox fx:id="tx_sapStatus" prefWidth="250.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="WBS号:" GridPane.columnIndex="3" />
<Label text="批次号:" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="tx_wbsMx" GridPane.columnIndex="4" />
<TextField fx:id="tx_batchNum" GridPane.columnIndex="4" GridPane.rowIndex="1" />
</children>
</GridPane>
</content>
</TitledPane>
</center>
<bottom>
<GridPane fx:id="bt_cx" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="bt_close" mnemonicParsing="false" onAction="#closeClick" text="关闭" GridPane.columnIndex="3" />
<Button fx:id="bt_search" mnemonicParsing="false" onAction="#searchAction" text="查询" GridPane.columnIndex="1" />
<Button fx:id="bt_czcx" mnemonicParsing="false" onAction="#resetClick" text="重置查询" GridPane.columnIndex="2" />
</children>
</GridPane>
</bottom>
</BorderPane>
</content>
</TitledPane>
</top>
<center>
<BorderPane fx:id="resultBorder" prefHeight="800.0" prefWidth="1200.0" BorderPane.alignment="CENTER">
<top>
<TitledPane fx:id="tp_result" prefHeight="600.0" prefWidth="200.0" text="结果" BorderPane.alignment="CENTER">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="10.0" />
</padding>
<content>
<BorderPane prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<opaqueInsets>
<Insets />
</opaqueInsets>
<top>
<TableView fx:id="tableView" prefHeight="460.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<columns>
<TableColumn fx:id="tc_xh" prefWidth="75.0" text="序号" />
<TableColumn fx:id="tc_rwh" prefWidth="102.0" text="任务号" />
<TableColumn fx:id="tc_fqr" prefWidth="133.0" text="发起人" />
<TableColumn fx:id="tc_fqsj" prefWidth="160.0" text="发起时间" />
<TableColumn fx:id="tc_zrws" prefWidth="85.0" text="子任务数" />
<TableColumn fx:id="tc_sapState" prefWidth="142.0" text="SAP处理结果" />
<TableColumn fx:id="tc_status" prefWidth="111.0" text="数据状态" />
<TableColumn fx:id="tc_plm" prefWidth="133.0" text="PLM处理进度" />
<TableColumn fx:id="tc_result" minWidth="7.0" prefWidth="103.0" text="结果明细" />
<TableColumn fx:id="tc_log" minWidth="0.0" prefWidth="91.0" text="日志获取" />
</columns>
</TableView>
</top>
<bottom>
<GridPane BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" />
</BorderPane.margin>
<children>
<Button fx:id="bt_sy" mnemonicParsing="false" onAction="#firstBtnAction" text="首页" GridPane.columnIndex="1" />
<Button fx:id="bt_syy" mnemonicParsing="false" onAction="#lastBtnAction" text="上一页" GridPane.columnIndex="2" />
<Button fx:id="bt_xyy" mnemonicParsing="false" onAction="#nextBtnAction" text="下一页" GridPane.columnIndex="3" />
<Button fx:id="bt_wy" mnemonicParsing="false" onAction="#tailBtnAction" text="尾页" GridPane.columnIndex="4" />
</children>
</GridPane>
</bottom>
</BorderPane>
</content>
</TitledPane>
</top>
</BorderPane>
</center>
<bottom>
<AnchorPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="bt_closeAll" layoutX="1108.0" layoutY="14.0" mnemonicParsing="false" onAction="#clossAll" text="关闭" />
</children>
</AnchorPane>
</bottom>
<padding>
<Insets left="10.0" />
</padding>
</BorderPane>
</content>
</ScrollPane>
</children>
</StackPane>

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import tornadofx.control.*?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult.DetailsController">
<children>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="100.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<FlowPane alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<children>
<CheckBox fx:id="cb_errBtn" mnemonicParsing="false" onAction="#errBtnAction" text="仅显示错误数据" />
</children>
</FlowPane>
<ScrollPane prefHeight="1200.0" prefWidth="1200.0" style="-fx-padding: 5;" GridPane.rowIndex="1">
<content>
<TableView fx:id="tableView" prefHeight="700.0" prefWidth="1190.0" style="-fx-faint-focus-color: transparent;">
<columns>
<TableColumn fx:id="tc_xh" prefWidth="75.0" text="序号" />
<TableColumn fx:id="tc_batch" prefWidth="75.0" text="批次号" />
<TableColumn fx:id="tc_material" prefWidth="162.0" text="父物料编码" />
<TableColumn fx:id="tc_wbs" minWidth="0.0" prefWidth="127.0" text="WBS号" />
<TableColumn fx:id="tc_SapResult" minWidth="0.0" prefWidth="99.0" text="SAP处理结果" />
<TableColumn fx:id="tc_msg" prefWidth="126.0" text="结果内容" />
<TableColumn fx:id="tc_cDate" prefWidth="114.0" text="BOM创建日期" />
<TableColumn fx:id="tc_cTime" prefWidth="110.0" text="BOM创建时间" />
<TableColumn fx:id="tc_returnDate" prefWidth="110.0" text="BOM同步日期" />
<TableColumn fx:id="tc_returnTime" prefWidth="104.0" text="BOM同步时间" />
<TableColumn fx:id="tc_plm" prefWidth="82.0" text="PLM状态" />
</columns>
</TableView>
</content>
</ScrollPane>
<BorderPane prefHeight="100.0" prefWidth="200.0" style="-fx-padding: 10;" GridPane.rowIndex="2">
<left>
<FlowPane hgap="15.0" prefHeight="140.0" prefWidth="552.0" style="-fx-padding: 0;" BorderPane.alignment="CENTER">
<children>
<Button fx:id="bt_first" mnemonicParsing="false" onAction="#firstAction" prefHeight="30.0" prefWidth="80.0" text="首页" />
<Button fx:id="bt_last" mnemonicParsing="false" onAction="#lastAction" prefHeight="30.0" prefWidth="80.0" text="上一页" />
<Button fx:id="bt_next" mnemonicParsing="false" onAction="#nextAction" prefWidth="80.0" text="下一页" />
<Button fx:id="bt_tail" mnemonicParsing="false" onAction="#tailAction" prefWidth="80.0" text="尾页" />
<Button fx:id="bt_all" mnemonicParsing="false" onAction="#allAction" text="本页全部加载" />
</children>
<BorderPane.margin>
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0" />
</BorderPane.margin>
<padding>
<Insets left="10.0" right="10.0" />
</padding>
</FlowPane>
</left>
<right>
<FlowPane alignment="TOP_CENTER" prefHeight="140.0" prefWidth="589.0" BorderPane.alignment="CENTER">
<children>
<TextField alignment="TOP_RIGHT" prefHeight="30.0" prefWidth="154.0" text="1" />
<Label fx:id="lb_page" prefWidth="80.0" text="/" />
<Button mnemonicParsing="false" onAction="#outputAction" text="结果导出" />
</children>
<BorderPane.margin>
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0" />
</BorderPane.margin>
</FlowPane>
</right>
</BorderPane>
</children>
</GridPane>
</children>
</StackPane>

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import tornadofx.control.*?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1600.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult.SearchSapController">
<children>
<ScrollPane prefHeight="865.0" prefWidth="1192.0">
<content>
<BorderPane prefHeight="849.0" prefWidth="1075.0">
<center>
<BorderPane prefHeight="503.0" prefWidth="1075.0" BorderPane.alignment="CENTER">
<right>
<TitledPane fx:id="tp_result" animated="false" prefHeight="480.0" prefWidth="1075.0" text="结果" BorderPane.alignment="CENTER">
<content>
<BorderPane prefHeight="400.0" prefWidth="900.0">
<top>
<TableView fx:id="tableView" BorderPane.alignment="CENTER">
<columns>
<TableColumn fx:id="tc_xh" prefWidth="54.0" text="序号" />
<TableColumn fx:id="tc_drawingno" prefWidth="96.0" text="图号" />
<TableColumn fx:id="tc_datesetname" prefWidth="103.0" text="文件名称" />
<TableColumn fx:id="tc_materialno" prefWidth="98.0" text="物料编码" />
<TableColumn fx:id="tc_wbs" prefWidth="97.0" text="WBS号" />
<TableColumn fx:id="tc_revision" prefWidth="45.0" text="版本" />
<TableColumn fx:id="tc_code" prefWidth="66.0" text="文件类型" />
<TableColumn fx:id="tc_urlcreatetime" prefWidth="94.0" text="提交时间" />
<TableColumn fx:id="tc_released" prefWidth="71.0" text="发放状态" />
<TableColumn fx:id="tc_username" prefWidth="59.0" text="提交人" />
<TableColumn fx:id="tc_fileurl" prefWidth="265.0" text="链接" />
</columns>
</TableView>
</top>
<bottom>
<GridPane BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="321.0" minWidth="10.0" prefWidth="265.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="349.0" minWidth="10.0" prefWidth="160.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="334.0" minWidth="10.0" prefWidth="155.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="309.0" minWidth="10.0" prefWidth="149.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="219.0" minWidth="10.0" prefWidth="213.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="bt_sy" mnemonicParsing="false" onAction="#firstBtnAction" text="首页" GridPane.columnIndex="1" />
<Button fx:id="bt_syy" mnemonicParsing="false" onAction="#lastBtnAction" text="上一页" GridPane.columnIndex="2" />
<Button fx:id="bt_xyy" mnemonicParsing="false" onAction="#nextBtnAction" text="下一页" GridPane.columnIndex="3" />
<Button fx:id="bt_wy" mnemonicParsing="false" onAction="#tailBtnAction" text="尾页" GridPane.columnIndex="4" />
</children>
</GridPane>
</bottom>
</BorderPane>
</content>
</TitledPane>
</right>
</BorderPane>
</center>
<top>
<TitledPane fx:id="tp_sxtj" animated="false" text="筛选条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="331.0" prefWidth="1073.0">
<children>
<BorderPane layoutX="26.0" layoutY="8.0" prefHeight="235.0" prefWidth="1022.0">
<top>
<TitledPane fx:id="rwtjPane" animated="false" prefHeight="236.0" prefWidth="1022.0" text="查询条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane fx:id="gridPane" layoutX="20.0" layoutY="16.0" prefHeight="175.0" prefWidth="980.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="208.0" minWidth="10.0" prefWidth="157.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="300.0" minWidth="10.0" prefWidth="268.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="291.0" minWidth="10.0" prefWidth="101.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="214.0" minWidth="10.0" prefWidth="97.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="356.0" minWidth="10.0" prefWidth="356.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="发放人:" GridPane.rowIndex="1" />
<Label text="物料编码" GridPane.rowIndex="2" />
<Label text="发放状态" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<Label text="工厂" GridPane.columnIndex="3" />
<Label text="WBS号:" />
<TextField fx:id="tx_bh" GridPane.columnIndex="1" />
<TextField fx:id="tx_projectName" prefHeight="30.0" prefWidth="291.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="tx_user" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<ComboBox fx:id="cb_sapState" prefHeight="30.0" prefWidth="271.0" GridPane.columnIndex="4" />
<ComboBox fx:id="cb_status" prefHeight="30.0" prefWidth="272.0" GridPane.columnIndex="4" GridPane.rowIndex="1" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
</BorderPane>
<GridPane layoutX="216.0" layoutY="270.0" prefHeight="30.0" prefWidth="702.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="10.0" prefWidth="80.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="219.0" minWidth="10.0" prefWidth="219.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="216.0" minWidth="10.0" prefWidth="210.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="185.0" minWidth="10.0" prefWidth="74.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="bt_close" mnemonicParsing="false" onAction="#closeClick" prefHeight="30.0" prefWidth="86.0" text="关闭" GridPane.columnIndex="3" />
<Button fx:id="bt_search" mnemonicParsing="false" onAction="#searchAction" prefHeight="30.0" prefWidth="96.0" text="查询" GridPane.columnIndex="1" />
<Button fx:id="bt_czcx" mnemonicParsing="false" onAction="#resetClick" prefHeight="30.0" prefWidth="88.0" text="重置查询" GridPane.columnIndex="2" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
</BorderPane>
</content>
</ScrollPane>
</children>
</StackPane>

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import tornadofx.control.*?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1600.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult9.SearchSapController">
<children>
<ScrollPane fx:id="scrollPane" prefHeight="865.0" prefWidth="1192.0">
<content>
<BorderPane prefHeight="849.0" prefWidth="1075.0">
<center>
<BorderPane fx:id="resultBorder" prefHeight="503.0" prefWidth="1075.0" BorderPane.alignment="CENTER">
<right>
<TitledPane fx:id="tp_result" animated="false" prefHeight="480.0" prefWidth="1075.0" text="结果" BorderPane.alignment="CENTER">
<content>
<BorderPane prefHeight="400.0" prefWidth="900.0">
<top>
<TableView fx:id="tableView" prefHeight="374.0" prefWidth="1049.0" BorderPane.alignment="CENTER">
<columns>
<TableColumn fx:id="tc_xh" prefWidth="54.0" text="序号" />
<TableColumn fx:id="tc_drawingno" prefWidth="96.0" text="图号" />
<TableColumn fx:id="tc_datesetname" prefWidth="103.0" text="文件名称" />
<TableColumn fx:id="tc_materialno" prefWidth="98.0" text="物料编码" />
<TableColumn fx:id="tc_wbs" prefWidth="97.0" text="WBS号" />
<TableColumn fx:id="tc_revision" prefWidth="45.0" text="版本" />
<TableColumn fx:id="tc_code" prefWidth="66.0" text="文件类型" />
<TableColumn fx:id="tc_urlcreatetime" prefWidth="94.0" text="提交时间" />
<TableColumn fx:id="tc_released" prefWidth="71.0" text="发放状态" />
<TableColumn fx:id="tc_username" prefWidth="59.0" text="提交人" />
<TableColumn fx:id="tc_fileurl" prefWidth="265.0" text="链接" />
</columns>
</TableView>
</top>
<bottom>
<GridPane BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="321.0" minWidth="10.0" prefWidth="265.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="349.0" minWidth="10.0" prefWidth="160.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="334.0" minWidth="10.0" prefWidth="155.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="309.0" minWidth="10.0" prefWidth="149.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="219.0" minWidth="10.0" prefWidth="213.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="bt_sy" mnemonicParsing="false" onAction="#firstBtnAction" text="首页" GridPane.columnIndex="1" />
<Button fx:id="bt_syy" mnemonicParsing="false" onAction="#lastBtnAction" text="上一页" GridPane.columnIndex="2" />
<Button fx:id="bt_xyy" mnemonicParsing="false" onAction="#nextBtnAction" text="下一页" GridPane.columnIndex="3" />
<Button fx:id="bt_wy" mnemonicParsing="false" onAction="#tailBtnAction" text="尾页" GridPane.columnIndex="4" />
</children>
</GridPane>
</bottom>
</BorderPane>
</content>
</TitledPane>
</right>
</BorderPane>
</center>
<top>
<TitledPane fx:id="tp_sxtj" animated="false" text="筛选条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="331.0" prefWidth="1073.0">
<children>
<BorderPane layoutX="26.0" layoutY="8.0" prefHeight="235.0" prefWidth="1022.0">
<top>
<TitledPane fx:id="rwtjPane" animated="false" prefHeight="236.0" prefWidth="1022.0" text="查询条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane fx:id="gridPane" layoutX="20.0" layoutY="16.0" prefHeight="175.0" prefWidth="980.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="208.0" minWidth="10.0" prefWidth="157.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="300.0" minWidth="10.0" prefWidth="268.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="291.0" minWidth="10.0" prefWidth="101.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="214.0" minWidth="10.0" prefWidth="97.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="356.0" minWidth="10.0" prefWidth="356.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="发放人:" GridPane.rowIndex="1" />
<Label text="物料编码" GridPane.rowIndex="2" />
<Label text="发放状态" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<Label text="工厂" GridPane.columnIndex="3" />
<Label text="WBS号:" />
<TextField fx:id="tx_bh" GridPane.columnIndex="1" />
<TextField fx:id="tx_projectName" prefHeight="30.0" prefWidth="291.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="tx_user" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<ComboBox fx:id="cb_sapState" prefHeight="30.0" prefWidth="271.0" GridPane.columnIndex="4" />
<ComboBox fx:id="cb_status" prefHeight="30.0" prefWidth="272.0" GridPane.columnIndex="4" GridPane.rowIndex="1" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
</BorderPane>
<GridPane layoutX="216.0" layoutY="270.0" prefHeight="30.0" prefWidth="702.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="10.0" prefWidth="80.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="219.0" minWidth="10.0" prefWidth="219.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="216.0" minWidth="10.0" prefWidth="210.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="185.0" minWidth="10.0" prefWidth="74.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="bt_close" mnemonicParsing="false" onAction="#closeClick" prefHeight="30.0" prefWidth="86.0" text="关闭" GridPane.columnIndex="3" />
<Button fx:id="bt_search" mnemonicParsing="false" onAction="#searchAction" prefHeight="30.0" prefWidth="96.0" text="查询" GridPane.columnIndex="1" />
<Button fx:id="bt_czcx" mnemonicParsing="false" onAction="#resetClick" prefHeight="30.0" prefWidth="88.0" text="重置查询" GridPane.columnIndex="2" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
</BorderPane>
</content>
</ScrollPane>
</children>
</StackPane>

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<GridPane hgap="5.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="240.0" prefWidth="400.0" vgap="5.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.createEcn.AssignIdController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" vgrow="NEVER" />
</rowConstraints>
<children>
<FlowPane alignment="CENTER" hgap="12.0" GridPane.rowIndex="1">
<children>
<Button fx:id="assignBtn" mnemonicParsing="false" onAction="#okBtnClick" prefWidth="77.0" text="指派" />
<Button fx:id="closeBtn" mnemonicParsing="false" onAction="#cancelBtnClick" text=" 取消 " />
</children>
</FlowPane>
<GridPane alignment="CENTER" prefHeight="200.0">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="50.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="创建者工厂:" />
<ComboBox fx:id="factoryComb" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" />
<Label text="创建者部门:" GridPane.rowIndex="1" />
<ComboBox fx:id="bmComb" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<RadioButton fx:id="rb_formalChange" maxWidth="200.0" prefWidth="150.0" mnemonicParsing="false" text="正式更改" GridPane.rowIndex="2" />
<RadioButton fx:id="rb_tempChange" mnemonicParsing="false" text="临时更改" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="预览" GridPane.rowIndex="3" />
<TextField fx:id="ylText" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
</children>
</GridPane>
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</GridPane>

@ -0,0 +1,285 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.createEcn.CreateEcnController">
<children>
<ScrollPane fx:id="scollPane" prefHeight="800.0" prefWidth="1200.0">
<content>
<GridPane fx:id="gridPane" prefHeight="1600.0" prefWidth="1180.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="160.0" minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="280.0" minHeight="10.0" prefHeight="230.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="600.0" minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="NEVER" />
</rowConstraints>
<children>
<BorderPane prefHeight="160.0" prefWidth="200.0">
<left>
<FlowPane alignment="CENTER_LEFT" hgap="12.0" prefHeight="80.0" prefWidth="400.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<children>
<Label text="单位:" />
<TextField fx:id="factoryText" />
</children>
<BorderPane.margin>
<Insets />
</BorderPane.margin>
<padding>
<Insets left="10.0" />
</padding>
</FlowPane>
</left>
<center>
<FlowPane alignment="CENTER" prefHeight="200.0" prefWidth="100.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<children>
<Label text="更改通知单">
<font>
<Font size="22.0" />
</font>
</Label>
</children>
</FlowPane>
</center>
<padding>
<Insets left="2.0" right="2.0" top="2.0" />
</padding>
<bottom>
<BorderPane prefHeight="80.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<left>
<FlowPane alignment="CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<children>
<Label text="更改类型">
<font>
<Font size="18.0" />
</font>
</Label>
</children>
</FlowPane>
</left>
<center>
<GridPane style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="400.0" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<FlowPane alignment="CENTER_LEFT" hgap="100.0" prefHeight="200.0" prefWidth="200.0">
<children>
<RadioButton fx:id="rb_formalChange" mnemonicParsing="false" text="正式更改" />
<RadioButton fx:id="rb_tempChange" mnemonicParsing="false" text="临时更改" />
</children>
<GridPane.margin>
<Insets />
</GridPane.margin>
<padding>
<Insets left="5.0" />
</padding>
</FlowPane>
<FlowPane alignment="CENTER_LEFT" hgap="100.0" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1">
<children>
<RadioButton fx:id="rb_product" mnemonicParsing="false" text="产品" />
<RadioButton fx:id="rb_Process" mnemonicParsing="false" text="过程" />
</children>
<GridPane.margin>
<Insets />
</GridPane.margin>
<padding>
<Insets left="5.0" />
</padding>
</FlowPane>
<FlowPane alignment="CENTER_LEFT" hgap="15.0" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
<padding>
<Insets left="5.0" />
</padding>
</FlowPane>
</children>
</GridPane>
</center>
</BorderPane>
</bottom>
<right>
<GridPane prefHeight="78.0" prefWidth="400.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="120.0" minWidth="10.0" prefWidth="80.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="150.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="60.0" minWidth="10.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="通知单编号:" />
<Label text="关联申请单编号:" GridPane.rowIndex="1" />
<Button fx:id="assignBtn" mnemonicParsing="false" onAction="#assignClick" text="指派" GridPane.columnIndex="2" />
<Button mnemonicParsing="false" onAction="#relateClick" text="查看" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<TextField fx:id="ecnId" GridPane.columnIndex="1" />
<TextField fx:id="relateEcnText" GridPane.columnIndex="1" GridPane.rowIndex="1" />
</children>
<padding>
<Insets left="5.0" />
</padding>
</GridPane>
</right>
</BorderPane>
<TitledPane fx:id="tp_product" animated="false" prefHeight="280.0" prefWidth="1200.0" text="产品及项目信息:" GridPane.rowIndex="1">
<content>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<center>
<GridPane fx:id="productPane" alignment="CENTER" maxHeight="200.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="160.0" minWidth="10.0" prefWidth="20.0" />
<ColumnConstraints halignment="LEFT" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="160.0" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="LEFT" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="产品型号:" />
<Label text="产品名称:" GridPane.rowIndex="1" />
<Label text="文件代号及名称:" GridPane.rowIndex="2" />
<ComboBox fx:id="pmCombox" prefHeight="30.0" prefWidth="370.0" GridPane.columnIndex="1" />
<ComboBox fx:id="prodNameComb" prefHeight="30.0" prefWidth="370.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="markText" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="合同代号:" GridPane.columnIndex="2" />
<Label text="合同名称:" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label text="更改实施日期:" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="contractText" GridPane.columnIndex="3" />
<TextField fx:id="htNameText" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<DatePicker fx:id="changeDate" GridPane.columnIndex="3" GridPane.rowIndex="2" />
</children>
<padding>
<Insets right="10.0" />
</padding>
</GridPane>
</center>
<bottom>
<BorderPane prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets top="5.0" />
</BorderPane.margin>
<left>
<FlowPane alignment="CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<children>
<Label text="发放部门" />
</children>
</FlowPane>
</left>
<center>
<FlowPane fx:id="departPane" alignment="CENTER_LEFT" hgap="20.0" prefHeight="200.0" prefWidth="200.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets />
</BorderPane.margin>
<padding>
<Insets left="5.0" />
</padding>
</FlowPane>
</center>
</BorderPane>
</bottom>
</BorderPane>
</content>
<padding>
<Insets left="2.0" right="2.0" />
</padding>
</TitledPane>
<TitledPane fx:id="tc_details" prefHeight="1200.0" prefWidth="200.0" text="变更明细:" GridPane.rowIndex="2">
<GridPane.margin>
<Insets top="5.0" />
</GridPane.margin>
<padding>
<Insets left="2.0" right="2.0" />
</padding>
<content>
<BorderPane>
<center>
<ScrollPane prefHeight="500.0" style="-fx-padding: 5;" BorderPane.alignment="CENTER">
<content>
<TableView fx:id="tableView" prefHeight="480.0" prefWidth="1142.0" style="-fx-faint-focus-color: transparent;" />
</content>
</ScrollPane>
</center>
<top>
<FlowPane alignment="CENTER" hgap="25.0" prefHeight="80.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="addRows" mnemonicParsing="false" onAction="#addRows" text="增加五行" />
<Button fx:id="addRow" mnemonicParsing="false" onAction="#addRow" text="增加行" />
<Button fx:id="deleteRow" mnemonicParsing="false" onAction="#deleteRow" text="删除行" />
</children>
<BorderPane.margin>
<Insets bottom="5.0" />
</BorderPane.margin>
</FlowPane>
</top>
</BorderPane>
</content>
</TitledPane>
<GridPane GridPane.rowIndex="3">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" prefHeight="100.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TitledPane fx:id="referencePane" animated="false" text="影响分析(会签):">
<GridPane.margin>
<Insets top="5.0" />
</GridPane.margin>
<padding>
<Insets left="2.0" right="2.0" />
</padding>
<content>
<ScrollPane prefHeight="400.0">
<content>
<TableView fx:id="refTable" prefHeight="400.0" prefWidth="1170.0" />
</content>
</ScrollPane>
</content>
</TitledPane>
<BorderPane prefHeight="100.0" prefWidth="200.0" GridPane.rowIndex="1">
<left>
<Label text="备注:" />
</left>
<center>
<ScrollPane prefHeight="100.0" style="-fx-padding: 5;" BorderPane.alignment="CENTER">
<content>
<TextArea fx:id="remarkArea" prefHeight="99.0" prefWidth="1100.0" wrapText="true" />
</content>
</ScrollPane>
</center>
</BorderPane>
<FlowPane alignment="TOP_CENTER" hgap="40.0" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2">
<children>
<Button fx:id="createBtn" mnemonicParsing="false" onAction="#createClick" text="确定" />
<Button alignment="CENTER" mnemonicParsing="false" onAction="#disposeClick" text="取消" />
</children>
<GridPane.margin>
<Insets top="5.0" />
</GridPane.margin>
</FlowPane>
</children>
</GridPane>
</children>
</GridPane>
</content>
</ScrollPane>
</children>
</StackPane>

@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import tornadofx.control.*?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.createEcn.RelateEcnController">
<children>
<ScrollPane fx:id="scollPane" prefHeight="800.0" prefWidth="1200.0">
<content>
<GridPane fx:id="gridPane" prefHeight="800.0" prefWidth="1180.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="85.0" minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="280.0" minHeight="10.0" prefHeight="230.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="400.0" minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<BorderPane maxHeight="80.0" prefHeight="80.0" prefWidth="200.0">
<padding>
<Insets left="2.0" right="2.0" top="2.0" />
</padding>
<bottom>
<BorderPane prefHeight="80.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<left>
<FlowPane alignment="CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<children>
<Label text="更改类型">
<font>
<Font size="18.0" />
</font>
</Label>
</children>
</FlowPane>
</left>
<center>
<GridPane style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="400.0" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<FlowPane alignment="CENTER_LEFT" hgap="100.0" prefHeight="200.0" prefWidth="200.0">
<children>
<RadioButton fx:id="rb_formalChange" mnemonicParsing="false" text="正式更改" />
<RadioButton fx:id="rb_tempChange" mnemonicParsing="false" text="临时更改" />
</children>
<GridPane.margin>
<Insets />
</GridPane.margin>
<padding>
<Insets left="5.0" />
</padding>
</FlowPane>
<FlowPane alignment="CENTER_LEFT" hgap="15.0" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1">
<children>
<RadioButton fx:id="rb_product" mnemonicParsing="false" text="产品" />
<Label text="产品特性:" />
<RadioButton mnemonicParsing="false" text="A" />
<RadioButton mnemonicParsing="false" text="B" />
<RadioButton mnemonicParsing="false" text="C" />
</children>
<GridPane.margin>
<Insets />
</GridPane.margin>
<padding>
<Insets left="5.0" />
</padding>
</FlowPane>
<FlowPane alignment="CENTER_LEFT" hgap="15.0" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
<children>
<RadioButton fx:id="rb_Process" mnemonicParsing="false" text="过程" />
<Label text="过程特性:" />
<RadioButton mnemonicParsing="false" text="A" />
<RadioButton mnemonicParsing="false" text="B" />
<RadioButton mnemonicParsing="false" text="C" />
</children>
<padding>
<Insets left="5.0" />
</padding>
</FlowPane>
</children>
</GridPane>
</center>
</BorderPane>
</bottom>
</BorderPane>
<TitledPane fx:id="tp_product" animated="false" prefHeight="280.0" prefWidth="1200.0" text="更改涉及内容:" GridPane.rowIndex="1">
<content>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<center>
<GridPane alignment="CENTER" maxHeight="200.0" style="-fx-border-color: black;" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="160.0" minWidth="10.0" prefWidth="20.0" />
<ColumnConstraints halignment="LEFT" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="160.0" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="产品型号:" />
<Label text="产品名称:" GridPane.rowIndex="1" />
<Label text="文件代号及名称:" GridPane.rowIndex="2" />
<TextField fx:id="prodModelText" GridPane.columnIndex="1" />
<TextField fx:id="prodNameText" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="docCodeText" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="合同代号:" GridPane.columnIndex="2" />
<Label text="合同名称:" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label text="图样代号及名称:" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="contCondeText" GridPane.columnIndex="3" />
<TextField fx:id="contNameText" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="pattCodeText" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label text="申请人:" GridPane.rowIndex="3" />
<Label text="申请单号:" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Label text="申请时间晚于:" GridPane.rowIndex="4" />
<Label text="申请时间早于:" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<TextField fx:id="applicantText" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField fx:id="requestNoText" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<DatePicker fx:id="startTime" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<DatePicker fx:id="endTime" GridPane.columnIndex="3" GridPane.rowIndex="4" />
</children>
<padding>
<Insets right="10.0" top="2.0" />
</padding>
</GridPane>
</center>
<bottom>
<BorderPane prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets top="5.0" />
</BorderPane.margin>
<right>
<FlowPane alignment="CENTER" hgap="30.0" prefHeight="40.0" prefWidth="318.0" BorderPane.alignment="CENTER">
<children>
<Button mnemonicParsing="false" onAction="#searchClick" prefWidth="80.0" text="查询" />
<Button mnemonicParsing="false" onAction="#closeClick" prefWidth="80.0" text="关闭" />
</children>
</FlowPane>
</right>
</BorderPane>
</bottom>
</BorderPane>
</content>
<padding>
<Insets left="2.0" right="2.0" />
</padding>
</TitledPane>
<TitledPane fx:id="tc_details" prefHeight="400.0" prefWidth="200.0" text="搜索结果:" GridPane.rowIndex="2">
<GridPane.margin>
<Insets top="5.0" />
</GridPane.margin>
<padding>
<Insets left="2.0" right="2.0" />
</padding>
<content>
<BorderPane>
<center>
<ScrollPane prefHeight="400.0" style="-fx-padding: 5;" BorderPane.alignment="CENTER">
<content>
<TableView fx:id="tableView" prefHeight="400.0" prefWidth="1142.0" style="-fx-faint-focus-color: transparent;" />
</content>
</ScrollPane>
</center>
</BorderPane>
</content>
</TitledPane>
</children>
</GridPane>
</content>
</ScrollPane>
</children>
</StackPane>

@ -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

@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1200.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.chint.JDBPackage.MySceneController">
<children>
<ScrollPane fx:id="scollPane" prefHeight="1200.0" prefWidth="1200.0">
<content>
<AnchorPane fx:id="parentPane" minHeight="0.0" minWidth="0.0" prefHeight="1800.0" prefWidth="1200.0">
<children>
<BorderPane fx:id="borderPane" layoutX="-7.0" prefHeight="1800.0" prefWidth="1200.0" style="-fx-padding: 5;">
<padding>
<Insets bottom="18.0" left="18.0" right="18.0" top="18.0" />
</padding>
<top>
<TitledPane fx:id="topTitlePane" animated="false" blendMode="DARKEN" pickOnBounds="false" style="-fx-padding: 10;" text="校对条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="182.0" prefWidth="1162.0" style="-fx-padding: 5;">
<children>
<GridPane fx:id="gridPane" hgap="9.0" layoutX="17.0" maxWidth="1400.0" prefHeight="175.0" prefWidth="1098.0" style="-fx-padding: 7;" vgap="9.0">
<columnConstraints>
<ColumnConstraints hgrow="NEVER" maxWidth="104.0" minWidth="10.0" prefWidth="104.0" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="373.0" minWidth="10.0" prefWidth="283.0" />
<ColumnConstraints halignment="CENTER" hgrow="NEVER" maxWidth="361.0" minWidth="10.0" prefWidth="208.0" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="317.0" minWidth="0.0" prefWidth="122.0" />
<ColumnConstraints halignment="RIGHT" hgrow="NEVER" maxWidth="146.0" minWidth="0.0" prefWidth="0.0" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="322.0" minWidth="10.0" prefWidth="322.0" />
<ColumnConstraints hgrow="NEVER" maxWidth="5.0" minWidth="0.0" prefWidth="0.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="36.0" minHeight="10.0" prefHeight="36.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="23.0" minHeight="10.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="编号:" />
<Label text="检查次数:" GridPane.columnIndex="3" />
<Label text="校对表编号:" GridPane.rowIndex="2" />
<Label text="校对日期:" GridPane.rowIndex="1" />
<Label text="检查人:" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<ComboBox fx:id="cb_jccs" editable="true" maxWidth="1.7976931348623157E308" onAction="#selectJccs" GridPane.columnIndex="5" />
<TextField fx:id="tf_bh" prefHeight="30.0" prefWidth="288.0" GridPane.columnIndex="1" />
<ComboBox fx:id="cb_jclx" maxWidth="1.7976931348623157E308" prefWidth="150.0" GridPane.columnIndex="5" GridPane.rowIndex="3" />
<TextField fx:id="tf_jcr" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<Label text="图号清单:" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<ComboBox fx:id="cb_thqd" maxWidth="1.7976931348623157E308" GridPane.columnIndex="5" GridPane.rowIndex="2" />
<Label text="版本号:" GridPane.rowIndex="3" />
<Label text="检查类型:" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<TextField fx:id="jdrq" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="revId" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField fx:id="jdbbh" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="过滤不通过项:" GridPane.rowIndex="4" />
<CheckBox fx:id="glBtn" mnemonicParsing="false" onAction="#selectBtnGl" GridPane.columnIndex="1" GridPane.rowIndex="4" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
<center>
<TabPane fx:id="TestPane" prefHeight="263.0" prefWidth="1180.0" style="-fx-padding: 10;" tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" BorderPane.alignment="CENTER">
<tabs>
<Tab text="检查结果">
<content>
<TableView fx:id="table" prefHeight="292.0" prefWidth="1170.0" style="-fx-faint-focus-color: transparent; -fx-focus-color: rgba(0,0,0,0.2);" />
</content>
</Tab>
</tabs>
</TabPane>
</center>
<bottom>
<BorderPane prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 10;" BorderPane.alignment="CENTER">
<top>
<TitledPane fx:id="btoTitlePane" animated="false" prefHeight="260.0" prefWidth="1160.0" style="-fx-padding: 5;" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="457.0" prefWidth="1178.0">
<children>
<GridPane prefHeight="214.0" prefWidth="1178.0" style="-fx-padding: 15;">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1166.0" minWidth="10.0" prefWidth="1127.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="584.0" minWidth="10.0" prefWidth="51.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="校对人员发现的问题真实记录:" />
<Label text="审核人员发现的问题真实记录:" GridPane.rowIndex="2" />
<Label text="校对、审核发现的问题“是否”已逐条进行更改?如未更改则写明未更改理由。(审核人再审签字):" GridPane.rowIndex="4" />
<TextField fx:id="tx1" GridPane.rowIndex="1" />
<TextField fx:id="tx2" GridPane.rowIndex="3" />
<TextField fx:id="tx3" GridPane.rowIndex="5" />
</children>
</GridPane>
</children></AnchorPane>
</content>
</TitledPane>
</top>
<bottom>
<GridPane style="-fx-padding: 30;" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="bt_tj" mnemonicParsing="false" onAction="#tjBtnClick" text="提交" />
<Button fx:id="bt_sc" mnemonicParsing="false" text="输出" GridPane.columnIndex="1" />
<Button fx:id="bt_lsbc" mnemonicParsing="false" onAction="#lsbcBtnClick" text="临时保存" GridPane.columnIndex="2" />
<Button fx:id="bt_outbtg" mnemonicParsing="false" text="输出不通过项" GridPane.columnIndex="3" />
<Button mnemonicParsing="false" text="输出当前检查" GridPane.columnIndex="4" />
<Button fx:id="qxBtn" mnemonicParsing="false" onAction="#qxBtnClick" text="取消" GridPane.columnIndex="5" />
</children>
</GridPane>
</bottom>
</BorderPane>
</bottom>
</BorderPane>
</children>
</AnchorPane>
</content>
</ScrollPane>
</children>
</StackPane>

@ -0,0 +1,19 @@
#\u6570\u636E\u5E93\u9A71\u52A8
driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
#\u6570\u636E\u5E93\u8FDE\u63A5\u5730\u5740
url=jdbc:sqlserver://10.128.10.135:1433;DatabaseName=CHINT_DB
#\u7528\u6237\u540D
username=PLMUser
#\u5BC6\u7801
password=PLMUser
#\u8FDE\u63A5\u6C60\u7684\u6700\u5927\u6570\u636E\u5E93\u8FDE\u63A5\u6570\u3002\u8BBE\u4E3A0\u8868\u793A\u65E0\u9650\u5236
maxActive=30
#\u6700\u5927\u7A7A\u95F2\u6570\uFF0C\u6570\u636E\u5E93\u8FDE\u63A5\u7684\u6700\u5927\u7A7A\u95F2\u65F6\u95F4\u3002\u8D85\u8FC7\u7A7A\u95F2\u65F6\u95F4\uFF0C\u6570\u636E\u5E93\u8FDE
#\u63A5\u5C06\u88AB\u6807\u8BB0\u4E3A\u4E0D\u53EF\u7528\uFF0C\u7136\u540E\u88AB\u91CA\u653E\u3002\u8BBE\u4E3A0\u8868\u793A\u65E0\u9650\u5236
maxIdle=10
#\u6700\u5927\u5EFA\u7ACB\u8FDE\u63A5\u7B49\u5F85\u65F6\u95F4\u3002\u5982\u679C\u8D85\u8FC7\u6B64\u65F6\u95F4\u5C06\u63A5\u5230\u5F02\u5E38\u3002\u8BBE\u4E3A-1\u8868\u793A\u65E0\u9650\u5236
maxWait=1000
#\u8D85\u8FC7removeAbandonedTimeout\u65F6\u95F4\u540E\uFF0C\u662F\u5426\u8FDB \u884C\u6CA1\u7528\u8FDE\u63A5\uFF08\u5E9F\u5F03\uFF09\u7684\u56DE\u6536\uFF08\u9ED8\u8BA4\u4E3Afalse\uFF0C\u8C03\u6574\u4E3Atrue)
removeAbandoned=true
#\u8D85\u8FC7\u65F6\u95F4\u9650\u5236\uFF0C\u56DE\u6536\u6CA1\u6709\u7528(\u5E9F\u5F03)\u7684\u8FDE\u63A5\uFF08\u9ED8\u8BA4\u4E3A 300\u79D2\uFF0C\u8C03\u6574\u4E3A180\uFF09
removeAbandonedTimeout=180

@ -0,0 +1,41 @@
SQL.URL=jdbc:sqlserver://10.128.20.35:1433;DatabaseName=BDP2020
SQL.DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver
SQL.USER=PLMUser
SQL.PASSWORD=PLMUser
#\u4F4E\u538B\u8BDA\u521B
SQL.CC.URL=jdbc:sqlserver://10.128.10.135:1433;DatabaseName=CHINT_DB
SQL.CC.DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver
SQL.CC.USER=PLMUser
SQL.CC.PASSWORD=PLMUser
# Test
#SQL.SH.URL=jdbc:sqlserver://10.128.155.236:1433;DatabaseName=ISP.CADAssistant
#SQL.SH.DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver
#SQL.SH.USER=sa
#SQL.SH.PASSWORD=2wsx#EDC
#
SQL.SH.URL=jdbc:sqlserver://10.128.155.140:1433;DatabaseName=ISP.CADAssistant
SQL.SH.DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver
SQL.SH.USER=sa
SQL.SH.PASSWORD=2wsx#EDC
SQL.TC.URL=jdbc:oracle:thin:@10.128.10.207:1521:tcprod
SQL.TC.DRIVER=oracle.jdbc.driver.OracleDriver
SQL.TC.USER=infodba
SQL.TC.PASSWORD=infodba
#SQL.TCDATA.URL=jdbc:oracle:thin:@192.168.0.103:1521:TC
SQL.TCDATA.URL=jdbc:oracle:thin:@10.128.18.139:1521:testdb
SQL.TCDATA.DRIVER=oracle.jdbc.driver.OracleDriver
SQL.TCDATA.USER=infodba
SQL.TCDATA.PASSWORD=infodba
SQL.TEMPLATE_TREE=select t.PmpcCode, t.PmpcCompanyCode, t.PmpcName, t.PmpcUpperCode, t.PmpcItem, t.PmpcPrhCode, t.PmpcEnd,t.PmpcCanzz,t.PmpcPType,t.PmpcMType from CcemVW_Pmpc t;
SQL.TEMPLATE=select t.PrhName,t.PrdLine,t.PrdNo,t.PrdFeatureCode,t.FeatureName,t.PrdCanInput,t.PrdSign from CcemVW_Prd t where t.prhcode = ? order by t.PrdNo
SQL.LOV=select t.PrddNo,t.PrddFeatureCode,t.PrddValue from CcemVW_Prdd t where t.PrddCode = ? and PrddLine = ? order by t.PrddNo
SQL.FEATURE=select t.FeatureCode,t.FeatureName from CcemVW_Feature t
SQL.GROUP=select t.ProductGroupCode,t.ProductGroupName from CcemVW_ProductGroup t

@ -0,0 +1,191 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<AnchorPane fx:id="coverPane" prefHeight="842.0" prefWidth="1326.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.CreateOuotation.MyController">
<children>
<GridPane fx:id="gridPane" layoutX="14.0" layoutY="108.0" prefHeight="189.0" prefWidth="1302.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;" AnchorPane.leftAnchor="9.0" AnchorPane.rightAnchor="10.0">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label fx:id="projectNameLabel" prefHeight="20.0" prefWidth="83.0" text="项目名称:" />
<TextField fx:id="projectNameTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" />
<Label fx:id="transformerModelLabel" prefHeight="20.0" prefWidth="83.0" text="变压器型号:" GridPane.rowIndex="1" />
<TextField fx:id="transformerModelTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="noLoadLossLabel" prefHeight="20.0" prefWidth="83.0" text="空载损耗:" GridPane.rowIndex="2" />
<TextField fx:id="noLoadLossTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label fx:id="loadLossLabel" prefHeight="20.0" prefWidth="120.0" text="负载损耗(KW):" GridPane.rowIndex="3" />
<TextField fx:id="loadLossTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label fx:id="biddingNumberLabel" prefHeight="20.0" prefWidth="83.0" text="投标编号:" GridPane.columnIndex="2" />
<Label fx:id="capacityRatioLabel" prefHeight="20.0" prefWidth="120.0" text="容量比(MVA):" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label fx:id="impedanceVoltageLabel" prefHeight="20.0" prefWidth="83.0" text="阻抗电压:" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="biddingNumberTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" />
<TextField fx:id="capacityRatioTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="impedanceVoltageTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label fx:id="projectManagerLabel" prefHeight="20.0" prefWidth="83.0" text="项目经理:" GridPane.columnIndex="4" />
<Label fx:id="voltageRatioLabel" prefHeight="20.0" prefWidth="83.0" text="电压比(kV):" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label fx:id="transportationWeightLabel" prefHeight="20.0" prefWidth="83.0" text="运输重(t):" GridPane.columnIndex="4" GridPane.rowIndex="2" />
<TextField fx:id="projectManagerTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" />
<TextField fx:id="voltageRatioTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<TextField fx:id="transportationWeightTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" GridPane.rowIndex="2" />
<Label fx:id="quantityLabel" prefHeight="20.0" prefWidth="83.0" text="数量:" GridPane.columnIndex="6" />
<TextField fx:id="quantityTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="7" />
<Label fx:id="totalWeightLabel" prefHeight="20.0" prefWidth="83.0" text="总重(t):" GridPane.columnIndex="6" GridPane.rowIndex="2" />
<TextField fx:id="totalWeightTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="7" GridPane.rowIndex="2" />
</children>
<padding>
<Insets right="15.0" />
</padding>
</GridPane>
<FlowPane fx:id="buttonPane" alignment="CENTER_RIGHT" hgap="40.0" layoutX="618.0" layoutY="766.0" prefHeight="60.0" prefWidth="698.0" AnchorPane.bottomAnchor="1.0" AnchorPane.rightAnchor="10.0">
<children>
<Button fx:id="saveButton" mnemonicParsing="false" prefWidth="100.0" text="保存" />
<Button fx:id="calculateButton" mnemonicParsing="false" prefWidth="100.0" text="计算金额" />
<Button fx:id="selectComparisonButton" mnemonicParsing="false" prefWidth="100.0" text="选择对比" />
<Button fx:id="compareButton" mnemonicParsing="false" prefWidth="100.0" text="对比" />
</children>
<padding>
<Insets right="30.0" />
</padding>
</FlowPane>
<BorderPane fx:id="tablePane" layoutX="14.0" layoutY="365.0" prefHeight="379.0" prefWidth="1302.0" AnchorPane.bottomAnchor="80.0" AnchorPane.leftAnchor="9.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="350.0">
<center>
<TableView fx:id="materialsTable" prefHeight="320.0" prefWidth="1302.0" BorderPane.alignment="CENTER">
<columns>
<TableColumn fx:id="no" prefWidth="54.0" />
<TableColumn fx:id="materialNameColumn" prefWidth="78.0" text="材料名称" />
<TableColumn fx:id="relatedMaterialColumn" prefWidth="76.0" text="材料名称" />
<TableColumn fx:id="specificationColumn" prefWidth="223.0" text="规格" />
<TableColumn fx:id="manufacturerColumn" minWidth="0.0" prefWidth="215.0" text="制造厂商" />
<TableColumn fx:id="quantityColumn" prefWidth="81.0" text="数量(净重)" />
<TableColumn fx:id="utilizationRateColumn" prefWidth="71.0" text="利用率" />
<TableColumn fx:id="unitColumn" prefWidth="60.0" text="单位" />
<TableColumn fx:id="unitPriceColumn" prefWidth="89.0" text="单价(元)" />
<TableColumn fx:id="amountColumn" prefWidth="85.0" text="金额(元)" />
<TableColumn fx:id="comparedQuantityColumn" prefWidth="74.0" text="对比数量" />
<TableColumn fx:id="comparedUnitPriceColumn" prefWidth="75.0" text="对比单价" />
<TableColumn fx:id="comparedResultColumn" prefWidth="114.0" text="对比结果(元)" />
</columns>
</TableView>
</center>
<bottom>
<BorderPane fx:id="bordPane" prefHeight="60.0" prefWidth="314.0" BorderPane.alignment="CENTER">
<center>
<FlowPane alignment="CENTER_RIGHT" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<children>
<FlowPane alignment="CENTER" prefHeight="43.0" prefWidth="447.0">
<children>
<Label alignment="CENTER" contentDisplay="CENTER" nodeOrientation="LEFT_TO_RIGHT" text="颜色备注:">
<FlowPane.margin>
<Insets top="10.0" />
</FlowPane.margin>
</Label>
<TextField editable="false" prefHeight="20.0" prefWidth="37.0" style="-fx-background-color: #FF6600;">
<FlowPane.margin>
<Insets top="10.0" />
</FlowPane.margin>
</TextField>
<Label text=":代表亏损 ">
<FlowPane.margin>
<Insets top="10.0" />
</FlowPane.margin>
</Label>
<TextField editable="false" prefHeight="20.0" prefWidth="37.0" style="-fx-background-color: #A9D08E;">
<FlowPane.margin>
<Insets top="10.0" />
</FlowPane.margin>
</TextField>
<Label text=":代表盈利 ">
<FlowPane.margin>
<Insets top="10.0" />
</FlowPane.margin>
</Label>
</children>
</FlowPane>
<Label prefWidth="86.0" text=" 总价:" />
<TextField fx:id="totalPriceTextField" prefHeight="30.0" prefWidth="131.0" />
</children>
</FlowPane>
</center>
<bottom>
<FlowPane alignment="CENTER_RIGHT" prefHeight="50.0" prefWidth="1237.0" BorderPane.alignment="CENTER">
<children>
<Label text="总价对比结果:" />
<TextField fx:id="totalPriceCompareTextField" prefHeight="30.0" prefWidth="131.0" />
</children>
</FlowPane>
</bottom>
<padding>
<Insets top="2.0" />
</padding>
</BorderPane>
</bottom>
</BorderPane>
<FlowPane alignment="TOP_RIGHT" hgap="40.0" layoutX="160.0" layoutY="26.0" prefHeight="48.0" prefWidth="1151.0" AnchorPane.rightAnchor="10.0">
<children>
<Label fx:id="costSheetTypeLabel" prefHeight="20.0" prefWidth="83.0" text="成本单类型:" />
<ComboBox fx:id="costSheetTypeComboBox" prefHeight="30.0" prefWidth="216.0" />
<Label fx:id="editionLabel" prefHeight="20.0" prefWidth="52.0" text="版次:" />
<ComboBox fx:id="editionComboBox" prefWidth="100.0" />
<Label fx:id="comparedCostSheetLabel" prefHeight="20.0" prefWidth="113.0" text="要对比的成本单:" />
<TextField fx:id="comparedCostSheetTextField" prefHeight="30.0" prefWidth="200.0" />
</children>
</FlowPane>
<GridPane fx:id="centerPane" layoutX="14.0" layoutY="304.0" prefHeight="48.0" prefWidth="1297.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;" AnchorPane.leftAnchor="9.0" AnchorPane.rightAnchor="10.0">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label fx:id="copperAmountLabel" prefHeight="20.0" prefWidth="83.0" text="用铜量(kg):" />
<TextField fx:id="copperAmountTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" />
<Label fx:id="copperMarketPriceLabel" prefHeight="20.0" prefWidth="139.0" text="铜价市场价(元/kg):" GridPane.columnIndex="2" />
<TextField fx:id="copperMarketPriceTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" />
<Label fx:id="voltageLevelLabel" prefHeight="20.0" prefWidth="74.0" text="电压等级:" GridPane.columnIndex="4" />
<TextField fx:id="voltageLevelTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" />
</children>
<padding>
<Insets right="15.0" />
</padding>
</GridPane>
<TextArea fx:id="changeReason" layoutX="106.0" layoutY="794.0" prefHeight="106.0" prefWidth="450.0" AnchorPane.bottomAnchor="1.0" />
<Label layoutX="37.0" layoutY="796.0" text="更改原因:" AnchorPane.bottomAnchor="90.0" />
</children>
<padding>
<Insets bottom="30.0" left="5.0" right="5.0" top="10.0" />
</padding>
</AnchorPane>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<AnchorPane fx:id="coverPane" prefHeight="814.0" prefWidth="1329.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.CreateOuotation.MyController">
<children>
<Label fx:id="costSheetTypeLabel" layoutX="461.0" layoutY="50.0" prefHeight="20.0" prefWidth="83.0" text="成本单类型:" />
<ComboBox fx:id="costSheetTypeComboBox" layoutX="560.0" layoutY="45.0" prefWidth="160.0" />
<Label fx:id="editionLabel" layoutX="762.0" layoutY="50.0" prefHeight="20.0" prefWidth="52.0" text="版次:" />
<ComboBox fx:id="editionComboBox" layoutX="822.0" layoutY="45.0" prefWidth="100.0" />
<Label fx:id="comparedCostSheetLabel" layoutX="957.0" layoutY="50.0" prefHeight="20.0" prefWidth="113.0" text="要对比的成本单:" />
<TextField fx:id="comparedCostSheetTextField" layoutX="1093.0" layoutY="45.0" prefHeight="30.0" prefWidth="200.0" />
<Pane fx:id="centerPane" layoutX="14.0" layoutY="299.0" prefHeight="48.0" prefWidth="1302.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;">
<children>
<Label fx:id="copperAmountLabel" layoutX="25.0" layoutY="14.0" prefHeight="20.0" prefWidth="83.0" text="用铜量(kg):" />
<TextField fx:id="copperAmountTextField" layoutX="131.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="copperMarketPriceLabel" layoutX="375.0" layoutY="14.0" prefHeight="20.0" prefWidth="139.0" text="铜价市场价(元/kg):" />
<TextField fx:id="copperMarketPriceTextField" layoutX="533.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="voltageLevelLabel" layoutX="766.0" layoutY="14.0" prefHeight="20.0" prefWidth="74.0" text="电压等级:" />
<TextField fx:id="voltageLevelTextField" layoutX="854.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
</children>
</Pane>
<Pane fx:id="tablePane" layoutX="14.0" layoutY="365.0" prefHeight="380.0" prefWidth="1302.0">
<children>
<TableView fx:id="materialsTable" prefHeight="309.0" prefWidth="1302.0">
<columns>
<TableColumn fx:id="no" prefWidth="75.0" />
<TableColumn fx:id="materialNameColumn" prefWidth="126.0" text="材料名称" />
<TableColumn fx:id="relatedMaterialColumn" prefWidth="122.0" text="材料名称" />
<TableColumn fx:id="specificationColumn" prefWidth="250.0" text="规格" />
<TableColumn fx:id="manufacturerColumn" minWidth="0.0" prefWidth="203.0" text="制造厂商" />
<TableColumn fx:id="quantityColumn" prefWidth="91.0" text="数量(净重)" />
<TableColumn fx:id="utilizationRateColumn" prefWidth="69.0" text="利用率" />
<TableColumn fx:id="unitColumn" prefWidth="70.0" text="单位" />
<TableColumn fx:id="unitPriceColumn" prefWidth="86.0" text="单价(元)" />
<TableColumn fx:id="amountColumn" prefWidth="94.0" text="金额(元)" />
<TableColumn fx:id="comparedResultColumn" prefWidth="115.0" text="对比结果(元)" />
</columns>
</TableView>
<BorderPane fx:id="bordPane" layoutX="974.0" layoutY="309.0" prefHeight="60.0" prefWidth="314.0">
<center>
<FlowPane alignment="CENTER_RIGHT" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<children>
<Label prefWidth="86.0" text=" 总价:" />
<TextField fx:id="totalPriceTextField" prefHeight="30.0" prefWidth="131.0" />
</children>
</FlowPane>
</center>
<bottom>
<FlowPane alignment="CENTER_RIGHT" prefHeight="50.0" prefWidth="314.0" BorderPane.alignment="CENTER">
<children>
<Label text="总价对比结果:" />
<TextField fx:id="totalPriceCompareTextField" prefHeight="30.0" prefWidth="131.0" />
</children>
</FlowPane>
</bottom>
<padding>
<Insets top="2.0" />
</padding>
</BorderPane>
</children>
</Pane>
<Button fx:id="saveButton" layoutX="750.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="保存" />
<Button fx:id="calculateButton" layoutX="900.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="计算金额" />
<Button fx:id="selectComparisonButton" layoutX="1050.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="选择对比" />
<Button fx:id="compareButton" layoutX="1200.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="对比" />
<GridPane fx:id="gridPane" layoutX="14.0" layoutY="108.0" prefHeight="189.0" prefWidth="1302.0">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label fx:id="projectNameLabel" prefHeight="20.0" prefWidth="83.0" text="项目名称:" />
<TextField fx:id="projectNameTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" />
<Label fx:id="transformerModelLabel" prefHeight="20.0" prefWidth="83.0" text="变压器型号:" GridPane.rowIndex="1" />
<TextField fx:id="transformerModelTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="noLoadLossLabel" prefHeight="20.0" prefWidth="83.0" text="空载损耗:" GridPane.rowIndex="2" />
<TextField fx:id="noLoadLossTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label fx:id="loadLossLabel" prefHeight="20.0" prefWidth="120.0" text="负载损耗(KW):" GridPane.rowIndex="3" />
<TextField fx:id="loadLossTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label fx:id="biddingNumberLabel" prefHeight="20.0" prefWidth="83.0" text="投标编号:" GridPane.columnIndex="2" />
<Label fx:id="capacityRatioLabel" prefHeight="20.0" prefWidth="120.0" text="容量比(MVA):" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label fx:id="impedanceVoltageLabel" prefHeight="20.0" prefWidth="83.0" text="阻抗电压:" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="biddingNumberTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" />
<TextField fx:id="capacityRatioTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="impedanceVoltageTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label fx:id="projectManagerLabel" prefHeight="20.0" prefWidth="83.0" text="项目经理:" GridPane.columnIndex="4" />
<Label fx:id="voltageRatioLabel" prefHeight="20.0" prefWidth="83.0" text="电压比(kV):" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label fx:id="transportationWeightLabel" prefHeight="20.0" prefWidth="83.0" text="运输重(t):" GridPane.columnIndex="4" GridPane.rowIndex="2" />
<TextField fx:id="projectManagerTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" />
<TextField fx:id="voltageRatioTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<TextField fx:id="transportationWeightTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" GridPane.rowIndex="2" />
<Label fx:id="quantityLabel" prefHeight="20.0" prefWidth="83.0" text="数量:" GridPane.columnIndex="6" />
<TextField fx:id="quantityTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="7" />
<Label fx:id="totalWeightLabel" prefHeight="20.0" prefWidth="83.0" text="总重(t):" GridPane.columnIndex="6" GridPane.rowIndex="2" />
<TextField fx:id="totalWeightTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="7" GridPane.rowIndex="2" />
</children>
</GridPane>
</children>
</AnchorPane>

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<AnchorPane fx:id="coverPane" prefHeight="814.0" prefWidth="1329.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.CreateOuotation.MyController">
<children>
<Pane fx:id="topPane" layoutX="14.0" layoutY="91.0" prefHeight="189.0" prefWidth="1302.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;">
<children>
<Label fx:id="projectNameLabel" layoutX="23.0" layoutY="16.0" prefHeight="20.0" prefWidth="83.0" text="项目名称:" />
<Label fx:id="transformerModelLabel" layoutX="23.0" layoutY="60.0" prefHeight="20.0" prefWidth="83.0" text="变压器型号:" />
<Label fx:id="noLoadLossLabel" layoutX="23.0" layoutY="105.0" prefHeight="20.0" prefWidth="83.0" text="空载损耗:" />
<Label fx:id="loadLossLabel" layoutX="23.0" layoutY="148.0" prefHeight="20.0" prefWidth="120.0" text="负载损耗(KW):" />
<TextField fx:id="projectNameTextField" layoutX="129.0" layoutY="11.0" prefHeight="20.0" prefWidth="166.0" />
<TextField fx:id="transformerModelTextField" layoutX="129.0" layoutY="55.0" prefHeight="20.0" prefWidth="166.0" />
<TextField fx:id="noLoadLossTextField" layoutX="129.0" layoutY="100.0" prefHeight="20.0" prefWidth="166.0" />
<TextField fx:id="loadLossTextField" layoutX="129.0" layoutY="143.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="biddingNumberLabel" layoutX="355.0" layoutY="16.0" prefHeight="20.0" prefWidth="83.0" text="投标编号:" />
<TextField fx:id="biddingNumberTextField" layoutX="473.0" layoutY="11.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="capacityRatioLabel" layoutX="355.0" layoutY="60.0" prefHeight="20.0" prefWidth="120.0" text="容量比(MVA):" />
<TextField fx:id="capacityRatioTextField" layoutX="473.0" layoutY="55.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="impedanceVoltageLabel" layoutX="355.0" layoutY="105.0" prefHeight="20.0" prefWidth="83.0" text="阻抗电压:" />
<Label fx:id="projectManagerLabel" layoutX="705.0" layoutY="16.0" prefHeight="20.0" prefWidth="83.0" text="项目经理:" />
<TextField fx:id="impedanceVoltageTextField" layoutX="473.0" layoutY="100.0" prefHeight="20.0" prefWidth="166.0" />
<TextField fx:id="projectManagerTextField" layoutX="825.0" layoutY="11.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="voltageRatioLabel" layoutX="705.0" layoutY="60.0" prefHeight="20.0" prefWidth="83.0" text="电压比(kV):" />
<Label fx:id="transportationWeightLabel" layoutX="705.0" layoutY="105.0" prefHeight="20.0" prefWidth="83.0" text="运输重(t):" />
<TextField fx:id="voltageRatioTextField" layoutX="825.0" layoutY="55.0" prefHeight="20.0" prefWidth="166.0" />
<TextField fx:id="transportationWeightTextField" layoutX="825.0" layoutY="100.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="quantityLabel" layoutX="1044.0" layoutY="15.0" prefHeight="20.0" prefWidth="83.0" text="数量:" />
<Label fx:id="totalWeightLabel" layoutX="1044.0" layoutY="105.0" prefHeight="20.0" prefWidth="83.0" text="总重(t):" />
<TextField fx:id="quantityTextField" layoutX="1113.0" layoutY="11.0" prefHeight="20.0" prefWidth="166.0" />
<TextField fx:id="totalWeightTextField" layoutX="1113.0" layoutY="100.0" prefHeight="20.0" prefWidth="166.0" />
</children>
</Pane>
<Label fx:id="costSheetTypeLabel" layoutX="461.0" layoutY="50.0" prefHeight="20.0" prefWidth="83.0" text="成本单类型:" />
<ComboBox fx:id="costSheetTypeComboBox" layoutX="560.0" layoutY="45.0" prefWidth="160.0" />
<Label fx:id="editionLabel" layoutX="762.0" layoutY="50.0" prefHeight="20.0" prefWidth="52.0" text="版次:" />
<ComboBox fx:id="editionComboBox" layoutX="822.0" layoutY="45.0" prefWidth="100.0" />
<Label fx:id="comparedCostSheetLabel" layoutX="957.0" layoutY="50.0" prefHeight="20.0" prefWidth="113.0" text="要对比的成本单:" />
<TextField fx:id="comparedCostSheetTextField" layoutX="1093.0" layoutY="45.0" prefHeight="30.0" prefWidth="200.0" />
<Pane fx:id="centerPane" layoutX="14.0" layoutY="299.0" prefHeight="48.0" prefWidth="1302.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;">
<children>
<Label fx:id="copperAmountLabel" layoutX="25.0" layoutY="14.0" prefHeight="20.0" prefWidth="83.0" text="用铜量(kg):" />
<TextField fx:id="copperAmountTextField" layoutX="131.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="copperMarketPriceLabel" layoutX="375.0" layoutY="14.0" prefHeight="20.0" prefWidth="139.0" text="铜价市场价(元/kg):" />
<TextField fx:id="copperMarketPriceTextField" layoutX="533.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
<Label fx:id="voltageLevelLabel" layoutX="766.0" layoutY="14.0" prefHeight="20.0" prefWidth="74.0" text="电压等级:" />
<TextField fx:id="voltageLevelTextField" layoutX="854.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
</children>
</Pane>
<Pane fx:id="tablePane" layoutX="14.0" layoutY="365.0" prefHeight="380.0" prefWidth="1302.0">
<children>
<TableView fx:id="materialsTable" prefHeight="309.0" prefWidth="1302.0">
<columns>
<TableColumn fx:id="no" prefWidth="75.0" />
<TableColumn fx:id="materialNameColumn" prefWidth="126.0" text="材料名称" />
<TableColumn fx:id="relatedMaterialColumn" prefWidth="122.0" text="材料名称" />
<TableColumn fx:id="specificationColumn" prefWidth="250.0" text="规格" />
<TableColumn fx:id="manufacturerColumn" minWidth="0.0" prefWidth="203.0" text="制造厂商" />
<TableColumn fx:id="quantityColumn" prefWidth="91.0" text="数量(净重)" />
<TableColumn fx:id="utilizationRateColumn" prefWidth="69.0" text="利用率" />
<TableColumn fx:id="unitColumn" prefWidth="70.0" text="单位" />
<TableColumn fx:id="unitPriceColumn" prefWidth="86.0" text="单价(元)" />
<TableColumn fx:id="amountColumn" prefWidth="94.0" text="金额(元)" />
<TableColumn fx:id="comparedResultColumn" prefWidth="115.0" text="对比结果(元)" />
</columns>
</TableView>
<TextField fx:id="totalPriceTextField" layoutX="1171.0" layoutY="308.0" prefHeight="30.0" prefWidth="131.0" />
<Label layoutX="1085.0" layoutY="313.0" prefWidth="86.0" text=" 总价:" />
<Label layoutX="1050.0" layoutY="346.0" text="总价对比结果:" />
<TextField fx:id="totalPriceCompareTextField" layoutX="1171.0" layoutY="341.0" prefHeight="30.0" prefWidth="131.0" />
</children>
</Pane>
<Button fx:id="saveButton" layoutX="750.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="保存" />
<Button fx:id="calculateButton" layoutX="900.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="计算金额" />
<Button fx:id="selectComparisonButton" layoutX="1050.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="选择对比" />
<Button fx:id="compareButton" layoutX="1200.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="对比" />
</children>
</AnchorPane>

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<Pane fx:id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="840.0" prefWidth="1270.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.GZXQ.GZXQController">
<children>
<BorderPane fx:id="bpane" layoutX="5.0" layoutY="14.0" prefHeight="840.0" prefWidth="1261.0">
<top>
<TitledPane fx:id="titlePaneCondition" animated="false" prefHeight="182.0" prefWidth="1034.0" text="条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="151.0" prefWidth="964.0">
<children>
<GridPane fx:id="gridPaneCondition" layoutX="13.0" layoutY="11.0" prefHeight="114.0" prefWidth="1218.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="109.0" minWidth="10.0" prefWidth="86.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="216.0" minWidth="10.0" prefWidth="164.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="112.0" minWidth="10.0" prefWidth="93.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="233.0" minWidth="10.0" prefWidth="185.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="103.0" minWidth="10.0" prefWidth="95.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="246.0" minWidth="10.0" prefWidth="191.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="189.0" minWidth="10.0" prefWidth="97.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="212.0" minWidth="10.0" prefWidth="212.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField fx:id="jTextField1" GridPane.columnIndex="1" />
<TextField fx:id="jTextField2" prefHeight="30.0" prefWidth="189.0" GridPane.columnIndex="3" />
<TextField fx:id="jTextField5" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="jTextField6" prefHeight="30.0" prefWidth="152.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="jTextField7" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<TextField fx:id="jTextField3" GridPane.columnIndex="5" />
<TextField fx:id="jTextField8" GridPane.columnIndex="7" GridPane.rowIndex="1" />
<TextField fx:id="jTextField4" prefHeight="30.0" prefWidth="168.0" GridPane.columnIndex="7" />
<TextField fx:id="jTextField9" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="jTextField10" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label text="流程实例ID" GridPane.halignment="CENTER" />
<Label text="工装名称" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="产品名称" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="工艺负责人" GridPane.columnIndex="2" GridPane.halignment="CENTER" />
<Label text="委托理由" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="工装等级" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="产品型号" GridPane.columnIndex="4" GridPane.halignment="CENTER" />
<Label text="计划时间" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label GridPane.columnIndex="4" GridPane.rowIndex="2" />
<Label text="工装编号" GridPane.columnIndex="6" GridPane.halignment="CENTER" />
<Label text="申请人" GridPane.columnIndex="6" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Button fx:id="jButton2" mnemonicParsing="false" onAction="#cxAction" prefHeight="30.0" prefWidth="98.0" text="查 询" GridPane.columnIndex="7" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="BOTTOM">
<GridPane.margin>
<Insets />
</GridPane.margin>
</Button>
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
<center>
<TitledPane fx:id="titlePaneResult" animated="false" prefHeight="620.0" prefWidth="966.0" text="结果" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="570.0" prefWidth="964.0">
<children>
<BorderPane fx:id="tablePane" layoutX="8.0" layoutY="6.0" prefHeight="573.0" prefWidth="1245.0">
<top>
<TableView fx:id="tableView" prefHeight="544.0" prefWidth="1195.0" BorderPane.alignment="CENTER" />
</top>
<bottom>
<GridPane fx:id="gridPaneResult" prefHeight="29.0" prefWidth="948.0" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="sy" mnemonicParsing="false" onAction="#firstBtnAction" text="首页" GridPane.columnIndex="2" />
<Button fx:id="syy" mnemonicParsing="false" onAction="#lastBtnAction" text="上一页" GridPane.columnIndex="3" />
<Button mnemonicParsing="false" onAction="#nextBtnAction" text="下一页" GridPane.columnIndex="4" fx:id="xyy" />
<Button fx:id="wy" mnemonicParsing="false" onAction="#tailBtnAction" text="尾页" GridPane.columnIndex="5" />
</children>
</GridPane>
</bottom>
</BorderPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</center>
</BorderPane>
</children>
</Pane>

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<Pane fx:id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="840.0" prefWidth="1270.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.GZXQ.GZXQController">
<children>
<BorderPane fx:id="bpane" layoutX="5.0" layoutY="14.0" prefHeight="840.0" prefWidth="1261.0">
<top>
<TitledPane fx:id="titlePaneCondition" animated="false" prefHeight="182.0" prefWidth="1034.0" text="条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="151.0" prefWidth="964.0">
<children>
<GridPane fx:id="gridPaneCondition" layoutX="13.0" layoutY="11.0" prefHeight="114.0" prefWidth="1218.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="109.0" minWidth="10.0" prefWidth="86.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="216.0" minWidth="10.0" prefWidth="164.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="112.0" minWidth="10.0" prefWidth="93.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="233.0" minWidth="10.0" prefWidth="185.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="103.0" minWidth="10.0" prefWidth="95.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="246.0" minWidth="10.0" prefWidth="191.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="189.0" minWidth="10.0" prefWidth="97.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="212.0" minWidth="10.0" prefWidth="212.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField fx:id="jTextField1" GridPane.columnIndex="1" />
<TextField fx:id="jTextField2" prefHeight="30.0" prefWidth="189.0" GridPane.columnIndex="3" />
<TextField fx:id="jTextField5" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="jTextField6" prefHeight="30.0" prefWidth="152.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="jTextField3" GridPane.columnIndex="5" />
<TextField fx:id="jTextField8" GridPane.columnIndex="7" GridPane.rowIndex="1" />
<TextField fx:id="jTextField4" prefHeight="30.0" prefWidth="168.0" GridPane.columnIndex="7" />
<TextField fx:id="jTextField9" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="jTextField10" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label text="流程实例ID" GridPane.halignment="CENTER" />
<Label text="工装名称" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="产品名称" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="工艺负责人" GridPane.columnIndex="2" GridPane.halignment="CENTER" />
<Label text="委托理由" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="工装等级" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="产品型号" GridPane.columnIndex="4" GridPane.halignment="CENTER" />
<Label text="计划时间" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label GridPane.columnIndex="4" GridPane.rowIndex="2" />
<Label text="工装编号" GridPane.columnIndex="6" GridPane.halignment="CENTER" />
<Label text="申请人" GridPane.columnIndex="6" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Button fx:id="jButton2" mnemonicParsing="false" onAction="#cxAction" prefHeight="30.0" prefWidth="98.0" text="查 询" GridPane.columnIndex="7" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="BOTTOM">
<GridPane.margin>
<Insets />
</GridPane.margin>
</Button>
<DatePicker GridPane.columnIndex="5" GridPane.rowIndex="1" />
<DatePicker fx:id="jTextField7" GridPane.columnIndex="5" GridPane.rowIndex="1" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
<center>
<TitledPane fx:id="titlePaneResult" animated="false" prefHeight="620.0" prefWidth="966.0" text="结果" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="570.0" prefWidth="964.0">
<children>
<BorderPane fx:id="tablePane" layoutX="8.0" layoutY="6.0" prefHeight="573.0" prefWidth="1245.0">
<top>
<TableView fx:id="tableView" prefHeight="544.0" prefWidth="1195.0" BorderPane.alignment="CENTER" />
</top>
<bottom>
<GridPane fx:id="gridPaneResult" prefHeight="29.0" prefWidth="948.0" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="sy" mnemonicParsing="false" onAction="#firstBtnAction" text="首页" GridPane.columnIndex="2" />
<Button fx:id="syy" mnemonicParsing="false" onAction="#lastBtnAction" text="上一页" GridPane.columnIndex="3" />
<Button mnemonicParsing="false" onAction="#nextBtnAction" text="下一页" GridPane.columnIndex="4" fx:id="xyy" />
<Button fx:id="wy" mnemonicParsing="false" onAction="#tailBtnAction" text="尾页" GridPane.columnIndex="5" />
</children>
</GridPane>
</bottom>
</BorderPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</center>
</BorderPane>
</children>
</Pane>

@ -0,0 +1,24 @@
preferr=\u9996\u9009\u9879\u914D\u7F6E\u4E0D\u6B63\u786E
err=\u9519\u8BEF\uFF1A
#ProcessCheckDialog
title=\u5DE5\u827A\u8DEF\u7EBF\u9F50\u5957\u6027\u68C0\u67E5
cols=\u5E8F\u53F7;\u7269\u6599\u7F16\u7801;\u7269\u6599\u540D\u79F0;\u662F\u5426\u5173\u8054\u5DE5\u827A\u8DEF\u7EBF
xmzx=\u9879\u76EE\u6267\u884C
zztz=13-\u603B\u88C5\u56FE\u7EB8
msg1=\u8BF7\u9009\u62E9\u9879\u76EE\u5BF9\u8C61
msg2=\u672A\u627E\u5230\u603B\u88C5\u56FE\u7EB8
yes=\u662F
no=\u5426
#AssProcessAutoFeedingCommand
cpxh=\u4EA7\u54C1\u578B\u53F7
info1=\u8BF7\u767B\u5F55\u6B63\u786E\u7EC4
info2=\u8BF7\u9009\u62E9BOM\u884C\u6216\u8005\u7248\u672C\u5BF9\u8C61
info3=\u8BF7\u9009\u62E9PBOM\u5BF9\u8C61
info4=\u672A\u627E\u5230\u4EA7\u6210\u54C1\u6587\u4EF6\u5939\uFF0C\u8BF7\u68C0\u67E5
info5=\u5B58\u5728\u9876\u5C42P\u7269\u6599\u6CA1\u6709\u5173\u8054\u56FE\u7EB8\uFF0C\u8BF7\u68C0\u67E5
info6=\u5F53\u524D\u4EA7\u54C1\u578B\u53F7\u672A\u7EF4\u62A4\uFF0C\u8BF7\u9009\u62E9\u5BF9\u5E94\u4EA7\u54C1\u65CF
info7=\u6B63\u5728\u8FDB\u884C\u4E00\u952E\u6307\u6D3E\u5DE5\u827A\u8DEF\u7EBF......
info8=\u6307\u6D3E\u5DE5\u827A\u8DEF\u7EBF\u5B58\u5728\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\uFF1A\n
info9=\u6B63\u5728\u8FDB\u884C\u81EA\u52A8\u6295\u6599......
info10=\u81EA\u52A8\u6295\u6599\u5B58\u5728\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\uFF1A\n
info11=\u6307\u6D3E\u5DE5\u827A\u8DEF\u7EBF\u4E0E\u81EA\u52A8\u6295\u6599\u5B8C\u6210

@ -0,0 +1,24 @@
preferr=\u9996\u9009\u9879\u914D\u7F6E\u4E0D\u6B63\u786E
#ProcessCheckDialog
err=\u9519\u8BEF\uFF1A
title=\u5DE5\u827A\u8DEF\u7EBF\u9F50\u5957\u6027\u68C0\u67E5
cols=\u5E8F\u53F7;\u7269\u6599\u7F16\u7801;\u7269\u6599\u540D\u79F0;\u662F\u5426\u5173\u8054\u5DE5\u827A\u8DEF\u7EBF
xmzx=\u9879\u76EE\u6267\u884C
zztz=13-\u603B\u88C5\u56FE\u7EB8
msg1=\u8BF7\u9009\u62E9\u9879\u76EE\u5BF9\u8C61
msg2=\u672A\u627E\u5230\u603B\u88C5\u56FE\u7EB8
yes=\u662F
no=\u5426
#AssProcessAutoFeedingCommand
cpxh=\u4EA7\u54C1\u578B\u53F7
info1=\u8BF7\u767B\u5F55\u6B63\u786E\u7EC4
info2=\u8BF7\u9009\u62E9BOM\u884C\u6216\u8005\u7248\u672C\u5BF9\u8C61
info3=\u8BF7\u9009\u62E9PBOM\u5BF9\u8C61
info4=\u672A\u627E\u5230\u4EA7\u6210\u54C1\u6587\u4EF6\u5939\uFF0C\u8BF7\u68C0\u67E5
info5=\u5B58\u5728\u9876\u5C42P\u7269\u6599\u6CA1\u6709\u5173\u8054\u56FE\u7EB8\uFF0C\u8BF7\u68C0\u67E5
info6=\u5F53\u524D\u4EA7\u54C1\u578B\u53F7\u672A\u7EF4\u62A4\uFF0C\u8BF7\u9009\u62E9\u5BF9\u5E94\u4EA7\u54C1\u65CF
info7=\u6B63\u5728\u8FDB\u884C\u4E00\u952E\u6307\u6D3E\u5DE5\u827A\u8DEF\u7EBF......
info8=\u6307\u6D3E\u5DE5\u827A\u8DEF\u7EBF\u5B58\u5728\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\uFF1A\n
info9=\u6B63\u5728\u8FDB\u884C\u81EA\u52A8\u6295\u6599......
info10=\u81EA\u52A8\u6295\u6599\u5B58\u5728\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\uFF1A\n
info11=\u6307\u6D3E\u5DE5\u827A\u8DEF\u7EBF\u4E0E\u81EA\u52A8\u6295\u6599\u5B8C\u6210

@ -4,8 +4,12 @@
<extension point="org.eclipse.ui.commands">
<!--工具条-->
<!-- <command name="创建RDM研发项目" id="com.connor.plm.rdmCreate.RdmCreateHandler"/>-->
<command name="SRM图纸下发查询" id="com.chint.plm.SearchSapResult9.PlclIDHandler"/>
<command name="SRM图纸下发" id="com.connor.plm.srm.SRMHandler"/>
<command name="更新图纸自制外购" id="com.connor.plm.txdp.GXTZHandler"/>
<command name="铁心数据管理" id="com.connor.plm.txdp.TXDPHandler"/>
<command name="标准工时维护" id="com.connor.plm.txdp.BZGSHandler"/>
<command name="获取售前资料" id="com.connor.plm.srm.FileIntegrationHandler"/>
<command name="DBOM转EBOM" id="com.connor.chint.yunpi.command.DbomToECommand"/>
<command name="EBOM转PBOM" id="com.connor.chint.yunpi.command.EbomToPCommand"/>
@ -13,6 +17,7 @@
<command name="框架BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapKjSendCommand"/>
<command name="项目BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapWhCommand"/>
<command name="拆卸一览表下发" id="com.connor.chint.yunpi.command.ZxjcCommand"/>
<command name="拆卸一览表默认数据管理" id="com.connor.chint.yunpi.command.QueryZxjcHandler"/>
<command name="部件BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapWhBjCommand"/>
<command name="物料编码批量申请-全部图纸" id="com.chint.plm.applyMatnr.ApplyMatnrCommand#all"/>
<!--正泰定制下 中压开关-->
@ -41,8 +46,12 @@
<extension
point="org.eclipse.ui.handlers">
<handler commandId="com.connor.plm.srm.FileIntegrationHandler" class="com.connor.plm.srm.FileIntegrationHandler"/>
<!--<handler commandId="com.connor.plm.rdmCreate.RdmCreateHandler" class="com.connor.plm.rdmCreate.RdmCreateHandler"/>-->
<handler commandId="com.chint.plm.SearchSapResult9.PlclIDHandler" class="com.chint.plm.SearchSapResult9.PlclIDHandler"/>
<handler commandId="com.connor.plm.srm.SRMHandler" class="com.connor.plm.srm.SRMHandler"/>
<handler commandId="com.connor.plm.txdp.TXDPHandler" class="com.connor.plm.txdp.TXDPHandler"/>
<handler commandId="com.connor.plm.txdp.BZGSHandler" class="com.connor.plm.txdp.BZGSHandler"/>
<handler commandId="com.connor.plm.txdp.GXTZHandler" class="com.connor.plm.txdp.GXTZHandler"/>
<handler commandId="com.chint.plm.createbomdifference.BomCompareComd" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.chint.plm.createbomdifference.ExtractDiffComd" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.chint.plm.extractdraw.ExtractDrawComd" class="com.connor.chint.yunpi.KHandler"/>
@ -59,6 +68,7 @@
<handler commandId="com.connor.chint.yunpi.command.EbomToPCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.BomSapWhCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.ZxjcCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.QueryZxjcHandler" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.BomSapWhBjCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.chint.plm.createKjBom.CreateKjBomCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.DbomToECommand" class="com.connor.chint.yunpi.KHandler"/>
@ -73,6 +83,34 @@
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="menu:com.connor.chint.sap2.menu.test?after=additions">
<command commandId = "com.connor.plm.GZXQHandler" id = "com.connor.plm.GZXQHandler">
</command>
<command commandId = "com.connor.plm.txdp.TXDPHandler" id = "com.connor.plm.txdp.TXDPHandler">
<visibleWhen>
<and>
<or>
<reference definitionId="com.teamcenter.rac.ui.inMainPerspective"/>
<reference definitionId="com.teamcenter.rac.pse.inMainView"/>
</or>
<with
variable="rac_command_suppression">
<not>
<iterate
operator="or">
<equals
value="com.connor.plm.txdp.TXDPHandler">
</equals>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
</menuContribution>
<menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=additions">
@ -486,6 +524,29 @@
</visibleWhen>
</command>
<command commandId = "com.connor.chint.yunpi.command.QueryZxjcHandler" id = "com.connor.chint.yunpi.command.QueryZxjcHandler">
<visibleWhen>
<and>
<or>
<reference definitionId="com.teamcenter.rac.ui.inMainPerspective"/>
<reference definitionId="com.teamcenter.rac.pse.inMainView"/>
</or>
<with
variable="rac_command_suppression">
<not>
<iterate
operator="or">
<equals
value="com.connor.chint.yunpi.command.QueryZxjcHandler">
</equals>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
<command commandId = "com.connor.chint.yunpi.command.BomDcSapCommand" id = "com.connor.chint.yunpi.command.BomDcSapCommand">
<visibleWhen>
<and>
@ -637,6 +698,71 @@
</visibleWhen>
</command>
<command commandId = "com.connor.plm.txdp.TXDPHandler" id = "com.connor.plm.txdp.TXDPHandler">
<visibleWhen>
<and>
<or>
<reference definitionId="com.teamcenter.rac.ui.inMainPerspective"/>
<reference definitionId="com.teamcenter.rac.pse.inMainView"/>
</or>
<with
variable="rac_command_suppression">
<not>
<iterate
operator="or">
<equals
value="com.connor.plm.txdp.TXDPHandler">
</equals>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
<command commandId = "com.connor.plm.txdp.BZGSHandler" id = "com.connor.plm.txdp.BZGSHandler">
<visibleWhen>
<and>
<or>
<reference definitionId="com.teamcenter.rac.ui.inMainPerspective"/>
<reference definitionId="com.teamcenter.rac.pse.inMainView"/>
</or>
<with
variable="rac_command_suppression">
<not>
<iterate
operator="or">
<equals
value="com.connor.plm.txdp.BZGSHandler">
</equals>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
<command commandId = "com.connor.plm.txdp.GXTZHandler" id = "com.connor.plm.txdp.GXTZHandler">
<visibleWhen>
<and>
<or>
<reference definitionId="com.teamcenter.rac.ui.inMainPerspective"/>
<reference definitionId="com.teamcenter.rac.pse.inMainView"/>
</or>
<with
variable="rac_command_suppression">
<not>
<iterate
operator="or">
<equals
value="com.connor.plm.txdp.GXTZHandler">
</equals>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
<command commandId = "com.connor.plm.srm.FileIntegrationHandler" id = "com.connor.plm.srm.FileIntegrationHandler">
<visibleWhen>
@ -683,8 +809,29 @@
</visibleWhen>
</command>
<!--
<command commandId = "com.connor.plm.rdmCreate.RdmCreateHandler" id = "com.connor.plm.rdmCreate.RdmCreateHandler">
<visibleWhen>
<and>
<or>
<reference definitionId="com.teamcenter.rac.ui.inMainPerspective"/>
<reference definitionId="com.teamcenter.rac.pse.inMainView"/>
</or>
<with
variable="rac_command_suppression">
<not>
<iterate
operator="or">
<equals
value="com.connor.plm.rdmCreate.RdmCreateHandler">
</equals>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
-->
</menuContribution>
</extension>

@ -13,6 +13,7 @@ public class ApplyBean {
this.mCode = mCode;
}
public String getIdType() {
return idType;
}

@ -207,7 +207,7 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
// 220103001 CHINT_MadMaterialApply
for(ApplyBean bean:beans) {
if(bean.getIdType().equals("1ZD")) {
if(bean.getIdType().equals("1ZD") || bean.getIdType().equals("6ZD")) {
m_code1 = bean.getmCode();
}else {
m_code2 = bean.getmCode();
@ -388,7 +388,7 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
for(TCComponentItemRevision generalRev:general_maps.keySet()) {
String item_id = generalRev.getStringProperty("item_id");
String stringProperty = generalRev.getStringProperty("object_name");
if(item_id.startsWith("1ZD")) {
if(item_id.startsWith("1ZD") || item_id.startsWith("6ZD")) {
if(!nameList.contains(stringProperty)) {
errBuff.append(generalRev.toString()).append("\n");
}
@ -830,7 +830,7 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
}
String bpNo = properties[0];//rev.getProperty("item_id"); // 非必填
String zt2_DrawingNo = properties[2];//rev.getProperty("zt2_DrawingNo");
if (!KUtil.isEmpty(zt2_DrawingNo)&& !stuf.equalsIgnoreCase("1ZD")) {
if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD") && !stuf.equalsIgnoreCase("6ZD")) {
if (!bpNo.equals(zt2_DrawingNo))
bpNo = zt2_DrawingNo;
}
@ -984,7 +984,7 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
}
String bpNo = properties[0].toString();// rev.getProperty("item_id"); // 非必填
String zt2_DrawingNo = properties[2];// rev.getProperty("zt2_DrawingNo");
if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD")) {
if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD") && !stuf.equalsIgnoreCase("6ZD")) {
if (!bpNo.equals(zt2_DrawingNo))
bpNo = zt2_DrawingNo;
}
@ -1094,7 +1094,8 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
String item_id = revProperties[0];
if (item_id.length() >= 3) {
String stuf = item_id.substring(0, 3);
if (stuf.equalsIgnoreCase("2ZD") || stuf.equalsIgnoreCase("4ZD") || stuf.equalsIgnoreCase("1ZD")) {
if (stuf.equalsIgnoreCase("2ZD") || stuf.equalsIgnoreCase("4ZD")
|| stuf.equalsIgnoreCase("1ZD") || stuf.equalsIgnoreCase("6ZD")) {
// flag = false;
// 开始根据通用件规格属性来判断是否需要申请物料
String zt2_TYJSpec = line.getProperty("ZT2_TYSpecifications");
@ -1144,6 +1145,11 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
general_maps.put(rev, specs);
}
}
}else {//20240730ÔöźÓ˛éŃŻ˛éľ˝ľÄÂßź­
if(comps!= null && comps.length > 0) {
partRevs.add(comps[0]);
}
}
@ -1170,7 +1176,8 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
String bpNo = item_id;
//String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo");
String zt2_DrawingNo = revProperties[2];
if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD")) {
if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD")
&& !stuf.equalsIgnoreCase("6ZD")) {
if (!item_id.equals(zt2_DrawingNo))
bpNo = zt2_DrawingNo;
}

@ -1147,6 +1147,11 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation {
general_maps.put(rev, specs);
}
}
}else {//20240730增加查询查到的逻辑
if(comps!= null && comps.length > 0) {
partRevs.add(comps[0]);
}
}

@ -4,7 +4,6 @@ import java.util.Map;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemType;
import com.teamcenter.rac.kernel.TCProperty;
import com.teamcenter.rac.kernel.TCSession;
public class RemarkUtil {
@ -14,11 +13,31 @@ public class RemarkUtil {
int len =0;
try {
String[] split = itemId.split("-");
String topId = "1ZDB300000P-"+split[1];
System.out.println("topId:" + topId);
String id4 = itemId.substring(0, 4);
//lidy20250423
String[] ids = session.getPreferenceService().getStringValues("CHINT_FindDrawing");
String topId = "";//"1ZDB300000P-" + split[1];
for(String s : ids) {
if(s.substring(0, 4).equalsIgnoreCase(id4)) {
topId = s + split[1];
break;
}
}
TCComponentItemType partType = (TCComponentItemType) session.getTypeComponent("ZT2_Design3D");
TCComponentItem find = partType.findItems(topId)[0];
Map<String, String> classificationAttributes = find.getClassificationAttributes();
TCComponentItem[] find = null;
if(topId.isEmpty()) {
for(String s : ids) {
topId = s + split[1];
find = partType.findItems(topId);
if(find != null && find.length > 0)
break;
}
}else {
find = partType.findItems(topId);
}
System.out.println("topId:" + topId);
// TCComponentItem find = partType.findItems(topId)[0];
Map<String, String> classificationAttributes = find[0].getClassificationAttributes();
// System.out.println(classificationAttributes.toString());
for(String key : classificationAttributes.keySet()) {

@ -2,7 +2,6 @@ package com.chint.plm.createEcn;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -10,20 +9,18 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import com.chint.plm.fxUtil.KFXPanel;
import com.chint.plm.fxUtil.KFXPanelController;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
import javafx.stage.Stage;
/**
@ -34,22 +31,26 @@ public class AssignIdController {
private String groupID;
private TCSession session;
private TextField field;
private TCComponent tar;
private boolean flag;
// private TCComponent tar;
// private boolean flag;
@FXML
private Button assignBtn;
private Button assignBtnTop; // 变更管理中的指派按钮
@FXML
private TextField ylText;
@FXML
private Button closeBtn;
@FXML
private ComboBox<String> bmComb;
@FXML
private ComboBox<String> factoryComb;
@FXML
private RadioButton rb_tempChange; // 临时更改通知单
@FXML
private RadioButton rb_formalChange; // 正式更改通知单
private RadioButton p_tempChange;
private RadioButton p_formalChange;
/**
* @param session
@ -58,47 +59,82 @@ public class AssignIdController {
* @param tar
* @param flag
* @param assignBtn
* @param p_tempChange
* @param p_formalChange
* @function
*/
public void initData(TCSession session, String groupID, TextField field, TCComponent tar, boolean flag,
Button assignBtn) {
// TODO Auto-generated method stub
public void initData(TCSession session, String groupID, TextField field, Button assignBtn,
RadioButton p_tempChange, RadioButton p_formalChange) {
// Auto-generated method stub
this.groupID = groupID;
this.session = session;
this.field = field;
this.flag = flag;
this.tar = tar;
this.assignBtnTop = assignBtn;
this.p_tempChange = p_tempChange;
this.p_formalChange = p_formalChange;
getCombox();
//lidy20240919变更指派通知单号界面增加更改类型里面选择了正式或者临时外面页要一起跟着变
ToggleGroup group = new ToggleGroup(); // 变更类型组
// 实现单选功能
rb_formalChange.setToggleGroup(group);
rb_tempChange.setToggleGroup(group);
if(p_tempChange.isSelected())
rb_tempChange.setSelected(true);
else
rb_formalChange.setSelected(true);
rb_tempChange.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
try {
updateYL();
} catch (Exception e1) {
e1.printStackTrace();
MessageBox.post("生成单号失败,error:" + e1.getMessage(), "", MessageBox.INFORMATION);
}
}
});
rb_formalChange.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
try {
updateYL();
} catch (Exception e1) {
e1.printStackTrace();
MessageBox.post("生成单号失败,error:" + e1.getMessage(), "", MessageBox.INFORMATION);
}
}
});
}
@FXML
void okBtnClick(ActionEvent event) {
SimpleDateFormat sdf = new SimpleDateFormat("yy");
String year = sdf.format(new Date());
String fac = factoryComb.getSelectionModel().getSelectedItem();
String off = bmComb.getSelectionModel().getSelectedItem();
if (off.equals("-")) {
off = "";
}
String TF = "";
/// if(1==1)
// return;
if (flag) { // 临时
TF = "L";
} else { // if (TF.trim().equals("正式更改通知单"))
TF = "";
}
String searchWord = fac.split("-")[0] + off.split("-")[0] + "-" + year + TF;
String flow = searchWord;
Connection conn = null;
conn = util.connect(conn, session);
String query = "select FLOW from CHINT_ECN_CODE where CODE='" + searchWord + "'";
System.out.println(query);
Statement stmt;
ResultSet rs_get;
Statement stmt = null;
ResultSet rs_get = null;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yy");
String year = sdf.format(new Date());
String fac = factoryComb.getSelectionModel().getSelectedItem();
String off = bmComb.getSelectionModel().getSelectedItem();
if (off.equals("-")) {
off = "";
}
String TF = "";
/// if(1==1)
// return;
if (rb_tempChange.isSelected()) { // 临时
TF = "L";
p_tempChange.setSelected(true);
} else { // if (TF.trim().equals("正式更改通知单"))
TF = "";
p_formalChange.setSelected(true);
}
String searchWord = fac.split("-")[0] + off.split("-")[0] + "-" + year + TF;
String flow = searchWord;
conn = util.connect(conn, session);
String query = "select FLOW from CHINT_ECN_CODE where CODE='" + searchWord + "'";
System.out.println(query);
stmt = conn.createStatement();
rs_get = null;
rs_get = stmt.executeQuery(query);
@ -123,14 +159,19 @@ public class AssignIdController {
}
rs_get = stmt.executeQuery(query);
util.disconnect(conn, stmt, rs_get);
} catch (SQLException e1) {
assignBtnTop.setDisable(true);// 只能指派一次
assignBtn.setDisable(true);// 只能指派一次
//lidy20240919指派了更改界面临时正式变更就不能改了
p_tempChange.setDisable(true);
p_formalChange.setDisable(true);
Stage stage = (Stage) closeBtn.getScene().getWindow();
stage.close();
} catch (Exception e1) {
e1.printStackTrace();
MessageBox.post("生成单号失败,error:" + e1.getMessage(), "", MessageBox.INFORMATION);
}
assignBtnTop.setDisable(true);// 只能指派一次
assignBtn.setDisable(true);// 只能指派一次
Stage stage = (Stage) closeBtn.getScene().getWindow();
stage.close();
util.disconnect(conn, stmt, rs_get);
}
@FXML
@ -201,48 +242,11 @@ public class AssignIdController {
// 添加监听 预览信息
bmComb.valueProperty().addListener((obs, oldVal, newVal) -> {
System.out.println("选择了:" + newVal);
SimpleDateFormat sdf = new SimpleDateFormat("yy");
String year = sdf.format(new Date());
String fac = factoryComb.getSelectionModel().getSelectedItem();
String off = bmComb.getSelectionModel().getSelectedItem();
if (off.equals("-")) {
off = "";
}
String TF = "";
if (flag) { // 临时
TF = "L";
} else { // if (TF.trim().equals("正式更改通知单"))
TF = "";
}
String searchWord = fac.split("-")[0] + off.split("-")[0] + "-" + year + TF;
String flow = searchWord;
Connection conn = null;
conn = util.connect(conn, session);
String query = "select FLOW from CHINT_ECN_CODE where CODE='" + searchWord + "'";
System.out.println(query);
Statement stmt;
ResultSet rs_get;
try {
stmt = conn.createStatement();
rs_get = null;
rs_get = stmt.executeQuery(query);
if (rs_get.next()) {
String FLOW = rs_get.getString("FLOW");
flow = flow + FLOW;
FLOW = String.format("%04d", Integer.valueOf(FLOW) + 1);
} else {
flow = flow + "0001";
}
ylText.setText(flow);
System.out.println(query);
if (rs_get != null) {
rs_get.close();
}
util.disconnect(conn, stmt, rs_get);
} catch (SQLException e1) {
updateYL();
} catch (Exception e1) {
e1.printStackTrace();
MessageBox.post("生成单号失败,error:" + e1.getMessage(), "", MessageBox.INFORMATION);
}
});
@ -267,5 +271,52 @@ public class AssignIdController {
// }
}
private boolean updateYL() throws Exception {
boolean update = true;
SimpleDateFormat sdf = new SimpleDateFormat("yy");
String year = sdf.format(new Date());
String fac = factoryComb.getSelectionModel().getSelectedItem();
String off = bmComb.getSelectionModel().getSelectedItem();
if (off.equals("-")) {
off = "";
}
String TF = "";
if (rb_tempChange.isSelected()) { // 临时
TF = "L";
p_tempChange.setSelected(true);
} else {
TF = "";
p_formalChange.setSelected(true);
}
String searchWord = fac.split("-")[0] + off.split("-")[0] + "-" + year + TF;
String flow = searchWord;
Connection conn = null;
conn = util.connect(conn, session);
String query = "select FLOW from CHINT_ECN_CODE where CODE='" + searchWord + "'";
System.out.println(query);
Statement stmt;
ResultSet rs_get;
stmt = conn.createStatement();
rs_get = null;
System.out.println(query);
rs_get = stmt.executeQuery(query);
if (rs_get.next()) {
String FLOW = rs_get.getString("FLOW");
flow = flow + FLOW;
FLOW = String.format("%04d", Integer.valueOf(FLOW) + 1);
} else {
flow = flow + "0001";
update = false;
}
ylText.setText(flow);
if (rs_get != null) {
rs_get.close();
}
util.disconnect(conn, stmt, rs_get);
return update;
}
private Util util = new Util();
}

@ -1,30 +1,6 @@
package com.chint.plm.createEcn;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import com.chint.plm.SearchSapResult.DetailsBean;
import com.chint.plm.SearchSapResult.DetailsController;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import javafx.application.Application;
@ -32,6 +8,7 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
@ -39,19 +16,22 @@ public class AssignIdDialog extends Application {
private String groupID;
private TCSession session;
private TextField field;
private TCComponent tar;
// private TCComponent tar;
private Button assignBtn;
private boolean flag;
// private boolean flag;
private RadioButton p_tempChange;
private RadioButton p_formalChange;
public AssignIdDialog(TCSession session, String groupID, TextField field, TCComponent tar, boolean flag,
Button assignBtn) {
public AssignIdDialog(TCSession session, String groupID, TextField field, Button assignBtn,
RadioButton p_tempChange, RadioButton p_formalChange) {
super();
this.groupID = groupID;
this.session = session;
this.field = field;
this.tar = tar;
this.flag = flag;
this.assignBtn = assignBtn;
this.p_tempChange = p_tempChange;
this.p_formalChange = p_formalChange;
}
@Override
@ -63,7 +43,7 @@ public class AssignIdDialog extends Application {
Scene scene = new Scene(root, 400.0, 240.0);
AssignIdController controller = (AssignIdController) fxmlLoader.getController();
primaryStage.setTitle("֪ͨµ¥±àºÅ");
controller.initData(session, groupID, field, tar, flag, assignBtn);
controller.initData(session, groupID, field, assignBtn, p_tempChange, p_formalChange);
primaryStage.setScene(scene);
primaryStage.show();
}

@ -8,41 +8,43 @@
<?import javafx.scene.layout.BorderPane?>
<GridPane hgap="5.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="240.0" prefWidth="400.0" vgap="5.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.createEcn.AssignIdController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" vgrow="NEVER" />
</rowConstraints>
<children>
<FlowPane alignment="CENTER" hgap="12.0" GridPane.rowIndex="1">
<children>
<Button fx:id="assignBtn" mnemonicParsing="false" onAction="#okBtnClick" prefWidth="77.0" text="指派" />
<Button fx:id="closeBtn" mnemonicParsing="false" onAction="#cancelBtnClick" text=" 取消 " />
</children>
</FlowPane>
<GridPane alignment="CENTER" prefHeight="200.0">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="50.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<ComboBox fx:id="bmComb" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="创建者工厂:" />
<Label text="创建者部门:" GridPane.rowIndex="1" />
<Label text="预览" GridPane.rowIndex="2" />
<ComboBox fx:id="factoryComb" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" />
<TextField fx:id="ylText" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
</children>
</GridPane>
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" vgrow="NEVER" />
</rowConstraints>
<children>
<FlowPane alignment="CENTER" hgap="12.0" GridPane.rowIndex="1">
<children>
<Button fx:id="assignBtn" mnemonicParsing="false" onAction="#okBtnClick" prefWidth="77.0" text="指派" />
<Button fx:id="closeBtn" mnemonicParsing="false" onAction="#cancelBtnClick" text=" 取消 " />
</children>
</FlowPane>
<GridPane alignment="CENTER" prefHeight="200.0">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="50.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="创建者工厂:" />
<ComboBox fx:id="factoryComb" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" />
<Label text="创建者部门:" GridPane.rowIndex="1" />
<ComboBox fx:id="bmComb" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<RadioButton fx:id="rb_formalChange" maxWidth="200.0" prefWidth="150.0" mnemonicParsing="false" text="正式更改" GridPane.rowIndex="2" />
<RadioButton fx:id="rb_tempChange" mnemonicParsing="false" text="临时更改" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="预览" GridPane.rowIndex="3" />
<TextField fx:id="ylText" maxWidth="200.0" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
</children>
</GridPane>
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</GridPane>

@ -0,0 +1,129 @@
package com.chint.plm.createEcn;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumnModel;
import com.teamcenter.rac.aif.AbstractAIFDialog;
import com.teamcenter.rac.util.MessageBox;
import javafx.scene.control.TableView;
/**
* : UUID
* :2024-09-06
* @author
*
*
* 2024-09-06
*/
public class ChooseUuidDialog extends AbstractAIFDialog {
/**
*
*/
private static final long serialVersionUID = 1L;
private JTable impTable;
private DefaultTableModel impModel;
private JButton okBtn;
private JButton cancelBtn;
private TableView<RefTableBean> refTable;
private String[][] datas;
private List<RefTableBean> refTableBeans;
private int[] rows;
public ChooseUuidDialog(CreateEcnFrame parent, TableView<RefTableBean> refTable, String[][] datas, int[] rows, List<RefTableBean> refTableBeans) {
super(parent, true);
this.refTable = refTable;
this.datas = datas;
this.refTableBeans = refTableBeans;
this.rows = rows;
String[] header = { "姓名", "所属部门", "邮箱", "长工号", "短工号" };
impModel = new DefaultTableModel(header, 0);
impTable = new JTable(impModel) {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public boolean isCellEditable(int row, int column) {
return false;
}
};
int[] width = { 100, 850, 200, 100, 100 };
impModel.setDataVector(datas, header);
impTable.getTableHeader().setReorderingAllowed(false); // 设置列不可移动,否则会发生类型转换错误(第三列)
impTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
impTable.setRowHeight(23);
TableColumnModel colModel = impTable.getColumnModel();
for (int i = 0; i < width.length; i++) {
colModel.getColumn(i).setPreferredWidth(width[i]);
}
JPanel panel = new JPanel(new FlowLayout());
okBtn = new JButton("确定");
cancelBtn = new JButton("取消");
panel.add(okBtn);
panel.add(cancelBtn);
addActionListener();
this.setLayout(new BorderLayout());
this.add(BorderLayout.CENTER, new JScrollPane(impTable));
this.add(BorderLayout.SOUTH, panel);
this.setPreferredSize(new Dimension(1400, 400));
Dimension screen = getToolkit().getScreenSize();
setLocation((screen.width - getSize().width) / 2, (screen.height - getSize().height) / 2);
setAlwaysOnTop(true);
this.setAlwaysOnTop(true);
}
public void run(){
showDialog();
}
private void addActionListener() {
//final Shell dialog = shell;
okBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
int row = impTable.getSelectedRow();
if(row < 0) {
MessageBox.post("请选择行", "", MessageBox.WARNING);
return;
}
for (int i = rows[0]; i < rows[1]; i++) {
//TODO lidy20240716更改通知单影响分析 指派人员之前记录用户uid现在记录域名即接口中EMail字段并截取@前的内容
// refTableBeans.get(i).setUserUUid("" + datas[row][5]);
refTableBeans.get(i).setUserUUid("" + datas[row][2].substring(0, datas[row][2].indexOf("@")));
refTableBeans.get(i).setUserPane("" + datas[row][0]);
}
refTable.refresh();
dispose();
}
});
cancelBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
for (int i = rows[0]; i < rows[1]; i++) {
refTableBeans.get(i).setUserUUid("");
refTableBeans.get(i).setUserPane("");
}
refTable.refresh();
dispose();
}
});
}
}

@ -1,9 +1,9 @@
package com.chint.plm.createEcn;
import com.chint.plm.SearchSapResult.SapResultFrame;
import com.connor.chint.yunpi.KCommand;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.util.MessageBox;
public class CreateEcnCommond extends KCommand {
@ -12,7 +12,7 @@ public class CreateEcnCommond extends KCommand {
super(app, commandId, actionInfo);
try {
InterfaceAIFComponent targetComponent = app.getTargetComponent();
if (targetComponent.getType().equals("ZT2_ProjectItem") || targetComponent.getType().equals("ZT2_Change")) {
if ((targetComponent instanceof TCComponentFolder) || targetComponent.getType().equals("ZT2_ProjectItem") || targetComponent.getType().equals("ZT2_Change")) {
new CreateEcnFrame();
} else {
MessageBox.post("请选中项目零组件或者更改通知单或文件夹", "", MessageBox.ERROR);

@ -11,9 +11,7 @@ import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
@ -45,6 +43,7 @@ import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemType;
import com.teamcenter.rac.kernel.TCException;
@ -56,6 +55,8 @@ import edu.emory.mathcs.backport.java.util.Arrays;
import javafx.application.Platform;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
@ -147,6 +148,9 @@ public class CreateEcnController extends KFXPanelController {
@FXML
private TextArea remarkArea;
@FXML
private Button createBtn;
private CreateEcnController controller;
private CreateEcnFrame frame;
private String[] database;
@ -158,6 +162,30 @@ public class CreateEcnController extends KFXPanelController {
private final int ITEM_ROW_CNT = 1;//每个对象行数
private final int TITLE_ROW_CNT = 7;//表头行数
private String contractNo; // 合同代号
private String contractName;// 合同名称
private String productModel; // 产品型号
private String changeType; // 正式临时
private String changeTime;// 更改实施日期
private String changeUnit1; // 属性变更发往部门
private int pages = 0;
private String[] changeDrawingNo; // 属性zt2_ChangeDrawingNo
private String[] sign; // 属性zt2_Sign
// private String[] placesNo; //属性zt2_PlacesNo
private String[] partition; // 属性zt2_Partition
private String[] changeBefore1; // 属性zt2_ChangeBefore1
private String[] changeAfter1; // 属性zt2_ChangeAfter1
private String[] changeReason; // 属性zt2_ChangeReason
private String[] processType1; // 属性zt2_ProcessType1
private String[] szVersionBefs; // 变更前版本
private String[] szVersionAfts; // 变更后版本
private String[] productSzs; // 变更后版本
private String[] processSzs; // 变更后版本
@FXML
public TextField relateEcnText;
@Override
public void initData(KFXPanel paramKFXPanel) throws Exception {
// Auto-generated method stub
@ -173,7 +201,7 @@ public class CreateEcnController extends KFXPanelController {
// 实现单选功能
rb_formalChange.setToggleGroup(group);
rb_tempChange.setToggleGroup(group);
rb_formalChange.setSelected(true);
rb_tempChange.setSelected(true);//更改类型默认值改为“临时更改”
referencePane.setExpanded(true);
ToggleGroup groupGc = new ToggleGroup(); // 变更类型组
@ -188,12 +216,8 @@ public class CreateEcnController extends KFXPanelController {
// 获取选中的对象
initText();
}
@FXML
private Button createBtn;
/**
* @param event
* @throws Exception
@ -203,14 +227,10 @@ public class CreateEcnController extends KFXPanelController {
private void createClick(ActionEvent event) throws Exception {
if (ecnId.getText().isEmpty()) {
// MessageBox.post("请先指派变更单ID", "提示", MessageBox.ERROR);
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("提示");
alert.setHeaderText("请先指派变更单ID");
//alert.setContentText("导入完成");
alert.showAndWait();
showAlertBox("请先指派变更单ID", "提示", AlertType.INFORMATION);
return;
}
//TODO lidy20240520检查“影响分析”中的责任人列是否都为空值。如果是则不允许创建
// lidy20240520检查“影响分析”中的责任人列是否都为空值。如果是则不允许创建
boolean check = true;
ObservableList<RefTableBean> refs = refTable.getItems();
for (int i = 0; i < refs.size(); i++) {
@ -224,11 +244,12 @@ public class CreateEcnController extends KFXPanelController {
}
if(check) {
// MessageBox.post("当前变更单没有选择会签人,请选择会签人", "提示", MessageBox.ERROR);
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("提示");
alert.setHeaderText("当前变更单没有选择会签人,请选择会签人");
//alert.setContentText("导入完成");
alert.showAndWait();
showAlertBox("当前变更单没有选择会签人,请选择会签人", "提示", AlertType.INFORMATION);
return;
}
String date = changeDate.getEditor().getText();
if(date == null || date.isEmpty()) {
showAlertBox("更改实施日期不允许为空", "提示", AlertType.INFORMATION);
return;
}
String changeName = "临时更改通知单";
@ -237,8 +258,26 @@ public class CreateEcnController extends KFXPanelController {
}
if (target.getType().equals("ZT2_Change")) {
TCComponentItem item = (TCComponentItem) target;
setItemProperty(item, changeName);
try {
setItemProperty(item, changeName);
} catch (Exception e1) {
e1.printStackTrace();
String err = Util.getStackTrace(e1);
err = err.substring(0, err.indexOf("\n\tat")).replace("输入字符串过长", "输入的内容过长,请缩减内容");
if (err.contains("无法设置属性 更改前")) {
showAlertBox("更改单生成异常:" + err + "\n"
+ " 【更改前】【更改后】字符总数不能超过256个字符\n (一个中文字=2个字符1个标点或者英文=1个字符)",
"保存异常", AlertType.INFORMATION);
} else if (err.contains("无法设置属性 更改后")) {
showAlertBox("更改单生成异常:" + err + "\n"
+ " 【更改前】【更改后】字符总数不能超过256个字符 \n (一个中文字=2个字符1个标点或者英文=1个字符)",
"保存异常", AlertType.INFORMATION);
} else {
showAlertBox("更改单生成异常:" + err, "保存异常", AlertType.INFORMATION);
}
// item.delete();
return;
}
String type = item.getProperty("zt2_Template");
TCComponentDataset dataset = null;
File file = null;
@ -275,21 +314,21 @@ public class CreateEcnController extends KFXPanelController {
} catch (Exception e1) {
e1.printStackTrace();
flag = false;
if (e1.getMessage().contains("无法设置属性 更改前")) {
MessageBox.post(
"更改单生成异常:" + e1.getMessage() + "\n"
String err = Util.getStackTrace(e1);
err = err.substring(0, err.indexOf("\n\tat")).replace("输入字符串过长", "输入的内容过长,请缩减内容");
if (err.contains("无法设置属性 更改前")) {
showAlertBox("更改单生成异常:" + err + "\n"
+ " 【更改前】【更改后】字符总数不能超过256个字符\n (一个中文字=2个字符1个标点或者英文=1个字符)",
"保存异常", MessageBox.INFORMATION);
} else if (e1.getMessage().contains("无法设置属性 更改后")) {
MessageBox.post(
"更改单生成异常:" + e1.getMessage() + "\n"
"保存异常", AlertType.INFORMATION);
} else if (err.contains("无法设置属性 更改后")) {
showAlertBox("更改单生成异常:" + err + "\n"
+ " 【更改前】【更改后】字符总数不能超过256个字符 \n (一个中文字=2个字符1个标点或者英文=1个字符)",
"保存异常", MessageBox.INFORMATION);
"保存异常", AlertType.INFORMATION);
} else {
MessageBox.post("更改单生成异常:" + e1.getMessage(), "保存异常", MessageBox.INFORMATION);
showAlertBox("更改单生成异常:" + err, "保存异常", AlertType.INFORMATION);
}
item.delete();
return;
}
if (flag) {
TCComponent targetFolder = getTargetFolder(target);
@ -310,6 +349,52 @@ public class CreateEcnController extends KFXPanelController {
MessageBox.post("创建完成", "", MessageBox.INFORMATION);
}
} else if (target instanceof TCComponentFolder) {
//TODO 选择文件夹直接创建,功能逻辑和选择项目的保持一致,只是取自项目的相关属性,更改为手工填写,其余完全一致
TCComponentItemType itemType = (TCComponentItemType) session.getTypeComponent("ZT2_Change");
TCComponentItem item = itemType.create(ecnId.getText(), null, "ZT2_Change", changeName, "", null);
// 设置属性
boolean flag = true;
try {
setItemProperty(item, changeName);
} catch (Exception e1) {
e1.printStackTrace();
flag = false;
String err = Util.getStackTrace(e1);
// System.out.println("err" + err);
err = err.substring(0, err.indexOf("\n\tat")).replace("输入字符串过长", "输入的内容过长,请缩减内容");
// System.out.println("err" + err);
if (err.contains("无法设置属性 更改前")) {
showAlertBox("更改单生成异常:" + err + "\n"
+ " 【更改前】【更改后】字符总数不能超过256个字符\n (一个中文字=2个字符1个标点或者英文=1个字符)",
"保存异常", AlertType.INFORMATION);
} else if (err.contains("无法设置属性 更改后")) {
showAlertBox("更改单生成异常:" + err + "\n"
+ " 【更改前】【更改后】字符总数不能超过256个字符 \n (一个中文字=2个字符1个标点或者英文=1个字符)",
"保存异常", AlertType.INFORMATION);
} else {
showAlertBox("更改单生成异常:" + err, "保存异常", AlertType.INFORMATION);
}
item.delete();
return;
}
if (flag) {
target.add("contents", new TCComponent[] { item });
// 新建数据集挂到对象规范关系下,导出相关属性
// 获取模板的puid
String type = item.getProperty("zt2_Template");
TCComponentDataset dataset = null;
dataset = getDataset(type, 1);
// item.setProperty("zt2_WBSNo", "");
File file = Util.getExcel(dataset);
createOrReplace(dataset, file, changeName);
item.setRelated("IMAN_reference", new TCComponent[] { dataset });
// item.unlock();
MessageBox.post("创建完成", "", MessageBox.INFORMATION);
}
}
// 影响分析信息 保存到CHINT_ECN_NOTIFICATION中
@ -325,61 +410,99 @@ public class CreateEcnController extends KFXPanelController {
// 1222 新增逻辑,责任人指派
for (int i = 0; i < 7; i++) {
RefTableBean refTableBean = items.get(i);
String user = refTableBean.getUserVal();
String uuid = refTableBean.getUserUUid();
if(uuid != null && !uuid.isEmpty())
user += ";" + uuid;
if(user.isEmpty())
user = ";";
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
SqlUtil.write(new String[] { endCode, "1", refTableBean.getDepart(), String.valueOf(i + 1),
refTableBean.getMessage(), result, refTableBean.getUserVal() + ";" + refTableBean.getUserUUid(),
refTableBean.getMessage(), result, user,
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
}
for (int i = 7; i < 11; i++) {
RefTableBean refTableBean = items.get(i);
String user = refTableBean.getUserVal();
String uuid = refTableBean.getUserUUid();
if(uuid != null && !uuid.isEmpty())
user += ";" + uuid;
if(user.isEmpty())
user = ";";
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
SqlUtil.write(new String[] { endCode, "2", refTableBean.getDepart(), String.valueOf(i - 6),
refTableBean.getMessage(), result, refTableBean.getUserVal() + ";" + refTableBean.getUserUUid(),
refTableBean.getMessage(), result, user,
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
}
for (int i = 11; i < 15; i++) {
RefTableBean refTableBean = items.get(i);
String user = refTableBean.getUserVal();
String uuid = refTableBean.getUserUUid();
if(uuid != null && !uuid.isEmpty())
user += ";" + uuid;
if(user.isEmpty())
user = ";";
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
SqlUtil.write(new String[] { endCode, "3", refTableBean.getDepart(), String.valueOf(i - 10),
refTableBean.getMessage(), result, refTableBean.getUserVal() + ";" + refTableBean.getUserUUid(),
refTableBean.getMessage(), result, user,
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
}
for (int i = 15; i < 19; i++) {
RefTableBean refTableBean = items.get(i);
String user = refTableBean.getUserVal();
String uuid = refTableBean.getUserUUid();
if(uuid != null && !uuid.isEmpty())
user += ";" + uuid;
if(user.isEmpty())
user = ";";
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
SqlUtil.write(new String[] { endCode, "4", refTableBean.getDepart(), String.valueOf(i - 14),
refTableBean.getMessage(), result, refTableBean.getUserVal() + ";" + refTableBean.getUserUUid(),
refTableBean.getMessage(), result, user,
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
}
for (int i = 19; i < 24; i++) {
RefTableBean refTableBean = items.get(i);
String user = refTableBean.getUserVal();
String uuid = refTableBean.getUserUUid();
if(uuid != null && !uuid.isEmpty())
user += ";" + uuid;
if(user.isEmpty())
user = ";";
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
SqlUtil.write(new String[] { endCode, "5", refTableBean.getDepart(), String.valueOf(i - 18),
refTableBean.getMessage(), result, refTableBean.getUserVal() + ";" + refTableBean.getUserUUid(),
refTableBean.getMessage(), result, user,
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
}
for (int i = 24; i < 27; i++) {
RefTableBean refTableBean = items.get(i);
String user = refTableBean.getUserVal();
String uuid = refTableBean.getUserUUid();
if(uuid != null && !uuid.isEmpty())
user += ";" + uuid;
if(user.isEmpty())
user = ";";
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
SqlUtil.write(new String[] { endCode, "6", refTableBean.getDepart(), String.valueOf(i - 23),
refTableBean.getMessage(), result, refTableBean.getUserVal() + ";" + refTableBean.getUserUUid(),
refTableBean.getMessage(), result, user,
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
}
for (int i = 27; i < 28; i++) {
RefTableBean refTableBean = items.get(i);
String user = refTableBean.getUserVal();
String uuid = refTableBean.getUserUUid();
if(uuid != null && !uuid.isEmpty())
user += ";" + uuid;
if(user.isEmpty())
user = ";";
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
SqlUtil.write(new String[] { endCode, "7", refTableBean.getDepart(), String.valueOf(i - 26),
refTableBean.getMessage(), result, refTableBean.getUserVal() + ";" + refTableBean.getUserUUid(),
refTableBean.getMessage(), result, user,
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
}
frame.dispose();
} catch (Exception e) {
e.printStackTrace();
Alert alert = new Alert(AlertType.ERROR);
//alert.setTitle("信息");
//alert.setHeaderText("这是一个信息对话框");
alert.setContentText("" + e.getMessage());
alert.showAndWait();
showAlertBox("" + e.getMessage(), "错误", AlertType.ERROR);
} finally {
SqlUtil.freeAll();
}
@ -392,7 +515,7 @@ public class CreateEcnController extends KFXPanelController {
* @param changeName excel
*/
private void createOrReplace(TCComponentDataset dataset, File file, String changeName) {
//TODO 20240227大幅修改excel
// 20240227大幅修改excel
FileInputStream fis = null;
FileOutputStream fos = null;
try {
@ -477,8 +600,9 @@ public class CreateEcnController extends KFXPanelController {
cell.setCellValue(i + 1);//序号
cell = POIUtil.getCell(row, 1);
cell.setCellValue(changeDrawingNo[i]);//图样代号(文件编号)
cell = POIUtil.getCell(row, 3);
cell.setCellValue(sign[i]);//标记
cell = POIUtil.getCell(row, 3);//21改为通过公式取值
// cell.setCellValue(sign[i]);
cell.setCellFormula("IFERROR(CONCATENATE(VLOOKUP(\"" + sign[i] + "\",标记符!A:B,2,0)),\"\")");//标记
cell = POIUtil.getCell(row, 4);
cell.setCellValue(partition[i]);//处数
cell = POIUtil.getCell(row, 5);
@ -516,8 +640,10 @@ public class CreateEcnController extends KFXPanelController {
cell.setCellValue(refTableBean.getMark().getText());//备注
}
File file2 = null;
String timeNow = Util.GetNowDate();
String filePath = System.getProperty("java.io.tmpdir") + timeNow + ".xlsx";
//lidy20241114修改excel文件名称避免重复
// String timeNow = Util.GetNowDate();
String timeNow = new SimpleDateFormat("-yyyyMMddHHmmss").format(new Date());
String filePath = System.getProperty("java.io.tmpdir") + ecnId.getText() + timeNow + ".xlsx";
file2 = new File(filePath);
fos = new FileOutputStream(file2);
workbook.write(fos);
@ -589,13 +715,6 @@ public class CreateEcnController extends KFXPanelController {
}
}
private String contractNo; // 合同代号
private String contractName;// 合同名称
private String productModel; // 产品型号
private String changeType; // 正式临时
private String changeTime;// 更改实施日期
private String changeUnit1; // 属性变更发往部门
/**
* @param item
* @param changeName
@ -666,7 +785,7 @@ public class CreateEcnController extends KFXPanelController {
pages = dlivery + 1;
}
}
System.out.println("页数pages:" + pages);//TODO
System.out.println("页数pages:" + pages);//
for (int i = 0; i < rowCount; i++) {
EcnBean ecnBean = items.get(i);
changeDrawingNo[i] = ecnBean.getDrawNo().getText();
@ -714,20 +833,6 @@ public class CreateEcnController extends KFXPanelController {
item.getTCProperty("zt2_SZProcess").setStringValueArray(processSzs);
}
private int pages = 0;
private String[] changeDrawingNo; // 属性zt2_ChangeDrawingNo
private String[] sign; // 属性zt2_Sign
// private String[] placesNo; //属性zt2_PlacesNo
private String[] partition; // 属性zt2_Partition
private String[] changeBefore1; // 属性zt2_ChangeBefore1
private String[] changeAfter1; // 属性zt2_ChangeAfter1
private String[] changeReason; // 属性zt2_ChangeReason
private String[] processType1; // 属性zt2_ProcessType1
private String[] szVersionBefs; // 变更前版本
private String[] szVersionAfts; // 变更后版本
private String[] productSzs; // 变更后版本
private String[] processSzs; // 变更后版本
/**
* @param event
* @function
@ -742,10 +847,15 @@ public class CreateEcnController extends KFXPanelController {
* @function
*/
private void initText() throws Exception {
List<String> productModelList = new ArrayList<>();
productModelList = Util.getproductModel(target, productModelList);
factoryText.setEditable(false);
pmCombox.getItems().addAll(productModelList);
//TODO 选择文件夹直接创建,取自项目的相关属性,更改为手工填写
if(target instanceof TCComponentFolder) {
pmCombox.setEditable(true);
}else {
List<String> productModelList = new ArrayList<>();
productModelList = Util.getproductModel(target, productModelList);
pmCombox.getItems().addAll(productModelList);
}
List<String> unitList = new ArrayList<>();
contractText.setText(Util.getProjectNo(target));
contractText.setEditable(false);
@ -753,7 +863,9 @@ public class CreateEcnController extends KFXPanelController {
htNameText.setEditable(false);
ecnId.setEditable(false);
rb_product.setSelected(true);
if (target.getType().equals("ZT2_ProjectItem")) {
if(target instanceof TCComponentFolder) {
prodNameComb.setEditable(true);
}else if (target.getType().equals("ZT2_ProjectItem")) {
// 获取产成品的名称
List<String> ccpNameFromProject = KUtil.getCCPNameFromProject(target, session);
prodNameComb.getItems().addAll(ccpNameFromProject);
@ -765,6 +877,8 @@ public class CreateEcnController extends KFXPanelController {
String productModel = target.getProperty("zt2_ProductModel");
pmCombox.getSelectionModel().select(productModel);
assignBtn.setDisable(true);
rb_tempChange.setDisable(true);
rb_formalChange.setDisable(true);
ecnId.setText(target.getProperty("item_id"));
TCProperty[] properties = null;
try {
@ -775,7 +889,7 @@ public class CreateEcnController extends KFXPanelController {
}
// 初始化选中工厂
if (target.getType().equals("ZT2_Change")) {
String[] changeUnit1 = target.getProperty("zt2_ChangeUnit1").split(";");
String[] changeUnit1 = target.getProperty("zt2_ChangeUnit1").split(" ");
for (int j = 0; j < changeUnit1.length; j++) {
unitList.add(changeUnit1[j]);
}
@ -785,7 +899,8 @@ public class CreateEcnController extends KFXPanelController {
properties = target.getTCProperties(
new String[] { "zt2_ChangeDrawingNo", "zt2_Sign", "zt2_PlacesNo", "zt2_Partition",
"zt2_ChangeBefore1", "zt2_ChangeAfter1", "zt2_ChangeReason", "zt2_ProcessType1",
"zt2_SZVersionbefore", "zt2_SZRevisedversion", "zt2_SZProduct", "zt2_SZProcess", "zt2_Remark" });
"zt2_SZVersionbefore", "zt2_SZRevisedversion", "zt2_SZProduct", "zt2_SZProcess",
"zt2_Remark", "zt2_ChangeType" });
} catch (TCException e1) {
e1.printStackTrace();
}
@ -802,6 +917,7 @@ public class CreateEcnController extends KFXPanelController {
String[] szProduct = properties[10].getStringArrayValue();
String[] szProcess = properties[11].getStringArrayValue();
String zt2_Remark = properties[12].getStringValue();
String zt2_ChangeType = properties[13].getStringValue();
if (szProcess.length > 0) {
rb_Process.setSelected(szProcess[0].equals("N"));
}
@ -812,6 +928,11 @@ public class CreateEcnController extends KFXPanelController {
markText.setText(fileName);
relateEcnText.setText(changRequestNo);
remarkArea.setText(zt2_Remark);
if(zt2_ChangeType.startsWith("临时")) {
rb_tempChange.setSelected(true);
}else {
rb_formalChange.setSelected(true);
}
// String productName = prodNameComb.getSelectionModel().getSelectedItem();
// String fileName = markText.getText();
// item.setProperty("zt2_FileName", fileName);
@ -822,6 +943,7 @@ public class CreateEcnController extends KFXPanelController {
EcnBean ecnBean = new EcnBean(rowNum, reasons, wips, ChangeDrawingNo[j], sign[j], placesNo[j],
ChangeBefore1[j], ChangeAfter1[j], ChangeReason[j], ProcessType1[j], szVersionBef[j],
szVersionAft[j], products, szProduct[j]);
ecnBean.addActionListener(frame);
ecnBeans.add(ecnBean);
// ecnBean.setProductSz(szProduct[j]);
}
@ -850,11 +972,19 @@ public class CreateEcnController extends KFXPanelController {
refTableBean.setCompDate(read.getString("pctime"));
refTableBean.setMark(read.getString("remark"));
String principal = read.getString("principal");
if(principal == null)
principal = "";
String[] split = principal.split(";");
if (split.length >= 2) {
refTableBean.setUserUUid(split[1]);
}
refTableBean.setUserPane(split[0]);
if(split.length > 0) {
if(split[0].equals("null"))
refTableBean.setUserPane("");
else
refTableBean.setUserPane(split[0]);
}else
refTableBean.setUserPane("");
String result = read.getString("result");
if (result.equals("否")) {
refTableBean.setShNo(true);
@ -955,19 +1085,17 @@ public class CreateEcnController extends KFXPanelController {
@SuppressWarnings("unchecked")
private void createDetailTable() {
// Auto-generated method stub
TableColumn<EcnBean, TextArea> tc_beforChange = new TableColumn<EcnBean, TextArea>("更改前");
TableColumn<EcnBean, TextArea> tc_afterChange = new TableColumn<EcnBean, TextArea>("更改后");
TableColumn<EcnBean, TextArea> tc_afterVer = new TableColumn<EcnBean, TextArea>("更改后版本");
TableColumn<EcnBean, Integer> tc_xh = new TableColumn<EcnBean, Integer>("序号");
TableColumn<EcnBean, TextArea> tc_drawNo = new TableColumn<EcnBean, TextArea>("图样代号");
TableColumn<EcnBean, TextArea> tc_mark = new TableColumn<EcnBean, TextArea>("标记");
TableColumn<EcnBean, Integer> tc_xh = new TableColumn<EcnBean, Integer>("序号");
TableColumn<EcnBean, ComboBox<String>> tc_wipTreat = new TableColumn<EcnBean, ComboBox<String>>("在制品处理");
TableColumn<EcnBean, TextArea> tc_poiNum = new TableColumn<EcnBean, TextArea>("处数");
TableColumn<EcnBean, TextArea> tc_beforChange = new TableColumn<EcnBean, TextArea>("更改前");
TableColumn<EcnBean, TextArea> tc_beforVer = new TableColumn<EcnBean, TextArea>("更改前版本");
TableColumn<EcnBean, TextArea> tc_afterChange = new TableColumn<EcnBean, TextArea>("更改后");
TableColumn<EcnBean, TextArea> tc_afterVer = new TableColumn<EcnBean, TextArea>("更改后版本");
TableColumn<EcnBean, ComboBox<String>> productSz = new TableColumn<EcnBean, ComboBox<String>>("特性等级");
TableColumn<EcnBean, ComboBox<String>> tc_reason = new TableColumn<EcnBean, ComboBox<String>>("更改原因");
TableColumn<EcnBean, TextArea> tc_poiNum = new TableColumn<EcnBean, TextArea>("处数");
TableColumn<EcnBean, ComboBox<String>> tc_wipTreat = new TableColumn<EcnBean, ComboBox<String>>("在制品处理");
tableView.getColumns().addAll(tc_xh, tc_drawNo, tc_mark, tc_poiNum, tc_beforChange, tc_beforVer, tc_afterChange,
tc_afterVer, productSz, tc_reason, tc_wipTreat);
@ -1008,7 +1136,7 @@ public class CreateEcnController extends KFXPanelController {
tc_wipTreat.prefWidthProperty().bind(tableView.widthProperty().multiply(0.10));
tableView.setRowFactory(tv -> {
//TODO 设置行高
// 设置行高
TableRow<EcnBean> row = new TableRow<>();
row.setPrefHeight(100);
return row;
@ -1125,47 +1253,143 @@ public class CreateEcnController extends KFXPanelController {
*/
private void addAssignAction(List<RefTableBean> refTableBeans) {
// Auto-generated method stub
Button userBtn = refTableBeans.get(0).getUserBtn();
assignBtnAction(userBtn, 0, 7, refTableBeans);
assignBtnAction(refTableBeans.get(7).getUserBtn(), 7, 11, refTableBeans);
assignBtnAction(refTableBeans.get(11).getUserBtn(), 11, 15, refTableBeans);
assignBtnAction(refTableBeans.get(15).getUserBtn(), 15, 19, refTableBeans);
assignBtnAction(refTableBeans.get(19).getUserBtn(), 19, 24, refTableBeans);
assignBtnAction(refTableBeans.get(24).getUserBtn(), 24, 27, refTableBeans);
assignBtnAction(refTableBeans.get(27).getUserBtn(), 27, 28, refTableBeans);
assignBtnAction(refTableBeans.get(0), 0, 7, refTableBeans);
assignBtnAction(refTableBeans.get(7), 7, 11, refTableBeans);
assignBtnAction(refTableBeans.get(11), 11, 15, refTableBeans);
assignBtnAction(refTableBeans.get(15), 15, 19, refTableBeans);
assignBtnAction(refTableBeans.get(19), 19, 24, refTableBeans);
assignBtnAction(refTableBeans.get(24), 24, 27, refTableBeans);
assignBtnAction(refTableBeans.get(27), 27, 28, refTableBeans);
}
/**
* @param userBtn
* @param start
* @param end
* @param userVal
* @param refTableBeans
* @function
*
* @param bean
* @param start
* @param end
* @param refTableBeans
*/
private void assignBtnAction(Button userBtn, int start, int end, List<RefTableBean> refTableBeans) {
private void assignBtnAction(RefTableBean bean, int start, int end, List<RefTableBean> refTableBeans) {
// Auto-generated method stub
userBtn.setOnAction(e -> {
bean.getUserBtn().setOnAction(e -> {
try {
String userVal = refTableBeans.get(start).getUserVal();
if(userVal == null || userVal.isEmpty() || userVal.equals("null")) {
showAlertBox("请输入用户名", "提示", AlertType.INFORMATION);
return;
}
String encodeQuery = URIUtil.encodeQuery(userVal);
System.out.println("setOnAction" + encodeQuery);
Map<String, String> userItemMap = getUserItemOA(encodeQuery);
Platform.runLater(() -> {
for (int i = start; i < end; i++) {
String next = userItemMap.keySet().iterator().next();
refTableBeans.get(i).setUserUUid(userItemMap.get(next));
refTableBeans.get(i).setUserPane(userVal);
String[][] datas = getUserItemOA(encodeQuery);
if(datas == null || datas.length == 0) {
//提示指派失败就清空这个值
for (int i = start; i < end; i++) {
refTableBeans.get(i).setUserUUid("");
refTableBeans.get(i).setUserPane("");
}
System.out.println("setOnAction" + encodeQuery);
refTable.refresh();
});
return;
}
if(datas.length == 1) {
Platform.runLater(() -> {
for (int i = start; i < end; i++) {
//TODO lidy20240716更改通知单影响分析 指派人员之前记录用户uid现在记录域名即接口中EMail字段并截取@前的内容
// refTableBeans.get(i).setUserUUid(datas[0][5]);
refTableBeans.get(i).setUserUUid(datas[0][2].substring(0, datas[0][2].indexOf("@")));
refTableBeans.get(i).setUserPane(userVal);
}
refTable.refresh();
});
}else {
new ChooseUuidDialog(frame, refTable, datas, new int[] { start, end }, refTableBeans).showDialog();
}
// Map<String, String> userItemMap = getUserItemOA(encodeQuery);
// System.out.println("userItemMap" + userItemMap);
// Platform.runLater(() -> {
// for (int i = start; i < end; i++) {
// String next = userItemMap.keySet().iterator().next();
// System.out.println(i + "===" + next + ">>>" + userItemMap.get(next));
// refTableBeans.get(i).setUserUUid(userItemMap.get(next));
// refTableBeans.get(i).setUserPane(userVal);
// }
// System.out.println("setOnAction" + encodeQuery);
// refTable.refresh();
// });
} catch (Exception e1) {
// Auto-generated catch block
e1.printStackTrace();
showAlertBox("指派失败:" + e1, "提示", AlertType.ERROR);
//提示指派失败就清空这个值
for (int i = start; i < end; i++) {
refTableBeans.get(i).setUserUUid("");
refTableBeans.get(i).setUserPane("");
}
refTable.refresh();
}
});
for (int i = start; i < end; i++) {
RefTableBean row = refTableBeans.get(i);
row.getShYes().selectedProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
// Auto-generated method stub
// System.out.println("oldValue"+oldValue);
if (newValue) {
row.getShNo().setSelected(false);
}
setRefEnable(start, end, refTableBeans);
}
});
row.getShNo().selectedProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
// Auto-generated method stub
// System.out.println("oldValue"+oldValue);
if (newValue) {
row.getShYes().setSelected(false);
}
setRefEnable(start, end, refTableBeans);
}
});
}
TextField text = refTableBeans.get(start).getUserText();//填写了名字,没点指派,点到其他地方,提示进行指派
text.focusedProperty().addListener((obs, wasFocused, isNowFocused) -> {
if (wasFocused && !isNowFocused && !text.getText().isEmpty()) {
if (!refTableBeans.get(start).getUserBtn().isFocused()) {
showAlertBox("进行指派", "提示", AlertType.WARNING);
text.requestFocus();
}
}
});
setRefEnable(start, end, refTableBeans);
}
/**
*
* @param start
* @param end
* @param refTableBeans
*/
private void setRefEnable(int start, int end, List<RefTableBean> refTableBeans) {
boolean set = true;
for(int i = start; i < end; i++) {
if(refTableBeans.get(i).getShYes().isSelected()) {
set = false;
break;
}
}
RefTableBean top = refTableBeans.get(start);
top.getUserBtn().setDisable(set);
top.getUserText().setDisable(set);
if(set) {
for (int i = start; i < end; i++) {
refTableBeans.get(i).setUserPane("");
refTableBeans.get(i).setUserUUid("");
}
}
}
/**
@ -1174,9 +1398,8 @@ public class CreateEcnController extends KFXPanelController {
* @throws Exception
* @function OA9ID
*/
private Map<String, String> getUserItemOA(String name) throws Exception {//TODO 调用OA接口
private String[][] getUserItemOA(String name) throws Exception {// 调用OA接口
OkHttpClient client = new OkHttpClient();
Map<String, String> emailMap = new HashMap<>();
String url = session.getPreferenceService().getStringValues("CHINT_OAUserID_RUL")[0];
System.out.println("url==>" + url);
@ -1197,28 +1420,29 @@ public class CreateEcnController extends KFXPanelController {
Element rootElement = document.getRootElement();
String type = rootElement.elementText("TYPE");
String message = rootElement.elementText("MESSAGE");
String[][] datas = null;
if (type.equals("S")) {
Element element = rootElement.element("items");
@SuppressWarnings("unchecked")
List<Element> elements = rootElement.elements("items");
for (Element element : elements) {
Element userItemCs = element.element("EH_HR_UserItems_CS");
String email = userItemCs.elementText("Email");
String status = userItemCs.elementText("ObjectID");
emailMap.put(email, status);
}
if (emailMap.size() > 0) {
} else {
// String key = emailMap.keySet().iterator().next();
// return emailMap.get(key);
List<Element> elements = element.elements("EH_HR_UserItems_CS");
datas = new String[elements.size()][6];
for (int i = 0; i < elements.size(); i++) {
// Element userItemCs = element.element("EH_HR_UserItems_CS");
Element userItemCs = elements.get(i);
datas[i][0] = userItemCs.elementText("Name");
datas[i][1] = userItemCs.elementText("DepName");
datas[i][2] = userItemCs.elementText("Email");
datas[i][3] = userItemCs.elementText("Code");
datas[i][4] = userItemCs.elementText("SourceID");
datas[i][5] = userItemCs.elementText("ObjectID");
}
} else {
MessageBox.post("指派失败:" + message, "提示", 2);
// MessageBox.post("指派失败:" + message, "提示", 2);
showAlertBox("指派失败:" + message, "提示", AlertType.ERROR);
}
// Element element = body.element("MT_MATERIAL_BOP_REQ");
// Element INTERGRATIONLIST = element.addElement("INTERGRATIONLIST");
return emailMap;
return datas;
}
// 最大化
@ -1303,7 +1527,10 @@ public class CreateEcnController extends KFXPanelController {
@FXML
void addRows(ActionEvent event) {
for (int i = 0; i < 5; i++) {
ecnBeans.add(new EcnBean(ecnBeans.size() + 1, reasons, wips, products));
EcnBean bean = new EcnBean(ecnBeans.size() + 1, reasons, wips, products);
bean.addActionListener(frame);
bean.getProductSz().setValue("C");//特性等级默认为“C”
ecnBeans.add(bean);
}
ObservableList<EcnBean> data = FXCollections.observableArrayList(ecnBeans);
tableView.getItems().clear();
@ -1316,7 +1543,10 @@ public class CreateEcnController extends KFXPanelController {
*/
@FXML
void addRow(ActionEvent event) {
ecnBeans.add(new EcnBean(ecnBeans.size() + 1, reasons, wips, products));
EcnBean bean = new EcnBean(ecnBeans.size() + 1, reasons, wips, products);
bean.addActionListener(frame);
bean.getProductSz().setValue("C");//特性等级默认为“C”
ecnBeans.add(bean);
ObservableList<EcnBean> data = FXCollections.observableArrayList(ecnBeans);
tableView.getItems().clear();
tableView.setItems(data);
@ -1348,8 +1578,8 @@ public class CreateEcnController extends KFXPanelController {
// rb_tempChange
// assignBtn ecnId
try {
AssignIdDialog dialog = new AssignIdDialog(session, SAPUtil.getGroupID(), ecnId, target,
rb_tempChange.isSelected(), assignBtn);
AssignIdDialog dialog = new AssignIdDialog(session, SAPUtil.getGroupID(), ecnId,
assignBtn, rb_tempChange, rb_formalChange);
dialog.start(new Stage());
} catch (Exception e) {
// Auto-generated catch block
@ -1357,9 +1587,6 @@ public class CreateEcnController extends KFXPanelController {
}
}
@FXML
public TextField relateEcnText;
/**
* @param event
* @function
@ -1375,5 +1602,21 @@ public class CreateEcnController extends KFXPanelController {
}
}
/**
* javafx
*
* @param msg
* @param title
* @param type
*/
private void showAlertBox(String msg, String title, AlertType type) {
System.out.println("Alert" + msg);
Alert alert = new Alert(type);
alert.setTitle(title);
if(msg.contains("\n"))
alert.setContentText(msg);
else
alert.setHeaderText(msg);
alert.showAndWait();
}
}

@ -8,17 +8,20 @@ import javafx.scene.control.TextArea;
public class EcnBean {
protected SimpleIntegerProperty num;
protected TextArea drawNo;// 图样代号
protected TextArea mark; // 标记
protected TextArea poiNum; // 处数
protected TextArea overChange;// 更改前
protected TextArea overVersion;// 更改前版本
protected TextArea afterVersion;// 更改后版本
protected TextArea afterChange;// 更改后
protected ComboBox<String> productSz = new ComboBox<String>();// 特性等级
protected ComboBox<String> changeReason = new ComboBox<String>();// 更改原因
protected ComboBox<String> wipTreat = new ComboBox<String>();// 在制品处理
private SimpleIntegerProperty num;
private TextArea drawNo;// 图样代号
private TextArea mark; // 标记
private TextArea poiNum; // 处数
private TextArea overChange;// 更改前
// private Button overChange = new Button("查看");// 更改前
private TextArea overVersion;// 更改前版本
private TextArea afterChange;// 更改后
private TextArea afterVersion;// 更改后版本
private ComboBox<String> productSz = new ComboBox<String>();// 特性等级
private ComboBox<String> changeReason = new ComboBox<String>();// 更改原因
private ComboBox<String> wipTreat = new ComboBox<String>();// 在制品处理
// private String overChangeTxt;
public ComboBox<String> getProductSz() {
return productSz;
@ -41,18 +44,23 @@ public class EcnBean {
overChange = new TextArea(); // ComboBoxTextArea
overChange.setPrefSize(200, 40);
overChange.setWrapText(true);
// overChange = new Button("查看");
// overChangeTxt = "";
overVersion = new TextArea(); // ComboBoxTextArea
overVersion.setPrefSize(200, 40);
afterChange = new TextArea(); // ComboBoxTextArea
afterChange.setPrefSize(200, 40);
afterChange.setWrapText(true);
afterVersion = new TextArea(); // ComboBoxTextArea
afterVersion.setPrefSize(200, 40);
wipTreat.getItems().addAll(wips);
productSz.getItems().addAll(products);
productSz.getSelectionModel().selectFirst();
// productSz.getSelectionModel().selectFirst();
changeReason.getItems().addAll(reasons);
}
@ -75,6 +83,10 @@ public class EcnBean {
overChange = new TextArea(); // ComboBoxTextArea
overChange.setPrefSize(200, 40);
overChange.setText(changeBefore);
overChange.setWrapText(true);
// overChange = new Button("查看");
// overChangeTxt = changeBefore;
overVersion = new TextArea(); // ComboBoxTextArea
overVersion.setPrefSize(200, 40);
@ -83,6 +95,7 @@ public class EcnBean {
afterChange = new TextArea(); // ComboBoxTextArea
afterChange.setPrefSize(200, 40);
afterChange.setText(changeAfter);
afterChange.setWrapText(true);
afterVersion = new TextArea(); // ComboBoxTextArea
afterVersion.setPrefSize(200, 40);
@ -97,6 +110,19 @@ public class EcnBean {
productSz.getSelectionModel().select(product);
}
protected void addActionListener(CreateEcnFrame frame) {
overChange.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
new EditTextDialog(frame, true, true, overChange).showDialog();
}
});
afterChange.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
new EditTextDialog(frame, false, true, afterChange).showDialog();
}
});
}
public Integer getNum() {
return num.get();
}
@ -137,6 +163,14 @@ public class EcnBean {
this.overChange = overChange;
}
// public String getOverChangeTxt() {
// return overChangeTxt;
// }
//
// public void setOverChangeTxt(String overChangeTxt) {
// this.overChangeTxt = overChangeTxt;
// }
public TextArea getOverVersion() {
return overVersion;
}

@ -0,0 +1,115 @@
package com.chint.plm.createEcn;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import com.teamcenter.rac.aif.AbstractAIFDialog;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
/**
* :
* :2024-12-02
* @author
*
*
* 2024-12-02
*/
public class EditTextDialog extends AbstractAIFDialog {
/**
*
*/
private static final long serialVersionUID = 1L;
private JTextArea textArea;
private JButton okBtn;
private JButton cancelBtn;
private String value;
private TextArea changeArea;
public EditTextDialog(CreateEcnFrame parent, TableView<EcnBean> refTable, int row, List<EcnBean> refTableBeans,
boolean before, boolean edit, String value) {
super(parent, true);
this.value = value;
initUI(before, edit);
}
public EditTextDialog(CreateEcnFrame parent, boolean before, boolean edit, String value) {
super(parent, true);
this.value = value;
initUI(before, edit);
}
public EditTextDialog(CreateEcnFrame parent, boolean before, boolean edit, TextArea area) {
super(parent, true);
this.changeArea = area;
initUI(before, edit);
}
private void initUI(boolean before, boolean edit) {
setTitle(before ? "更改前" : "更改后");
textArea = new JTextArea();
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
textArea.setEditable(edit);
if(value != null)
textArea.setText(value);
else if(changeArea != null)
textArea.setText(changeArea.getText());
JPanel panel = new JPanel(new FlowLayout());
okBtn = new JButton("确定");
cancelBtn = new JButton("取消");
panel.add(okBtn);
panel.add(cancelBtn);
okBtn.setEnabled(edit);
addActionListener();
this.setLayout(new BorderLayout());
this.add(BorderLayout.CENTER, new JScrollPane(textArea));
this.add(BorderLayout.SOUTH, panel);
this.setPreferredSize(new Dimension(800, 400));
Dimension screen = getToolkit().getScreenSize();
setLocation((screen.width - getSize().width) / 2, (screen.height - getSize().height) / 2);
setAlwaysOnTop(true);
this.setAlwaysOnTop(true);
}
public void run(){
showDialog();
}
private void addActionListener() {
//final Shell dialog = shell;
okBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
changeArea.setText(textArea.getText());
dispose();
}
});
cancelBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
dispose();
}
});
}
}

@ -1,25 +1,19 @@
package com.chint.plm.createEcn;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.FlowPane;
public class RefTableBean {
protected SimpleStringProperty depart;// ²¿ÃÅ
protected SimpleStringProperty message; // Ðж¯
protected CheckBox shYes = new CheckBox();// ÊÇ
protected CheckBox shNo = new CheckBox();// ·ñ
private SimpleStringProperty depart;// ²¿ÃÅ
private SimpleStringProperty message; // Ðж¯
private CheckBox shYes = new CheckBox();// ÊÇ
private CheckBox shNo = new CheckBox();// ·ñ
// protected TextField user = new TextField();// ÔðÈÎÈË
protected TextField compDate = new TextField();// ¸ü¸Äºó
protected Object userPane;
private TextField compDate = new TextField();// ¸ü¸Äºó
private Object userPane;
private TextField userText;
private Button userBtn;
private String userUUid; //¼Ç¼OA»Ø´«µÄÓû§UUID
@ -42,6 +36,9 @@ public class RefTableBean {
}
return userPane;
}
public TextField getUserText() {
return userText;
}
public String getUserVal() {
if (userPane instanceof SimpleStringProperty) {
SimpleStringProperty userProp = (SimpleStringProperty) userPane;
@ -51,6 +48,8 @@ public class RefTableBean {
return userText.getText();
}
public void setUserPane(String val) {
if(val == null)
return;
if (userPane instanceof SimpleStringProperty) {
SimpleStringProperty userProp = (SimpleStringProperty) userPane;
userProp.setValue(val);
@ -129,11 +128,10 @@ public class RefTableBean {
shNo.setSelected(true);
shYes.selectedProperty().addListener(new ChangeListener<Boolean>() {
/*shYes.selectedProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
// TODO Auto-generated method stub
// Auto-generated method stub
// System.out.println("oldValue"+oldValue);
if (newValue) {
shNo.setSelected(false);
@ -141,16 +139,15 @@ public class RefTableBean {
}
});
shNo.selectedProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
// TODO Auto-generated method stub
// Auto-generated method stub
// System.out.println("oldValue"+oldValue);
if (newValue) {
shYes.setSelected(false);
}
}
});
});*/
}
}

@ -1,7 +1,6 @@
package com.chint.plm.createEcn;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.connor.chint.sap2.util.BomToSapUtil;
import com.connor.chint.sap2.util.SqlUtil;
@ -55,7 +54,7 @@ public class RelateEcnBean {
SimpleStringProperty requestNo, SimpleStringProperty prodModel, SimpleStringProperty applicant,
SimpleStringProperty status, String link, CreateEcnController controller,
ResultSet read, String[] prefs, TableView<RelateEcnBean> tableView)
throws SQLException {
throws Exception {
super();
this.num = num;
this.contConde = contConde;
@ -67,13 +66,13 @@ public class RelateEcnBean {
// 变更单号
String applyNo = read.getString("APPLYNO");
// 七种责任人
String designPal = read.getString("DESIGNPRINCIPAL");
String techPal = read.getString("TECHPRINCIPAL");
String quantityPal = read.getString("QUALITYPRINCIPAL");
String producePal = read.getString("PRODUCEPRINCIPAL");
String purchasePal = read.getString("PURCHASEYPRINCIPAL");
String customPal = read.getString("CUSTOMNOTICEPRINCIPAL");// FINAPRICEPRINCIPAL
String finaPal = read.getString("FINAPRICEPRINCIPAL");
String designPal = getUser(read, "DESIGNPRINCIPAL");
String techPal = getUser(read, "TECHPRINCIPAL");
String quantityPal = getUser(read, "QUALITYPRINCIPAL");
String producePal = getUser(read, "PRODUCEPRINCIPAL");
String purchasePal = getUser(read, "PURCHASEYPRINCIPAL");
String customPal = getUser(read, "CUSTOMNOTICEPRINCIPAL");// FINAPRICEPRINCIPAL
String finaPal = getUser(read, "FINAPRICEPRINCIPAL");
String docuName = read.getString("DOCUNAME"); // 文件代号及名称
// String designFile = read.getString("DESIGNFILE");// 获取行动内容
linkBtn.setOnAction(e -> {
@ -175,5 +174,15 @@ public class RelateEcnBean {
public void setApplicant(SimpleStringProperty applicant) {
this.applicant = applicant;
}
/**
* :;
*
* @param read
* @param col
* @return
*/
private String getUser(ResultSet read, String col) throws Exception {
String val = read.getString(col);
return val == null ? val : val.replaceAll(":", ";");
}
}

@ -231,14 +231,13 @@ public class RelateEcnController {
if (!startText.isEmpty()) {
searchSqlBuff.append(" and to_date(APPLYDATE,'yyyy-mm-dd hh24:mi:ss') >= to_date('").append(startText)
.append("','yyyy-mm-dd') "); // to_date(?,'yyyy-mm-ddhh24:mi:ss')
System.out.println("startText==>" + startText);
}
String endText = endTime.getEditor().getText();
if (!endText.isEmpty()) {
searchSqlBuff.append(" and to_date(APPLYDATE,'yyyy-mm-dd hh24:mi:ss') <= to_date('").append(endText)
.append("','yyyy-mm-dd') "); // to_date(?,'yyyy-mm-ddhh24:mi:ss')
System.out.println("endText==>" + endText);
}
System.out.println("searchSqlBuff==>" + searchSqlBuff);
int num = 1;
ResultSet read = SqlUtil.read(searchSqlBuff.toString());
List<RelateEcnBean> ecnBeans = new ArrayList<>();
@ -247,7 +246,8 @@ public class RelateEcnController {
String contName = read.getString("CONTRACTNAME");
String requestNo = read.getString("APPLYNO");
String prodModel = read.getString("PRODUCTMODEL");
String applicant = read.getString("APPLYUSER");// STATUS
String applicant = read.getString("APPLYUSER").replaceAll(":", ";");// STATUS
System.out.println("applicant£º" + read.getString("APPLYUSER") + "==" + applicant);
String status = read.getString("STATUS");
String link = read.getString("APPLYLINK");
ecnBeans.add(new RelateEcnBean(new SimpleStringProperty(num + ""), new SimpleStringProperty(contConde),

@ -258,7 +258,9 @@ public class Util {
TCComponent[] ccbh = folders2[j].getRelatedComponents("contents");
for (int k = 0; k < ccbh.length; k++) {
if (ccbh[k].getType().equals("Part")) {
productModelList.add(ccbh[k].getProperty("object_name"));
String name = ccbh[k].getProperty("object_name");
if(!productModelList.contains(name))
productModelList.add(name);
}
}
}
@ -285,7 +287,8 @@ public class Util {
AIFComponentContext[] a1 = target.whereReferenced();// ¸ü¸Äµ¥Îļþ¼Ð
if (a1 == null || a1.length < 1) {
String zt2_ProductModel = target.getProperty("zt2_ProductModel");
productModelList.add(zt2_ProductModel);
if(!productModelList.contains(zt2_ProductModel))
productModelList.add(zt2_ProductModel);
return productModelList;
}
@ -293,7 +296,8 @@ public class Util {
try {
if (a2.length < 1 || !a2[0].getComponent().getProperty("object_name").contains("ÏîÄ¿¼à¿Ø")) {
String zt2_ProductModel = target.getProperty("zt2_ProductModel");
productModelList.add(zt2_ProductModel);
if(!productModelList.contains(zt2_ProductModel))
productModelList.add(zt2_ProductModel);
return productModelList;
}
} catch (Exception e) {
@ -317,7 +321,9 @@ public class Util {
TCComponent[] ccbh = folders2[j].getRelatedComponents("contents");
for (int k = 0; k < ccbh.length; k++) {
if (ccbh[k].getType().equals("Part")) {
productModelList.add(ccbh[k].getProperty("object_name"));
String name = ccbh[k].getProperty("object_name");
if(!productModelList.contains(name))
productModelList.add(name);
}
}
}
@ -484,4 +490,17 @@ public class Util {
* FileOutputStream(file.getAbsolutePath()); workBook.write(fos); fos.flush();
* fos.close(); fis.close(); }
*/
/**
*
*
* @param e
* @return
*/
public static String getStackTrace(Exception e) {
StringBuilder rError = new StringBuilder("" + e.toString());
for(StackTraceElement ste : e.getStackTrace()) {
rError.append("\n\tat " + ste.toString());
}
return rError.toString();
}
}

@ -1,6 +1,7 @@
package com.chint.plm.createKjBom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -21,6 +22,7 @@ import com.connor.chint.sap2.util.BomToSapUtil;
import com.connor.chint.sap2.util.ChintPreferenceUtil;
import com.connor.chint.sap2.util.KUtil;
import com.connor.chint.sap2.util.MyProgressBarCompent;
import com.connor.chint.sap2.util.SAPUtil;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
@ -43,6 +45,7 @@ import com.teamcenter.rac.kernel.TCComponentUser;
import com.teamcenter.rac.kernel.TCPreferenceService;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.kernel.TCTypeService;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData;
import com.teamcenter.services.rac.structuremanagement._2014_10.Structure.CloneStructureInputInfo;
import com.teamcenter.services.rac.structuremanagement._2014_10.Structure.CloneStructureResponse;
@ -94,7 +97,7 @@ public class KjController {
AIFComponentContext[] childFolders = xmzxFolder.getChildren();
TCComponentFolder bztFolder = null;
TCComponentFolder dcsjFolder = null;
for(AIFComponentContext context:childFolders) {
for(AIFComponentContext context : childFolders) {
InterfaceAIFComponent c = context.getComponent();
if(c instanceof TCComponentFolder) {
String cName = c.getProperty("object_name");
@ -117,7 +120,7 @@ public class KjController {
}
}
TCComponentItem dcsjItem = null;;
if(dcsjFolder!=null) {
if(dcsjFolder != null) {
AIFComponentContext[] children = dcsjFolder.getChildren();
for(AIFComponentContext cont : children) {
InterfaceAIFComponent component = cont.getComponent();
@ -127,7 +130,7 @@ public class KjController {
}
}
}
if(dcsjItem==null) {
if(dcsjItem == null) {
errBuff.append("当前项目中未创建物主材采购单,不允许创建框架BOM.\n");
flag = false;
}else {
@ -140,7 +143,7 @@ public class KjController {
errBuff.append("当前项目中主材采购单BOM视图版本未发布,不允许创建框架BOM.\n");flag = false;
}
}
if(tqqgdItem==null) {
if(tqqgdItem == null) {
errBuff.append("当前项目中未创建物料提前请购单,不允许创建框架BOM.\n");flag = false;
}else {
TCComponentItemRevision latestItemRevision = tqqgdItem.getLatestItemRevision();
@ -152,32 +155,37 @@ public class KjController {
errBuff.append("当前项目中物料提前请购单BOM视图版本未发布,不允许创建框架BOM.\n");flag = false;
}
}
OkHttpClient client = new OkHttpClient();
String preference = ChintPreferenceUtil.getPreference("CHINT_PIUrl", session);
Request request = new Request.Builder()
.url(preference+"/api/open/task/getTaskInfo/"+projectId)
.build();
Response response = client.newCall(request).execute();
String string = response.body().string();
System.out.println(string);
JSONObject parseObject = JSON.parseObject(string);
JSONArray datas = parseObject.getJSONArray("data");
idName.clear();
if(datas!=null) {
for(int t=0;t<datas.size();t++) {
JSONObject jsonObject = datas.getJSONObject(t);
String string2 = jsonObject.getString("userid");
if(string2!=null && !string2.equals("")) {
idName.put(jsonObject.getString("taskname"),string2);
try {
OkHttpClient client = new OkHttpClient();
String preference = ChintPreferenceUtil.getPreference("CHINT_PIUrl", session);
Request request = new Request.Builder()
.url(preference + "/api/open/task/getTaskInfo/" + projectId)
.build();
Response response = client.newCall(request).execute();
String string = response.body().string();
System.out.println(string);
JSONObject parseObject = JSON.parseObject(string);
JSONArray datas = parseObject.getJSONArray("data");
if(datas != null) {
for(int t = 0;t < datas.size(); t++) {
JSONObject jsonObject = datas.getJSONObject(t);
String string2 = jsonObject.getString("userid");
if(string2!=null && !string2.equals("")) {
idName.put(jsonObject.getString("taskname"),string2);
}
System.out.println(jsonObject.getString("taskname")+"====="+string2);
}
System.out.println(jsonObject.getString("taskname")+"====="+string2);
}
} catch (Exception e) {
// Auto-generated catch block
e.printStackTrace();
}
System.out.println(idName.toString());
System.out.println("idName==>" + idName.toString());
List<CBean> beanList = kjBean.cbeans;
// ZT2_Requisition
for(CBean bean:beanList) {
for(CBean bean : beanList) {
String piName = bean.piName;
String folderName = bean.folderName;
if(idName.containsKey(piName)) {
@ -194,7 +202,7 @@ public class KjController {
fMap.put(bean.cId, fodlers.get(folderName));
}
}
System.out.println(nameUser.toString());
System.out.println("nameUser==>" + nameUser.toString());
} catch (Exception e) {
// Auto-generated catch block
e.printStackTrace();
@ -253,10 +261,19 @@ public class KjController {
//遍历获取BOM新ID
List<TCComponentBOMLine> useLines = new ArrayList<TCComponentBOMLine>();
createId(kjBomLine, bomLineTreeNodeSOA, builder, ccomponentitemtype, findMap, useLines, 1);
System.out.println(kjIdMap.toString());
System.out.println("kjIdMap==>" + kjIdMap.toString());
System.out.println("builder==>" + builder.toString());
if(builder.length() > 0) {
// MessageBox.post(builder.toString(), "提示",2);
String[] msgs = builder.toString().split("");
builder.setLength(0);
for(int i = 0; i < msgs.length; i++) {
builder.append(msgs[i]).append("");
if(i % 4 == 3) {
builder.append("\n");
}
}
Object[] options = { "是", "否" };
comp.setVisible(false);
builder.append("是否要继续生成.");
@ -272,33 +289,41 @@ public class KjController {
//开始克隆BOM
cloneOrUpdate(session, kjBomLine, copyLines, useLines);
//添加到文件夹
System.out.println("oldkjIdMap==>" + oldkjIdMap.toString());
for(TCComponentItemRevision rev : oldkjIdMap.keySet()) {
TCComponentItem find = oldkjIdMap.get(rev);
String id = find.getProperty("item_id");
String[] split = id.split("-");
System.out.println("id==>" + id);
System.out.println("id1==>" + id);
if(fMap.containsKey(split[0])) {
TCComponentFolder tcComponentFolder = fMap.get(split[0]);
try {
tcComponentFolder.add("contents", find);
}catch(Exception e) {
if(!e.getMessage().contains("存在于目标文件夹中"))
e.printStackTrace();
}
}
}
System.out.println("nameUser==>"+nameUser.toString());
System.out.println("fMap==>"+nameUser.toString());
for(TCComponentItemRevision rev:kjIdMap.keySet()) {
System.out.println("nameUser==>" + nameUser.toString());
System.out.println("fMap==>" + fMap.toString());
for(TCComponentItemRevision rev : kjIdMap.keySet()) {
String id = kjIdMap.get(rev);
TCComponentItem find = ccomponentitemtype.findItems(id)[0];
TCComponentItem[] finds = ccomponentitemtype.findItems(id);
if(finds == null || finds.length == 0) {
System.out.println(id + "对象未找到");
continue;
}
TCComponentItem find = finds[0];
String[] split = id.split("-");
System.out.println("id==>"+split[0]);
System.out.println("id2==>" + split[0]);
if(fMap.containsKey(split[0])) {
TCComponentFolder tcComponentFolder = fMap.get(split[0]);
try {
tcComponentFolder.add("contents", find);
}catch(Exception e) {
if(!e.getMessage().contains("存在于目标文件夹中"))
e.printStackTrace();
}
}
if(nameUser.containsKey(split[0])) {
@ -325,12 +350,30 @@ public class KjController {
}
TCComponentBOMLine newTopline = window.setWindowTopLine(find, find.getLatestItemRevision(),null, null);
//如果存在已经有的框架BOM对象遍历BOM然后替换再进行下面操作
System.out.println(byqCCPFromProject.toString());
System.out.println("byqCCPFromProject==>" + byqCCPFromProject.toString());
if(byqCCPFromProject.size()>0) {
find.getLatestItemRevision().add("representation_for", byqCCPFromProject);
try {
find.getLatestItemRevision().add("representation_for", byqCCPFromProject);
}catch(Exception e) {
if(!e.getMessage().contains("存在于目标文件夹中"))
e.printStackTrace();
}
}
List<ClassProperty> propList = new ArrayList<ClassProperty>();
sendToClass(find.getUid(), "ICM230101", objectToJson(propList));
//TODO 读取CHINT_kjbomTemp_FL首选项根据组织、图纸母号找到对应的分类库 ICM230101
String groupId = SAPUtil.getGroupID();
String prefId = groupId + ":" + bean.kjbomId, classID = "";
String[] prefs = ChintPreferenceUtil.getPreferences("CHINT_kjbomTemp_FL", session);
for(String pref : prefs) {
if(!pref.startsWith(prefId))
continue;
classID = pref.substring(pref.indexOf("\\|") + 1);
}
System.out.println("prefId==>" + prefId + "\nclassID==>" + classID);
if(classID.isEmpty()) {
MessageBox.post(prefId + "未找到对应分类库", "提示", MessageBox.WARNING);
}else
sendToClass(find.getUid(), "ICM230101", objectToJson(propList));
List<TCComponentBOMLine> listBoms = BomToSapUtil.listBoms(newTopline);
//存放名称对应的BOM行
List<BomBean> bomBeans = new ArrayList<>();
@ -346,12 +389,14 @@ public class KjController {
TCComponentBOMLine qgdBomline = window2.setWindowTopLine(tqqgdItem, tqqgdItem.getLatestItemRevision(), null, null);
AIFComponentContext[] children = qgdBomline.getChildren();
//遍历物料提前请购单 根据备注添加BOM到对应位置
// lidy20240710创建框架BOM中功能中的从提前请购组件BOM中抓取成分搭建进生成的框架BOM
//需要将抓取的物料明细在复制后增加注释信息BOM行属性数据来源bl_occ_zt2_wlsource写入“提前请购单”
for(int i = 0; i < children.length; i++) {
TCComponentBOMLine wlLine = (TCComponentBOMLine) children[i].getComponent();
TCComponentItem item = wlLine.getItem();
if(item.getType().equals("ZT2_MainMat")) {
AIFComponentContext[] children2 = wlLine.getChildren();
for(AIFComponentContext c2:children2) {
for(AIFComponentContext c2 : children2) {
TCComponentBOMLine wlLine2 = (TCComponentBOMLine) c2.getComponent();
String object_name = wlLine2.getProperty("ZT2_Remark");
String objName = wlLine2.getItem().getProperty("object_name");
@ -359,18 +404,28 @@ public class KjController {
System.out.println(objName + "gg");
if(!object_name.equals("") && bomBeans.contains(new BomBean(object_name))) {
BomBean bomBean = bomBeans.get(bomBeans.indexOf(new BomBean(object_name)));
bomBean.bomLine.add(wlLine2, false);
if(checkSource(bomBean.bomLine, wlLine2))
continue;
bomBean.bomLine.add(wlLine2, false).setProperty("bl_occ_zt2_wlsource", "提前请购单");
bomBean.bomLine.save();
bomBean.bomLine.unlock();//unlock
}else if(object_name.equals("") && objName.contains("硅钢条料")) {
if(bomBeans.contains(new BomBean("硅钢片"))) {
BomBean bomBean = bomBeans.get(bomBeans.indexOf(new BomBean("硅钢片")));
bomBean.bomLine.add(wlLine2, false);
if(checkSource(bomBean.bomLine, wlLine2))
continue;
bomBean.bomLine.add(wlLine2, false).setProperty("bl_occ_zt2_wlsource", "提前请购单");
bomBean.bomLine.save();
bomBean.bomLine.unlock();//unlock
}
}else {
if(checkSource(newTopline, wlLine2))
continue;
TCComponentBOMLine add = newTopline.add(wlLine2, false);
add.setProperty("bl_occ_zt2_wlsource", "提前请购单");
System.out.println(add);
newTopline.save();
newTopline.unlock();//unlock
}
}
}else {
@ -379,19 +434,29 @@ public class KjController {
String objName = wlLine.getItem().getProperty("object_name");
if(!object_name.equals("") && bomBeans.contains(new BomBean(object_name))) {
BomBean bomBean = bomBeans.get(bomBeans.indexOf(new BomBean(object_name)));
bomBean.bomLine.add(wlLine, false);
if(checkSource(bomBean.bomLine, wlLine))
continue;
bomBean.bomLine.add(wlLine, false).setProperty("bl_occ_zt2_wlsource", "提前请购单");
bomBean.bomLine.save();
bomBean.bomLine.unlock();//unlock
}else if(object_name.equals("") && objName.equals("硅钢条料")) {
if(bomBeans.contains(new BomBean("硅钢片"))) {
BomBean bomBean = bomBeans.get(bomBeans.indexOf(new BomBean("硅钢片")));
bomBean.bomLine.add(wlLine, false);
if(checkSource(bomBean.bomLine, wlLine))
continue;
bomBean.bomLine.add(wlLine, false).setProperty("bl_occ_zt2_wlsource", "提前请购单");
bomBean.bomLine.save();
bomBean.bomLine.unlock();//unlock
}
}
else {
if(checkSource(newTopline, wlLine))
continue;
TCComponentBOMLine add = newTopline.add(wlLine, false);
add.setProperty("bl_occ_zt2_wlsource", "提前请购单");
System.out.println(add);
newTopline.save();
newTopline.unlock();//unlock
}
}
}
@ -410,14 +475,15 @@ public class KjController {
TCAccessControlService accessControlService = session.getTCAccessControlService();
TCComponentUser user = session.getUser();
accessControlService.grantPrivilege(dataset, user, new String[]{"WRITE","READ"});
KUtil.setByPass(false);
// KUtil.setByPass(false);
}
@SuppressWarnings("deprecation")
private void updateKjBom(Map<String, TCComponentItem> findMap, Map<String, ExpandPSData[]> bomLineTreeNodeSOA, String uid) throws Exception {
private void updateKjBom(Map<String, TCComponentItem> findMap, Map<String, ExpandPSData[]> bomLineTreeNodeSOA,
String uid) throws Exception {
// Auto-generated method stub
ExpandPSData[] expandPSDatas = bomLineTreeNodeSOA.get(uid);
for(ExpandPSData expandPSData:expandPSDatas) {
for(ExpandPSData expandPSData : expandPSDatas) {
TCComponentBOMLine bomLine = expandPSData.bomLine;
TCComponentItemRevision itemRevOfBOMLine = expandPSData.itemRevOfBOMLine;
String itemId = itemRevOfBOMLine.getProperty("item_id");
@ -429,9 +495,16 @@ public class KjController {
TCComponentItemRevision lastRev = tcItem.getLatestItemRevision();
bomLine.replace(tcItem, lastRev, null);
bomLine.save();
// bomLine.unlock();
bomLine.unlock();
}
TCComponent[] views = itemRevOfBOMLine.getRelatedComponents("view");
if(views.length > 0) {//lidy20241213 优化“BOM 模块接收的标记无效。”报错
views[0].lock();
bomLine.lock();
updateKjBom(findMap, bomLineTreeNodeSOA, bomLine.getUid());
bomLine.unlock();
views[0].unlock();
}
updateKjBom(findMap, bomLineTreeNodeSOA, bomLine.getUid());//ExpandPSData[] expandPSDatas2 = bomLineTreeNodeSOA.get(bomLine.getUid());
}
}
@SuppressWarnings("deprecation")
@ -529,21 +602,22 @@ public class KjController {
if(cRev.getType().contains("ZT2_Design3D")) {
String item_id = cRev.getProperty("item_id");
String replaceAll = item_id.replaceAll(kjBs, projectDh);
if(type == 0) {
/*if(type == 0) {
useLines.add(cLine);
oldkjIdMap.put(cRev, cLine.getItem());
createId(cLine, bomLineTreeNodeSOA, builder, ccomponentitemtype, findMap, useLines, 0);
}else {
TCComponentItem[] finds = ccomponentitemtype.findItems(replaceAll);
if(finds != null && finds.length > 0) {
builder.append("µ±Ç°IDÒѾ­´æÔÚ:").append(replaceAll).append("\n");
findMap.put(item_id, finds[0]);
useLines.add(cLine);
oldkjIdMap.put(cRev, finds[0]);
createId(cLine, bomLineTreeNodeSOA, builder, ccomponentitemtype, findMap, useLines, 0);
}else {
kjIdMap.put(cRev, replaceAll);
createId(cLine, bomLineTreeNodeSOA, builder, ccomponentitemtype, findMap, useLines, 1);
}
}*/
TCComponentItem[] finds = ccomponentitemtype.findItems(replaceAll);
if(finds != null && finds.length > 0) {
builder.append("当前ID已经存在:").append(replaceAll).append("");
findMap.put(item_id, finds[0]);
useLines.add(cLine);
oldkjIdMap.put(cRev, finds[0]);
createId(cLine, bomLineTreeNodeSOA, builder, ccomponentitemtype, findMap, useLines, 0);
}else {
kjIdMap.put(cRev, replaceAll);
createId(cLine, bomLineTreeNodeSOA, builder, ccomponentitemtype, findMap, useLines, 1);
}
}else {
copyLines.add(cLine);
@ -552,8 +626,10 @@ public class KjController {
}
//批量复制
private void cloneOrUpdate(TCSession session, TCComponentBOMLine puid,
private void cloneOrUpdate(TCSession session, TCComponentBOMLine parentLine,
List<TCComponentBOMLine> bomLines, List<TCComponentBOMLine> useLines) {
System.out.println("cloneOrUpdate==>" + bomLines);
System.out.println("useLines==>" + useLines);
com.teamcenter.services.rac.structuremanagement.StructureService service =
com.teamcenter.services.rac.structuremanagement.StructureService.getService(session);
// idMapAdd.clear();
@ -571,17 +647,23 @@ public class KjController {
projectInfo.assign = false;
projectInfo.validate = false;
infos[0].projects = projectInfo;
TCComponentRevisionRule revisionRule = puid.window().getRevisionRule();
TCComponentRevisionRule revisionRule = parentLine.window().getRevisionRule();
infos[0].revRule = revisionRule;
TCComponentItemRevision[] revs = new TCComponentItemRevision[] { puid.getItemRevision() };
TCComponentItemRevision[] revs = new TCComponentItemRevision[] { parentLine.getItemRevision() };
infos[0].topItemRevs = revs;
System.out.println("Save class Partial bomLine -- " + bomLines.size());
List<CloneStructureSaveAsIn> saveList = new ArrayList<CloneStructureSaveAsIn>();
for(TCComponentBOMLine subLine : bomLines) {
CloneStructureSaveAsIn dataMap = null;
// for(int i = 0; i < bomLines.size(); i++) {
// TCComponentBOMLine subLine = bomLines.get(i);
TCComponentItem item = subLine.getItem();
// String name = item.getProperty("object_name");
// if(name.equals("箱底焊装") || name.equals("箱沿焊装")) {//TODO
// continue;
// }
CloneStructureSaveAsIn dataMap = null;
if(item.getType().equals("ZT2_Design3D")) {
// subLine.replace
dataMap = getDataMap(subLine, 0, session);
@ -590,17 +672,17 @@ public class KjController {
}
saveList.add(dataMap);
}
for(TCComponentBOMLine subLine : useLines) {
CloneStructureSaveAsIn dataMap = getDataMap(subLine, 1, session);
saveList.add(dataMap);
}
// for(TCComponentBOMLine subLine : useLines) {
// CloneStructureSaveAsIn dataMap = getDataMap(subLine, 1, session);
// saveList.add(dataMap);
// }
com.teamcenter.services.rac.structuremanagement._2014_10.Structure.CloneStructureDefaultNaming naming =
new com.teamcenter.services.rac.structuremanagement._2014_10.Structure.CloneStructureDefaultNaming();
CloneStructureSaveAsIn[] array = saveList.toArray(new CloneStructureSaveAsIn[saveList.size()]);
infos[0].dataMap = array;
naming.autogen = true;
infos[0].defaultName = naming;
infos[0].topLines = new TCComponentBOMLine[] { puid };
infos[0].topLines = new TCComponentBOMLine[] { parentLine };
// TCComponentBOMLine.get
// puid.getr
} catch (Exception e1) {
@ -612,34 +694,34 @@ public class KjController {
// cloneStructureExpandOrUpdate.serviceData;
if (cloneStructure.serviceData.sizeOfPartialErrors() > 0) {
for (int i = 0; i < cloneStructure.serviceData.sizeOfPartialErrors(); i++) {
System.out.println("Save class Partial Error -- " + cloneStructure.serviceData
.getPartialError(i).getMessages()[0]);
System.out.println(i + "Save class Partial Error -- " + Arrays.toString(cloneStructure.serviceData
.getPartialError(i).getMessages()));
}
}
try {
System.out.println("Save class Partial Error -- " + cloneStructure.serviceData.sizeOfUpdatedObjects());
if(cloneStructure.serviceData.sizeOfUpdatedObjects()>0) {
TCComponent updatedObject = cloneStructure.serviceData.getUpdatedObject(0);
System.out.println(session.componentToString(updatedObject));
}
for(int i = 0; i < cloneStructure.serviceData.sizeOfCreatedObjects(); i++) {
TCComponent plainObject = cloneStructure.serviceData.getCreatedObject(i);
System.out.println(session.componentToString(plainObject));
}
for(int i = 0; i < cloneStructure.serviceData.sizeOfPlainObjects(); i++) {
TCComponent plainObject = cloneStructure.serviceData.getPlainObject(i);
System.out.println(session.componentToString(plainObject));
System.out.println(session.componentToString(updatedObject) + " >> " + updatedObject);
}
// for(int i = 0; i < cloneStructure.serviceData.sizeOfCreatedObjects(); i++) {
// TCComponent plainObject = cloneStructure.serviceData.getCreatedObject(i);
// System.out.println(session.componentToString(plainObject));
// }
// for(int i = 0; i < cloneStructure.serviceData.sizeOfPlainObjects(); i++) {
// TCComponent plainObject = cloneStructure.serviceData.getPlainObject(i);
// System.out.println(session.componentToString(plainObject));
// }
} catch (Exception e) {
// Auto-generated catch block
e.printStackTrace();
}
}
private CloneStructureSaveAsIn getDataMap(TCComponentBOMLine child, int type, TCSession session) throws Exception {
TCComponentItemRevision rev = child.getItemRevision();
com.teamcenter.services.rac.structuremanagement._2014_10.Structure.CloneStructureSaveAsIn dataMap =
new com.teamcenter.services.rac.structuremanagement._2014_10.Structure.CloneStructureSaveAsIn();
CloneStructureSaveAsIn dataMap = new CloneStructureSaveAsIn();
Map<String, String[]> newItemRevinfo = new HashMap<>();
dataMap.cloneOperationType = type;
// dataMap.newItemRevinfo =
@ -687,4 +769,21 @@ public class KjController {
dataMap.newItemRevinfo = newItemRevinfo;
return dataMap;
}
/**
* BOMBOMBOMBOMBOM
*
* @param parent
* @param target
* @return BOMtrue
* @throws Exception
*/
private boolean checkSource(TCComponentBOMLine parent, TCComponentBOMLine target) throws Exception {
String id = target.getProperty("bl_item_item_id");
for(AIFComponentContext c : parent.getChildren()) {
TCComponentBOMLine child = (TCComponentBOMLine) c.getComponent();
if(child.getProperty("bl_item_item_id").equals(id) && child.getProperty("bl_occ_zt2_wlsource").equals("提前请购单"))
return true;
}
return false;
}
}

@ -133,5 +133,21 @@ public class BOMDifCellEditor extends AbstractCellEditor implements TableCellEdi
return null;
}
/**
*
* @param index
* @param add truefalse
*/
public void changeRow(int index, boolean add) {
if(add) {
JComboBox<String> jcom = new JComboBox<String>();
JTextField jtf = new JTextField();
jcom_subclass.add(index, jcom);
jtf_subclass.add(index, jtf);
}else {
jcom_subclass.remove(index);
jtf_subclass.remove(index);
}
}
}

@ -41,6 +41,6 @@ public class BomCompareComd extends KCommand {
*/
public BomCompareComd(AbstractAIFApplication app, String commandId, String actionInfo) {
super(app, commandId, actionInfo);
this.setRunnable(new CreateBOMDifferenceDialog(app));
this.setRunnable(new CreateBOMDifferenceDialogWh(app));
}
}

@ -25,6 +25,8 @@ import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.TableModelEvent;
@ -35,25 +37,18 @@ 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;
@ -61,15 +56,17 @@ import com.teamcenter.rac.util.MessageBox;
* BOM
*
*/
public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
public class CreateBOMDifferenceDialogWh 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 };
"新物料描述", "新物料数量", "原因大类", "原因小类", "处理类型", "差异来源" };
public static final int[] HEADERWIDTH = new int[] { 50, 80, 120, 220, 120, 180, 80, 120, 180, 80, 100, 100, 100, 80 };
private AbstractAIFApplication app;
private TCSession session;
private JButton btn_add = new JButton("增加行");
private JButton btn_del = new JButton("删除行");
private final JButton btn_ok = new JButton("确定");
private final JButton btn_cel = new JButton("取消");
@ -89,8 +86,9 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
private Map<String, String> map_class = new HashMap<>(8); // 大类
private Map<String, String> map_subclass = new HashMap<>(64); // 小类
private BOMDifCellEditor cellEditor;
// 多选编辑
JPanel selectPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
private JPanel selectPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
private JComboBox<String> box_class = new JComboBox<String>();
private JComboBox<String> box_subClass = new JComboBox<String>();
private JComboBox<String> box_processType = new JComboBox<String>();
@ -99,7 +97,7 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
private String selectSubClassItemString = new String();
private String selectProcessTypeItemString = new String();
public CreateBOMDifferenceDialog(AbstractAIFApplication app) {
public CreateBOMDifferenceDialogWh(AbstractAIFApplication app) {
super(false);
this.app = app;
this.session = (TCSession) app.getSession();
@ -108,8 +106,8 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
private void initUI() {
this.setTitle("BOM差异表");
this.setLayout(new BorderLayout());
this.setPreferredSize(new Dimension(1400, 400));
this.setMinimumSize(new Dimension(1300, 300));
this.setPreferredSize(new Dimension(1400, 600));
this.setMinimumSize(new Dimension(1300, 500));
this.add(BorderLayout.NORTH, getSelectPanel());
this.add(BorderLayout.CENTER, getTablePanel());
this.add(BorderLayout.SOUTH, getButtonPanel());
@ -267,13 +265,15 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
@Override
public void run() {
try {
pb = new ProgressBar(CreateBOMDifferenceDialog.this, new Dimension(250, 50));
pb = new ProgressBar(CreateBOMDifferenceDialogWh.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));
//TODO
t_part.setValueAt("自动生成", i, HEADER.length - 1);
}
pb.disposeDialog();
} catch (Exception e) {
@ -306,11 +306,11 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
* P
*
* @param oldComponents
* @throws TCException
* @throws Exception
* @function
*/
private TCComponent[] getPMaterial(TCComponent[] oldComponents) throws TCException {
// TODO Auto-generated method stub
private TCComponent[] getPMaterial(TCComponent[] oldComponents) throws Exception {
// Auto-generated method stub
// Util.ZT_PROP_PBOM;
// 物料编码 - E和P物料
Map<String, PBomBean> pbomMap = new HashMap<>();
@ -370,10 +370,14 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
@Override
public boolean isCellEditable(int row, int column) {
// TODO Auto-generated method stub
if (column > 9) {
return true;
}
// Auto-generated method stub
if (column == 13) {
return false;
} else if (column > 9) {
return true;
} else if(column != 0 && getValueAt(row, 13).equals("手工增加")) {
return true;
}
return false;
}
};
@ -394,7 +398,7 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
Collections.sort(list, new Comparator<Entry<String, String>>() {
@Override
public int compare(Entry<String, String> o1, Entry<String, String> o2) {
// TODO Auto-generated method stub
// Auto-generated method stub
return o1.getValue().compareTo(o2.getValue());
}
@ -404,10 +408,9 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
jcm_reason.addItem(list.get(i).getKey());
box_class.addItem(list.get(i).getKey());
}
t_part.getColumnModel().getColumn(10).setCellEditor(new DefaultCellEditor(jcm_reason));
colModel.getColumn(10).setCellEditor(new DefaultCellEditor(jcm_reason));
t_part.getModel().addTableModelListener(new TableModelListener() {
@Override
public void tableChanged(TableModelEvent e) {
int col = e.getColumn();
@ -421,6 +424,13 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
}
}
});
//TODO 更改类别列为下拉框
Object[] values = map_indexs.keySet().toArray();
JComboBox<String> changeType = new JComboBox<String>();
changeType.addItem("");
for(Object s : values)
changeType.addItem(s.toString());
colModel.getColumn(1).setCellEditor(new DefaultCellEditor(changeType));
System.out.println("processType:" + processType);
if (processType.size() > 0) {
@ -434,40 +444,136 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
}
Collections.sort(list2);
JComboBox<String> jcom_Type = new JComboBox<String>(list2.toArray(new String[size]));
t_part.getColumnModel().getColumn(12).setCellEditor(new DefaultCellEditor(jcom_Type));
colModel.getColumn(12).setCellEditor(new DefaultCellEditor(jcom_Type));
for (String processType : list2) {
box_processType.addItem(processType);
}
}
for(int i = 0; i < t_part.getColumnCount(); i++) {
if(i == 2 || i == 4 || i == 7) {
//输入父件物料编码、旧物料编码、新物料编码后,物料描述通过查询自动填写
TableCellEditor descEditor = new DefaultCellEditor(new JTextField());
descEditor.addCellEditorListener(new CellEditorListener() {
public void editingStopped(ChangeEvent e) {
// 编辑完成后的操作
try {
int row = t_part.getSelectedRow(), col = t_part.getSelectedColumn();
String val = "" + ((TableCellEditor)e.getSource()).getCellEditorValue();
System.out.println("编辑完成: " + row + "," + col + "==" + val);
HashMap<String, String> fields = new HashMap<>();
fields.put("materialno", val);
AIFComponentContext[] parts = KUtil.query(session, "chint_query_material", fields).toArray();
if(parts.length == 0)
return;
TCComponentItemRevision part = (TCComponentItemRevision) parts[0].getComponent();
t_part.setValueAt(part.getProperty("object_desc"), row, col + 1);
}catch(Exception e1) {
e1.printStackTrace();
MessageBox.post(CreateBOMDifferenceDialogWh.this, "错误:" + e1, "警告", MessageBox.ERROR);
}
}
public void editingCanceled(ChangeEvent e) {
// 编辑取消后的操作
System.out.println("编辑取消: " + t_part.getSelectedRow() + "," + t_part.getSelectedColumn() + "==" + ((TableCellEditor)e.getSource()).getCellEditorValue());
}
});
colModel.getColumn(i).setCellEditor(descEditor);
}else if(i == 6 || i == 9) {
TableCellEditor descEditor = new DefaultCellEditor(new JTextField());
descEditor.addCellEditorListener(new CellEditorListener() {
public void editingStopped(ChangeEvent e) {
// 编辑完成后的操作
int row = t_part.getSelectedRow(), col = t_part.getSelectedColumn();
TableCellEditor editor = ((TableCellEditor)e.getSource());
try {
String val = "" + editor.getCellEditorValue();
System.out.println("编辑完成: " + row + "," + col + "==" + val);
Double.parseDouble("" + val);
if(val.contains("d") || val.contains("D")) {
MessageBox.post(CreateBOMDifferenceDialogWh.this, "物料数量填写不符合要求", "错误", MessageBox.ERROR);
// t_part.setValueAt(e.toString(), row, col);
}
} catch (NumberFormatException e1) {
MessageBox.post(CreateBOMDifferenceDialogWh.this, "物料数量填写不符合要求", "错误", MessageBox.ERROR);
// t_part.setValueAt(e.toString(), row, col);
}
}
public void editingCanceled(ChangeEvent e) {
// 编辑取消后的操作
System.out.println("编辑取消: " + t_part.getSelectedRow() + "," + t_part.getSelectedColumn() + "==" + ((TableCellEditor)e.getSource()).getCellEditorValue());
}
});
colModel.getColumn(i).setCellEditor(descEditor);
}else if(i != 1 && i != 10 && i != 11 && i != 12) {
colModel.getColumn(i).setCellEditor(new DefaultCellEditor(new JTextField()));
}
}
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 JPanel getButtonPanel() {
JPanel south = new JPanel(new BorderLayout());
JPanel panel = new JPanel(new FlowLayout());
panel.add(btn_add);
panel.add(btn_del);
panel.add(btn_ok);
// for (int i = 0; i < 4; i++) {
// panel.add(new JLabel(" "));
// }
panel.add(btn_cel);
south.add(BorderLayout.WEST, new JLabel("<html>物料数量变更:只能是当前物料数量由**减少到**<br>物料新增:当前物料数量由**增加了**个 <br>物料删除物料从BOM中全部移除</html>"));
south.add(BorderLayout.CENTER, panel);
return south;
}
private void addListener() {
//TODO
btn_add.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int[] rows = t_part.getSelectedRows();
if(rows.length == 0) {
tm_part.addRow(new Object[] { 0, "", "", "", "", "", "", "", "", "", "", "", "", "手工增加" });
cellEditor.changeRow(t_part.getRowCount() - 1, true);
}else {
int row = rows[rows.length - 1] + 1;
tm_part.insertRow(row, new Object[] { 0, "", "", "", "", "", "", "", "", "", "", "", "", "手工增加" });
cellEditor.changeRow(row, true);
}
refrashNo(t_part);
}
});
btn_del.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int[] rows = t_part.getSelectedRows();
if(rows.length == 0) {
MessageBox.post("请选择要删除的行", "", MessageBox.WARNING);
return;
}
for(int i = rows.length - 1; i >= 0; i--) {
if(!t_part.getValueAt(rows[i], 13).equals("手工增加"))
continue;
tm_part.removeRow(rows[i]);
cellEditor.changeRow(rows[i], false);
}
refrashNo(t_part);
}
});
btn_cel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
// Auto-generated method stub
disposeDialog();
}
});
// 点击OK 则将界面显示数据写入zt2_BOMEC,并挂载到更改通知单对象下
btn_ok.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new Thread(new Runnable() {
@ -477,6 +583,32 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
KUtil.stopTableEditing(t_part);
// 组织数据
try {
//删除空行
int last = HEADER.length - 1;
for(int i = t_part.getRowCount() - 1; i >= 0; i--) {
if(t_part.getValueAt(i, last).equals("自动生成"))
continue;
try {
if(!isEmpty(t_part.getValueAt(i, 4)))
Double.parseDouble("" + t_part.getValueAt(i, 6));
if(!isEmpty(t_part.getValueAt(i, 7)))
Double.parseDouble("" + t_part.getValueAt(i, 9));
} catch (NumberFormatException e) {
throw new Exception("物料数量填写不符合要求");
}
boolean del = true;
for(int j = 1; j < last; j++) {
if(!isEmpty(t_part.getValueAt(i, j))) {
del = false;
break;
}
}
if(del) {
tm_part.removeRow(i);
}
}
refrashNo(t_part);
createBOMEC(t_part.getRowCount());
btn_ok.setEnabled(false);
MessageBox.post("BOM差异表生成成功", "", 2);
@ -485,13 +617,11 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
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) {
@ -502,10 +632,8 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
}
});
box_class.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
// 使Table编辑失去焦点
TableCellEditor tableCellEditor = t_part.getCellEditor();
if (tableCellEditor != null) {
@ -523,7 +651,6 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
private void setSubClassBoxValue() {
if (selectClassItemString != "") {
field_subClass.setVisible(false);
box_subClass.setVisible(true);
box_subClass.removeAllItems();
@ -532,7 +659,6 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
for (String item : subClassMap.keySet()) {
box_subClass.addItem(item);
}
} else {
field_subClass.setVisible(true);
box_subClass.setVisible(false);
@ -551,7 +677,6 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
});
box_subClass.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
// 使Table编辑失去焦点
@ -567,7 +692,6 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
setTableSubClassCellValue();
selectSubClassItemString = null;
}
}
private void setTableSubClassCellValue() {
@ -575,11 +699,9 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
for (int index : selectRowsIndex) {
t_part.setValueAt(selectSubClassItemString, index, 11);
}
}
});
box_processType.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
// 使Table编辑失去焦点
@ -595,7 +717,6 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
setTableSubClassCellValue();
selectProcessTypeItemString = null;
}
}
private void setTableSubClassCellValue() {
@ -603,13 +724,13 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
for (int index : selectRowsIndex) {
t_part.setValueAt(selectProcessTypeItemString, index, 12);
}
}
});
}
public TCComponentForm createBOMEC(int rowCout) throws Exception {
@SuppressWarnings("deprecation")
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++) {
@ -625,7 +746,7 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
}
System.out.println("form uid:" + form.getUid());
List<String> list = new ArrayList<>(rowCout);
for (int i = 0; i < 13; i++) {
for (int i = 0; i < HEADER.length; 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) {
@ -704,5 +825,23 @@ public class CreateBOMDifferenceDialog extends AbstractAIFDialog {
//
// return revs;
// }
/**
*
*
* @param val
* @return
*/
private static boolean isEmpty(Object val) {
return val == null || ("" + val).isEmpty();
}
/**
*
*
*/
private static void refrashNo(JTable t_part) {
for(int i = 0; i < t_part.getRowCount(); i++) {
t_part.setValueAt(i + 1, i, 0);
}
}
}

@ -62,6 +62,8 @@ public class CreateBOMDifference_DYController {
for (TCComponent comp : oldComponents) {
if (comp instanceof TCComponentItemRevision) {
rev = (TCComponentItemRevision) comp;
if(rev.isTypeOf("ZT2_XNZJBRevision"))
continue;
item = rev.getItem();
bean = map_item_beans.get(item);
if (bean == null) {
@ -105,6 +107,8 @@ public class CreateBOMDifference_DYController {
for (TCComponent comp : newComponents) {
if (comp instanceof TCComponentItemRevision) {
rev = (TCComponentItemRevision) comp;
if(rev.isTypeOf("ZT2_XNZJBRevision"))
continue;
item = rev.getItem();
bean = map_item_beans.get(item);
if (bean == null) {

@ -147,6 +147,8 @@ public class MySceneController extends KFXPanelController {
private String findLovString = "SELECT result FROM CHINT_CHECK_LOV_TEMPLATE where lovcode = ? ORDER BY code asc";
private String addMsgString = "INSERT INTO CHINT_CHECK_DETAILS (no,imcheckproject,ipcheckdetials,designresult,proofreadresult,design,proofread,"
+ "\"AUDIT\",checkno,modelversion,numberofchecks) VALUES (?,?,?,?,?,?,?,?,?,?,1)";
private String addMsgString1 = "INSERT INTO CHINT_CHECK_DETAILS (no,imcheckproject,ipcheckdetials,designresult,proofreadresult,design,proofread,"
+ "\"AUDIT\",checkno,modelversion,numberofchecks) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
private String oldMsgString = "SELECT no,designresult,PROOFREADRESULT,design,proofread,\"AUDIT\" FROM CHINT_CHECK_DETAILS where checkno = ? and modelversion = ? and numberofchecks = ? ORDER BY no asc ";
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"
@ -260,7 +262,20 @@ public class MySceneController extends KFXPanelController {
shType = "2";
}
if(isFirst) {
SqlUtil.write(addMsgString, new String[] {String.valueOf(i),zdjc,zdhc,valYqz,valSjz,sjType,jdType,shType,code,version});
//update
String text = cb_jccs.getValue();
//20240805 增加非第一次检查次数逻辑
if(text != null && !text.isEmpty()) {
String substring = text.substring(1, 2);
System.out.println("text==="+substring);
SqlUtil.write(addMsgString1, new String[] {String.valueOf(i),zdjc,zdhc,valYqz,valSjz,sjType,jdType,shType,code,version,substring});
}else {
SqlUtil.write(addMsgString, new String[] {String.valueOf(i),zdjc,zdhc,valYqz,valSjz,sjType,jdType,shType,code,version});
}
}else {
//update
String text = cb_jccs.getValue();
@ -394,13 +409,15 @@ public class MySceneController extends KFXPanelController {
if(sjz instanceof ComboBox) {
ComboBox<String> box = (ComboBox<String>)sjz;
valSjz = box.getEditor().getText();
System.out.println("ComboBox:" + valSjz);
}else if(sjz instanceof TextArea){
TextArea area = (TextArea)sjz;
valSjz = area.getText();
System.out.println("TextArea:" + valSjz);
}else {
valSjz = "NA";
}
if(valSjz.isEmpty()) {
if(valSjz == null || valSjz.isEmpty()) {
flag = true;
// break;
cbff.append("µÚ").append(i+1).append("ÐÐ");
@ -1257,6 +1274,7 @@ public class MySceneController extends KFXPanelController {
// String testTh = "TestTh00001";
if(checkno!=null) {
ResultSet read2 = SqlUtil.read(oldMsgString, new String[] {checkno,version,String.valueOf(selectedIndex+1)});
System.out.println(checkno+"-"+version+"-"+String.valueOf(selectedIndex+1));
System.out.println("version==>"+version);
while(read2.next()) {
isFirst = false;

@ -793,7 +793,7 @@ public class KUtil {
for(AIFComponentContext context:ccpContexts) {
InterfaceAIFComponent component = context.getComponent();
String property = component.getProperty("object_name");
if(component instanceof TCComponentItem) {
if((component instanceof TCComponentItem) && !ccpRevList.contains(property)) {
ccpRevList.add(property);
}
}

@ -79,7 +79,7 @@ public class AssignProcess extends KCommand {
revPs.add(revP);
}
}
boolean find = true;
for (TCComponentItemRevision revP : revPs) {
if (revPs.size() > 1) {
// TCComponentItemRevision revP = (TCComponentItemRevision)whereUsed[i];
@ -88,11 +88,23 @@ public class AssignProcess extends KCommand {
continue;
}
}
find = false;
TCComponentItemRevision item = getTopZzItem(revP);
if (item != null) {
return item;
}
}
if(find) {
//lidy20240605如果选中的物料通过使用找到多个物料且都没有P那么找一个最新的物料版本向上找P即可
for (TCComponentItemRevision revP : revPs) {
if(revP != revP.getItem().getLatestItemRevision())
continue;
TCComponentItemRevision item = getTopZzItem(revP);
if (item != null) {
return item;
}
}
}
}
} catch (Exception e) {
// Auto-generated catch block

@ -63,30 +63,50 @@ public class BomDcSapOp extends AbstractAIFOperation {
List<TCComponentItem> itemList = new ArrayList<>();
List<TCComponentItem> itemPList = new ArrayList<>();
String id = "1ZDB300000P-";
if(rev2.getType().equals("Part Revision")) {
String desc = rev2.getStringProperty("object_desc");
String[] split = desc.split(" ");
if(split.length>=2) {
String[] split2 = split[1].split("-");
if(split2.length==2) {
id = id + split2[1];
}else if(split2.length==3) {
id = id + split2[2];
//lidy20250423 1ZDB300000P-
String[] ids = session.getPreferenceService().getStringValues("CHINT_FindDrawing");
String id = "", idl = "";
if (rev2.getType().equals("Part Revision")) {
String desc = rev2.getStringProperty("object_desc");
String[] split = desc.split(" ");
if (split.length >= 2) {
String[] split2 = split[1].split("-");
if (split2.length == 2) {
idl = split2[1];
} else if (split2.length == 3) {
idl = split2[2];
}
}
} else if (rev2.getType().equals("ZT2_Design3DRevision")) {
String desc = rev2.getStringProperty("item_id");
String[] split2 = desc.split("-");
if (split2.length == 2) {
idl = split2[1];
} else if (split2.length == 3) {
idl = split2[2];
}
String id4 = desc.substring(0, 4);
for(String s : ids) {
if(s.substring(0, 4).equalsIgnoreCase(id4)) {
id = s + idl;
break;
}
}
}else if(rev2.getType().equals("ZT2_Design3DRevision")) {
String desc = rev2.getStringProperty("item_id");
String[] split2 = desc.split("-");
if(split2.length==2) {
id = id + split2[1];
}else if(split2.length==3) {
id = id + split2[2];
}
TCComponentItem[] find = null;
if(id.isEmpty()) {
for(String s : ids) {
id = s + idl;
find = ccomponentitemtype.findItems(id);
if(find != null && find.length > 0)
break;
}
}else {
find = ccomponentitemtype.findItems(id);
}
System.out.print("id===>"+id);
TCComponentItem find = ccomponentitemtype.findItems(id)[0];
TCComponentItemRevision zztRev = find.getLatestItemRevision();
System.out.print("id===>" + id);
// TCComponentItem find = ccomponentitemtype.findItems(id)[0];
TCComponentItemRevision zztRev = find[0].getLatestItemRevision();
TCComponent[] matnrs = zztRev.getRelatedComponents("representation_for");
for(TCComponent matnr:matnrs) {
String[] properties = matnr.getProperties(new String[]{"zt2_ifpbom"});

@ -65,30 +65,50 @@ public class BomSapWhBjOp extends AbstractAIFOperation {
List<TCComponentItem> itemList = new ArrayList<>();
List<TCComponentItem> itemPList = new ArrayList<>();
String id = "1ZDB300000P-";
//lidy20250423 1ZDB300000P-
String[] ids = session.getPreferenceService().getStringValues("CHINT_FindDrawing");
String id = "", idl = "";
if (rev2.getType().equals("Part Revision")) {
String desc = rev2.getStringProperty("object_desc");
String[] split = desc.split(" ");
if (split.length >= 2) {
String[] split2 = split[1].split("-");
if (split2.length == 2) {
id = id + split2[1];
idl = split2[1];
} else if (split2.length == 3) {
id = id + split2[2];
idl = split2[2];
}
}
} else if (rev2.getType().equals("ZT2_Design3DRevision")) {
String desc = rev2.getStringProperty("item_id");
String[] split2 = desc.split("-");
if (split2.length == 2) {
id = id + split2[1];
idl = split2[1];
} else if (split2.length == 3) {
id = id + split2[2];
idl = split2[2];
}
String id4 = desc.substring(0, 4);
for(String s : ids) {
if(s.substring(0, 4).equalsIgnoreCase(id4)) {
id = s + idl;
break;
}
}
}
TCComponentItem[] find = null;
if(id.isEmpty()) {
for(String s : ids) {
id = s + idl;
find = ccomponentitemtype.findItems(id);
if(find != null && find.length > 0)
break;
}
}else {
find = ccomponentitemtype.findItems(id);
}
System.out.print("id===>" + id);
TCComponentItem find = ccomponentitemtype.findItems(id)[0];
TCComponentItemRevision zztRev = find.getLatestItemRevision();
// TCComponentItem find = ccomponentitemtype.findItems(id)[0];
TCComponentItemRevision zztRev = find[0].getLatestItemRevision();
TCComponent[] matnrs = zztRev.getRelatedComponents("representation_for");
for (TCComponent matnr : matnrs) {
String[] properties = matnr.getProperties(new String[] { "zt2_ifpbom" });

@ -22,7 +22,7 @@ import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import com.alibaba.fastjson2.JSONArray;
//import com.alibaba.fastjson2.JSONArray;
//import com.connor.chint.sap2.sap.SAPPushBOMBean;
//import com.connor.chint.sap2.sap_by.SAPBYOperation;
//import com.connor.chint.sap2.sap_zy.PartBean;
@ -41,6 +41,7 @@ import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
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.ListOfValuesInfo;
import com.teamcenter.rac.kernel.TCComponent;
@ -512,27 +513,42 @@ public class BomSendSapController {
String dataTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
String zt2_WBSNo = project.getStringProperty("zt2_WBSNo");
String object_name = project.getStringProperty("object_name");
String code = BomUtilWh.getCode().toString();
List<PartBean> selectedParts = getSelectedParts();
JSONArray array = new JSONArray();
StringBuilder uids = new StringBuilder("");
// JSONArray array = new JSONArray();
// StringBuilder uids = new StringBuilder("");
HashMap<String, StringBuilder> uids = new HashMap<>();
for (int i = 0; i < selectedParts.size(); i++) {
String uid = selectedParts.get(i).getPart().getUid();
array.add(uid);
uids.append(uid).append(":");
//lidy20240528图纸不同的零件使用不同的批次号写入数据库
TCComponentItemRevision part = selectedParts.get(i).getPart();
AIFComponentContext[] designs = BomToSapUtil.getPseudoFolder(part, "TC_Is_Represented_By").getChildren();
String uid = part.getUid();
// array.add(uid);
//uids.append(uid).append(":");
if(designs == null || designs.length == 0) {
uids.put("" + i, new StringBuilder(uid));
}else {
String design = ((TCComponentItemRevision)designs[0].getComponent()).getItem().getLatestItemRevision().getUid();
if(uids.containsKey(design))
uids.get(design).append(":").append(uid);
else
uids.put(design, new StringBuilder(uid));
}
}
for(StringBuilder uid : uids.values()) {
String code = BomUtilWh.getCode().toString();
// obj.put("uid", array);
// OkHttpClient client = new OkHttpClient();
String substring = uids.substring(0, uids.length() - 1);
// 新增字段 项目UID执行人改成定时执行不调用接口
String serverHostname = session.getServerHostname();
System.out.println("serverHostname===>" + serverHostname);
String sql = "insert into CHINT_BOM_TO_SAP_SUM (code,factory,\"USER\",starttime,wbsno,projectno,taskstauts"
+ ",plmresult,transfer,keymsg,sapresult,PROJECTUID,SERVERHOST,USERID) values "
+ "(?,?,?,to_date(?,'yyyy-mm-ddhh24:mi:ss')" + ",?,?,'等待组织','未处理',?,?,'未返回',?,?,?)"; // to_date(?,'yyyy-mm-ddhh24:mi:ss')
SqlUtil.write(sql, new String[] { code + "", "M060", userName, dataTime, zt2_WBSNo, object_name,
"产成品", substring, project.getUid(), serverHostname, userId });
// String substring = uids.substring(0, uids.length() - 1);
// 新增字段 项目UID执行人改成定时执行不调用接口
String serverHostname = session.getServerHostname();
System.out.println("serverHostname===>" + serverHostname);
String sql = "insert into CHINT_BOM_TO_SAP_SUM (code,factory,\"USER\",starttime,wbsno,projectno,taskstauts"
+ ",plmresult,transfer,keymsg,sapresult,PROJECTUID,SERVERHOST,USERID) values "
+ "(?,?,?,to_date(?,'yyyy-mm-ddhh24:mi:ss')" + ",?,?,'等待组织','未处理',?,?,'未返回',?,?,?)"; // to_date(?,'yyyy-mm-ddhh24:mi:ss')
SqlUtil.write(sql, new String[] { code + "", "M060", userName, dataTime, zt2_WBSNo, object_name,
"产成品", uid.toString(), project.getUid(), serverHostname, userId });
}
MessageBox.post(dialog, "传递请求已记录,请等待飞书通知.", "", MessageBox.INFORMATION);
} catch (Exception e) {

@ -204,7 +204,7 @@ public class BomSendSapWhFram extends AbstractAIFDialog {
panel.add(b_qr);
panel.add(b_cel);
b_yb = new JButton("Òì²½´«µÝ");
// panel.add(b_yb);
panel.add(b_yb);
return panel;
}

@ -64,12 +64,35 @@ public class DbomToECommand extends KCommand {
String itemId = rev.getProperty("item_id");
String[] split = itemId.split("-");
if(split.length>=2) {
String topId = "1ZDB300000P-"+split[1];
// String topId = "1ZDB300000P-"+split[1];
String id4 = itemId.substring(0, 4);
//lidy20250423
String[] ids = session.getPreferenceService().getStringValues("CHINT_FindDrawing");
String topId = "";//"1ZDB300000P-" + split[1];
for(String s : ids) {
if(s.substring(0, 4).equalsIgnoreCase(id4)) {
topId = s + split[1];
break;
}
}
// TCComponentItemType itemType = (TCComponentItemType) session.getTypeComponent("ZT2_Design3D");
// TCComponentItem find = itemType.find(topId);
TCComponentItemType itemType = (TCComponentItemType) session.getTypeComponent("ZT2_Design3D");
TCComponentItem find = itemType.find(topId);
if(find!=null) {
TCComponentItem[] find = null;
if(topId.isEmpty()) {
for(String s : ids) {
topId = s + split[1];
find = itemType.findItems(topId);
if(find != null && find.length > 0)
break;
}
}else {
find = itemType.findItems(topId);
}
System.out.println("topId:" + topId);
if(find != null && find.length > 0) {
//boolean equals = find.getLatestItemRevision().getProperty("zt2_SapState").equals("已传");
boolean equals = find.getProperty("zt2_kjbomstate").equals("ÒÑ´«");
boolean equals = find[0].getProperty("zt2_kjbomstate").equals("ÒÑ´«");
if(!equals) {
MessageBox.post("请联系主设传递框架BOM.", "", MessageBox.ERROR);
return;

@ -5,6 +5,7 @@ import com.connor.chint.sap2.util.SAPMessageUtilFram;
import com.connor.chint.sap2.util.SAPUtil;
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;
@ -76,6 +77,14 @@ public class EbomToPCommand extends KCommand {
if(!call.toString().equals("succ")) {
new SAPMessageUtilFram("", "EBOM转PBOM存在异常物料,请检查:\n" + call.toString()).show();
}else {
//lidy20240716刷新图纸最新版本的物料伪文件夹
AIFComponentContext[] designs = rev.getChildren("TC_Is_Represented_By")[0].getComponent().getChildren();
if(designs.length > 0) {
TCComponentItemRevision design = ((TCComponentItemRevision) designs[0].getComponent()).getItem().getLatestItemRevision();
TCComponent folder = (TCComponent) design.getChildren("representation_for")[0].getComponent();
folder.refresh();
design.refresh();
}
MessageBox.post("EBOM转PBOM完成","提示",2);
}
} catch (Exception e) {

@ -0,0 +1,474 @@
package com.connor.chint.yunpi.command;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.Month;
import java.time.YearMonth;
import java.time.temporal.ChronoUnit;
import java.time.temporal.WeekFields;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.DateButton;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.util.PropertyLayout;
public class QueryZxjcFram extends JFrame implements ActionListener {
private TCSession session;
protected DefaultTableModel tm_part;
private static ArrayList<String> dateConnList = new ArrayList<String>();
private String[] prefs;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
private JTextField pathJTextField = new JTextField(30);
private JButton outputButton = new JButton("选择");
public QueryZxjcFram(TCSession session) {
// TODO Auto-generated constructor stub
this.session = session;
prefs = session.getPreferenceService().getStringValues("CHINT_SRM_SQL_CONNECT");
initUI();
}
// private String sqlString = "delete ML_CREATEORDERBOM where STATUS='2' and PRODUCTID=? and MATERIALNO=? "
// + "and OBJECTNAME=? and PRODPLANO=? and BATCHNO=?"
// + " and FACTORY=? and REPCODE=? and PRODORDERO=?";
private String sqlString = "";
private void initUI() {
// TODO Auto-generated method stub
try {
this.setTitle("WMS集成默认物料维护界面");
this.setLayout(new BorderLayout());
JPanel topPanel = getTopPanel();
// JScrollPane pane = getTablePanel();
// pane.setBorder(BorderFactory.createTitledBorder(""));
// JPanel btnPanel = getRightPanel();
JPanel btnPanel = getBtnPanel();
this.add(topPanel, BorderLayout.NORTH);
// this.add(pane,BorderLayout.CENTER);
this.add(btnPanel, BorderLayout.SOUTH);
this.setPreferredSize(new Dimension(550, 110));
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
int screenWidth = screenSize.width; // 获取屏幕宽度
int screenHeight = screenSize.height; // 获取屏幕高度
int x = (screenWidth - 550) / 2; // 计算Frame的左上角x坐标
int y = (screenHeight - 300) / 2; // 计算Frame的左上角y坐标
this.setLocation(x, y); // 设置Frame的位置
// this.setLocationRelativeTo(null);
this.createActionEvent();
this.pack();
// this.validate();
this.setVisible(true);
// this.setAlwaysOnTop(true);
} catch (Exception e) {
e.printStackTrace();
return;
}
}
// 添加监听
public void createActionEvent() {
this.btnOut.addActionListener(this);
this.btnIn.addActionListener(this);
}
private List<TCComponent> compList = new ArrayList<TCComponent>();
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
Object source = e.getSource();
System.out.println("source==>+" + source);
if (this.btnIn.equals(source)) {
//导入的逻辑
String pathJTextFieldStr = pathJTextField.getText();
if(pathJTextFieldStr == null || pathJTextFieldStr.isEmpty()) {
MessageBox.post("请选择需要导入的Excel。", "提示", 2);
return;
}
FileInputStream input = null;
try {
SqlUtil.SRMGetTCDataConnection(prefs);
String factory = "";
try {
factory = SAPUtil.getGroupID(session);
} catch (TCException e3) {
// TODO Auto-generated catch block
e3.printStackTrace();
}
if(!pathJTextFieldStr.contains(".xlsx")) {
MessageBox.post("请选择.xlsx格式的Excel。", "提示", 2);
return;
}
File file = new File(pathJTextFieldStr);
input = new FileInputStream(file);
Workbook workbook = new XSSFWorkbook(input);
Sheet sheet = workbook.getSheetAt(0);
for (Row row : sheet) {
System.out.println("row.getRowNum()=================="+row.getRowNum());
if(row.getRowNum() != 0) {
if(getCellValue(row.getCell(4)).isEmpty()) {
String insertSql = "INSERT INTO CHINT_WMS_DEFAULT_MATERIAL_RULE(FACTORY,OBJECTNAME,SPECIFICATIONS,QUANTITY,DRAWINGNO,UNIT,REMARK) VALUES('"+
getCellValue(row.getCell(0))+"','"+
getCellValue(row.getCell(1))+"','"+
getCellValue(row.getCell(2))+"','"+
getCellValue(row.getCell(3))+"','"+
getCellValue(row.getCell(4))+"','"+
getCellValue(row.getCell(5))+"','"+
getCellValue(row.getCell(6))+"')";
System.out.println("sql语句:" + insertSql.toString());
SqlUtil.update(insertSql);
}else {//有物料编码
String selectSql = "SELECT SEQ FROM CHINT_WMS_DEFAULT_MATERIAL_RULE WHERE DRAWINGNO='"+getCellValue(row.getCell(4))+
"' AND FACTORY='"+getCellValue(row.getCell(0))+"'";
ResultSet rs = SqlUtil.read(selectSql);
String seq = "";
while (rs.next()) {
seq = rs.getString(1);
}
if(seq.isEmpty()) {
String insertSql = "INSERT INTO CHINT_WMS_DEFAULT_MATERIAL_RULE(FACTORY,OBJECTNAME,SPECIFICATIONS,QUANTITY,DRAWINGNO,UNIT,REMARK) VALUES('"+
getCellValue(row.getCell(0))+"','"+
getCellValue(row.getCell(1))+"','"+
getCellValue(row.getCell(2))+"','"+
getCellValue(row.getCell(3))+"','"+
getCellValue(row.getCell(4))+"','"+
getCellValue(row.getCell(5))+"','"+
getCellValue(row.getCell(6))+"')";
System.out.println("sql语句:" + insertSql.toString());
SqlUtil.update(insertSql);
}else {
int cellType = row.getCell(5).getCellType();
int cellType1 = row.getCell(6).getCellType();
System.out.println("type5==============================="+cellType);
System.out.println("cellType1==============================="+cellType1);
String updateSql = "UPDATE CHINT_WMS_DEFAULT_MATERIAL_RULE SET FACTORY='"+getCellValue(row.getCell(0))+
"',OBJECTNAME='"+getCellValue(row.getCell(1))+
"',SPECIFICATIONS='"+getCellValue(row.getCell(2))+
"',QUANTITY='"+getCellValue(row.getCell(3))+
"',DRAWINGNO='"+getCellValue(row.getCell(4))+
"',UNIT='"+getCellValue(row.getCell(5))+
"',REMARK='"+getCellValue(row.getCell(6))+"' WHERE DRAWINGNO='"+getCellValue(row.getCell(4))+
"' AND FACTORY='"+getCellValue(row.getCell(0))+"'";
System.out.println("sql语句:" + updateSql.toString());
SqlUtil.update(updateSql);
}
}
}
}
} catch (IOException e2) {
e2.printStackTrace();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
MessageBox.post("导入失败请联系管理员!", "提示", 2);
}
MessageBox.post("导入成功!", "提示", 2);
} else if (source.equals(this.btnOut)) {
File model_file = null;
File output_file = null;
SqlUtil.SRMGetTCDataConnection(prefs);
String factory = "";
try {
factory = SAPUtil.getGroupID(session);
} catch (TCException e3) {
// TODO Auto-generated catch block
e3.printStackTrace();
}
sqlString = "SELECT * FROM CHINT_WMS_DEFAULT_MATERIAL_RULE WHERE FACTORY = '"+factory+"'";
// 1.根据条件查询数据
System.out.println("查询语句:" + sqlString.toString());
List<ZxjcMATERIALBean> lists = new ArrayList<ZxjcMATERIALBean>();
try{
ResultSet result = SqlUtil.read(sqlString.toString());
while (result.next()) {
ZxjcMATERIALBean ZxjcMATERIALBean = new ZxjcMATERIALBean(result.getInt(1),
result.getString(2), result.getString(3),result.getString(4) , result.getInt(5),
result.getString(6), result.getString(7),result.getString(8));
System.out.println(ZxjcMATERIALBean);
// 过滤有处理人的数据
lists.add(ZxjcMATERIALBean);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
if (lists.size() == 0) {
MessageBox.post("未查到数据,无法导出!", "提示", 2);
return;
} else {
// 导出数据的逻辑
InputStream input;
String targetPath = null;
try {
String[] CHINT_WMS_ModelUid = session.getPreferenceService()
.getStringValues("CHINT_WMS_ModelUid");
if (CHINT_WMS_ModelUid == null || CHINT_WMS_ModelUid.length == 0) {
MessageBox.post("首选项CHINT_WMS_ModelUid配置有误请检查。", "提示", 2);
return;
} else {
String pathJTextFieldStr = pathJTextField.getText();
if(pathJTextFieldStr == null || pathJTextFieldStr.isEmpty()) {
MessageBox.post("请选择需要导出的路径。", "提示", 2);
return;
}
TCComponentDataset excel = (TCComponentDataset) session
.stringToComponent(CHINT_WMS_ModelUid[0]);
model_file = ((TCComponentDataset) excel).getTcFiles()[0].getFmsFile();
String date = new SimpleDateFormat("yyyyMMddhhmmss").format(new Date());
String fileName = "WMS集成默认物料_" + date + ".xlsx";
// 定义源文件路径
Path sourcePath = Paths.get(model_file.getPath()); // 替换为你的源文件路径
// 定义目标文件路径
// targetPath = System.getProperty("user.home")+"\\Desktop"+"\\"+fileName;
targetPath = pathJTextFieldStr + "\\" + fileName;
// 使用Files.copy()方法复制文件
// Files.copy(sourcePath, targetPath);
// 设置可写
// makeFileWritable(System.getProperty("user.home")+"\\Desktop"+"\\"+fileName);
// output_file = new
// File(System.getProperty("user.home")+"\\Desktop"+"\\"+fileName);
}
input = new FileInputStream(model_file);
XSSFWorkbook wb = new XSSFWorkbook(input);// (
XSSFSheet sheet = wb.getSheetAt(0);
sheet.getSheetName();
for (int i = 0; i < lists.size(); i++) {
ZxjcMATERIALBean ZxjcMATERIALBean = lists.get(i);
int row = i + 1;
XSSFRow titleRow = sheet.getRow(row);
// setCellValue(titleRow, 0, i + 1 + "", sheet, row);
// 零件号合零件名称逻辑
if(titleRow == null) {
titleRow = sheet.createRow(row);
}
setCellValue(titleRow, 0, ZxjcMATERIALBean.getFACTORY());
setCellValue(titleRow, 1, ZxjcMATERIALBean.getOBJECTNAME());
setCellValue(titleRow, 2, ZxjcMATERIALBean.getSPECIFICATIONS());
setCellValue(titleRow, 3, ZxjcMATERIALBean.getQUANTITY()+"");
setCellValue(titleRow, 4, ZxjcMATERIALBean.getDRAWINGNO());
setCellValue(titleRow, 5, ZxjcMATERIALBean.getUNIT());
setCellValue(titleRow, 6, ZxjcMATERIALBean.getREMARK());
}
// 写入输出文件
try (FileOutputStream outputStream = new FileOutputStream(new File(targetPath))) {
wb.write(outputStream);
} catch (FileNotFoundException e1) {
System.err.println("目标文件未找到: " + targetPath);
e1.printStackTrace();
} catch (IOException e2) {
System.err.println("写入文件时发生错误: " + targetPath);
e2.printStackTrace();
}
this.dispose();
MessageBox.post("成功导出" + lists.size() + "条数据!", "提示", 2);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
/**
*
*
* @param filePath
*/
public static void makeFileWritable(String filePath) {
File file = new File(filePath);
if (!file.exists()) {
System.out.println("File does not exist.");
return;
}
try {
// 设置文件可写true 表示可写false 表示不可写null 表示使用系统默认值
boolean success = file.setWritable(true, false); // 第二个参数表示是否只改变文件所有者的权限
if (success) {
System.out.println("File permissions set to writable.");
} else {
System.out.println("Failed to set file as writable.");
}
} catch (SecurityException se) {
System.err.println("Security exception: " + se.getMessage());
}
}
public static void setCellValue(XSSFRow row, int colum, String str) {
// if (row == null) {
// // 处理空行的情况,比如插入一行或者给出提示
// row = sheet.createRow(rowNum);
// }
XSSFCell cell = row.getCell(colum);
if (cell == null) {
cell = row.createCell(colum);
}
cell.setCellValue(str);
}
private JButton btnOut;
private JButton btnIn;
private JPanel getBtnPanel() {
JPanel topPanel = new JPanel();
topPanel.setLayout(new PropertyLayout());
btnOut = new JButton("导出");
btnIn = new JButton("导入");
topPanel.add("1.1.center", new JLabel(""));
topPanel.add("2.1.center", new JLabel(""));
topPanel.add("2.3.center", new JLabel(""));
topPanel.add("2.5.center", new JLabel(""));
topPanel.add("2.2.center", btnIn);
topPanel.add("2.4.center", btnOut);
return topPanel;
}
// 查询部分
private JPanel getTopPanel() {
// TODO Auto-generated method stub
JPanel topPanel = new JPanel();
topPanel.setLayout(new PropertyLayout());
topPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
topPanel.add("1.1.left.center", new JLabel(""));
topPanel.add("2.1.left.center", new JLabel("文件存放位置:"));
topPanel.add("2.2.left.center", pathJTextField);
topPanel.add("2.3.left.center", outputButton);
// 注册输出按钮的点击事件监听器
outputButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// 创建文件选择器
JFileChooser fileChooser = new JFileChooser();
// 设置文件选择器只能选择文件夹
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
int result = fileChooser.showOpenDialog(topPanel);
if (result == JFileChooser.APPROVE_OPTION) {
// 获取用户选择的路径
String selectedPath = fileChooser.getSelectedFile().getPath();
// 输出用户选择的路径
System.out.println("用户选择的路径:" + selectedPath);
pathJTextField.setText(selectedPath);
}
}
});
return topPanel;
}
public String getCellValue(Cell cell) {
if(cell == null) {
return "";
}else {
int cellType = cell.getCellType();
if(cellType == 1) {//string
return cell.getStringCellValue();
}else if(cellType == 3 || cellType == 0) {//num
double numericCellValue = cell.getNumericCellValue();
System.out.println("================================numericCellValue===="+numericCellValue);
if(numericCellValue == 0.0) {
return ""; }
return cell.getNumericCellValue()+"";
}
}
return "";
}
}

@ -0,0 +1,30 @@
package com.connor.chint.yunpi.command;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
import com.connor.chint.yunpi.KCommand;
import com.teamcenter.rac.aif.AbstractAIFApplication;
public class QueryZxjcHandler extends KCommand {
public QueryZxjcHandler(AbstractAIFApplication app, String commandId, String actionInfo) {
super(app, commandId, actionInfo);
TCSession session = (TCSession) app.getSession();
try {
new QueryZxjcFram(session);
}catch(Exception e) {
e.printStackTrace();
}
}
}

@ -9,6 +9,8 @@ import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -42,8 +44,10 @@ import com.connor.chint.sap2.util.BomUtilWh;
import com.connor.chint.sap2.util.KUtil;
import com.connor.chint.sap2.util.MyProgressBarCompent;
import com.connor.chint.sap2.util.SAPMessageUtil;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil;
import com.connor.chint.sap2.util.TXTUtil;
import com.connor.plm.CostListManagement.pojo.GzxqBean;
import com.squareup.okhttp.Credentials;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient;
@ -78,9 +82,15 @@ import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData;
import cn.hutool.json.JSONArray;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
public class ZxjcController {
// 存在相同的物料 如果用j做序号不对
private int count = 1;//物料个数
public static final String TYPE_REV_PART = "Part Revision";
public TCComponent project; // 项目信息
public String groupName;
@ -381,8 +391,7 @@ public class ZxjcController {
System.out.println("tzBoms.size=====================" + tzBomsList.size());
// 根据图纸获取物料 排除重复物料
// 存在相同的物料 如果用j做序号不对
int count = 1;
// 获取流水号的首选项
String[] lsmPref = session.getPreferenceService().getStringValues("CHINT_MATERIAL_VIRTUAL_RULE");
@ -396,6 +405,19 @@ public class ZxjcController {
}
}
// 获取数据库物料的首选项
String[] sqlMaterialPref = session.getPreferenceService().getStringValues("CHINT_WMS_DEFAULT_MATERIAL_RULE");
String sqlMaterialStr = "";
for (int i = 0; i < sqlMaterialPref.length; i++) {
String[] split = lsmPref[i].split(":");
// 判断当前组织与首选项是否相同
if (split[0].equals(groupName)) {
sqlMaterialStr = split[1];
}
}
for (int i = 0; i < tzBomsList.size(); i++) {
TCComponentBOMLine tcComponentBOMLine = tzBomsList.get(i);
String tzType = tcComponentBOMLine.getStringProperty("fnd0bl_line_object_type");
@ -415,6 +437,23 @@ public class ZxjcController {
TCComponentItemRevision wlRev = (TCComponentItemRevision) tzItemRevision;
String zt2_MaterialNo = "";
zt2_MaterialNo = wlRev.getStringProperty("zt2_MaterialNo");
String zt2_Specifications = wlRev.getStringProperty("zt2_Specifications");
//2、物料型号规格取物料描述第一个空格后的数据
// String zt2_Specifications = "";
// String object_desc = wlRev.getStringProperty("object_desc");
// System.out.println("object_desc================================================"+object_desc);
//
// if(object_desc != null && !object_desc.isEmpty()) {
// // 查找第一个空格的位置
// int spaceIndex = object_desc.indexOf(' ');
//
// // 检查是否找到了空格
// if (spaceIndex != -1) {
// // 提取空格之后的字符串
// zt2_Specifications = object_desc.substring(spaceIndex + 1);
// }
// }
System.out.println("zt2_Specifications=================================================="+zt2_Specifications);
// 如果物料号为空,去数据库取
String object_name = wlRev.getStringProperty("object_name");
@ -427,7 +466,11 @@ public class ZxjcController {
String selectSql = "SELECT drawingno,objectname FROM CHINT_MATERIAL_VIRTUAL WHERE objectname = '"
+ object_name + "' AND factory = '" + groupName
+ "' ORDER BY SEQ DESC FETCH FIRST 1 ROW ONLY";
if(zt2_Specifications != null && !zt2_Specifications.isEmpty()) {
selectSql = "SELECT drawingno,objectname FROM CHINT_MATERIAL_VIRTUAL WHERE objectname = '"
+ object_name + "' AND factory = '" + groupName
+ "' AND SPECIFICATIONS = '"+ zt2_Specifications +"' ORDER BY SEQ DESC FETCH FIRST 1 ROW ONLY";
}
System.out.println("查询语句:" + selectSql.toString());
ResultSet rs = SqlUtil.read(selectSql.toString());
String newCount = "";// 新流水码
@ -498,8 +541,8 @@ public class ZxjcController {
String subLsh = lsh.substring(0, 3);
if (maxLsh.isEmpty() || !maxLsh.contains(subLsh)) {// 数据库中查到的与首选项不匹配 生成新的流水码
SqlUtil.SRMGetTCDataConnection(prefs);
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
zt2_MaterialNo = lsh;
} else {// 首选项字母与数据库相同
@ -529,8 +572,8 @@ public class ZxjcController {
// 流水码+1
SqlUtil.SRMGetTCDataConnection(prefs);
if (!newCount1.isEmpty()) {
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
}
zt2_MaterialNo = newCount1;
@ -557,8 +600,8 @@ public class ZxjcController {
if (maxLsh.isEmpty() || !maxLsh.contains(subLsh)) {// 数据库中查到的与首选项不匹配 生成新的流水码
SqlUtil.SRMGetTCDataConnection(prefs);
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
zt2_MaterialNo = lsh;
} else {// 首选项字母与数据库相同
@ -588,8 +631,8 @@ public class ZxjcController {
// 流水码+1
SqlUtil.SRMGetTCDataConnection(prefs);
if (!newCount1.isEmpty()) {
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
}
zt2_MaterialNo = newCount1;
@ -610,7 +653,6 @@ public class ZxjcController {
wlMap.get(object_name + zt2_MaterialNo).set(5, intQuantity + "");
} else {
// 获取物料属性
String zt2_Specifications = wlRev.getStringProperty("zt2_Specifications");
// 获取物料item单位
TCComponentItem item = wlRev.getItem();
@ -653,6 +695,24 @@ public class ZxjcController {
TCComponentItemRevision wlRev = (TCComponentItemRevision) wlRevs[j];
String zt2_MaterialNo = "";
zt2_MaterialNo = wlRev.getStringProperty("zt2_MaterialNo");
String object_desc = wlRev.getStringProperty("object_desc");
System.out.println("object_desc================================================"+object_desc);
//String zt2_Specifications = wlRev.getStringProperty("zt2_Specifications");
//2、物料型号规格取物料描述第一个空格后的数据
String zt2_Specifications = "";
//String object_desc = wlRev.getStringProperty("object_desc");
if(object_desc != null && !object_desc.isEmpty()) {
// 查找第一个空格的位置
int spaceIndex = object_desc.indexOf(' ');
// 检查是否找到了空格
if (spaceIndex != -1) {
// 提取空格之后的字符串
zt2_Specifications = object_desc.substring(spaceIndex + 1);
}
}
System.out.println("zt2_Specifications=================================================="+zt2_Specifications);
// 如果物料号为空,去数据库取
String object_name = wlRev.getStringProperty("object_name");
@ -666,6 +726,13 @@ public class ZxjcController {
+ object_name + "' AND factory = '" + groupName
+ "' ORDER BY SEQ DESC FETCH FIRST 1 ROW ONLY";
if(zt2_Specifications != null && !zt2_Specifications.isEmpty()) {
selectSql = "SELECT drawingno,objectname FROM CHINT_MATERIAL_VIRTUAL WHERE objectname = '"
+ object_name + "' AND factory = '" + groupName
+ "' AND SPECIFICATIONS = '"+ zt2_Specifications +"' ORDER BY SEQ DESC FETCH FIRST 1 ROW ONLY";
}
System.out.println("查询语句:" + selectSql.toString());
ResultSet rs = SqlUtil.read(selectSql.toString());
String newCount = "";// 新流水码
@ -736,8 +803,8 @@ public class ZxjcController {
String subLsh = lsh.substring(0, 3);
if (maxLsh.isEmpty() || !maxLsh.contains(subLsh)) {// 数据库中查到的与首选项不匹配 生成新的流水码
SqlUtil.SRMGetTCDataConnection(prefs);
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
zt2_MaterialNo = lsh;
} else {// 首选项字母与数据库相同
@ -767,8 +834,8 @@ public class ZxjcController {
// 流水码+1
SqlUtil.SRMGetTCDataConnection(prefs);
if (!newCount1.isEmpty()) {
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
}
zt2_MaterialNo = newCount1;
@ -795,8 +862,8 @@ public class ZxjcController {
if (maxLsh.isEmpty() || !maxLsh.contains(subLsh)) {// 数据库中查到的与首选项不匹配 生成新的流水码
SqlUtil.SRMGetTCDataConnection(prefs);
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
zt2_MaterialNo = lsh;
} else {// 首选项字母与数据库相同
@ -826,8 +893,8 @@ public class ZxjcController {
// 流水码+1
SqlUtil.SRMGetTCDataConnection(prefs);
if (!newCount1.isEmpty()) {
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
}
zt2_MaterialNo = newCount1;
@ -848,11 +915,11 @@ public class ZxjcController {
wlMap.get(object_name + zt2_MaterialNo).set(5, intQuantity + "");
} else {
// 获取物料属性
String object_desc = wlRev.getStringProperty("object_desc");
if (object_desc == null || object_desc.isEmpty()) {
object_desc = object_name;
}
String zt2_Specifications = wlRev.getStringProperty("zt2_Specifications");
// 获取物料item单位
TCComponentItem item = wlRev.getItem();
@ -869,7 +936,9 @@ public class ZxjcController {
// 把值存在list里存入map
List<String> fieldList = new ArrayList<String>();
fieldList.add(count + "");// 序号
fieldList.add(object_desc==null?"":object_desc);
//20240703 改
//fieldList.add(object_desc==null?"":object_desc);
fieldList.add(object_name==null?"":object_name);
fieldList.add(zt2_Specifications==null?"":zt2_Specifications);
fieldList.add(zt2_MaterialNo==null?"":zt2_MaterialNo);
fieldList.add(zt2_unit==null?"":zt2_unit);
@ -905,6 +974,29 @@ public class ZxjcController {
// 物料bomline获取rev
TCComponentItemRevision wlRev = tcComponentBOMLine.getItemRevision();
String zt2_MaterialNo = "";
String object_desc = wlRev.getStringProperty("object_desc");
System.out.println("object_desc================================================"+object_desc);
String zt2_Specifications = "";
//2、物料型号规格取物料描述第一个空格后的数据
//String object_desc = wlRev.getStringProperty("object_desc");
if(object_desc != null && !object_desc.isEmpty()) {
// 查找第一个空格的位置
int spaceIndex = object_desc.indexOf(' ');
// 检查是否找到了空格
if (spaceIndex != -1) {
// 提取空格之后的字符串
zt2_Specifications = object_desc.substring(spaceIndex + 1);
}
}
if(zt2_Specifications != null && zt2_Specifications.isEmpty()) {
zt2_Specifications = wlRev.getStringProperty("zt2_Specifications");
}
System.out.println("zt2_Specifications=================================================="+zt2_Specifications);
zt2_MaterialNo = wlRev.getStringProperty("zt2_MaterialNo");
// 是否查到流水码
boolean isCheck = false;
@ -920,7 +1012,11 @@ public class ZxjcController {
String selectSql = "SELECT drawingno,objectname FROM CHINT_MATERIAL_VIRTUAL WHERE objectname = '"
+ object_name + "' AND factory = '" + groupName
+ "' ORDER BY SEQ DESC FETCH FIRST 1 ROW ONLY";
if(zt2_Specifications != null && !zt2_Specifications.isEmpty()) {
selectSql = "SELECT drawingno,objectname FROM CHINT_MATERIAL_VIRTUAL WHERE objectname = '"
+ object_name + "' AND factory = '" + groupName
+ "' AND SPECIFICATIONS = '"+ zt2_Specifications +"' ORDER BY SEQ DESC FETCH FIRST 1 ROW ONLY";
}
System.out.println("查询语句:" + selectSql.toString());
ResultSet rs = SqlUtil.read(selectSql.toString());
String newCount = "";// 新流水码
@ -991,8 +1087,8 @@ public class ZxjcController {
String subLsh = lsh.substring(0, 3);
if (maxLsh.isEmpty() || !maxLsh.contains(subLsh)) {// 数据库中查到的与首选项不匹配 生成新的流水码
SqlUtil.SRMGetTCDataConnection(prefs);
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
zt2_MaterialNo = lsh;
} else {// 首选项字母与数据库相同
@ -1022,8 +1118,8 @@ public class ZxjcController {
// 流水码+1
SqlUtil.SRMGetTCDataConnection(prefs);
if (!newCount1.isEmpty()) {
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
}
zt2_MaterialNo = newCount1;
@ -1050,8 +1146,8 @@ public class ZxjcController {
if (maxLsh.isEmpty() || !maxLsh.contains(subLsh)) {// 数据库中查到的与首选项不匹配 生成新的流水码
SqlUtil.SRMGetTCDataConnection(prefs);
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + lsh +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
zt2_MaterialNo = lsh;
} else {// 首选项字母与数据库相同
@ -1081,8 +1177,8 @@ public class ZxjcController {
// 流水码+1
SqlUtil.SRMGetTCDataConnection(prefs);
if (!newCount1.isEmpty()) {
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 + "')";
String updateSql = "INSERT INTO CHINT_MATERIAL_VIRTUAL (factory,objectname,drawingno,SPECIFICATIONS) VALUES ('"
+ groupName + "','" + object_name + "','" + newCount1 +"','"+ zt2_Specifications + "')";
SqlUtil.update(updateSql);
}
zt2_MaterialNo = newCount1;
@ -1117,11 +1213,11 @@ public class ZxjcController {
wlMap.get(object_name + zt2_MaterialNo).set(5, intQuantity + "");
} else {
// 获取物料属性
String object_desc = wlRev.getStringProperty("object_desc");
if (object_desc == null || object_desc.isEmpty()) {
object_desc = object_name;
}
String zt2_Specifications = wlRev.getStringProperty("zt2_Specifications");
System.out.println("zt2_Specifications==="+zt2_Specifications+"zt2_MaterialNo===="+zt2_MaterialNo);
// 获取物料item单位
@ -1133,7 +1229,9 @@ public class ZxjcController {
// 把值存在list里存入map
List<String> fieldList = new ArrayList<String>();
fieldList.add(count + "");// 序号
fieldList.add(object_desc==null?"":object_desc);
//20240703 改
//fieldList.add(object_desc==null?"":object_desc);
fieldList.add(object_name==null?"":object_name);
fieldList.add(zt2_Specifications==null?"":zt2_Specifications);
fieldList.add(zt2_MaterialNo==null?"":zt2_MaterialNo);
fieldList.add(zt2_unit==null?"":zt2_unit);
@ -1156,6 +1254,9 @@ public class ZxjcController {
JSONArray ccpArray = new JSONArray();
// 获取产成品revs
List<List> ccp_revs = map.getValue();
//获取其中一个产成品名称
String ccpName = "";
for (int j = 0; j < ccp_revs.size(); j++) {
JSONObject ccp_temp_Json = new JSONObject();
TCComponentItemRevision ccp_rev = (TCComponentItemRevision) ccp_revs.get(j).get(0);
@ -1166,6 +1267,7 @@ public class ZxjcController {
// 手动填写属性
ccp_temp_Json.put("factoryno", ccp_revs.get(j).get(1));
ccpArray.put(ccp_temp_Json);
ccpName = ccp_rev.getStringProperty("object_name");
}
// 物料信息array
@ -1184,11 +1286,45 @@ public class ZxjcController {
wlArray.put(wl_temp_Json);
}
//首选项取到对应的产成品名称 是否匹配
boolean isDelivery = true;
if(sqlMaterialStr != null && !sqlMaterialStr.isEmpty()) {
String[] split = sqlMaterialStr.split(";");
for (int i = 0; i < split.length; i++) {
//产成品名称匹配首选项 ,匹配到就不传数据库里的物料
if(ccpName.contains(split[i])) {
isDelivery = false;
}
}
}
//去数据库查对应组织的物料
if(isDelivery) {
//连接数据库查询出对应组织物料
String sql = "SELECT * FROM CHINT_WMS_DEFAULT_MATERIAL_RULE WHERE FACTORY = '" + groupName + "'";
SqlUtil.SRMGetTCDataConnection(prefs);
System.out.println("查询语句:" + sql.toString());
ResultSet rs = SqlUtil.read(sql.toString());
while (rs.next()) {
JSONObject wl_temp_Json = new JSONObject();
wl_temp_Json.put("no", count+"");
wl_temp_Json.put("materialno", rs.getString("DRAWINGNO"));
wl_temp_Json.put("objectdesc", rs.getString("OBJECTNAME"));
wl_temp_Json.put("specifications", rs.getString("SPECIFICATIONS"));
wl_temp_Json.put("quantity", rs.getInt("QUANTITY"));
wl_temp_Json.put("unit", rs.getString("UNIT"));
wl_temp_Json.put("remark", rs.getString("REMARK"));
wlArray.put(wl_temp_Json);
count++;
}
}
top.put("projectname", project_object_name);
top.put("projectno", project_zt2_ProjectNo);
top.put("wbsno", project_zt2_WBSNo);
top.put("factory", groupName);
top.put("producttype", cpxhValue);
top.put("producttype", tzObjectName.contains("备件包")? "备品备件": cpxhValue);
//如果是备件包就不取id
top.put("drawingno", tzObjectName.contains("备件包")? "": tzId);
top.put("productnos", ccpArray);
@ -1196,7 +1332,8 @@ public class ZxjcController {
//
System.out.println("top========" + top.toString());
//组织完一次 count 清空
count = 1;
// 发送接口
String[] url = session.getPreferenceService().getStringValues("CHINT_ZXJC_URL");
String strUrl = url[0];

@ -0,0 +1,84 @@
package com.connor.chint.yunpi.command;
public class ZxjcMATERIALBean {
private int SEQ;
private String FACTORY;
private String OBJECTNAME;
private String SPECIFICATIONS;
private int QUANTITY;
private String DRAWINGNO;
private String UNIT;
private String REMARK;
public int getSEQ() {
return SEQ;
}
public void setSEQ(int sEQ) {
SEQ = sEQ;
}
public String getFACTORY() {
return FACTORY;
}
public void setFACTORY(String fACTORY) {
FACTORY = fACTORY;
}
public String getOBJECTNAME() {
return OBJECTNAME;
}
public void setOBJECTNAME(String oBJECTNAME) {
OBJECTNAME = oBJECTNAME;
}
public String getSPECIFICATIONS() {
return SPECIFICATIONS;
}
public void setSPECIFICATIONS(String sPECIFICATIONS) {
SPECIFICATIONS = sPECIFICATIONS;
}
public int getQUANTITY() {
return QUANTITY;
}
public void setQUANTITY(int qUANTITY) {
QUANTITY = qUANTITY;
}
public String getDRAWINGNO() {
return DRAWINGNO;
}
public void setDRAWINGNO(String dRAWINGNO) {
DRAWINGNO = dRAWINGNO;
}
public String getUNIT() {
return UNIT;
}
public void setUNIT(String uNIT) {
UNIT = uNIT;
}
public String getREMARK() {
return REMARK;
}
public void setREMARK(String rEMARK) {
REMARK = rEMARK;
}
public ZxjcMATERIALBean(int sEQ, String fACTORY, String oBJECTNAME, String sPECIFICATIONS, int qUANTITY,
String dRAWINGNO, String uNIT, String rEMARK) {
super();
SEQ = sEQ;
FACTORY = fACTORY;
OBJECTNAME = oBJECTNAME;
SPECIFICATIONS = sPECIFICATIONS;
QUANTITY = qUANTITY;
DRAWINGNO = dRAWINGNO;
UNIT = uNIT;
REMARK = rEMARK;
}
public ZxjcMATERIALBean() {
super();
}
@Override
public String toString() {
return "ZxjcMATERIALBean [SEQ=" + SEQ + ", FACTORY=" + FACTORY + ", OBJECTNAME=" + OBJECTNAME
+ ", SPECIFICATIONS=" + SPECIFICATIONS + ", QUANTITY=" + QUANTITY + ", DRAWINGNO=" + DRAWINGNO
+ ", UNIT=" + UNIT + ", REMARK=" + REMARK + "]";
}
}

@ -1,164 +1,495 @@
package com.connor.plm.CostListManagement.pojo;
/**
* ===============================================================================
* Copyright (c) 2012-2024 CONNOR lijh. Unpublished - All Rights Reserved
* ===============================================================================
* File description:
*
* GzxqBean.java bean
*
* ===============================================================================
* DATE Name Description of Change
*
* 2024-06-13 ljh create
* ===============================================================================
*/
import java.awt.Desktop;
import java.net.URI;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCComponentItemType;
import com.teamcenter.rac.kernel.TCSession;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
public class GzxqBean {
private String instanceId;
private String factory;
private String sfId;
private String head;
private String scheduledtime;
private String model;
private String productname;
private String toolnumber;
private String toolname;
private String toolinglevel;
private String reason;
private String jsgyrequirements;
private String link;
private String state;
public GzxqBean() {
super();
}
public String getInstanceId() {
return instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public String getFactory() {
return factory;
}
public void setFactory(String factory) {
this.factory = factory;
}
public String getSfId() {
return sfId;
}
public void setSfId(String sfId) {
this.sfId = sfId;
}
public String getHead() {
return head;
}
public void setHead(String head) {
this.head = head;
}
public String getScheduledtime() {
return scheduledtime;
}
public void setScheduledtime(String scheduledtime) {
this.scheduledtime = scheduledtime;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname;
}
public String getToolnumber() {
return toolnumber;
}
public void setToolnumber(String toolnumber) {
this.toolnumber = toolnumber;
}
public String getToolname() {
return toolname;
}
public void setToolname(String toolname) {
this.toolname = toolname;
}
public String getToolinglevel() {
return toolinglevel;
}
public void setToolinglevel(String toolinglevel) {
this.toolinglevel = toolinglevel;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getJsgyrequirements() {
return jsgyrequirements;
}
public void setJsgyrequirements(String jsgyrequirements) {
this.jsgyrequirements = jsgyrequirements;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public GzxqBean(String instanceId, String factory, String sfId, String head, String scheduledtime, String model,
String productname, String toolnumber, String toolname, String toolinglevel, String reason,
String jsgyrequirements, String link, String state) {
super();
this.instanceId = instanceId;
this.factory = factory;
this.sfId = sfId;
this.head = head;
this.scheduledtime = scheduledtime;
this.model = model;
this.productname = productname;
this.toolnumber = toolnumber;
this.toolname = toolname;
this.toolinglevel = toolinglevel;
this.reason = reason;
this.jsgyrequirements = jsgyrequirements;
this.link = link;
this.state = state;
}
@Override
public String toString() {
return "GzxqBean [instanceId=" + instanceId + ", factory=" + factory + ", sfId=" + sfId + ", head=" + head
+ ", scheduledtime=" + scheduledtime + ", model=" + model + ", productname=" + productname
+ ", toolnumber=" + toolnumber + ", toolname=" + toolname + ", toolinglevel=" + toolinglevel
+ ", reason=" + reason + ", jsgyrequirements=" + jsgyrequirements + ", link=" + link + ", state="
+ state + "]";
}
private TextArea instanceId = new TextArea();
private TextArea factory = new TextArea();
private TextArea sfId = new TextArea();
private TextArea head = new TextArea();
private TextArea scheduledtime = new TextArea();
private TextArea model = new TextArea();
private TextArea productname = new TextArea();
private TextArea toolnumber = new TextArea();
private TextArea toolname = new TextArea();
private TextArea toolinglevel = new TextArea();
private TextArea reason = new TextArea();
private TextArea jsgyrequirements = new TextArea();
private Button link = new Button();
private Button cjgzxq = new Button();
private String linkStr;
private String sfIdStr;
private String instanceIdStr;
private TCSession session;
private TextArea state = new TextArea();
private TextArea xh = new TextArea();
//设置TextArea的值和Button
public GzxqBean(String instanceId, String factory, String sfId, String head, String scheduledtime,
String model, String productname, String toolnumber, String toolname, String toolinglevel,
String reason, String jsgyrequirements, String link, String state, String xh,TCSession session) {
super();
this.instanceId.setText(instanceId);
this.instanceId.setEditable(false);
this.instanceId.setPrefSize(200, 40);
this.factory.setText(factory);
this.factory.setEditable(false);
this.factory.setPrefSize(200, 40);
this.sfId.setText(sfId);
this.sfId.setEditable(false);
this.sfId.setPrefSize(200, 40);
this.head.setText(head);
this.head.setEditable(false);
this.head.setPrefSize(200, 40);
this.scheduledtime.setText(scheduledtime);
this.scheduledtime.setEditable(false);
this.scheduledtime.setPrefSize(200, 40);
this.model.setText(model);
this.model.setEditable(false);
this.model.setPrefSize(200, 40);
this.productname.setText(productname);
this.productname.setEditable(false);
this.productname.setPrefSize(200, 40);
this.toolnumber.setText(toolnumber);
this.toolnumber.setEditable(false);
this.toolnumber.setPrefSize(200, 40);
this.toolname.setText(toolname);
this.toolname.setEditable(false);
this.toolname.setPrefSize(200, 40);
this.toolinglevel.setText(toolinglevel);
this.toolinglevel.setEditable(false);
this.toolinglevel.setPrefSize(200, 40);
this.reason.setText(reason);
this.reason.setEditable(false);
this.reason.setPrefSize(200, 40);
this.jsgyrequirements.setText(jsgyrequirements);
this.jsgyrequirements.setEditable(false);
this.jsgyrequirements.setPrefSize(200, 40);
this.cjgzxq.setText("设计");;
this.cjgzxq.setPrefSize(200, 40);
this.link.setText("打开");
this.link.setPrefSize(200, 40);
this.linkStr = link;
this.sfIdStr = sfId;
this.instanceIdStr = instanceId;
this.session = session;
this.state.setText(state);
this.state.setEditable(false);
this.state.setPrefSize(200, 40);
this.xh.setText(xh);
this.xh.setEditable(false);
this.xh.setPrefSize(200, 40);
//加按钮监听
this.link.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("Button was clicked!");
// 在这里可以添加更多的逻辑
try {
browse2(linkStr);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
//加按钮监听 创建对象
this.cjgzxq.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("Button was clicked!");
// 在这里可以添加更多的逻辑
String formnumber = instanceIdStr;
String sfid =sfIdStr;
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
InterfaceAIFComponent target = app.getTargetComponent();
if(target instanceof TCComponentFolder) {
TCComponentFolder folder = (TCComponentFolder)target;
try {
TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
String newID = typeComponent.getNewID();
TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
TCComponentItemRevision itemRev = item.getLatestItemRevision();
if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
itemRev.setStringProperty("zt2_formnumber", formnumber);
}
if(itemRev != null && sfid != null && !sfid.isEmpty()) {
itemRev.setStringProperty("zt2_sfid", sfid);
}
folder.add("contents", item);
folder.refresh();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}else {
try {
TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
String newID = typeComponent.getNewID();
TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
TCComponentItemRevision itemRev = item.getLatestItemRevision();
if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
itemRev.setStringProperty("zt2_formnumber", formnumber);
}
if(itemRev != null && sfid != null && !sfid.isEmpty()) {
itemRev.setStringProperty("zt2_sfid", sfid);
}
session.getUser().getNewStuffFolder().add("contents", item);
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
});
}
public TextArea getInstanceId() {
return instanceId;
}
public void setInstanceId(TextArea instanceId) {
this.instanceId = instanceId;
}
public TextArea getFactory() {
return factory;
}
public void setFactory(TextArea factory) {
this.factory = factory;
}
public TextArea getSfId() {
return sfId;
}
public void setSfId(TextArea sfId) {
this.sfId = sfId;
}
public TextArea getHead() {
return head;
}
public void setHead(TextArea head) {
this.head = head;
}
public TextArea getScheduledtime() {
return scheduledtime;
}
public void setScheduledtime(TextArea scheduledtime) {
this.scheduledtime = scheduledtime;
}
public TextArea getModel() {
return model;
}
public void setModel(TextArea model) {
this.model = model;
}
public TextArea getProductname() {
return productname;
}
public void setProductname(TextArea productname) {
this.productname = productname;
}
public TextArea getToolnumber() {
return toolnumber;
}
public void setToolnumber(TextArea toolnumber) {
this.toolnumber = toolnumber;
}
public TextArea getToolname() {
return toolname;
}
public void setToolname(TextArea toolname) {
this.toolname = toolname;
}
public TextArea getToolinglevel() {
return toolinglevel;
}
public void setToolinglevel(TextArea toolinglevel) {
this.toolinglevel = toolinglevel;
}
public TextArea getReason() {
return reason;
}
public void setReason(TextArea reason) {
this.reason = reason;
}
public Button getCjgzxq() {
return cjgzxq;
}
public void setCjgzxq(Button cjgzxq) {
this.cjgzxq = cjgzxq;
}
public Button getLink() {
return link;
}
public void setLink(Button link) {
this.link = link;
}
public TextArea getState() {
return state;
}
public void setState(TextArea state) {
this.state = state;
}
public TextArea getXh() {
return xh;
}
public void setXh(TextArea xh) {
this.xh = xh;
}
public TextArea getJsgyrequirements() {
return jsgyrequirements;
}
public void setJsgyrequirements(TextArea jsgyrequirements) {
this.jsgyrequirements = jsgyrequirements;
}
public String getLinkStr() {
return linkStr;
}
public void setLinkStr(String linkStr) {
this.linkStr = linkStr;
}
public String getSfIdStr() {
return sfIdStr;
}
public void setSfIdStr(String sfIdStr) {
this.sfIdStr = sfIdStr;
}
public String getInstanceIdStr() {
return instanceIdStr;
}
public void setInstanceIdStr(String instanceIdStr) {
this.instanceIdStr = instanceIdStr;
}
public TCSession getSession() {
return session;
}
public void setSession(TCSession session) {
this.session = session;
}
/**
*
*/
private void browse2(String url) throws Exception {
Desktop desktop = Desktop.getDesktop();
if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
URI uri = new URI(url);
desktop.browse(uri);
}
}
// public GzxqBean() {
// super();
// }
//
// public String getInstanceId() {
// return instanceId;
// }
//
// public void setInstanceId(String instanceId) {
// this.instanceId = instanceId;
// }
//
// public String getFactory() {
// return factory;
// }
//
// public void setFactory(String factory) {
// this.factory = factory;
// }
//
// public String getSfId() {
// return sfId;
// }
//
// public void setSfId(String sfId) {
// this.sfId = sfId;
// }
//
// public String getHead() {
// return head;
// }
//
// public void setHead(String head) {
// this.head = head;
// }
//
// public String getScheduledtime() {
// return scheduledtime;
// }
//
// public void setScheduledtime(String scheduledtime) {
// this.scheduledtime = scheduledtime;
// }
//
// public String getModel() {
// return model;
// }
//
// public void setModel(String model) {
// this.model = model;
// }
//
// public String getProductname() {
// return productname;
// }
//
// public void setProductname(String productname) {
// this.productname = productname;
// }
//
// public String getToolnumber() {
// return toolnumber;
// }
//
// public void setToolnumber(String toolnumber) {
// this.toolnumber = toolnumber;
// }
//
// public String getToolname() {
// return toolname;
// }
//
// public void setToolname(String toolname) {
// this.toolname = toolname;
// }
//
// public String getToolinglevel() {
// return toolinglevel;
// }
//
// public void setToolinglevel(String toolinglevel) {
// this.toolinglevel = toolinglevel;
// }
//
// public String getReason() {
// return reason;
// }
//
// public void setReason(String reason) {
// this.reason = reason;
// }
//
// public String getJsgyrequirements() {
// return jsgyrequirements;
// }
//
// public void setJsgyrequirements(String jsgyrequirements) {
// this.jsgyrequirements = jsgyrequirements;
// }
//
// public String getLink() {
// return link;
// }
//
// public void setLink(String link) {
// this.link = link;
// }
//
// public String getState() {
// return state;
// }
//
// public void setState(String state) {
// this.state = state;
// }
//
// public GzxqBean(String instanceId, String factory, String sfId, String head, String scheduledtime, String model,
// String productname, String toolnumber, String toolname, String toolinglevel, String reason,
// String jsgyrequirements, String link, String state) {
// super();
// this.instanceId = instanceId;
// this.factory = factory;
// this.sfId = sfId;
// this.head = head;
// this.scheduledtime = scheduledtime;
// this.model = model;
// this.productname = productname;
// this.toolnumber = toolnumber;
// this.toolname = toolname;
// this.toolinglevel = toolinglevel;
// this.reason = reason;
// this.jsgyrequirements = jsgyrequirements;
// this.link = link;
// this.state = state;
// }
//
// @Override
// public String toString() {
// return "GzxqBean [instanceId=" + instanceId + ", factory=" + factory + ", sfId=" + sfId + ", head=" + head
// + ", scheduledtime=" + scheduledtime + ", model=" + model + ", productname=" + productname
// + ", toolnumber=" + toolnumber + ", toolname=" + toolname + ", toolinglevel=" + toolinglevel
// + ", reason=" + reason + ", jsgyrequirements=" + jsgyrequirements + ", link=" + link + ", state="
// + state + "]";
// }
}

@ -1,124 +1,124 @@
package com.connor.plm.GZXQ;
import java.awt.Component;
import java.awt.Desktop;
import java.net.URI;
import java.util.List;
import javax.swing.AbstractCellEditor;
import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.table.TableCellEditor;
import com.connor.plm.CostListManagement.pojo.Cusquotation;
import com.connor.plm.CostListManagement.pojo.GzxqBean;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCComponentItemType;
import com.teamcenter.rac.kernel.TCSession;
public class ButtonCellEditor extends AbstractCellEditor implements TableCellEditor{
private JButton button;
private JTable table;
private List<GzxqBean> quotations;
private Boolean flag = false;
public static GzxqBean quotation;
public static Cusquotation cusquotation;
public static TCSession session;
public ButtonCellEditor(JTable jTable2,List<GzxqBean> quotations,TCSession session, TCComponent f) {
button = new JButton();
this.table = jTable2;
this.quotations = quotations;
this.session = session;
button.addActionListener(e -> {
// 这里可以添加按钮的点击事件响应逻辑
int selectedRow = table.getSelectedRow();
System.out.println("点击了第"+selectedRow+"行");
String text = button.getText();
System.out.println("点击按钮名称:"+text);
if("打开".equals(text)) {
String url = quotations.get(selectedRow).getLink();
try {
browse2(url);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}else if("设计".equals(text)){
String formnumber = quotations.get(selectedRow).getInstanceId();
String sfid = quotations.get(selectedRow).getSfId();
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
InterfaceAIFComponent target = app.getTargetComponent();
if(target instanceof TCComponentFolder) {
TCComponentFolder folder = (TCComponentFolder)target;
try {
TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
String newID = typeComponent.getNewID();
TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
TCComponentItemRevision itemRev = item.getLatestItemRevision();
if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
itemRev.setStringProperty("zt2_formnumber", formnumber);
}
if(itemRev != null && sfid != null && !sfid.isEmpty()) {
itemRev.setStringProperty("zt2_sfid", sfid);
}
folder.add("contents", item);
folder.refresh();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}else {
try {
TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
String newID = typeComponent.getNewID();
TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
TCComponentItemRevision itemRev = item.getLatestItemRevision();
if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
itemRev.setStringProperty("zt2_formnumber", formnumber);
}
if(itemRev != null && sfid != null && !sfid.isEmpty()) {
itemRev.setStringProperty("zt2_sfid", sfid);
}
session.getUser().getNewStuffFolder().add("contents", item);
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
});
}
private void browse2(String url) throws Exception {
Desktop desktop = Desktop.getDesktop();
if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
URI uri = new URI(url);
desktop.browse(uri);
}
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
int row, int column) {
button.setText(value != null ? value.toString() : "");
return button;
}
@Override
public Object getCellEditorValue() {
return button.getText();
}
}
//package com.connor.plm.GZXQ;
//
//import java.awt.Component;
//import java.awt.Desktop;
//import java.net.URI;
//import java.util.List;
//
//import javax.swing.AbstractCellEditor;
//import javax.swing.JButton;
//import javax.swing.JTable;
//import javax.swing.table.TableCellEditor;
//
//import com.connor.plm.CostListManagement.pojo.Cusquotation;
//import com.connor.plm.CostListManagement.pojo.GzxqBean;
//import com.teamcenter.rac.aif.AbstractAIFApplication;
//import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
//import com.teamcenter.rac.aifrcp.AIFUtility;
//import com.teamcenter.rac.kernel.TCComponent;
//import com.teamcenter.rac.kernel.TCComponentFolder;
//import com.teamcenter.rac.kernel.TCComponentItem;
//import com.teamcenter.rac.kernel.TCComponentItemRevision;
//import com.teamcenter.rac.kernel.TCComponentItemType;
//import com.teamcenter.rac.kernel.TCSession;
//
//public class ButtonCellEditor extends AbstractCellEditor implements TableCellEditor{
//
//
// private JButton button;
// private JTable table;
// private List<GzxqBean> quotations;
// private Boolean flag = false;
// public static GzxqBean quotation;
// public static Cusquotation cusquotation;
// public static TCSession session;
//
// public ButtonCellEditor(JTable jTable2,List<GzxqBean> quotations,TCSession session, TCComponent f) {
// button = new JButton();
// this.table = jTable2;
// this.quotations = quotations;
// this.session = session;
// button.addActionListener(e -> {
// // 这里可以添加按钮的点击事件响应逻辑
// int selectedRow = table.getSelectedRow();
// System.out.println("点击了第"+selectedRow+"行");
// String text = button.getText();
// System.out.println("点击按钮名称:"+text);
// if("打开".equals(text)) {
// String url = quotations.get(selectedRow).getLink();
// try {
// browse2(url);
// } catch (Exception e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
// }else if("设计".equals(text)){
// String formnumber = quotations.get(selectedRow).getInstanceId();
// String sfid = quotations.get(selectedRow).getSfId();
// AbstractAIFApplication app = AIFUtility.getCurrentApplication();
// InterfaceAIFComponent target = app.getTargetComponent();
// if(target instanceof TCComponentFolder) {
// TCComponentFolder folder = (TCComponentFolder)target;
// try {
// TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
// String newID = typeComponent.getNewID();
// TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
// TCComponentItemRevision itemRev = item.getLatestItemRevision();
// if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
// itemRev.setStringProperty("zt2_formnumber", formnumber);
// }
// if(itemRev != null && sfid != null && !sfid.isEmpty()) {
// itemRev.setStringProperty("zt2_sfid", sfid);
// }
// folder.add("contents", item);
// folder.refresh();
// } catch (Exception e2) {
// // TODO: handle exception
// e2.printStackTrace();
// }
//
// }else {
// try {
// TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
// String newID = typeComponent.getNewID();
// TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
// TCComponentItemRevision itemRev = item.getLatestItemRevision();
// if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
// itemRev.setStringProperty("zt2_formnumber", formnumber);
//
// }
// if(itemRev != null && sfid != null && !sfid.isEmpty()) {
// itemRev.setStringProperty("zt2_sfid", sfid);
// }
// session.getUser().getNewStuffFolder().add("contents", item);
// } catch (Exception e2) {
// // TODO: handle exception
// e2.printStackTrace();
// }
//
// }
// }
// });
//
// }
//private void browse2(String url) throws Exception {
// Desktop desktop = Desktop.getDesktop();
// if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
// URI uri = new URI(url);
// desktop.browse(uri);
// }
//}
//
//@Override
//public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
// int row, int column) {
// button.setText(value != null ? value.toString() : "");
// return button;
//}
//
//@Override
//public Object getCellEditorValue() {
// return button.getText();
//}
//
//}

@ -0,0 +1,25 @@
package com.connor.plm.GZXQ;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
public class CenterRenderer extends DefaultTableCellRenderer implements TableCellRenderer {
public CenterRenderer() {
// 设置水平对齐方式为居中
setHorizontalAlignment(SwingConstants.CENTER);
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int column) {
// 调用父类的实现,然后根据需要做进一步的自定义
Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
// 如果需要,可以在这里做更多的自定义,如字体、颜色等
return c;
}
}

@ -0,0 +1,24 @@
package com.connor.plm.GZXQ;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
public class CustomHeaderRenderer extends JLabel implements TableCellRenderer {
private Border border = new LineBorder(Color.black, 1); // ÉèÖñ߿òÑÕÉ«ºÍ¿í¶È
public CustomHeaderRenderer() {
setOpaque(true);
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int column) {
setText(value.toString());
setBorder(border);
return this;
}
}

@ -0,0 +1,511 @@
package com.connor.plm.GZXQ;
/**
* ===============================================================================
* Copyright (c) 2012-2024 CONNOR lijh. Unpublished - All Rights Reserved
* ===============================================================================
* File description:
*
* GZXQController.java
*
* ===============================================================================
* DATE Name Description of Change
*
* 2024-06-13 ljh create
* ===============================================================================
*/
import java.awt.Component;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.casic.javafx.control.DateTimePicker;
import com.chint.plm.fxUtil.KFXPanel;
import com.chint.plm.fxUtil.KFXPanelController;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil;
import com.connor.plm.CostListManagement.pojo.GzxqBean;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.DatePicker;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableRow;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.control.TitledPane;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
public class GZXQController extends KFXPanelController {
private Connection conn;
private int pageNum;// 分页显示当前第几页
private List<List<GzxqBean>> tableBeans = new ArrayList<List<GzxqBean>>();//存储table分页数据
private String PlanTime;//
@FXML
private TextField jTextField8;
@FXML
private BorderPane tablePane;
@FXML
private DatePicker jTextField7;
@FXML
private Button jButton2;
@FXML
private Button wy;
@FXML
private TextField jTextField9;
@FXML
private TitledPane titlePaneResult;
@FXML
private TextField jTextField4;
@FXML
private TextField jTextField3;
@FXML
private Button sy;
@FXML
private TextField jTextField6;
@FXML
private GridPane gridPaneCondition;
@FXML
private TextField jTextField5;
@FXML
private TableView<GzxqBean> tableView;
@FXML
private TextField jTextField10;
@FXML
private Button syy;
@FXML
private BorderPane bpane;
@FXML
private TitledPane titlePaneCondition;
@FXML
private GridPane gridPaneResult;
@FXML
private Button xyy;
@FXML
private TextField jTextField2;
@FXML
private TextField jTextField1;
@FXML
private Pane pane;
// table的列
private TableColumn<GzxqBean, TextArea> tc_1 = new TableColumn<GzxqBean, TextArea>("序号");
private TableColumn<GzxqBean, TextArea> tc_2 = new TableColumn<GzxqBean, TextArea>("申请人");
private TableColumn<GzxqBean, TextArea> tc_3 = new TableColumn<GzxqBean, TextArea>("流程实例ID");
private TableColumn<GzxqBean, TextArea> tc_4 = new TableColumn<GzxqBean, TextArea>("工艺负责人");
private TableColumn<GzxqBean, TextArea> tc_5 = new TableColumn<GzxqBean, TextArea>("计划时间");
private TableColumn<GzxqBean, TextArea> tc_6 = new TableColumn<GzxqBean, TextArea>("委托理由");
private TableColumn<GzxqBean, TextArea> tc_7 = new TableColumn<GzxqBean, TextArea>("技术工艺要求");
private TableColumn<GzxqBean, Button> tc_8 = new TableColumn<GzxqBean, Button>("OA表单链接");
private TableColumn<GzxqBean, Button> tc_9 = new TableColumn<GzxqBean, Button>("创建工装需求");
private TableColumn<GzxqBean, TextArea> tc_10 = new TableColumn<GzxqBean, TextArea>("状态");
@FXML
private ScrollPane scrollPane;
@FXML
private BorderPane resultBorder;
@FXML
private BorderPane topBorder;
private GZXQFrame frame;
private DateTimePicker dateTimeStart;
private DateTimePicker dateTimeEnd;
protected AbstractAIFApplication app;
private TCSession session;
/**
*
*/
@Override
public void initData(KFXPanel paramKFXPanel) throws Exception {
// TODO Auto-generated method stub
frame = (GZXQFrame) paramKFXPanel.getParentDialog();
addWindListener(frame);
frame.setMaximumSize(frame.getMaximumSize());
System.out.println("frame==>" + frame);
this.app = AIFUtility.getCurrentApplication();
this.session = (TCSession) app.getSession();
dateTimeStart = new DateTimePicker();
dateTimeEnd = new DateTimePicker();
//设置文本框的高度
jTextField1.setPrefHeight(30);
jTextField2.setPrefHeight(30);
jTextField3.setPrefHeight(30);
jTextField4.setPrefHeight(30);
jTextField5.setPrefHeight(30);
jTextField6.setPrefHeight(30);
jTextField7.setPrefHeight(30);
jTextField7.setPrefWidth(244);
jTextField8.setPrefHeight(30);
jTextField9.setPrefHeight(30);
jTextField10.setPrefHeight(30);
// 表格列绑定bean对象
tc_1.setSortable(false);
tc_2.setSortable(false);
tc_3.setSortable(false);
tc_4.setSortable(false);
tc_5.setSortable(false);
tc_6.setSortable(false);
tc_7.setSortable(false);
tc_8.setSortable(false);
tc_9.setSortable(false);
tc_10.setSortable(false);
// 列绑定bean对象
tc_1.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("xh"));
tc_2.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("sfId"));// cTaskNum
tc_3.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("instanceId"));
tc_4.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("head"));
tc_5.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("scheduledtime"));
tc_6.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("reason"));
tc_7.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("jsgyrequirements"));
tc_8.setCellValueFactory(new PropertyValueFactory<GzxqBean, Button>("link"));
tc_9.setCellValueFactory(new PropertyValueFactory<GzxqBean, Button>("cjgzxq"));
tc_10.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("state"));
//设置table列宽度
tc_1.prefWidthProperty().bind(tableView.widthProperty().multiply(0.04));
tc_2.prefWidthProperty().bind(tableView.widthProperty().multiply(0.07));
tc_3.prefWidthProperty().bind(tableView.widthProperty().multiply(0.12));
tc_4.prefWidthProperty().bind(tableView.widthProperty().multiply(0.09));
tc_5.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tc_6.prefWidthProperty().bind(tableView.widthProperty().multiply(0.2));
tc_7.prefWidthProperty().bind(tableView.widthProperty().multiply(0.12));
tc_8.prefWidthProperty().bind(tableView.widthProperty().multiply(0.09));
tc_9.prefWidthProperty().bind(tableView.widthProperty().multiply(0.09));
tc_10.prefWidthProperty().bind(tableView.widthProperty().multiply(0.08));
// //设置是否可编辑
// tc_1.setEditable(false);
// tc_2.setEditable(false);
// tc_3.setEditable(false);
// tc_4.setEditable(false);
// tc_5.setEditable(false);
// tc_6.setEditable(false);
// tc_7.setEditable(false);
// tc_8.setEditable(true);
// tc_9.setEditable(true);
// tc_10.setEditable(false);
//把代码中定义的table列加入tableView
tableView.getColumns().addAll(tc_1, tc_2, tc_3, tc_4, tc_5, tc_6, tc_7,
tc_8, tc_9, tc_10);
// tableView.setMaxHeight(pageNum);
}
// 跳转首页
@FXML
void firstBtnAction(ActionEvent event) {
pageNum = 0;
ObservableList<GzxqBean> data = FXCollections.observableArrayList(tableBeans.get(0));
tableView.getItems().clear();
tableView.setItems(data);
}
// 跳转上一页
@FXML
void lastBtnAction(ActionEvent event) {
if (pageNum > 0) {
pageNum = pageNum - 1;
}
ObservableList<GzxqBean> data = FXCollections.observableArrayList(tableBeans.get(pageNum));
tableView.getItems().clear();
tableView.setItems(data);
}
// 跳转下一页
@FXML
void nextBtnAction(ActionEvent event) {
if (pageNum < tableBeans.size() - 1) {
pageNum = pageNum + 1;
}
ObservableList<GzxqBean> data = FXCollections.observableArrayList(tableBeans.get(pageNum));
tableView.getItems().clear();
tableView.setItems(data);
}
// 跳转尾页
@FXML
void tailBtnAction(ActionEvent event) {
pageNum = tableBeans.size() - 1;
ObservableList<GzxqBean> data = FXCollections.observableArrayList(tableBeans.get(pageNum));
tableView.getItems().clear();
tableView.setItems(data);
}
/**
* @param frame
* @function
*/
private void addWindListener(GZXQFrame frame) {
// TODO Auto-generated method stub
frame.addComponentListener(new ComponentListener() {
@Override
public void componentShown(ComponentEvent e) {
// TODO Auto-generated method stub
}
/**
* pane
*/
@Override
public void componentResized(ComponentEvent e) {
// TODO Auto-generated method stub
// System.out.println("==============");
Component component = e.getComponent();
System.out.println("component==>" + component);
double width = component.getSize().getWidth();
// // double width = primaryStage.getWidth();
System.out.println("width==>" + width);
pane.setPrefWidth(width * 0.98);
bpane.setPrefWidth(width * 0.98);
titlePaneCondition.setPrefWidth(width * 0.98);
titlePaneResult.setPrefWidth(width * 0.98);
gridPaneCondition.setPrefWidth(width * 0.97);
gridPaneCondition.setPrefWidth(width * 0.97);
tablePane.setPrefWidth(width * 0.98);
tableView.setPrefWidth(width * 0.97);
gridPaneResult.setPrefWidth(width * 0.97);
// refTable.setPrefWidth(width * 0.97);
}
@Override
public void componentMoved(ComponentEvent e) {
// TODO Auto-generated method stub
}
@Override
public void componentHidden(ComponentEvent e) {
// TODO Auto-generated method stub
}
});
}
@FXML
void cxAction(ActionEvent event) throws ParseException {
//连接数据库
String[] prefs = session.getPreferenceService().getStringValues("database_tc");
System.out.println("===============开始连接tc数据库===============");
long time31 = System.nanoTime();
conn = SqlUtil.getTCDataConnection(prefs);
long time32 = System.nanoTime();
System.out.println("===============连接tc数据库用时(ms) " + ((time32 - time31) / 1000000L)+"===============");
System.out.println("======================清除");
tableView.getItems().clear();
tableBeans.clear();
String factory = "";
// 拼接查询语句
String sql = "select * from \"CHINT_ FROCK\" where 1=1 ";
try {
factory = SAPUtil.getGroupID(session);
sql = "select * from \"CHINT_ FROCK\" where FACTORY = '"+factory+"' ";
} catch (TCException e1) {
// TODO Auto-generated catch block
System.out.println("获取组织失败");
e1.printStackTrace();
}
if(jTextField1.getText()!=null && !"".equals(jTextField1.getText().trim())) {
sql += "and instanceId = \'" + jTextField1.getText() +"\'";
}
if(jTextField2.getText()!=null && !"".equals(jTextField2.getText().trim())) {
sql += "and \"HEAD\" = \'" + jTextField2.getText() +"\'";
}
if(jTextField3.getText()!=null && !"".equals(jTextField3.getText().trim())) {
sql += "and \"MODEL\" = \'" + jTextField3.getText() +"\'";
}
if(jTextField4.getText()!=null && !"".equals(jTextField4.getText().trim())) {
sql += "and \"TOOLNUMBER\" = \'" + jTextField4.getText() +"\'";
}
if(jTextField5.getText()!=null && !"".equals(jTextField5.getText().trim())) {
sql += "and \"TOOLNAME\" = \'" + jTextField5.getText() +"\'";
}
if(jTextField8.getText()!=null && !"".equals(jTextField8.getText().trim())) {
sql += "and sfId = \'" + jTextField8.getText() +"\'";
}
PlanTime = jTextField7.getEditor().getText();
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-M-dd");
if (PlanTime.length() > 0) {
if(PlanTime.contains("-")) {
PlanTime = PlanTime.replace("-", "/");
System.out.println("PlanTime==========="+PlanTime);
//Date date = sdf2.parse(PlanTime);
sql += "and \"SCHEDULEDTIME\" like \'%" + PlanTime +"%\'";
}
}
// if(jTextField7.getText()!=null && !"".equals(jTextField7.getText().trim())) {
// sql += "and \"SCHEDULEDTIME\" = \'" + jTextField7.getText() +"\'";
// }
if(jTextField9.getText()!=null && !"".equals(jTextField9.getText().trim())) {
sql += "and \"PRODUCTNAME\" = \'" + jTextField9.getText() +"\'";
}
if(jTextField10.getText()!=null && !"".equals(jTextField10.getText().trim())) {
sql += "and \"TOOLINGLEVEL\" = \'" + jTextField10.getText() +"\'";
}
if(jTextField6.getText()!=null && !"".equals(jTextField6.getText().trim())) {
sql += "and \"REASON\" = \'" + jTextField6.getText() +"\'";
}
System.out.println("sql:"+sql);
PreparedStatement statement;
try {
int z=1;
statement = conn.prepareStatement(sql);
ResultSet res = statement.executeQuery();
List<GzxqBean> quotations = new ArrayList<GzxqBean>();
//处理查询数据结果集
while (res.next()) {
GzxqBean gzxqBean = new GzxqBean(
res.getString("instanceId") != null ? res.getString("instanceId") : "",
res.getString("factory") != null ? res.getString("factory") : "",
res.getString("sfId") != null ? res.getString("sfId") : "",
res.getString("head") != null ? res.getString("head") : "",
res.getString("scheduledtime") != null ? res.getString("scheduledtime") : "",
res.getString("model") != null ? res.getString("model") : "",
res.getString("productname") != null ? res.getString("productname") : "",
res.getString("toolnumber") != null ? res.getString("toolnumber") : "",
res.getString("toolname") != null ? res.getString("toolname") : "",
res.getString("toolinglevel") != null ? res.getString("toolinglevel") : "",
res.getString("reason") != null ? res.getString("reason") : "",
res.getString("jsgyrequirements") != null ? res.getString("jsgyrequirements") : "",
res.getString("link") != null ? res.getString("link") : "",
res.getString("state") != null ? res.getString("state") : "",z+""
,session);
if(z % 10 ==1) {
quotations = new ArrayList<GzxqBean>();
tableBeans.add(quotations);
}
quotations.add(gzxqBean);
z = z+1;
}
pageNum = 0;
if(tableBeans == null || tableBeans.size() <= 0 || tableBeans.get(0).size() <= 0) {
//MessageBox.post("未查询到对应工装需求!","提示",2);
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("提示");
alert.setHeaderText("未查询到对应工装需求");
//alert.setContentText("导入完成");
alert.showAndWait();
}else {
ObservableList<GzxqBean> data = FXCollections.observableArrayList(tableBeans.get(0));
System.out.println("======================清除");
tableView.getItems().clear();
tableView.setItems(data);
}
tableView.setRowFactory(tv -> {
//TODO 设置行高
TableRow<GzxqBean> row = new TableRow<>();
row.setPrefHeight(50);
return row;
});
}catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,26 @@
package com.connor.plm.GZXQ;
import java.awt.BorderLayout;
import java.awt.Dimension;
import com.chint.plm.fxUtil.KFrame;
import javafx.embed.swing.JFXPanel;
public class GZXQFrame extends KFrame {
public GZXQFrame() {
super();
}
@Override
protected void initUI() throws Exception {
this.setTitle("¹¤×°ÐèÇó");
this.setLayout(new BorderLayout());
this.setPreferredSize(new Dimension(1490, 900));
JFXPanel panel = new JFXPanel();
panel.setScene(new GZXQPanel(this).getScene());
this.add(BorderLayout.CENTER, panel);
}
}

@ -3,9 +3,11 @@ package com.connor.plm.GZXQ;
import java.awt.Dimension;
import java.awt.Toolkit;
import org.apache.log4j.chainsaw.Main;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import com.chint.plm.SearchSapResult.SapResultFrame;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
@ -26,22 +28,26 @@ public class GZXQHandler extends AbstractHandler{
new Thread() {
@Override
public void run() {
NewJFrame newJFrame = new NewJFrame(session);
int width2 = newJFrame.getWidth();
int height2 = newJFrame.getHeight();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
int screenWidth = screenSize.width; // 获取屏幕宽度
int screenHeight = screenSize.height; // 获取屏幕高度
int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标
int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标
newJFrame.setTitle("工装需求查询");
// this.getContentPane().setBackground(Color.red);
newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255));
newJFrame.setSize(950, height2); // 设置Frame的大小
newJFrame.setLocation(x, y); // 设置Frame的位置
newJFrame.setResizable(false);
newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作
newJFrame.setVisible(true);
// NewJFrame newJFrame = new NewJFrame(session);
// int width2 = newJFrame.getWidth();
// int height2 = newJFrame.getHeight();
// Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
// int screenWidth = screenSize.width; // 获取屏幕宽度
// int screenHeight = screenSize.height; // 获取屏幕高度
// int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标
// int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标
// newJFrame.setTitle("工装需求查询");
// // this.getContentPane().setBackground(Color.red);
// newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255));
// newJFrame.setSize(1240, height2); // 设置Frame的大小
// newJFrame.setLocation(x, y); // 设置Frame的位置
// newJFrame.setResizable(false);
// newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作
// newJFrame.setVisible(true);
new GZXQFrame();
}
}.start();
} catch (Exception e) {
@ -50,4 +56,8 @@ public class GZXQHandler extends AbstractHandler{
return null;
}
public static void main(String[] args) {
new GZXQFrame();
}
}

@ -0,0 +1,13 @@
package com.connor.plm.GZXQ;
import java.awt.Window;
import com.chint.plm.fxUtil.KFXPanel;
public class GZXQPanel extends KFXPanel {
public GZXQPanel(Window dialog) {
super(dialog, "a.fxml");
// TODO Auto-generated constructor stub
}
}

@ -0,0 +1,129 @@
package com.connor.plm.GZXQ;
//import javax.swing.*;
//import javax.swing.table.*;
//import java.awt.*;
//
//public class MultiLineTableCellRenderer extends JTextArea implements TableCellRenderer {
//
// public MultiLineTableCellRenderer() {
// // 设置JTextArea的属性
// this.setEditable(false);
// this.setLineWrap(true); // 启用自动换行
// this.setWrapStyleWord(true); // 保持单词的完整性,不在单词中间换行
// }
//
// @Override
// public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
// // 清除样式,避免残留样式影响显示
// this.setText(value == null ? "" : value.toString());
//
// // 可以根据需要设置字体、颜色等样式
// if (isSelected) {
// this.setBackground(table.getSelectionBackground());
// this.setForeground(table.getSelectionForeground());
// } else {
// this.setBackground(table.getBackground());
// this.setForeground(table.getForeground());
// }
//
// return this;
// }
//}
//import javax.swing.*;
//import javax.swing.table.DefaultTableCellRenderer;
//import javax.swing.table.TableCellRenderer;
//import java.awt.*;
//
//public class MultiLineTableCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer {
//
// private JScrollPane scrollPane;
//
// public MultiLineTableCellRenderer() {
// JTextArea textArea = new JTextArea();
// textArea.setEditable(false); // 禁止编辑
// textArea.setLineWrap(true); // 允许换行
// textArea.setWrapStyleWord(true); // 单词整行换行
//
// scrollPane = new JScrollPane(textArea);
// scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
// scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
// scrollPane.setBorder(null); // 移除边框
// }
//
// @Override
// public Component getTableCellRendererComponent(JTable table, Object value,
// boolean isSelected, boolean hasFocus,
// int row, int column) {
// JTextArea textArea = (JTextArea) scrollPane.getViewport().getView();
// textArea.setText(value == null ? "" : value.toString());
//
// // 设置选中状态的颜色
// if (isSelected) {
// textArea.setBackground(table.getSelectionBackground());
// textArea.setForeground(table.getSelectionForeground());
// } else {
// textArea.setBackground(table.getBackground());
// textArea.setForeground(table.getForeground());
// }
//
// return scrollPane;
// }
//}
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
public class MultiLineTableCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer {
private JTextArea textArea;
private JScrollPane scrollPane;
public MultiLineTableCellRenderer() {
textArea = new JTextArea();
textArea.setEditable(false);
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
scrollPane = new JScrollPane(textArea);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setBorder(null);
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int column) {
textArea.setText(value == null ? "" : value.toString());
// 设置选中状态的颜色
if (isSelected) {
textArea.setBackground(table.getSelectionBackground());
textArea.setForeground(table.getSelectionForeground());
} else {
textArea.setBackground(table.getBackground());
textArea.setForeground(table.getForeground());
}
// 获取单元格的首选大小
Dimension preferredSize = table.getColumnModel().getColumn(column).getPreferredWidth() > 0 ?
new Dimension(table.getColumnModel().getColumn(column).getPreferredWidth(), table.getRowHeight(row)) :
new Dimension(table.getColumnModel().getColumn(column).getWidth(), table.getRowHeight(row));
// 设置JScrollPane的大小
scrollPane.setPreferredSize(preferredSize);
scrollPane.setMaximumSize(preferredSize);
scrollPane.setMinimumSize(preferredSize);
scrollPane.setSize(preferredSize);
// 重新计算JScrollPane的布局
scrollPane.revalidate();
scrollPane.repaint();
return scrollPane;
}
}

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<Pane fx:id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="840.0" prefWidth="1270.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.GZXQ.GZXQController">
<children>
<BorderPane fx:id="bpane" layoutX="5.0" layoutY="14.0" prefHeight="840.0" prefWidth="1261.0">
<top>
<TitledPane fx:id="titlePaneCondition" animated="false" prefHeight="182.0" prefWidth="1034.0" text="条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="151.0" prefWidth="964.0">
<children>
<GridPane fx:id="gridPaneCondition" layoutX="13.0" layoutY="11.0" prefHeight="114.0" prefWidth="1218.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="109.0" minWidth="10.0" prefWidth="86.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="216.0" minWidth="10.0" prefWidth="164.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="112.0" minWidth="10.0" prefWidth="93.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="233.0" minWidth="10.0" prefWidth="185.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="103.0" minWidth="10.0" prefWidth="95.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="246.0" minWidth="10.0" prefWidth="191.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="189.0" minWidth="10.0" prefWidth="97.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="212.0" minWidth="10.0" prefWidth="212.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField fx:id="jTextField1" GridPane.columnIndex="1" />
<TextField fx:id="jTextField2" prefHeight="30.0" prefWidth="189.0" GridPane.columnIndex="3" />
<TextField fx:id="jTextField5" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="jTextField6" prefHeight="30.0" prefWidth="152.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="jTextField7" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<TextField fx:id="jTextField3" GridPane.columnIndex="5" />
<TextField fx:id="jTextField8" GridPane.columnIndex="7" GridPane.rowIndex="1" />
<TextField fx:id="jTextField4" prefHeight="30.0" prefWidth="168.0" GridPane.columnIndex="7" />
<TextField fx:id="jTextField9" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="jTextField10" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label text="流程实例ID" GridPane.halignment="CENTER" />
<Label text="工装名称" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="产品名称" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="工艺负责人" GridPane.columnIndex="2" GridPane.halignment="CENTER" />
<Label text="委托理由" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="工装等级" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="产品型号" GridPane.columnIndex="4" GridPane.halignment="CENTER" />
<Label text="计划时间" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label GridPane.columnIndex="4" GridPane.rowIndex="2" />
<Label text="工装编号" GridPane.columnIndex="6" GridPane.halignment="CENTER" />
<Label text="申请人" GridPane.columnIndex="6" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Button fx:id="jButton2" mnemonicParsing="false" onAction="#cxAction" prefHeight="30.0" prefWidth="98.0" text="查 询" GridPane.columnIndex="7" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="BOTTOM">
<GridPane.margin>
<Insets />
</GridPane.margin>
</Button>
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
<center>
<TitledPane fx:id="titlePaneResult" animated="false" prefHeight="620.0" prefWidth="966.0" text="结果" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="570.0" prefWidth="964.0">
<children>
<BorderPane fx:id="tablePane" layoutX="8.0" layoutY="6.0" prefHeight="573.0" prefWidth="1245.0">
<top>
<TableView fx:id="tableView" prefHeight="544.0" prefWidth="1195.0" BorderPane.alignment="CENTER" />
</top>
<bottom>
<GridPane fx:id="gridPaneResult" prefHeight="29.0" prefWidth="948.0" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="sy" mnemonicParsing="false" onAction="#firstBtnAction" text="首页" GridPane.columnIndex="2" />
<Button fx:id="syy" mnemonicParsing="false" onAction="#lastBtnAction" text="上一页" GridPane.columnIndex="3" />
<Button mnemonicParsing="false" onAction="#nextBtnAction" text="下一页" GridPane.columnIndex="4" fx:id="xyy" />
<Button fx:id="wy" mnemonicParsing="false" onAction="#tailBtnAction" text="尾页" GridPane.columnIndex="5" />
</children>
</GridPane>
</bottom>
</BorderPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</center>
</BorderPane>
</children>
</Pane>

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<Pane fx:id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="840.0" prefWidth="1270.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.GZXQ.GZXQController">
<children>
<BorderPane fx:id="bpane" layoutX="5.0" layoutY="14.0" prefHeight="840.0" prefWidth="1261.0">
<top>
<TitledPane fx:id="titlePaneCondition" animated="false" prefHeight="182.0" prefWidth="1034.0" text="条件" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="151.0" prefWidth="964.0">
<children>
<GridPane fx:id="gridPaneCondition" layoutX="13.0" layoutY="11.0" prefHeight="114.0" prefWidth="1218.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="109.0" minWidth="10.0" prefWidth="86.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="216.0" minWidth="10.0" prefWidth="164.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="112.0" minWidth="10.0" prefWidth="93.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="233.0" minWidth="10.0" prefWidth="185.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="103.0" minWidth="10.0" prefWidth="95.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="246.0" minWidth="10.0" prefWidth="191.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="189.0" minWidth="10.0" prefWidth="97.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="212.0" minWidth="10.0" prefWidth="212.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField fx:id="jTextField1" GridPane.columnIndex="1" />
<TextField fx:id="jTextField2" prefHeight="30.0" prefWidth="189.0" GridPane.columnIndex="3" />
<TextField fx:id="jTextField5" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="jTextField6" prefHeight="30.0" prefWidth="152.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="jTextField3" GridPane.columnIndex="5" />
<TextField fx:id="jTextField8" GridPane.columnIndex="7" GridPane.rowIndex="1" />
<TextField fx:id="jTextField4" prefHeight="30.0" prefWidth="168.0" GridPane.columnIndex="7" />
<TextField fx:id="jTextField9" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="jTextField10" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label text="流程实例ID" GridPane.halignment="CENTER" />
<Label text="工装名称" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="产品名称" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="工艺负责人" GridPane.columnIndex="2" GridPane.halignment="CENTER" />
<Label text="委托理由" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="工装等级" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="产品型号" GridPane.columnIndex="4" GridPane.halignment="CENTER" />
<Label text="计划时间" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label GridPane.columnIndex="4" GridPane.rowIndex="2" />
<Label text="工装编号" GridPane.columnIndex="6" GridPane.halignment="CENTER" />
<Label text="申请人" GridPane.columnIndex="6" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Button fx:id="jButton2" mnemonicParsing="false" onAction="#cxAction" prefHeight="30.0" prefWidth="98.0" text="查 询" GridPane.columnIndex="7" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="BOTTOM">
<GridPane.margin>
<Insets />
</GridPane.margin>
</Button>
<DatePicker GridPane.columnIndex="5" GridPane.rowIndex="1" />
<DatePicker fx:id="jTextField7" GridPane.columnIndex="5" GridPane.rowIndex="1" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</top>
<center>
<TitledPane fx:id="titlePaneResult" animated="false" prefHeight="620.0" prefWidth="966.0" text="结果" BorderPane.alignment="CENTER">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="570.0" prefWidth="964.0">
<children>
<BorderPane fx:id="tablePane" layoutX="8.0" layoutY="6.0" prefHeight="573.0" prefWidth="1245.0">
<top>
<TableView fx:id="tableView" prefHeight="544.0" prefWidth="1195.0" BorderPane.alignment="CENTER" />
</top>
<bottom>
<GridPane fx:id="gridPaneResult" prefHeight="29.0" prefWidth="948.0" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="sy" mnemonicParsing="false" onAction="#firstBtnAction" text="首页" GridPane.columnIndex="2" />
<Button fx:id="syy" mnemonicParsing="false" onAction="#lastBtnAction" text="上一页" GridPane.columnIndex="3" />
<Button mnemonicParsing="false" onAction="#nextBtnAction" text="下一页" GridPane.columnIndex="4" fx:id="xyy" />
<Button fx:id="wy" mnemonicParsing="false" onAction="#tailBtnAction" text="尾页" GridPane.columnIndex="5" />
</children>
</GridPane>
</bottom>
</BorderPane>
</children>
</AnchorPane>
</content>
</TitledPane>
</center>
</BorderPane>
</children>
</Pane>

@ -4,6 +4,7 @@ import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.AbstractAIFDialog;
@ -12,6 +13,7 @@ import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCComponentGroup;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
@ -37,6 +39,7 @@ public class SRMDialog extends AbstractAIFDialog {
public SRMDialog(AbstractAIFApplication app, TCSession session) throws Exception {
this.session = session;
System.out.println("222222222222222222222222222222222222");
this.app = app;
initUI();
}
@ -76,13 +79,18 @@ public class SRMDialog extends AbstractAIFDialog {
// »ñÈ¡uid
String uid = revision.getUid();
System.out.println("uid===" + uid);
// 获取组信息
TCComponentGroup loginGroup = session.getUser().getLoginGroup();
//TCComponentGroup loginGroup = session.getUser().getLoginGroup();
String userName = session.getUserName();
String userId = session.getUser().getUserId();
System.out.println("userName================"+userName);
System.out.println("userId================"+userId);
String groupName = loginGroup.getStringProperty("full_name");
TCComponentGroup group = session.getCurrentGroup();
String groupName = group.getTCProperty("name").getStringValue();
//String groupName = loginGroup.getStringProperty("full_name");
System.out.println("groupName===" + groupName);
// insertÊý¾Ý¿â
String[] prefs = session.getPreferenceService().getStringValues("CHINT_SRM_SQL_CONNECT");

@ -6,6 +6,7 @@ import org.eclipse.core.commands.ExecutionException;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
public class SRMHandler extends AbstractHandler{
@ -15,6 +16,7 @@ public class SRMHandler extends AbstractHandler{
public Object execute(ExecutionEvent arg0) throws ExecutionException {
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession) app.getSession();
try {
new Thread() {

@ -0,0 +1,378 @@
package com.connor.plm.txdp;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.Month;
import java.time.YearMonth;
import java.time.temporal.ChronoUnit;
import java.time.temporal.WeekFields;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellValue;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.connor.chint.sap2.util.MyProgressBarCompent;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.DateButton;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.util.PropertyLayout;
public class BZGSFram extends JFrame implements ActionListener {
private TCSession session;
protected DefaultTableModel tm_part;
private static ArrayList<String> dateConnList = new ArrayList<String>();
private String[] prefs;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
StringBuilder insertSql = new StringBuilder();
private JTextField pathJTextField = new JTextField(30);
private JButton outputButton = new JButton("选择");
private Workbook workbook;
public BZGSFram(TCSession session) {
// TODO Auto-generated constructor stub
this.session = session;
prefs = session.getPreferenceService().getStringValues("CHINT_SRM_SQL_CONNECT");
initUI();
}
private String sqlString = "";
private void initUI() {
// TODO Auto-generated method stub
try {
this.setTitle("工时维护界面");
this.setLayout(new BorderLayout());
JPanel topPanel = getTopPanel();
JPanel btnPanel = getBtnPanel();
this.add(topPanel, BorderLayout.NORTH);
// this.add(pane,BorderLayout.CENTER);
this.add(btnPanel, BorderLayout.SOUTH);
this.setPreferredSize(new Dimension(550, 115));
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
int screenWidth = screenSize.width; // 获取屏幕宽度
int screenHeight = screenSize.height; // 获取屏幕高度
int x = (screenWidth - 550) / 2; // 计算Frame的左上角x坐标
int y = (screenHeight - 300) / 2; // 计算Frame的左上角y坐标
this.setLocation(x, y); // 设置Frame的位置
// this.setLocationRelativeTo(null);
this.createActionEvent();
this.pack();
// this.validate();
this.setVisible(true);
// this.setAlwaysOnTop(true);
} catch (Exception e) {
e.printStackTrace();
return;
}
}
// 添加监听
public void createActionEvent() {
this.btnIn.addActionListener(this);
}
private List<TCComponent> compList = new ArrayList<TCComponent>();
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
Object source = e.getSource();
System.out.println("source==>+" + source);
if (this.btnIn.equals(source)) {
//导入的逻辑
String pathJTextFieldStr = pathJTextField.getText();
if(pathJTextFieldStr == null || pathJTextFieldStr.isEmpty()) {
MessageBox.post("请选择需要导入的Excel。", "提示", 2);
return;
}
MyProgressBarCompent comp = null;
FileInputStream input = null;
try {
SqlUtil.SRMGetTCDataConnection(prefs);
if(!pathJTextFieldStr.contains(".xlsx")) {
MessageBox.post("请选择.xlsx格式的Excel。", "提示", 2);
return;
}
File file = new File(pathJTextFieldStr);
input = new FileInputStream(file);
workbook = new XSSFWorkbook(input);
comp = new MyProgressBarCompent("", "正在进行导入...");
//获取sheet页
Sheet sheet0 = workbook.getSheet("工时规则表");
//excel每一列的字段和数据库对比 判断该列是否导入
LinkedHashMap<String, Integer> titleMap = new LinkedHashMap<String, Integer>();
Row row1 = sheet0.getRow(0);
for (int i = 0; i < 100; i++) {
Cell cell = row1.getCell(i);
if(cell == null || getCellValue(cell).isEmpty()) {
System.out.println("i==="+i);
break;
}else {
titleMap.put(getCellValue(cell), cell.getColumnIndex());
}
}
System.out.println("titleMap==="+titleMap.toString());
String selectTitleSql = "SELECT column_name FROM all_tab_columns WHERE owner = 'INFODBA' AND table_name = 'CHINT_WORKHOUR'";
System.out.println("selectTitleSql ========="+selectTitleSql);
ResultSet rs = SqlUtil.read(selectTitleSql.toString());
ArrayList<String> titleArray = new ArrayList<String>();
while (rs.next()) {
titleArray.add(rs.getString(1));
}
System.out.println("titleArray==="+titleArray.toString());
Iterator<Map.Entry<String, Integer>> iterator = titleMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, Integer> map = iterator.next();
if(!titleArray.contains(map.getKey())) {
iterator.remove();
System.out.println("被移除的key======================"+map.getKey());
}
}
//备份 将CHINT_WORKHOUR表中的数据全量拷贝至表CHINT_WORKHOUR_BACKUP中
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String newTime = simpleDateFormat.format(new Date());
String user = session.getUser().getStringProperty("object_string");
String saveSql = "INSERT INTO CHINT_WORKHOUR_BACKUP(\"COMPANYCODE\", \"PRODUCTTYPE\", \"PRODUCTXH\", \"JSASK\", \"GYNAME\", \"GYID\", \"GXNAME\", \"GXCODE\", \"ARTIFICIALTIME\", \"MACHINETIME\", \"READINESSTIME\", \"GXMARK\", \"BZTH\", \"ProCycle\", \"VOLTAGELEVEL\", \"USER\", \"CREATETIME\") " +
"SELECT \"COMPANYCODE\", \"PRODUCTTYPE\", \"PRODUCTXH\", \"JSASK\", \"GYNAME\", \"GYID\", \"GXNAME\", \"GXCODE\", \"ARTIFICIALTIME\", \"MACHINETIME\", \"READINESSTIME\", \"GXMARK\", \"BZTH\", \"ProCycle\", \"VOLTAGELEVEL\", '"+user+"', to_date('"+newTime+"','yyyy-mm-ddhh24:mi:ss')"+
"FROM CHINT_WORKHOUR";
System.out.println("saveSql ========="+saveSql);
SqlUtil.update(saveSql);
String groupID = SAPUtil.getGroupID(session);
//将当前用户登录组织的数据从CHINT_WORKHOUR表中删除
String deleteSql = "DELETE FROM CHINT_WORKHOUR WHERE COMPANYCODE ='"+groupID+"'";
SqlUtil.update(deleteSql);
//导入数据
//把导入的字段拼接
StringBuilder fieldStr = new StringBuilder();
//可以使用insert all into table(a) values(a) into table(a) values(a);
fieldStr.append("INSERT INTO CHINT_WORKHOUR(");
for (Map.Entry<String, Integer> map : titleMap.entrySet()) {
fieldStr.append("\"").append(map.getKey()).append("\",");
}
fieldStr.setLength(fieldStr.length() - 1);
fieldStr.append(") VALUES(");
// Integer[] values = (Integer[]) titleMap.values().toArray();
Integer[] values = titleMap.values().toArray(new Integer[0]);
for (int i = 2; i < sheet0.getLastRowNum()+1; i++) {
Row row = sheet0.getRow(i);
Cell cell = row.getCell(0);
if(getCellValue(cell).isEmpty()) {
break;
}else {
String insertSqlStr = getSql(fieldStr.toString(),row,values);
SqlUtil.update(insertSqlStr);
System.out.println("insertSqlStr==="+insertSqlStr);
}
}
// System.out.println("insertSql===="+insertSql.toString());
// SqlUtil.update(insertSql.toString());
} catch (Exception e2) {
e2.printStackTrace();
if (comp != null) {
comp.setVisible(false);
}
MessageBox.post("导入失败,请联系管理员!", "提示", 2);
}
if (comp != null) {
comp.setVisible(false);
}
MessageBox.post("导入成功!", "提示", 2);
}
}
private String getSql(String fieldStr, Row row, Integer[] values) {
// TODO Auto-generated method stub
StringBuilder tempInsertSql = new StringBuilder();
tempInsertSql.append(fieldStr);
for (int i = 0; i < values.length; i++) {
tempInsertSql.append("'").append(getCellValue(row.getCell(values[i]))).append("',");
}
tempInsertSql.setLength(tempInsertSql.length() - 1);
tempInsertSql.append(")");
System.out.println("tempInsertSql===="+tempInsertSql.toString());
insertSql.append(tempInsertSql).append(";");
return tempInsertSql.toString();
}
private JButton btnIn;
private JPanel getBtnPanel() {
JPanel topPanel = new JPanel();
topPanel.setLayout(new PropertyLayout());
btnIn = new JButton("导入");
topPanel.add("1.1.center", new JLabel(""));
topPanel.add("2.1.center", new JLabel(""));
topPanel.add("2.2.center", new JLabel(""));
topPanel.add("2.3.center", btnIn);
return topPanel;
}
// 查询部分
private JPanel getTopPanel() {
// TODO Auto-generated method stub
JPanel topPanel = new JPanel();
topPanel.setLayout(new PropertyLayout());
topPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
topPanel.add("1.1.left.center", new JLabel(""));
topPanel.add("2.1.left.center", new JLabel("文件存放位置:"));
topPanel.add("2.2.left.center", pathJTextField);
topPanel.add("2.3.left.center", outputButton);
// 注册输出按钮的点击事件监听器
outputButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// 创建文件选择器
JFileChooser fileChooser = new JFileChooser();
// 设置文件选择器只能选择文件夹
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
int result = fileChooser.showOpenDialog(topPanel);
if (result == JFileChooser.APPROVE_OPTION) {
// 获取用户选择的路径
String selectedPath = fileChooser.getSelectedFile().getPath();
// 输出用户选择的路径
System.out.println("用户选择的路径:" + selectedPath);
pathJTextField.setText(selectedPath);
}
}
});
return topPanel;
}
public String getCellValue(Cell cell) {
if(cell == null) {
return "";
}else {
int cellType = cell.getCellType();
System.out.println("cellType="+cellType+"===cell.getRowIndex()="+cell.getRowIndex()+"===cell.getColumnIndex()="+cell.getColumnIndex());
if(cellType == 1) {//string
return cell.getStringCellValue();
}else if(cellType == 3 || cellType == 0) {//num
double numericCellValue = cell.getNumericCellValue();
System.out.println("numericCellValue====================="+numericCellValue);
if(numericCellValue == 0.0) {
return ""; }
if (numericCellValue == Math.floor(numericCellValue) && !Double.isInfinite(numericCellValue)) {
long integerPart = (long) numericCellValue;
return integerPart+"";
}else {
return numericCellValue+"";
}
}else if(cellType == 2) {
// 检查单元格是否是公式类型
// 创建FormulaEvaluator
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
// 评估公式
CellValue valueEval = evaluator.evaluate(cell);
//System.out.println("valueEval.getCellType()============================================"+valueEval.getCellType());
if(valueEval.getCellType() == 1) {
return valueEval.getStringValue();
}else if(valueEval.getCellType() == 0) {//num
double numericCellValue = valueEval.getNumberValue();
// 创建DecimalFormat对象指定格式模式
DecimalFormat df = new DecimalFormat("#.00");
// 格式化数字
String formattedNumber = df.format(numericCellValue);
if(numericCellValue == 0.0) {
return ""; }
return formattedNumber;
}
}
}
return "";
}
}

@ -0,0 +1,69 @@
package com.connor.plm.txdp;
import java.util.HashMap;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.connor.chint.sap2.util.SAPUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
public class BZGSHandler extends AbstractHandler{
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession) app.getSession();
try {
//获取首选项判断用户是否可以使用该功能
String[] prefs = session.getPreferenceService().getStringValues("CHINT_WORKHOUR_ACL");
String userId = session.getUser().getUserId();
String groupID = SAPUtil.getGroupID(session);
HashMap<String, String> groupNamesMap = new HashMap<String, String>();
for (int i = 0; i < prefs.length; i++) {
String[] split = prefs[i].split(":");
groupNamesMap.put(split[0], split[1]);
}
System.out.println("groupNamesMap==="+groupNamesMap.toString());
String names = groupNamesMap.get(groupID);
System.out.println("names==="+names);
if(names == null || names.isEmpty()) {
MessageBox.post("您无权使用此功能,请联系管理员处理。", "提示", MessageBox.INFORMATION);
return null;
}else {
if(!names.contains(userId)) {
MessageBox.post("您无权使用此功能,请联系管理员处理。", "提示", MessageBox.INFORMATION);
return null;
}
}
new Thread() {
@Override
public void run() {
try {
new BZGSFram(session);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}.start();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return null;
}
}

@ -0,0 +1,44 @@
package com.connor.plm.txdp;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.connor.chint.yunpi.command.BomDcSapOp;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
public class GXTZHandler extends AbstractHandler{
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession) app.getSession();
try {
new Thread() {
@Override
public void run() {
try {
new GXTZOp(app).executeOperation();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}.start();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return null;
}
}

@ -0,0 +1,178 @@
package com.connor.plm.txdp;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.swing.JButton;
import javax.swing.JTextField;
import org.apache.poi.ss.usermodel.Workbook;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import com.connor.chint.sap2.util.BomToSapUtil;
import com.connor.chint.sap2.util.BomUtilWh;
import com.connor.chint.sap2.util.KUtil;
import com.connor.chint.sap2.util.MyProgressBarCompent;
import com.connor.chint.sap2.util.SAPMessageUtil;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil;
import com.connor.chint.sap2.util.TXTUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.AbstractAIFOperation;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentBOMWindow;
import com.teamcenter.rac.kernel.TCComponentBOMWindowType;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCComponentItemType;
import com.teamcenter.rac.kernel.TCComponentMEProcessRevision;
import com.teamcenter.rac.kernel.TCComponentUser;
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;
public class GXTZOp extends AbstractAIFOperation {
private AbstractAIFApplication app;
private TCSession session;
private String groupName;
private String userName;
private String[] prefs;
public GXTZOp(AbstractAIFApplication app) {
// Auto-generated constructor stub
this.app = app;
this.session = (TCSession) app.getSession();
prefs = session.getPreferenceService().getStringValues("CHINT_SRM_SQL_CONNECT");
}
@Override
public void executeOperation() throws Exception {
// Auto-generated method stub
MyProgressBarCompent comp = null;
SqlUtil.SRMGetTCDataConnection(prefs);
try {
KUtil.setByPass(true);
groupName = SAPUtil.getGroupID(session);
userName = getUserName(session);
System.out.println(groupName + "------------------" + userName);
InterfaceAIFComponent target = app.getTargetComponent();
TCComponentItemRevision degignRev = null;
if (target != null && target.getType().equals("ZT2_Design3DRevision")) {
degignRev = (TCComponentItemRevision) target;
} else {
MessageBox.post("请选择图纸版本", "", MessageBox.INFORMATION);
return;
}
// sql查询获取对应组的图纸id
HashMap<String, String> sqlMap = new HashMap<String, String>();
String selectSql = "SELECT \"drawingno\",\"source\" FROM CHINT_DESIGN__SOURCE_RULE WHERE \"factory\" = '"
+ groupName + "'";
System.out.println("selectSql =========" + selectSql);
ResultSet rs = SqlUtil.read(selectSql);
while (rs.next()) {
sqlMap.put(rs.getString(1), rs.getString(2));
}
if (sqlMap.size() == 0) {
MessageBox.post("该组织未在数据库中获取到图纸", "", MessageBox.INFORMATION);
return;
}
System.out.println("sqlMap====" + sqlMap.toString());
comp = new MyProgressBarCompent("", "正在进行更新图纸自制外购....");
String lineSeparator = System.lineSeparator();// 换行符
StringBuffer errMessage = new StringBuffer("");
StringBuffer succMessage = new StringBuffer("");
succMessage.append("成功修改数据如下:").append(lineSeparator);
errMessage.append("无法修改数据如下:").append(lineSeparator);
String current_user_name = getUserName(session);
TCComponentBOMWindowType bomWinType = (TCComponentBOMWindowType) session.getTypeComponent("BOMWindow");
TCComponentBOMWindow win = bomWinType.create(null);
TCComponentBOMLine setWindowTopLine = win.setWindowTopLine(degignRev.getItem(), degignRev, null, null);
// soa获取bom子
List<TCComponentItemRevision> childLines = BomToSapUtil.getBomLineTreeNodeSOA2(setWindowTopLine);
System.out.println("childLines.size====" + childLines.size());
// 遍历逻辑
for (int i = 0; i < childLines.size(); i++) {
TCComponentItemRevision tcComponentItemRevision = childLines.get(i);
String[] properties = tcComponentItemRevision
.getProperties(new String[] { "item_id", "item_revision_id" });
String zt2_Source = tcComponentItemRevision.getStringProperty("zt2_Source");
for (Entry<String, String> map : sqlMap.entrySet()) {
String key = map.getKey();
if (properties[0].contains(key)) {
String value = map.getValue();
System.out.println("item_id========" + properties[0]);
if (!zt2_Source.equals(value)) {
// 判断是否发布
if (KUtil.isTCM(tcComponentItemRevision)) {
errMessage.append(properties[0] + "-" + properties[1] + "因发布无法更改,请手工处理");
errMessage.append(lineSeparator);
} else {
// 判断登录人是否owning_user
TCComponent owning_user = tcComponentItemRevision.getReferenceProperty("owning_user");
String user_name = owning_user.getProperty("user_name");
if (current_user_name.equals(user_name)) {
// 修改版本的值
tcComponentItemRevision.setProperty("zt2_Source", value);
succMessage.append(
properties[0] + "-" + properties[1] + "已从" + (zt2_Source.equals("S1")?"自制":"外购") + "改成" + (value.equals("S1")?"自制":"外购"));
succMessage.append(lineSeparator);
} else {
errMessage.append(properties[0] + "-" + properties[1] + "所有者为" + user_name
+ ",无法更改,请联系" + user_name);
errMessage.append(lineSeparator);
}
}
}
}
}
}
win.close();
MessageBox.post(succMessage.toString() + lineSeparator + errMessage.toString(), "项目BOM传递SAP", 2);
} catch (Exception e) {
e.printStackTrace();
if (comp != null) {
comp.setVisible(false);
}
} finally {
KUtil.setByPass(false);
if (comp != null) {
comp.setVisible(false);
}
}
}
public String getUserName(TCSession session) throws TCException {
TCComponentUser user = session.getUser();
session.getUserName();
return user.getTCProperty("user_name").getDisplayValue();
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,58 @@
package com.connor.plm.txdp;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.connor.chint.sap2.util.ChintPreferenceUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
public class TXDPHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession) app.getSession();
try {
String type = ChintPreferenceUtil.getPreference("CHINT_IRON_TYPE", session);
if(type == null || type.isEmpty()) {
MessageBox.post("首选项CHINT_IRON_TYPE配置不正确", "提示", MessageBox.WARNING);
return null;
}
TCComponent target = (TCComponent) app.getTargetComponent();
if(target instanceof TCComponentItem && !target.isTypeOf(type)) {
MessageBox.post("请选择文件夹或铁心剪切单进行导入", "提示", MessageBox.WARNING);
return null;
}else if(target instanceof TCComponentItemRevision
&& !((TCComponentItemRevision)target).getItem().isTypeOf(type)) {
MessageBox.post("请选择文件夹或铁心剪切单进行导入", "提示", MessageBox.WARNING);
return null;
}else if(!(target instanceof TCComponentFolder)) {
MessageBox.post("请选择文件夹或铁心剪切单进行导入", "提示", MessageBox.WARNING);
return null;
}
new Thread() {
@Override
public void run() {
try {
new TXDPFram(session, target, type);
} catch (Exception e) {
// Auto-generated catch block
e.printStackTrace();
}
}
}.start();
} catch (Exception e) {
// : handle exception
e.printStackTrace();
}
return null;
}
}
Loading…
Cancel
Save