parent
f4b5b5cb20
commit
167f989baf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,135 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import com.sun.javafx.util.Logging;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import java.awt.Window;
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.stage.Stage;
|
||||
//import sun.util.logging.PlatformLogger;
|
||||
|
||||
public abstract class KFXPanel extends Application {
|
||||
protected Scene scene;
|
||||
|
||||
protected KFXPanelController aifController;
|
||||
|
||||
protected Parent root;
|
||||
|
||||
protected String cssForm;
|
||||
|
||||
protected Window parentDialog;
|
||||
|
||||
static {
|
||||
Platform.setImplicitExit(false);
|
||||
// Logging.getCSSLogger().setLevel(Platform.class...STYLESHEET_CASPIAN....Level.OFF);
|
||||
}
|
||||
|
||||
public KFXPanel(Window dialog, String fxmlName) {
|
||||
setParentDialog(dialog);
|
||||
initUI(fxmlName);
|
||||
initData();
|
||||
}
|
||||
|
||||
public KFXPanel(Window dialog, Class<?> c, String css) {
|
||||
setParentDialog(dialog);
|
||||
this.cssForm = c.getResource(css).toExternalForm();
|
||||
initUI();
|
||||
initData();
|
||||
}
|
||||
|
||||
public void setParentDialog(Window dialog) {
|
||||
this.parentDialog = dialog;
|
||||
}
|
||||
|
||||
public Window getParentDialog() {
|
||||
return this.parentDialog;
|
||||
}
|
||||
|
||||
public Parent getRoot() {
|
||||
return this.root;
|
||||
}
|
||||
|
||||
public KFXPanelController getController() {
|
||||
return this.aifController;
|
||||
}
|
||||
|
||||
public Scene getScene() {
|
||||
if (this.scene == null) {
|
||||
this.scene = new Scene(this.root);
|
||||
this.scene.setFill(null);
|
||||
}
|
||||
return this.scene;
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
try {
|
||||
this.aifController.initData(this);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post(this.parentDialog, e.getMessage(), "", 1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initUI(String fxmlName) {
|
||||
try {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader();
|
||||
String resource = fxmlName;// "SearchSapResultPanel.fxml";
|
||||
fxmlLoader.setLocation(getClass().getResource(resource));
|
||||
this.root = (Parent) fxmlLoader.load();
|
||||
this.aifController = (KFXPanelController) fxmlLoader.getController();
|
||||
if (this.cssForm != null)
|
||||
this.root.getStylesheets().add(this.cssForm);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post(this.parentDialog, e.getMessage(), "", 1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initUI() {
|
||||
try {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader();
|
||||
String resource = "SearchSapResultPanel.fxml";
|
||||
fxmlLoader.setLocation(getClass().getResource(resource));
|
||||
this.root = (Parent) fxmlLoader.load();
|
||||
this.aifController = (KFXPanelController) fxmlLoader.getController();
|
||||
if (this.cssForm != null)
|
||||
this.root.getStylesheets().add(this.cssForm);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post(this.parentDialog, e.getMessage(), "", 1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void post(Window dialog, final String msg, final String title, int msgType) {
|
||||
if (dialog == null) {
|
||||
Platform.runLater(new Runnable() {
|
||||
public void run() {
|
||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||
alert.setTitle(title);
|
||||
alert.setHeaderText("");
|
||||
alert.setContentText(msg);
|
||||
alert.showAndWait();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MessageBox.post(dialog, msg, title, msgType);
|
||||
}
|
||||
}
|
||||
|
||||
// protected Stage primaryStage;
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
initUI();
|
||||
initData();
|
||||
// this.primaryStage = primaryStage;
|
||||
primaryStage.setScene(getScene());
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
|
||||
public abstract class KFXPanelController {
|
||||
@FXML
|
||||
protected AnchorPane coverPane;
|
||||
|
||||
public abstract void initData(KFXPanel paramKFXPanel) throws Exception;
|
||||
|
||||
public void setCoverVisible(final boolean visible) {
|
||||
if (this.coverPane != null) {
|
||||
Platform.runLater(new Runnable() {
|
||||
public void run() {
|
||||
KFXPanelController.this.coverPane.setVisible(visible);
|
||||
}
|
||||
});
|
||||
try {
|
||||
Thread.sleep(10L);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import com.teamcenter.rac.util.UIUtilities;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class KFrame extends JFrame {
|
||||
// protected KDialogController controller;
|
||||
|
||||
public KFrame() {
|
||||
try {
|
||||
// if (!this.controller.init())
|
||||
// return;
|
||||
initUI();
|
||||
showFrame();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MessageBox.post(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void showFrame() {
|
||||
pack();
|
||||
UIUtilities.centerToScreen(this);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
protected abstract void initUI() throws Exception;
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
<?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.chint.plm.rdmCreate.RdmCreateController">
|
||||
<children>
|
||||
<TitledPane fx:id="titlePane" animated="false" layoutY="-1.0" prefHeight="105.0" prefWidth="1272.0" text="创建研发项目">
|
||||
<content>
|
||||
<AnchorPane fx:id="anchorPane1" minHeight="0.0" minWidth="0.0" prefHeight="67.0" prefWidth="1270.0">
|
||||
<children>
|
||||
<GridPane fx:id="gridTop" layoutX="197.0" layoutY="18.0" prefHeight="49.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>
|
||||
<children>
|
||||
<Button fx:id="cjButton" mnemonicParsing="false" onAction="#cjbutton" prefHeight="41.0" prefWidth="136.0" text="创建" GridPane.halignment="CENTER" />
|
||||
<Button fx:id="gbxmButton" mnemonicParsing="false" onAction="#gbxmButton" prefHeight="43.0" prefWidth="135.0" text="关闭项目" GridPane.columnIndex="2" GridPane.halignment="CENTER" />
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</TitledPane>
|
||||
<Pane fx:id="pane1" layoutY="109.0" prefHeight="726.0" prefWidth="309.0">
|
||||
<children>
|
||||
<AnchorPane fx:id="anchorPane2" minHeight="0.0" minWidth="0.0" prefHeight="726.0" prefWidth="309.0">
|
||||
<children>
|
||||
<GridPane fx:id="grid" layoutX="20.0" layoutY="41.0" prefHeight="457.0" prefWidth="253.0">
|
||||
<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>
|
||||
<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>
|
||||
</GridPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane fx:id="pane2" layoutX="318.0" layoutY="108.0" prefHeight="733.0" prefWidth="949.0">
|
||||
<children>
|
||||
<AnchorPane fx:id="anchorPane3" minHeight="0.0" minWidth="0.0" prefHeight="726.0" prefWidth="949.0">
|
||||
<children>
|
||||
<ScrollPane fx:id="scrollpane" prefHeight="726.0" prefWidth="941.0">
|
||||
<content>
|
||||
<AnchorPane fx:id="anchorPane4" minHeight="0.0" minWidth="0.0" prefHeight="707.0" prefWidth="922.0">
|
||||
<children>
|
||||
<TableView fx:id="table" prefHeight="711.0" prefWidth="927.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</Pane>
|
||||
</children>
|
||||
</Pane>
|
@ -0,0 +1,200 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.scene.control.CheckBox;
|
||||
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();
|
||||
private CheckBox checkBox = new CheckBox();
|
||||
|
||||
|
||||
|
||||
|
||||
public CheckBox getCheckBox() {
|
||||
return checkBox;
|
||||
}
|
||||
|
||||
public void setCheckBox(CheckBox checkBox) {
|
||||
this.checkBox = checkBox;
|
||||
}
|
||||
|
||||
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.checkBox.setSelected(false);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public TextArea getOrdernumber() {
|
||||
return ordernumber;
|
||||
}
|
||||
|
||||
public TextArea getProjectno() {
|
||||
return projectno;
|
||||
}
|
||||
|
||||
public TextArea getRdmprojectno() {
|
||||
return rdmprojectno;
|
||||
}
|
||||
|
||||
public TextArea getProjectname() {
|
||||
return projectname;
|
||||
}
|
||||
|
||||
public TextArea getProjectleader() {
|
||||
return projectleader;
|
||||
}
|
||||
|
||||
public TextArea getFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public TextArea getPushuser() {
|
||||
return pushuser;
|
||||
}
|
||||
|
||||
public TextArea getPushdate() {
|
||||
return pushdate;
|
||||
}
|
||||
|
||||
public TextArea getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public TextArea getCreatedate() {
|
||||
return createdate;
|
||||
}
|
||||
|
||||
public TextArea getProjectleaderid() {
|
||||
return projectleaderid;
|
||||
}
|
||||
|
||||
public TextArea getPushuserid() {
|
||||
return pushuserid;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.log4j.chainsaw.Main;
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
|
||||
|
||||
import com.connor.chint.sap2.util.SAPUtil;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 成本单管理
|
||||
* @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);
|
||||
|
||||
String groupID = "";
|
||||
try {
|
||||
groupID = SAPUtil.getGroupID(session);
|
||||
} catch (TCException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("groupID==="+groupID);
|
||||
//Project Administration
|
||||
if(!groupID.equals("Project Administration")) {
|
||||
MessageBox.post("请切换至项目管理组执行此功能。", "提示", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
new RdmCreateFrame();
|
||||
}
|
||||
}.start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new RdmCreateFrame();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import java.awt.Window;
|
||||
|
||||
|
||||
|
||||
public class RdmCreatePanel extends KFXPanel {
|
||||
|
||||
public RdmCreatePanel(Window dialog) {
|
||||
super(dialog, "RdmCreate.fxml");
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMLine;
|
||||
|
||||
public class BomBean {
|
||||
|
||||
String revName;
|
||||
TCComponentBOMLine bomLine;
|
||||
public BomBean(String revName, TCComponentBOMLine bomLine) {
|
||||
super();
|
||||
this.revName = revName;
|
||||
this.bomLine = bomLine;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(revName);
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
BomBean other = (BomBean) obj;
|
||||
return other.revName.contains(revName);
|
||||
}
|
||||
public BomBean(String revName) {
|
||||
super();
|
||||
this.revName = revName;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BomBean [revName=" + revName + ", bomLine=" + bomLine + "]\n";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
public class CBean {
|
||||
|
||||
|
||||
String cId;
|
||||
String folderName;
|
||||
String piName;
|
||||
public String getcId() {
|
||||
return cId;
|
||||
}
|
||||
public void setcId(String cId) {
|
||||
this.cId = cId;
|
||||
}
|
||||
public String getFolderName() {
|
||||
return folderName;
|
||||
}
|
||||
public void setFolderName(String folderName) {
|
||||
this.folderName = folderName;
|
||||
}
|
||||
public String getPiName() {
|
||||
return piName;
|
||||
}
|
||||
public void setPiName(String piName) {
|
||||
this.piName = piName;
|
||||
}
|
||||
public CBean(String cId, String folderName, String piName) {
|
||||
super();
|
||||
this.cId = cId;
|
||||
this.folderName = folderName;
|
||||
this.piName = piName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.connor.chint.sap2.KCommand;
|
||||
import com.connor.chint.sap2.util.ChintPreferenceUtil;
|
||||
import com.connor.chint.sap2.util.SAPUtil;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class CreateKjBomCommand extends KCommand {
|
||||
|
||||
// private boolean top = true;
|
||||
// private TCComponentBOMLine line;
|
||||
public CreateKjBomCommand(AbstractAIFApplication app, String commandId, String actionInfo) {
|
||||
super(app, commandId, actionInfo);
|
||||
|
||||
|
||||
// InterfaceAIFComponent targetComponent = app.getTargetComponent();
|
||||
|
||||
try {
|
||||
|
||||
TCSession session = (TCSession)app.getSession();
|
||||
String groupID = SAPUtil.getGroupID(session);//
|
||||
String[] prefs = ChintPreferenceUtil.getPreferences("CHINT_kjbomTemp", session);
|
||||
List<KjBean> kjList = new ArrayList<KjBean>();
|
||||
for(String pref : prefs) {
|
||||
// 1ZDB300000P-xxx|1ZDB300000P=2-组件布置图;1ZDB400000T=3-铁心图纸&H铁心
|
||||
if(!pref.startsWith(groupID))
|
||||
continue;
|
||||
String[] split = pref.substring(groupID.length() + 1).split("\\|");
|
||||
String kjBomId = split[0];
|
||||
KjBean bean = new KjBean(kjBomId);
|
||||
String[] split2 = split[1].split(";");
|
||||
for(String s : split2) {
|
||||
String[] split3 = s.split("=");
|
||||
if(split3[1].contains("&")) {
|
||||
String[] split4 = split3[1].split("&");
|
||||
CBean cb = new CBean(split3[0],split4[0],split4[1]);
|
||||
bean.cbeans.add(cb);
|
||||
}else {
|
||||
CBean cb = new CBean(split3[0],split3[1],"");
|
||||
bean.cbeans.add(cb);
|
||||
}
|
||||
}
|
||||
kjList.add(bean);
|
||||
}
|
||||
if(kjList.size() == 0) {
|
||||
MessageBox.post("首选项中未找到配置,请登陆正确组", "", MessageBox.WARNING);
|
||||
return;
|
||||
}
|
||||
this.setRunnable(new KjBomDialog(app, "", kjList));
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KjBean {
|
||||
|
||||
public String kjBs;
|
||||
public String kjbomId;
|
||||
public List<CBean> cbeans = new ArrayList<CBean>();
|
||||
public String getKjbomId() {
|
||||
return kjbomId;
|
||||
}
|
||||
public void setKjbomId(String kjbomId) {
|
||||
this.kjbomId = kjbomId;
|
||||
}
|
||||
public KjBean(String kjbomId) {
|
||||
super();
|
||||
this.kjbomId = kjbomId;
|
||||
String[] split = kjbomId.split("-");
|
||||
kjBs = split[1];
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return kjbomId;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
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.JComboBox;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EtchedBorder;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import com.connor.chint.sap2.util.KUtil;
|
||||
import com.connor.chint.sap2.util.MyProgressBarCompent;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class KjBomDialog extends AbstractAIFDialog {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List<KjBean> kjList;
|
||||
// private AbstractAIFApplication app;
|
||||
private KjController controller;
|
||||
public KjBomDialog(AbstractAIFApplication app, String actionInfo,List<KjBean> beanList) {
|
||||
// Auto-generated constructor stub
|
||||
super(false);
|
||||
// KUtil.setByPass(true);
|
||||
// this.app = app;
|
||||
this.kjList = beanList;
|
||||
this.controller = new KjController(app);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Auto-generated method stub
|
||||
try {
|
||||
if (!controller.checkProject()) {
|
||||
MessageBox.post(this, "请选择项目文件夹对象", "", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
initUI();
|
||||
showDialog();
|
||||
/*
|
||||
* if(!controller.isAllHave) { MessageBox.post(this,
|
||||
* "项目中"+controller.name+"方案未同步WBS,请手动执行", "",MessageBox.INFORMATION); }else {
|
||||
* b_syn.setVisible(false); }
|
||||
*/
|
||||
} catch (Exception e) {
|
||||
|
||||
MessageBox.post(this, "申请方案编码时发生错误:" + e.getMessage(), "", MessageBox.ERROR);
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
private JButton okButton;
|
||||
private JButton celButton;
|
||||
private JComboBox<KjBean> kjCombox;
|
||||
public void initUI() {
|
||||
this.setTitle("创建框架BOM");
|
||||
this.setPreferredSize(new Dimension(400,150));
|
||||
JPanel p1 = new JPanel(new BorderLayout());
|
||||
p1.setBorder(new TitledBorder(new EtchedBorder(), "框架BOM模板"));
|
||||
|
||||
kjCombox = new JComboBox<KjBean>();
|
||||
for(KjBean bean:kjList) {
|
||||
kjCombox.addItem(bean);
|
||||
}
|
||||
p1.add(kjCombox);
|
||||
|
||||
JPanel rootPanel = new JPanel(new FlowLayout());
|
||||
this.okButton = new JButton("确认");
|
||||
this.celButton = new JButton("取消");
|
||||
|
||||
rootPanel.add(okButton);
|
||||
rootPanel.add(celButton);
|
||||
|
||||
this.setLayout(new BorderLayout());
|
||||
this.add(p1, BorderLayout.NORTH);
|
||||
this.add(rootPanel, BorderLayout.CENTER);
|
||||
// dialog.add(tablePanel, BorderLayout.CENTER);
|
||||
this.add(rootPanel, BorderLayout.SOUTH);
|
||||
this.pack();
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setVisible(true);
|
||||
|
||||
addListeners();
|
||||
}
|
||||
|
||||
private void addListeners() {
|
||||
// Auto-generated method stub
|
||||
celButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// Auto-generated method stub
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// Auto-generated method stub
|
||||
//开始创建框架BOM
|
||||
//1.遍历原有框架BOM获取项目代号 、 检查项目结构文件夹、检查id是否唯一
|
||||
//2.根据项目找到组件布置图 拆分BOM
|
||||
//3.根据云派信息转换所有权
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
MyProgressBarCompent comp = null;
|
||||
KUtil.setByPass(true);
|
||||
try {
|
||||
|
||||
comp = new MyProgressBarCompent("", "正在创建框架BOM......");
|
||||
int selectedIndex = kjCombox.getSelectedIndex();
|
||||
KjBean kjBean = kjList.get(selectedIndex);
|
||||
StringBuilder build = new StringBuilder("");
|
||||
String tempId = kjBean.getKjbomId();
|
||||
boolean checkFolder = controller.checkFolder(tempId, kjBean, build);
|
||||
if(!checkFolder) {
|
||||
comp.setVisible(false);
|
||||
dispose();
|
||||
MessageBox.post(build.toString(), "",2);
|
||||
|
||||
return;
|
||||
}
|
||||
if(controller.byqCCPFromProject.size()>1) {
|
||||
Object[] options = {"是","否"};
|
||||
int response = JOptionPane.showOptionDialog(null, "项目产成品存在多台变压器,请确认是否为同一工程图号", "选择",JOptionPane.YES_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
|
||||
if(response == -1 || response==1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
// List<CBean> cbeans = kjBean.cbeans;
|
||||
boolean createKjBom = controller.createKjBom(kjBean,comp);
|
||||
comp.setVisible(false);
|
||||
if(!createKjBom) {
|
||||
dispose();
|
||||
return;
|
||||
}else {
|
||||
dispose();
|
||||
MessageBox.post("框架BOM创建完成。", "提示",2);
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
// Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}finally {
|
||||
KUtil.setByPass(false);
|
||||
}
|
||||
if(comp!=null) {
|
||||
comp.setVisible(false);
|
||||
}
|
||||
dispose();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.connor.chint.sap2.materialno;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import com.connor.chint.sap2.util.ChintPreferenceUtil;
|
||||
import com.connor.chint.sap2.util.SqlUtil;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class FactoryChooseDialog extends AbstractAIFDialog {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private boolean update;
|
||||
|
||||
public FactoryChooseDialog(AbstractAIFApplication app, TCSession session, String groupID) {
|
||||
super(true);
|
||||
try {
|
||||
String[] database = ChintPreferenceUtil.getPreferences("database_tc", session);
|
||||
if (SqlUtil.getTCDataConnection(database) == null) {
|
||||
MessageBox.post("数据库连接失败,请检查首选项<database_tc>", "", 2);
|
||||
return;
|
||||
}
|
||||
String user = session.getUser().getUserId();
|
||||
update = false;
|
||||
String sql = "select \"factory\" from CHINT_MATERIAL_APPLY_RULE where \"userid\"='" + user + "'";
|
||||
System.out.println("sql:\n" + sql);
|
||||
ResultSet rs = SqlUtil.read(sql);
|
||||
String defaultGroup = "";
|
||||
if(rs.next()) {
|
||||
defaultGroup = rs.getString(1);
|
||||
update = true;
|
||||
}
|
||||
String[] applys = ChintPreferenceUtil.getPreferences("CHINT_MATERIAL_APPLY_LIST", session);
|
||||
JComboBox<String> j_Group = new JComboBox<>();
|
||||
j_Group.setSize(new Dimension(150, 30));
|
||||
j_Group.setPreferredSize(new Dimension(130, 30));
|
||||
j_Group.addItem("");
|
||||
for(String s : applys) {
|
||||
j_Group.addItem(s);
|
||||
}
|
||||
j_Group.setSelectedItem(defaultGroup);
|
||||
|
||||
JButton okBtn = new JButton("确定");
|
||||
okBtn.setSize(new Dimension(100, 30));
|
||||
okBtn.setPreferredSize(new Dimension(90, 30));
|
||||
okBtn.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
String groupID = j_Group.getSelectedItem().toString();
|
||||
if(groupID.isEmpty()) {
|
||||
MessageBox.post(FactoryChooseDialog.this, "请选择组织", "", MessageBox.WARNING);
|
||||
return;
|
||||
}
|
||||
String sql = "insert into CHINT_MATERIAL_APPLY_RULE values ('" + user + "','" + groupID + "')";
|
||||
if(update)
|
||||
sql = "update CHINT_MATERIAL_APPLY_RULE set \"factory\"='" + groupID + "' where \"userid\"='" + user + "'";
|
||||
System.out.println("sql:\n" + sql);
|
||||
SqlUtil.write(sql);
|
||||
SqlUtil.freeAll();
|
||||
|
||||
groupID = groupID.substring(0, groupID.indexOf(":"));
|
||||
System.out.println("groupID:" + groupID);
|
||||
//TODO
|
||||
// new Thread(new MaterialNoDialog(app, session, groupID)).start();
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
JButton cancelBtn = new JButton("取消");
|
||||
cancelBtn.setSize(new Dimension(100, 30));
|
||||
cancelBtn.setPreferredSize(new Dimension(90, 30));
|
||||
cancelBtn.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
SqlUtil.freeAll();
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
|
||||
panel.add(new JLabel("请选择组织:"));
|
||||
panel.add(j_Group);
|
||||
JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
|
||||
btnPanel.add(okBtn);
|
||||
btnPanel.add(cancelBtn);
|
||||
|
||||
this.setPreferredSize(new Dimension(500, 300));
|
||||
this.setMinimumSize(new Dimension(400, 200));
|
||||
this.setLayout(new BorderLayout());
|
||||
this.add(BorderLayout.CENTER, panel);
|
||||
this.add(BorderLayout.SOUTH, btnPanel);
|
||||
setDefaultLookAndFeelDecorated(true);
|
||||
Dimension screen = getToolkit().getScreenSize();
|
||||
setLocation((screen.width - getSize().width) / 2, (screen.height - getSize().height) / 2);
|
||||
this.setVisible(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MessageBox.post("错误:" + e, "", MessageBox.ERROR);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue