parent
bbcac57a9a
commit
dc52c69198
@ -1,164 +1,495 @@
|
|||||||
package com.connor.plm.CostListManagement.pojo;
|
package com.connor.plm.CostListManagement.pojo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ===============================================================================
|
||||||
|
* Copyright (c) 2012-2024 CONNOR lijh. Unpublished - All Rights Reserved
|
||||||
|
* ===============================================================================
|
||||||
|
* File description:
|
||||||
|
*
|
||||||
|
* GzxqBean.java 工装需求bean
|
||||||
|
*
|
||||||
|
* ===============================================================================
|
||||||
|
* DATE Name Description of Change
|
||||||
|
*
|
||||||
|
* 2024-06-13 ljh create
|
||||||
|
* ===============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import java.awt.Desktop;
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||||
|
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
||||||
|
import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||||
|
import com.teamcenter.rac.kernel.TCComponentFolder;
|
||||||
|
import com.teamcenter.rac.kernel.TCComponentItem;
|
||||||
|
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
||||||
|
import com.teamcenter.rac.kernel.TCComponentItemType;
|
||||||
|
import com.teamcenter.rac.kernel.TCSession;
|
||||||
|
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.TextArea;
|
||||||
|
|
||||||
public class GzxqBean {
|
public class GzxqBean {
|
||||||
private String instanceId;
|
private TextArea instanceId = new TextArea();
|
||||||
private String factory;
|
private TextArea factory = new TextArea();
|
||||||
private String sfId;
|
private TextArea sfId = new TextArea();
|
||||||
private String head;
|
private TextArea head = new TextArea();
|
||||||
private String scheduledtime;
|
private TextArea scheduledtime = new TextArea();
|
||||||
private String model;
|
private TextArea model = new TextArea();
|
||||||
private String productname;
|
private TextArea productname = new TextArea();
|
||||||
private String toolnumber;
|
private TextArea toolnumber = new TextArea();
|
||||||
private String toolname;
|
private TextArea toolname = new TextArea();
|
||||||
private String toolinglevel;
|
private TextArea toolinglevel = new TextArea();
|
||||||
private String reason;
|
|
||||||
private String jsgyrequirements;
|
private TextArea reason = new TextArea();
|
||||||
private String link;
|
private TextArea jsgyrequirements = new TextArea();
|
||||||
private String state;
|
private Button link = new Button();
|
||||||
|
private Button cjgzxq = new Button();
|
||||||
public GzxqBean() {
|
private String linkStr;
|
||||||
|
private String sfIdStr;
|
||||||
|
private String instanceIdStr;
|
||||||
|
private TCSession session;
|
||||||
|
private TextArea state = new TextArea();
|
||||||
|
private TextArea xh = new TextArea();
|
||||||
|
//设置TextArea的值和Button
|
||||||
|
public GzxqBean(String instanceId, String factory, String sfId, String head, String scheduledtime,
|
||||||
|
String model, String productname, String toolnumber, String toolname, String toolinglevel,
|
||||||
|
String reason, String jsgyrequirements, String link, String state, String xh,TCSession session) {
|
||||||
super();
|
super();
|
||||||
|
this.instanceId.setText(instanceId);
|
||||||
|
this.instanceId.setEditable(false);
|
||||||
|
this.instanceId.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.factory.setText(factory);
|
||||||
|
this.factory.setEditable(false);
|
||||||
|
this.factory.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.sfId.setText(sfId);
|
||||||
|
this.sfId.setEditable(false);
|
||||||
|
this.sfId.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.head.setText(head);
|
||||||
|
this.head.setEditable(false);
|
||||||
|
this.head.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.scheduledtime.setText(scheduledtime);
|
||||||
|
this.scheduledtime.setEditable(false);
|
||||||
|
this.scheduledtime.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
|
||||||
|
this.model.setText(model);
|
||||||
|
this.model.setEditable(false);
|
||||||
|
this.model.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.productname.setText(productname);
|
||||||
|
this.productname.setEditable(false);
|
||||||
|
this.productname.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.toolnumber.setText(toolnumber);
|
||||||
|
this.toolnumber.setEditable(false);
|
||||||
|
this.toolnumber.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.toolname.setText(toolname);
|
||||||
|
this.toolname.setEditable(false);
|
||||||
|
this.toolname.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.toolinglevel.setText(toolinglevel);
|
||||||
|
this.toolinglevel.setEditable(false);
|
||||||
|
this.toolinglevel.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.reason.setText(reason);
|
||||||
|
this.reason.setEditable(false);
|
||||||
|
this.reason.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.jsgyrequirements.setText(jsgyrequirements);
|
||||||
|
this.jsgyrequirements.setEditable(false);
|
||||||
|
this.jsgyrequirements.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.cjgzxq.setText("设计");;
|
||||||
|
this.cjgzxq.setPrefSize(200, 40);
|
||||||
|
this.link.setText("打开");
|
||||||
|
this.link.setPrefSize(200, 40);
|
||||||
|
this.linkStr = link;
|
||||||
|
this.sfIdStr = sfId;
|
||||||
|
this.instanceIdStr = instanceId;
|
||||||
|
this.session = session;
|
||||||
|
|
||||||
|
this.state.setText(state);
|
||||||
|
this.state.setEditable(false);
|
||||||
|
this.state.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
this.xh.setText(xh);
|
||||||
|
this.xh.setEditable(false);
|
||||||
|
this.xh.setPrefSize(200, 40);
|
||||||
|
|
||||||
|
//加按钮监听
|
||||||
|
this.link.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
|
@Override
|
||||||
|
public void handle(ActionEvent event) {
|
||||||
|
System.out.println("Button was clicked!");
|
||||||
|
// 在这里可以添加更多的逻辑
|
||||||
|
try {
|
||||||
|
browse2(linkStr);
|
||||||
|
} catch (Exception e1) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
public String getInstanceId() {
|
//加按钮监听 创建对象
|
||||||
return instanceId;
|
this.cjgzxq.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
|
@Override
|
||||||
|
public void handle(ActionEvent event) {
|
||||||
|
System.out.println("Button was clicked!");
|
||||||
|
// 在这里可以添加更多的逻辑
|
||||||
|
|
||||||
|
String formnumber = instanceIdStr;
|
||||||
|
String sfid =sfIdStr;
|
||||||
|
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
|
||||||
|
InterfaceAIFComponent target = app.getTargetComponent();
|
||||||
|
if(target instanceof TCComponentFolder) {
|
||||||
|
TCComponentFolder folder = (TCComponentFolder)target;
|
||||||
|
try {
|
||||||
|
TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
|
||||||
|
String newID = typeComponent.getNewID();
|
||||||
|
TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
|
||||||
|
TCComponentItemRevision itemRev = item.getLatestItemRevision();
|
||||||
|
if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
|
||||||
|
itemRev.setStringProperty("zt2_formnumber", formnumber);
|
||||||
|
}
|
||||||
|
if(itemRev != null && sfid != null && !sfid.isEmpty()) {
|
||||||
|
itemRev.setStringProperty("zt2_sfid", sfid);
|
||||||
|
}
|
||||||
|
folder.add("contents", item);
|
||||||
|
folder.refresh();
|
||||||
|
} catch (Exception e2) {
|
||||||
|
// TODO: handle exception
|
||||||
|
e2.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInstanceId(String instanceId) {
|
}else {
|
||||||
this.instanceId = instanceId;
|
try {
|
||||||
|
TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
|
||||||
|
String newID = typeComponent.getNewID();
|
||||||
|
TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
|
||||||
|
TCComponentItemRevision itemRev = item.getLatestItemRevision();
|
||||||
|
if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
|
||||||
|
itemRev.setStringProperty("zt2_formnumber", formnumber);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(itemRev != null && sfid != null && !sfid.isEmpty()) {
|
||||||
|
itemRev.setStringProperty("zt2_sfid", sfid);
|
||||||
|
}
|
||||||
|
session.getUser().getNewStuffFolder().add("contents", item);
|
||||||
|
} catch (Exception e2) {
|
||||||
|
// TODO: handle exception
|
||||||
|
e2.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactory() {
|
|
||||||
return factory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFactory(String factory) {
|
}
|
||||||
this.factory = factory;
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSfId() {
|
public TextArea getInstanceId() {
|
||||||
|
return instanceId;
|
||||||
|
}
|
||||||
|
public void setInstanceId(TextArea instanceId) {
|
||||||
|
this.instanceId = instanceId;
|
||||||
|
}
|
||||||
|
public TextArea getFactory() {
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
|
public void setFactory(TextArea factory) {
|
||||||
|
this.factory = factory;
|
||||||
|
}
|
||||||
|
public TextArea getSfId() {
|
||||||
return sfId;
|
return sfId;
|
||||||
}
|
}
|
||||||
|
public void setSfId(TextArea sfId) {
|
||||||
public void setSfId(String sfId) {
|
|
||||||
this.sfId = sfId;
|
this.sfId = sfId;
|
||||||
}
|
}
|
||||||
|
public TextArea getHead() {
|
||||||
public String getHead() {
|
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
|
public void setHead(TextArea head) {
|
||||||
public void setHead(String head) {
|
|
||||||
this.head = head;
|
this.head = head;
|
||||||
}
|
}
|
||||||
|
public TextArea getScheduledtime() {
|
||||||
public String getScheduledtime() {
|
|
||||||
return scheduledtime;
|
return scheduledtime;
|
||||||
}
|
}
|
||||||
|
public void setScheduledtime(TextArea scheduledtime) {
|
||||||
public void setScheduledtime(String scheduledtime) {
|
|
||||||
this.scheduledtime = scheduledtime;
|
this.scheduledtime = scheduledtime;
|
||||||
}
|
}
|
||||||
|
public TextArea getModel() {
|
||||||
public String getModel() {
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
public void setModel(TextArea model) {
|
||||||
public void setModel(String model) {
|
|
||||||
this.model = model;
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
public TextArea getProductname() {
|
||||||
public String getProductname() {
|
|
||||||
return productname;
|
return productname;
|
||||||
}
|
}
|
||||||
|
public void setProductname(TextArea productname) {
|
||||||
public void setProductname(String productname) {
|
|
||||||
this.productname = productname;
|
this.productname = productname;
|
||||||
}
|
}
|
||||||
|
public TextArea getToolnumber() {
|
||||||
public String getToolnumber() {
|
|
||||||
return toolnumber;
|
return toolnumber;
|
||||||
}
|
}
|
||||||
|
public void setToolnumber(TextArea toolnumber) {
|
||||||
public void setToolnumber(String toolnumber) {
|
|
||||||
this.toolnumber = toolnumber;
|
this.toolnumber = toolnumber;
|
||||||
}
|
}
|
||||||
|
public TextArea getToolname() {
|
||||||
public String getToolname() {
|
|
||||||
return toolname;
|
return toolname;
|
||||||
}
|
}
|
||||||
|
public void setToolname(TextArea toolname) {
|
||||||
public void setToolname(String toolname) {
|
|
||||||
this.toolname = toolname;
|
this.toolname = toolname;
|
||||||
}
|
}
|
||||||
|
public TextArea getToolinglevel() {
|
||||||
public String getToolinglevel() {
|
|
||||||
return toolinglevel;
|
return toolinglevel;
|
||||||
}
|
}
|
||||||
|
public void setToolinglevel(TextArea toolinglevel) {
|
||||||
public void setToolinglevel(String toolinglevel) {
|
|
||||||
this.toolinglevel = toolinglevel;
|
this.toolinglevel = toolinglevel;
|
||||||
}
|
}
|
||||||
|
public TextArea getReason() {
|
||||||
public String getReason() {
|
|
||||||
return reason;
|
return reason;
|
||||||
}
|
}
|
||||||
|
public void setReason(TextArea reason) {
|
||||||
public void setReason(String reason) {
|
|
||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
}
|
}
|
||||||
|
public Button getCjgzxq() {
|
||||||
|
return cjgzxq;
|
||||||
|
}
|
||||||
|
public void setCjgzxq(Button cjgzxq) {
|
||||||
|
this.cjgzxq = cjgzxq;
|
||||||
|
}
|
||||||
|
public Button getLink() {
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
public void setLink(Button link) {
|
||||||
|
this.link = link;
|
||||||
|
}
|
||||||
|
public TextArea getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
public void setState(TextArea state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
public TextArea getXh() {
|
||||||
|
return xh;
|
||||||
|
}
|
||||||
|
public void setXh(TextArea xh) {
|
||||||
|
this.xh = xh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getJsgyrequirements() {
|
public TextArea getJsgyrequirements() {
|
||||||
return jsgyrequirements;
|
return jsgyrequirements;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setJsgyrequirements(String jsgyrequirements) {
|
public void setJsgyrequirements(TextArea jsgyrequirements) {
|
||||||
this.jsgyrequirements = jsgyrequirements;
|
this.jsgyrequirements = jsgyrequirements;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLink() {
|
public String getLinkStr() {
|
||||||
return link;
|
return linkStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLink(String link) {
|
public void setLinkStr(String linkStr) {
|
||||||
this.link = link;
|
this.linkStr = linkStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getState() {
|
public String getSfIdStr() {
|
||||||
return state;
|
return sfIdStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setState(String state) {
|
public void setSfIdStr(String sfIdStr) {
|
||||||
this.state = state;
|
this.sfIdStr = sfIdStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GzxqBean(String instanceId, String factory, String sfId, String head, String scheduledtime, String model,
|
public String getInstanceIdStr() {
|
||||||
String productname, String toolnumber, String toolname, String toolinglevel, String reason,
|
return instanceIdStr;
|
||||||
String jsgyrequirements, String link, String state) {
|
|
||||||
super();
|
|
||||||
this.instanceId = instanceId;
|
|
||||||
this.factory = factory;
|
|
||||||
this.sfId = sfId;
|
|
||||||
this.head = head;
|
|
||||||
this.scheduledtime = scheduledtime;
|
|
||||||
this.model = model;
|
|
||||||
this.productname = productname;
|
|
||||||
this.toolnumber = toolnumber;
|
|
||||||
this.toolname = toolname;
|
|
||||||
this.toolinglevel = toolinglevel;
|
|
||||||
this.reason = reason;
|
|
||||||
this.jsgyrequirements = jsgyrequirements;
|
|
||||||
this.link = link;
|
|
||||||
this.state = state;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void setInstanceIdStr(String instanceIdStr) {
|
||||||
public String toString() {
|
this.instanceIdStr = instanceIdStr;
|
||||||
return "GzxqBean [instanceId=" + instanceId + ", factory=" + factory + ", sfId=" + sfId + ", head=" + head
|
|
||||||
+ ", scheduledtime=" + scheduledtime + ", model=" + model + ", productname=" + productname
|
|
||||||
+ ", toolnumber=" + toolnumber + ", toolname=" + toolname + ", toolinglevel=" + toolinglevel
|
|
||||||
+ ", reason=" + reason + ", jsgyrequirements=" + jsgyrequirements + ", link=" + link + ", state="
|
|
||||||
+ state + "]";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TCSession getSession() {
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSession(TCSession session) {
|
||||||
|
this.session = session;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过浏览器打开连接
|
||||||
|
*/
|
||||||
|
private void browse2(String url) throws Exception {
|
||||||
|
Desktop desktop = Desktop.getDesktop();
|
||||||
|
if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
|
||||||
|
URI uri = new URI(url);
|
||||||
|
desktop.browse(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// public GzxqBean() {
|
||||||
|
// super();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getInstanceId() {
|
||||||
|
// return instanceId;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setInstanceId(String instanceId) {
|
||||||
|
// this.instanceId = instanceId;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getFactory() {
|
||||||
|
// return factory;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setFactory(String factory) {
|
||||||
|
// this.factory = factory;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getSfId() {
|
||||||
|
// return sfId;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setSfId(String sfId) {
|
||||||
|
// this.sfId = sfId;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getHead() {
|
||||||
|
// return head;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setHead(String head) {
|
||||||
|
// this.head = head;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getScheduledtime() {
|
||||||
|
// return scheduledtime;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setScheduledtime(String scheduledtime) {
|
||||||
|
// this.scheduledtime = scheduledtime;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getModel() {
|
||||||
|
// return model;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setModel(String model) {
|
||||||
|
// this.model = model;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getProductname() {
|
||||||
|
// return productname;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setProductname(String productname) {
|
||||||
|
// this.productname = productname;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getToolnumber() {
|
||||||
|
// return toolnumber;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setToolnumber(String toolnumber) {
|
||||||
|
// this.toolnumber = toolnumber;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getToolname() {
|
||||||
|
// return toolname;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setToolname(String toolname) {
|
||||||
|
// this.toolname = toolname;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getToolinglevel() {
|
||||||
|
// return toolinglevel;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setToolinglevel(String toolinglevel) {
|
||||||
|
// this.toolinglevel = toolinglevel;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getReason() {
|
||||||
|
// return reason;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setReason(String reason) {
|
||||||
|
// this.reason = reason;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getJsgyrequirements() {
|
||||||
|
// return jsgyrequirements;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setJsgyrequirements(String jsgyrequirements) {
|
||||||
|
// this.jsgyrequirements = jsgyrequirements;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getLink() {
|
||||||
|
// return link;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setLink(String link) {
|
||||||
|
// this.link = link;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getState() {
|
||||||
|
// return state;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setState(String state) {
|
||||||
|
// this.state = state;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public GzxqBean(String instanceId, String factory, String sfId, String head, String scheduledtime, String model,
|
||||||
|
// String productname, String toolnumber, String toolname, String toolinglevel, String reason,
|
||||||
|
// String jsgyrequirements, String link, String state) {
|
||||||
|
// super();
|
||||||
|
// this.instanceId = instanceId;
|
||||||
|
// this.factory = factory;
|
||||||
|
// this.sfId = sfId;
|
||||||
|
// this.head = head;
|
||||||
|
// this.scheduledtime = scheduledtime;
|
||||||
|
// this.model = model;
|
||||||
|
// this.productname = productname;
|
||||||
|
// this.toolnumber = toolnumber;
|
||||||
|
// this.toolname = toolname;
|
||||||
|
// this.toolinglevel = toolinglevel;
|
||||||
|
// this.reason = reason;
|
||||||
|
// this.jsgyrequirements = jsgyrequirements;
|
||||||
|
// this.link = link;
|
||||||
|
// this.state = state;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public String toString() {
|
||||||
|
// return "GzxqBean [instanceId=" + instanceId + ", factory=" + factory + ", sfId=" + sfId + ", head=" + head
|
||||||
|
// + ", scheduledtime=" + scheduledtime + ", model=" + model + ", productname=" + productname
|
||||||
|
// + ", toolnumber=" + toolnumber + ", toolname=" + toolname + ", toolinglevel=" + toolinglevel
|
||||||
|
// + ", reason=" + reason + ", jsgyrequirements=" + jsgyrequirements + ", link=" + link + ", state="
|
||||||
|
// + state + "]";
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,124 +1,124 @@
|
|||||||
package com.connor.plm.GZXQ;
|
//package com.connor.plm.GZXQ;
|
||||||
|
//
|
||||||
import java.awt.Component;
|
//import java.awt.Component;
|
||||||
import java.awt.Desktop;
|
//import java.awt.Desktop;
|
||||||
import java.net.URI;
|
//import java.net.URI;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
import javax.swing.AbstractCellEditor;
|
//import javax.swing.AbstractCellEditor;
|
||||||
import javax.swing.JButton;
|
//import javax.swing.JButton;
|
||||||
import javax.swing.JTable;
|
//import javax.swing.JTable;
|
||||||
import javax.swing.table.TableCellEditor;
|
//import javax.swing.table.TableCellEditor;
|
||||||
|
//
|
||||||
import com.connor.plm.CostListManagement.pojo.Cusquotation;
|
//import com.connor.plm.CostListManagement.pojo.Cusquotation;
|
||||||
import com.connor.plm.CostListManagement.pojo.GzxqBean;
|
//import com.connor.plm.CostListManagement.pojo.GzxqBean;
|
||||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
//import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||||
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
//import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
||||||
import com.teamcenter.rac.aifrcp.AIFUtility;
|
//import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||||
import com.teamcenter.rac.kernel.TCComponent;
|
//import com.teamcenter.rac.kernel.TCComponent;
|
||||||
import com.teamcenter.rac.kernel.TCComponentFolder;
|
//import com.teamcenter.rac.kernel.TCComponentFolder;
|
||||||
import com.teamcenter.rac.kernel.TCComponentItem;
|
//import com.teamcenter.rac.kernel.TCComponentItem;
|
||||||
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
//import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
||||||
import com.teamcenter.rac.kernel.TCComponentItemType;
|
//import com.teamcenter.rac.kernel.TCComponentItemType;
|
||||||
import com.teamcenter.rac.kernel.TCSession;
|
//import com.teamcenter.rac.kernel.TCSession;
|
||||||
|
//
|
||||||
public class ButtonCellEditor extends AbstractCellEditor implements TableCellEditor{
|
//public class ButtonCellEditor extends AbstractCellEditor implements TableCellEditor{
|
||||||
|
//
|
||||||
|
//
|
||||||
private JButton button;
|
// private JButton button;
|
||||||
private JTable table;
|
// private JTable table;
|
||||||
private List<GzxqBean> quotations;
|
// private List<GzxqBean> quotations;
|
||||||
private Boolean flag = false;
|
// private Boolean flag = false;
|
||||||
public static GzxqBean quotation;
|
// public static GzxqBean quotation;
|
||||||
public static Cusquotation cusquotation;
|
// public static Cusquotation cusquotation;
|
||||||
public static TCSession session;
|
// public static TCSession session;
|
||||||
|
//
|
||||||
public ButtonCellEditor(JTable jTable2,List<GzxqBean> quotations,TCSession session, TCComponent f) {
|
// public ButtonCellEditor(JTable jTable2,List<GzxqBean> quotations,TCSession session, TCComponent f) {
|
||||||
button = new JButton();
|
// button = new JButton();
|
||||||
this.table = jTable2;
|
// this.table = jTable2;
|
||||||
this.quotations = quotations;
|
// this.quotations = quotations;
|
||||||
this.session = session;
|
// this.session = session;
|
||||||
button.addActionListener(e -> {
|
// button.addActionListener(e -> {
|
||||||
// 这里可以添加按钮的点击事件响应逻辑
|
// // 这里可以添加按钮的点击事件响应逻辑
|
||||||
int selectedRow = table.getSelectedRow();
|
// int selectedRow = table.getSelectedRow();
|
||||||
System.out.println("点击了第"+selectedRow+"行");
|
// System.out.println("点击了第"+selectedRow+"行");
|
||||||
String text = button.getText();
|
// String text = button.getText();
|
||||||
System.out.println("点击按钮名称:"+text);
|
// System.out.println("点击按钮名称:"+text);
|
||||||
if("打开".equals(text)) {
|
// if("打开".equals(text)) {
|
||||||
String url = quotations.get(selectedRow).getLink();
|
// String url = quotations.get(selectedRow).getLink();
|
||||||
try {
|
// try {
|
||||||
browse2(url);
|
// browse2(url);
|
||||||
} catch (Exception e1) {
|
// } catch (Exception e1) {
|
||||||
// TODO Auto-generated catch block
|
// // TODO Auto-generated catch block
|
||||||
e1.printStackTrace();
|
// e1.printStackTrace();
|
||||||
}
|
// }
|
||||||
}else if("设计".equals(text)){
|
// }else if("设计".equals(text)){
|
||||||
String formnumber = quotations.get(selectedRow).getInstanceId();
|
// String formnumber = quotations.get(selectedRow).getInstanceId();
|
||||||
String sfid = quotations.get(selectedRow).getSfId();
|
// String sfid = quotations.get(selectedRow).getSfId();
|
||||||
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
|
// AbstractAIFApplication app = AIFUtility.getCurrentApplication();
|
||||||
InterfaceAIFComponent target = app.getTargetComponent();
|
// InterfaceAIFComponent target = app.getTargetComponent();
|
||||||
if(target instanceof TCComponentFolder) {
|
// if(target instanceof TCComponentFolder) {
|
||||||
TCComponentFolder folder = (TCComponentFolder)target;
|
// TCComponentFolder folder = (TCComponentFolder)target;
|
||||||
try {
|
// try {
|
||||||
TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
|
// TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
|
||||||
String newID = typeComponent.getNewID();
|
// String newID = typeComponent.getNewID();
|
||||||
TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
|
// TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
|
||||||
TCComponentItemRevision itemRev = item.getLatestItemRevision();
|
// TCComponentItemRevision itemRev = item.getLatestItemRevision();
|
||||||
if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
|
// if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
|
||||||
itemRev.setStringProperty("zt2_formnumber", formnumber);
|
// itemRev.setStringProperty("zt2_formnumber", formnumber);
|
||||||
}
|
// }
|
||||||
if(itemRev != null && sfid != null && !sfid.isEmpty()) {
|
// if(itemRev != null && sfid != null && !sfid.isEmpty()) {
|
||||||
itemRev.setStringProperty("zt2_sfid", sfid);
|
// itemRev.setStringProperty("zt2_sfid", sfid);
|
||||||
}
|
// }
|
||||||
folder.add("contents", item);
|
// folder.add("contents", item);
|
||||||
folder.refresh();
|
// folder.refresh();
|
||||||
} catch (Exception e2) {
|
// } catch (Exception e2) {
|
||||||
// TODO: handle exception
|
// // TODO: handle exception
|
||||||
e2.printStackTrace();
|
// e2.printStackTrace();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}else {
|
// }else {
|
||||||
try {
|
// try {
|
||||||
TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
|
// TCComponentItemType typeComponent = (TCComponentItemType) session.getTypeComponent("ZT2_Frock");
|
||||||
String newID = typeComponent.getNewID();
|
// String newID = typeComponent.getNewID();
|
||||||
TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
|
// TCComponentItem item = typeComponent.create(newID, "A", "ZT2_Frock", "", "", null);
|
||||||
TCComponentItemRevision itemRev = item.getLatestItemRevision();
|
// TCComponentItemRevision itemRev = item.getLatestItemRevision();
|
||||||
if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
|
// if(itemRev != null && formnumber != null && !formnumber.isEmpty()) {
|
||||||
itemRev.setStringProperty("zt2_formnumber", formnumber);
|
// itemRev.setStringProperty("zt2_formnumber", formnumber);
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
if(itemRev != null && sfid != null && !sfid.isEmpty()) {
|
// if(itemRev != null && sfid != null && !sfid.isEmpty()) {
|
||||||
itemRev.setStringProperty("zt2_sfid", sfid);
|
// itemRev.setStringProperty("zt2_sfid", sfid);
|
||||||
}
|
// }
|
||||||
session.getUser().getNewStuffFolder().add("contents", item);
|
// session.getUser().getNewStuffFolder().add("contents", item);
|
||||||
} catch (Exception e2) {
|
// } catch (Exception e2) {
|
||||||
// TODO: handle exception
|
// // TODO: handle exception
|
||||||
e2.printStackTrace();
|
// e2.printStackTrace();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
private void browse2(String url) throws Exception {
|
//private void browse2(String url) throws Exception {
|
||||||
Desktop desktop = Desktop.getDesktop();
|
// Desktop desktop = Desktop.getDesktop();
|
||||||
if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
|
// if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
|
||||||
URI uri = new URI(url);
|
// URI uri = new URI(url);
|
||||||
desktop.browse(uri);
|
// desktop.browse(uri);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
@Override
|
//@Override
|
||||||
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
|
//public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
|
||||||
int row, int column) {
|
// int row, int column) {
|
||||||
button.setText(value != null ? value.toString() : "");
|
// button.setText(value != null ? value.toString() : "");
|
||||||
return button;
|
// return button;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
@Override
|
//@Override
|
||||||
public Object getCellEditorValue() {
|
//public Object getCellEditorValue() {
|
||||||
return button.getText();
|
// return button.getText();
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue