|
|
|
@ -88,7 +88,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
@FXML
|
|
|
|
|
private GridPane gridPane;
|
|
|
|
|
@FXML
|
|
|
|
|
private RadioButton rb_tempChange; //临时更改通知单
|
|
|
|
|
private RadioButton rb_tempChange; // 临时更改通知单
|
|
|
|
|
@FXML
|
|
|
|
|
private RadioButton rb_Process;
|
|
|
|
|
@FXML
|
|
|
|
@ -106,7 +106,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
private TCSession session;
|
|
|
|
|
private TCComponent target;
|
|
|
|
|
@FXML
|
|
|
|
|
private RadioButton rb_formalChange; //正式更改通知单
|
|
|
|
|
private RadioButton rb_formalChange; // 正式更改通知单
|
|
|
|
|
@FXML
|
|
|
|
|
private TextField factoryText;
|
|
|
|
|
@FXML
|
|
|
|
@ -134,20 +134,20 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
this.app = AIFUtility.getCurrentApplication();
|
|
|
|
|
this.session = (TCSession) app.getSession();
|
|
|
|
|
target = (TCComponent)app.getTargetComponent();
|
|
|
|
|
target = (TCComponent) app.getTargetComponent();
|
|
|
|
|
database = session.getPreferenceService().getStringValues("database_tc");
|
|
|
|
|
CreateEcnFrame frame = (CreateEcnFrame)paramKFXPanel.getParentDialog();
|
|
|
|
|
CreateEcnFrame frame = (CreateEcnFrame) paramKFXPanel.getParentDialog();
|
|
|
|
|
this.frame = frame;
|
|
|
|
|
addWindListener(frame);
|
|
|
|
|
//过程组
|
|
|
|
|
ToggleGroup group = new ToggleGroup(); //变更类型组
|
|
|
|
|
//实现单选功能
|
|
|
|
|
// 过程组
|
|
|
|
|
ToggleGroup group = new ToggleGroup(); // 变更类型组
|
|
|
|
|
// 实现单选功能
|
|
|
|
|
rb_formalChange.setToggleGroup(group);
|
|
|
|
|
rb_tempChange.setToggleGroup(group);
|
|
|
|
|
rb_formalChange.setSelected(true);
|
|
|
|
|
referencePane.setExpanded(false);
|
|
|
|
|
|
|
|
|
|
ToggleGroup groupGc = new ToggleGroup(); //变更类型组
|
|
|
|
|
ToggleGroup groupGc = new ToggleGroup(); // 变更类型组
|
|
|
|
|
rb_product.setToggleGroup(groupGc);
|
|
|
|
|
rb_Process.setToggleGroup(groupGc);
|
|
|
|
|
tp_product.setCollapsible(false);
|
|
|
|
@ -156,13 +156,15 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
createDetailTable();
|
|
|
|
|
|
|
|
|
|
createRefTable();
|
|
|
|
|
//获取选中的对象
|
|
|
|
|
// 获取选中的对象
|
|
|
|
|
|
|
|
|
|
initText();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
private Button createBtn;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param event
|
|
|
|
|
* @throws Exception
|
|
|
|
@ -170,17 +172,17 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
*/
|
|
|
|
|
@FXML
|
|
|
|
|
void createClick(ActionEvent event) throws Exception {
|
|
|
|
|
if(ecnId.getText().isEmpty()) {
|
|
|
|
|
MessageBox.post("请先指派变更单ID","提示",2);
|
|
|
|
|
if (ecnId.getText().isEmpty()) {
|
|
|
|
|
MessageBox.post("请先指派变更单ID", "提示", 2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String changeName = "临时更改通知单";
|
|
|
|
|
if(rb_formalChange.isSelected()) {
|
|
|
|
|
if (rb_formalChange.isSelected()) {
|
|
|
|
|
changeName = "正式更改通知单";
|
|
|
|
|
}
|
|
|
|
|
if (target.getType().equals("ZT2_Change")) {
|
|
|
|
|
TCComponentItem item = (TCComponentItem) target;
|
|
|
|
|
setItemProperty(item,changeName);
|
|
|
|
|
setItemProperty(item, changeName);
|
|
|
|
|
|
|
|
|
|
String type = item.getProperty("zt2_Template");
|
|
|
|
|
TCComponentDataset dataset = null;
|
|
|
|
@ -207,10 +209,8 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
} else if (target.getType().equals("ZT2_ProjectItem")) {
|
|
|
|
|
String zt2_WBSNo = target.getProperty("zt2_WBSNo");
|
|
|
|
|
// 针对新建,
|
|
|
|
|
TCComponentItemType itemType = (TCComponentItemType) session
|
|
|
|
|
.getTypeComponent("ZT2_Change");
|
|
|
|
|
TCComponentItem item = itemType.create(ecnId.getText(), null, "ZT2_Change",
|
|
|
|
|
changeName, "", null);
|
|
|
|
|
TCComponentItemType itemType = (TCComponentItemType) session.getTypeComponent("ZT2_Change");
|
|
|
|
|
TCComponentItem item = itemType.create(ecnId.getText(), null, "ZT2_Change", changeName, "", null);
|
|
|
|
|
// 设置属性
|
|
|
|
|
boolean flag = true;
|
|
|
|
|
try {
|
|
|
|
@ -255,84 +255,77 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//影响分析信息 保存到CHINT_ECN_NOTIFICATION中
|
|
|
|
|
// 影响分析信息 保存到CHINT_ECN_NOTIFICATION中
|
|
|
|
|
try {
|
|
|
|
|
SqlUtil.getTCDataConnection(database);
|
|
|
|
|
String deleteSql = "delete CHINT_ECN_NOTIFICATION where \"ecncode\" = ? ";
|
|
|
|
|
String endCode = ecnId.getText();
|
|
|
|
|
SqlUtil.delete(deleteSql,new String[] {endCode});
|
|
|
|
|
SqlUtil.delete(deleteSql, new String[] { endCode });
|
|
|
|
|
String insertSql = "insert into CHINT_ECN_NOTIFICATION (\"ecncode\", \"code\", \"section\", \"no\" ,"
|
|
|
|
|
+ "\"actionstatement\",\"result\",\"principal\",\"pctime\",\"remark\") values (?,?,?,?,?,?,?,?,?)";
|
|
|
|
|
ObservableList<RefTableBean> items = refTable.getItems();
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<7;i++) {
|
|
|
|
|
for (int i = 0; i < 7; i++) {
|
|
|
|
|
RefTableBean refTableBean = items.get(i);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected()?"是":"否";
|
|
|
|
|
SqlUtil.write(
|
|
|
|
|
new String[] {endCode,"1",refTableBean.getDepart(),String.valueOf(i+1),
|
|
|
|
|
refTableBean.getMessage(),result,refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(),refTableBean.getMark().getText()}, insertSql);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
|
|
|
|
|
SqlUtil.write(new String[] { endCode, "1", refTableBean.getDepart(), String.valueOf(i + 1),
|
|
|
|
|
refTableBean.getMessage(), result, refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
|
|
|
|
|
}
|
|
|
|
|
for(int i=7;i<11;i++) {
|
|
|
|
|
for (int i = 7; i < 11; i++) {
|
|
|
|
|
RefTableBean refTableBean = items.get(i);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected()?"是":"否";
|
|
|
|
|
SqlUtil.write(
|
|
|
|
|
new String[] {endCode,"2",refTableBean.getDepart(),String.valueOf(i-6),
|
|
|
|
|
refTableBean.getMessage(),result,refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(),refTableBean.getMark().getText()}, insertSql);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
|
|
|
|
|
SqlUtil.write(new String[] { endCode, "2", refTableBean.getDepart(), String.valueOf(i - 6),
|
|
|
|
|
refTableBean.getMessage(), result, refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
|
|
|
|
|
}
|
|
|
|
|
for(int i=11;i<15;i++) {
|
|
|
|
|
for (int i = 11; i < 15; i++) {
|
|
|
|
|
RefTableBean refTableBean = items.get(i);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected()?"是":"否";
|
|
|
|
|
SqlUtil.write(
|
|
|
|
|
new String[] {endCode,"3",refTableBean.getDepart(),String.valueOf(i-10),
|
|
|
|
|
refTableBean.getMessage(),result,refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(),refTableBean.getMark().getText()}, insertSql);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
|
|
|
|
|
SqlUtil.write(new String[] { endCode, "3", refTableBean.getDepart(), String.valueOf(i - 10),
|
|
|
|
|
refTableBean.getMessage(), result, refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
|
|
|
|
|
}
|
|
|
|
|
for(int i=15;i<19;i++) {
|
|
|
|
|
for (int i = 15; i < 19; i++) {
|
|
|
|
|
RefTableBean refTableBean = items.get(i);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected()?"是":"否";
|
|
|
|
|
SqlUtil.write(
|
|
|
|
|
new String[] {endCode,"4",refTableBean.getDepart(),String.valueOf(i-14),
|
|
|
|
|
refTableBean.getMessage(),result,refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(),refTableBean.getMark().getText()}, insertSql);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
|
|
|
|
|
SqlUtil.write(new String[] { endCode, "4", refTableBean.getDepart(), String.valueOf(i - 14),
|
|
|
|
|
refTableBean.getMessage(), result, refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
|
|
|
|
|
}
|
|
|
|
|
for(int i=19;i<24;i++) {
|
|
|
|
|
for (int i = 19; i < 24; i++) {
|
|
|
|
|
RefTableBean refTableBean = items.get(i);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected()?"是":"否";
|
|
|
|
|
SqlUtil.write(
|
|
|
|
|
new String[] {endCode,"5",refTableBean.getDepart(),String.valueOf(i-18),
|
|
|
|
|
refTableBean.getMessage(),result,refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(),refTableBean.getMark().getText()}, insertSql);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
|
|
|
|
|
SqlUtil.write(new String[] { endCode, "5", refTableBean.getDepart(), String.valueOf(i - 18),
|
|
|
|
|
refTableBean.getMessage(), result, refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
|
|
|
|
|
}
|
|
|
|
|
for(int i=24;i<27;i++) {
|
|
|
|
|
for (int i = 24; i < 27; i++) {
|
|
|
|
|
RefTableBean refTableBean = items.get(i);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected()?"是":"否";
|
|
|
|
|
SqlUtil.write(
|
|
|
|
|
new String[] {endCode,"6",refTableBean.getDepart(),String.valueOf(i-23),
|
|
|
|
|
refTableBean.getMessage(),result,refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(),refTableBean.getMark().getText()}, insertSql);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
|
|
|
|
|
SqlUtil.write(new String[] { endCode, "6", refTableBean.getDepart(), String.valueOf(i - 23),
|
|
|
|
|
refTableBean.getMessage(), result, refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
|
|
|
|
|
}
|
|
|
|
|
for(int i=27;i<28;i++) {
|
|
|
|
|
for (int i = 27; i < 28; i++) {
|
|
|
|
|
RefTableBean refTableBean = items.get(i);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected()?"是":"否";
|
|
|
|
|
SqlUtil.write(
|
|
|
|
|
new String[] {endCode,"7",refTableBean.getDepart(),String.valueOf(i-26),
|
|
|
|
|
refTableBean.getMessage(),result,refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(),refTableBean.getMark().getText()}, insertSql);
|
|
|
|
|
String result = refTableBean.getShYes().isSelected() ? "是" : "否";
|
|
|
|
|
SqlUtil.write(new String[] { endCode, "7", refTableBean.getDepart(), String.valueOf(i - 26),
|
|
|
|
|
refTableBean.getMessage(), result, refTableBean.getUser().getText(),
|
|
|
|
|
refTableBean.getCompDate().getText(), refTableBean.getMark().getText() }, insertSql);
|
|
|
|
|
}
|
|
|
|
|
}catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}finally {
|
|
|
|
|
} finally {
|
|
|
|
|
SqlUtil.freeAll();
|
|
|
|
|
}
|
|
|
|
|
createBtn.setDisable(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param 数据集
|
|
|
|
|
* @param 文件路径
|
|
|
|
|
* @param 更改类型
|
|
|
|
|
* 创建或者替换excel文件
|
|
|
|
|
* @param 更改类型 创建或者替换excel文件
|
|
|
|
|
*/
|
|
|
|
|
protected void createOrReplace(TCComponentDataset dataset, File file, String changeName) {
|
|
|
|
|
// 20200407新增删除多余的
|
|
|
|
@ -420,12 +413,12 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String contractNo; //合同代号
|
|
|
|
|
private String contractName;//合同名称
|
|
|
|
|
private String productModel; //产品型号
|
|
|
|
|
private String changeType; //正式临时
|
|
|
|
|
private String changeTime;//更改实施日期
|
|
|
|
|
private String changeUnit1; //属性变更发往部门
|
|
|
|
|
private String contractNo; // 合同代号
|
|
|
|
|
private String contractName;// 合同名称
|
|
|
|
|
private String productModel; // 产品型号
|
|
|
|
|
private String changeType; // 正式临时
|
|
|
|
|
private String changeTime;// 更改实施日期
|
|
|
|
|
private String changeUnit1; // 属性变更发往部门
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param item 对象
|
|
|
|
@ -435,12 +428,12 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
*/
|
|
|
|
|
protected void setItemProperty(TCComponentItem item, String changeName) throws Exception {
|
|
|
|
|
|
|
|
|
|
contractNo = contractText.getText(); //合同代号
|
|
|
|
|
contractName = htNameText.getText();//合同名称
|
|
|
|
|
productModel = pmCombox.getSelectionModel().getSelectedItem(); //产品型号
|
|
|
|
|
contractNo = contractText.getText(); // 合同代号
|
|
|
|
|
contractName = htNameText.getText();// 合同名称
|
|
|
|
|
productModel = pmCombox.getSelectionModel().getSelectedItem(); // 产品型号
|
|
|
|
|
String productName = prodNameComb.getSelectionModel().getSelectedItem();
|
|
|
|
|
String fileName = markText.getText();
|
|
|
|
|
changeType = changeName; //正式临时
|
|
|
|
|
changeType = changeName; // 正式临时
|
|
|
|
|
item.setProperty("zt2_ContractNo", contractNo);
|
|
|
|
|
item.setProperty("zt2_ContractName", contractName);
|
|
|
|
|
item.setProperty("zt2_ProductModel", productModel);
|
|
|
|
@ -455,9 +448,9 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
item.setDateProperty("zt2_ChangeDate", date);
|
|
|
|
|
}
|
|
|
|
|
StringBuilder unit = new StringBuilder("");
|
|
|
|
|
for(int j=0;j<partBtns.size();j++) {
|
|
|
|
|
for (int j = 0; j < partBtns.size(); j++) {
|
|
|
|
|
CheckBox radioButton = partBtns.get(j);
|
|
|
|
|
if(radioButton.isSelected()) {
|
|
|
|
|
if (radioButton.isSelected()) {
|
|
|
|
|
if (unit.length() > 0) {
|
|
|
|
|
unit.append(";").append(radioButton.getText());
|
|
|
|
|
} else {
|
|
|
|
@ -465,7 +458,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
changeUnit1 = unit.toString(); //属性变更发往部门
|
|
|
|
|
changeUnit1 = unit.toString(); // 属性变更发往部门
|
|
|
|
|
item.setProperty("zt2_ChangeUnit1", changeUnit1);
|
|
|
|
|
ObservableList<EcnBean> items = tableView.getItems();
|
|
|
|
|
int rowCount = items.size();
|
|
|
|
@ -502,17 +495,17 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
changeBefore1[i] = ecnBean.getOverChange().getText();
|
|
|
|
|
changeAfter1[i] = ecnBean.getAfterChange().getText();
|
|
|
|
|
String reasonItem = ecnBean.getChangeReason().getSelectionModel().getSelectedItem();
|
|
|
|
|
changeReason[i] = reasonItem==null?"":reasonItem;
|
|
|
|
|
changeReason[i] = reasonItem == null ? "" : reasonItem;
|
|
|
|
|
String processTypeItem = ecnBean.getWipTreat().getSelectionModel().getSelectedItem();
|
|
|
|
|
processType1[i] = processTypeItem==null?"":processTypeItem;
|
|
|
|
|
processType1[i] = processTypeItem == null ? "" : processTypeItem;
|
|
|
|
|
szVersionBefs[i] = ecnBean.getOverVersion().getText();
|
|
|
|
|
szVersionAfts[i] = ecnBean.getAfterVersion().getText();
|
|
|
|
|
productSzs[i] = ecnBean.getProductSz().getSelectionModel().getSelectedItem();
|
|
|
|
|
processSzs[i] = rb_product.isSelected() ? "Y":"N";
|
|
|
|
|
processSzs[i] = rb_product.isSelected() ? "Y" : "N";
|
|
|
|
|
}
|
|
|
|
|
item.getTCProperty("zt2_ChangeDrawingNo").setStringValueArray(changeDrawingNo);
|
|
|
|
|
item.getTCProperty("zt2_Sign").setStringValueArray(sign);
|
|
|
|
|
item.getTCProperty("zt2_PlacesNo").setStringValueArray(partition); //处数
|
|
|
|
|
item.getTCProperty("zt2_PlacesNo").setStringValueArray(partition); // 处数
|
|
|
|
|
item.getTCProperty("zt2_ChangeBefore1").setStringValueArray(changeBefore1);
|
|
|
|
|
item.getTCProperty("zt2_ChangeAfter1").setStringValueArray(changeAfter1);
|
|
|
|
|
item.getTCProperty("zt2_ChangeReason").setStringValueArray(changeReason);
|
|
|
|
@ -522,19 +515,21 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
item.getTCProperty("zt2_SZProduct").setStringValueArray(productSzs);
|
|
|
|
|
item.getTCProperty("zt2_SZProcess").setStringValueArray(processSzs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int pages = 0;
|
|
|
|
|
private String[] changeDrawingNo; //属性zt2_ChangeDrawingNo
|
|
|
|
|
private String[] sign; //属性zt2_Sign
|
|
|
|
|
private String[] changeDrawingNo; // 属性zt2_ChangeDrawingNo
|
|
|
|
|
private String[] sign; // 属性zt2_Sign
|
|
|
|
|
// private String[] placesNo; //属性zt2_PlacesNo
|
|
|
|
|
private String[] partition; //属性zt2_Partition
|
|
|
|
|
private String[] changeBefore1; //属性zt2_ChangeBefore1
|
|
|
|
|
private String[] changeAfter1; //属性zt2_ChangeAfter1
|
|
|
|
|
private String[] changeReason; //属性zt2_ChangeReason
|
|
|
|
|
private String[] processType1; //属性zt2_ProcessType1
|
|
|
|
|
private String[] partition; // 属性zt2_Partition
|
|
|
|
|
private String[] changeBefore1; // 属性zt2_ChangeBefore1
|
|
|
|
|
private String[] changeAfter1; // 属性zt2_ChangeAfter1
|
|
|
|
|
private String[] changeReason; // 属性zt2_ChangeReason
|
|
|
|
|
private String[] processType1; // 属性zt2_ProcessType1
|
|
|
|
|
private String[] szVersionBefs; // 变更前版本
|
|
|
|
|
private String[] szVersionAfts; // 变更后版本
|
|
|
|
|
private String[] productSzs; // 变更后版本
|
|
|
|
|
private String[] processSzs; // 变更后版本
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param event
|
|
|
|
|
* @function 关闭页面操作
|
|
|
|
@ -560,12 +555,12 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
htNameText.setEditable(false);
|
|
|
|
|
ecnId.setEditable(false);
|
|
|
|
|
rb_product.setSelected(true);
|
|
|
|
|
if(target.getType().equals("ZT2_ProjectItem")) {
|
|
|
|
|
//获取产成品的名称
|
|
|
|
|
if (target.getType().equals("ZT2_ProjectItem")) {
|
|
|
|
|
// 获取产成品的名称
|
|
|
|
|
List<String> ccpNameFromProject = KUtil.getCCPNameFromProject(target, session);
|
|
|
|
|
prodNameComb.getItems().addAll(ccpNameFromProject);
|
|
|
|
|
}else {
|
|
|
|
|
//对象类型为变更对象时 , 设置ID,时间,产品型号、
|
|
|
|
|
} else {
|
|
|
|
|
// 对象类型为变更对象时 , 设置ID,时间,产品型号、
|
|
|
|
|
List<String> productNameList = new ArrayList<>();
|
|
|
|
|
productNameList = Util.getProductNames(target, productNameList);
|
|
|
|
|
prodNameComb.getItems().addAll(productNameList);
|
|
|
|
@ -580,7 +575,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
if (date != null) {
|
|
|
|
|
changeDate.getEditor().setText(sdf.format(date));
|
|
|
|
|
}
|
|
|
|
|
//初始化选中工厂
|
|
|
|
|
// 初始化选中工厂
|
|
|
|
|
if (target.getType().equals("ZT2_Change")) {
|
|
|
|
|
String[] changeUnit1 = target.getProperty("zt2_ChangeUnit1").split(";");
|
|
|
|
|
for (int j = 0; j < changeUnit1.length; j++) {
|
|
|
|
@ -591,8 +586,8 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
target.refresh();
|
|
|
|
|
properties = target.getTCProperties(
|
|
|
|
|
new String[] { "zt2_ChangeDrawingNo", "zt2_Sign", "zt2_PlacesNo", "zt2_Partition",
|
|
|
|
|
"zt2_ChangeBefore1", "zt2_ChangeAfter1", "zt2_ChangeReason", "zt2_ProcessType1" ,"zt2_SZVersionbefore",
|
|
|
|
|
"zt2_SZRevisedversion", "zt2_SZProduct", "zt2_SZProcess"});
|
|
|
|
|
"zt2_ChangeBefore1", "zt2_ChangeAfter1", "zt2_ChangeReason", "zt2_ProcessType1",
|
|
|
|
|
"zt2_SZVersionbefore", "zt2_SZRevisedversion", "zt2_SZProduct", "zt2_SZProcess" });
|
|
|
|
|
} catch (TCException e1) {
|
|
|
|
|
e1.printStackTrace();
|
|
|
|
|
}
|
|
|
|
@ -608,7 +603,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
String[] szVersionAft = properties[9].getStringArrayValue();
|
|
|
|
|
String[] szProduct = properties[10].getStringArrayValue();
|
|
|
|
|
String[] szProcess = properties[11].getStringArrayValue();
|
|
|
|
|
if(szProcess.length>0) {
|
|
|
|
|
if (szProcess.length > 0) {
|
|
|
|
|
rb_Process.setSelected(szProcess[0].equals("N"));
|
|
|
|
|
}
|
|
|
|
|
String fileName = target.getProperty("zt2_FileName");
|
|
|
|
@ -624,18 +619,19 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
int rowNum = 0;
|
|
|
|
|
for (int j = 0; j < ChangeDrawingNo.length; j++) {
|
|
|
|
|
rowNum++;
|
|
|
|
|
EcnBean ecnBean = new EcnBean(rowNum, reasons, wips, ChangeDrawingNo[j], sign[j], placesNo[j]
|
|
|
|
|
, ChangeBefore1[j], ChangeAfter1[j], ChangeReason[j], ProcessType1[j], szVersionBef[j], szVersionAft[j]);
|
|
|
|
|
EcnBean ecnBean = new EcnBean(rowNum, reasons, wips, ChangeDrawingNo[j], sign[j], placesNo[j],
|
|
|
|
|
ChangeBefore1[j], ChangeAfter1[j], ChangeReason[j], ProcessType1[j], szVersionBef[j],
|
|
|
|
|
szVersionAft[j]);
|
|
|
|
|
ecnBeans.add(ecnBean);
|
|
|
|
|
ecnBean.setProductSz(szProduct[j]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
tableView.getItems().addAll(ecnBeans);
|
|
|
|
|
for(int i=0;i<parts.size();i++) {
|
|
|
|
|
for (int i = 0; i < parts.size(); i++) {
|
|
|
|
|
CheckBox btn = new CheckBox(parts.get(i));
|
|
|
|
|
partBtns.add(btn);
|
|
|
|
|
departPane.getChildren().add(btn);
|
|
|
|
|
if(unitList.contains(parts.get(i))) {
|
|
|
|
|
if (unitList.contains(parts.get(i))) {
|
|
|
|
|
btn.setSelected(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -643,33 +639,35 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
try {
|
|
|
|
|
SqlUtil.getTCDataConnection(database);
|
|
|
|
|
ObservableList<RefTableBean> items = refTable.getItems();
|
|
|
|
|
int i=0;
|
|
|
|
|
String refTableSql = "select * from CHINT_ECN_NOTIFICATION where \"ecncode\" = '"+ecnId.getText()+"' order by \"code\" asc , \"no\" asc ";
|
|
|
|
|
System.out.println("refTableSql==>"+refTableSql);
|
|
|
|
|
int i = 0;
|
|
|
|
|
String refTableSql = "select * from CHINT_ECN_NOTIFICATION where \"ecncode\" = '" + ecnId.getText()
|
|
|
|
|
+ "' order by \"code\" asc , \"no\" asc ";
|
|
|
|
|
System.out.println("refTableSql==>" + refTableSql);
|
|
|
|
|
ResultSet read = SqlUtil.read(refTableSql);
|
|
|
|
|
while(read.next()) {
|
|
|
|
|
while (read.next()) {
|
|
|
|
|
// \"result\",\"principal\",\"pctime\",\"remark\"
|
|
|
|
|
RefTableBean refTableBean = items.get(i);
|
|
|
|
|
refTableBean.setCompDate(read.getString("pctime"));
|
|
|
|
|
refTableBean.setMark(read.getString("remark"));
|
|
|
|
|
refTableBean.setUser(read.getString("principal"));
|
|
|
|
|
String result = read.getString("result");
|
|
|
|
|
System.out.println("refTableSql==>"+read.getString("principal"));
|
|
|
|
|
if(result.equals("否")) {
|
|
|
|
|
System.out.println("refTableSql==>" + read.getString("principal"));
|
|
|
|
|
if (result.equals("否")) {
|
|
|
|
|
refTableBean.setShNo(true);
|
|
|
|
|
}
|
|
|
|
|
i=i+1;
|
|
|
|
|
i = i + 1;
|
|
|
|
|
}
|
|
|
|
|
refTable.setItems(items);
|
|
|
|
|
// if()
|
|
|
|
|
// refTable.getItems().clear();
|
|
|
|
|
// refTable.getItems().addAll(items);
|
|
|
|
|
}catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}finally {
|
|
|
|
|
} finally {
|
|
|
|
|
SqlUtil.freeAll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
@ -710,7 +708,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
// util.disconnect(conn, stmt, rs_get);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}finally {
|
|
|
|
|
} finally {
|
|
|
|
|
SqlUtil.freeAll();
|
|
|
|
|
}
|
|
|
|
|
if (i == 0) {
|
|
|
|
@ -719,6 +717,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
return newDataset;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param target项目对象
|
|
|
|
|
* @return 更改单文件夹
|
|
|
|
@ -742,6 +741,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @function 初始化影响分析的表格 绑定bean
|
|
|
|
@ -749,20 +749,20 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
private void createDetailTable() {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
TableColumn<EcnBean,TextArea> tc_beforChange = new TableColumn<EcnBean,TextArea>("更改前");
|
|
|
|
|
TableColumn<EcnBean,TextArea> tc_afterChange = new TableColumn<EcnBean,TextArea>("更改后");
|
|
|
|
|
TableColumn<EcnBean,TextArea> tc_afterVer = new TableColumn<EcnBean,TextArea>("更改后版本");
|
|
|
|
|
|
|
|
|
|
TableColumn<EcnBean,TextArea> tc_drawNo = new TableColumn<EcnBean,TextArea>("图样代号");
|
|
|
|
|
TableColumn<EcnBean,TextArea> tc_mark = new TableColumn<EcnBean,TextArea>("标记");
|
|
|
|
|
TableColumn<EcnBean,Integer> tc_xh = new TableColumn<EcnBean,Integer>("序号");
|
|
|
|
|
TableColumn<EcnBean,ComboBox<String>> tc_wipTreat = new TableColumn<EcnBean,ComboBox<String>>("在制品处理");
|
|
|
|
|
TableColumn<EcnBean,TextArea> tc_beforVer = new TableColumn<EcnBean,TextArea>("更改前版本");
|
|
|
|
|
TableColumn<EcnBean,ComboBox<String>> productSz = new TableColumn<EcnBean,ComboBox<String>>("特性等级");
|
|
|
|
|
TableColumn<EcnBean,ComboBox<String>> tc_reason = new TableColumn<EcnBean,ComboBox<String>>("更改原因");
|
|
|
|
|
TableColumn<EcnBean,TextArea> tc_poiNum = new TableColumn<EcnBean,TextArea>("处数");
|
|
|
|
|
tableView.getColumns().addAll(tc_xh, tc_drawNo, tc_mark,tc_poiNum,tc_beforChange, tc_beforVer, tc_afterChange,
|
|
|
|
|
tc_afterVer,productSz,tc_reason,tc_wipTreat);
|
|
|
|
|
TableColumn<EcnBean, TextArea> tc_beforChange = new TableColumn<EcnBean, TextArea>("更改前");
|
|
|
|
|
TableColumn<EcnBean, TextArea> tc_afterChange = new TableColumn<EcnBean, TextArea>("更改后");
|
|
|
|
|
TableColumn<EcnBean, TextArea> tc_afterVer = new TableColumn<EcnBean, TextArea>("更改后版本");
|
|
|
|
|
|
|
|
|
|
TableColumn<EcnBean, TextArea> tc_drawNo = new TableColumn<EcnBean, TextArea>("图样代号");
|
|
|
|
|
TableColumn<EcnBean, TextArea> tc_mark = new TableColumn<EcnBean, TextArea>("标记");
|
|
|
|
|
TableColumn<EcnBean, Integer> tc_xh = new TableColumn<EcnBean, Integer>("序号");
|
|
|
|
|
TableColumn<EcnBean, ComboBox<String>> tc_wipTreat = new TableColumn<EcnBean, ComboBox<String>>("在制品处理");
|
|
|
|
|
TableColumn<EcnBean, TextArea> tc_beforVer = new TableColumn<EcnBean, TextArea>("更改前版本");
|
|
|
|
|
TableColumn<EcnBean, ComboBox<String>> productSz = new TableColumn<EcnBean, ComboBox<String>>("特性等级");
|
|
|
|
|
TableColumn<EcnBean, ComboBox<String>> tc_reason = new TableColumn<EcnBean, ComboBox<String>>("更改原因");
|
|
|
|
|
TableColumn<EcnBean, TextArea> tc_poiNum = new TableColumn<EcnBean, TextArea>("处数");
|
|
|
|
|
tableView.getColumns().addAll(tc_xh, tc_drawNo, tc_mark, tc_poiNum, tc_beforChange, tc_beforVer, tc_afterChange,
|
|
|
|
|
tc_afterVer, productSz, tc_reason, tc_wipTreat);
|
|
|
|
|
|
|
|
|
|
tc_xh.setSortable(false);
|
|
|
|
|
tc_drawNo.setSortable(false);
|
|
|
|
@ -775,18 +775,18 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
tc_reason.setSortable(false);
|
|
|
|
|
productSz.setSortable(false);
|
|
|
|
|
tc_wipTreat.setSortable(false);
|
|
|
|
|
//列绑定bean对象
|
|
|
|
|
tc_xh.setCellValueFactory(new PropertyValueFactory<EcnBean,Integer>("num"));
|
|
|
|
|
tc_drawNo.setCellValueFactory(new PropertyValueFactory<EcnBean,TextArea>("drawNo"));
|
|
|
|
|
tc_mark.setCellValueFactory(new PropertyValueFactory<EcnBean,TextArea>("mark"));
|
|
|
|
|
tc_poiNum.setCellValueFactory(new PropertyValueFactory<EcnBean,TextArea>("poiNum"));
|
|
|
|
|
tc_beforChange.setCellValueFactory(new PropertyValueFactory<EcnBean,TextArea>("overChange"));
|
|
|
|
|
tc_beforVer.setCellValueFactory(new PropertyValueFactory<EcnBean,TextArea>("overVersion"));
|
|
|
|
|
tc_afterChange.setCellValueFactory(new PropertyValueFactory<EcnBean,TextArea>("afterChange"));
|
|
|
|
|
tc_afterVer.setCellValueFactory(new PropertyValueFactory<EcnBean,TextArea>("afterVersion"));
|
|
|
|
|
tc_reason.setCellValueFactory(new PropertyValueFactory<EcnBean,ComboBox<String>>("changeReason"));
|
|
|
|
|
tc_wipTreat.setCellValueFactory(new PropertyValueFactory<EcnBean,ComboBox<String>>("wipTreat"));
|
|
|
|
|
productSz.setCellValueFactory(new PropertyValueFactory<EcnBean,ComboBox<String>>("productSz"));
|
|
|
|
|
// 列绑定bean对象
|
|
|
|
|
tc_xh.setCellValueFactory(new PropertyValueFactory<EcnBean, Integer>("num"));
|
|
|
|
|
tc_drawNo.setCellValueFactory(new PropertyValueFactory<EcnBean, TextArea>("drawNo"));
|
|
|
|
|
tc_mark.setCellValueFactory(new PropertyValueFactory<EcnBean, TextArea>("mark"));
|
|
|
|
|
tc_poiNum.setCellValueFactory(new PropertyValueFactory<EcnBean, TextArea>("poiNum"));
|
|
|
|
|
tc_beforChange.setCellValueFactory(new PropertyValueFactory<EcnBean, TextArea>("overChange"));
|
|
|
|
|
tc_beforVer.setCellValueFactory(new PropertyValueFactory<EcnBean, TextArea>("overVersion"));
|
|
|
|
|
tc_afterChange.setCellValueFactory(new PropertyValueFactory<EcnBean, TextArea>("afterChange"));
|
|
|
|
|
tc_afterVer.setCellValueFactory(new PropertyValueFactory<EcnBean, TextArea>("afterVersion"));
|
|
|
|
|
tc_reason.setCellValueFactory(new PropertyValueFactory<EcnBean, ComboBox<String>>("changeReason"));
|
|
|
|
|
tc_wipTreat.setCellValueFactory(new PropertyValueFactory<EcnBean, ComboBox<String>>("wipTreat"));
|
|
|
|
|
productSz.setCellValueFactory(new PropertyValueFactory<EcnBean, ComboBox<String>>("productSz"));
|
|
|
|
|
|
|
|
|
|
tc_xh.prefWidthProperty().bind(tableView.widthProperty().multiply(0.06));
|
|
|
|
|
tc_drawNo.prefWidthProperty().bind(tableView.widthProperty().multiply(0.18));
|
|
|
|
@ -797,9 +797,10 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
tc_afterChange.prefWidthProperty().bind(tableView.widthProperty().multiply(0.10));
|
|
|
|
|
productSz.prefWidthProperty().bind(tableView.widthProperty().multiply(0.06));
|
|
|
|
|
tc_afterVer.prefWidthProperty().bind(tableView.widthProperty().multiply(0.06));
|
|
|
|
|
tc_reason.prefWidthProperty().bind(tableView.widthProperty().multiply(0.14)); //0.4
|
|
|
|
|
tc_reason.prefWidthProperty().bind(tableView.widthProperty().multiply(0.14)); // 0.4
|
|
|
|
|
tc_wipTreat.prefWidthProperty().bind(tableView.widthProperty().multiply(0.10));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
public TableView<RefTableBean> refTable;
|
|
|
|
|
|
|
|
|
@ -809,7 +810,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
*/
|
|
|
|
|
private void createRefTable() {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
//影响分析表格
|
|
|
|
|
// 影响分析表格
|
|
|
|
|
// protected SimpleStringProperty depart;//部门
|
|
|
|
|
// protected SimpleStringProperty message; //行动
|
|
|
|
|
// protected CheckBox shYes = new CheckBox();//是
|
|
|
|
@ -817,21 +818,21 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
// protected TextField user;//更改前版本
|
|
|
|
|
// protected TextField compDate;//更改后
|
|
|
|
|
// protected TextField mark;//更改后版本
|
|
|
|
|
TableColumn<RefTableBean,String> deapart = new TableColumn<RefTableBean,String>("部门");
|
|
|
|
|
TableColumn<RefTableBean,String> message = new TableColumn<RefTableBean,String>("行动(需要书面证据)");
|
|
|
|
|
TableColumn<RefTableBean,CheckBox> shYes = new TableColumn<RefTableBean,CheckBox>("是"); //要求值(设计)
|
|
|
|
|
TableColumn<RefTableBean,CheckBox> shNo = new TableColumn<RefTableBean,CheckBox>("否");
|
|
|
|
|
TableColumn<RefTableBean,TextField> user = new TableColumn<RefTableBean,TextField>("责任人");
|
|
|
|
|
TableColumn<RefTableBean,TextField> compDate = new TableColumn<RefTableBean,TextField>("完成时间"); //
|
|
|
|
|
TableColumn<RefTableBean,TextField> mark = new TableColumn<RefTableBean,TextField>("备注"); //
|
|
|
|
|
|
|
|
|
|
deapart.setCellValueFactory(new PropertyValueFactory<RefTableBean,String>("depart"));
|
|
|
|
|
message.setCellValueFactory(new PropertyValueFactory<RefTableBean,String>("message"));
|
|
|
|
|
shYes.setCellValueFactory(new PropertyValueFactory<RefTableBean,CheckBox>("shYes"));
|
|
|
|
|
shNo.setCellValueFactory(new PropertyValueFactory<RefTableBean,CheckBox>("shNo"));
|
|
|
|
|
user.setCellValueFactory(new PropertyValueFactory<RefTableBean,TextField>("user"));
|
|
|
|
|
compDate.setCellValueFactory(new PropertyValueFactory<RefTableBean,TextField>("compDate"));
|
|
|
|
|
mark.setCellValueFactory(new PropertyValueFactory<RefTableBean,TextField>("mark"));
|
|
|
|
|
TableColumn<RefTableBean, String> deapart = new TableColumn<RefTableBean, String>("部门");
|
|
|
|
|
TableColumn<RefTableBean, String> message = new TableColumn<RefTableBean, String>("行动(需要书面证据)");
|
|
|
|
|
TableColumn<RefTableBean, CheckBox> shYes = new TableColumn<RefTableBean, CheckBox>("是"); // 要求值(设计)
|
|
|
|
|
TableColumn<RefTableBean, CheckBox> shNo = new TableColumn<RefTableBean, CheckBox>("否");
|
|
|
|
|
TableColumn<RefTableBean, TextField> user = new TableColumn<RefTableBean, TextField>("责任人");
|
|
|
|
|
TableColumn<RefTableBean, TextField> compDate = new TableColumn<RefTableBean, TextField>("完成时间"); //
|
|
|
|
|
TableColumn<RefTableBean, TextField> mark = new TableColumn<RefTableBean, TextField>("备注"); //
|
|
|
|
|
|
|
|
|
|
deapart.setCellValueFactory(new PropertyValueFactory<RefTableBean, String>("depart"));
|
|
|
|
|
message.setCellValueFactory(new PropertyValueFactory<RefTableBean, String>("message"));
|
|
|
|
|
shYes.setCellValueFactory(new PropertyValueFactory<RefTableBean, CheckBox>("shYes"));
|
|
|
|
|
shNo.setCellValueFactory(new PropertyValueFactory<RefTableBean, CheckBox>("shNo"));
|
|
|
|
|
user.setCellValueFactory(new PropertyValueFactory<RefTableBean, TextField>("user"));
|
|
|
|
|
compDate.setCellValueFactory(new PropertyValueFactory<RefTableBean, TextField>("compDate"));
|
|
|
|
|
mark.setCellValueFactory(new PropertyValueFactory<RefTableBean, TextField>("mark"));
|
|
|
|
|
|
|
|
|
|
deapart.setSortable(false);
|
|
|
|
|
message.setSortable(false);
|
|
|
|
@ -840,7 +841,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
user.setSortable(false);
|
|
|
|
|
compDate.setSortable(false);
|
|
|
|
|
mark.setSortable(false);
|
|
|
|
|
refTable.getColumns().addAll(deapart, message, shYes,shNo,user, compDate, mark);
|
|
|
|
|
refTable.getColumns().addAll(deapart, message, shYes, shNo, user, compDate, mark);
|
|
|
|
|
// //设置宽度
|
|
|
|
|
deapart.prefWidthProperty().bind(refTable.widthProperty().multiply(0.14));
|
|
|
|
|
message.prefWidthProperty().bind(refTable.widthProperty().multiply(0.36));
|
|
|
|
@ -850,47 +851,49 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
compDate.prefWidthProperty().bind(refTable.widthProperty().multiply(0.13));
|
|
|
|
|
mark.prefWidthProperty().bind(refTable.widthProperty().multiply(0.14));
|
|
|
|
|
List<RefTableBean> refTableBeans = new ArrayList<RefTableBean>();
|
|
|
|
|
//初始化数据 写死的
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"),new SimpleStringProperty("产品图样、目录、铭牌等")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"),new SimpleStringProperty("技术方案、DFMEA、产品质量特性重要度分级表")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"),new SimpleStringProperty("BOM物料更改")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"),new SimpleStringProperty("包装图样/规范")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"),new SimpleStringProperty("发货标签更改")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"),new SimpleStringProperty("客户承诺相关设计文件")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"),new SimpleStringProperty("环保要求更改")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("工艺部"),new SimpleStringProperty("工艺流程图、PFMEA、工艺守则")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("工艺部"),new SimpleStringProperty("作业指导书、包装指导书")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("工艺部"),new SimpleStringProperty("客户承诺相关工艺文件")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("工艺部"),new SimpleStringProperty("模具、工装、设备更改")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("质量部"),new SimpleStringProperty("控制计划")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("质量部"),new SimpleStringProperty("进货/过程/成品检验文件")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("质量部"),new SimpleStringProperty("供应商产品质量检验报告")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("质量部"),new SimpleStringProperty("客户承诺相关质量文件")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("生产部"),new SimpleStringProperty("断点标识(物料切换)")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("生产部"),new SimpleStringProperty("在制品确认及处理")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("生产部"),new SimpleStringProperty("成品确认及处理")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("生产部"),new SimpleStringProperty("计划确认及调整")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"),new SimpleStringProperty("采购价格变化")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"),new SimpleStringProperty("更改信息(资料、价格)传递")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"),new SimpleStringProperty("合格供方评价(新增时)")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"),new SimpleStringProperty("供应商合同修改")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"),new SimpleStringProperty("供应商处产品确认")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("销售中心"),new SimpleStringProperty("通知客户")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("销售中心"),new SimpleStringProperty("客户批准")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("销售中心"),new SimpleStringProperty("修改客户协议")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("财务部"),new SimpleStringProperty("销售价格变化")));
|
|
|
|
|
// 初始化数据 写死的
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"), new SimpleStringProperty("产品图样、目录、铭牌等")));
|
|
|
|
|
refTableBeans.add(
|
|
|
|
|
new RefTableBean(new SimpleStringProperty("技术部"), new SimpleStringProperty("技术方案、DFMEA、产品质量特性重要度分级表")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"), new SimpleStringProperty("BOM物料更改")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"), new SimpleStringProperty("包装图样/规范")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"), new SimpleStringProperty("发货标签更改")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"), new SimpleStringProperty("客户承诺相关设计文件")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("技术部"), new SimpleStringProperty("环保要求更改")));
|
|
|
|
|
|
|
|
|
|
refTableBeans
|
|
|
|
|
.add(new RefTableBean(new SimpleStringProperty("工艺部"), new SimpleStringProperty("工艺流程图、PFMEA、工艺守则")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("工艺部"), new SimpleStringProperty("作业指导书、包装指导书")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("工艺部"), new SimpleStringProperty("客户承诺相关工艺文件")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("工艺部"), new SimpleStringProperty("模具、工装、设备更改")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("质量部"), new SimpleStringProperty("控制计划")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("质量部"), new SimpleStringProperty("进货/过程/成品检验文件")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("质量部"), new SimpleStringProperty("供应商产品质量检验报告")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("质量部"), new SimpleStringProperty("客户承诺相关质量文件")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("生产部"), new SimpleStringProperty("断点标识(物料切换)")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("生产部"), new SimpleStringProperty("在制品确认及处理")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("生产部"), new SimpleStringProperty("成品确认及处理")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("生产部"), new SimpleStringProperty("计划确认及调整")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"), new SimpleStringProperty("采购价格变化")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"), new SimpleStringProperty("更改信息(资料、价格)传递")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"), new SimpleStringProperty("合格供方评价(新增时)")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"), new SimpleStringProperty("供应商合同修改")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("采购部"), new SimpleStringProperty("供应商处产品确认")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("销售中心"), new SimpleStringProperty("通知客户")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("销售中心"), new SimpleStringProperty("客户批准")));
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("销售中心"), new SimpleStringProperty("修改客户协议")));
|
|
|
|
|
|
|
|
|
|
refTableBeans.add(new RefTableBean(new SimpleStringProperty("财务部"), new SimpleStringProperty("销售价格变化")));
|
|
|
|
|
|
|
|
|
|
refTable.getItems().addAll(refTableBeans);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//最大化
|
|
|
|
|
|
|
|
|
|
// 最大化
|
|
|
|
|
/**
|
|
|
|
|
* @param frame
|
|
|
|
|
* @function 添加页面的监听
|
|
|
|
@ -912,7 +915,7 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
// System.out.println("==============");
|
|
|
|
|
double width = e.getComponent().getSize().getWidth();
|
|
|
|
|
// // double width = primaryStage.getWidth();
|
|
|
|
|
System.out.println("width==>"+width);
|
|
|
|
|
System.out.println("width==>" + width);
|
|
|
|
|
scollPane.setPrefWidth(width * 0.98);
|
|
|
|
|
gridPane.setPrefWidth(width * 0.98);
|
|
|
|
|
tableView.setPrefWidth(width * 0.97);
|
|
|
|
@ -936,8 +939,8 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
String sql = "select PART,REASON,MANAGE,DATASET,UNIT,GRADE from CHINT_ECN_TYPE where CODE = ?";
|
|
|
|
|
ResultSet read = SqlUtil.read(sql, new String[] {SAPUtil.getGroupID()});
|
|
|
|
|
if(read.next()) {
|
|
|
|
|
ResultSet read = SqlUtil.read(sql, new String[] { SAPUtil.getGroupID() });
|
|
|
|
|
if (read.next()) {
|
|
|
|
|
String part = read.getString(1);
|
|
|
|
|
String reason = read.getString(2);
|
|
|
|
|
String manage = read.getString(3);
|
|
|
|
@ -955,9 +958,9 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
products = new ArrayList<String>(Arrays.asList(grades));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}finally {
|
|
|
|
|
} finally {
|
|
|
|
|
SqlUtil.freeAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -969,24 +972,26 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
*/
|
|
|
|
|
@FXML
|
|
|
|
|
void addRows(ActionEvent event) {
|
|
|
|
|
for(int i=0;i<5;i++) {
|
|
|
|
|
ecnBeans.add(new EcnBean(ecnBeans.size()+1, reasons, wips, products));
|
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
|
|
ecnBeans.add(new EcnBean(ecnBeans.size() + 1, reasons, wips, products));
|
|
|
|
|
}
|
|
|
|
|
ObservableList<EcnBean> data = FXCollections.observableArrayList(ecnBeans);
|
|
|
|
|
tableView.getItems().clear();
|
|
|
|
|
tableView.setItems(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param event
|
|
|
|
|
* @function 添加行
|
|
|
|
|
*/
|
|
|
|
|
@FXML
|
|
|
|
|
void addRow(ActionEvent event) {
|
|
|
|
|
ecnBeans.add(new EcnBean(ecnBeans.size()+1, reasons, wips, products));
|
|
|
|
|
ecnBeans.add(new EcnBean(ecnBeans.size() + 1, reasons, wips, products));
|
|
|
|
|
ObservableList<EcnBean> data = FXCollections.observableArrayList(ecnBeans);
|
|
|
|
|
tableView.getItems().clear();
|
|
|
|
|
tableView.setItems(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param event
|
|
|
|
|
* @function 删除行
|
|
|
|
@ -994,15 +999,16 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
@FXML
|
|
|
|
|
void deleteRow(ActionEvent event) {
|
|
|
|
|
int selectedIndex = tableView.getSelectionModel().getSelectedIndex();
|
|
|
|
|
System.out.println("selectedIndex==>"+selectedIndex);
|
|
|
|
|
System.out.println("selectedIndex==>" + selectedIndex);
|
|
|
|
|
ecnBeans.remove(selectedIndex);
|
|
|
|
|
for(int i=selectedIndex;i<ecnBeans.size();i++) {
|
|
|
|
|
ecnBeans.get(i).setNum(new SimpleIntegerProperty(i+1));
|
|
|
|
|
for (int i = selectedIndex; i < ecnBeans.size(); i++) {
|
|
|
|
|
ecnBeans.get(i).setNum(new SimpleIntegerProperty(i + 1));
|
|
|
|
|
}
|
|
|
|
|
ObservableList<EcnBean> data = FXCollections.observableArrayList(ecnBeans);
|
|
|
|
|
tableView.getItems().clear();
|
|
|
|
|
tableView.setItems(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param event
|
|
|
|
|
* @function 指派按钮
|
|
|
|
@ -1012,22 +1018,25 @@ public class CreateEcnController extends KFXPanelController {
|
|
|
|
|
// rb_tempChange
|
|
|
|
|
// assignBtn ecnId
|
|
|
|
|
try {
|
|
|
|
|
AssignIdDialog dialog = new AssignIdDialog(session,SAPUtil.getGroupID(),ecnId,target,rb_tempChange.isSelected(),assignBtn);
|
|
|
|
|
AssignIdDialog dialog = new AssignIdDialog(session, SAPUtil.getGroupID(), ecnId, target,
|
|
|
|
|
rb_tempChange.isSelected(), assignBtn);
|
|
|
|
|
dialog.start(new Stage());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
public TextField relateEcnText;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param event
|
|
|
|
|
* @function 关联申请单按钮
|
|
|
|
|
*/
|
|
|
|
|
@FXML
|
|
|
|
|
void relateClick(ActionEvent event) {
|
|
|
|
|
RelateEcnDialog dialog = new RelateEcnDialog(session,controller);
|
|
|
|
|
RelateEcnDialog dialog = new RelateEcnDialog(session, controller);
|
|
|
|
|
try {
|
|
|
|
|
dialog.start(new Stage());
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|