main
李建辉 8 months ago
parent 91c8cadc6e
commit 0b5e29dae1

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

@ -4,7 +4,7 @@
<extension point="org.eclipse.ui.commands"> <extension point="org.eclipse.ui.commands">
<!--工具条--> <!--工具条-->
<command name="创建RDM研发项目" id="com.connor.plm.rdmCreate.RdmCreateHandler"/> <!-- <command name="创建RDM研发项目" id="com.connor.plm.rdmCreate.RdmCreateHandler"/>-->
<command name="SRM图纸下发查询" id="com.chint.plm.SearchSapResult9.PlclIDHandler"/> <command name="SRM图纸下发查询" id="com.chint.plm.SearchSapResult9.PlclIDHandler"/>
<command name="SRM图纸下发" id="com.connor.plm.srm.SRMHandler"/> <command name="SRM图纸下发" id="com.connor.plm.srm.SRMHandler"/>
<command name="更新图纸自制外购" id="com.connor.plm.txdp.GXTZHandler"/> <command name="更新图纸自制外购" id="com.connor.plm.txdp.GXTZHandler"/>
@ -46,7 +46,7 @@
<extension <extension
point="org.eclipse.ui.handlers"> point="org.eclipse.ui.handlers">
<handler commandId="com.connor.plm.srm.FileIntegrationHandler" class="com.connor.plm.srm.FileIntegrationHandler"/> <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.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.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.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.TXDPHandler" class="com.connor.plm.txdp.TXDPHandler"/>
@ -787,7 +787,7 @@
</visibleWhen> </visibleWhen>
</command> </command>
<!--
<command commandId = "com.connor.plm.rdmCreate.RdmCreateHandler" id = "com.connor.plm.rdmCreate.RdmCreateHandler"> <command commandId = "com.connor.plm.rdmCreate.RdmCreateHandler" id = "com.connor.plm.rdmCreate.RdmCreateHandler">
<visibleWhen> <visibleWhen>
<and> <and>
@ -809,7 +809,7 @@
</and> </and>
</visibleWhen> </visibleWhen>
</command> </command>
-->
</menuContribution> </menuContribution>
</extension> </extension>

@ -1,100 +0,0 @@
<?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.rdmCreate.RdmCreateController">
<children>
<TitledPane fx:id="titlePane" animated="false" layoutY="-1.0" prefHeight="156.0" prefWidth="1272.0" text="创建研发项目">
<content>
<AnchorPane fx:id="anchorPane1" minHeight="0.0" minWidth="0.0" prefHeight="120.0" prefWidth="1270.0">
<children>
<GridPane fx:id="gridTop" layoutX="197.0" layoutY="18.0" prefHeight="90.0" prefWidth="839.0">
<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>
<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="cjButton" mnemonicParsing="false" onAction="#cjbutton" prefHeight="30.0" prefWidth="136.0" text="创建" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Button fx:id="gbxmButton" mnemonicParsing="false" onAction="#gbxmButton" prefHeight="30.0" prefWidth="135.0" text="关闭项目" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<SplitPane fx:id="splitPane" dividerPositions="0.23548740416210295" layoutY="165.0" prefHeight="675.0" prefWidth="1270.0">
<items>
<AnchorPane fx:id="anchorPane2" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children>
<GridPane fx:id="grid" layoutX="20.0" layoutY="41.0" prefHeight="457.0" prefWidth="253.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="122.0" minWidth="10.0" prefWidth="93.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="160.0" minWidth="10.0" prefWidth="160.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 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 prefHeight="20.0" prefWidth="82.0" text="内部订单号" />
<Label text="项目定义" GridPane.rowIndex="1" />
<Label text="集团项目号" GridPane.rowIndex="2" />
<Label text="项目名称" GridPane.rowIndex="3" />
<Label text="项目经理" GridPane.rowIndex="4" />
<Label text="工厂" GridPane.rowIndex="5" />
<Label text="推送者" GridPane.rowIndex="6" />
<Label text="推送时间早于" GridPane.rowIndex="7" />
<Label text="推送时间晚于" GridPane.rowIndex="8" />
<Label text="状态" GridPane.rowIndex="9" />
<TextField fx:id="f0" GridPane.columnIndex="1" />
<TextField fx:id="f1" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="f2" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="f3" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField fx:id="f4" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<TextField fx:id="f6" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<DatePicker fx:id="f7" GridPane.columnIndex="1" GridPane.rowIndex="7" />
<DatePicker fx:id="f8" GridPane.columnIndex="1" GridPane.rowIndex="8" />
<ComboBox fx:id="f5" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<ComboBox fx:id="f9" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="9" />
<Button fx:id="cxButton" mnemonicParsing="false" onAction="#cxButton" prefHeight="30.0" prefWidth="88.0" text="查询" GridPane.columnIndex="1" GridPane.rowIndex="11" />
</children>
</GridPane>
</children>
</AnchorPane>
<AnchorPane fx:id="anchorPane3" minHeight="0.0" minWidth="0.0" prefHeight="415.0" prefWidth="965.0">
<children>
<ScrollPane prefHeight="673.0" prefWidth="965.0">
<content>
<AnchorPane fx:id="anchorPane4" minHeight="0.0" minWidth="0.0" prefHeight="677.0" prefWidth="972.0">
<children>
<TableView fx:id="table" prefHeight="655.0" prefWidth="947.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
</children>
</AnchorPane>
</items>
</SplitPane>
</children>
</Pane>

