no-bomasyn
洪丞进 2 years ago
parent c15d8a9833
commit 9f6038cca3

@ -35,198 +35,206 @@ import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.SimpleStringProperty;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
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<Quotation> quotations;
private List<Quotation> quotations; private Boolean flag = false;
private Boolean flag = false; public static Quotation quotation;
public static Quotation quotation; public static Cusquotation cusquotation;
public static Cusquotation cusquotation; public static List<QuotationMX> tableList;
public static List<QuotationMX> tableList; public static TCSession session;
public static TCSession session; public static TCComponent project;
public static TCComponent project; public static TCComponent f;
public static TCComponent f; private JFrame frame;
private JFrame frame;
public ButtonCellEditor(JTable jTable2,List<Quotation> quotations,TCSession session, TCComponent f,JFrame frame) { public ButtonCellEditor(JTable jTable2, List<Quotation> quotations, TCSession session, TCComponent f,
button = new JButton(); JFrame frame) {
this.table = jTable2; button = new JButton();
this.quotations = quotations; this.table = jTable2;
this.session = session; this.quotations = quotations;
this.f = f; this.session = session;
this.frame = frame; this.f = f;
button.addActionListener(e -> { this.frame = frame;
// 这里可以添加按钮的点击事件响应逻辑 button.addActionListener(e -> {
int selectedRow = table.getSelectedRow(); // 这里可以添加按钮的点击事件响应逻辑
System.out.println("点击了第"+selectedRow+"行"); int selectedRow = table.getSelectedRow();
String text = button.getText(); System.out.println("点击了第" + selectedRow + "行");
System.out.println("点击按钮名称:"+text); String text = button.getText();
if("打开".equals(text)) { System.out.println("点击按钮名称:" + text);
String url = quotations.get(selectedRow).getTechnical(); if ("打开".equals(text)) {
try { String url = quotations.get(selectedRow).getTechnical();
browse2(url); try {
} catch (Exception e1) { browse2(url);
// TODO Auto-generated catch block } catch (Exception e1) {
e1.printStackTrace(); // TODO Auto-generated catch block
} e1.printStackTrace();
}else if("创建".equals(text)){ }
Object valueAt = table.getValueAt(table.getSelectedRow(), 4); } else if ("创建".equals(text)) {
if("已创建".equals(valueAt)) { Object valueAt = table.getValueAt(table.getSelectedRow(), 4);
MessageBox.post("请勿重复创建", "提示", MessageBox.INFORMATION); if ("已创建".equals(valueAt)) {
return; MessageBox.post("请勿重复创建", "提示", MessageBox.INFORMATION);
} return;
/*341 }
1- /*
*/ * 341 1-
//修改表一数据,改变表格内容 */
try { // 修改表一数据,改变表格内容
String update = "UPDATE \"CHINT_ QUOTATION_TITLE_TEMPLATE\" set \"state\"='已创建' where \"tennumber\" = '"+quotations.get(selectedRow).getTennumber()+"'"; try {
System.out.println("update:"+update); String update = "UPDATE \"CHINT_ QUOTATION_TITLE_TEMPLATE\" set \"state\"='已创建' where \"tennumber\" = '"
int state = SqlUtil.update(update); + quotations.get(selectedRow).getTennumber() + "'";
System.out.println("修改数据库:"+state); System.out.println("update:" + update);
int state = SqlUtil.update(update);
String insert = "INSERT INTO \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\"(\"cbdlx\",\"projectid\",\"revision\",\"factory\",\"proname\",\"tennumber\",\"promanager\",\"quantity\",\"tramodel\",\"capfactor\",\"volratio\",\"noloadloss\",\"loadloss\",\"impvoltage\",\"traweight\",\"totweight\",\"copconsumption\",\"cmarketprice\",\"vollevel\") values('"+ System.out.println("修改数据库:" + state);
"报价成本单','"+
project.getStringProperty("item_id")+"','"+ String insert = "INSERT INTO \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\"(\"cbdlx\",\"projectid\",\"revision\",\"factory\",\"proname\",\"tennumber\",\"promanager\",\"quantity\",\"tramodel\",\"capfactor\",\"volratio\",\"noloadloss\",\"loadloss\",\"impvoltage\",\"traweight\",\"totweight\",\"copconsumption\",\"cmarketprice\",\"vollevel\") values('"
"01','"+ + "报价成本单','" + project.getStringProperty("item_id") + "','" + "01','"
quotations.get(selectedRow).getFactory()+"','"+ + quotations.get(selectedRow).getFactory() + "','"
quotations.get(selectedRow).getProname()+"','"+ + quotations.get(selectedRow).getProname() + "','"
quotations.get(selectedRow).getTennumber()+"','"+ + quotations.get(selectedRow).getTennumber() + "','"
quotations.get(selectedRow).getPromanager()+"','"+ + quotations.get(selectedRow).getPromanager() + "','"
quotations.get(selectedRow).getQuantity()+"','"+ + quotations.get(selectedRow).getQuantity() + "','"
quotations.get(selectedRow).getTramodel()+"','"+ + quotations.get(selectedRow).getTramodel() + "','"
quotations.get(selectedRow).getCapfactor()+"','"+ + quotations.get(selectedRow).getCapfactor() + "','"
quotations.get(selectedRow).getVolratio()+"','"+ + quotations.get(selectedRow).getVolratio() + "','"
quotations.get(selectedRow).getNoloadloss()+"','"+ + quotations.get(selectedRow).getNoloadloss() + "','"
quotations.get(selectedRow).getLoadloss()+"','"+ + quotations.get(selectedRow).getLoadloss() + "','"
quotations.get(selectedRow).getImpvoltage()+"','"+ + quotations.get(selectedRow).getImpvoltage() + "','"
quotations.get(selectedRow).getTraweight()+"','"+ + quotations.get(selectedRow).getTraweight() + "','"
quotations.get(selectedRow).getTotweight()+"','"+ + quotations.get(selectedRow).getTotweight() + "','"
quotations.get(selectedRow).getCopconsumption()+"','"+ + quotations.get(selectedRow).getCopconsumption() + "','"
quotations.get(selectedRow).getCmarketprice()+"','"+ + quotations.get(selectedRow).getCmarketprice() + "','"
quotations.get(selectedRow).getVollevel()+"')"; + quotations.get(selectedRow).getVollevel() + "')";
System.out.println("insert:"+insert); System.out.println("insert:" + insert);
int write = SqlUtil.write(insert); int write = SqlUtil.write(insert);
System.out.println("插入数据库:"+write); System.out.println("插入数据库:" + write);
//修改表格内容 // 修改表格内容
table.setValueAt("已创建", table.getSelectedRow(), 4); table.setValueAt("已创建", table.getSelectedRow(), 4);
//创建对象挂载 // 创建对象挂载
TCComponentItemType tccomponentitemtype = (TCComponentItemType)session.getTypeComponent("ZT2_COSTSHEET"); TCComponentItemType tccomponentitemtype = (TCComponentItemType) session
String itemId = tccomponentitemtype.getNewID(); .getTypeComponent("ZT2_COSTSHEET");
String itemRev = tccomponentitemtype.getNewRev(null); String itemId = tccomponentitemtype.getNewID();
TCComponentItem item = tccomponentitemtype.create(itemId,itemRev,"ZT2_COSTSHEET","报价成本单","",null); String itemRev = tccomponentitemtype.getNewRev(null);
item.getLatestItemRevision().setProperty("zt2_cbdlx", "报价成本单"); TCComponentItem item = tccomponentitemtype.create(itemId, itemRev, "ZT2_COSTSHEET", "报价成本单", "",
item.getLatestItemRevision().setProperty("object_desc", project.getStringProperty("item_id")); null);
//挂在选中的文件夹下面 item.getLatestItemRevision().setProperty("zt2_cbdlx", "报价成本单");
f.add("contents",item); item.getLatestItemRevision().setProperty("object_desc", project.getStringProperty("item_id"));
flag = true; // 挂在选中的文件夹下面
//查询表三的内容,表二的内容,注入窗口 f.add("contents", item);
String select1 = "SELECT * FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" WHERE \"tennumber\"='"+quotations.get(selectedRow).getTennumber()+"'"; flag = true;
System.out.println("select1:"+select1); // 查询表三的内容,表二的内容,注入窗口
ResultSet resultSet1 = SqlUtil.read(select1); String select1 = "SELECT * FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" WHERE \"tennumber\"='"
while(resultSet1.next()) { + quotations.get(selectedRow).getTennumber() + "'";
cusquotation = new Cusquotation(resultSet1.getString("cbdlx"),resultSet1.getString("projectid"),resultSet1.getString("revision"), System.out.println("select1:" + select1);
resultSet1.getString("proname"),resultSet1.getString("tennumber"),resultSet1.getString("promanager"),resultSet1.getString("quantity"), ResultSet resultSet1 = SqlUtil.read(select1);
resultSet1.getString("tramodel"),resultSet1.getString("capfactor"),resultSet1.getString("volratio"),resultSet1.getString("noloadloss"), while (resultSet1.next()) {
resultSet1.getString("loadloss"),resultSet1.getString("impvoltage"),resultSet1.getString("traweight"),resultSet1.getString("totweight"), cusquotation = new Cusquotation(resultSet1.getString("cbdlx"),
QuotationUtil.formatString(resultSet1.getString("copconsumption")),QuotationUtil.formatString(resultSet1.getString("cmarketprice")),resultSet1.getString("vollevel"),resultSet1.getString("factory")); resultSet1.getString("projectid"), resultSet1.getString("revision"),
break; resultSet1.getString("proname"), resultSet1.getString("tennumber"),
} resultSet1.getString("promanager"), resultSet1.getString("quantity"),
resultSet1.getString("tramodel"), resultSet1.getString("capfactor"),
String select4 = "SELECT * FROM \"CHINT_ QUOTATION_ DETAILS_TEMPLATE\" WHERE \"tennumber\"='"+quotations.get(selectedRow).getTennumber()+"'"; resultSet1.getString("volratio"), resultSet1.getString("noloadloss"),
System.out.println("select4:"+select4); resultSet1.getString("loadloss"), resultSet1.getString("impvoltage"),
ResultSet resultSet4 = SqlUtil.read(select4); resultSet1.getString("traweight"), resultSet1.getString("totweight"),
List<String> insertList = new ArrayList<String>(); QuotationUtil.formatString(resultSet1.getString("copconsumption")),
while(resultSet4.next()) { QuotationUtil.formatString(resultSet1.getString("cmarketprice")),
String insert1 = "INSERT INTO \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\"(\"cbdlx\",\"projectid\",\"revision\",\"matgroup\",\"mgsnumber\",\"matcname\",\"matcnumber\",\"matcatname\",\"specifications\",\"manufacturer\",\"nwquantity\",\"utirate\",\"unit\",\"amomoney\",\"unitprice\",\"no\",\"totalprice\") values('"+ resultSet1.getString("vollevel"), resultSet1.getString("factory"));
"报价成本单"+"','"+ break;
project.getStringProperty("item_id")+"','"+ }
"01"+"','"+
resultSet4.getString("matgroup")+"','"+ String select4 = "SELECT * FROM \"CHINT_ QUOTATION_ DETAILS_TEMPLATE\" WHERE \"tennumber\"='"
resultSet4.getString("mgsnumber")+"','"+ + quotations.get(selectedRow).getTennumber() + "'";
resultSet4.getString("matcname")+"','"+ System.out.println("select4:" + select4);
resultSet4.getString("matcnumber")+"','"+ ResultSet resultSet4 = SqlUtil.read(select4);
resultSet4.getString("matcatname")+"','"+ List<String> insertList = new ArrayList<String>();
resultSet4.getString("specifications")+"','"+ while (resultSet4.next()) {
resultSet4.getString("manufacturer")+"','"+ String insert1 = "INSERT INTO \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\"(\"cbdlx\",\"projectid\",\"revision\",\"matgroup\",\"mgsnumber\",\"matcname\",\"matcnumber\",\"matcatname\",\"specifications\",\"manufacturer\",\"nwquantity\",\"utirate\",\"unit\",\"amomoney\",\"unitprice\",\"no\",\"totalprice\") values('"
resultSet4.getString("nwquantity")+"','"+ + "报价成本单" + "','" + project.getStringProperty("item_id") + "','" + "01" + "','"
resultSet4.getString("utirate")+"','"+ + resultSet4.getString("matgroup") + "','" + resultSet4.getString("mgsnumber") + "','"
resultSet4.getString("unit")+"','"+ + resultSet4.getString("matcname") + "','" + resultSet4.getString("matcnumber") + "','"
resultSet4.getString("amomoney")+"','"+ + resultSet4.getString("matcatname") + "','" + resultSet4.getString("specifications")
resultSet4.getString("unitprice")+"','"+ + "','" + resultSet4.getString("manufacturer") + "','"
resultSet4.getString("no")+"','"+ + resultSet4.getString("nwquantity") + "','" + resultSet4.getString("utirate") + "','"
resultSet4.getString("totalprice")+"')"; + resultSet4.getString("unit") + "','" + resultSet4.getString("amomoney") + "','"
insertList.add(insert1); + resultSet4.getString("unitprice") + "','" + resultSet4.getString("no") + "','"
+ resultSet4.getString("totalprice") + "')";
} insertList.add(insert1);
for(String insertsql : insertList) {
System.out.println("insert:"+insertsql); }
SqlUtil.write(insertsql); for (String insertsql : insertList) {
} System.out.println("insert:" + insertsql);
SqlUtil.write(insertsql);
String select2 = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"+project.getStringProperty("item_id")+"' and \"cbdlx\" = '报价成本单' order by \"matgroup\" asc ,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc"; }
System.out.println("select2:"+select2);
ResultSet resultSet2 = SqlUtil.read(select2); String select2 = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"
tableList = new ArrayList<QuotationMX>(); + project.getStringProperty("item_id")
while(resultSet2.next()) { + "' and \"cbdlx\" = '报价成本单' order by \"matgroup\" asc ,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc";
QuotationMX quotationMX = new QuotationMX(); System.out.println("select2:" + select2);
quotationMX.setCbdlx(resultSet2.getString("cbdlx")); ResultSet resultSet2 = SqlUtil.read(select2);
quotationMX.setProjectid(resultSet2.getString("projectid")); tableList = new ArrayList<QuotationMX>();
quotationMX.setRevision(resultSet2.getString("revision")); while (resultSet2.next()) {
quotationMX.setMatgroup(new SimpleStringProperty(resultSet2.getString("matgroup"))); QuotationMX quotationMX = new QuotationMX();
quotationMX.setMgsnumber(new SimpleStringProperty(resultSet2.getString("mgsnumber"))); quotationMX.setCbdlx(resultSet2.getString("cbdlx"));
quotationMX.setMatcname(new SimpleStringProperty(resultSet2.getString("matcname"))); quotationMX.setProjectid(resultSet2.getString("projectid"));
quotationMX.setMatcnumber(new SimpleStringProperty(resultSet2.getString("matcnumber"))); quotationMX.setRevision(resultSet2.getString("revision"));
quotationMX.setMatcatname(new SimpleStringProperty(resultSet2.getString("matcatname"))); quotationMX.setMatgroup(new SimpleStringProperty(resultSet2.getString("matgroup")));
quotationMX.setSpecifications(new SimpleStringProperty(resultSet2.getString("specifications"))); quotationMX.setMgsnumber(new SimpleStringProperty(resultSet2.getString("mgsnumber")));
quotationMX.setManufacturer(new SimpleStringProperty(resultSet2.getString("manufacturer"))); quotationMX.setMatcname(new SimpleStringProperty(resultSet2.getString("matcname")));
quotationMX.setNwquantity(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("nwquantity")))); quotationMX.setMatcnumber(new SimpleStringProperty(resultSet2.getString("matcnumber")));
quotationMX.setUtirate(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("utirate")))); quotationMX.setMatcatname(new SimpleStringProperty(resultSet2.getString("matcatname")));
quotationMX.setUnit(new SimpleStringProperty(resultSet2.getString("unit"))); quotationMX.setSpecifications(new SimpleStringProperty(resultSet2.getString("specifications")));
quotationMX.setAmomoney(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("amomoney")))); quotationMX.setManufacturer(new SimpleStringProperty(resultSet2.getString("manufacturer")));
quotationMX.setUnitprice(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("unitprice")))); quotationMX.setNwquantity(new SimpleStringProperty(
quotationMX.setNo(new SimpleStringProperty(resultSet2.getString("no"))); QuotationUtil.formatString(resultSet2.getString("nwquantity"))));
quotationMX.setContrastPrice(new SimpleStringProperty("")); quotationMX.setUtirate(
quotationMX.setTotalprice(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("totalprice")))); new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("utirate"))));
tableList.add(quotationMX); quotationMX.setUnit(new SimpleStringProperty(resultSet2.getString("unit")));
} quotationMX.setAmomoney(
new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("amomoney"))));
} catch (Exception e1) { quotationMX.setUnitprice(new SimpleStringProperty(
// TODO Auto-generated catch block QuotationUtil.formatString(resultSet2.getString("unitprice"))));
e1.printStackTrace(); quotationMX.setNo(new SimpleStringProperty(resultSet2.getString("no")));
} quotationMX.setContrastPrice(new SimpleStringProperty(""));
quotationMX.setTotalprice(new SimpleStringProperty(
QuotationUtil.formatString(resultSet2.getString("totalprice"))));
tableList.add(quotationMX);
}
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
// quotation = new Quotation(); // quotation = new Quotation();
// quotation.setProname("test"); // quotation.setProname("test");
this.frame.dispose(); this.frame.dispose();
new JDBFrame(); new JDBFrame();
}
} });
});
}
}
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(); }
}
} }

