no-bomasyn
陈翼晖 2 years ago
parent 76b3cd4cd5
commit 89c029fe29

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="json_lib/jfxrt.jar"/>
<classpathentry exported="true" kind="lib" path="poi/okhttp-2.7.4.jar"/>
<classpathentry exported="true" kind="lib" path="json_lib/JavaFx-DateTimePicker-0.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="json_lib/jfxrt.jar"/>
<classpathentry exported="true" kind="lib" path="json_lib/commons-beanutils-1.7.0.jar"/>
<classpathentry exported="true" kind="lib" path="json_lib/commons-collections-3.2.jar"/>
<classpathentry exported="true" kind="lib" path="json_lib/commons-lang-2.4.jar"/>

@ -113,6 +113,6 @@ Bundle-ClassPath: .,
poi/woden-impl-dom-1.0M9.jar,
poi/wsdl4j-1.6.2.jar,
poi/wstx-asl-3.2.9.jar,
json_lib/jfxrt.jar,
json_lib/JavaFx-DateTimePicker-0.0.1.jar,
poi/okhttp-2.7.4.jar
poi/okhttp-2.7.4.jar,
json_lib/jfxrt.jar

@ -10,7 +10,7 @@
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult.DetailsController">
<children>
<GridPane>
<GridPane fx:id="girdPane">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
@ -20,14 +20,14 @@
<RowConstraints maxHeight="100.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<FlowPane alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<FlowPane fx:id="flowPane" alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<children>
<CheckBox fx:id="cb_errBtn" mnemonicParsing="false" onAction="#errBtnAction" text="仅显示错误数据" />
</children>
</FlowPane>
<ScrollPane prefHeight="1200.0" prefWidth="1200.0" style="-fx-padding: 5;" GridPane.rowIndex="1">
<ScrollPane fx:id="scrollPane" prefHeight="1200.0" prefWidth="1200.0" style="-fx-padding: 5;" GridPane.rowIndex="1">
<content>
<TableView fx:id="tableView" prefHeight="700.0" prefWidth="1190.0" style="-fx-faint-focus-color: transparent;">
<TableView fx:id="tableView" prefHeight="660.0" prefWidth="1180.0" style="-fx-faint-focus-color: transparent;">
<columns>
<TableColumn fx:id="tc_xh" prefWidth="75.0" text="序号" />
<TableColumn fx:id="tc_batch" prefWidth="75.0" text="批次号" />
@ -65,7 +65,7 @@
<right>
<FlowPane alignment="TOP_CENTER" prefHeight="140.0" prefWidth="589.0" BorderPane.alignment="CENTER">
<children>
<TextField alignment="TOP_RIGHT" prefHeight="30.0" prefWidth="154.0" text="1" />
<TextField fx:id="pageNumTxt" alignment="TOP_RIGHT" prefHeight="30.0" prefWidth="154.0" text="1" />
<Label fx:id="lb_page" prefWidth="80.0" text="/" />
<Button mnemonicParsing="false" onAction="#outputAction" text="结果导出" />
</children>

@ -10,9 +10,9 @@
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1600.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult.SearchSapController">
<children>
<ScrollPane prefHeight="200.0">
<ScrollPane fx:id="scrollPane" prefHeight="200.0">
<content>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<BorderPane fx:id="topBorder" prefHeight="200.0" prefWidth="200.0">
<top>
<TitledPane fx:id="tp_sxtj" prefHeight="650.0" text="筛选条件" BorderPane.alignment="CENTER">
<padding>
@ -114,9 +114,9 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="bt_close" mnemonicParsing="false" text="关闭" GridPane.columnIndex="3" />
<Button fx:id="bt_close" mnemonicParsing="false" onAction="#closeClick" text="关闭" GridPane.columnIndex="3" />
<Button fx:id="bt_search" mnemonicParsing="false" onAction="#searchAction" text="查询" GridPane.columnIndex="1" />
<Button fx:id="bt_czcx" mnemonicParsing="false" text="重置查询" GridPane.columnIndex="2" />
<Button fx:id="bt_czcx" mnemonicParsing="false" onAction="#resetClick" text="重置查询" GridPane.columnIndex="2" />
</children>
</GridPane>
</bottom>
@ -125,7 +125,7 @@
</TitledPane>
</top>
<center>
<BorderPane prefHeight="800.0" prefWidth="1200.0" BorderPane.alignment="CENTER">
<BorderPane fx:id="resultBorder" prefHeight="800.0" prefWidth="1200.0" BorderPane.alignment="CENTER">
<top>
<TitledPane fx:id="tp_result" prefHeight="600.0" prefWidth="200.0" text="结果" BorderPane.alignment="CENTER">
<padding>

@ -81,6 +81,6 @@ bin.includes = plugin.xml,\
json_lib/json-lib-2.2.2-jdk15.jar,\
json_lib/json-lib-2.2.3-jdk13.jar,\
json_lib/xom-1.2.5.jar,\
json_lib/jfxrt.jar,\
json_lib/JavaFx-DateTimePicker-0.0.1.jar,\
poi/okhttp-2.7.4.jar
poi/okhttp-2.7.4.jar,\
json_lib/jfxrt.jar