@ -1,138 +0,0 @@
package com.connor.plm.rdmCreate;
import java.sql.Date;
import java.text.SimpleDateFormat;
import javafx.scene.control.TextArea;
public class RdmCreateBean {
private TextArea ordernumber = new TextArea();
private TextArea projectno = new TextArea();
private TextArea rdmprojectno = new TextArea();
private TextArea projectname = new TextArea();
private TextArea projectleader = new TextArea();
private TextArea factory = new TextArea();
private TextArea pushuser = new TextArea();
private TextArea pushdate = new TextArea();
private TextArea status = new TextArea();
private TextArea createdate = new TextArea();
private TextArea projectleaderid = new TextArea();
private TextArea pushuserid = new TextArea();
public RdmCreateBean(String ordernumber, String projectno, String rdmprojectno, String projectname,
String projectleader, String factory, String pushuser, Date pushdate, String status, Date createdate,
String projectleaderid, String pushuserid) {
super();
this.ordernumber.setText(ordernumber);
this.ordernumber.setEditable(false);
this.ordernumber.setPrefSize(200, 40);
this.projectno.setText(projectno);
this.projectno.setEditable(false);
this.projectno.setPrefSize(200, 40);
this.rdmprojectno.setText(rdmprojectno);
this.rdmprojectno.setEditable(false);
this.rdmprojectno.setPrefSize(200, 40);
this.projectname.setText(projectname);
this.projectname.setEditable(false);
this.projectname.setPrefSize(200, 40);
this.projectleader.setText(projectleader);
this.projectleader.setEditable(false);
this.projectleader.setPrefSize(200, 40);
this.factory.setText(factory);
this.factory.setEditable(false);
this.factory.setPrefSize(200, 40);
this.pushuser.setText(pushuser);
this.pushuser.setEditable(false);
this.pushuser.setPrefSize(200, 40);
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-M-dd");
this.pushdate.setText(sdf2.format(pushdate));
this.pushdate.setEditable(false);
this.pushdate.setPrefSize(200, 40);
this.status.setText(status);
this.status.setEditable(false);
this.status.setPrefSize(200, 40);
this.createdate.setText(sdf2.format(createdate));
this.createdate.setEditable(false);
this.createdate.setPrefSize(200, 40);
this.projectleaderid.setText(projectleaderid);
this.projectleaderid.setEditable(false);
this.projectleaderid.setPrefSize(200, 40);
this.pushuserid.setText(pushuserid);
this.pushuserid.setEditable(false);
this.pushuserid.setPrefSize(200, 40);
}
public void setOrdernumber(TextArea ordernumber) {
this.ordernumber = ordernumber;
}
public void setProjectno(TextArea projectno) {
this.projectno = projectno;
}
public void setRdmprojectno(TextArea rdmprojectno) {
this.rdmprojectno = rdmprojectno;
}
public void setProjectname(TextArea projectname) {
this.projectname = projectname;
}
public void setProjectleader(TextArea projectleader) {
this.projectleader = projectleader;
}
public void setFactory(TextArea factory) {
this.factory = factory;
}
public void setPushuser(TextArea pushuser) {
this.pushuser = pushuser;
}
public void setPushdate(TextArea pushdate) {
this.pushdate = pushdate;
}
public void setStatus(TextArea status) {
this.status = status;
}
public void setCreatedate(TextArea createdate) {
this.createdate = createdate;
}
public void setProjectleaderid(TextArea projectleaderid) {
this.projectleaderid = projectleaderid;
}
public void setPushuserid(TextArea pushuserid) {
this.pushuserid = pushuserid;
}
}

@ -1,414 +0,0 @@
package com.connor.plm.rdmCreate;
/**
* ===============================================================================
* 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.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponentProject;
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.ComboBox;
import javafx.scene.control.DatePicker;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.SplitPane;
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.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
public class RdmCreateController extends KFXPanelController {
private Connection conn;
private String PlanTime;//
@FXML
private Button cxButton;
@FXML
private TextField f0;
@FXML
private TextField f1;
@FXML
private AnchorPane anchorPane1;
@FXML
private TextField f2;
@FXML
private AnchorPane anchorPane2;
@FXML
private TextField f3;
@FXML
private TextField f4;
@FXML
private AnchorPane anchorPane3;
@FXML
private GridPane gridTop;
@FXML
private ComboBox<String> f5;
@FXML
private AnchorPane anchorPane4;
@FXML
private TextField f6;
@FXML
private TitledPane titlePane;
@FXML
private DatePicker f7;
@FXML
private DatePicker f8;
@FXML
private ComboBox<String> f9;
@FXML
private SplitPane splitPane;
@FXML
private Button cjButton;
@FXML
private GridPane grid;
@FXML
private Button gbxmButton;
@FXML
private Pane pane;
@FXML
private TableView<?> table;
// table的列
private TableColumn<String, TextField> tc_1 = new TableColumn<String, TextField>("序号");
private String f7Str;
private String f8Str;
private RdmCreateFrame frame;
protected AbstractAIFApplication app;
private TCSession session;
/**
*
*/
@Override
public void initData(KFXPanel paramKFXPanel) throws Exception {
// TODO Auto-generated method stub
frame = (RdmCreateFrame) paramKFXPanel.getParentDialog();
addWindListener(frame);
initCombox();
frame.setMaximumSize(frame.getMaximumSize());
System.out.println("frame==>" + frame);
this.app = AIFUtility.getCurrentApplication();
this.session = (TCSession) app.getSession();
f7 = new DatePicker();
f8 = new DatePicker();
//根据首选项初始化table
String[] chint_tcproject_result_rule = session.getPreferenceService().getStringValues("CHINT_TCPROJECT_RESULT_RULE");
if(chint_tcproject_result_rule == null || chint_tcproject_result_rule.length <= 0) {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("提示");
alert.setHeaderText("请正确配置“CHINT_TCPROJECT_RESULT_RULE”首选项");
//alert.setContentText("导入完成");
alert.showAndWait();
return;
}
for (int i = 0; i < chint_tcproject_result_rule.length; i++) {
String[] split = chint_tcproject_result_rule[i].split(":");
if(split.length == 3) {
TableColumn tempColume = new TableColumn<RdmCreateBean, TextArea>(split[0]);
tempColume.setSortable(false);
tempColume.setCellValueFactory(new PropertyValueFactory<RdmCreateBean, TextArea>(split[1]));
table.getColumns().add(tempColume);
}
}
//设置文本框的高度
// jTextField1.setPrefHeight(30);
// 表格列绑定bean对象
// tc_1.setSortable(false);
// 列绑定bean对象
// tc_1.setCellValueFactory(new PropertyValueFactory<GzxqBean, TextArea>("xh"));
//设置table列宽度
// tc_1.prefWidthProperty().bind(table.widthProperty().multiply(0.04));
// //设置是否可编辑
// 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
// table.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);
}
// 初始化下拉框内容
private void initCombox() {
// TODO Auto-generated method stub
List<String> gcList = new ArrayList<String>();
gcList.add("M060");
gcList.add("dba");
f5.getItems().addAll(gcList);
List<String> ztList = new ArrayList<String>();
ztList.add("未开始");
ztList.add("已完成");
f9.getItems().addAll(ztList);
}
/**
* @param frame
* @function
*/
private void addWindListener(RdmCreateFrame 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 cjbutton(ActionEvent event) {
}
@FXML
void gbxmButton(ActionEvent event) {
}
@FXML
void cxButton(ActionEvent event) {
f7Str = f7.getEditor().getText();
f8Str = f8.getEditor().getText();
String selectedFactory = f5.getSelectionModel().getSelectedItem();
String selectedStatus = f9.getSelectionModel().getSelectedItem();
//连接数据库 根据条件查询
String[] prefs = session.getPreferenceService().getStringValues("database_tc");
System.out.println("===============开始连接tc数据库===============");
conn = SqlUtil.getTCDataConnection(prefs);
System.out.println("======================清除");
table.getItems().clear();
List<RdmCreateBean> quotations = new ArrayList<RdmCreateBean>();
String factory = "";
// 拼接查询语句
String sql = "select ordernumber,projectno,rdmprojectno,projectname,projectleader,factory,pushuser,pushdate,status,createdate,projectleaderid,pushuserid from CHINT_RDM_PROJECT where 1=1 ";
if(f0.getText()!=null && !"".equals(f0.getText().trim())) {
sql += "and ordernumber = \'" + f0.getText() +"\'";
}
if(f1.getText()!=null && !"".equals(f1.getText().trim())) {
sql += "and projectno = \'" + f1.getText() +"\'";
}
if(f2.getText()!=null && !"".equals(f2.getText().trim())) {
sql += "and rdmprojectno = \'" + f2.getText() +"\'";
}
if(f3.getText()!=null && !"".equals(f3.getText().trim())) {
sql += "and projectname = \'" + f3.getText() +"\'";
}
if(f4.getText()!=null && !"".equals(f4.getText().trim())) {
sql += "and projectleader = \'" + f4.getText() +"\'";
}
if(selectedFactory != null && !selectedFactory.isEmpty()) {
sql += "and factory like \'%" + selectedFactory +"%\'";
}
if(f6.getText()!=null && !"".equals(f6.getText().trim())) {
sql += "and pushuser = \'" + f6.getText() +"\'";
}
if(f7Str !=null && !"".equals(f7Str)) {
sql += "and pushdate <= \'" + f7Str +"\'";
}
if(f8Str !=null && !"".equals(f8Str)) {
sql += "and pushdate >= \'" + f8Str +"\'";
}
if(selectedStatus != null && !selectedStatus.isEmpty()) {
sql += "and status = \'" + selectedStatus +"\'";
}
System.out.println("sql:"+sql);
PreparedStatement statement;
try {
int z=1;
statement = conn.prepareStatement(sql);
ResultSet res = statement.executeQuery();
//处理查询数据结果集
while (res.next()) {
RdmCreateBean rdmCreateBean = new RdmCreateBean(
res.getString("ordernumber") != null ? res.getString("ordernumber") : "",
res.getString("projectno") != null ? res.getString("projectno") : "",
res.getString("rdmprojectno") != null ? res.getString("rdmprojectno") : "",
res.getString("projectname") != null ? res.getString("projectname") : "",
res.getString("projectleader") != null ? res.getString("projectleader") : "",
res.getString("factory") != null ? res.getString("factory") : "",
res.getString("pushuser") != null ? res.getString("pushuser") : "",
res.getDate("pushdate"),
res.getString("status") != null ? res.getString("status") : "",
res.getDate("createdate"),
res.getString("projectleaderid") != null ? res.getString("projectleaderid") : "",
res.getString("pushuserid") != null ? res.getString("pushuserid") : "");
System.out.println("rdmCreateBean==="+rdmCreateBean);
quotations.add(rdmCreateBean);
}
}catch (Exception e) {
// TODO: handle exception
}
if(quotations.size() > 0) {
//组织界面数据
}else {
//未查到数据
}
}
}