@ -30,29 +30,31 @@ import javafx.stage.WindowEvent;
class ButtonCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer { class ButtonCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer {
private JButton button; private JButton button;
private JTable table; private JTable table;
private List<Quotation> quotations; private List<Quotation> quotations;
private TCSession session; private TCSession session;
private TCComponent f; private TCComponent f;
private JFrame frame; private JFrame frame;
public ButtonCellRenderer(JTable jTable2, List<Quotation> quotations,TCSession session, TCComponent f,JFrame frame) {
button = new JButton(); public ButtonCellRenderer(JTable jTable2, List<Quotation> quotations, TCSession session, TCComponent f,
this.quotations = quotations; JFrame frame) {
this.table = jTable2; button = new JButton();
this.session = session; this.quotations = quotations;
this.f = f; this.table = jTable2;
this.frame = frame; this.session = session;
} this.f = f;
public interface CostPageCallback { this.frame = frame;
void onOpenCostPage(); }
}
@Override public interface CostPageCallback {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, void onOpenCostPage();
boolean hasFocus, int row, int column) { }
button.setText(value != null ? value.toString() : "");
return button; @Override
} public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
button.setText(value != null ? value.toString() : "");
return button;
}
} }

@ -35,194 +35,239 @@ import javafx.beans.property.SimpleStringProperty;
/** /**
* *
* @author hongcj *
* 2023/11/16 * @author hongcj 2023/11/16
*/ */
public class CostListManagementHandler extends AbstractHandler{ public class CostListManagementHandler extends AbstractHandler {
@Override @Override
public Object execute(ExecutionEvent arg0) { public Object execute(ExecutionEvent arg0) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
AbstractAIFApplication app = AIFUtility.getCurrentApplication(); AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession)app.getSession(); TCSession session = (TCSession) app.getSession();
try { try {
new Thread() { new Thread() {
@Override @Override
public void run() { public void run() {
// 获取tc当前选择的操作 // 获取tc当前选择的操作
InterfaceAIFComponent target = app.getTargetComponent(); InterfaceAIFComponent target = app.getTargetComponent();
if(target instanceof TCComponent) { if (target instanceof TCComponent) {
TCComponent project = (TCComponent)target; TCComponent project = (TCComponent) target;
try { try {
String stringProperty = project.getStringProperty("object_type"); String stringProperty = project.getStringProperty("object_type");
if(!"ZT2_ProjectItem".equals(stringProperty)) { if (!"ZT2_ProjectItem".equals(stringProperty)) {
MessageBox.post("请选择项目零组件对象", "提示", MessageBox.INFORMATION); MessageBox.post("请选择项目零组件对象", "提示", MessageBox.INFORMATION);
return; return;
} }
} catch (TCException e1) { } catch (TCException e1) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e1.printStackTrace(); e1.printStackTrace();
} }
/* /*
* 1-ZT2_COSTSHEET * 1-ZT2_COSTSHEET
* */
*/ AIFComponentContext[] children = null;
AIFComponentContext[] children = null; try {
try { children = project.getChildren();
children = project.getChildren(); } catch (TCException e) {
} catch (TCException e) { // TODO Auto-generated catch block
// TODO Auto-generated catch block e.printStackTrace();
e.printStackTrace(); }
} for (AIFComponentContext child : children) {
for(AIFComponentContext child : children) { TCComponent component = (TCComponent) child.getComponent();
TCComponent component = (TCComponent)child.getComponent(); try {
try { System.out.println(component.getProperty("object_name"));
System.out.println(component.getProperty("object_name")); } catch (TCException e) {
} catch (TCException e) { // TODO Auto-generated catch block
// TODO Auto-generated catch block e.printStackTrace();
e.printStackTrace(); }
} try {
try { if ("项目执行".equals(component.getProperty("object_name"))) {
if("项目执行".equals(component.getProperty("object_name"))) { AIFComponentContext[] children2 = component.getChildren();
AIFComponentContext[] children2 = component.getChildren(); for (AIFComponentContext child2 : children2) {
for(AIFComponentContext child2 : children2) { TCComponent component2 = (TCComponent) child2.getComponent();
TCComponent component2 = (TCComponent)child2.getComponent(); System.out.println(component2.getProperty("object_name"));
System.out.println(component2.getProperty("object_name")); if ("1-电磁设计".equals(component2.getProperty("object_name"))) {
if("1-电磁设计".equals(component2.getProperty("object_name"))) { System.out.println("开始查看1-电磁设计下的文件是否含有成本单");
System.out.println("开始查看1-电磁设计下的文件是否含有成本单"); AIFComponentContext[] children3 = component2.getChildren();
AIFComponentContext[] children3 = component2.getChildren(); int count = 0;
int count = 0; if (children3 == null || children3.length == 0) {
if(children3 == null || children3.length==0) { // 显示查询界面
//显示查询界面 System.out.println("没有找到成本单对象,进入查询界面===============》》》》》》");
System.out.println("没有找到成本单对象,进入查询界面===============》》》》》》"); QueryQuotationFram queryQuotationFram = new QueryQuotationFram(session,
QueryQuotationFram queryQuotationFram = new QueryQuotationFram(session,component2); component2);
ButtonCellEditor.project = project; ButtonCellEditor.project = project;
session.queueOperation(queryQuotationFram); session.queueOperation(queryQuotationFram);
} }
for(AIFComponentContext child3 : children3) { for (AIFComponentContext child3 : children3) {
TCComponent component3 = (TCComponent)child3.getComponent(); TCComponent component3 = (TCComponent) child3.getComponent();
String typeString = component3.getProperty("object_type"); String typeString = component3.getProperty("object_type");
System.out.println("typeString:"+typeString); System.out.println("typeString:" + typeString);
if("ZT2_COSTSHEET".equals(component3.getStringProperty("object_type")) || "变压器投标成本单".equals(component3.getProperty("object_type"))) { if ("ZT2_COSTSHEET".equals(component3.getStringProperty("object_type"))
//显示报价单页面 || "变压器投标成本单".equals(component3.getProperty("object_type"))) {
System.out.println("显示报价页面"); // 显示报价单页面
try { System.out.println("显示报价页面");
String[] prefs = session.getPreferenceService().getStringValues("database_tc"); try {
System.out.println("===============开始连接tc数据库==============="); String[] prefs = session.getPreferenceService()
long time31 = System.nanoTime(); .getStringValues("database_tc");
Connection conn = SqlUtil.getTCDataConnection(prefs); System.out.println("===============开始连接tc数据库===============");
long time32 = System.nanoTime(); long time31 = System.nanoTime();
System.out.println("===============连接tc数据库用时(ms) " + ((time32 - time31) / 1000000L)+"==============="); Connection conn = SqlUtil.getTCDataConnection(prefs);
//给Controller层外部变量赋值 long time32 = System.nanoTime();
//查询表三的内容,表二的内容,注入窗口 System.out.println("===============连接tc数据库用时(ms) "
String select1 = "SELECT * FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" WHERE \"projectid\"='"+project.getStringProperty("item_id")+"' and \"cbdlx\" = '报价成本单' order by \"revision\" desc "; + ((time32 - time31) / 1000000L) + "===============");
System.out.println("select1:"+select1); // 给Controller层外部变量赋值
ResultSet resultSet1 = SqlUtil.read(select1); // 查询表三的内容,表二的内容,注入窗口
Cusquotation cusquotation = null; String select1 = "SELECT * FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" WHERE \"projectid\"='"
String tennumber = ""; + project.getStringProperty("item_id")
+ "' and \"cbdlx\" = '报价成本单' order by \"revision\" desc ";
System.out.println("select1:" + select1);
ResultSet resultSet1 = SqlUtil.read(select1);
Cusquotation cusquotation = null;
String tennumber = "";
while(resultSet1.next()) { while (resultSet1.next()) {
cusquotation = new Cusquotation(resultSet1.getString("cbdlx"),resultSet1.getString("projectid"),resultSet1.getString("revision"), cusquotation = new Cusquotation(
resultSet1.getString("proname"),resultSet1.getString("tennumber"),resultSet1.getString("promanager"),resultSet1.getString("quantity"), resultSet1.getString("cbdlx"),
resultSet1.getString("tramodel"),resultSet1.getString("capfactor"),resultSet1.getString("volratio"),resultSet1.getString("noloadloss"), resultSet1.getString("projectid"),
resultSet1.getString("loadloss"),resultSet1.getString("impvoltage"),resultSet1.getString("traweight"),resultSet1.getString("totweight"), resultSet1.getString("revision"),
QuotationUtil.formatString(resultSet1.getString("copconsumption")),QuotationUtil.formatString(resultSet1.getString("cmarketprice")),resultSet1.getString("vollevel"),resultSet1.getString("factory")); resultSet1.getString("proname"),
tennumber = resultSet1.getString("tennumber"); resultSet1.getString("tennumber"),
break; resultSet1.getString("promanager"),
} resultSet1.getString("quantity"),
ButtonCellEditor.cusquotation = cusquotation; resultSet1.getString("tramodel"),
ButtonCellEditor.session = session; resultSet1.getString("capfactor"),
resultSet1.getString("volratio"),
resultSet1.getString("noloadloss"),
resultSet1.getString("loadloss"),
resultSet1.getString("impvoltage"),
resultSet1.getString("traweight"),
resultSet1.getString("totweight"),
QuotationUtil.formatString(
resultSet1.getString("copconsumption")),
QuotationUtil.formatString(
resultSet1.getString("cmarketprice")),
resultSet1.getString("vollevel"),
resultSet1.getString("factory"));
tennumber = resultSet1.getString("tennumber");
break;
}
ButtonCellEditor.cusquotation = cusquotation;
ButtonCellEditor.session = session;
// 查询最高版本
// 开始刷新对比结果数据
// 获取数据库该类型成本单最新的版本
String getLastRevSql1 = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"
+ project.getStringProperty("item_id")
+ "' and \"cbdlx\" = '" + "报价成本单"
+ "' order by \"revision\" desc";
System.out.println("getLastRevSql:" + getLastRevSql1);
List<String> revList = new ArrayList<String>();
try {
ResultSet resultSet4 = SqlUtil.read(getLastRevSql1);
while (resultSet4.next()) {
revList.add(resultSet4.getString("revision"));
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//查询最高版本 String select2 = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"
//开始刷新对比结果数据 + project.getStringProperty("item_id")
//获取数据库该类型成本单最新的版本 + "' and \"cbdlx\" = '报价成本单' and \"revision\" = '"
String getLastRevSql1 = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"+project.getStringProperty("item_id")+"' and \"cbdlx\" = '" + "报价成本单" + "' order by \"revision\" desc" ; + revList.get(0)
System.out.println("getLastRevSql:"+getLastRevSql1); + "' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc";
List<String> revList = new ArrayList<String>(); System.out.println("select2:" + select2);
try { ResultSet resultSet2 = SqlUtil.read(select2);
ResultSet resultSet4 = SqlUtil.read(getLastRevSql1); List<QuotationMX> tableList = new ArrayList<QuotationMX>();
while(resultSet4.next()) { while (resultSet2.next()) {
revList.add(resultSet4.getString("revision")); QuotationMX quotationMX = new QuotationMX();
} quotationMX.setCbdlx(resultSet2.getString("cbdlx"));
} catch (SQLException e1) { quotationMX.setProjectid(resultSet2.getString("projectid"));
// TODO Auto-generated catch block quotationMX.setRevision(resultSet2.getString("revision"));
e1.printStackTrace(); quotationMX.setMatgroup(new SimpleStringProperty(
} resultSet2.getString("matgroup")));
quotationMX.setMgsnumber(new SimpleStringProperty(
resultSet2.getString("mgsnumber")));
quotationMX.setMatcname(new SimpleStringProperty(
resultSet2.getString("matcname")));
quotationMX.setMatcnumber(new SimpleStringProperty(
resultSet2.getString("matcnumber")));
quotationMX.setMatcatname(new SimpleStringProperty(
resultSet2.getString("Matcatname")));
quotationMX.setSpecifications(new SimpleStringProperty(
resultSet2.getString("specifications")));
quotationMX.setManufacturer(new SimpleStringProperty(
resultSet2.getString("manufacturer")));
quotationMX.setNwquantity(
new SimpleStringProperty(QuotationUtil.formatString(
resultSet2.getString("nwquantity"))));
quotationMX.setUtirate(
new SimpleStringProperty(QuotationUtil.formatString(
resultSet2.getString("utirate"))));
quotationMX.setUnit(new SimpleStringProperty(
resultSet2.getString("unit")));
quotationMX.setAmomoney(
new SimpleStringProperty(QuotationUtil.formatString(
resultSet2.getString("amomoney"))));
quotationMX.setUnitprice(
new SimpleStringProperty(QuotationUtil.formatString(
resultSet2.getString("unitprice"))));
quotationMX.setNo(new SimpleStringProperty(
resultSet2.getString("no")));
quotationMX.setContrastPrice(new SimpleStringProperty(""));
quotationMX.setTotalprice(
new SimpleStringProperty(QuotationUtil.formatString(
resultSet2.getString("totalprice"))));
tableList.add(quotationMX);
}
ButtonCellEditor.tableList = tableList;
ButtonCellEditor.f = component2;
ButtonCellEditor.project = project;
new JDBFrame();
break;
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
String select2 = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"+project.getStringProperty("item_id")+"' and \"cbdlx\" = '报价成本单' and \"revision\" = '" + revList.get(0) + "' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc"; } else {
System.out.println("select2:"+select2); count++;
ResultSet resultSet2 = SqlUtil.read(select2); }
List<QuotationMX> tableList = new ArrayList<QuotationMX>(); if (count == children3.length) {
while(resultSet2.next()) { // 显示查询界面
QuotationMX quotationMX = new QuotationMX(); System.out.println("没有找到成本单对象,进入查询界面===============》》》》》》");
quotationMX.setCbdlx(resultSet2.getString("cbdlx")); QueryQuotationFram queryQuotationFram = new QueryQuotationFram(
quotationMX.setProjectid(resultSet2.getString("projectid")); session, component2);
quotationMX.setRevision(resultSet2.getString("revision")); session.queueOperation(queryQuotationFram);
quotationMX.setMatgroup(new SimpleStringProperty(resultSet2.getString("matgroup"))); ButtonCellEditor.project = project;
quotationMX.setMgsnumber(new SimpleStringProperty(resultSet2.getString("mgsnumber"))); }
quotationMX.setMatcname(new SimpleStringProperty(resultSet2.getString("matcname"))); }
quotationMX.setMatcnumber(new SimpleStringProperty(resultSet2.getString("matcnumber"))); break;
quotationMX.setMatcatname(new SimpleStringProperty(resultSet2.getString("Matcatname"))); }
quotationMX.setSpecifications(new SimpleStringProperty(resultSet2.getString("specifications"))); }
quotationMX.setManufacturer(new SimpleStringProperty(resultSet2.getString("manufacturer"))); break;
quotationMX.setNwquantity(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("nwquantity")))); }
quotationMX.setUtirate(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("utirate")))); } catch (TCException e) {
quotationMX.setUnit(new SimpleStringProperty(resultSet2.getString("unit"))); // TODO Auto-generated catch block
quotationMX.setAmomoney(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("amomoney")))); e.printStackTrace();
quotationMX.setUnitprice(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("unitprice")))); }
quotationMX.setNo(new SimpleStringProperty(resultSet2.getString("no"))); }
quotationMX.setContrastPrice(new SimpleStringProperty("")); } else {
quotationMX.setTotalprice(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("totalprice")))); MessageBox.post("请选择TC对象操作", "提示", MessageBox.INFORMATION);
tableList.add(quotationMX); }
}
ButtonCellEditor.tableList = tableList; }
ButtonCellEditor.f = component2; }.start();
ButtonCellEditor.project = project; } catch (Exception e) {
new JDBFrame(); e.printStackTrace();
break; }
} catch (Exception e) { return null;
// TODO: handle exception }
e.printStackTrace();
}
}else {
count++;
}
if(count == children3.length) {
//显示查询界面
System.out.println("没有找到成本单对象,进入查询界面===============》》》》》》");
QueryQuotationFram queryQuotationFram = new QueryQuotationFram(session,component2);
session.queueOperation(queryQuotationFram);
ButtonCellEditor.project = project;
}
}
break;
}
}
break;
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}else {
MessageBox.post("请选择TC对象操作", "提示", MessageBox.INFORMATION);
}
}
}.start();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
} }

@ -40,24 +40,25 @@ import com.teamcenter.rac.util.MessageBox;
*/ */
public class NewJFrame extends javax.swing.JFrame { public class NewJFrame extends javax.swing.JFrame {
private TCSession session;
private Connection conn;
private TCComponent f;
private JFrame frame;
private TCSession session;
private Connection conn;
private TCComponent f;
private JFrame frame;
/** /**
* Creates new form NewJFrame * Creates new form NewJFrame
*
* @param session * @param session
*/ */
public NewJFrame(TCSession session,TCComponent f) { public NewJFrame(TCSession session, TCComponent f) {
String[] prefs = session.getPreferenceService().getStringValues("database_tc"); String[] prefs = session.getPreferenceService().getStringValues("database_tc");
System.out.println("===============开始连接tc数据库==============="); System.out.println("===============开始连接tc数据库===============");
long time31 = System.nanoTime(); long time31 = System.nanoTime();
conn = SqlUtil.getTCDataConnection(prefs); conn = SqlUtil.getTCDataConnection(prefs);
long time32 = System.nanoTime(); long time32 = System.nanoTime();
System.out.println("===============连接tc数据库用时(ms) " + ((time32 - time31) / 1000000L)+"==============="); System.out.println("===============连接tc数据库用时(ms) " + ((time32 - time31) / 1000000L) + "===============");
this.session = session; this.session = session;
this.f = f; this.f = f;
initComponents(); initComponents();
frame = this; frame = this;
} }
@ -109,21 +110,15 @@ public class NewJFrame extends javax.swing.JFrame {
jScrollPane3 = new javax.swing.JScrollPane(); jScrollPane3 = new javax.swing.JScrollPane();
jTable2 = new javax.swing.JTable(); jTable2 = new javax.swing.JTable();
jTable1.setModel(new javax.swing.table.DefaultTableModel( jTable1.setModel(
new Object [][] { new javax.swing.table.DefaultTableModel(
{null, null, null, null}, new Object[][] { { null, null, null, null }, { null, null, null, null },
{null, null, null, null}, { null, null, null, null }, { null, null, null, null } },
{null, null, null, null}, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane2.setViewportView(jTable1); jScrollPane2.setViewportView(jTable1);
setBackground(new java.awt.Color(255, 255, 255)); setBackground(new java.awt.Color(255, 255, 255));
// this.setBackground(new java.awt.Color(255, 255, 255)); // this.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBorder(new TitledBorder(new EtchedBorder())); jPanel1.setBorder(new TitledBorder(new EtchedBorder()));
jLabel2.setText("项目名称"); jLabel2.setText("项目名称");
@ -178,99 +173,96 @@ public class NewJFrame extends javax.swing.JFrame {
jButton2.setText("查询"); jButton2.setText("查询");
jButton2.addActionListener(new ActionListener() { jButton2.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent actionEvent) { public void actionPerformed(ActionEvent actionEvent) {
if (conn == null) {
if (conn == null) { System.out.println("连接TC数据库失败");
System.out.println("连接TC数据库失败"); // MessageBox.post(MaterialNoDialog.this, "连接TC数据库失败", "", MessageBox.ERROR);
// MessageBox.post(MaterialNoDialog.this, "连接TC数据库失败", "", MessageBox.ERROR); return;
return; }
} String sql = "select * from \"CHINT_ QUOTATION_TITLE_TEMPLATE\" where 1=1 ";
String sql = "select * from \"CHINT_ QUOTATION_TITLE_TEMPLATE\" where 1=1 "; if (jTextField1.getText() != null && !"".equals(jTextField1.getText().trim())) {
if(jTextField1.getText()!=null && !"".equals(jTextField1.getText().trim())) { sql += "and \"proname\" = \'" + jTextField1.getText() + "\'";
sql += "and \"proname\" = \'" + jTextField1.getText() +"\'"; }
} if (jTextField2.getText() != null && !"".equals(jTextField2.getText().trim())) {
if(jTextField2.getText()!=null && !"".equals(jTextField2.getText().trim())) { sql += "and \"promanager\" = \'" + jTextField2.getText() + "\'";
sql += "and \"promanager\" = \'" + jTextField2.getText() +"\'"; }
} if (jTextField3.getText() != null && !"".equals(jTextField3.getText().trim())) {
if(jTextField3.getText()!=null && !"".equals(jTextField3.getText().trim())) { sql += "and \"tramodel\" = \'" + jTextField3.getText() + "\'";
sql += "and \"tramodel\" = \'" + jTextField3.getText() +"\'"; }
} if (jTextField4.getText() != null && !"".equals(jTextField4.getText().trim())) {
if(jTextField4.getText()!=null && !"".equals(jTextField4.getText().trim())) { sql += "and \"noloadloss\" = \'" + jTextField4.getText() + "\'";
sql += "and \"noloadloss\" = \'" + jTextField4.getText() +"\'"; }
} if (jTextField5.getText() != null && !"".equals(jTextField5.getText().trim())) {
if(jTextField5.getText()!=null && !"".equals(jTextField5.getText().trim())) { sql += "and \"loadloss\" = \'" + jTextField5.getText() + "\'";
sql += "and \"loadloss\" = \'" + jTextField5.getText() +"\'"; }
} if (jTextField13.getText() != null && !"".equals(jTextField13.getText().trim())) {
if(jTextField13.getText()!=null && !"".equals(jTextField13.getText().trim())) { sql += "and \"tennumber\" = \'" + jTextField13.getText() + "\'";
sql += "and \"tennumber\" = \'" + jTextField13.getText() +"\'"; }
} if (jTextField8.getText() != null && !"".equals(jTextField8.getText().trim())) {
if(jTextField8.getText()!=null && !"".equals(jTextField8.getText().trim())) { sql += "and \"impvoltage\" = \'" + jTextField8.getText() + "\'";
sql += "and \"impvoltage\" = \'" + jTextField8.getText() +"\'"; }
} if (jTextField7.getText() != null && !"".equals(jTextField7.getText().trim())) {
if(jTextField7.getText()!=null && !"".equals(jTextField7.getText().trim())) { sql += "and \"volratio\" = \'" + jTextField7.getText() + "\'";
sql += "and \"volratio\" = \'" + jTextField7.getText() +"\'"; }
} if (jTextField9.getText() != null && !"".equals(jTextField9.getText().trim())) {
if(jTextField9.getText()!=null && !"".equals(jTextField9.getText().trim())) { sql += "and \"traweight\" = \'" + jTextField9.getText() + "\'";
sql += "and \"traweight\" = \'" + jTextField9.getText() +"\'"; }
} if (jTextField10.getText() != null && !"".equals(jTextField10.getText().trim())) {
if(jTextField10.getText()!=null && !"".equals(jTextField10.getText().trim())) { sql += "and \"quantity\" = \'" + jTextField10.getText() + "\'";
sql += "and \"quantity\" = \'" + jTextField10.getText() +"\'"; }
} if (jTextField11.getText() != null && !"".equals(jTextField11.getText().trim())) {
if(jTextField11.getText()!=null && !"".equals(jTextField11.getText().trim())) { sql += "and \"totweight\" = \'" + jTextField11.getText() + "\'";
sql += "and \"totweight\" = \'" + jTextField11.getText() +"\'"; }
} if (jTextField14.getText() != null && !"".equals(jTextField14.getText().trim())) {
if(jTextField14.getText()!=null && !"".equals(jTextField14.getText().trim())) { sql += "and \"rectime\" = \'" + jTextField14.getText() + "\'";
sql += "and \"rectime\" = \'" + jTextField14.getText() +"\'"; }
} System.out.println("sql:" + sql);
System.out.println("sql:"+sql); PreparedStatement statement;
PreparedStatement statement; try {
try { statement = conn.prepareStatement(sql);
statement = conn.prepareStatement(sql); ResultSet res = statement.executeQuery();
ResultSet res = statement.executeQuery(); List<Quotation> quotations = new ArrayList<Quotation>();
List<Quotation> quotations = new ArrayList<Quotation>(); while (res.next()) {
if(!res.next()) { Quotation quotation = new Quotation(
MessageBox.post("未查询到匹配的数据", "提示", MessageBox.INFORMATION); res.getString("technical") != null ? res.getString("technical") : "",
return; res.getString("factory") != null ? res.getString("factory") : "",
} res.getString("proname") != null ? res.getString("proname") : "",
while (res.next()) { res.getString("tennumber") != null ? res.getString("tennumber") : "",
Quotation quotation = new Quotation( res.getString("promanager") != null ? res.getString("promanager") : "",
res.getString("technical") != null ? res.getString("technical") : "", res.getString("quantity") != null ? res.getString("quantity") : "",
res.getString("factory") != null ? res.getString("factory") : "", res.getString("tramodel") != null ? res.getString("tramodel") : "",
res.getString("proname") != null ? res.getString("proname") : "", res.getString("capfactor") != null ? res.getString("capfactor") : "",
res.getString("tennumber") != null ? res.getString("tennumber") : "", res.getString("volratio") != null ? res.getString("volratio") : "",
res.getString("promanager") != null ? res.getString("promanager") : "", res.getString("noloadloss") != null ? res.getString("noloadloss") : "",
res.getString("quantity") != null ? res.getString("quantity") : "", res.getString("loadloss") != null ? res.getString("loadloss") : "",
res.getString("tramodel") != null ? res.getString("tramodel") : "", res.getString("impvoltage") != null ? res.getString("impvoltage") : "",
res.getString("capfactor") != null ? res.getString("capfactor") : "", res.getString("traweight") != null ? res.getString("traweight") : "",
res.getString("volratio") != null ? res.getString("volratio") : "", res.getString("totweight") != null ? res.getString("totweight") : "",
res.getString("noloadloss") != null ? res.getString("noloadloss") : "", res.getString("copconsumption") != null ? res.getString("copconsumption") : "",
res.getString("loadloss") != null ? res.getString("loadloss") : "", res.getString("cmarketprice") != null ? res.getString("cmarketprice") : "",
res.getString("impvoltage") != null ? res.getString("impvoltage") : "", res.getString("vollevel") != null ? res.getString("vollevel") : "",
res.getString("traweight") != null ? res.getString("traweight") : "", res.getString("rectime") != null ? res.getString("rectime") : "",
res.getString("totweight") != null ? res.getString("totweight") : "", res.getString("state") != null ? res.getString("state") : "");
res.getString("copconsumption") != null ? res.getString("copconsumption") : "", quotations.add(quotation);
res.getString("cmarketprice") != null ? res.getString("cmarketprice") : "", }
res.getString("vollevel") != null ? res.getString("vollevel") : "", if (quotations.size() == 0) {
res.getString("rectime") != null ? res.getString("rectime") : "", MessageBox.post("未查询到匹配的数据", "提示", MessageBox.INFORMATION);
res.getString("state") != null ? res.getString("state") : "" return;
); }
quotations.add(quotation); // 将数据插入到表格
} String[] title = new String[] { "序号", "投标编号", "技术评审表", "创建报价成本单", "状态" };
//将数据插入到表格
String[] title = new String [] { "序号", "投标编号", "技术评审表", "创建报价成本单","状态"};
// DefaultTableModel model = new DefaultTableModel(new Object [][] {},title); // DefaultTableModel model = new DefaultTableModel(new Object [][] {},title);
DefaultTableModel model = new DefaultTableModel(new Object [][] {},title) { DefaultTableModel model = new DefaultTableModel(new Object[][] {}, title) {
// 重写isCellEditable方法禁止第一列 第二列 第五列单元格编辑
@Override
public boolean isCellEditable(int row, int column) {
// 将第一列、第二列和第五列设置为不可编辑
return !(column == 0 || column == 1 || column == 4);
}
};
// 重写isCellEditable方法禁止第一列 第二列 第五列单元格编辑
@Override
public boolean isCellEditable(int row, int column) {
// 将第一列、第二列和第五列设置为不可编辑
return !(column == 0 || column == 1 || column == 4);
}
};
// Object[][] str = {{"数据1列1", "数据1列2", "打卡", "创建", "数据1列5"},{"数据1列1", "数据1列2", "打卡", "创建", "数据1列5"}}; // Object[][] str = {{"数据1列1", "数据1列2", "打卡", "创建", "数据1列5"},{"数据1列1", "数据1列2", "打卡", "创建", "数据1列5"}};
// DefaultTableModel model = new DefaultTableModel(str,title) { // DefaultTableModel model = new DefaultTableModel(str,title) {
@ -281,34 +273,37 @@ public class NewJFrame extends javax.swing.JFrame {
// return !(column == 0 || column == 1 || column == 4); // return !(column == 0 || column == 1 || column == 4);
// } // }
// }; // };
jTable2.setModel(model); jTable2.setModel(model);
TableColumn column_1 = jTable2.getColumn(title[0]); TableColumn column_1 = jTable2.getColumn(title[0]);
column_1.setMinWidth(40); column_1.setMinWidth(40);
for(int i = 0;i<quotations.size();i++) { for (int i = 0; i < quotations.size(); i++) {
Quotation quotation = quotations.get(i); Quotation quotation = quotations.get(i);
String[] row = {i+1+"",quotation.getTennumber(),"打开","创建",quotation.getState()}; String[] row = { i + 1 + "", quotation.getTennumber(), "打开", "创建", quotation.getState() };
model.addRow(row); model.addRow(row);
} }
// String[] row1 = {"数据1列1", "数据1列2", "打卡", "创建", "数据1列5"}; // String[] row1 = {"数据1列1", "数据1列2", "打卡", "创建", "数据1列5"};
// String[] row2 = {"数据2列1", "数据2列2", "打开", "创建", "数据2列5"}; // String[] row2 = {"数据2列1", "数据2列2", "打开", "创建", "数据2列5"};
// String[] row3 = {"数据3列1", "数据3列2", "打开", "创建", "数据3列5"}; // String[] row3 = {"数据3列1", "数据3列2", "打开", "创建", "数据3列5"};
//TableColumn column = jTable2.getColumnModel().getColumn(0); // TableColumn column = jTable2.getColumnModel().getColumn(0);
jTable2.setShowGrid(true); jTable2.setShowGrid(true);
jTable2.setGridColor(Color.BLACK); jTable2.setGridColor(Color.BLACK);
//column.setPreferredWidth(50); // column.setPreferredWidth(50);
//column.setResizable(false); // column.setResizable(false);
jTable2.getColumnModel().getColumn(2).setCellRenderer(new ButtonCellRenderer(jTable2,quotations,session,f,frame)); jTable2.getColumnModel().getColumn(2)
jTable2.getColumnModel().getColumn(2).setCellEditor(new ButtonCellEditor(jTable2,quotations,session,f,frame)); .setCellRenderer(new ButtonCellRenderer(jTable2, quotations, session, f, frame));
jTable2.getColumnModel().getColumn(3).setCellRenderer(new ButtonCellRenderer(jTable2,quotations,session,f,frame)); jTable2.getColumnModel().getColumn(2)
jTable2.getColumnModel().getColumn(3).setCellEditor(new ButtonCellEditor(jTable2,quotations,session,f,frame)); .setCellEditor(new ButtonCellEditor(jTable2, quotations, session, f, frame));
} catch (Exception e) { jTable2.getColumnModel().getColumn(3)
// TODO Auto-generated catch block .setCellRenderer(new ButtonCellRenderer(jTable2, quotations, session, f, frame));
e.printStackTrace(); jTable2.getColumnModel().getColumn(3)
} .setCellEditor(new ButtonCellEditor(jTable2, quotations, session, f, frame));
} catch (Exception e) {
// TODO Auto-generated catch block
} e.printStackTrace();
}
}
}); });
jLabel14.setText("招标编号"); jLabel14.setText("招标编号");
@ -321,187 +316,213 @@ public class NewJFrame extends javax.swing.JFrame {
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout); jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup( jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(24, 24, 24).addGroup(jPanel1Layout
.addGroup(jPanel1Layout.createSequentialGroup() .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(24, 24, 24) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel1Layout.createSequentialGroup().addGap(3, 3, 3)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout
.addGap(3, 3, 3) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3).addComponent(jLabel4)
.addComponent(jLabel3) .addComponent(jLabel2).addComponent(jLabel5))
.addComponent(jLabel4) .addGap(27, 27, 27))
.addComponent(jLabel2) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(jLabel7)
.addComponent(jLabel5)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
.addGap(27, 27, 27))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(111, 111, 111)
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
.addGap(84, 84, 84) jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
.addComponent(jLabel13) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)) .addComponent(jTextField2,
.addGroup(jPanel1Layout.createSequentialGroup() javax.swing.GroupLayout.PREFERRED_SIZE, 150,
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField3,
.addComponent(jLabel11) javax.swing.GroupLayout.PREFERRED_SIZE, 150,
.addComponent(jLabel12) javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10) .addComponent(jTextField4,
.addComponent(jLabel9) javax.swing.GroupLayout.PREFERRED_SIZE, 150,
.addComponent(jLabel8) javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel15)) .addComponent(jTextField5,
.addGap(18, 18, 18) javax.swing.GroupLayout.PREFERRED_SIZE, 150,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField8) .addComponent(jTextField13,
.addComponent(jTextField7) javax.swing.GroupLayout.PREFERRED_SIZE, 150,
.addComponent(jTextField9) javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jTextField10, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) .addGap(111, 111, 111)
.addComponent(jTextField11) .addComponent(jTextField12,
.addComponent(jTextField14)) javax.swing.GroupLayout.PREFERRED_SIZE, 98,
.addGap(108, 108, 108)))) javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap())
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(84, 84, 84).addComponent(jLabel13)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup().addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel11).addComponent(jLabel12)
.addComponent(jLabel10).addComponent(jLabel9)
.addComponent(jLabel8).addComponent(jLabel15))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING,
false).addComponent(jTextField8)
.addComponent(jTextField7)
.addComponent(jTextField9)
.addComponent(jTextField10,
javax.swing.GroupLayout.DEFAULT_SIZE,
150, Short.MAX_VALUE)
.addComponent(jTextField11)
.addComponent(jTextField14))
.addGap(108, 108, 108))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 150,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6).addComponent(jLabel14))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField4).addComponent(jTextField5).addComponent(jTextField13,
javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
.addGap(0, 0, Short.MAX_VALUE)))) .addGap(0, 0, Short.MAX_VALUE))))
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(690, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
.addComponent(jLabel14)) jPanel1Layout.createSequentialGroup().addComponent(jButton1).addContainerGap())
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .createSequentialGroup().addComponent(jButton2).addGap(67, 67, 67)))));
.addComponent(jTextField4) jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField5) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
.addComponent(jTextField13, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)) .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGap(0, 0, Short.MAX_VALUE)))) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel2)
.addContainerGap(690, Short.MAX_VALUE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(jLabel8).addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jButton1) javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap()) .addGap(24, 24, 24)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton2) .addGroup(jPanel1Layout
.addGap(67, 67, 67)))) .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
); .addComponent(jLabel3).addComponent(jTextField2,
jPanel1Layout.setVerticalGroup( javax.swing.GroupLayout.PREFERRED_SIZE,
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) javax.swing.GroupLayout.DEFAULT_SIZE,
.addGroup(jPanel1Layout.createSequentialGroup() javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap() .addGroup(jPanel1Layout
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel9).addComponent(jTextField7,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jLabel2) javax.swing.GroupLayout.DEFAULT_SIZE,
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel8) .addGap(21, 21, 21)
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addGap(24, 24, 24) .addComponent(jLabel4)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10).addComponent(jTextField9,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(25, 25, 25)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11).addComponent(jTextField10,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(24, 24, 24)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12).addComponent(jTextField11,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel15).addComponent(jTextField14,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel14)).addGap(18, 18, 18).addComponent(jButton2).addGap(359, 359, 359)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) javax.swing.GroupLayout.DEFAULT_SIZE,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9) .addComponent(jLabel13).addComponent(jTextField12,
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) javax.swing.GroupLayout.PREFERRED_SIZE,
.addGap(21, 21, 21) javax.swing.GroupLayout.DEFAULT_SIZE,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel4) .addComponent(jLabel7))
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
.addComponent(jLabel10) javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jButton1).addContainerGap()));
.addGap(25, 25, 25)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11)
.addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(24, 24, 24)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12)
.addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel15)
.addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel14))
.addGap(18, 18, 18)
.addComponent(jButton2)
.addGap(359, 359, 359)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13)
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1)
.addContainerGap())
);
jLabel1.setText("报价成本单查询界面"); jLabel1.setText("报价成本单查询界面");
jLabel1.setFont(new Font("Serif", Font.PLAIN, 20)); jLabel1.setFont(new Font("Serif", Font.PLAIN, 20));
String[] title = new String [] { "序号", "投标编号", "技术评审表", "创建报价成本单","状态"}; String[] title = new String[] { "序号", "投标编号", "技术评审表", "创建报价成本单", "状态" };
jTable2.setModel(new javax.swing.table.DefaultTableModel( jTable2.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {}, title));
new Object [][] {},title
));
TableColumn column_1 = jTable2.getColumn(title[0]); TableColumn column_1 = jTable2.getColumn(title[0]);
column_1.setMinWidth(40); column_1.setMinWidth(40);
// jTable2.setBackground(new java.awt.Color(255, 255, 255)); // jTable2.setBackground(new java.awt.Color(255, 255, 255));
jTable2.setRowHeight(30); jTable2.setRowHeight(30);
jScrollPane3.setViewportView(jTable2); jScrollPane3.setViewportView(jTable2);
jScrollPane3.getViewport().setBackground(new java.awt.Color(255, 255, 255)); jScrollPane3.getViewport().setBackground(new java.awt.Color(255, 255, 255));
//jPanel2.setBackground(new java.awt.Color(255, 255, 255)); // jPanel2.setBackground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout); jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup( jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE));
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE) jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
); .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING,
jPanel2Layout.setVerticalGroup( javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE));
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE)
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout); getContentPane().setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(20, 20, 20)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(20, 20, 20) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 271,
.addContainerGap(35, Short.MAX_VALUE)) javax.swing.GroupLayout.PREFERRED_SIZE))
); .addContainerGap(35, Short.MAX_VALUE)));
layout.setVerticalGroup( layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup()
.addGroup(layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 373, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 373,
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
); javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
pack(); pack();
}// </editor-fold> }// </editor-fold>
@ -511,9 +532,12 @@ public class NewJFrame extends javax.swing.JFrame {
*/ */
public static void main(String args[]) { public static void main(String args[]) {
/* Set the Nimbus look and feel */ /* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> // <editor-fold defaultstate="collapsed" desc=" Look and feel setting code
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. // (optional) ">
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html /*
* If Nimbus (introduced in Java SE 6) is not available, stay with the default
* look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/ */
// try { // try {
// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { // for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
@ -531,29 +555,29 @@ public class NewJFrame extends javax.swing.JFrame {
// } catch (javax.swing.UnsupportedLookAndFeelException ex) { // } catch (javax.swing.UnsupportedLookAndFeelException ex) {
// java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// } // }
//</editor-fold> // </editor-fold>
/* Create and display the form */ /* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() { java.awt.EventQueue.invokeLater(new Runnable() {
public void run() { public void run() {
NewJFrame newJFrame = new NewJFrame(null,null); NewJFrame newJFrame = new NewJFrame(null, null);
int width2 = newJFrame.getWidth(); int width2 = newJFrame.getWidth();
int height2 = newJFrame.getHeight(); int height2 = newJFrame.getHeight();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
int screenWidth = screenSize.width; // 获取屏幕宽度 int screenWidth = screenSize.width; // 获取屏幕宽度
int screenHeight = screenSize.height; // 获取屏幕高度 int screenHeight = screenSize.height; // 获取屏幕高度
int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标 int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标
int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标 int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标
newJFrame.setTitle("报价成本单查询"); newJFrame.setTitle("报价成本单查询");
// this.getContentPane().setBackground(Color.red); // this.getContentPane().setBackground(Color.red);
newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255)); newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255));
newJFrame.setSize(width2, height2); // 设置Frame的大小 newJFrame.setSize(width2, height2); // 设置Frame的大小
newJFrame.setLocation(x, y); // 设置Frame的位置 newJFrame.setLocation(x, y); // 设置Frame的位置
newJFrame.setResizable(false); newJFrame.setResizable(false);
newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作 newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作
newJFrame.setVisible(true); newJFrame.setVisible(true);
} }
}); });
} }
// Variables declaration - do not modify // Variables declaration - do not modify

@ -7,19 +7,20 @@ import com.teamcenter.rac.aif.AbstractAIFOperation;
import com.teamcenter.rac.kernel.TCComponent; import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCSession; import com.teamcenter.rac.kernel.TCSession;
public class QueryQuotationFram extends AbstractAIFOperation{ public class QueryQuotationFram extends AbstractAIFOperation {
TCSession session; TCSession session;
private TCComponent f; private TCComponent f;
public QueryQuotationFram(TCSession session, TCComponent component2) {
this.f = component2;
this.session = session;
// TODO Auto-generated constructor stub
}
@Override public QueryQuotationFram(TCSession session, TCComponent component2) {
public void executeOperation() throws Exception { this.f = component2;
// TODO Auto-generated method stub this.session = session;
// TODO Auto-generated constructor stub
}
@Override
public void executeOperation() throws Exception {
// TODO Auto-generated method stub
// try { // try {
// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { // for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
// if ("Nimbus".equals(info.getName())) { // if ("Nimbus".equals(info.getName())) {
@ -36,29 +37,29 @@ public class QueryQuotationFram extends AbstractAIFOperation{
// } catch (javax.swing.UnsupportedLookAndFeelException ex) { // } catch (javax.swing.UnsupportedLookAndFeelException ex) {
// java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// } // }
//</editor-fold> // </editor-fold>
/* Create and display the form */ /* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() { java.awt.EventQueue.invokeLater(new Runnable() {
public void run() { public void run() {
NewJFrame newJFrame = new NewJFrame(session,f); NewJFrame newJFrame = new NewJFrame(session, f);
int width2 = newJFrame.getWidth(); int width2 = newJFrame.getWidth();
int height2 = newJFrame.getHeight(); int height2 = newJFrame.getHeight();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
int screenWidth = screenSize.width; // 获取屏幕宽度 int screenWidth = screenSize.width; // 获取屏幕宽度
int screenHeight = screenSize.height; // 获取屏幕高度 int screenHeight = screenSize.height; // 获取屏幕高度
int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标 int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标
int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标 int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标
newJFrame.setTitle("报价成本单查询"); newJFrame.setTitle("报价成本单查询");
// this.getContentPane().setBackground(Color.red); // this.getContentPane().setBackground(Color.red);
newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255)); newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255));
newJFrame.setSize(width2, height2); // 设置Frame的大小 newJFrame.setSize(width2, height2); // 设置Frame的大小
newJFrame.setLocation(x, y); // 设置Frame的位置 newJFrame.setLocation(x, y); // 设置Frame的位置
newJFrame.setResizable(false); newJFrame.setResizable(false);
newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作 newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作
newJFrame.setVisible(true); newJFrame.setVisible(true);
} }
}); });
} }
} }

@ -2,7 +2,7 @@ package com.connor.plm.CostListManagement;
public class QuotationUtil { public class QuotationUtil {
public static String formatString(String input) { public static String formatString(String input) {
if (input == null || input.length() == 0) { if (input == null || input.length() == 0) {
return input; return input;
} }
@ -13,6 +13,6 @@ public class QuotationUtil {
} else { } else {
return String.format("%.3f", number).replaceAll("0*$", "").replaceAll("\\.$", ""); return String.format("%.3f", number).replaceAll("0*$", "").replaceAll("\\.$", "");
} }
} }
} }

@ -1,176 +1,212 @@
package com.connor.plm.CostListManagement.pojo; package com.connor.plm.CostListManagement.pojo;
public class Cusquotation { public class Cusquotation {
private String cbdlx; private String cbdlx;
private String projectid; private String projectid;
private String revision; private String revision;
private String proname; private String proname;
private String tennumber; private String tennumber;
private String promanager; private String promanager;
private String quantity; private String quantity;
private String tramodel; private String tramodel;
private String capfactor; private String capfactor;
private String volratio; private String volratio;
private String noloadloss; private String noloadloss;
private String loadloss; private String loadloss;
private String impvoltage; private String impvoltage;
private String traweight; private String traweight;
private String totweight; private String totweight;
private String copconsumption; private String copconsumption;
private String cmarketprice; private String cmarketprice;
private String vollevel; private String vollevel;
private String factory; private String factory;
public Cusquotation(String cbdlx, String projectid, String revision, String proname, String tennumber,
String promanager, String quantity, String tramodel, String capfactor, String volratio, String noloadloss,
String loadloss, String impvoltage, String traweight, String totweight, String copconsumption,
String cmarketprice, String vollevel,String factory) {
super();
this.cbdlx = cbdlx;
this.projectid = projectid;
this.revision = revision;
this.proname = proname;
this.tennumber = tennumber;
this.promanager = promanager;
this.quantity = quantity;
this.tramodel = tramodel;
this.capfactor = capfactor;
this.volratio = volratio;
this.noloadloss = noloadloss;
this.loadloss = loadloss;
this.impvoltage = impvoltage;
this.traweight = traweight;
this.totweight = totweight;
this.copconsumption = copconsumption;
this.cmarketprice = cmarketprice;
this.vollevel = vollevel;
this.factory = factory;
}
public String getCbdlx() {
return cbdlx;
}
public void setCbdlx(String cbdlx) {
this.cbdlx = cbdlx;
}
public String getProjectid() {
return projectid;
}
public void setProjectid(String projectid) {
this.projectid = projectid;
}
public String getRevision() {
return revision;
}
public void setRevision(String revision) {
this.revision = revision;
}
public String getProname() {
return proname;
}
public void setProname(String proname) {
this.proname = proname;
}
public String getTennumber() {
return tennumber;
}
public void setTennumber(String tennumber) {
this.tennumber = tennumber;
}
public String getPromanager() {
return promanager;
}
public void setPromanager(String promanager) {
this.promanager = promanager;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getTramodel() {
return tramodel;
}
public void setTramodel(String tramodel) {
this.tramodel = tramodel;
}
public String getCapfactor() {
return capfactor;
}
public void setCapfactor(String capfactor) {
this.capfactor = capfactor;
}
public String getVolratio() {
return volratio;
}
public void setVolratio(String volratio) {
this.volratio = volratio;
}
public String getNoloadloss() {
return noloadloss;
}
public void setNoloadloss(String noloadloss) {
this.noloadloss = noloadloss;
}
public String getLoadloss() {
return loadloss;
}
public void setLoadloss(String loadloss) {
this.loadloss = loadloss;
}
public String getImpvoltage() {
return impvoltage;
}
public void setImpvoltage(String impvoltage) {
this.impvoltage = impvoltage;
}
public String getTraweight() {
return traweight;
}
public void setTraweight(String traweight) {
this.traweight = traweight;
}
public String getTotweight() {
return totweight;
}
public void setTotweight(String totweight) {
this.totweight = totweight;
}
public String getCopconsumption() {
return copconsumption;
}
public void setCopconsumption(String copconsumption) {
this.copconsumption = copconsumption;
}
public String getCmarketprice() {
return cmarketprice;
}
public void setCmarketprice(String cmarketprice) {
this.cmarketprice = cmarketprice;
}
public String getVollevel() {
return vollevel;
}
public void setVollevel(String vollevel) {
this.vollevel = vollevel;
}
public String getFactory() {
return factory;
}
public void setFactory(String factory) {
this.factory = factory;
}
@Override
public String toString() {
return "Cusquotation [cbdlx=" + cbdlx + ", projectid=" + projectid + ", revision=" + revision + ", proname="
+ proname + ", tennumber=" + tennumber + ", promanager=" + promanager + ", quantity=" + quantity
+ ", tramodel=" + tramodel + ", capfactor=" + capfactor + ", volratio=" + volratio + ", noloadloss="
+ noloadloss + ", loadloss=" + loadloss + ", impvoltage=" + impvoltage + ", traweight=" + traweight
+ ", totweight=" + totweight + ", copconsumption=" + copconsumption + ", cmarketprice=" + cmarketprice
+ ", vollevel=" + vollevel + ", factory=" + factory + "]";
}
public Cusquotation(String cbdlx, String projectid, String revision, String proname, String tennumber,
String promanager, String quantity, String tramodel, String capfactor, String volratio, String noloadloss,
String loadloss, String impvoltage, String traweight, String totweight, String copconsumption,
String cmarketprice, String vollevel, String factory) {
super();
this.cbdlx = cbdlx;
this.projectid = projectid;
this.revision = revision;
this.proname = proname;
this.tennumber = tennumber;
this.promanager = promanager;
this.quantity = quantity;
this.tramodel = tramodel;
this.capfactor = capfactor;
this.volratio = volratio;
this.noloadloss = noloadloss;
this.loadloss = loadloss;
this.impvoltage = impvoltage;
this.traweight = traweight;
this.totweight = totweight;
this.copconsumption = copconsumption;
this.cmarketprice = cmarketprice;
this.vollevel = vollevel;
this.factory = factory;
}
public String getCbdlx() {
return cbdlx;
}
public void setCbdlx(String cbdlx) {
this.cbdlx = cbdlx;
}
public String getProjectid() {
return projectid;
}
public void setProjectid(String projectid) {
this.projectid = projectid;
}
public String getRevision() {
return revision;
}
public void setRevision(String revision) {
this.revision = revision;
}
public String getProname() {
return proname;
}
public void setProname(String proname) {
this.proname = proname;
}
public String getTennumber() {
return tennumber;
}
public void setTennumber(String tennumber) {
this.tennumber = tennumber;
}
public String getPromanager() {
return promanager;
}
public void setPromanager(String promanager) {
this.promanager = promanager;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getTramodel() {
return tramodel;
}
public void setTramodel(String tramodel) {
this.tramodel = tramodel;
}
public String getCapfactor() {
return capfactor;
}
public void setCapfactor(String capfactor) {
this.capfactor = capfactor;
}
public String getVolratio() {
return volratio;
}
public void setVolratio(String volratio) {
this.volratio = volratio;
}
public String getNoloadloss() {
return noloadloss;
}
public void setNoloadloss(String noloadloss) {
this.noloadloss = noloadloss;
}
public String getLoadloss() {
return loadloss;
}
public void setLoadloss(String loadloss) {
this.loadloss = loadloss;
}
public String getImpvoltage() {
return impvoltage;
}
public void setImpvoltage(String impvoltage) {
this.impvoltage = impvoltage;
}
public String getTraweight() {
return traweight;
}
public void setTraweight(String traweight) {
this.traweight = traweight;
}
public String getTotweight() {
return totweight;
}
public void setTotweight(String totweight) {
this.totweight = totweight;
}
public String getCopconsumption() {
return copconsumption;
}
public void setCopconsumption(String copconsumption) {
this.copconsumption = copconsumption;
}
public String getCmarketprice() {
return cmarketprice;
}
public void setCmarketprice(String cmarketprice) {
this.cmarketprice = cmarketprice;
}
public String getVollevel() {
return vollevel;
}
public void setVollevel(String vollevel) {
this.vollevel = vollevel;
}
public String getFactory() {
return factory;
}
public void setFactory(String factory) {
this.factory = factory;
}
@Override
public String toString() {
return "Cusquotation [cbdlx=" + cbdlx + ", projectid=" + projectid + ", revision=" + revision + ", proname="
+ proname + ", tennumber=" + tennumber + ", promanager=" + promanager + ", quantity=" + quantity
+ ", tramodel=" + tramodel + ", capfactor=" + capfactor + ", volratio=" + volratio + ", noloadloss="
+ noloadloss + ", loadloss=" + loadloss + ", impvoltage=" + impvoltage + ", traweight=" + traweight
+ ", totweight=" + totweight + ", copconsumption=" + copconsumption + ", cmarketprice=" + cmarketprice
+ ", vollevel=" + vollevel + ", factory=" + factory + "]";
}
} }

@ -1,232 +1,164 @@
package com.connor.plm.CostListManagement.pojo; package com.connor.plm.CostListManagement.pojo;
public class GzxqBean { public class GzxqBean {
private String instanceId; private String instanceId;
private String factory; private String factory;
private String sfId; private String sfId;
private String head; private String head;
private String scheduledtime; private String scheduledtime;
private String model; private String model;
private String productname; private String productname;
private String toolnumber; private String toolnumber;
private String toolname; private String toolname;
private String toolinglevel; private String toolinglevel;
private String reason; private String reason;
private String jsgyrequirements; private String jsgyrequirements;
private String link; private String link;
private String state; private String state;
public GzxqBean() {
super();
public GzxqBean() { }
super();
} public String getInstanceId() {
return instanceId;
}
public String getInstanceId() { public void setInstanceId(String instanceId) {
return instanceId; this.instanceId = instanceId;
} }
public String getFactory() {
return factory;
public void setInstanceId(String instanceId) { }
this.instanceId = instanceId;
} public void setFactory(String factory) {
this.factory = factory;
}
public String getFactory() { public String getSfId() {
return factory; return sfId;
} }
public void setSfId(String sfId) {
this.sfId = sfId;
public void setFactory(String factory) { }
this.factory = factory;
} public String getHead() {
return head;
}
public String getSfId() { public void setHead(String head) {
return sfId; this.head = head;
} }
public String getScheduledtime() {
return scheduledtime;
public void setSfId(String sfId) { }
this.sfId = sfId;
} public void setScheduledtime(String scheduledtime) {
this.scheduledtime = scheduledtime;
}
public String getHead() { public String getModel() {
return head; return model;
} }
public void setModel(String model) {
this.model = model;
public void setHead(String head) { }
this.head = head;
} public String getProductname() {
return productname;
}
public String getScheduledtime() { public void setProductname(String productname) {
return scheduledtime; this.productname = productname;
} }
public String getToolnumber() {
return toolnumber;
public void setScheduledtime(String scheduledtime) { }
this.scheduledtime = scheduledtime;
} public void setToolnumber(String toolnumber) {
this.toolnumber = toolnumber;
}
public String getModel() { public String getToolname() {
return model; return toolname;
} }
public void setToolname(String toolname) {
this.toolname = toolname;
public void setModel(String model) { }
this.model = model;
} public String getToolinglevel() {
return toolinglevel;
}
public String getProductname() { public void setToolinglevel(String toolinglevel) {
return productname; this.toolinglevel = toolinglevel;
} }
public String getReason() {
return reason;
public void setProductname(String productname) { }
this.productname = productname;
} public void setReason(String reason) {
this.reason = reason;
}
public String getToolnumber() { public String getJsgyrequirements() {
return toolnumber; return jsgyrequirements;
} }
public void setJsgyrequirements(String jsgyrequirements) {
this.jsgyrequirements = jsgyrequirements;
public void setToolnumber(String toolnumber) { }
this.toolnumber = toolnumber;
} public String getLink() {
return link;
}
public String getToolname() { public void setLink(String link) {
return toolname; this.link = link;
} }
public String getState() {
return state;
public void setToolname(String toolname) { }
this.toolname = toolname;
} public void setState(String state) {
this.state = state;
}
public String getToolinglevel() { public GzxqBean(String instanceId, String factory, String sfId, String head, String scheduledtime, String model,
return toolinglevel; String productname, String toolnumber, String toolname, String toolinglevel, String reason,
} String jsgyrequirements, String link, String state) {
super();
this.instanceId = instanceId;
this.factory = factory;
public void setToolinglevel(String toolinglevel) { this.sfId = sfId;
this.toolinglevel = toolinglevel; this.head = head;
} this.scheduledtime = scheduledtime;
this.model = model;
this.productname = productname;
this.toolnumber = toolnumber;
public String getReason() { this.toolname = toolname;
return reason; this.toolinglevel = toolinglevel;
} this.reason = reason;
this.jsgyrequirements = jsgyrequirements;
this.link = link;
this.state = state;
public void setReason(String reason) { }
this.reason = reason;
} @Override
public String toString() {
return "GzxqBean [instanceId=" + instanceId + ", factory=" + factory + ", sfId=" + sfId + ", head=" + head
+ ", scheduledtime=" + scheduledtime + ", model=" + model + ", productname=" + productname
public String getJsgyrequirements() { + ", toolnumber=" + toolnumber + ", toolname=" + toolname + ", toolinglevel=" + toolinglevel
return jsgyrequirements; + ", reason=" + reason + ", jsgyrequirements=" + jsgyrequirements + ", link=" + link + ", state="
} + state + "]";
}
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 + "]";
}
} }

@ -3,178 +3,216 @@ package com.connor.plm.CostListManagement.pojo;
import com.teamcenter.soaictstubs.stringSeq_tHolder; import com.teamcenter.soaictstubs.stringSeq_tHolder;
public class Quotation { public class Quotation {
private String technical; private String technical;
private String factory; private String factory;
private String proname; private String proname;
private String tennumber; private String tennumber;
private String promanager; private String promanager;
private String quantity; private String quantity;
private String tramodel; private String tramodel;
private String capfactor; private String capfactor;
private String volratio; private String volratio;
private String noloadloss; private String noloadloss;
private String loadloss; private String loadloss;
private String impvoltage; private String impvoltage;
private String traweight; private String traweight;
private String totweight; private String totweight;
private String copconsumption; private String copconsumption;
private String cmarketprice; private String cmarketprice;
private String vollevel; private String vollevel;
private String rectime; private String rectime;
private String state; private String state;
public Quotation() {
public Quotation() { super();
super(); }
}
public Quotation(String technical, String factory, String proname, String tennumber, public Quotation(String technical, String factory, String proname, String tennumber, String promanager,
String promanager, String quantity, String tramodel, String capfactor, String volratio, String noloadloss, String quantity, String tramodel, String capfactor, String volratio, String noloadloss, String loadloss,
String loadloss, String impvoltage, String traweight, String totweight, String copconsumption, String impvoltage, String traweight, String totweight, String copconsumption, String cmarketprice,
String cmarketprice, String vollevel, String rectime, String state) { String vollevel, String rectime, String state) {
super(); super();
this.technical = technical; this.technical = technical;
this.factory = factory; this.factory = factory;
this.proname = proname; this.proname = proname;
this.tennumber = tennumber; this.tennumber = tennumber;
this.promanager = promanager; this.promanager = promanager;
this.quantity = quantity; this.quantity = quantity;
this.tramodel = tramodel; this.tramodel = tramodel;
this.capfactor = capfactor; this.capfactor = capfactor;
this.volratio = volratio; this.volratio = volratio;
this.noloadloss = noloadloss; this.noloadloss = noloadloss;
this.loadloss = loadloss; this.loadloss = loadloss;
this.impvoltage = impvoltage; this.impvoltage = impvoltage;
this.traweight = traweight; this.traweight = traweight;
this.totweight = totweight; this.totweight = totweight;
this.copconsumption = copconsumption; this.copconsumption = copconsumption;
this.cmarketprice = cmarketprice; this.cmarketprice = cmarketprice;
this.vollevel = vollevel; this.vollevel = vollevel;
this.rectime = rectime; this.rectime = rectime;
this.state = state; this.state = state;
} }
public String getTechnical() {
return technical; public String getTechnical() {
} return technical;
public void setTechnical(String technical) { }
this.technical = technical;
} public void setTechnical(String technical) {
public String getFactory() { this.technical = technical;
return factory; }
}
public void setFactory(String factory) { public String getFactory() {
this.factory = factory; return factory;
} }
public String getProname() {
return proname; public void setFactory(String factory) {
} this.factory = factory;
public void setProname(String proname) { }
this.proname = proname;
} public String getProname() {
public String getTennumber() { return proname;
return tennumber; }
}
public void setTennumber(String tennumber) { public void setProname(String proname) {
this.tennumber = tennumber; this.proname = proname;
} }
public String getPromanager() {
return promanager; public String getTennumber() {
} return tennumber;
public void setPromanager(String promanager) { }
this.promanager = promanager;
} public void setTennumber(String tennumber) {
public String getQuantity() { this.tennumber = tennumber;
return quantity; }
}
public void setQuantity(String quantity) { public String getPromanager() {
this.quantity = quantity; return promanager;
} }
public String getTramodel() {
return tramodel; public void setPromanager(String promanager) {
} this.promanager = promanager;
public void setTramodel(String tramodel) { }
this.tramodel = tramodel;
} public String getQuantity() {
public String getCapfactor() { return quantity;
return capfactor; }
}
public void setCapfactor(String capfactor) { public void setQuantity(String quantity) {
this.capfactor = capfactor; this.quantity = quantity;
} }
public String getVolratio() {
return volratio; public String getTramodel() {
} return tramodel;
public void setVolratio(String volratio) { }
this.volratio = volratio;
} public void setTramodel(String tramodel) {
public String getNoloadloss() { this.tramodel = tramodel;
return noloadloss; }
}
public void setNoloadloss(String noloadloss) { public String getCapfactor() {
this.noloadloss = noloadloss; return capfactor;
} }
public String getLoadloss() {
return loadloss; public void setCapfactor(String capfactor) {
} this.capfactor = capfactor;
public void setLoadloss(String loadloss) { }
this.loadloss = loadloss;
} public String getVolratio() {
public String getImpvoltage() { return volratio;
return impvoltage; }
}
public void setImpvoltage(String impvoltage) { public void setVolratio(String volratio) {
this.impvoltage = impvoltage; this.volratio = volratio;
} }
public String getTraweight() {
return traweight; public String getNoloadloss() {
} return noloadloss;
public void setTraweight(String traweight) { }
this.traweight = traweight;
} public void setNoloadloss(String noloadloss) {
public String getTotweight() { this.noloadloss = noloadloss;
return totweight; }
}
public void setTotweight(String totweight) { public String getLoadloss() {
this.totweight = totweight; return loadloss;
} }
public String getCopconsumption() {
return copconsumption; public void setLoadloss(String loadloss) {
} this.loadloss = loadloss;
public void setCopconsumption(String copconsumption) { }
this.copconsumption = copconsumption;
} public String getImpvoltage() {
public String getCmarketprice() { return impvoltage;
return cmarketprice; }
}
public void setCmarketprice(String cmarketprice) { public void setImpvoltage(String impvoltage) {
this.cmarketprice = cmarketprice; this.impvoltage = impvoltage;
} }
public String getVollevel() {
return vollevel; public String getTraweight() {
} return traweight;
public void setVollevel(String vollevel) { }
this.vollevel = vollevel;
} public void setTraweight(String traweight) {
public String getRectime() { this.traweight = traweight;
return rectime; }
}
public void setRectime(String rectime) { public String getTotweight() {
this.rectime = rectime; return totweight;
} }
public String getState() {
return state; public void setTotweight(String totweight) {
} this.totweight = totweight;
public void setState(String state) { }
this.state = state;
} public String getCopconsumption() {
@Override return copconsumption;
public String toString() { }
return "Quotation [technical=" + technical + ", totalprice=" + ", factory=" + factory
+ ", proname=" + proname + ", tennumber=" + tennumber + ", promanager=" + promanager + ", quantity=" public void setCopconsumption(String copconsumption) {
+ quantity + ", tramodel=" + tramodel + ", capfactor=" + capfactor + ", volratio=" + volratio this.copconsumption = copconsumption;
+ ", noloadloss=" + noloadloss + ", loadloss=" + loadloss + ", impvoltage=" + impvoltage }
+ ", traweight=" + traweight + ", totweight=" + totweight + ", copconsumption=" + copconsumption
+ ", cmarketprice=" + cmarketprice + ", vollevel=" + vollevel + ", rectime=" + rectime + ", state=" public String getCmarketprice() {
+ state + "]"; return cmarketprice;
} }
public void setCmarketprice(String cmarketprice) {
this.cmarketprice = cmarketprice;
}
public String getVollevel() {
return vollevel;
}
public void setVollevel(String vollevel) {
this.vollevel = vollevel;
}
public String getRectime() {
return rectime;
}
public void setRectime(String rectime) {
this.rectime = rectime;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
@Override
public String toString() {
return "Quotation [technical=" + technical + ", totalprice=" + ", factory=" + factory + ", proname=" + proname
+ ", tennumber=" + tennumber + ", promanager=" + promanager + ", quantity=" + quantity + ", tramodel="
+ tramodel + ", capfactor=" + capfactor + ", volratio=" + volratio + ", noloadloss=" + noloadloss
+ ", loadloss=" + loadloss + ", impvoltage=" + impvoltage + ", traweight=" + traweight + ", totweight="
+ totweight + ", copconsumption=" + copconsumption + ", cmarketprice=" + cmarketprice + ", vollevel="
+ vollevel + ", rectime=" + rectime + ", state=" + state + "]";
}
} }

@ -4,295 +4,180 @@ import javafx.beans.property.SimpleStringProperty;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
public class QuotationMX { public class QuotationMX {
private String cbdlx; private String cbdlx;
private String projectid; private String projectid;
private String revision; private String revision;
private SimpleStringProperty matgroup; private SimpleStringProperty matgroup;
private SimpleStringProperty mgsnumber; private SimpleStringProperty mgsnumber;
private SimpleStringProperty materialNameColumn; private SimpleStringProperty materialNameColumn;
private SimpleStringProperty matcnumber; private SimpleStringProperty matcnumber;
private SimpleStringProperty relatedMaterialColumn; private SimpleStringProperty relatedMaterialColumn;
private SimpleStringProperty specificationColumn; private SimpleStringProperty specificationColumn;
private SimpleStringProperty manufacturerColumn; private SimpleStringProperty manufacturerColumn;
private SimpleStringProperty quantityColumn; private SimpleStringProperty quantityColumn;
private SimpleStringProperty utilizationRateColumn; private SimpleStringProperty utilizationRateColumn;
private SimpleStringProperty unitColumn; private SimpleStringProperty unitColumn;
private SimpleStringProperty amomoney; private SimpleStringProperty amomoney;
private SimpleStringProperty unitPriceColumn; private SimpleStringProperty unitPriceColumn;
private SimpleStringProperty no; private SimpleStringProperty no;
private SimpleStringProperty totalprice; private SimpleStringProperty totalprice;
private SimpleStringProperty contrastPrice; private SimpleStringProperty contrastPrice;
public QuotationMX() {
super(); public QuotationMX() {
} super();
}
public String getCbdlx() {
return cbdlx; public String getCbdlx() {
} return cbdlx;
}
public String getContrastPrice() {
return contrastPrice.get(); public String getContrastPrice() {
} return contrastPrice.get();
}
public void setContrastPrice(SimpleStringProperty contrastPrice) { public void setContrastPrice(SimpleStringProperty contrastPrice) {
this.contrastPrice = contrastPrice; this.contrastPrice = contrastPrice;
} }
public void setCbdlx(String cbdlx) { public void setCbdlx(String cbdlx) {
this.cbdlx = cbdlx; this.cbdlx = cbdlx;
} }
public String getProjectid() { public String getProjectid() {
return projectid; return projectid;
} }
public void setProjectid(String projectid) { public void setProjectid(String projectid) {
this.projectid = projectid; this.projectid = projectid;
} }
public String getRevision() {
public String getRevision() { return revision;
return revision; }
}
public void setRevision(String revision) {
public void setRevision(String revision) { this.revision = revision;
this.revision = revision; }
}
public String getMatgroup() {
return matgroup.get();
}
public void setMatgroup(SimpleStringProperty matgroup) {
public String getMatgroup() { this.matgroup = matgroup;
return matgroup.get(); }
}
public String getMgsnumber() {
return mgsnumber.get();
public void setMatgroup(SimpleStringProperty matgroup) { }
this.matgroup = matgroup;
} public void setMgsnumber(SimpleStringProperty mgsnumber) {
this.mgsnumber = mgsnumber;
}
public String getMgsnumber() {
return mgsnumber.get(); public String getMatcname() {
} return materialNameColumn.get();
}
public void setMgsnumber(SimpleStringProperty mgsnumber) { public void setMatcname(SimpleStringProperty matcname) {
this.mgsnumber = mgsnumber; this.materialNameColumn = matcname;
} }
public String getMatcname() { public String getMatcnumber() {
return materialNameColumn.get(); return matcnumber.get();
} }
public void setMatcname(SimpleStringProperty matcname) { public void setMatcnumber(SimpleStringProperty matcnumber) {
this.materialNameColumn = matcname; this.matcnumber = matcnumber;
} }
public String getMatcatname() {
return relatedMaterialColumn.get();
}
public void setMatcatname(SimpleStringProperty matcatname) {
public String getMatcnumber() { this.relatedMaterialColumn = matcatname;
return matcnumber.get(); }
}
public String getSpecifications() {
public void setMatcnumber(SimpleStringProperty matcnumber) { return specificationColumn.get();
this.matcnumber = matcnumber; }
}
public void setSpecifications(SimpleStringProperty specifications) {
this.specificationColumn = specifications;
public String getMatcatname() { }
return relatedMaterialColumn.get();
} public String getManufacturer() {
return manufacturerColumn.get();
}
public void setManufacturer(SimpleStringProperty manufacturer) {
this.manufacturerColumn = manufacturer;
}
public void setMatcatname(SimpleStringProperty matcatname) {
this.relatedMaterialColumn = matcatname; public String getNwquantity() {
} return quantityColumn.get();
}
public void setNwquantity(SimpleStringProperty nwquantity) {
this.quantityColumn = nwquantity;
}
public String getSpecifications() { public String getUtirate() {
return specificationColumn.get(); return utilizationRateColumn.get();
} }
public void setUtirate(SimpleStringProperty utirate) {
this.utilizationRateColumn = utirate;
}
public String getUnit() {
public void setSpecifications(SimpleStringProperty specifications) { return unitColumn.get();
this.specificationColumn = specifications; }
}
public void setUnit(SimpleStringProperty unit) {
this.unitColumn = unit;
}
public String getAmomoney() {
return amomoney.get();
public String getManufacturer() { }
return manufacturerColumn.get();
} public void setAmomoney(SimpleStringProperty amomoney) {
this.amomoney = amomoney;
}
public String getUnitprice() {
return unitPriceColumn.get();
}
public void setManufacturer(SimpleStringProperty manufacturer) {
this.manufacturerColumn = manufacturer; public void setUnitprice(SimpleStringProperty unitprice) {
} this.unitPriceColumn = unitprice;
}
public String getNo() {
return no.get();
}
public String getNwquantity() { public void setNo(SimpleStringProperty no) {
return quantityColumn.get(); this.no = no;
} }
public String getTotalprice() {
return totalprice.get();
}
public void setTotalprice(SimpleStringProperty totalprice) {
public void setNwquantity(SimpleStringProperty nwquantity) { this.totalprice = totalprice;
this.quantityColumn = nwquantity; }
}
@Override
public String toString() {
return "QuotationMX [matgroup=" + matgroup + ", mgsnumber=" + mgsnumber + ", matcname=" + materialNameColumn
+ ", matcnumber=" + matcnumber + ", matcatname=" + relatedMaterialColumn + ", specifications="
+ specificationColumn + ", manufacturer=" + manufacturerColumn + ", nwquantity=" + quantityColumn
+ ", utirate=" + utilizationRateColumn + ", unit=" + unitColumn + ", amomoney=" + amomoney
public String getUtirate() { + ", unitprice=" + unitPriceColumn + ", no=" + no + ", totalprice=" + totalprice + "]";
return utilizationRateColumn.get(); }
}
public void setUtirate(SimpleStringProperty utirate) {
this.utilizationRateColumn = utirate;
}
public String getUnit() {
return unitColumn.get();
}
public void setUnit(SimpleStringProperty unit) {
this.unitColumn = unit;
}
public String getAmomoney() {
return amomoney.get();
}
public void setAmomoney(SimpleStringProperty amomoney) {
this.amomoney = amomoney;
}
public String getUnitprice() {
return unitPriceColumn.get();
}
public void setUnitprice(SimpleStringProperty unitprice) {
this.unitPriceColumn = unitprice;
}
public String getNo() {
return no.get();
}
public void setNo(SimpleStringProperty no) {
this.no = no;
}
public String getTotalprice() {
return totalprice.get();
}
public void setTotalprice(SimpleStringProperty totalprice) {
this.totalprice = totalprice;
}
@Override
public String toString() {
return "QuotationMX [matgroup=" + matgroup + ", mgsnumber=" + mgsnumber
+ ", matcname=" + materialNameColumn + ", matcnumber=" + matcnumber + ", matcatname=" + relatedMaterialColumn
+ ", specifications=" + specificationColumn + ", manufacturer=" + manufacturerColumn + ", nwquantity=" + quantityColumn
+ ", utirate=" + utilizationRateColumn + ", unit=" + unitColumn + ", amomoney=" + amomoney + ", unitprice=" + unitPriceColumn
+ ", no=" + no + ", totalprice=" + totalprice + "]";
}
} }

@ -13,20 +13,20 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
public class test { public class test {
public static String formatString(String input) { public static String formatString(String input) {
if (input == null || input.length() == 0) { if (input == null || input.length() == 0) {
return input; return input;
} }
double number = Double.parseDouble(input); double number = Double.parseDouble(input);
if (number == (int) number) { if (number == (int) number) {
return String.valueOf((int) number); return String.valueOf((int) number);
} else { } else {
return String.format("%.3f", number).replaceAll("0*$", "").replaceAll("\\.$", ""); return String.format("%.3f", number).replaceAll("0*$", "").replaceAll("\\.$", "");
} }
} }
public static void main(String[] args) { public static void main(String[] args) {
// String input1 = "10"; // String input1 = "10";
// String input2 = "0.41"; // String input2 = "0.41";
// String input3 = ".40"; // String input3 = ".40";
@ -36,6 +36,6 @@ public class test {
// System.out.println(formatString(input2)); // 输出0.4 // System.out.println(formatString(input2)); // 输出0.4
// System.out.println(formatString(input3)); // 输出0.4 // System.out.println(formatString(input3)); // 输出0.4
// System.out.println(formatString(input4)); // 输出12.345 // System.out.println(formatString(input4)); // 输出12.345
MessageBox.post( "Ìáʾ", "δѡÔñ³É±¾µ¥ÀàÐÍ", MessageBox.INFORMATION); MessageBox.post("Ìáʾ", "δѡÔñ³É±¾µ¥ÀàÐÍ", MessageBox.INFORMATION);
} }
} }

@ -1,6 +1,5 @@
package com.connor.plm.CreateOuotation; package com.connor.plm.CreateOuotation;
import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.SimpleStringProperty;
import javafx.event.Event; import javafx.event.Event;
import javafx.geometry.Pos; import javafx.geometry.Pos;
@ -67,8 +66,7 @@ public class EditingCell<T> extends TableCell<T, String> {
TableView<T> table = getTableView(); TableView<T> table = getTableView();
if (table != null) { if (table != null) {
TableColumn<T, String> col = getTableColumn(); TableColumn<T, String> col = getTableColumn();
CellEditEvent<T, String> event = new CellEditEvent<>(table, CellEditEvent<T, String> event = new CellEditEvent<>(table, new TablePosition<>(table, getIndex(), col),
new TablePosition<>(table, getIndex(), col),
TableColumn.editCommitEvent(), newValue); TableColumn.editCommitEvent(), newValue);
Event.fireEvent(col, event); Event.fireEvent(col, event);
System.out.println("开始利用反射将数据写入对象"); System.out.println("开始利用反射将数据写入对象");
@ -95,9 +93,9 @@ public class EditingCell<T> extends TableCell<T, String> {
} }
private Object convertValue(String value, Class<?> type) { private Object convertValue(String value, Class<?> type) {
if(type == SimpleStringProperty.class) { if (type == SimpleStringProperty.class) {
return new SimpleStringProperty(value); return new SimpleStringProperty(value);
}else if (type == String.class) { } else if (type == String.class) {
return value; return value;
} else if (type == Integer.class) { } else if (type == Integer.class) {
return new IntegerStringConverter().fromString(value); return new IntegerStringConverter().fromString(value);

@ -1,6 +1,5 @@
package com.connor.plm.CreateOuotation; package com.connor.plm.CreateOuotation;
import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.SimpleStringProperty;
import javafx.event.Event; import javafx.event.Event;
import javafx.geometry.Pos; import javafx.geometry.Pos;
@ -67,8 +66,7 @@ public class EditingCellOR<T> extends TableCell<T, String> {
TableView<T> table = getTableView(); TableView<T> table = getTableView();
if (table != null) { if (table != null) {
TableColumn<T, String> col = getTableColumn(); TableColumn<T, String> col = getTableColumn();
CellEditEvent<T, String> event = new CellEditEvent<>(table, CellEditEvent<T, String> event = new CellEditEvent<>(table, new TablePosition<>(table, getIndex(), col),
new TablePosition<>(table, getIndex(), col),
TableColumn.editCommitEvent(), newValue); TableColumn.editCommitEvent(), newValue);
Event.fireEvent(col, event); Event.fireEvent(col, event);
System.out.println("开始利用反射将数据写入对象"); System.out.println("开始利用反射将数据写入对象");
@ -95,9 +93,9 @@ public class EditingCellOR<T> extends TableCell<T, String> {
} }
private Object convertValue(String value, Class<?> type) { private Object convertValue(String value, Class<?> type) {
if(type == SimpleStringProperty.class) { if (type == SimpleStringProperty.class) {
return new SimpleStringProperty(value); return new SimpleStringProperty(value);
}else if (type == String.class) { } else if (type == String.class) {
return value; return value;
} else if (type == Integer.class) { } else if (type == Integer.class) {
return new IntegerStringConverter().fromString(value); return new IntegerStringConverter().fromString(value);

@ -12,27 +12,25 @@ import com.connor.plm.CostListManagement.pojo.Quotation;
import javafx.embed.swing.JFXPanel; import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene; import javafx.scene.Scene;
public class JDBFrame extends KFrame{ public class JDBFrame extends KFrame {
private Quotation quotation; private Quotation quotation;
@Override
protected void initUI() throws Exception {
@Override this.setTitle("变压器投标成本单");
protected void initUI() throws Exception { this.setLayout(new BorderLayout());
this.setTitle("变压器投标成本单"); this.setPreferredSize(new Dimension(1350, 850));
this.setLayout(new BorderLayout()); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
this.setPreferredSize(new Dimension(1350, 850)); int screenWidth = screenSize.width; // 获取屏幕宽度
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸 int screenHeight = screenSize.height; // 获取屏幕高度
int screenWidth = screenSize.width; // 获取屏幕宽度 int x = (screenWidth - 1350) / 2; // 计算Frame的左上角x坐标
int screenHeight = screenSize.height; // 获取屏幕高度 int y = (screenHeight - 850) / 2; // 计算Frame的左上角y坐标
int x = (screenWidth - 1350) / 2; // 计算Frame的左上角x坐标 this.setLocation(x, y); // 设置Frame的位置
int y = (screenHeight - 850) / 2; // 计算Frame的左上角y坐标 JFXPanel panel = new JFXPanel();
this.setLocation(x, y); // 设置Frame的位置 panel.setScene(new JDBfxPanel(this).getScene());
JFXPanel panel = new JFXPanel(); this.add(BorderLayout.CENTER, panel);
panel.setScene(new JDBfxPanel(this).getScene());
this.add(BorderLayout.CENTER, panel);
// this.setResizable(false); // this.setResizable(false);
this.setAlwaysOnTop(true); this.setAlwaysOnTop(true);
} }
} }

@ -1,13 +1,15 @@
package com.connor.plm.CreateOuotation; package com.connor.plm.CreateOuotation;
import java.awt.Window; import java.awt.Window;
import com.connor.plm.CostListManagement.pojo.Quotation; import com.connor.plm.CostListManagement.pojo.Quotation;
public class JDBfxPanel extends KFXPanel{
private Quotation quotation;
public JDBfxPanel(Window dialog) {
super(dialog);
// TODO Auto-generated constructor stub
}
public class JDBfxPanel extends KFXPanel {
private Quotation quotation;
public JDBfxPanel(Window dialog) {
super(dialog);
// TODO Auto-generated constructor stub
}
} }

@ -13,116 +13,113 @@ import javafx.stage.Stage;
//import sun.util.logging.PlatformLogger; //import sun.util.logging.PlatformLogger;
public abstract class KFXPanel extends Application { public abstract class KFXPanel extends Application {
protected Scene scene; protected Scene scene;
protected KFXPanelController aifController; protected KFXPanelController aifController;
protected Parent root; protected Parent root;
protected String cssForm; protected String cssForm;
protected Window parentDialog; protected Window parentDialog;
private FXMLLoader fxmlLoader; private FXMLLoader fxmlLoader;
static {
Platform.setImplicitExit(false);
// Logging.getCSSLogger().setLevel(Platform.class...STYLESHEET_CASPIAN....Level.OFF);
}
public KFXPanel(Window dialog) {
setParentDialog(dialog);
initUI();
initData();
}
public KFXPanel(Window dialog, Class<?> c, String css) {
setParentDialog(dialog);
this.cssForm = c.getResource(css).toExternalForm();
initUI();
initData();
}
static { public void setParentDialog(Window dialog) {
Platform.setImplicitExit(false); this.parentDialog = dialog;
// Logging.getCSSLogger().setLevel(Platform.class...STYLESHEET_CASPIAN....Level.OFF);
}
public KFXPanel(Window dialog) {
setParentDialog(dialog);
initUI();
initData();
}
public KFXPanel(Window dialog, Class<?> c, String css) {
setParentDialog(dialog);
this.cssForm = c.getResource(css).toExternalForm();
initUI();
initData();
}
public void setParentDialog(Window dialog) {
this.parentDialog = dialog;
}
public Window getParentDialog() {
return this.parentDialog;
}
public Parent getRoot() {
return this.root;
}
public KFXPanelController getController() {
return this.aifController;
}
public Scene getScene() {
if (this.scene == null) {
this.scene = new Scene(this.root);
this.scene.setFill(null);
} }
return this.scene;
}
public void initData() { public Window getParentDialog() {
try { return this.parentDialog;
this.aifController.initData(this); }
} catch (Exception e) { public Parent getRoot() {
e.printStackTrace(); return this.root;
post(this.parentDialog, e.getMessage(), "", 1);
} }
}
public KFXPanelController getController() {
protected void initUI() { return this.aifController;
try {
fxmlLoader = new FXMLLoader();
String resource = "PersonOverview.fxml";
fxmlLoader.setLocation(getClass().getResource(resource));
root = fxmlLoader.load();
this.aifController = (KFXPanelController)fxmlLoader.getController();
if (this.cssForm != null)
this.root.getStylesheets().add(this.cssForm);
} catch (Exception e) {
e.printStackTrace();
post(this.parentDialog, e.getMessage(), "", 1);
} }
}
public Scene getScene() {
public static void post(Window dialog, final String msg, final String title, int msgType) { if (this.scene == null) {
if (dialog == null) { this.scene = new Scene(this.root);
Platform.runLater(new Runnable() { this.scene.setFill(null);
public void run() { }
Alert alert = new Alert(Alert.AlertType.INFORMATION); return this.scene;
alert.setTitle(title);
alert.setHeaderText("");
alert.setContentText(msg);
alert.showAndWait();
}
});
} else {
MessageBox.post(dialog, msg, title, msgType);
} }
}
public void initData() {
try {
this.aifController.initData(this);
} catch (Exception e) {
e.printStackTrace();
post(this.parentDialog, e.getMessage(), "", 1);
}
}
protected void initUI() {
try {
fxmlLoader = new FXMLLoader();
String resource = "PersonOverview.fxml";
fxmlLoader.setLocation(getClass().getResource(resource));
root = fxmlLoader.load();
this.aifController = (KFXPanelController) fxmlLoader.getController();
if (this.cssForm != null)
this.root.getStylesheets().add(this.cssForm);
} catch (Exception e) {
e.printStackTrace();
post(this.parentDialog, e.getMessage(), "", 1);
}
}
public static void post(Window dialog, final String msg, final String title, int msgType) {
if (dialog == null) {
Platform.runLater(new Runnable() {
public void run() {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle(title);
alert.setHeaderText("");
alert.setContentText(msg);
alert.showAndWait();
}
});
} else {
MessageBox.post(dialog, msg, title, msgType);
}
}
// protected Stage primaryStage; // protected Stage primaryStage;
public void start(Stage primaryStage) throws Exception { public void start(Stage primaryStage) throws Exception {
initUI(); initUI();
initData(); initData();
// this.primaryStage = primaryStage; // this.primaryStage = primaryStage;
primaryStage.setScene(getScene()); primaryStage.setScene(getScene());
primaryStage.show(); primaryStage.show();
} }
public static void main(String[] args) {
launch(args);
}
public static void main(String[] args) {
launch(args);
}
} }

@ -1,6 +1,5 @@
package com.connor.plm.CreateOuotation; package com.connor.plm.CreateOuotation;
import com.connor.plm.CostListManagement.pojo.Quotation; import com.connor.plm.CostListManagement.pojo.Quotation;
import javafx.application.Platform; import javafx.application.Platform;
@ -8,23 +7,23 @@ import javafx.fxml.FXML;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
public abstract class KFXPanelController { public abstract class KFXPanelController {
@FXML @FXML
protected AnchorPane coverPane; protected AnchorPane coverPane;
public abstract void initData(KFXPanel paramKFXPanel) throws Exception; public abstract void initData(KFXPanel paramKFXPanel) throws Exception;
public void setCoverVisible(final boolean visible) { public void setCoverVisible(final boolean visible) {
if (this.coverPane != null) { if (this.coverPane != null) {
Platform.runLater(new Runnable() { Platform.runLater(new Runnable() {
public void run() { public void run() {
KFXPanelController.this.coverPane.setVisible(visible); KFXPanelController.this.coverPane.setVisible(visible);
}
});
try {
Thread.sleep(10L);
} catch (Exception e) {
e.printStackTrace();
} }
}); }
try {
Thread.sleep(10L);
} catch (Exception e) {
e.printStackTrace();
}
} }
}
} }

@ -1,6 +1,5 @@
package com.connor.plm.CreateOuotation; package com.connor.plm.CreateOuotation;
import java.io.IOException; import java.io.IOException;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@ -18,12 +17,11 @@ public class MainApp extends Application {
private Stage primaryStage; private Stage primaryStage;
private Pane rootLayout; private Pane rootLayout;
@Override @Override
public void start(Stage primaryStage) throws IOException { public void start(Stage primaryStage) throws IOException {
try { try {
System.out.println("1"); System.out.println("1");
this.primaryStage = primaryStage; this.primaryStage = primaryStage;
this.primaryStage.setTitle("变压器投标成本单"); this.primaryStage.setTitle("变压器投标成本单");
FXMLLoader loader = new FXMLLoader(); FXMLLoader loader = new FXMLLoader();
loader.setLocation(MainApp.class.getResource("PersonOverview.fxml")); loader.setLocation(MainApp.class.getResource("PersonOverview.fxml"));

@ -1,9 +1,9 @@
package com.connor.plm.CreateOuotation; package com.connor.plm.CreateOuotation;
public class test { public class test {
public static void main(String[] args) { public static void main(String[] args) {
double contrastPrice = Double.parseDouble("0"); double contrastPrice = Double.parseDouble("0");
System.out.println(contrastPrice==0); System.out.println(contrastPrice == 0);
} }
} }

@ -3,50 +3,50 @@ package com.connor.plm.SendGXToMOM;
import org.omg.CORBA.PRIVATE_MEMBER; import org.omg.CORBA.PRIVATE_MEMBER;
public class FileJson { public class FileJson {
private String name; private String name;
private String uid; private String uid;
private String no; private String no;
public FileJson() { public FileJson() {
super(); super();
} }
public FileJson(String name, String uid, String no) { public FileJson(String name, String uid, String no) {
super(); super();
this.name = name; this.name = name;
this.uid = uid; this.uid = uid;
this.no = no; this.no = no;
} }
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getUid() { public String getUid() {
return uid; return uid;
} }
public void setUid(String uid) { public void setUid(String uid) {
this.uid = uid; this.uid = uid;
} }
public String getNo() { public String getNo() {
return no; return no;
} }
public void setNo(String no) { public void setNo(String no) {
this.no = no; this.no = no;
} }
@Override @Override
public String toString() { public String toString() {
return "FileJson [name=" + name + ", uid=" + uid + ", no=" + no + "]"; return "FileJson [name=" + name + ", uid=" + uid + ", no=" + no + "]";
} }
} }

@ -3,133 +3,97 @@ package com.connor.plm.SendGXToMOM;
import java.util.List; import java.util.List;
public class Process { public class Process {
private String factoryCode; private String factoryCode;
private String processName; private String processName;
private String processCode; private String processCode;
private String workCenter; private String workCenter;
private String processType; private String processType;
private List<FileJson> processRouteFiles; private List<FileJson> processRouteFiles;
private List<FileJson> esopFiles; private List<FileJson> esopFiles;
public Process() {
super();
}
public Process(String factoryCode, String processName, String processCode, String workCenter, String processType,
List<FileJson> processRouteFiles, List<FileJson> esopFiles) {
super();
this.factoryCode = factoryCode;
this.processName = processName;
this.processCode = processCode;
this.workCenter = workCenter;
this.processType = processType;
this.processRouteFiles = processRouteFiles;
this.esopFiles = esopFiles;
}
public Process() { public String getFactoryCode() {
super(); return factoryCode;
} }
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getProcessName() {
return processName;
}
public Process(String factoryCode, String processName, String processCode, String workCenter, String processType, public void setProcessName(String processName) {
List<FileJson> processRouteFiles, List<FileJson> esopFiles) { this.processName = processName;
super(); }
this.factoryCode = factoryCode;
this.processName = processName;
this.processCode = processCode;
this.workCenter = workCenter;
this.processType = processType;
this.processRouteFiles = processRouteFiles;
this.esopFiles = esopFiles;
}
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getFactoryCode() { public String getWorkCenter() {
return factoryCode; return workCenter;
} }
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
public String getProcessType() {
return processType;
}
public void setFactoryCode(String factoryCode) { public void setProcessType(String processType) {
this.factoryCode = factoryCode; this.processType = processType;
} }
public List<FileJson> getProcessRouteFiles() {
return processRouteFiles;
}
public void setProcessRouteFiles(List<FileJson> processRouteFiles) {
this.processRouteFiles = processRouteFiles;
}
public String getProcessName() { public List<FileJson> getEsopFiles() {
return processName; return esopFiles;
} }
public void setProcessName(String processName) {
this.processName = processName;
}
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getWorkCenter() {
return workCenter;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
public String getProcessType() {
return processType;
}
public void setProcessType(String processType) {
this.processType = processType;
}
public List<FileJson> getProcessRouteFiles() {
return processRouteFiles;
}
public void setProcessRouteFiles(List<FileJson> processRouteFiles) {
this.processRouteFiles = processRouteFiles;
}
public List<FileJson> getEsopFiles() {
return esopFiles;
}
public void setEsopFiles(List<FileJson> esopFiles) {
this.esopFiles = esopFiles;
}
@Override
public String toString() {
return "Process [factoryCode=" + factoryCode + ", processName=" + processName + ", processCode=" + processCode
+ ", workCenter=" + workCenter + ", processType=" + processType + ", processRouteFiles="
+ processRouteFiles + ", esopFiles=" + esopFiles + "]";
}
public void setEsopFiles(List<FileJson> esopFiles) {
this.esopFiles = esopFiles;
}
@Override
public String toString() {
return "Process [factoryCode=" + factoryCode + ", processName=" + processName + ", processCode=" + processCode
+ ", workCenter=" + workCenter + ", processType=" + processType + ", processRouteFiles="
+ processRouteFiles + ", esopFiles=" + esopFiles + "]";
}
} }

@ -30,45 +30,43 @@ import javafx.beans.property.SimpleStringProperty;
/** /**
* ±ê×¼¹¤Ðò´«µÝMOM * ±ê×¼¹¤Ðò´«µÝMOM
* @author hongcj *
* 2023/11/29 * @author hongcj 2023/11/29
*/ */
public class sendGXToMOMHandler extends AbstractHandler{ public class sendGXToMOMHandler extends AbstractHandler {
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
AbstractAIFApplication app = AIFUtility.getCurrentApplication(); AbstractAIFApplication app = AIFUtility.getCurrentApplication();
TCSession session = (TCSession)app.getSession(); TCSession session = (TCSession) app.getSession();
try { try {
new Thread() { new Thread() {
@Override @Override
public void run() { public void run() {
// 获取tc当前选择的操作 // 获取tc当前选择的操作
InterfaceAIFComponent target = app.getTargetComponent(); InterfaceAIFComponent target = app.getTargetComponent();
if(target instanceof TCComponentItemRevision) { if (target instanceof TCComponentItemRevision) {
TCComponentItemRevision revision = (TCComponentItemRevision)target; TCComponentItemRevision revision = (TCComponentItemRevision) target;
try { try {
String type = revision.getStringProperty("object_type"); String type = revision.getStringProperty("object_type");
if("ZT2_FirstOPRevision".equals(type) || "MEOPRevision".equals(type)) { if ("ZT2_FirstOPRevision".equals(type) || "MEOPRevision".equals(type)) {
sendGXToMOMOperation sendGXToMOMOperation = new sendGXToMOMOperation(session,revision); sendGXToMOMOperation sendGXToMOMOperation = new sendGXToMOMOperation(session, revision);
session.queueOperation(sendGXToMOMOperation); session.queueOperation(sendGXToMOMOperation);
}else { } else {
MessageBox.post("请选择标准工序对象操作", "提示", MessageBox.INFORMATION); MessageBox.post("请选择标准工序对象操作", "提示", MessageBox.INFORMATION);
} }
} catch (TCException e) { } catch (TCException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
}else { } else {
MessageBox.post("请选择版本对象操作", "提示", MessageBox.INFORMATION); MessageBox.post("请选择版本对象操作", "提示", MessageBox.INFORMATION);
} }
} }
}.start(); }.start();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
} }
} }

@ -24,166 +24,173 @@ import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCSession; import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox; import com.teamcenter.rac.util.MessageBox;
public class sendGXToMOMOperation extends AbstractAIFOperation{ public class sendGXToMOMOperation extends AbstractAIFOperation {
private TCSession session; private TCSession session;
private TCComponentItemRevision revision; private TCComponentItemRevision revision;
public sendGXToMOMOperation(TCSession session, TCComponentItemRevision revision) { public sendGXToMOMOperation(TCSession session, TCComponentItemRevision revision) {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
this.session = session; this.session = session;
this.revision = revision; this.revision = revision;
} }
@Override @Override
public void executeOperation() throws Exception { public void executeOperation() throws Exception {
// TODO Auto-generated method stub // TODO Auto-generated method stub
System.out.println("开始获取信息传递"); System.out.println("开始获取信息传递");
System.out.println("获取工厂"); System.out.println("获取工厂");
Process process = new Process(); Process process = new Process();
String groupID = SAPUtil.getGroupID(session); String groupID = SAPUtil.getGroupID(session);
System.out.println(groupID); System.out.println(groupID);
process.setFactoryCode(groupID); process.setFactoryCode(groupID);
System.out.println("获取工序名称"); System.out.println("获取工序名称");
String name = revision.getStringProperty("object_name"); String name = revision.getStringProperty("object_name");
System.out.println(name); System.out.println(name);
process.setProcessName(name); process.setProcessName(name);
System.out.println("获取工序编码"); System.out.println("获取工序编码");
String code = revision.getStringProperty("zt2_ClassificationCode"); String code = revision.getStringProperty("zt2_ClassificationCode");
System.out.println(code); System.out.println(code);
process.setProcessCode(code); process.setProcessCode(code);
System.out.println("获取工作中心"); System.out.println("获取工作中心");
String center = revision.getStringProperty("zt2_WorkCenter"); String center = revision.getStringProperty("zt2_WorkCenter");
System.out.println(center); System.out.println(center);
process.setProcessCode(center); process.setProcessCode(center);
System.out.println("获取工序类型"); System.out.println("获取工序类型");
String type = revision.getStringProperty("object_type"); String type = revision.getStringProperty("object_type");
System.out.println(type); System.out.println(type);
if("ZT2_FirstOPRevision".equals(type)) { if ("ZT2_FirstOPRevision".equals(type)) {
process.setProcessType("1"); process.setProcessType("1");
List<FileJson> fileJsons = new ArrayList<FileJson>(); // FileJson fileJson = new FileJson();
process.setProcessRouteFiles(fileJsons);
List<FileJson> fileJsons1 = new ArrayList<FileJson>(); List<FileJson> fileJsons = new ArrayList<FileJson>();
process.setEsopFiles(fileJsons1); // fileJsons.add(fileJson);
}else { process.setProcessRouteFiles(fileJsons);
process.setProcessType("2");
System.out.println("开始获取file数组1"); List<FileJson> fileJsons1 = new ArrayList<FileJson>();
TCComponent[] referenceListProperty = revision.getReferenceListProperty("ZT2_ProcessRuleRelation"); // fileJsons1.add(fileJson);
List<FileJson> fileJsons = new ArrayList<FileJson>(); process.setEsopFiles(fileJsons1);
if(referenceListProperty!=null && referenceListProperty.length>0) { } else {
for(TCComponent component : referenceListProperty) { process.setProcessType("2");
String gxType = component.getStringProperty("object_type"); System.out.println("开始获取file数组1");
if("ZT2_ProcessRule".equals(gxType)) { TCComponent[] referenceListProperty = revision.getReferenceListProperty("ZT2_ProcessRuleRelation");
TCComponentItemRevision latestItemRevision = ((TCComponentItem)component).getLatestItemRevision(); List<FileJson> fileJsons = new ArrayList<FileJson>();
TCComponent[] referenceListProperty2 = latestItemRevision.getReferenceListProperty("IMAN_specification"); if (referenceListProperty != null && referenceListProperty.length > 0) {
if(referenceListProperty2!=null && referenceListProperty2.length>0) { for (TCComponent component : referenceListProperty) {
for(TCComponent component2 : referenceListProperty2) { String gxType = component.getStringProperty("object_type");
String typePdf = component2.getStringProperty("object_type"); if ("ZT2_ProcessRule".equals(gxType)) {
if("PDF".equals(typePdf) || "pdf".equals(typePdf)) { TCComponentItemRevision latestItemRevision = ((TCComponentItem) component)
FileJson fileJson = new FileJson(); .getLatestItemRevision();
fileJson.setName(component2.getStringProperty("object_name")); TCComponent[] referenceListProperty2 = latestItemRevision
fileJson.setUid(component2.getUid()); .getReferenceListProperty("IMAN_specification");
fileJson.setNo((fileJsons.size()+1)*10+""); if (referenceListProperty2 != null && referenceListProperty2.length > 0) {
fileJsons.add(fileJson); for (TCComponent component2 : referenceListProperty2) {
} String typePdf = component2.getStringProperty("object_type");
} if ("PDF".equals(typePdf) || "pdf".equals(typePdf)) {
} FileJson fileJson = new FileJson();
fileJson.setName(component2.getStringProperty("object_name"));
} fileJson.setUid(component2.getUid());
} fileJson.setNo((fileJsons.size() + 1) * 10 + "");
} fileJsons.add(fileJson);
}
System.out.println(fileJsons.toString()); }
process.setProcessRouteFiles(fileJsons); }
System.out.println("开始获取file数组2"); }
TCComponent[] referenceListProperty1 = revision.getReferenceListProperty("ZT2_ProcGuidBookRelation"); }
List<FileJson> fileJsons1 = new ArrayList<FileJson>(); }
if(referenceListProperty1!=null && referenceListProperty1.length>0) {
for(TCComponent component : referenceListProperty1) { System.out.println(fileJsons.toString());
String gxType = component.getStringProperty("object_type"); process.setProcessRouteFiles(fileJsons);
if("ZT2_ProcGuidBook".equals(gxType)) {
TCComponentItemRevision latestItemRevision = ((TCComponentItem)component).getLatestItemRevision(); System.out.println("开始获取file数组2");
TCComponent[] referenceListProperty2 = latestItemRevision.getReferenceListProperty("IMAN_specification"); TCComponent[] referenceListProperty1 = revision.getReferenceListProperty("ZT2_ProcGuidBookRelation");
if(referenceListProperty2!=null && referenceListProperty2.length>0) { List<FileJson> fileJsons1 = new ArrayList<FileJson>();
for(TCComponent component2 : referenceListProperty2) { if (referenceListProperty1 != null && referenceListProperty1.length > 0) {
String typePdf = component2.getStringProperty("object_type"); for (TCComponent component : referenceListProperty1) {
if("PDF".equals(typePdf) || "pdf".equals(typePdf)) { String gxType = component.getStringProperty("object_type");
FileJson fileJson = new FileJson(); if ("ZT2_ProcGuidBook".equals(gxType)) {
fileJson.setName(component2.getStringProperty("object_name")); TCComponentItemRevision latestItemRevision = ((TCComponentItem) component)
fileJson.setUid(component2.getUid()); .getLatestItemRevision();
fileJson.setNo((fileJsons1.size()+1)*10+""); TCComponent[] referenceListProperty2 = latestItemRevision
fileJsons1.add(fileJson); .getReferenceListProperty("IMAN_specification");
} if (referenceListProperty2 != null && referenceListProperty2.length > 0) {
} for (TCComponent component2 : referenceListProperty2) {
} String typePdf = component2.getStringProperty("object_type");
if ("PDF".equals(typePdf) || "pdf".equals(typePdf)) {
} FileJson fileJson = new FileJson();
} fileJson.setName(component2.getStringProperty("object_name"));
} fileJson.setUid(component2.getUid());
fileJson.setNo((fileJsons1.size() + 1) * 10 + "");
System.out.println(fileJsons1.toString()); fileJsons1.add(fileJson);
process.setEsopFiles(fileJsons1); }
} }
}
System.out.println("要发送的数据"+process.toString()); }
}
String json = JSON.toJSONString(process); }
System.out.println("要发送的json"+json);
System.out.println(fileJsons1.toString());
String url = session.getPreferenceService().getStringValue("CHINT_SENDGXTOMOMURL"); process.setEsopFiles(fileJsons1);
if(url==null) { }
MessageBox.post("首选项【CHINT_SENDGXTOMOMURL】配置有误请检查", "错误", MessageBox.ERROR);
return; System.out.println("要发送的数据" + process.toString());
}else {
System.out.println(url); String json = JSON.toJSONString(process);
String sendJsonHttpPost = sendJsonHttpPost(url,json); System.out.println("要发送的json" + json);
JSONObject parseObject = JSONObject.parseObject(sendJsonHttpPost);
String url = session.getPreferenceService().getStringValue("CHINT_SENDGXTOMOMURL");
if (url == null) {
MessageBox.post(parseObject.getString("msg"), "提示", MessageBox.INFORMATION); MessageBox.post("首选项【CHINT_SENDGXTOMOMURL】配置有误请检查", "错误", MessageBox.ERROR);
} return;
} else {
} System.out.println(url);
String sendJsonHttpPost = sendJsonHttpPost(url, json);
public String sendJsonHttpPost(String url, String json) { JSONObject parseObject = JSONObject.parseObject(sendJsonHttpPost);
CloseableHttpClient httpclient = HttpClients.createDefault(); MessageBox.post(parseObject.getString("msg"), "提示", MessageBox.INFORMATION);
String responseInfo = null; }
try {
HttpPost httpPost = new HttpPost(url); }
// 设置请求头部
httpPost.setHeader("Content-Type", "application/json"); public String sendJsonHttpPost(String url, String json) {
if(url.contains("10.128.11.12")) {
httpPost.addHeader("Authorization", "Basic MTQyODI0Mjg2NDU2ODMwNzcxNDpkREF3TWpveE1EQXg="); CloseableHttpClient httpclient = HttpClients.createDefault();
//http://10.128.11.12:7788/gateway/chint/bop-sync String responseInfo = null;
}else { try {
httpPost.addHeader("Authorization", "Basic MTcxNDkwNTkyNTc2MjUzNTQyNjpkREF3TWpveE1EQXg="); HttpPost httpPost = new HttpPost(url);
} // 设置请求头部
// 设置请求体 httpPost.setHeader("Content-Type", "application/json");
StringEntity entityReq = new StringEntity(json, StandardCharsets.UTF_8); if (url.contains("10.128.11.12")) {
httpPost.setEntity(entityReq); httpPost.addHeader("Authorization", "Basic MTQyODI0Mjg2NDU2ODMwNzcxNDpkREF3TWpveE1EQXg=");
// http://10.128.11.12:7788/gateway/chint/bop-sync
CloseableHttpResponse response = httpclient.execute(httpPost); } else {
HttpEntity entity = response.getEntity(); httpPost.addHeader("Authorization", "Basic MTcxNDkwNTkyNTc2MjUzNTQyNjpkREF3TWpveE1EQXg=");
int status = response.getStatusLine().getStatusCode(); }
String string = EntityUtils.toString(entity); // 设置请求体
System.out.println("MOM status:" + status + "responseInfo:" + string); StringEntity entityReq = new StringEntity(json, StandardCharsets.UTF_8);
return string; httpPost.setEntity(entityReq);
} catch (Exception e) {
e.printStackTrace(); CloseableHttpResponse response = httpclient.execute(httpPost);
} finally { HttpEntity entity = response.getEntity();
try { int status = response.getStatusLine().getStatusCode();
httpclient.close(); String string = EntityUtils.toString(entity);
} catch (IOException e) { System.out.println("MOM status:" + status + "responseInfo:" + string);
e.printStackTrace(); return string;
} } catch (Exception e) {
} e.printStackTrace();
return responseInfo; } finally {
} try {
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return responseInfo;
}
} }

Loading…
Cancel
Save