@ -10,12 +10,12 @@ import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class ChildMessage extends Application {
private List<List<DetailsBean>> tableBeans;
// private List<List<DetailsBean>> tableBeans;
private boolean onlyError;
private StringBuilder sqlTotal;
public ChildMessage(List<List<DetailsBean>> tableBeans,boolean onlyError,StringBuilder sqlTotal) {
public ChildMessage(boolean onlyError,StringBuilder sqlTotal) {
super();
this.tableBeans = tableBeans;
// this.tableBeans = tableBeans;
this.onlyError = onlyError;
this.sqlTotal = sqlTotal;
}
@ -28,7 +28,7 @@ public class ChildMessage extends Application {
Scene scene = new Scene(root, 1200.0, 800.0);
DetailsController controller = (DetailsController) fxmlLoader.getController();
primaryStage.setTitle("SAP´«µÝ½á¹ûÃ÷ϸ");
controller.initData(primaryStage,tableBeans,onlyError,sqlTotal);
controller.initData(primaryStage,onlyError,sqlTotal);
primaryStage.setScene(scene);
primaryStage.show();
}

@ -1,6 +1,7 @@
package com.chint.plm.SearchSapResult;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@ -12,6 +13,8 @@ import com.teamcenter.rac.kernel.TCSession;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
@ -19,12 +22,24 @@ import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
* @author cyh
*
*/
/**
* @author cyh
*
*/
public class DetailsController {
@FXML
@ -47,6 +62,8 @@ public class DetailsController {
@FXML
private TableColumn<DetailsBean, String> tc_batch;
@FXML
private TextField pageNumTxt;
@FXML
private TableColumn<DetailsBean, String> tc_wbs;
@FXML
@ -76,6 +93,7 @@ public class DetailsController {
int pageNum = 0;
List<List<DetailsBean>> tableBeans;
@FXML
void firstAction(ActionEvent event) {
pageNum = 0;
@ -86,8 +104,8 @@ public class DetailsController {
@FXML
void lastAction(ActionEvent event) {
if(pageNum>0) {
pageNum = pageNum -1;
if (pageNum > 0) {
pageNum = pageNum - 1;
}
ObservableList<DetailsBean> data = FXCollections.observableArrayList(tableBeans.get(pageNum));
tableView.getItems().clear();
@ -96,8 +114,8 @@ public class DetailsController {
@FXML
void nextAction(ActionEvent event) {
if(pageNum<tableBeans.size()-1) {
pageNum = pageNum +1;
if (pageNum < tableBeans.size() - 1) {
pageNum = pageNum + 1;
}
ObservableList<DetailsBean> data = FXCollections.observableArrayList(tableBeans.get(pageNum));
tableView.getItems().clear();
@ -106,36 +124,57 @@ public class DetailsController {
@FXML
void tailAction(ActionEvent event) {
pageNum = tableBeans.size()-1;
pageNum = tableBeans.size() - 1;
ObservableList<DetailsBean> data = FXCollections.observableArrayList(tableBeans.get(pageNum));
tableView.getItems().clear();
tableView.setItems(data);
}
@FXML
private FlowPane flowPane;
@FXML
private ScrollPane scrollPane;
@FXML
private GridPane girdPane;
/**
* @param event
* @function
*/
@FXML
void allAction(ActionEvent event) {
List<DetailsBean> allBeans = new ArrayList<DetailsBean>();
for(int i=0;i<tableBeans.size();i++) {
for (int i = 0; i < tableBeans.size(); i++) {
allBeans.addAll(tableBeans.get(i));
}
ObservableList<DetailsBean> data = FXCollections.observableArrayList(tableBeans.get(0));
ObservableList<DetailsBean> data = FXCollections.observableArrayList(allBeans);
tableView.getItems().clear();
tableView.setItems(data);
}
protected AbstractAIFApplication app;
private TCSession session;
/**
* @param event
* @function
*/
@FXML
void outputAction(ActionEvent event) {
}
private StringBuilder sqlTotal;
public void initData(Stage primaryStage,List<List<DetailsBean>> tableBeans,boolean onlyError,StringBuilder sqlTotal) {
public void initData(Stage primaryStage, boolean onlyError,
StringBuilder sqlTotal) {
// TODO Auto-generated method stub
this.sqlTotal = sqlTotal;
this.app = AIFUtility.getCurrentApplication();
this.session = (TCSession) app.getSession();
//表格列绑定bean对象
// 表格列绑定bean对象
tc_xh.setSortable(false);
tc_cDate.setSortable(false);
tc_msg.setSortable(false);
@ -147,62 +186,118 @@ public class DetailsController {
tc_plm.setSortable(false);
tc_material.setSortable(false);
tc_returnDate.setSortable(false);
//列绑定bean对象
tc_xh.setCellValueFactory(new PropertyValueFactory<DetailsBean,Integer>("num"));
tc_batch.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("batchNum"));
tc_material.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("productMaterialNo"));
tc_wbs.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("wbsNo"));
tc_SapResult.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("status"));
// 列绑定bean对象
tc_xh.setCellValueFactory(new PropertyValueFactory<DetailsBean, Integer>("num"));
tc_batch.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("batchNum"));
tc_material.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("productMaterialNo"));
tc_wbs.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("wbsNo"));
tc_SapResult.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("status"));
tc_msg.setCellValueFactory(new PropertyValueFactory<>("message"));
// tc_log.setCellValueFactory(new PropertyValueFactory<>("user"));
tc_cDate.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("createDate"));
tc_cTime.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("createTime"));
tc_returnDate.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("returnDate"));
tc_returnTime.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("returnTime"));
tc_plm.setCellValueFactory(new PropertyValueFactory<DetailsBean,String>("plmStatus"));
tc_cDate.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("createDate"));
tc_cTime.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("createTime"));
tc_returnDate.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("returnDate"));
tc_returnTime.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("returnTime"));
tc_plm.setCellValueFactory(new PropertyValueFactory<DetailsBean, String>("plmStatus"));
//绑定列宽
tc_xh.prefWidthProperty().bind(tableView.widthProperty().multiply(0.05));
tc_batch.prefWidthProperty().bind(tableView.widthProperty().multiply(0.08));
tc_material.prefWidthProperty().bind(tableView.widthProperty().multiply(0.12));
tc_wbs.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tc_SapResult.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tc_msg.prefWidthProperty().bind(tableView.widthProperty().multiply(0.35));
tc_cDate.prefWidthProperty().bind(tableView.widthProperty().multiply(0.08));
tc_cTime.prefWidthProperty().bind(tableView.widthProperty().multiply(0.08));
tc_returnDate.prefWidthProperty().bind(tableView.widthProperty().multiply(0.08));
tc_returnTime.prefWidthProperty().bind(tableView.widthProperty().multiply(0.08));
tc_plm.prefWidthProperty().bind(tableView.widthProperty().multiply(0.07));
//触发查询,默认错误数据
try {
cb_errBtn.setSelected(true);
searchErrMsg();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ObservableList<DetailsBean> data = FXCollections.observableArrayList(tableBeans.get(0));
tableView.getItems().clear();
tableView.setItems(data);
lb_page.setText("/"+tableBeans.size());
// this.tableBeans = tableBeans;
this.tableBeans = tableBeans;
//最大化绑定
primaryStage.widthProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
// 更新GUI组件
// Platform.runLater(new Runnable() {
double width = primaryStage.getWidth();
System.out.println("width==>" + width);
girdPane.setPrefWidth(width * 0.98);
flowPane.setPrefWidth(width * 0.98);
scrollPane.setPrefWidth(width * 0.98);
tableView.setPrefWidth(width * 0.98);
}
});
primaryStage.setMaximized(true);
}
/**
* @param event
* @function
*/
@FXML
void errBtnAction(ActionEvent event) {
try {
cb_errBtn.setDisable(true);
searchErrMsg();
cb_errBtn.setDisable(false);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
System.out.println("END" + sqlTotal.toString());
SqlUtil.freeAll();
}
}
/**
* @throws Exception
* @function
*/
private void searchErrMsg() throws Exception {
String[] prefs = ChintPreferenceUtil.getPreferences("database_tc", session);
//单个BOM具体信息 : 全部状态.
// 单个BOM具体信息 : 全部状态.
List<List<DetailsBean>> tableBeans = new ArrayList<List<DetailsBean>>();
SqlUtil.getTCDataConnection(prefs);
String sqlDetail = "";
if(cb_errBtn.isSelected()) {
sqlDetail = sqlTotal.toString()+" and status = 'E' ";
}else {
sqlDetail = sqlTotal.toString()+" and status = 'S' ";
if (cb_errBtn.isSelected()) {
sqlDetail = sqlTotal.toString() + " and status = 'E' ";
} else {
sqlDetail = sqlTotal.toString();// + " and status = 'S' ";
}
ResultSet read = SqlUtil.read(sqlDetail);
int i=1;
int i = 1;
List<DetailsBean> beanList = null;
while(read.next()) {
//分页 20 查询结果放入表格
while (read.next()) {
// 分页 20 查询结果放入表格
DetailsBean sumBean = new DetailsBean(new SimpleIntegerProperty(i),
new SimpleStringProperty(read.getString(1)),new SimpleStringProperty(read.getString(2)),
new SimpleStringProperty(read.getString(3)),new SimpleStringProperty(read.getString(4)),
new SimpleStringProperty(read.getString(5)),new SimpleStringProperty(read.getString(6)),
new SimpleStringProperty(read.getString(7)),new SimpleStringProperty(read.getString(8)),
new SimpleStringProperty(read.getString(9)),new SimpleStringProperty(read.getString(10)));
if(i % 20 ==1) {
new SimpleStringProperty(read.getString(1)), new SimpleStringProperty(read.getString(2)),
new SimpleStringProperty(read.getString(3)), new SimpleStringProperty(read.getString(4)),
new SimpleStringProperty(read.getString(5)), new SimpleStringProperty(read.getString(6)),
new SimpleStringProperty(read.getString(7)), new SimpleStringProperty(read.getString(8)),
new SimpleStringProperty(read.getString(9)), new SimpleStringProperty(read.getString(10)));
if (i % 20 == 1) {
beanList = new ArrayList<DetailsBean>();
tableBeans.add(beanList);
}
beanList.add(sumBean);
i=i+1;
i = i + 1;
}
SqlUtil.freeAll();
if(tableBeans.size()==0) {
if (tableBeans.size() == 0) {
beanList = new ArrayList<DetailsBean>();
tableBeans.add(beanList);
}
@ -210,14 +305,8 @@ public class DetailsController {
tableView.getItems().clear();
tableView.setItems(data);
pageNum = 0;
}catch(Exception ex){
ex.printStackTrace();
}finally {
System.out.println("END"+sqlTotal.toString());
SqlUtil.freeAll();
}
this.tableBeans = tableBeans;
lb_page.setText("/"+tableBeans.size());
}
}

@ -1,23 +1,32 @@
package com.chint.plm.SearchSapResult;
import java.awt.Component;
import java.awt.Window;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.sql.ResultSet;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame;
import org.casic.javafx.control.DateTimePicker;
import com.chint.plm.createEcn.CreateEcnFrame;
import com.chint.plm.fxUtil.KFXPanel;
import com.chint.plm.fxUtil.KFXPanelController;
import com.connor.chint.sap2.util.ChintPreferenceUtil;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil;
import com.connor.plm.CostListManagement.pojo.QuotationMX;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
import edu.emory.mathcs.backport.java.util.Arrays;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
@ -25,21 +34,24 @@ import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.SingleSelectionModel;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.TitledPane;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;
public class SearchSapController extends KFXPanelController {
@FXML
private TitledPane tp_result;
@ -49,180 +61,185 @@ public class SearchSapController extends KFXPanelController {
@FXML
private TitledPane mxtjPane;
@FXML
private GridPane bt_cx; // °´Å¥µÄpane
@FXML
private Button bt_close; //关闭
private Button bt_close; // 关闭
@FXML
private Button bt_czcx;//重置查询
private Button bt_czcx;// 重置查询
@FXML
private StackPane stackPane;
//table的列
// table的列
@FXML
private TableColumn<SumTableBean,String> tc_xh;
private TableColumn<SumTableBean, String> tc_xh;
@FXML
private TableColumn<SumTableBean,String> tc_zrws;
private TableColumn<SumTableBean, String> tc_zrws;
@FXML
private TableColumn<SumTableBean,String> tc_rwh;
private TableColumn<SumTableBean, String> tc_rwh;
@FXML
private TableColumn<SumTableBean,String> tc_fqsj;
private TableColumn<SumTableBean, String> tc_fqsj;
@FXML
private TableColumn<SumTableBean,String> tc_fqr;
private TableColumn<SumTableBean, String> tc_fqr;
@FXML
private TableColumn<SumTableBean,String> tc_status;
private TableColumn<SumTableBean, String> tc_status;
@FXML
private TableColumn<SumTableBean,Object> tc_log;
private TableColumn<SumTableBean, Object> tc_log;
@FXML
private TableColumn<SumTableBean,String> tc_sapState;
private TableColumn<SumTableBean, String> tc_sapState;
@FXML
private TableColumn<SumTableBean,String> tc_plm;
private TableColumn<SumTableBean, String> tc_plm;
@FXML
private TableColumn<SumTableBean,Object> tc_result;
private TableColumn<SumTableBean, Object> tc_result;
@FXML
private TitledPane tp_sxtj;//筛选条件pane
private TitledPane tp_sxtj;// 筛选条件pane
@FXML
private TitledPane rwtjPane; //任务条件pane
private TitledPane rwtjPane; // 任务条件pane
@FXML
private GridPane gridPane; //第一个pane插入日期控件
private GridPane gridPane; // 第一个pane插入日期控件
@FXML
private TextField tx_bh; //文本 任务编号
private TextField tx_bh; // 文本 任务编号
@FXML
private ComboBox<String> cb_factory; //工厂下拉
private ComboBox<String> cb_factory; // 工厂下拉
@FXML
private TextField tx_wbs; //wbs号
private TextField tx_wbs; // wbs号
@FXML
private ComboBox<String> cb_status; //数据状态
private ComboBox<String> cb_status; // 数据状态
@FXML
private TextField tx_user;//发起人
private TextField tx_user;// 发起人
@FXML
private ComboBox<String> cb_sapState; //sap处理结果
private ComboBox<String> cb_sapState; // sap处理结果
@FXML
private TextField tx_projectName;//项目名称
private TextField tx_projectName;// 项目名称
@FXML
private CheckBox bt_errTask;//查询错误任务
private CheckBox bt_errTask;// 查询错误任务
@FXML
private CheckBox bt_errMsg; // µ¥¸öBOM´íÎóÐÅÏ¢
//明细条件
// 明细条件
@FXML
private ComboBox<String> tx_sapStatus;//sap数据状态
private ComboBox<String> tx_sapStatus;// sap数据状态
@FXML
private TextField tx_pcode;//父物料编码
private TextField tx_pcode;// 父物料编码
@FXML
private TextField tx_wbsMx;//wbs
private TextField tx_wbsMx;// wbs
@FXML
private TextField tx_sapReturn;//sap返回信息
private TextField tx_sapReturn;// sap返回信息
@FXML
private TextField tx_batchNum;//批次号
private TextField tx_batchNum;// 批次号
@FXML
private Button bt_wy; //按钮尾页
private Button bt_wy; // 按钮尾页
@FXML
private Button bt_syy; //上一页
private Button bt_syy; // 上一页
@FXML
private Button bt_xyy;//下一页
private Button bt_xyy;// 下一页
@FXML
private Button bt_sy;//首页
private Button bt_sy;// 首页
@FXML
private Button bt_search;
@FXML
private TableView<SumTableBean> tableView;
//全部关闭
// 全部关闭
@FXML
void clossAll(ActionEvent event) {
frame.dispose();
}
String getCombText(Object comb) {
String textVal = "";
if(comb instanceof TextField) {
textVal = ((TextField)comb).getText();
}else if(comb instanceof ComboBox) {
SingleSelectionModel<?> selectionModel = ((ComboBox<?>)comb).getSelectionModel();
if(selectionModel.getSelectedIndex()>=0) {
textVal = ((ComboBox<?>)comb).getSelectionModel().getSelectedItem().toString();
if (comb instanceof TextField) {
textVal = ((TextField) comb).getText();
} else if (comb instanceof ComboBox) {
SingleSelectionModel<?> selectionModel = ((ComboBox<?>) comb).getSelectionModel();
if (selectionModel.getSelectedIndex() >= 0) {
textVal = ((ComboBox<?>) comb).getSelectionModel().getSelectedItem().toString();
}
}else if(comb instanceof CheckBox) {
boolean selected = ((CheckBox)comb).isSelected();
} else if (comb instanceof CheckBox) {
boolean selected = ((CheckBox) comb).isSelected();
}
return textVal;
}
private int pageNum;//分页显示当前第几页
private int pageNum;// 分页显示当前第几页
private List<List<SumTableBean>> tableBeans = new ArrayList<List<SumTableBean>>();
//查询操作
// 查询操作
@FXML
void searchAction(ActionEvent event) {
//拼接查询语句
StringBuilder sql = new StringBuilder("select \"CODE\",\"USER\",STARTTIME,\"NUMBER\",SAPRESULT,DATASTATUS,PLMRESULT,LOGURL from CHINT_BOM_TO_SAP_SUM where 1=1");
// 拼接查询语句
StringBuilder sql = new StringBuilder(
"select \"CODE\",\"USER\",STARTTIME,\"NUMBER\",SAPRESULT,DATASTATUS,PLMRESULT,LOGURL from CHINT_BOM_TO_SAP_SUM where 1=1");
String code = getCombText(tx_bh);
if(!code.isEmpty()) {
if (!code.isEmpty()) {
sql.append(" and \"CODE\" = '").append(code).append("'");
}
String factory = getCombText(cb_factory);
if(!factory.isEmpty()) {
if (!factory.isEmpty()) {
sql.append(" and factory = '").append(factory).append("'");
}
String wbsno = getCombText(tx_wbs);
if(!wbsno.isEmpty()) {
if (!wbsno.isEmpty()) {
sql.append(" and wbsno = '").append(wbsno).append("'");
}
String datastatus = getCombText(cb_status);
if(!datastatus.isEmpty()) {
if (!datastatus.isEmpty()) {
sql.append(" and datastatus = '").append(datastatus).append("'");
}
String user = getCombText(tx_user);
System.out.println("user==>"+user);
if(!user.isEmpty()) {
System.out.println("user==>" + user);
if (!user.isEmpty()) {
sql.append(" and \"USER\" = '").append(user).append("'");
}
String sapresult = getCombText(cb_sapState);
if(!sapresult.isEmpty()) {
if (!sapresult.isEmpty()) {
sql.append(" and sapresult = '").append(sapresult).append("'");
}
String projectno = getCombText(tx_projectName);
if(!projectno.isEmpty()) {
if (!projectno.isEmpty()) {
sql.append(" and projectno = '").append(projectno).append("'");
}
if (bt_errTask.isSelected()) {
sql.append(" and SAPRESULT = '部分失败' ");
}
ObjectProperty<LocalDateTime> dateTimeProperty = dateTimeStart.dateTimeProperty();
if(dateTimeProperty!=null && dateTimeProperty.get()!=null) {
if (dateTimeProperty != null && dateTimeProperty.get() != null) {
String startTime = dateTimeProperty.get().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
sql.append(" and starttime >= to_date('").append(startTime).append("','yyyy-mm-ddhh24:mi:ss') "); //to_date(?,'yyyy-mm-ddhh24:mi:ss')
System.out.println("startTime==>"+startTime);
sql.append(" and starttime >= to_date('").append(startTime).append("','yyyy-mm-ddhh24:mi:ss') "); // to_date(?,'yyyy-mm-ddhh24:mi:ss')
System.out.println("startTime==>" + startTime);
}
ObjectProperty<LocalDateTime> dateTimeProperty2 = dateTimeEnd.dateTimeProperty();
if(dateTimeProperty2!=null && dateTimeProperty2.get()!=null) {
if (dateTimeProperty2 != null && dateTimeProperty2.get() != null) {
String endTime = dateTimeProperty2.get().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
sql.append(" and starttime <= to_date('").append(endTime).append("','yyyy-mm-ddhh24:mi:ss') "); //to_date(?,'yyyy-mm-ddhh24:mi:ss')
System.out.println("endTime==>"+endTime);
sql.append(" and starttime <= to_date('").append(endTime).append("','yyyy-mm-ddhh24:mi:ss') "); // to_date(?,'yyyy-mm-ddhh24:mi:ss')
System.out.println("endTime==>" + endTime);
}
//拼接DETAILS表的SQL信息
// 拼接DETAILS表的SQL信息
StringBuilder detailSql = new StringBuilder("");
String batchNum = getCombText(tx_batchNum);
if(!batchNum.isEmpty()) {
if (!batchNum.isEmpty()) {
detailSql.append(" and batchnumber = '").append(batchNum).append("'");
}
String wbsnoDetail = getCombText(tx_wbsMx);
if(!wbsnoDetail.isEmpty()) {
if (!wbsnoDetail.isEmpty()) {
detailSql.append(" and wbsno = '").append(wbsnoDetail).append("'");
}
String message = getCombText(tx_sapReturn);
if(!message.isEmpty()) {
if (!message.isEmpty()) {
detailSql.append(" and message like '%").append(message).append("%'");
}
String productmaterialno = getCombText(tx_pcode);
if(!productmaterialno.isEmpty()) {
if (!productmaterialno.isEmpty()) {
detailSql.append(" and productmaterialno like '%").append(productmaterialno).append("%'");
}
String status = getCombText(tx_sapStatus);
if(!status.isEmpty()) {
if(status.equals("成功")) {
if (!status.isEmpty()) {
if (status.equals("成功")) {
status = "S";
}else {
} else {
status = "E";
}
detailSql.append(" and status = '").append(status).append("'");
@ -231,55 +248,68 @@ public class SearchSapController extends KFXPanelController {
String[] prefs = ChintPreferenceUtil.getPreferences("database_tc", session);
SqlUtil.getTCDataConnection(prefs);
try {
tableBeans.clear();
sql.append(" order by \"CODE\" asc ");
System.out.println("read==>"+sql);
System.out.println("read==>" + sql);
ResultSet read = SqlUtil.read(sql.toString());
int i=1;
int i = 1;
List<SumTableBean> beanList = null;
while(read.next()) {
//分页 20 查询结果放入表格
System.out.println("read==>"+read.getInt(4));
while (read.next()) {
// 分页 20 查询结果放入表格
System.out.println("read==>" + read.getInt(4));
SumTableBean sumBean = new SumTableBean(new SimpleIntegerProperty(i),
new SimpleStringProperty(String.valueOf(read.getInt(1))),new SimpleStringProperty(read.getString(2)),
new SimpleStringProperty(read.getString(3)),new SimpleStringProperty(String.valueOf(read.getInt(4))),
new SimpleStringProperty(read.getString(5)),new SimpleStringProperty(read.getString(6)),
new SimpleStringProperty(read.getString(7)),bt_errMsg.isSelected(),detailSql,prefs,code,
new SimpleStringProperty(String.valueOf(read.getInt(1))),
new SimpleStringProperty(read.getString(2)), new SimpleStringProperty(read.getString(3)),
new SimpleStringProperty(String.valueOf(read.getInt(4))),
new SimpleStringProperty(read.getString(5)), new SimpleStringProperty(read.getString(6)),
new SimpleStringProperty(read.getString(7)), bt_errMsg.isSelected(), detailSql, prefs, code,
read.getString(8));
if(i % 20 ==1) {
if (i % 20 == 1) {
beanList = new ArrayList<SumTableBean>();
tableBeans.add(beanList);
}
beanList.add(sumBean);
i=i+1;
i = i + 1;
}
if(tableBeans.size()==0) {
MessageBox.post("未查询到传递记录.","提示",2);
if (tableBeans.size() == 0) {
MessageBox.post("未查询到传递记录.", "提示", 2);
beanList = new ArrayList<SumTableBean>();
tableBeans.add(beanList);
}
pageNum = 0;
System.out.println("beanList==>"+beanList.size());
System.out.println("beanList==>" + beanList.size());
ObservableList<SumTableBean> data = FXCollections.observableArrayList(tableBeans.get(0));
tableView.getItems().clear();
tableView.setItems(data);
}catch(Exception e) {
} catch (Exception e) {
e.printStackTrace();
}finally {
} finally {
SqlUtil.freeAll();
}
// if(bt_errMsg)
}
@FXML
private ScrollPane scrollPane;
@FXML
private BorderPane resultBorder;
@FXML
private BorderPane topBorder;
private SapResultFrame 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 = (SapResultFrame) paramKFXPanel.getParentDialog();
addWindListener(frame);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
System.out.println("frame==>" + frame);
this.app = AIFUtility.getCurrentApplication();
this.session = (TCSession) app.getSession();
dateTimeStart = new DateTimePicker();
@ -288,7 +318,7 @@ public class SearchSapController extends KFXPanelController {
gridPane.add(dateTimeEnd, 1, 4);
initCombox();
//表格列绑定bean对象
// 表格列绑定bean对象
tc_xh.setSortable(false);
tc_zrws.setSortable(false);
tc_rwh.setSortable(false);
@ -299,27 +329,65 @@ public class SearchSapController extends KFXPanelController {
tc_sapState.setSortable(false);
tc_plm.setSortable(false);
tc_result.setSortable(false);
//列绑定bean对象
tc_xh.setCellValueFactory(new PropertyValueFactory<SumTableBean,String>("num"));
tc_zrws.setCellValueFactory(new PropertyValueFactory<SumTableBean,String>("cTaskNum"));//cTaskNum
tc_rwh.setCellValueFactory(new PropertyValueFactory<SumTableBean,String>("taskNo"));
tc_fqsj.setCellValueFactory(new PropertyValueFactory<SumTableBean,String>("startTime"));
tc_fqr.setCellValueFactory(new PropertyValueFactory<SumTableBean,String>("user"));
// 列绑定bean对象
tc_xh.setCellValueFactory(new PropertyValueFactory<SumTableBean, String>("num"));
tc_zrws.setCellValueFactory(new PropertyValueFactory<SumTableBean, String>("cTaskNum"));// cTaskNum
tc_rwh.setCellValueFactory(new PropertyValueFactory<SumTableBean, String>("taskNo"));
tc_fqsj.setCellValueFactory(new PropertyValueFactory<SumTableBean, String>("startTime"));
tc_fqr.setCellValueFactory(new PropertyValueFactory<SumTableBean, String>("user"));
tc_status.setCellValueFactory(new PropertyValueFactory<>("dataStatus"));
tc_log.setCellValueFactory(new PropertyValueFactory<SumTableBean,Object>("logDownload"));
tc_sapState.setCellValueFactory(new PropertyValueFactory<SumTableBean,String>("sapResult"));
tc_plm.setCellValueFactory(new PropertyValueFactory<SumTableBean,String>("plmResult"));
tc_result.setCellValueFactory(new PropertyValueFactory<SumTableBean,Object>("details"));
tc_log.setCellValueFactory(new PropertyValueFactory<SumTableBean, Object>("logDownload"));
tc_sapState.setCellValueFactory(new PropertyValueFactory<SumTableBean, String>("sapResult"));
tc_plm.setCellValueFactory(new PropertyValueFactory<SumTableBean, String>("plmResult"));
tc_result.setCellValueFactory(new PropertyValueFactory<SumTableBean, Object>("details"));
tc_xh.prefWidthProperty().bind(tableView.widthProperty().multiply(0.05));
tc_zrws.prefWidthProperty().bind(tableView.widthProperty().multiply(0.08));
tc_rwh.prefWidthProperty().bind(tableView.widthProperty().multiply(0.12));
tc_fqsj.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tc_fqr.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tc_status.prefWidthProperty().bind(tableView.widthProperty().multiply(0.15));
tc_log.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tc_sapState.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tc_plm.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tc_result.prefWidthProperty().bind(tableView.widthProperty().multiply(0.1));
tp_result.setCollapsible(false);
mxtjPane.setCollapsible(false);
tp_sxtj.setCollapsible(false);
rwtjPane.setCollapsible(false);
tc_sapState.setCellFactory(column -> {
return new TableCell<SumTableBean, String>() {
@Override
protected void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty && !item.isEmpty()) {
// double contrastPrice = Double.parseDouble(item);
if (item.equals("未返回")) {
// 不做格式
setStyle("-fx-background-color: #ffff99;");
} else if (item.equals("部分失败")) {
setStyle("-fx-background-color: #FF6600;");
} else {
setStyle("-fx-background-color: #A9D08E;");
}
setText(getItem());
setAlignment(Pos.CENTER); // 设置单元格内容居中对齐
} else {
setStyle("");
setText(empty ? null : getItem());
setAlignment(Pos.CENTER); // 设置单元格内容居中对齐
}
}
};
});
// tableView.setMaxHeight(pageNum);
}
//初始化下拉框内容
// 初始化下拉框内容
private void initCombox() {
// TODO Auto-generated method stub
List<String> factoryList = new ArrayList<String>();
@ -343,8 +411,7 @@ public class SearchSapController extends KFXPanelController {
tx_sapStatus.getItems().addAll(sapStatusList);
}
//跳转首页
// 跳转首页
@FXML
void firstBtnAction(ActionEvent event) {
pageNum = 0;
@ -352,33 +419,108 @@ public class SearchSapController extends KFXPanelController {
tableView.getItems().clear();
tableView.setItems(data);
}
//跳转上一页
// 跳转上一页
@FXML
void lastBtnAction(ActionEvent event) {
if(pageNum>0) {
pageNum = pageNum -1;
if (pageNum > 0) {
pageNum = pageNum - 1;
}
ObservableList<SumTableBean> 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;
if (pageNum < tableBeans.size() - 1) {
pageNum = pageNum + 1;
}
ObservableList<SumTableBean> data = FXCollections.observableArrayList(tableBeans.get(pageNum));
tableView.getItems().clear();
tableView.setItems(data);
}
//跳转尾页
// 跳转尾页
@FXML
void tailBtnAction(ActionEvent event) {
pageNum = tableBeans.size()-1;
pageNum = tableBeans.size() - 1;
ObservableList<SumTableBean> data = FXCollections.observableArrayList(tableBeans.get(pageNum));
tableView.getItems().clear();
tableView.setItems(data);
}
/**
* @param frame
* @function
*/
private void addWindListener(SapResultFrame frame) {
// TODO Auto-generated method stub
frame.addComponentListener(new ComponentListener() {
@Override
public void componentShown(ComponentEvent e) {
// TODO Auto-generated method stub
}
@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);
scrollPane.setPrefWidth(width * 0.98);
topBorder.setPrefWidth(width * 0.98);
tp_sxtj.setPrefWidth(width * 0.98);
resultBorder.setPrefWidth(width * 0.98);
gridPane.setPrefWidth(width * 0.98);
tableView.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 resetClick(ActionEvent event) {
tx_bh.setText("");
cb_sapState.getSelectionModel().clearSelection();
cb_factory.getSelectionModel().clearSelection();
tx_user.setText("");
tx_wbs.setText("");
tx_projectName.setText("");
tx_pcode.setText("");
tx_wbsMx.setText("");
tx_batchNum.setText("");
tx_sapReturn.setText("");
cb_status.getSelectionModel().clearSelection();
tx_sapStatus.getSelectionModel().clearSelection();
bt_errTask.setSelected(false);
bt_errMsg.setSelected(false);
dateTimeStart.clearTimeProperty();
dateTimeEnd.clearTimeProperty();
}
@FXML
void closeClick(ActionEvent event) {
frame.dispose();
}
}

@ -10,7 +10,7 @@
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult.DetailsController">
<children>
<GridPane>
<GridPane fx:id="girdPane">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
@ -20,14 +20,14 @@
<RowConstraints maxHeight="100.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<FlowPane alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<FlowPane fx:id="flowPane" alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<children>
<CheckBox fx:id="cb_errBtn" mnemonicParsing="false" onAction="#errBtnAction" text="仅显示错误数据" />
</children>
</FlowPane>
<ScrollPane prefHeight="1200.0" prefWidth="1200.0" style="-fx-padding: 5;" GridPane.rowIndex="1">
<ScrollPane fx:id="scrollPane" prefHeight="1200.0" prefWidth="1200.0" style="-fx-padding: 5;" GridPane.rowIndex="1">
<content>
<TableView fx:id="tableView" prefHeight="700.0" prefWidth="1190.0" style="-fx-faint-focus-color: transparent;">
<TableView fx:id="tableView" prefHeight="660.0" prefWidth="1180.0" style="-fx-faint-focus-color: transparent;">
<columns>
<TableColumn fx:id="tc_xh" prefWidth="75.0" text="序号" />
<TableColumn fx:id="tc_batch" prefWidth="75.0" text="批次号" />
@ -65,7 +65,7 @@
<right>
<FlowPane alignment="TOP_CENTER" prefHeight="140.0" prefWidth="589.0" BorderPane.alignment="CENTER">
<children>
<TextField alignment="TOP_RIGHT" prefHeight="30.0" prefWidth="154.0" text="1" />
<TextField fx:id="pageNumTxt" alignment="TOP_RIGHT" prefHeight="30.0" prefWidth="154.0" text="1" />
<Label fx:id="lb_page" prefWidth="80.0" text="/" />
<Button mnemonicParsing="false" onAction="#outputAction" text="结果导出" />
</children>

@ -10,9 +10,9 @@
<StackPane fx:id="stackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1600.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.SearchSapResult.SearchSapController">
<children>
<ScrollPane prefHeight="200.0">
<ScrollPane fx:id="scrollPane" prefHeight="200.0">
<content>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<BorderPane fx:id="topBorder" prefHeight="200.0" prefWidth="200.0">
<top>
<TitledPane fx:id="tp_sxtj" prefHeight="650.0" text="筛选条件" BorderPane.alignment="CENTER">
<padding>
@ -114,9 +114,9 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="bt_close" mnemonicParsing="false" text="关闭" GridPane.columnIndex="3" />
<Button fx:id="bt_close" mnemonicParsing="false" onAction="#closeClick" text="关闭" GridPane.columnIndex="3" />
<Button fx:id="bt_search" mnemonicParsing="false" onAction="#searchAction" text="查询" GridPane.columnIndex="1" />
<Button fx:id="bt_czcx" mnemonicParsing="false" text="重置查询" GridPane.columnIndex="2" />
<Button fx:id="bt_czcx" mnemonicParsing="false" onAction="#resetClick" text="重置查询" GridPane.columnIndex="2" />
</children>
</GridPane>
</bottom>
@ -125,7 +125,7 @@
</TitledPane>
</top>
<center>
<BorderPane prefHeight="800.0" prefWidth="1200.0" BorderPane.alignment="CENTER">
<BorderPane fx:id="resultBorder" prefHeight="800.0" prefWidth="1200.0" BorderPane.alignment="CENTER">
<top>
<TitledPane fx:id="tp_result" prefHeight="600.0" prefWidth="200.0" text="结果" BorderPane.alignment="CENTER">
<padding>

@ -138,35 +138,35 @@ public class SumTableBean {
sqlTotal.append(this.detailSql);
try {
//单个BOM具体信息 : 全部状态.
List<List<DetailsBean>> tableBeans = new ArrayList<List<DetailsBean>>();
SqlUtil.getTCDataConnection(prefs);
String sqlDetail = "";
if(onlyError) {
sqlDetail = sqlTotal.toString()+" and status = 'E' ";
}else {
sqlDetail = sqlTotal.toString()+" and status = 'S' ";
}
ResultSet read = SqlUtil.read(sqlDetail);
int i=1;
List<DetailsBean> beanList = null;
while(read.next()) {
//·ÖÒ³ 20 ²éѯ½á¹û·ÅÈë±í¸ñ
DetailsBean sumBean = new DetailsBean(new SimpleIntegerProperty(i),
new SimpleStringProperty(read.getString(1)),new SimpleStringProperty(read.getString(2)),
new SimpleStringProperty(read.getString(3)),new SimpleStringProperty(read.getString(4)),
new SimpleStringProperty(read.getString(5)),new SimpleStringProperty(read.getString(6)),
new SimpleStringProperty(read.getString(7)),new SimpleStringProperty(read.getString(8)),
new SimpleStringProperty(read.getString(9)),new SimpleStringProperty(read.getString(10)));
if(i % 20 ==1) {
beanList = new ArrayList<DetailsBean>();
tableBeans.add(beanList);
}
beanList.add(sumBean);
i=i+1;
}
SqlUtil.freeAll();
ChildMessage open = new ChildMessage(tableBeans,this.onlyError,sqlTotal);
// List<List<DetailsBean>> tableBeans = new ArrayList<List<DetailsBean>>();
// SqlUtil.getTCDataConnection(prefs);
// String sqlDetail = "";
// if(onlyError) {
// sqlDetail = sqlTotal.toString()+" and status = 'E' ";
// }else {
// sqlDetail = sqlTotal.toString()+" and status = 'S' ";
// }
// ResultSet read = SqlUtil.read(sqlDetail);
// int i=1;
// List<DetailsBean> beanList = null;
// while(read.next()) {
// //·ÖÒ³ 20 ²éѯ½á¹û·ÅÈë±í¸ñ
// DetailsBean sumBean = new DetailsBean(new SimpleIntegerProperty(i),
// new SimpleStringProperty(read.getString(1)),new SimpleStringProperty(read.getString(2)),
// new SimpleStringProperty(read.getString(3)),new SimpleStringProperty(read.getString(4)),
// new SimpleStringProperty(read.getString(5)),new SimpleStringProperty(read.getString(6)),
// new SimpleStringProperty(read.getString(7)),new SimpleStringProperty(read.getString(8)),
// new SimpleStringProperty(read.getString(9)),new SimpleStringProperty(read.getString(10)));
// if(i % 20 ==1) {
// beanList = new ArrayList<DetailsBean>();
// tableBeans.add(beanList);
// }
// beanList.add(sumBean);
// i=i+1;
// }
//
// SqlUtil.freeAll();
ChildMessage open = new ChildMessage(this.onlyError,sqlTotal);
open.start(new Stage());
}catch(Exception ex){
ex.printStackTrace();

Loading…
Cancel
Save