@ -1,26 +0,0 @@
package com.connor.plm.rdmCreate;
import java.awt.BorderLayout;
import java.awt.Dimension;
import com.chint.plm.fxUtil.KFrame;
import javafx.embed.swing.JFXPanel;
public class RdmCreateFrame extends KFrame {
public RdmCreateFrame() {
super();
}
@Override
protected void initUI() throws Exception {
this.setTitle("´´½¨RDMÑз¢ÏîÄ¿");
this.setLayout(new BorderLayout());
this.setPreferredSize(new Dimension(1300, 900));
JFXPanel panel = new JFXPanel();
panel.setScene(new RdmCreatePanel(this).getScene());
this.add(BorderLayout.CENTER, panel);
}
}

@ -1,63 +0,0 @@
package com.connor.plm.rdmCreate;
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;
/**
*
* @author admin
* 2023/11/16
*/
public class RdmCreateHandler extends AbstractHandler{
@Override
public Object execute(ExecutionEvent arg0) {
// TODO Auto-generated method stub
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession)app.getSession();
try {
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(1240, height2); // 设置Frame的大小
// newJFrame.setLocation(x, y); // 设置Frame的位置
// newJFrame.setResizable(false);
// newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作
// newJFrame.setVisible(true);
new RdmCreateFrame();
}
}.start();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static void main(String[] args) {
new RdmCreateFrame();
}
}

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

@ -4,6 +4,7 @@ import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.SQLException; import java.sql.SQLException;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil; import com.connor.chint.sap2.util.SqlUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication; import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.AbstractAIFDialog; 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.TCComponentDataset;
import com.teamcenter.rac.kernel.TCComponentGroup; import com.teamcenter.rac.kernel.TCComponentGroup;
import com.teamcenter.rac.kernel.TCComponentItemRevision; import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession; import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox; import com.teamcenter.rac.util.MessageBox;
@ -37,6 +39,7 @@ public class SRMDialog extends AbstractAIFDialog {
public SRMDialog(AbstractAIFApplication app, TCSession session) throws Exception { public SRMDialog(AbstractAIFApplication app, TCSession session) throws Exception {
this.session = session; this.session = session;
System.out.println("222222222222222222222222222222222222");
this.app = app; this.app = app;
initUI(); initUI();
} }
@ -76,13 +79,18 @@ public class SRMDialog extends AbstractAIFDialog {
// »ñÈ¡uid // »ñÈ¡uid
String uid = revision.getUid(); String uid = revision.getUid();
System.out.println("uid===" + uid); System.out.println("uid===" + uid);
// 获取组信息
TCComponentGroup loginGroup = session.getUser().getLoginGroup();
//TCComponentGroup loginGroup = session.getUser().getLoginGroup();
String userName = session.getUserName(); String userName = session.getUserName();
String userId = session.getUser().getUserId(); String userId = session.getUser().getUserId();
System.out.println("userName================"+userName); System.out.println("userName================"+userName);
System.out.println("userId================"+userId); 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); System.out.println("groupName===" + groupName);
// insertÊý¾Ý¿â // insertÊý¾Ý¿â
String[] prefs = session.getPreferenceService().getStringValues("CHINT_SRM_SQL_CONNECT"); 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.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility; import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession; import com.teamcenter.rac.kernel.TCSession;
public class SRMHandler extends AbstractHandler{ public class SRMHandler extends AbstractHandler{
@ -15,6 +16,7 @@ public class SRMHandler extends AbstractHandler{
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
AbstractAIFApplication app = AIFUtility.getCurrentApplication(); AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession) app.getSession(); TCSession session = (TCSession) app.getSession();
try { try {
new Thread() { new Thread() {

@ -96,7 +96,7 @@ public class TXDPFram extends JFrame implements ActionListener {
private void initUI() { private void initUI() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
try { try {
this.setTitle("WMS集成默认物料维护界面"); this.setTitle("铁心数据导入界面");
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
JPanel topPanel = getTopPanel(); JPanel topPanel = getTopPanel();

Loading…
Cancel
Save