no-bomasyn
陈翼晖 2 years ago
parent d25571ebe1
commit b8a133df93

@ -22,7 +22,7 @@
<children>
<FlowPane fx:id="flowPane" alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<children>
<CheckBox fx:id="cb_errBtn" mnemonicParsing="false" onAction="#errBtnAction" text="仅显示错误数据" />
<CheckBox fx:id="cb_errBtn" mnemonicParsing="false" text="仅显示错误数据" />
</children>
</FlowPane>
<ScrollPane fx:id="scrollPane" prefHeight="1200.0" prefWidth="1200.0" style="-fx-padding: 5;" GridPane.rowIndex="1">

@ -1,16 +1,25 @@
package com.chint.plm.SearchSapResult;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.chint.plm.createEcn.Util;
import com.connor.chint.sap2.util.ChintPreferenceUtil;
import com.connor.chint.sap2.util.SqlUtil;
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 javafx.application.Platform;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
@ -18,6 +27,7 @@ import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
@ -27,6 +37,8 @@ import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;
@ -62,8 +74,8 @@ public class DetailsController {
@FXML
private TableColumn<DetailsBean, String> tc_batch;
@FXML
private TextField pageNumTxt;
@FXML
private TextField pageNumTxt;
@FXML
private TableColumn<DetailsBean, String> tc_wbs;
@FXML
@ -92,7 +104,10 @@ public class DetailsController {
private Button bt_all;
int pageNum = 0;
List<List<DetailsBean>> tableBeans;
List<List<DetailsBean>> tableBeans; // 记录表格里面的数据
List<List<DetailsBean>> errMsgBeans; // 记录错误的数据
List<List<DetailsBean>> allMsgBeans; // 记录全部数据
@FXML
void firstAction(ActionEvent event) {
@ -155,23 +170,41 @@ public class DetailsController {
protected AbstractAIFApplication app;
private TCSession session;
/**
* @param event
* @function
* @function EXCEL
*/
@FXML
void outputAction(ActionEvent event) {
// 获取首选项的文件
File tempFile = Util.getFile(session, "CHINT_BOM_RESULT_TEMPLATE", "MSExcelX");
if (tempFile == null) {
MessageBox.post("未找到excel模板请检查CHINT_BOM_RESULT_TEMPLATE.", "失败", MessageBox.INFORMATION);
return;
}
try {
FileInputStream in = new FileInputStream(tempFile);
XSSFWorkbook wb = new XSSFWorkbook(in);
in.close();
XSSFSheet sheetAt = wb.getSheet("SAP传递结果导出");
for (List<DetailsBean> detailList : tableBeans) {
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private StringBuilder sqlTotal;
public void initData(Stage primaryStage, 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对象
@ -200,7 +233,7 @@ public class DetailsController {
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));
@ -212,8 +245,8 @@ public class DetailsController {
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();
@ -224,10 +257,10 @@ public class DetailsController {
ObservableList<DetailsBean> data = FXCollections.observableArrayList(tableBeans.get(0));
tableView.getItems().clear();
tableView.setItems(data);
lb_page.setText("/"+tableBeans.size());
lb_page.setText("/" + tableBeans.size());
// this.tableBeans = tableBeans;
//最大化绑定
// 最大化绑定
primaryStage.widthProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
@ -242,71 +275,109 @@ public class DetailsController {
}
});
primaryStage.setMaximized(true);
cb_errBtn.selectedProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
// just show results
try {
if (flagEdit) {
flagEdit = false;
searchErrMsg();
Platform.runLater(() -> {
flagEdit = true;
});
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
System.out.println("END" + sqlTotal.toString());
SqlUtil.freeAll();
}
}
});
pageNumTxt.setOnKeyPressed(new EventHandler<KeyEvent>() {
@Override
public void handle(KeyEvent event) {
if (event.getCode() == KeyCode.ENTER) {
// showHistoryWords(querybox.getText());
}
}
});
}
private boolean flagEdit = true;
/**
* @param event
* @function
*/
@FXML
void errBtnAction(ActionEvent event) {
// @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具体信息 : 全部状态.
List<List<DetailsBean>> tableBeans = new ArrayList<List<DetailsBean>>();
SqlUtil.getTCDataConnection(prefs);
String sqlDetail = "";
if (cb_errBtn.isSelected()) {
sqlDetail = sqlTotal.toString() + " and status = 'E' ";
if (cb_errBtn.isSelected() && errMsgBeans.size() > 0) {
tableBeans = errMsgBeans;
} else if (!cb_errBtn.isSelected() && allMsgBeans.size() > 0) {
tableBeans = allMsgBeans;
} 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) {
String sqlDetail = "";
if (cb_errBtn.isSelected()) {
sqlDetail = sqlTotal.toString() + " and status = 'E' ";
} else {
sqlDetail = sqlTotal.toString();// + " and status = 'S' ";
}
String[] prefs = ChintPreferenceUtil.getPreferences("database_tc", session);
SqlUtil.getTCDataConnection(prefs);
System.out.println("cb_errBtn" + cb_errBtn.isSelected());
System.out.println("sqlDetail" + sqlDetail.toString());
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 % 40 == 1) {
beanList = new ArrayList<DetailsBean>();
tableBeans.add(beanList);
}
beanList.add(sumBean);
i = i + 1;
}
SqlUtil.freeAll();
if (tableBeans.size() == 0) {
beanList = new ArrayList<DetailsBean>();
tableBeans.add(beanList);
}
beanList.add(sumBean);
i = i + 1;
}
SqlUtil.freeAll();
if (tableBeans.size() == 0) {
beanList = new ArrayList<DetailsBean>();
tableBeans.add(beanList);
if (errMsgBeans.size() == 0 && cb_errBtn.isSelected()) {
errMsgBeans = tableBeans;
} else if (allMsgBeans.size() == 0 && !cb_errBtn.isSelected()) {
allMsgBeans = tableBeans;
}
}
ObservableList<DetailsBean> data = FXCollections.observableArrayList(tableBeans.get(0));
tableView.getItems().clear();
tableView.setItems(data);
pageNum = 0;
this.tableBeans = tableBeans;
lb_page.setText("/"+tableBeans.size());
lb_page.setText("/" + tableBeans.size());
pageNumTxt.setText("1");
}
}

@ -272,7 +272,7 @@ public class SearchSapController extends KFXPanelController {
i = i + 1;
}
if (tableBeans.size() == 0) {
MessageBox.post("未查询到传递记录.", "提示", 2);
MessageBox.post(frame,"未查询到传递记录.", "提示", 2);
beanList = new ArrayList<SumTableBean>();
tableBeans.add(beanList);
}
@ -308,7 +308,7 @@ public class SearchSapController extends KFXPanelController {
frame = (SapResultFrame) paramKFXPanel.getParentDialog();
addWindListener(frame);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setMaximumSize(frame.getMaximumSize());
System.out.println("frame==>" + frame);
this.app = AIFUtility.getCurrentApplication();
this.session = (TCSession) app.getSession();
@ -383,7 +383,7 @@ public class SearchSapController extends KFXPanelController {
}
};
});
// tableView.setMaxHeight(pageNum);
}
@ -402,7 +402,7 @@ public class SearchSapController extends KFXPanelController {
sapStateList.add("PLM数据检查未通过");
sapStateList.add("未返回");
sapStateList.add("处理中");
sapStateList.add("全部返回");
sapStateList.add("全部成功");
sapStateList.add("部分失败");
cb_sapState.getItems().addAll(sapStateList);
List<String> sapStatusList = new ArrayList<String>();

@ -22,7 +22,7 @@
<children>
<FlowPane fx:id="flowPane" alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0" style="-fx-padding: 5;">
<children>
<CheckBox fx:id="cb_errBtn" mnemonicParsing="false" onAction="#errBtnAction" text="仅显示错误数据" />
<CheckBox fx:id="cb_errBtn" mnemonicParsing="false" text="仅显示错误数据" />
</children>
</FlowPane>
<ScrollPane fx:id="scrollPane" prefHeight="1200.0" prefWidth="1200.0" style="-fx-padding: 5;" GridPane.rowIndex="1">

@ -26,36 +26,38 @@ import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
public class AssignIdController{
public class AssignIdController {
private String groupID;
private TCSession session;
private TextField field;
private TCComponent tar;
private boolean flag;
@FXML
private Button assignBtn;
private Button assignBtnTop; //变更管理中的指派按钮
@FXML
private TextField ylText;
@FXML
private Button assignBtn;
private Button assignBtnTop; // 变更管理中的指派按钮
@FXML
private TextField ylText;
@FXML
private Button closeBtn;
@FXML
private Button closeBtn;
@FXML
private ComboBox<String> bmComb;
@FXML
private ComboBox<String> bmComb;
@FXML
private ComboBox<String> factoryComb;
@FXML
private ComboBox<String> factoryComb;
/**
* @param session
* @param groupID ID
* @param field
* @param tar
* @param flag
* @param session
* @param groupID ID
* @param field
* @param tar
* @param flag
* @param assignBtn
* @function
*/
public void initData(TCSession session,String groupID,TextField field,TCComponent tar,boolean flag,Button assignBtn) {
public void initData(TCSession session, String groupID, TextField field, TCComponent tar, boolean flag,
Button assignBtn) {
// TODO Auto-generated method stub
this.groupID = groupID;
this.session = session;
@ -65,21 +67,22 @@ public class AssignIdController{
this.assignBtnTop = assignBtn;
getCombox();
}
@FXML
void okBtnClick(ActionEvent event) {
SimpleDateFormat sdf = new SimpleDateFormat("yy");
@FXML
void okBtnClick(ActionEvent event) {
SimpleDateFormat sdf = new SimpleDateFormat("yy");
String year = sdf.format(new Date());
String fac = factoryComb.getSelectionModel().getSelectedItem();
String off = bmComb.getSelectionModel().getSelectedItem();
if(off.equals("-")) {
if (off.equals("-")) {
off = "";
}
String TF = "";
/// if(1==1)
// return;
if (flag) { //临时
if (flag) { // 临时
TF = "L";
} else { //if (TF.trim().equals("正式更改通知单"))
} else { // if (TF.trim().equals("正式更改通知单"))
TF = "";
}
String searchWord = fac.split("-")[0] + off.split("-")[0] + "-" + year + TF;
@ -101,8 +104,8 @@ public class AssignIdController{
FLOW = String.format("%04d", Integer.valueOf(FLOW) + 1);
query = "update CHINT_ECN_CODE set FLOW='" + FLOW + "' where CODE='" + searchWord + "'";
} else {
query = "insert into CHINT_ECN_CODE (FACTORY,OFFICE,CODE,FLOW) VALUES('" + fac + "','" + off
+ "','" + searchWord + "','0002')";
query = "insert into CHINT_ECN_CODE (FACTORY,OFFICE,CODE,FLOW) VALUES('" + fac + "','" + off + "','"
+ searchWord + "','0002')";
// query = "insert into CHINT_ECN_CODE (FACTORY,OFFICE,CODE,FLOW) VALUES('" +
// fac + "','" + off
// + "','" + searchWord + "','0002')";
@ -122,32 +125,32 @@ public class AssignIdController{
}
assignBtnTop.setDisable(true);// 只能指派一次
assignBtn.setDisable(true);// 只能指派一次
Stage stage = (Stage)closeBtn.getScene().getWindow();
stage.close();
}
@FXML
void cancelBtnClick(ActionEvent event) {
Stage stage = (Stage)closeBtn.getScene().getWindow();
stage.close();
}
Stage stage = (Stage) closeBtn.getScene().getWindow();
stage.close();
}
@FXML
void selectDepart(ActionEvent event) {
@FXML
void cancelBtnClick(ActionEvent event) {
Stage stage = (Stage) closeBtn.getScene().getWindow();
stage.close();
}
}
@FXML
void selectDepart(ActionEvent event) {
@FXML
void selectFactory(ActionEvent event) {
}
}
@FXML
void selectFactory(ActionEvent event) {
}
/**
*
* @function
*/
public void getCombox() {
//根据首选项获取工厂和部门
// 根据首选项获取工厂和部门
String[] FO = session.getPreferenceService().getStringValues("CHINT_FAC_OFF");
List<String> facList = new ArrayList<>();
String first_FO = "";
@ -171,40 +174,40 @@ public class AssignIdController{
// foMap.put(FO[i].split(":")[0], list);
foMap.put(group, list);
}
//初始化下拉框的逻辑
// 初始化下拉框的逻辑
factoryComb.getItems().addAll(facList);
factoryComb.getSelectionModel().select(first_FO);
//添加监听 动态设置下拉框内容
// 添加监听 动态设置下拉框内容
factoryComb.valueProperty().addListener((obs, oldVal, newVal) -> {
System.out.println("选择了:" + newVal);
String index = factoryComb.getSelectionModel().getSelectedItem();
List<String> vector = foMap.get(index);
bmComb.getItems().clear();
bmComb.getItems().addAll(vector);
if(vector.size()==1 && vector.get(0).equals("-")) {
System.out.println("选择了:" + newVal);
String index = factoryComb.getSelectionModel().getSelectedItem();
List<String> vector = foMap.get(index);
bmComb.getItems().clear();
bmComb.getItems().addAll(vector);
if (vector.size() == 1 && vector.get(0).equals("-")) {
bmComb.setVisible(false);
}else {
} else {
bmComb.setVisible(true);
}
});
List<String> init = foMap.get(factoryComb.getSelectionModel().getSelectedItem());
bmComb.getItems().addAll(init);
//添加监听 预览信息
// 添加监听 预览信息
bmComb.valueProperty().addListener((obs, oldVal, newVal) -> {
System.out.println("选择了:" + newVal);
SimpleDateFormat sdf = new SimpleDateFormat("yy");
System.out.println("选择了:" + newVal);
SimpleDateFormat sdf = new SimpleDateFormat("yy");
String year = sdf.format(new Date());
String fac = factoryComb.getSelectionModel().getSelectedItem();
String off = bmComb.getSelectionModel().getSelectedItem();
if(off.equals("-")) {
if (off.equals("-")) {
off = "";
}
String TF = "";
if (flag) { //临时
if (flag) { // 临时
TF = "L";
} else { //if (TF.trim().equals("正式更改通知单"))
} else { // if (TF.trim().equals("正式更改通知单"))
TF = "";
}
String searchWord = fac.split("-")[0] + off.split("-")[0] + "-" + year + TF;
@ -238,7 +241,7 @@ public class AssignIdController{
e1.printStackTrace();
}
});
// comBoxOffice = new JComboBox(new DefaultComboBoxModel<String>(init.toArray(new String[init.size()])));
System.out.println("first_FO:" + first_FO);
// if (tar.getType().equals("ZT2_Change")) {
@ -259,5 +262,6 @@ public class AssignIdController{
//
// }
}
private Util util = new Util();
}

@ -35,14 +35,16 @@ import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
public class AssignIdDialog extends Application {
public class AssignIdDialog extends Application {
private String groupID;
private TCSession session;
private TextField field;
private TCComponent tar;
private Button assignBtn;
private boolean flag;
public AssignIdDialog(TCSession session,String groupID,TextField field,TCComponent tar,boolean flag,Button assignBtn) {
public AssignIdDialog(TCSession session, String groupID, TextField field, TCComponent tar, boolean flag,
Button assignBtn) {
super();
this.groupID = groupID;
this.session = session;
@ -51,19 +53,19 @@ public class AssignIdDialog extends Application {
this.flag = flag;
this.assignBtn = assignBtn;
}
@Override
public void start(Stage primaryStage) throws IOException {
public void start(Stage primaryStage) throws IOException {
// StackPane root = new StackPane();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("AssignIdPane.fxml"));
Parent root = (Parent) fxmlLoader.load();
Scene scene = new Scene(root, 400.0, 240.0);
AssignIdController controller = (AssignIdController) fxmlLoader.getController();
primaryStage.setTitle("֪ͨµ¥±àºÅ");
controller.initData(session,groupID,field,tar,flag,assignBtn);
primaryStage.setScene(scene);
primaryStage.show();
}
primaryStage.setTitle("֪ͨµ¥±àºÅ");
controller.initData(session, groupID, field, tar, flag, assignBtn);
primaryStage.setScene(scene);
primaryStage.show();
}
}

@ -7,18 +7,18 @@ import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.util.MessageBox;
public class CreateEcnCommond extends KCommand {
public CreateEcnCommond(AbstractAIFApplication app, String commandId, String actionInfo) {
super(app, commandId, actionInfo);
try {
InterfaceAIFComponent targetComponent = app.getTargetComponent();
if(targetComponent.getType().equals("ZT2_ProjectItem") || targetComponent.getType().equals("ZT2_Change")) {
if (targetComponent.getType().equals("ZT2_ProjectItem") || targetComponent.getType().equals("ZT2_Change")) {
new CreateEcnFrame();
}else {
} else {
MessageBox.post("请选中项目零组件或者更改通知单或文件夹", "", MessageBox.ERROR);
}
}catch(Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
}

@ -8,7 +8,7 @@ import com.chint.plm.fxUtil.KFrame;
import javafx.embed.swing.JFXPanel;
public class CreateEcnFrame extends KFrame{
public class CreateEcnFrame extends KFrame {
public CreateEcnFrame() {
super();

@ -4,10 +4,10 @@ import java.awt.Window;
import com.chint.plm.fxUtil.KFXPanel;
public class CreateEcnPanel extends KFXPanel{
public class CreateEcnPanel extends KFXPanel {
public CreateEcnPanel(Window dialog) {
super(dialog,"ChangeNoticePanel.fxml");
super(dialog, "ChangeNoticePanel.fxml");
// TODO Auto-generated constructor stub
}
}

@ -1,6 +1,5 @@
package com.chint.plm.createEcn;
import java.util.ArrayList;
import java.util.List;
@ -10,84 +9,87 @@ import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;
public class EcnBean {
protected SimpleIntegerProperty num;
protected TextArea drawNo;//图样代号
protected TextArea mark; //标记
protected TextArea poiNum; //处数
protected TextArea overChange;//更改前
protected TextArea overVersion;//更改前版本
protected TextArea afterVersion;//更改后版本
protected TextArea afterChange;//更改后
protected ComboBox<String> productSz = new ComboBox<String>();//特性等级
protected ComboBox<String> changeReason = new ComboBox<String>();//更改原因
protected ComboBox<String> wipTreat = new ComboBox<String>();//在制品处理
protected TextArea drawNo;// 图样代号
protected TextArea mark; // 标记
protected TextArea poiNum; // 处数
protected TextArea overChange;// 更改前
protected TextArea overVersion;// 更改前版本
protected TextArea afterVersion;// 更改后版本
protected TextArea afterChange;// 更改后
protected ComboBox<String> productSz = new ComboBox<String>();// 特性等级
protected ComboBox<String> changeReason = new ComboBox<String>();// 更改原因
protected ComboBox<String> wipTreat = new ComboBox<String>();// 在制品处理
public ComboBox<String> getProductSz() {
return productSz;
}
public void setProductSz(String productSz) {
this.productSz.getSelectionModel().select(productSz);
}
EcnBean(int ind, List<String> reasons, List<String> wips,List<String> products) {
EcnBean(int ind, List<String> reasons, List<String> wips, List<String> products) {
num = new SimpleIntegerProperty(ind);
drawNo = new TextArea(); //ComboBoxTextArea
drawNo = new TextArea(); // ComboBoxTextArea
drawNo.setPrefSize(200, 40);
mark = new TextArea(); //ComboBoxTextArea
mark = new TextArea(); // ComboBoxTextArea
mark.setPrefSize(200, 40);
poiNum = new TextArea(); //ComboBoxTextArea
poiNum = new TextArea(); // ComboBoxTextArea
poiNum.setPrefSize(200, 40);
overChange = new TextArea(); //ComboBoxTextArea
overChange = new TextArea(); // ComboBoxTextArea
overChange.setPrefSize(200, 40);
overVersion = new TextArea(); //ComboBoxTextArea
overVersion = new TextArea(); // ComboBoxTextArea
overVersion.setPrefSize(200, 40);
afterChange = new TextArea(); //ComboBoxTextArea
afterChange = new TextArea(); // ComboBoxTextArea
afterChange.setPrefSize(200, 40);
afterVersion = new TextArea(); //ComboBoxTextArea
afterVersion = new TextArea(); // ComboBoxTextArea
afterVersion.setPrefSize(200, 40);
wipTreat.getItems().addAll(wips);
productSz.getItems().addAll(products);
productSz.getSelectionModel().selectFirst();
changeReason.getItems().addAll(reasons);
}
EcnBean(int ind, List<String> reasons, List<String> wips, String drawNoVal, String markVal,
String placesNo, String changeBefore, String changeAfter, String reasonVal, String processType,
String szRevisionBef, String szRevisionAft) {
EcnBean(int ind, List<String> reasons, List<String> wips, String drawNoVal, String markVal, String placesNo,
String changeBefore, String changeAfter, String reasonVal, String processType, String szRevisionBef,
String szRevisionAft) {
num = new SimpleIntegerProperty(ind);
drawNo = new TextArea(); //ComboBoxTextArea
drawNo = new TextArea(); // ComboBoxTextArea
drawNo.setPrefSize(200, 40);
drawNo.setText(drawNoVal);
mark = new TextArea(); //ComboBoxTextArea
mark = new TextArea(); // ComboBoxTextArea
mark.setPrefSize(200, 40);
mark.setText(markVal);
poiNum = new TextArea(); //ComboBoxTextArea
poiNum = new TextArea(); // ComboBoxTextArea
poiNum.setPrefSize(200, 40);
poiNum.setText(placesNo);
overChange = new TextArea(); //ComboBoxTextArea
overChange = new TextArea(); // ComboBoxTextArea
overChange.setPrefSize(200, 40);
overChange.setText(changeBefore);
overVersion = new TextArea(); //ComboBoxTextArea
overVersion = new TextArea(); // ComboBoxTextArea
overVersion.setPrefSize(200, 40);
overVersion.setText(szRevisionBef);
afterChange = new TextArea(); //ComboBoxTextArea
afterChange = new TextArea(); // ComboBoxTextArea
afterChange.setPrefSize(200, 40);
afterChange.setText(changeAfter);
afterVersion = new TextArea(); //ComboBoxTextArea
afterVersion = new TextArea(); // ComboBoxTextArea
afterVersion.setPrefSize(200, 40);
afterVersion.setText(szRevisionAft);
wipTreat.getItems().addAll(wips);
wipTreat.getSelectionModel().select(processType);
changeReason.getItems().addAll(reasons);
@ -174,6 +176,4 @@ public class EcnBean {
this.wipTreat = wipTreat;
}
}

@ -18,6 +18,9 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import com.connor.chint.sap2.util.KUtil;
import com.connor.chint.sap2.util.POIUtil;
@ -26,6 +29,7 @@ import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCComponentTcFile;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCPreferenceService;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
@ -52,6 +56,60 @@ public class Util {
return conn;
}
/**
*
* @param session
* @param PreServiceName:
* @param Filetype:excelMSExcelX
* @return
*/
public static File getFile(TCSession session,String PreServiceName,String Filetype) {
TCPreferenceService service = session.getPreferenceService();
String puid = service.getStringValue(PreServiceName);
if (puid == null)
{
System.out.println("未找到首选项");
return null;
}
TCComponentDataset dat;
try {
dat = (TCComponentDataset)session
.stringToComponent(puid);
TCComponentTcFile[] tcFile = dat.getTcFiles();
if(tcFile != null && tcFile.length == 0)
{
System.out.println("未找到配置文件");
}
else
{
return tcFile[0].getFmsFile();
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
private static void setCellValue(XSSFCell cell2,int index,XSSFRow row0,String cellValue) {
// TODO Auto-generated method stub
if(cell2 == null) {
cell2 = row0.createCell(index);
}
cell2.setCellValue(cellValue);
}
private static XSSFRow getRow(XSSFSheet sheetAt,int rowNum) {
// TODO Auto-generated method stub
XSSFRow row = sheetAt.getRow(rowNum);
if(row ==null) {
row = sheetAt.createRow(rowNum);
}
return row;
}
/**
* @param dateset
* @return ±ä¸üµ¥Ä£°åÎļþ

Loading…
Cancel
Save