装箱集成和工装需求

main
李建辉 11 months ago
parent 92113227ea
commit 2811ff7d92

@ -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();
}
}
}

@ -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 + "]";
}
}

@ -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);
}
}

@ -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>
Loading…
Cancel
Save