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

@ -37,7 +37,6 @@ 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;
@ -49,7 +48,9 @@ public class ButtonCellEditor extends AbstractCellEditor implements TableCellEdi
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,
JFrame frame) {
button = new JButton(); button = new JButton();
this.table = jTable2; this.table = jTable2;
this.quotations = quotations; this.quotations = quotations;
@ -76,36 +77,35 @@ public class ButtonCellEditor extends AbstractCellEditor implements TableCellEdi
MessageBox.post("请勿重复创建", "提示", MessageBox.INFORMATION); MessageBox.post("请勿重复创建", "提示", MessageBox.INFORMATION);
return; return;
} }
/*341 /*
1- * 341 1-
*/ */
// 修改表一数据,改变表格内容 // 修改表一数据,改变表格内容
try { try {
String update = "UPDATE \"CHINT_ QUOTATION_TITLE_TEMPLATE\" set \"state\"='已创建' where \"tennumber\" = '"+quotations.get(selectedRow).getTennumber()+"'"; String update = "UPDATE \"CHINT_ QUOTATION_TITLE_TEMPLATE\" set \"state\"='已创建' where \"tennumber\" = '"
+ quotations.get(selectedRow).getTennumber() + "'";
System.out.println("update:" + update); System.out.println("update:" + update);
int state = SqlUtil.update(update); int state = SqlUtil.update(update);
System.out.println("修改数据库:" + state); System.out.println("修改数据库:" + state);
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('"+ 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('"
"报价成本单','"+ + "报价成本单','" + project.getStringProperty("item_id") + "','" + "01','"
project.getStringProperty("item_id")+"','"+ + quotations.get(selectedRow).getFactory() + "','"
"01','"+ + quotations.get(selectedRow).getProname() + "','"
quotations.get(selectedRow).getFactory()+"','"+ + quotations.get(selectedRow).getTennumber() + "','"
quotations.get(selectedRow).getProname()+"','"+ + quotations.get(selectedRow).getPromanager() + "','"
quotations.get(selectedRow).getTennumber()+"','"+ + quotations.get(selectedRow).getQuantity() + "','"
quotations.get(selectedRow).getPromanager()+"','"+ + quotations.get(selectedRow).getTramodel() + "','"
quotations.get(selectedRow).getQuantity()+"','"+ + quotations.get(selectedRow).getCapfactor() + "','"
quotations.get(selectedRow).getTramodel()+"','"+ + quotations.get(selectedRow).getVolratio() + "','"
quotations.get(selectedRow).getCapfactor()+"','"+ + quotations.get(selectedRow).getNoloadloss() + "','"
quotations.get(selectedRow).getVolratio()+"','"+ + quotations.get(selectedRow).getLoadloss() + "','"
quotations.get(selectedRow).getNoloadloss()+"','"+ + quotations.get(selectedRow).getImpvoltage() + "','"
quotations.get(selectedRow).getLoadloss()+"','"+ + quotations.get(selectedRow).getTraweight() + "','"
quotations.get(selectedRow).getImpvoltage()+"','"+ + quotations.get(selectedRow).getTotweight() + "','"
quotations.get(selectedRow).getTraweight()+"','"+ + quotations.get(selectedRow).getCopconsumption() + "','"
quotations.get(selectedRow).getTotweight()+"','"+ + quotations.get(selectedRow).getCmarketprice() + "','"
quotations.get(selectedRow).getCopconsumption()+"','"+ + quotations.get(selectedRow).getVollevel() + "')";
quotations.get(selectedRow).getCmarketprice()+"','"+
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);
@ -114,51 +114,53 @@ public class ButtonCellEditor extends AbstractCellEditor implements TableCellEdi
table.setValueAt("已创建", table.getSelectedRow(), 4); table.setValueAt("已创建", table.getSelectedRow(), 4);
// 创建对象挂载 // 创建对象挂载
TCComponentItemType tccomponentitemtype = (TCComponentItemType)session.getTypeComponent("ZT2_COSTSHEET"); TCComponentItemType tccomponentitemtype = (TCComponentItemType) session
.getTypeComponent("ZT2_COSTSHEET");
String itemId = tccomponentitemtype.getNewID(); String itemId = tccomponentitemtype.getNewID();
String itemRev = tccomponentitemtype.getNewRev(null); String itemRev = tccomponentitemtype.getNewRev(null);
TCComponentItem item = tccomponentitemtype.create(itemId,itemRev,"ZT2_COSTSHEET","报价成本单","",null); TCComponentItem item = tccomponentitemtype.create(itemId, itemRev, "ZT2_COSTSHEET", "报价成本单", "",
null);
item.getLatestItemRevision().setProperty("zt2_cbdlx", "报价成本单"); item.getLatestItemRevision().setProperty("zt2_cbdlx", "报价成本单");
item.getLatestItemRevision().setProperty("object_desc", project.getStringProperty("item_id")); item.getLatestItemRevision().setProperty("object_desc", project.getStringProperty("item_id"));
// 挂在选中的文件夹下面 // 挂在选中的文件夹下面
f.add("contents", item); f.add("contents", item);
flag = true; flag = true;
// 查询表三的内容,表二的内容,注入窗口 // 查询表三的内容,表二的内容,注入窗口
String select1 = "SELECT * FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" WHERE \"tennumber\"='"+quotations.get(selectedRow).getTennumber()+"'"; String select1 = "SELECT * FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" WHERE \"tennumber\"='"
+ quotations.get(selectedRow).getTennumber() + "'";
System.out.println("select1:" + select1); System.out.println("select1:" + select1);
ResultSet resultSet1 = SqlUtil.read(select1); ResultSet resultSet1 = SqlUtil.read(select1);
while (resultSet1.next()) { while (resultSet1.next()) {
cusquotation = new Cusquotation(resultSet1.getString("cbdlx"),resultSet1.getString("projectid"),resultSet1.getString("revision"), cusquotation = new Cusquotation(resultSet1.getString("cbdlx"),
resultSet1.getString("proname"),resultSet1.getString("tennumber"),resultSet1.getString("promanager"),resultSet1.getString("quantity"), resultSet1.getString("projectid"), resultSet1.getString("revision"),
resultSet1.getString("tramodel"),resultSet1.getString("capfactor"),resultSet1.getString("volratio"),resultSet1.getString("noloadloss"), resultSet1.getString("proname"), resultSet1.getString("tennumber"),
resultSet1.getString("loadloss"),resultSet1.getString("impvoltage"),resultSet1.getString("traweight"),resultSet1.getString("totweight"), resultSet1.getString("promanager"), resultSet1.getString("quantity"),
QuotationUtil.formatString(resultSet1.getString("copconsumption")),QuotationUtil.formatString(resultSet1.getString("cmarketprice")),resultSet1.getString("vollevel"),resultSet1.getString("factory")); resultSet1.getString("tramodel"), 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"));
break; break;
} }
String select4 = "SELECT * FROM \"CHINT_ QUOTATION_ DETAILS_TEMPLATE\" WHERE \"tennumber\"='"+quotations.get(selectedRow).getTennumber()+"'"; String select4 = "SELECT * FROM \"CHINT_ QUOTATION_ DETAILS_TEMPLATE\" WHERE \"tennumber\"='"
+ quotations.get(selectedRow).getTennumber() + "'";
System.out.println("select4:" + select4); System.out.println("select4:" + select4);
ResultSet resultSet4 = SqlUtil.read(select4); ResultSet resultSet4 = SqlUtil.read(select4);
List<String> insertList = new ArrayList<String>(); List<String> insertList = new ArrayList<String>();
while (resultSet4.next()) { while (resultSet4.next()) {
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('"+ 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('"
"报价成本单"+"','"+ + "报价成本单" + "','" + project.getStringProperty("item_id") + "','" + "01" + "','"
project.getStringProperty("item_id")+"','"+ + resultSet4.getString("matgroup") + "','" + resultSet4.getString("mgsnumber") + "','"
"01"+"','"+ + resultSet4.getString("matcname") + "','" + resultSet4.getString("matcnumber") + "','"
resultSet4.getString("matgroup")+"','"+ + resultSet4.getString("matcatname") + "','" + resultSet4.getString("specifications")
resultSet4.getString("mgsnumber")+"','"+ + "','" + resultSet4.getString("manufacturer") + "','"
resultSet4.getString("matcname")+"','"+ + resultSet4.getString("nwquantity") + "','" + resultSet4.getString("utirate") + "','"
resultSet4.getString("matcnumber")+"','"+ + resultSet4.getString("unit") + "','" + resultSet4.getString("amomoney") + "','"
resultSet4.getString("matcatname")+"','"+ + resultSet4.getString("unitprice") + "','" + resultSet4.getString("no") + "','"
resultSet4.getString("specifications")+"','"+ + resultSet4.getString("totalprice") + "')";
resultSet4.getString("manufacturer")+"','"+
resultSet4.getString("nwquantity")+"','"+
resultSet4.getString("utirate")+"','"+
resultSet4.getString("unit")+"','"+
resultSet4.getString("amomoney")+"','"+
resultSet4.getString("unitprice")+"','"+
resultSet4.getString("no")+"','"+
resultSet4.getString("totalprice")+"')";
insertList.add(insert1); insertList.add(insert1);
} }
@ -167,7 +169,9 @@ public class ButtonCellEditor extends AbstractCellEditor implements TableCellEdi
SqlUtil.write(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"; 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); System.out.println("select2:" + select2);
ResultSet resultSet2 = SqlUtil.read(select2); ResultSet resultSet2 = SqlUtil.read(select2);
tableList = new ArrayList<QuotationMX>(); tableList = new ArrayList<QuotationMX>();
@ -183,14 +187,19 @@ public class ButtonCellEditor extends AbstractCellEditor implements TableCellEdi
quotationMX.setMatcatname(new SimpleStringProperty(resultSet2.getString("matcatname"))); quotationMX.setMatcatname(new SimpleStringProperty(resultSet2.getString("matcatname")));
quotationMX.setSpecifications(new SimpleStringProperty(resultSet2.getString("specifications"))); quotationMX.setSpecifications(new SimpleStringProperty(resultSet2.getString("specifications")));
quotationMX.setManufacturer(new SimpleStringProperty(resultSet2.getString("manufacturer"))); quotationMX.setManufacturer(new SimpleStringProperty(resultSet2.getString("manufacturer")));
quotationMX.setNwquantity(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("nwquantity")))); quotationMX.setNwquantity(new SimpleStringProperty(
quotationMX.setUtirate(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("utirate")))); QuotationUtil.formatString(resultSet2.getString("nwquantity"))));
quotationMX.setUtirate(
new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("utirate"))));
quotationMX.setUnit(new SimpleStringProperty(resultSet2.getString("unit"))); quotationMX.setUnit(new SimpleStringProperty(resultSet2.getString("unit")));
quotationMX.setAmomoney(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("amomoney")))); quotationMX.setAmomoney(
quotationMX.setUnitprice(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("unitprice")))); new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("amomoney"))));
quotationMX.setUnitprice(new SimpleStringProperty(
QuotationUtil.formatString(resultSet2.getString("unitprice"))));
quotationMX.setNo(new SimpleStringProperty(resultSet2.getString("no"))); quotationMX.setNo(new SimpleStringProperty(resultSet2.getString("no")));
quotationMX.setContrastPrice(new SimpleStringProperty("")); quotationMX.setContrastPrice(new SimpleStringProperty(""));
quotationMX.setTotalprice(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("totalprice")))); quotationMX.setTotalprice(new SimpleStringProperty(
QuotationUtil.formatString(resultSet2.getString("totalprice"))));
tableList.add(quotationMX); tableList.add(quotationMX);
} }
@ -204,11 +213,11 @@ public class ButtonCellEditor extends AbstractCellEditor implements TableCellEdi
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)) {
@ -218,8 +227,7 @@ public class ButtonCellEditor extends AbstractCellEditor implements TableCellEdi
} }
@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;
} }

@ -36,7 +36,9 @@ class ButtonCellRenderer extends DefaultTableCellRenderer implements TableCellRe
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) {
public ButtonCellRenderer(JTable jTable2, List<Quotation> quotations, TCSession session, TCComponent f,
JFrame frame) {
button = new JButton(); button = new JButton();
this.quotations = quotations; this.quotations = quotations;
this.table = jTable2; this.table = jTable2;
@ -44,15 +46,15 @@ class ButtonCellRenderer extends DefaultTableCellRenderer implements TableCellRe
this.f = f; this.f = f;
this.frame = frame; this.frame = frame;
} }
public interface CostPageCallback { public interface CostPageCallback {
void onOpenCostPage(); void onOpenCostPage();
} }
@Override @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
boolean hasFocus, int row, int column) { int row, int column) {
button.setText(value != null ? value.toString() : ""); button.setText(value != null ? value.toString() : "");
return button; return button;
} }
} }

@ -35,8 +35,8 @@ 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 {
@ -65,8 +65,7 @@ public class CostListManagementHandler extends AbstractHandler{
e1.printStackTrace(); e1.printStackTrace();
} }
/* /*
* 1-ZT2_COSTSHEET * 1-ZT2_COSTSHEET
*
*/ */
AIFComponentContext[] children = null; AIFComponentContext[] children = null;
try { try {
@ -96,7 +95,8 @@ public class CostListManagementHandler extends AbstractHandler{
if (children3 == null || children3.length == 0) { if (children3 == null || children3.length == 0) {
// 显示查询界面 // 显示查询界面
System.out.println("没有找到成本单对象,进入查询界面===============》》》》》》"); System.out.println("没有找到成本单对象,进入查询界面===============》》》》》》");
QueryQuotationFram queryQuotationFram = new QueryQuotationFram(session,component2); QueryQuotationFram queryQuotationFram = new QueryQuotationFram(session,
component2);
ButtonCellEditor.project = project; ButtonCellEditor.project = project;
session.queueOperation(queryQuotationFram); session.queueOperation(queryQuotationFram);
} }
@ -105,41 +105,65 @@ public class CostListManagementHandler extends AbstractHandler{
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("显示报价页面"); System.out.println("显示报价页面");
try { try {
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();
Connection conn = SqlUtil.getTCDataConnection(prefs); Connection 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) + "===============");
// 给Controller层外部变量赋值 // 给Controller层外部变量赋值
// 查询表三的内容,表二的内容,注入窗口 // 查询表三的内容,表二的内容,注入窗口
String select1 = "SELECT * FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" WHERE \"projectid\"='"+project.getStringProperty("item_id")+"' and \"cbdlx\" = '报价成本单' order by \"revision\" desc "; String select1 = "SELECT * FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" WHERE \"projectid\"='"
+ project.getStringProperty("item_id")
+ "' and \"cbdlx\" = '报价成本单' order by \"revision\" desc ";
System.out.println("select1:" + select1); System.out.println("select1:" + select1);
ResultSet resultSet1 = SqlUtil.read(select1); ResultSet resultSet1 = SqlUtil.read(select1);
Cusquotation cusquotation = null; Cusquotation cusquotation = null;
String tennumber = ""; 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"),
resultSet1.getString("tennumber"),
resultSet1.getString("promanager"),
resultSet1.getString("quantity"),
resultSet1.getString("tramodel"),
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"); tennumber = resultSet1.getString("tennumber");
break; break;
} }
ButtonCellEditor.cusquotation = cusquotation; ButtonCellEditor.cusquotation = cusquotation;
ButtonCellEditor.session = session; ButtonCellEditor.session = session;
// 查询最高版本 // 查询最高版本
// 开始刷新对比结果数据 // 开始刷新对比结果数据
// 获取数据库该类型成本单最新的版本 // 获取数据库该类型成本单最新的版本
String getLastRevSql1 = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"+project.getStringProperty("item_id")+"' and \"cbdlx\" = '" + "报价成本单" + "' order by \"revision\" desc" ; 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); System.out.println("getLastRevSql:" + getLastRevSql1);
List<String> revList = new ArrayList<String>(); List<String> revList = new ArrayList<String>();
try { try {
@ -152,8 +176,11 @@ public class CostListManagementHandler extends AbstractHandler{
e1.printStackTrace(); e1.printStackTrace();
} }
String select2 = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"
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"; + 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";
System.out.println("select2:" + select2); System.out.println("select2:" + select2);
ResultSet resultSet2 = SqlUtil.read(select2); ResultSet resultSet2 = SqlUtil.read(select2);
List<QuotationMX> tableList = new ArrayList<QuotationMX>(); List<QuotationMX> tableList = new ArrayList<QuotationMX>();
@ -162,21 +189,40 @@ public class CostListManagementHandler extends AbstractHandler{
quotationMX.setCbdlx(resultSet2.getString("cbdlx")); quotationMX.setCbdlx(resultSet2.getString("cbdlx"));
quotationMX.setProjectid(resultSet2.getString("projectid")); quotationMX.setProjectid(resultSet2.getString("projectid"));
quotationMX.setRevision(resultSet2.getString("revision")); quotationMX.setRevision(resultSet2.getString("revision"));
quotationMX.setMatgroup(new SimpleStringProperty(resultSet2.getString("matgroup"))); quotationMX.setMatgroup(new SimpleStringProperty(
quotationMX.setMgsnumber(new SimpleStringProperty(resultSet2.getString("mgsnumber"))); resultSet2.getString("matgroup")));
quotationMX.setMatcname(new SimpleStringProperty(resultSet2.getString("matcname"))); quotationMX.setMgsnumber(new SimpleStringProperty(
quotationMX.setMatcnumber(new SimpleStringProperty(resultSet2.getString("matcnumber"))); resultSet2.getString("mgsnumber")));
quotationMX.setMatcatname(new SimpleStringProperty(resultSet2.getString("Matcatname"))); quotationMX.setMatcname(new SimpleStringProperty(
quotationMX.setSpecifications(new SimpleStringProperty(resultSet2.getString("specifications"))); resultSet2.getString("matcname")));
quotationMX.setManufacturer(new SimpleStringProperty(resultSet2.getString("manufacturer"))); quotationMX.setMatcnumber(new SimpleStringProperty(
quotationMX.setNwquantity(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("nwquantity")))); resultSet2.getString("matcnumber")));
quotationMX.setUtirate(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("utirate")))); quotationMX.setMatcatname(new SimpleStringProperty(
quotationMX.setUnit(new SimpleStringProperty(resultSet2.getString("unit"))); resultSet2.getString("Matcatname")));
quotationMX.setAmomoney(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("amomoney")))); quotationMX.setSpecifications(new SimpleStringProperty(
quotationMX.setUnitprice(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("unitprice")))); resultSet2.getString("specifications")));
quotationMX.setNo(new SimpleStringProperty(resultSet2.getString("no"))); 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.setContrastPrice(new SimpleStringProperty(""));
quotationMX.setTotalprice(new SimpleStringProperty(QuotationUtil.formatString(resultSet2.getString("totalprice")))); quotationMX.setTotalprice(
new SimpleStringProperty(QuotationUtil.formatString(
resultSet2.getString("totalprice"))));
tableList.add(quotationMX); tableList.add(quotationMX);
} }
@ -196,7 +242,8 @@ public class CostListManagementHandler extends AbstractHandler{
if (count == children3.length) { if (count == children3.length) {
// 显示查询界面 // 显示查询界面
System.out.println("没有找到成本单对象,进入查询界面===============》》》》》》"); System.out.println("没有找到成本单对象,进入查询界面===============》》》》》》");
QueryQuotationFram queryQuotationFram = new QueryQuotationFram(session,component2); QueryQuotationFram queryQuotationFram = new QueryQuotationFram(
session, component2);
session.queueOperation(queryQuotationFram); session.queueOperation(queryQuotationFram);
ButtonCellEditor.project = project; ButtonCellEditor.project = project;
} }
@ -215,8 +262,6 @@ public class CostListManagementHandler extends AbstractHandler{
MessageBox.post("请选择TC对象操作", "提示", MessageBox.INFORMATION); MessageBox.post("请选择TC对象操作", "提示", MessageBox.INFORMATION);
} }
} }
}.start(); }.start();
} catch (Exception e) { } catch (Exception e) {

@ -40,13 +40,14 @@ import com.teamcenter.rac.util.MessageBox;
*/ */
public class NewJFrame extends javax.swing.JFrame { public class NewJFrame extends javax.swing.JFrame {
private TCSession session; private TCSession session;
private Connection conn; private Connection conn;
private TCComponent f; private TCComponent f;
private JFrame frame; 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) {
@ -109,17 +110,11 @@ 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));
@ -181,7 +176,6 @@ public class NewJFrame extends javax.swing.JFrame {
@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);
@ -230,10 +224,6 @@ public class NewJFrame extends javax.swing.JFrame {
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>();
if(!res.next()) {
MessageBox.post("未查询到匹配的数据", "提示", MessageBox.INFORMATION);
return;
}
while (res.next()) { while (res.next()) {
Quotation quotation = new Quotation( Quotation quotation = new Quotation(
res.getString("technical") != null ? res.getString("technical") : "", res.getString("technical") != null ? res.getString("technical") : "",
@ -254,10 +244,13 @@ public class NewJFrame extends javax.swing.JFrame {
res.getString("cmarketprice") != null ? res.getString("cmarketprice") : "", res.getString("cmarketprice") != null ? res.getString("cmarketprice") : "",
res.getString("vollevel") != null ? res.getString("vollevel") : "", res.getString("vollevel") != null ? res.getString("vollevel") : "",
res.getString("rectime") != null ? res.getString("rectime") : "", res.getString("rectime") != null ? res.getString("rectime") : "",
res.getString("state") != null ? res.getString("state") : "" res.getString("state") != null ? res.getString("state") : "");
);
quotations.add(quotation); quotations.add(quotation);
} }
if (quotations.size() == 0) {
MessageBox.post("未查询到匹配的数据", "提示", MessageBox.INFORMATION);
return;
}
// 将数据插入到表格 // 将数据插入到表格
String[] title = new String[] { "序号", "投标编号", "技术评审表", "创建报价成本单", "状态" }; String[] title = new String[] { "序号", "投标编号", "技术评审表", "创建报价成本单", "状态" };
// DefaultTableModel model = new DefaultTableModel(new Object [][] {},title); // DefaultTableModel model = new DefaultTableModel(new Object [][] {},title);
@ -271,7 +264,6 @@ public class NewJFrame extends javax.swing.JFrame {
} }
}; };
// 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) {
// // 重写isCellEditable方法禁止第一列 第二列 第五列单元格编辑 // // 重写isCellEditable方法禁止第一列 第二列 第五列单元格编辑
@ -298,16 +290,19 @@ public class NewJFrame extends javax.swing.JFrame {
// 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));
jTable2.getColumnModel().getColumn(3)
.setCellRenderer(new ButtonCellRenderer(jTable2, quotations, session, f, frame));
jTable2.getColumnModel().getColumn(3)
.setCellEditor(new ButtonCellEditor(jTable2, quotations, session, f, frame));
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
} }
}); });
@ -321,146 +316,174 @@ 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)
.addComponent(jLabel2)
.addComponent(jLabel5))
.addGap(27, 27, 27)) .addGap(27, 27, 27))
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup().addComponent(jLabel7)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField2,
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) javax.swing.GroupLayout.PREFERRED_SIZE, 150,
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField13, 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) .addGap(111, 111, 111)
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField12,
javax.swing.GroupLayout.PREFERRED_SIZE, 98,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap()) .addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
.addGap(84, 84, 84) .addGap(84, 84, 84).addComponent(jLabel13)
.addComponent(jLabel13)
.addGap(0, 0, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup().addPreferredGap(
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) javax.swing.LayoutStyle.ComponentPlacement.RELATED,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel11) .addGroup(jPanel1Layout.createParallelGroup(
.addComponent(jLabel12) javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel10) .addComponent(jLabel11).addComponent(jLabel12)
.addComponent(jLabel9) .addComponent(jLabel10).addComponent(jLabel9)
.addComponent(jLabel8) .addComponent(jLabel8).addComponent(jLabel15))
.addComponent(jLabel15))
.addGap(18, 18, 18) .addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel1Layout.createParallelGroup(
.addComponent(jTextField8) javax.swing.GroupLayout.Alignment.LEADING,
false).addComponent(jTextField8)
.addComponent(jTextField7) .addComponent(jTextField7)
.addComponent(jTextField9) .addComponent(jTextField9)
.addComponent(jTextField10, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) .addComponent(jTextField10,
javax.swing.GroupLayout.DEFAULT_SIZE,
150, Short.MAX_VALUE)
.addComponent(jTextField11) .addComponent(jTextField11)
.addComponent(jTextField14)) .addComponent(jTextField14))
.addGap(108, 108, 108)))) .addGap(108, 108, 108))))
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 150,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))) .addGap(0, 0, Short.MAX_VALUE))))
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6) .addComponent(jLabel6).addComponent(jLabel14))
.addComponent(jLabel14))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel1Layout
.addComponent(jTextField4) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField5) .addComponent(jTextField4).addComponent(jTextField5).addComponent(jTextField13,
.addComponent(jTextField13, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)) javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
.addGap(0, 0, Short.MAX_VALUE)))) .addGap(0, 0, Short.MAX_VALUE))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(690, Short.MAX_VALUE) .addContainerGap(690, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
.addComponent(jButton1) jPanel1Layout.createSequentialGroup().addComponent(jButton1).addContainerGap())
.addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .createSequentialGroup().addComponent(jButton2).addGap(67, 67, 67)))));
.addComponent(jButton2) jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(67, 67, 67)))) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
); .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
jPanel1Layout.setVerticalGroup( .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel2)
.addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
.addContainerGap() javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel8).addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE,
.addGroup(jPanel1Layout.createSequentialGroup() javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8)
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(24, 24, 24) .addGap(24, 24, 24)
.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
.addComponent(jLabel3) .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel3).addComponent(jTextField2,
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jLabel9) javax.swing.GroupLayout.DEFAULT_SIZE,
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9).addComponent(jTextField7,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(21, 21, 21) .addGap(21, 21, 21)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4) .addComponent(jLabel4)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jLabel10) javax.swing.GroupLayout.DEFAULT_SIZE,
.addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_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) .addGap(25, 25, 25)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5) .addComponent(jLabel5)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jLabel11) javax.swing.GroupLayout.DEFAULT_SIZE,
.addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_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) .addGap(24, 24, 24)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6) .addComponent(jLabel6)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jLabel12) javax.swing.GroupLayout.DEFAULT_SIZE,
.addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_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) .addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .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(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jLabel15) javax.swing.GroupLayout.DEFAULT_SIZE,
.addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14)) .addComponent(jLabel15).addComponent(jTextField14,
.addGap(18, 18, 18) javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jButton2) javax.swing.GroupLayout.DEFAULT_SIZE,
.addGap(359, 359, 359) 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(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE,
.addComponent(jLabel13) javax.swing.GroupLayout.DEFAULT_SIZE,
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_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)) .addComponent(jLabel7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
.addComponent(jButton1) javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap()) .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));
@ -471,37 +494,35 @@ public class NewJFrame extends javax.swing.JFrame {
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()
.addGap(20, 20, 20)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel2, 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(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
.addContainerGap(35, Short.MAX_VALUE)) javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
); .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 271,
layout.setVerticalGroup( javax.swing.GroupLayout.PREFERRED_SIZE))
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addContainerGap(35, Short.MAX_VALUE)));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
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,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 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()) {

@ -11,6 +11,7 @@ public class QueryQuotationFram extends AbstractAIFOperation{
TCSession session; TCSession session;
private TCComponent f; private TCComponent f;
public QueryQuotationFram(TCSession session, TCComponent component2) { public QueryQuotationFram(TCSession session, TCComponent component2) {
this.f = component2; this.f = component2;
this.session = session; this.session = session;

@ -20,6 +20,7 @@ public class Cusquotation {
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, 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 promanager, String quantity, String tramodel, String capfactor, String volratio, String noloadloss,
String loadloss, String impvoltage, String traweight, String totweight, String copconsumption, String loadloss, String impvoltage, String traweight, String totweight, String copconsumption,
@ -45,111 +46,147 @@ public class Cusquotation {
this.vollevel = vollevel; this.vollevel = vollevel;
this.factory = factory; this.factory = factory;
} }
public String getCbdlx() { public String getCbdlx() {
return cbdlx; return cbdlx;
} }
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 getProname() { public String getProname() {
return proname; return proname;
} }
public void setProname(String proname) { public void setProname(String proname) {
this.proname = proname; this.proname = proname;
} }
public String getTennumber() { public String getTennumber() {
return tennumber; return tennumber;
} }
public void setTennumber(String tennumber) { public void setTennumber(String tennumber) {
this.tennumber = tennumber; this.tennumber = tennumber;
} }
public String getPromanager() { public String getPromanager() {
return promanager; return promanager;
} }
public void setPromanager(String promanager) { public void setPromanager(String promanager) {
this.promanager = promanager; this.promanager = promanager;
} }
public String getQuantity() { public String getQuantity() {
return quantity; return quantity;
} }
public void setQuantity(String quantity) { public void setQuantity(String quantity) {
this.quantity = quantity; this.quantity = quantity;
} }
public String getTramodel() { public String getTramodel() {
return tramodel; return tramodel;
} }
public void setTramodel(String tramodel) { public void setTramodel(String tramodel) {
this.tramodel = tramodel; this.tramodel = tramodel;
} }
public String getCapfactor() { public String getCapfactor() {
return capfactor; return capfactor;
} }
public void setCapfactor(String capfactor) { public void setCapfactor(String capfactor) {
this.capfactor = capfactor; this.capfactor = capfactor;
} }
public String getVolratio() { public String getVolratio() {
return volratio; return volratio;
} }
public void setVolratio(String volratio) { public void setVolratio(String volratio) {
this.volratio = volratio; this.volratio = volratio;
} }
public String getNoloadloss() { public String getNoloadloss() {
return noloadloss; return noloadloss;
} }
public void setNoloadloss(String noloadloss) { public void setNoloadloss(String noloadloss) {
this.noloadloss = noloadloss; this.noloadloss = noloadloss;
} }
public String getLoadloss() { public String getLoadloss() {
return loadloss; return loadloss;
} }
public void setLoadloss(String loadloss) { public void setLoadloss(String loadloss) {
this.loadloss = loadloss; this.loadloss = loadloss;
} }
public String getImpvoltage() { public String getImpvoltage() {
return impvoltage; return impvoltage;
} }
public void setImpvoltage(String impvoltage) { public void setImpvoltage(String impvoltage) {
this.impvoltage = impvoltage; this.impvoltage = impvoltage;
} }
public String getTraweight() { public String getTraweight() {
return traweight; return traweight;
} }
public void setTraweight(String traweight) { public void setTraweight(String traweight) {
this.traweight = traweight; this.traweight = traweight;
} }
public String getTotweight() { public String getTotweight() {
return totweight; return totweight;
} }
public void setTotweight(String totweight) { public void setTotweight(String totweight) {
this.totweight = totweight; this.totweight = totweight;
} }
public String getCopconsumption() { public String getCopconsumption() {
return copconsumption; return copconsumption;
} }
public void setCopconsumption(String copconsumption) { public void setCopconsumption(String copconsumption) {
this.copconsumption = copconsumption; this.copconsumption = copconsumption;
} }
public String getCmarketprice() { public String getCmarketprice() {
return cmarketprice; return cmarketprice;
} }
public void setCmarketprice(String cmarketprice) { public void setCmarketprice(String cmarketprice) {
this.cmarketprice = cmarketprice; this.cmarketprice = cmarketprice;
} }
public String getVollevel() { public String getVollevel() {
return vollevel; return vollevel;
} }
public void setVollevel(String vollevel) { public void setVollevel(String vollevel) {
this.vollevel = vollevel; this.vollevel = vollevel;
} }
@ -157,9 +194,11 @@ public class Cusquotation {
public String getFactory() { public String getFactory() {
return factory; return factory;
} }
public void setFactory(String factory) { public void setFactory(String factory) {
this.factory = factory; this.factory = factory;
} }
@Override @Override
public String toString() { public String toString() {
return "Cusquotation [cbdlx=" + cbdlx + ", projectid=" + projectid + ", revision=" + revision + ", proname=" return "Cusquotation [cbdlx=" + cbdlx + ", projectid=" + projectid + ", revision=" + revision + ", proname="
@ -170,7 +209,4 @@ public class Cusquotation {
+ ", vollevel=" + vollevel + ", factory=" + factory + "]"; + ", vollevel=" + vollevel + ", factory=" + factory + "]";
} }
} }

@ -16,182 +16,122 @@ public class GzxqBean {
private String link; private String link;
private String state; private String state;
public GzxqBean() { public GzxqBean() {
super(); super();
} }
public String getInstanceId() { public String getInstanceId() {
return instanceId; return instanceId;
} }
public void setInstanceId(String instanceId) { public void setInstanceId(String instanceId) {
this.instanceId = instanceId; this.instanceId = instanceId;
} }
public String getFactory() { public String getFactory() {
return factory; return factory;
} }
public void setFactory(String factory) { public void setFactory(String factory) {
this.factory = factory; this.factory = factory;
} }
public String getSfId() { public String getSfId() {
return sfId; return sfId;
} }
public void setSfId(String sfId) { public void setSfId(String sfId) {
this.sfId = sfId; this.sfId = sfId;
} }
public String getHead() { public String getHead() {
return head; return head;
} }
public void setHead(String head) { public void setHead(String head) {
this.head = head; this.head = head;
} }
public String getScheduledtime() { public String getScheduledtime() {
return scheduledtime; return scheduledtime;
} }
public void setScheduledtime(String scheduledtime) { public void setScheduledtime(String scheduledtime) {
this.scheduledtime = scheduledtime; this.scheduledtime = scheduledtime;
} }
public String getModel() { public String getModel() {
return model; return model;
} }
public void setModel(String model) { public void setModel(String model) {
this.model = model; this.model = model;
} }
public String getProductname() { public String getProductname() {
return productname; return productname;
} }
public void setProductname(String productname) { public void setProductname(String productname) {
this.productname = productname; this.productname = productname;
} }
public String getToolnumber() { public String getToolnumber() {
return toolnumber; return toolnumber;
} }
public void setToolnumber(String toolnumber) { public void setToolnumber(String toolnumber) {
this.toolnumber = toolnumber; this.toolnumber = toolnumber;
} }
public String getToolname() { public String getToolname() {
return toolname; return toolname;
} }
public void setToolname(String toolname) { public void setToolname(String toolname) {
this.toolname = toolname; this.toolname = toolname;
} }
public String getToolinglevel() { public String getToolinglevel() {
return toolinglevel; return toolinglevel;
} }
public void setToolinglevel(String toolinglevel) { public void setToolinglevel(String toolinglevel) {
this.toolinglevel = toolinglevel; this.toolinglevel = toolinglevel;
} }
public String getReason() { public String getReason() {
return reason; return reason;
} }
public void setReason(String reason) { public void setReason(String reason) {
this.reason = reason; this.reason = reason;
} }
public String getJsgyrequirements() { public String getJsgyrequirements() {
return jsgyrequirements; return jsgyrequirements;
} }
public void setJsgyrequirements(String jsgyrequirements) { public void setJsgyrequirements(String jsgyrequirements) {
this.jsgyrequirements = jsgyrequirements; this.jsgyrequirements = jsgyrequirements;
} }
public String getLink() { public String getLink() {
return link; return link;
} }
public void setLink(String link) { public void setLink(String link) {
this.link = link; this.link = link;
} }
public String getState() { public String getState() {
return state; return state;
} }
public void setState(String state) { public void setState(String state) {
this.state = state; this.state = state;
} }
public GzxqBean(String instanceId, String factory, String sfId, String head, String scheduledtime, String model, 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 productname, String toolnumber, String toolname, String toolinglevel, String reason,
String jsgyrequirements, String link, String state) { String jsgyrequirements, String link, String state) {
@ -212,8 +152,6 @@ public class GzxqBean {
this.state = state; this.state = state;
} }
@Override @Override
public String toString() { public String toString() {
return "GzxqBean [instanceId=" + instanceId + ", factory=" + factory + ", sfId=" + sfId + ", head=" + head return "GzxqBean [instanceId=" + instanceId + ", factory=" + factory + ", sfId=" + sfId + ", head=" + head
@ -223,10 +161,4 @@ public class GzxqBean {
+ state + "]"; + state + "]";
} }
} }

@ -23,14 +23,14 @@ public class Quotation {
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,
String promanager, String quantity, String tramodel, String capfactor, String volratio, String noloadloss, public Quotation(String technical, String factory, String proname, String tennumber, String promanager,
String loadloss, String impvoltage, String traweight, String totweight, String copconsumption, String quantity, String tramodel, String capfactor, String volratio, String noloadloss, String loadloss,
String cmarketprice, String vollevel, String rectime, String state) { String impvoltage, String traweight, String totweight, String copconsumption, String cmarketprice,
String vollevel, String rectime, String state) {
super(); super();
this.technical = technical; this.technical = technical;
this.factory = factory; this.factory = factory;
@ -52,129 +52,167 @@ public class Quotation {
this.rectime = rectime; this.rectime = rectime;
this.state = state; this.state = state;
} }
public String getTechnical() { public String getTechnical() {
return technical; return technical;
} }
public void setTechnical(String technical) { public void setTechnical(String technical) {
this.technical = technical; this.technical = technical;
} }
public String getFactory() { public String getFactory() {
return factory; return factory;
} }
public void setFactory(String factory) { public void setFactory(String factory) {
this.factory = factory; this.factory = factory;
} }
public String getProname() { public String getProname() {
return proname; return proname;
} }
public void setProname(String proname) { public void setProname(String proname) {
this.proname = proname; this.proname = proname;
} }
public String getTennumber() { public String getTennumber() {
return tennumber; return tennumber;
} }
public void setTennumber(String tennumber) { public void setTennumber(String tennumber) {
this.tennumber = tennumber; this.tennumber = tennumber;
} }
public String getPromanager() { public String getPromanager() {
return promanager; return promanager;
} }
public void setPromanager(String promanager) { public void setPromanager(String promanager) {
this.promanager = promanager; this.promanager = promanager;
} }
public String getQuantity() { public String getQuantity() {
return quantity; return quantity;
} }
public void setQuantity(String quantity) { public void setQuantity(String quantity) {
this.quantity = quantity; this.quantity = quantity;
} }
public String getTramodel() { public String getTramodel() {
return tramodel; return tramodel;
} }
public void setTramodel(String tramodel) { public void setTramodel(String tramodel) {
this.tramodel = tramodel; this.tramodel = tramodel;
} }
public String getCapfactor() { public String getCapfactor() {
return capfactor; return capfactor;
} }
public void setCapfactor(String capfactor) { public void setCapfactor(String capfactor) {
this.capfactor = capfactor; this.capfactor = capfactor;
} }
public String getVolratio() { public String getVolratio() {
return volratio; return volratio;
} }
public void setVolratio(String volratio) { public void setVolratio(String volratio) {
this.volratio = volratio; this.volratio = volratio;
} }
public String getNoloadloss() { public String getNoloadloss() {
return noloadloss; return noloadloss;
} }
public void setNoloadloss(String noloadloss) { public void setNoloadloss(String noloadloss) {
this.noloadloss = noloadloss; this.noloadloss = noloadloss;
} }
public String getLoadloss() { public String getLoadloss() {
return loadloss; return loadloss;
} }
public void setLoadloss(String loadloss) { public void setLoadloss(String loadloss) {
this.loadloss = loadloss; this.loadloss = loadloss;
} }
public String getImpvoltage() { public String getImpvoltage() {
return impvoltage; return impvoltage;
} }
public void setImpvoltage(String impvoltage) { public void setImpvoltage(String impvoltage) {
this.impvoltage = impvoltage; this.impvoltage = impvoltage;
} }
public String getTraweight() { public String getTraweight() {
return traweight; return traweight;
} }
public void setTraweight(String traweight) { public void setTraweight(String traweight) {
this.traweight = traweight; this.traweight = traweight;
} }
public String getTotweight() { public String getTotweight() {
return totweight; return totweight;
} }
public void setTotweight(String totweight) { public void setTotweight(String totweight) {
this.totweight = totweight; this.totweight = totweight;
} }
public String getCopconsumption() { public String getCopconsumption() {
return copconsumption; return copconsumption;
} }
public void setCopconsumption(String copconsumption) { public void setCopconsumption(String copconsumption) {
this.copconsumption = copconsumption; this.copconsumption = copconsumption;
} }
public String getCmarketprice() { public String getCmarketprice() {
return cmarketprice; return cmarketprice;
} }
public void setCmarketprice(String cmarketprice) { public void setCmarketprice(String cmarketprice) {
this.cmarketprice = cmarketprice; this.cmarketprice = cmarketprice;
} }
public String getVollevel() { public String getVollevel() {
return vollevel; return vollevel;
} }
public void setVollevel(String vollevel) { public void setVollevel(String vollevel) {
this.vollevel = vollevel; this.vollevel = vollevel;
} }
public String getRectime() { public String getRectime() {
return rectime; return rectime;
} }
public void setRectime(String rectime) { public void setRectime(String rectime) {
this.rectime = rectime; this.rectime = rectime;
} }
public String getState() { public String getState() {
return state; return state;
} }
public void setState(String state) { public void setState(String state) {
this.state = state; this.state = state;
} }
@Override @Override
public String toString() { public String toString() {
return "Quotation [technical=" + technical + ", totalprice=" + ", factory=" + factory return "Quotation [technical=" + technical + ", totalprice=" + ", factory=" + factory + ", proname=" + proname
+ ", proname=" + proname + ", tennumber=" + tennumber + ", promanager=" + promanager + ", quantity=" + ", tennumber=" + tennumber + ", promanager=" + promanager + ", quantity=" + quantity + ", tramodel="
+ quantity + ", tramodel=" + tramodel + ", capfactor=" + capfactor + ", volratio=" + volratio + tramodel + ", capfactor=" + capfactor + ", volratio=" + volratio + ", noloadloss=" + noloadloss
+ ", noloadloss=" + noloadloss + ", loadloss=" + loadloss + ", impvoltage=" + impvoltage + ", loadloss=" + loadloss + ", impvoltage=" + impvoltage + ", traweight=" + traweight + ", totweight="
+ ", traweight=" + traweight + ", totweight=" + totweight + ", copconsumption=" + copconsumption + totweight + ", copconsumption=" + copconsumption + ", cmarketprice=" + cmarketprice + ", vollevel="
+ ", cmarketprice=" + cmarketprice + ", vollevel=" + vollevel + ", rectime=" + rectime + ", state=" + vollevel + ", rectime=" + rectime + ", state=" + state + "]";
+ state + "]";
} }
} }

@ -22,6 +22,7 @@ public class QuotationMX {
private SimpleStringProperty no; private SimpleStringProperty no;
private SimpleStringProperty totalprice; private SimpleStringProperty totalprice;
private SimpleStringProperty contrastPrice; private SimpleStringProperty contrastPrice;
public QuotationMX() { public QuotationMX() {
super(); super();
} }
@ -34,7 +35,6 @@ public class QuotationMX {
return contrastPrice.get(); return contrastPrice.get();
} }
public void setContrastPrice(SimpleStringProperty contrastPrice) { public void setContrastPrice(SimpleStringProperty contrastPrice) {
this.contrastPrice = contrastPrice; this.contrastPrice = contrastPrice;
} }
@ -51,7 +51,6 @@ public class QuotationMX {
this.projectid = projectid; this.projectid = projectid;
} }
public String getRevision() { public String getRevision() {
return revision; return revision;
} }
@ -60,25 +59,18 @@ public class QuotationMX {
this.revision = revision; this.revision = revision;
} }
public String getMatgroup() { public String getMatgroup() {
return matgroup.get(); return matgroup.get();
} }
public void setMatgroup(SimpleStringProperty matgroup) { public void setMatgroup(SimpleStringProperty matgroup) {
this.matgroup = matgroup; this.matgroup = matgroup;
} }
public String getMgsnumber() { public String getMgsnumber() {
return mgsnumber.get(); return mgsnumber.get();
} }
public void setMgsnumber(SimpleStringProperty mgsnumber) { public void setMgsnumber(SimpleStringProperty mgsnumber) {
this.mgsnumber = mgsnumber; this.mgsnumber = mgsnumber;
} }
@ -91,11 +83,6 @@ public class QuotationMX {
this.materialNameColumn = matcname; this.materialNameColumn = matcname;
} }
public String getMatcnumber() { public String getMatcnumber() {
return matcnumber.get(); return matcnumber.get();
} }
@ -104,195 +91,93 @@ public class QuotationMX {
this.matcnumber = matcnumber; this.matcnumber = matcnumber;
} }
public String getMatcatname() { public String getMatcatname() {
return relatedMaterialColumn.get(); return relatedMaterialColumn.get();
} }
public void setMatcatname(SimpleStringProperty matcatname) { public void setMatcatname(SimpleStringProperty matcatname) {
this.relatedMaterialColumn = matcatname; this.relatedMaterialColumn = matcatname;
} }
public String getSpecifications() { public String getSpecifications() {
return specificationColumn.get(); return specificationColumn.get();
} }
public void setSpecifications(SimpleStringProperty specifications) { public void setSpecifications(SimpleStringProperty specifications) {
this.specificationColumn = specifications; this.specificationColumn = specifications;
} }
public String getManufacturer() { public String getManufacturer() {
return manufacturerColumn.get(); return manufacturerColumn.get();
} }
public void setManufacturer(SimpleStringProperty manufacturer) { public void setManufacturer(SimpleStringProperty manufacturer) {
this.manufacturerColumn = manufacturer; this.manufacturerColumn = manufacturer;
} }
public String getNwquantity() { public String getNwquantity() {
return quantityColumn.get(); return quantityColumn.get();
} }
public void setNwquantity(SimpleStringProperty nwquantity) { public void setNwquantity(SimpleStringProperty nwquantity) {
this.quantityColumn = nwquantity; this.quantityColumn = nwquantity;
} }
public String getUtirate() { public String getUtirate() {
return utilizationRateColumn.get(); return utilizationRateColumn.get();
} }
public void setUtirate(SimpleStringProperty utirate) { public void setUtirate(SimpleStringProperty utirate) {
this.utilizationRateColumn = utirate; this.utilizationRateColumn = utirate;
} }
public String getUnit() { public String getUnit() {
return unitColumn.get(); return unitColumn.get();
} }
public void setUnit(SimpleStringProperty unit) { public void setUnit(SimpleStringProperty unit) {
this.unitColumn = unit; this.unitColumn = unit;
} }
public String getAmomoney() { public String getAmomoney() {
return amomoney.get(); return amomoney.get();
} }
public void setAmomoney(SimpleStringProperty amomoney) { public void setAmomoney(SimpleStringProperty amomoney) {
this.amomoney = amomoney; this.amomoney = amomoney;
} }
public String getUnitprice() { public String getUnitprice() {
return unitPriceColumn.get(); return unitPriceColumn.get();
} }
public void setUnitprice(SimpleStringProperty unitprice) { public void setUnitprice(SimpleStringProperty unitprice) {
this.unitPriceColumn = unitprice; this.unitPriceColumn = unitprice;
} }
public String getNo() { public String getNo() {
return no.get(); return no.get();
} }
public void setNo(SimpleStringProperty no) { public void setNo(SimpleStringProperty no) {
this.no = no; this.no = no;
} }
public String getTotalprice() { public String getTotalprice() {
return totalprice.get(); return totalprice.get();
} }
public void setTotalprice(SimpleStringProperty totalprice) { public void setTotalprice(SimpleStringProperty totalprice) {
this.totalprice = totalprice; this.totalprice = totalprice;
} }
@Override @Override
public String toString() { public String toString() {
return "QuotationMX [matgroup=" + matgroup + ", mgsnumber=" + mgsnumber return "QuotationMX [matgroup=" + matgroup + ", mgsnumber=" + mgsnumber + ", matcname=" + materialNameColumn
+ ", matcname=" + materialNameColumn + ", matcnumber=" + matcnumber + ", matcatname=" + relatedMaterialColumn + ", matcnumber=" + matcnumber + ", matcatname=" + relatedMaterialColumn + ", specifications="
+ ", specifications=" + specificationColumn + ", manufacturer=" + manufacturerColumn + ", nwquantity=" + quantityColumn + specificationColumn + ", manufacturer=" + manufacturerColumn + ", nwquantity=" + quantityColumn
+ ", utirate=" + utilizationRateColumn + ", unit=" + unitColumn + ", amomoney=" + amomoney + ", unitprice=" + unitPriceColumn + ", utirate=" + utilizationRateColumn + ", unit=" + unitColumn + ", amomoney=" + amomoney
+ ", no=" + no + ", totalprice=" + totalprice + "]"; + ", unitprice=" + unitPriceColumn + ", no=" + no + ", totalprice=" + totalprice + "]";
} }
} }

@ -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("开始利用反射将数据写入对象");

@ -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("开始利用反射将数据写入对象");

@ -15,8 +15,6 @@ import javafx.scene.Scene;
public class JDBFrame extends KFrame { public class JDBFrame extends KFrame {
private Quotation quotation; private Quotation quotation;
@Override @Override
protected void initUI() throws Exception { protected void initUI() throws Exception {
this.setTitle("变压器投标成本单"); this.setTitle("变压器投标成本单");

@ -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 { public class JDBfxPanel extends KFXPanel {
private Quotation quotation; private Quotation quotation;
public JDBfxPanel(Window dialog) { public JDBfxPanel(Window dialog) {
super(dialog); super(dialog);
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
} }

@ -25,9 +25,6 @@ public abstract class KFXPanel extends Application {
private FXMLLoader fxmlLoader; private FXMLLoader fxmlLoader;
static { static {
Platform.setImplicitExit(false); Platform.setImplicitExit(false);
// Logging.getCSSLogger().setLevel(Platform.class...STYLESHEET_CASPIAN....Level.OFF); // Logging.getCSSLogger().setLevel(Platform.class...STYLESHEET_CASPIAN....Level.OFF);
@ -111,6 +108,7 @@ public abstract class KFXPanel extends Application {
MessageBox.post(dialog, msg, title, msgType); 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();
@ -124,5 +122,4 @@ public abstract class KFXPanel extends Application {
launch(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;

@ -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,7 +17,6 @@ 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 {

@ -60,7 +60,6 @@ public class MyController extends KFXPanelController {
private List<String> DbnoList = null; private List<String> DbnoList = null;
private List<String> dbtotalpriceList = null; private List<String> dbtotalpriceList = null;
@FXML @FXML
private AnchorPane coverPane; private AnchorPane coverPane;
@ -245,7 +244,6 @@ public class MyController extends KFXPanelController {
private String rev = "01"; private String rev = "01";
public void editWrite() { public void editWrite() {
materialsTable.setEditable(true); materialsTable.setEditable(true);
// 头表 // 头表
@ -287,8 +285,7 @@ public class MyController extends KFXPanelController {
if (contrastPrice == 0) { if (contrastPrice == 0) {
// 不做格式 // 不做格式
setStyle(""); setStyle("");
} } else if (contrastPrice < 0) {
else if (contrastPrice < 0) {
setStyle("-fx-background-color: #FF6600;"); setStyle("-fx-background-color: #FF6600;");
} else { } else {
setStyle("-fx-background-color: #A9D08E;"); setStyle("-fx-background-color: #A9D08E;");
@ -348,8 +345,7 @@ public class MyController extends KFXPanelController {
if (contrastPrice == 0) { if (contrastPrice == 0) {
// 不做格式 // 不做格式
setStyle(""); setStyle("");
} } else if (contrastPrice < 0) {
else if (contrastPrice < 0) {
setStyle("-fx-background-color: #FF6600;"); setStyle("-fx-background-color: #FF6600;");
} else { } else {
setStyle("-fx-background-color: #A9D08E;"); setStyle("-fx-background-color: #A9D08E;");
@ -382,7 +378,6 @@ public class MyController extends KFXPanelController {
amountColumn.prefWidthProperty().bind(materialsTable.widthProperty().multiply(0.07)); amountColumn.prefWidthProperty().bind(materialsTable.widthProperty().multiply(0.07));
comparedResultColumn.prefWidthProperty().bind(materialsTable.widthProperty().multiply(0.09)); comparedResultColumn.prefWidthProperty().bind(materialsTable.widthProperty().multiply(0.09));
String sql1 = "SELECT DISTINCT \"cbdlx\" FROM \"CHINT_ QUOTATION_LOV\""; String sql1 = "SELECT DISTINCT \"cbdlx\" FROM \"CHINT_ QUOTATION_LOV\"";
System.out.println(sql1); System.out.println(sql1);
ResultSet resultSet1 = SqlUtil.read(sql1); ResultSet resultSet1 = SqlUtil.read(sql1);
@ -396,7 +391,8 @@ public class MyController extends KFXPanelController {
// 查询版次 // 查询版次
String sql2 = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '" +"报价成本单"+ "'"; String sql2 = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"cbdlx\" = '" + "报价成本单" + "'";
System.out.println(sql2); System.out.println(sql2);
ResultSet resultSet2 = SqlUtil.read(sql2); ResultSet resultSet2 = SqlUtil.read(sql2);
List<String> revision = new ArrayList<String>(); List<String> revision = new ArrayList<String>();
@ -447,12 +443,10 @@ public class MyController extends KFXPanelController {
totalPriceTextField.setText(ButtonCellEditor.tableList.get(0).getTotalprice()); totalPriceTextField.setText(ButtonCellEditor.tableList.get(0).getTotalprice());
} }
// 设置只读 // 设置只读
totalPriceTextField.setEditable(false); totalPriceTextField.setEditable(false);
totalPriceCompareTextField.setEditable(false); totalPriceCompareTextField.setEditable(false);
// 给表哥添加内容 // 给表哥添加内容
ObservableList<QuotationMX> data = FXCollections.observableArrayList(); ObservableList<QuotationMX> data = FXCollections.observableArrayList();
data.addAll(ButtonCellEditor.tableList); data.addAll(ButtonCellEditor.tableList);
@ -487,19 +481,14 @@ public class MyController extends KFXPanelController {
amountColumn.setCellValueFactory(new PropertyValueFactory<>("amomoney")); amountColumn.setCellValueFactory(new PropertyValueFactory<>("amomoney"));
amountColumn.setSortable(false); amountColumn.setSortable(false);
comparedResultColumn.setCellValueFactory(new PropertyValueFactory<>("contrastPrice")); comparedResultColumn.setCellValueFactory(new PropertyValueFactory<>("contrastPrice"));
comparedResultColumn.setSortable(false); comparedResultColumn.setSortable(false);
materialsTable.setEditable(true); materialsTable.setEditable(true);
// 设置可编辑状态 // 设置可编辑状态
editWrite(); editWrite();
// 将personList设置为TableView的数据源 // 将personList设置为TableView的数据源
materialsTable.setItems(data); materialsTable.setItems(data);
@ -519,7 +508,9 @@ public class MyController extends KFXPanelController {
// 根据选择的成本单类型刷新版本下拉框 // 根据选择的成本单类型刷新版本下拉框
try { try {
String revsql = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '" +selectedItemType+ "' order by \"revision\" asc"; String revsql = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"cbdlx\" = '" + selectedItemType
+ "' order by \"revision\" asc";
System.out.println(revsql); System.out.println(revsql);
ResultSet resultRev = SqlUtil.read(revsql); ResultSet resultRev = SqlUtil.read(revsql);
List<String> revisions = new ArrayList<String>(); List<String> revisions = new ArrayList<String>();
@ -544,12 +535,11 @@ public class MyController extends KFXPanelController {
e.printStackTrace(); e.printStackTrace();
} }
// 开始刷新数据,设置只能查看数据 // 开始刷新数据,设置只能查看数据
System.out.println("开始刷新头表数据"); System.out.println("开始刷新头表数据");
String selSQL = "SELECT \"cbdlx\",\"projectid\",\"revision\",\"factory\",\"proname\",\"tennumber\",\"promanager\",\"quantity\",\"tramodel\",\"capfactor\",\"volratio\",\"noloadloss\",\"loadloss\",\"impvoltage\",\"traweight\",\"totweight\",\"copconsumption\",\"cmarketprice\",\"vollevel\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"revision\" = '"+rev+"' and \"cbdlx\" = '" +costSheetTypeComboBox.getSelectionModel().getSelectedItem()+ "'"; String selSQL = "SELECT \"cbdlx\",\"projectid\",\"revision\",\"factory\",\"proname\",\"tennumber\",\"promanager\",\"quantity\",\"tramodel\",\"capfactor\",\"volratio\",\"noloadloss\",\"loadloss\",\"impvoltage\",\"traweight\",\"totweight\",\"copconsumption\",\"cmarketprice\",\"vollevel\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"revision\" = '" + rev
+ "' and \"cbdlx\" = '" + costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "'";
// 根据查询结果更新数据 // 根据查询结果更新数据
System.out.println(selSQL); System.out.println(selSQL);
try { try {
@ -579,7 +569,10 @@ public class MyController extends KFXPanelController {
System.out.println("开始刷新明细数据"); System.out.println("开始刷新明细数据");
try { try {
String reSql = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '"+costSheetTypeComboBox.getSelectionModel().getSelectedItem()+"' and \"revision\" = '"+rev+"' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc"; String reSql = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"cbdlx\" = '"
+ costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "' and \"revision\" = '" + rev
+ "' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc";
System.out.println("reSql:" + reSql); System.out.println("reSql:" + reSql);
ResultSet reSql1 = SqlUtil.read(reSql); ResultSet reSql1 = SqlUtil.read(reSql);
ArrayList<QuotationMX> tableList = new ArrayList<QuotationMX>(); ArrayList<QuotationMX> tableList = new ArrayList<QuotationMX>();
@ -596,14 +589,19 @@ public class MyController extends KFXPanelController {
quotationMX.setMatcatname(new SimpleStringProperty(reSql1.getString("matcatname"))); quotationMX.setMatcatname(new SimpleStringProperty(reSql1.getString("matcatname")));
quotationMX.setSpecifications(new SimpleStringProperty(reSql1.getString("specifications"))); quotationMX.setSpecifications(new SimpleStringProperty(reSql1.getString("specifications")));
quotationMX.setManufacturer(new SimpleStringProperty(reSql1.getString("manufacturer"))); quotationMX.setManufacturer(new SimpleStringProperty(reSql1.getString("manufacturer")));
quotationMX.setNwquantity(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("nwquantity")))); quotationMX.setNwquantity(
quotationMX.setUtirate(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("utirate")))); new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("nwquantity"))));
quotationMX.setUtirate(
new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("utirate"))));
quotationMX.setUnit(new SimpleStringProperty(reSql1.getString("unit"))); quotationMX.setUnit(new SimpleStringProperty(reSql1.getString("unit")));
quotationMX.setAmomoney(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("amomoney")))); quotationMX.setAmomoney(
quotationMX.setUnitprice(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("unitprice")))); new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("amomoney"))));
quotationMX.setUnitprice(
new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("unitprice"))));
quotationMX.setNo(new SimpleStringProperty(reSql1.getString("no"))); quotationMX.setNo(new SimpleStringProperty(reSql1.getString("no")));
quotationMX.setContrastPrice(new SimpleStringProperty("")); quotationMX.setContrastPrice(new SimpleStringProperty(""));
quotationMX.setTotalprice(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("totalprice")))); quotationMX.setTotalprice(
new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("totalprice"))));
tableList.add(quotationMX); tableList.add(quotationMX);
} }
System.out.println("表格数据:" + tableList.size()); System.out.println("表格数据:" + tableList.size());
@ -630,7 +628,8 @@ public class MyController extends KFXPanelController {
quotationMX.setUnitprice(new SimpleStringProperty(tableList.get(j).getUnitprice())); quotationMX.setUnitprice(new SimpleStringProperty(tableList.get(j).getUnitprice()));
quotationMX.setNo(new SimpleStringProperty(tableList.get(j).getNo())); quotationMX.setNo(new SimpleStringProperty(tableList.get(j).getNo()));
quotationMX.setContrastPrice(new SimpleStringProperty("")); quotationMX.setContrastPrice(new SimpleStringProperty(""));
//quotationMX.setTotalprice(new SimpleStringProperty(reSql1.getString("totalprice"))); // quotationMX.setTotalprice(new
// SimpleStringProperty(reSql1.getString("totalprice")));
} }
System.out.println("刷新表格"); System.out.println("刷新表格");
@ -652,13 +651,8 @@ public class MyController extends KFXPanelController {
e.printStackTrace(); e.printStackTrace();
} }
}); });
// 版本下拉框,按钮监听 // 版本下拉框,按钮监听
editionComboBox.setOnAction(event -> { editionComboBox.setOnAction(event -> {
@ -666,7 +660,9 @@ public class MyController extends KFXPanelController {
// 开始刷新数据,设置只能查看数据 // 开始刷新数据,设置只能查看数据
System.out.println("开始刷新头表数据"); System.out.println("开始刷新头表数据");
String selSQL = "SELECT \"cbdlx\",\"projectid\",\"revision\",\"factory\",\"proname\",\"tennumber\",\"promanager\",\"quantity\",\"tramodel\",\"capfactor\",\"volratio\",\"noloadloss\",\"loadloss\",\"impvoltage\",\"traweight\",\"totweight\",\"copconsumption\",\"cmarketprice\",\"vollevel\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"revision\" = '"+selectedItem+"' and \"cbdlx\" = '" +costSheetTypeComboBox.getSelectionModel().getSelectedItem()+ "'"; String selSQL = "SELECT \"cbdlx\",\"projectid\",\"revision\",\"factory\",\"proname\",\"tennumber\",\"promanager\",\"quantity\",\"tramodel\",\"capfactor\",\"volratio\",\"noloadloss\",\"loadloss\",\"impvoltage\",\"traweight\",\"totweight\",\"copconsumption\",\"cmarketprice\",\"vollevel\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"revision\" = '" + selectedItem
+ "' and \"cbdlx\" = '" + costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "'";
// 根据查询结果更新数据 // 根据查询结果更新数据
System.out.println(selSQL); System.out.println(selSQL);
try { try {
@ -694,10 +690,13 @@ public class MyController extends KFXPanelController {
e1.printStackTrace(); e1.printStackTrace();
} }
System.out.println("开始刷新明细数据"); System.out.println("开始刷新明细数据");
try { try {
String reSql = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '"+costSheetTypeComboBox.getSelectionModel().getSelectedItem()+"' and \"revision\" = '"+selectedItem+"' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc"; String reSql = "SELECT * FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"cbdlx\" = '"
+ costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "' and \"revision\" = '"
+ selectedItem
+ "' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc";
System.out.println("reSql:" + reSql); System.out.println("reSql:" + reSql);
ResultSet reSql1 = SqlUtil.read(reSql); ResultSet reSql1 = SqlUtil.read(reSql);
ArrayList<QuotationMX> tableList = new ArrayList<QuotationMX>(); ArrayList<QuotationMX> tableList = new ArrayList<QuotationMX>();
@ -714,14 +713,19 @@ public class MyController extends KFXPanelController {
quotationMX.setMatcatname(new SimpleStringProperty(reSql1.getString("matcatname"))); quotationMX.setMatcatname(new SimpleStringProperty(reSql1.getString("matcatname")));
quotationMX.setSpecifications(new SimpleStringProperty(reSql1.getString("specifications"))); quotationMX.setSpecifications(new SimpleStringProperty(reSql1.getString("specifications")));
quotationMX.setManufacturer(new SimpleStringProperty(reSql1.getString("manufacturer"))); quotationMX.setManufacturer(new SimpleStringProperty(reSql1.getString("manufacturer")));
quotationMX.setNwquantity(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("nwquantity")))); quotationMX.setNwquantity(
quotationMX.setUtirate(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("utirate")))); new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("nwquantity"))));
quotationMX.setUtirate(
new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("utirate"))));
quotationMX.setUnit(new SimpleStringProperty(reSql1.getString("unit"))); quotationMX.setUnit(new SimpleStringProperty(reSql1.getString("unit")));
quotationMX.setAmomoney(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("amomoney")))); quotationMX.setAmomoney(
quotationMX.setUnitprice(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("unitprice")))); new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("amomoney"))));
quotationMX.setUnitprice(
new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("unitprice"))));
quotationMX.setNo(new SimpleStringProperty(reSql1.getString("no"))); quotationMX.setNo(new SimpleStringProperty(reSql1.getString("no")));
quotationMX.setContrastPrice(new SimpleStringProperty("")); quotationMX.setContrastPrice(new SimpleStringProperty(""));
quotationMX.setTotalprice(new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("totalprice")))); quotationMX.setTotalprice(
new SimpleStringProperty(QuotationUtil.formatString(reSql1.getString("totalprice"))));
tableList.add(quotationMX); tableList.add(quotationMX);
} }
System.out.println("表格数据:" + tableList.size()); System.out.println("表格数据:" + tableList.size());
@ -748,7 +752,8 @@ public class MyController extends KFXPanelController {
quotationMX.setUnitprice(new SimpleStringProperty(tableList.get(j).getUnitprice())); quotationMX.setUnitprice(new SimpleStringProperty(tableList.get(j).getUnitprice()));
quotationMX.setNo(new SimpleStringProperty(tableList.get(j).getNo())); quotationMX.setNo(new SimpleStringProperty(tableList.get(j).getNo()));
quotationMX.setContrastPrice(new SimpleStringProperty("")); quotationMX.setContrastPrice(new SimpleStringProperty(""));
//quotationMX.setTotalprice(new SimpleStringProperty(reSql1.getString("totalprice"))); // quotationMX.setTotalprice(new
// SimpleStringProperty(reSql1.getString("totalprice")));
} }
System.out.println("刷新表格"); System.out.println("刷新表格");
@ -776,8 +781,6 @@ public class MyController extends KFXPanelController {
e.printStackTrace(); e.printStackTrace();
} }
}); });
// 保存按钮 // 保存按钮
@ -816,67 +819,56 @@ public class MyController extends KFXPanelController {
String newVollevel = voltageLevelTextField.getText(); String newVollevel = voltageLevelTextField.getText();
// 判断数据库中是否已经存在表行 // 判断数据库中是否已经存在表行
boolean isExist = true; boolean isExist = true;
String set = "select * from \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"cbdlx\" = '" + costSheetTypeComboBox.getSelectionModel().getSelectedItem() +"' and \"projectid\" = '" + ButtonCellEditor.cusquotation.getProjectid()+"' and \"revision\" = '" + editionComboBox.getSelectionModel().getSelectedItem() + "'"; String set = "select * from \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"cbdlx\" = '"
+ costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "' and \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"revision\" = '"
+ editionComboBox.getSelectionModel().getSelectedItem() + "'";
System.out.println("set:" + set); System.out.println("set:" + set);
try { try {
ResultSet read = SqlUtil.read(set); ResultSet read = SqlUtil.read(set);
if (read.next()) { if (read.next()) {
isExist = false; isExist = false;
// 更新数据 // 更新数据
String updateTop = "UPDATE \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" SET \"cbdlx\" = '"+ String updateTop = "UPDATE \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" SET \"cbdlx\" = '" + newCbdlx
newCbdlx+"', \"projectid\" = '"+ + "', \"projectid\" = '" + newProjectid + "', \"revision\" = '" + newRevision
newProjectid+"', \"revision\" = '"+ + "', \"factory\" = '" + newFactory + "', \"proname\" = '" + newProname
newRevision+"', \"factory\" = '"+ + "', \"tennumber\" = '" + newTennumber + "', \"promanager\" = '" + newPromanager
newFactory+"', \"proname\" = '"+ + "', \"quantity\" = '" + newQuantity + "', \"tramodel\" = '" + newTramodel
newProname+"', \"tennumber\" = '"+ + "', \"capfactor\" = '" + newCapfactor + "', \"volratio\" = '" + newVolratio
newTennumber+"', \"promanager\" = '"+ + "', \"noloadloss\" = '" + newNoloadloss + "', \"loadloss\" = '" + newLoadloss
newPromanager+"', \"quantity\" = '"+ + "', \"impvoltage\" = '" + newImpvoltage + "', \"traweight\" = '" + newTraweight
newQuantity+"', \"tramodel\" = '"+ + "', \"totweight\" = '" + newTotweight + "', \"copconsumption\" = '" + newCopconsumption
newTramodel+"', \"capfactor\" = '"+ + "', \"cmarketprice\" = '" + newCmarketprice + "', \"vollevel\" = '" + newVollevel
newCapfactor+"', \"volratio\" = '"+ + "' where \"cbdlx\" = '" + costSheetTypeComboBox.getSelectionModel().getSelectedItem()
newVolratio+"', \"noloadloss\" = '"+ + "' and \"projectid\" = '" + ButtonCellEditor.cusquotation.getProjectid()
newNoloadloss+"', \"loadloss\" = '"+ + "' and \"revision\" = '" + editionComboBox.getSelectionModel().getSelectedItem() + "'";
newLoadloss+"', \"impvoltage\" = '"+
newImpvoltage+"', \"traweight\" = '"+
newTraweight+"', \"totweight\" = '"+
newTotweight+"', \"copconsumption\" = '"+
newCopconsumption+"', \"cmarketprice\" = '"+
newCmarketprice+"', \"vollevel\" = '"+
newVollevel+"' where \"cbdlx\" = '" + costSheetTypeComboBox.getSelectionModel().getSelectedItem() +"' and \"projectid\" = '" + ButtonCellEditor.cusquotation.getProjectid()+"' and \"revision\" = '" + editionComboBox.getSelectionModel().getSelectedItem() + "'";
System.out.println("insertTop:" + updateTop); System.out.println("insertTop:" + updateTop);
SqlUtil.update(updateTop); SqlUtil.update(updateTop);
System.out.println("更新数据成功"); System.out.println("更新数据成功");
// 将关联的明细表数据删除,重新插入数据 // 将关联的明细表数据删除,重新插入数据
String deleSql = "DELETE FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"cbdlx\" = '" + costSheetTypeComboBox.getSelectionModel().getSelectedItem() +"' and \"projectid\" = '" + ButtonCellEditor.cusquotation.getProjectid()+"' and \"revision\" = '" + editionComboBox.getSelectionModel().getSelectedItem() + "'"; String deleSql = "DELETE FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"cbdlx\" = '"
+ costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "' and \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"revision\" = '"
+ editionComboBox.getSelectionModel().getSelectedItem() + "'";
SqlUtil.delete(deleSql); SqlUtil.delete(deleSql);
// 将关联的对比结果信息表删除,重新插入数据 // 将关联的对比结果信息表删除,重新插入数据
String deleteDataSql = "DELETE FROM \"CHINT_DBCUSQUOTATION_ DETAILS_TEMPLATE\" where \"cbdlx\" = '" + costSheetTypeComboBox.getSelectionModel().getSelectedItem() +"' and \"projectid\" = '" + ButtonCellEditor.cusquotation.getProjectid()+"' and \"revision\" = '" + editionComboBox.getSelectionModel().getSelectedItem() + "' and \"dbcbdlx\" = '" + comparedCostSheetTextField.getText() + "'"; String deleteDataSql = "DELETE FROM \"CHINT_DBCUSQUOTATION_ DETAILS_TEMPLATE\" where \"cbdlx\" = '"
+ costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "' and \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"revision\" = '"
+ editionComboBox.getSelectionModel().getSelectedItem() + "' and \"dbcbdlx\" = '"
+ comparedCostSheetTextField.getText() + "'";
SqlUtil.delete(deleteDataSql); SqlUtil.delete(deleteDataSql);
} else { } else {
// 插入数据 // 插入数据
String insertTop = "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('"+ String insertTop = "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('"
newCbdlx+"','"+ + newCbdlx + "','" + newProjectid + "','" + newRevision + "','" + newFactory + "','"
newProjectid+"','"+ + newProname + "','" + newTennumber + "','" + newPromanager + "','" + newQuantity + "','"
newRevision+"','"+ + newTramodel + "','" + newCapfactor + "','" + newVolratio + "','" + newNoloadloss + "','"
newFactory+"','"+ + newLoadloss + "','" + newImpvoltage + "','" + newTraweight + "','" + newTotweight + "','"
newProname+"','"+ + newCopconsumption + "','" + newCmarketprice + "','" + newVollevel + "')";
newTennumber+"','"+
newPromanager+"','"+
newQuantity+"','"+
newTramodel+"','"+
newCapfactor+"','"+
newVolratio+"','"+
newNoloadloss+"','"+
newLoadloss+"','"+
newImpvoltage+"','"+
newTraweight+"','"+
newTotweight+"','"+
newCopconsumption+"','"+
newCmarketprice+"','"+
newVollevel+"')";
System.out.println("insertTop:" + insertTop); System.out.println("insertTop:" + insertTop);
SqlUtil.write(insertTop); SqlUtil.write(insertTop);
System.out.println("插入数据成功"); System.out.println("插入数据成功");
@ -952,63 +944,33 @@ public class MyController extends KFXPanelController {
dbjg = quotationMX.getContrastPrice(); dbjg = quotationMX.getContrastPrice();
} }
// 保存明细表 // 保存明细表
String insert = "INSERT INTO \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\"(\"cbdlx\",\"projectid\",\"revision\",\"matgroup\",\"mgsnumber\",\"matcname\",\"matcnumber\",\"matcatname\",\"specifications\",\"manufacturer\",\"nwquantity\",\"utirate\",\"unit\",\"amomoney\",\"unitprice\",\"no\",\"totalprice\") values('"+ String insert = "INSERT INTO \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\"(\"cbdlx\",\"projectid\",\"revision\",\"matgroup\",\"mgsnumber\",\"matcname\",\"matcnumber\",\"matcatname\",\"specifications\",\"manufacturer\",\"nwquantity\",\"utirate\",\"unit\",\"amomoney\",\"unitprice\",\"no\",\"totalprice\") values('"
costSheetTypeComboBox.getSelectionModel().getSelectedItem()+"','"+ + costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "','"
ButtonCellEditor.cusquotation.getProjectid()+"','"+ + ButtonCellEditor.cusquotation.getProjectid() + "','"
editionComboBox.getSelectionModel().getSelectedItem()+"','"+ + editionComboBox.getSelectionModel().getSelectedItem() + "','" + group + "','" + Mgsnumber
group+"','"+ + "','" + Matcname + "','" + Matcnumber + "','" + Matcatname + "','" + Specifications + "','"
Mgsnumber+"','"+ + Manufacturer + "','" + Nwquantity + "','" + Utirate + "','" + Unit + "','" + Amomoney + "','"
Matcname+"','"+ + Unitprice + "','" + No + "','" + Totalprice + "')";
Matcnumber+"','"+
Matcatname+"','"+
Specifications+"','"+
Manufacturer+"','"+
Nwquantity+"','"+
Utirate+"','"+
Unit+"','"+
Amomoney+"','"+
Unitprice+"','"+
No+"','"+
Totalprice+"')";
System.out.println("insert:" + insert); System.out.println("insert:" + insert);
System.out.println("插入数据库:" + insert); System.out.println("插入数据库:" + insert);
int write = SqlUtil.write(insert); int write = SqlUtil.write(insert);
System.out.println("受影响的行:" + write); System.out.println("受影响的行:" + write);
if (dbmatcatnameList != null && dbmatcatnameList.size() > 0) { if (dbmatcatnameList != null && dbmatcatnameList.size() > 0) {
// 保存成本单对比结果信息表 // 保存成本单对比结果信息表
// 保存明细表 // 保存明细表
String insert1 = "INSERT INTO \"CHINT_DBCUSQUOTATION_ DETAILS_TEMPLATE\"(\"cbdlx\",\"dbcbdlx\",\"projectid\",\"revision\",\"dbrevision\",\"dbjg\",\"factory\",\"matgroup\",\"mgsnumber\",\"matcname\",\"matcnumber\",\"matcatname\",\"dbmatcatname\",\"specifications\",\"manufacturer\",\"nwquantity\",\"dbnwquantity\",\"utirate\",\"dbutirate\",\"unit\",\"dbunit\",\"amomoney\",\"dbamomoney\",\"unitprice\",\"dbunitprice\",\"no\",\"Dbno\",\"totalprice\",\"dbtotalprice\") values('"+ String insert1 = "INSERT INTO \"CHINT_DBCUSQUOTATION_ DETAILS_TEMPLATE\"(\"cbdlx\",\"dbcbdlx\",\"projectid\",\"revision\",\"dbrevision\",\"dbjg\",\"factory\",\"matgroup\",\"mgsnumber\",\"matcname\",\"matcnumber\",\"matcatname\",\"dbmatcatname\",\"specifications\",\"manufacturer\",\"nwquantity\",\"dbnwquantity\",\"utirate\",\"dbutirate\",\"unit\",\"dbunit\",\"amomoney\",\"dbamomoney\",\"unitprice\",\"dbunitprice\",\"no\",\"Dbno\",\"totalprice\",\"dbtotalprice\") values('"
costSheetTypeComboBox.getSelectionModel().getSelectedItem()+"','"+ + costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "','"
comparedCostSheetTextField.getText()+"','"+ + comparedCostSheetTextField.getText() + "','"
ButtonCellEditor.cusquotation.getProjectid()+"','"+ + ButtonCellEditor.cusquotation.getProjectid() + "','"
editionComboBox.getSelectionModel().getSelectedItem()+"','"+ + editionComboBox.getSelectionModel().getSelectedItem() + "','" + dbRevList.get(a) + "','"
dbRevList.get(a)+"','"+ + dbjg + "','" + newFactory + "','" + group + "','" + Mgsnumber + "','" + Matcname + "','"
dbjg+"','"+ + Matcnumber + "','" + Matcatname + "','" + dbmatcatnameList.get(a) + "','" + Specifications
newFactory+"','"+ + "','" + Manufacturer + "','" + Nwquantity + "','" + dbnwquantityList.get(a) + "','"
group+"','"+ + Utirate + "','" + dbutirateList.get(a) + "','" + Unit + "','" + dbunitList.get(a) + "','"
Mgsnumber+"','"+ + Amomoney + "','" + moneyList.get(a) + "','" + Unitprice + "','" + dbunitpriceList.get(a)
Matcname+"','"+ + "','" + No + "','" + DbnoList.get(a) + "','" + Totalprice + "','"
Matcnumber+"','"+ + dbtotalpriceList.get(a) + "')";
Matcatname+"','"+
dbmatcatnameList.get(a)+"','"+
Specifications+"','"+
Manufacturer+"','"+
Nwquantity+"','"+
dbnwquantityList.get(a)+"','"+
Utirate+"','"+
dbutirateList.get(a)+"','"+
Unit+"','"+
dbunitList.get(a)+"','"+
Amomoney+"','"+
moneyList.get(a)+"','"+
Unitprice+"','"+
dbunitpriceList.get(a)+"','"+
No+"','"+
DbnoList.get(a)+"','"+
Totalprice+"','"+
dbtotalpriceList.get(a)+"')";
System.out.println("insert:" + insert1); System.out.println("insert:" + insert1);
System.out.println("插入数据库:" + insert1); System.out.println("插入数据库:" + insert1);
@ -1020,12 +982,16 @@ public class MyController extends KFXPanelController {
if (isExist) { if (isExist) {
// 创建新对象 // 创建新对象
try { try {
TCComponentItemType tccomponentitemtype = (TCComponentItemType)ButtonCellEditor.session.getTypeComponent("ZT2_COSTSHEET"); TCComponentItemType tccomponentitemtype = (TCComponentItemType) ButtonCellEditor.session
.getTypeComponent("ZT2_COSTSHEET");
String itemId = tccomponentitemtype.getNewID(); String itemId = tccomponentitemtype.getNewID();
String itemRev = tccomponentitemtype.getNewRev(null); String itemRev = tccomponentitemtype.getNewRev(null);
TCComponentItem item = tccomponentitemtype.create(itemId,itemRev,"ZT2_COSTSHEET",costSheetTypeComboBox.getSelectionModel().getSelectedItem(),"",null); TCComponentItem item = tccomponentitemtype.create(itemId, itemRev, "ZT2_COSTSHEET",
item.getLatestItemRevision().setProperty("zt2_cbdlx", costSheetTypeComboBox.getSelectionModel().getSelectedItem()); costSheetTypeComboBox.getSelectionModel().getSelectedItem(), "", null);
item.getLatestItemRevision().setProperty("object_desc", ButtonCellEditor.cusquotation.getProjectid()); item.getLatestItemRevision().setProperty("zt2_cbdlx",
costSheetTypeComboBox.getSelectionModel().getSelectedItem());
item.getLatestItemRevision().setProperty("object_desc",
ButtonCellEditor.cusquotation.getProjectid());
// 挂在选中的文件夹下面 // 挂在选中的文件夹下面
ButtonCellEditor.f.add("contents", item); ButtonCellEditor.f.add("contents", item);
} catch (TCException e1) { } catch (TCException e1) {
@ -1043,12 +1009,12 @@ public class MyController extends KFXPanelController {
calculateButton.setOnAction(event -> { calculateButton.setOnAction(event -> {
// 计算金额 // 计算金额
for (QuotationMX quotationMX : materialsTable.getItems()) { for (QuotationMX quotationMX : materialsTable.getItems()) {
if(quotationMX.getUnitprice()==null || "".equals(quotationMX.getUnitprice()) || if (quotationMX.getUnitprice() == null || "".equals(quotationMX.getUnitprice())
quotationMX.getNwquantity()==null || "".equals(quotationMX.getNwquantity()) || || quotationMX.getNwquantity() == null || "".equals(quotationMX.getNwquantity())
quotationMX.getUtirate() == null || "".equals(quotationMX.getUtirate()) || || quotationMX.getUtirate() == null || "".equals(quotationMX.getUtirate())
quotationMX.getUnit() == null || "".equals(quotationMX.getUnit()) || quotationMX.getUnit() == null || "".equals(quotationMX.getUnit())) {
) { MessageBox.post(paramKFXPanel.getParentDialog(), "数量、单价、利用率、单位存在为空。请检查", "提示",
MessageBox.post(paramKFXPanel.getParentDialog(), "数量、单价、利用率、单位存在为空。请检查", "提示", MessageBox.INFORMATION); MessageBox.INFORMATION);
// MessageBox.post("数量、单价、利用率、单位存在为空。请检查", "提示", MessageBox.INFORMATION); // MessageBox.post("数量、单价、利用率、单位存在为空。请检查", "提示", MessageBox.INFORMATION);
return; return;
} }
@ -1073,11 +1039,10 @@ public class MyController extends KFXPanelController {
}); });
selectComparisonButton.setOnAction(event -> { selectComparisonButton.setOnAction(event -> {
// 选择对比按钮 // 选择对比按钮
String sql3 = "SELECT \"cbdlx\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"'"; String sql3 = "SELECT \"cbdlx\" FROM \"CHINT_ CUSQUOTATION_TITLE_TEMPLATE\" where \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "'";
System.out.println(sql3); System.out.println(sql3);
ResultSet resultSet3 = null; ResultSet resultSet3 = null;
try { try {
@ -1106,9 +1071,8 @@ public class MyController extends KFXPanelController {
String[] options = selectType.toArray(new String[selectType.size()]); String[] options = selectType.toArray(new String[selectType.size()]);
// String[] options = { "Option 1", "Option 2", "Option 3" }; // String[] options = { "Option 1", "Option 2", "Option 3" };
String selectedOption = (String) JOptionPane.showInputDialog(paramKFXPanel.getParentDialog(), String selectedOption = (String) JOptionPane.showInputDialog(paramKFXPanel.getParentDialog(), "选择要对比的成本单",
"选择要对比的成本单", "选择成本单", JOptionPane.PLAIN_MESSAGE, "选择成本单", JOptionPane.PLAIN_MESSAGE, null, options, options[0]);
null, options, options[0]);
if (selectedOption != null) { if (selectedOption != null) {
moneyList = new ArrayList<String>(); moneyList = new ArrayList<String>();
dbRevList = new ArrayList<String>(); dbRevList = new ArrayList<String>();
@ -1121,7 +1085,9 @@ public class MyController extends KFXPanelController {
dbtotalpriceList = new ArrayList<String>(); dbtotalpriceList = new ArrayList<String>();
System.out.println("用户选择的选项:" + selectedOption); System.out.println("用户选择的选项:" + selectedOption);
// 获取数据库该类型成本单最新的版本 // 获取数据库该类型成本单最新的版本
String getLastRevSql = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '" + selectedOption + "' order by \"revision\" desc" ; String getLastRevSql = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"cbdlx\" = '" + selectedOption
+ "' order by \"revision\" desc";
System.out.println("getLastRevSql:" + getLastRevSql); System.out.println("getLastRevSql:" + getLastRevSql);
try { try {
ResultSet resultSet4 = SqlUtil.read(getLastRevSql); ResultSet resultSet4 = SqlUtil.read(getLastRevSql);
@ -1133,8 +1099,10 @@ public class MyController extends KFXPanelController {
e1.printStackTrace(); e1.printStackTrace();
} }
String sql4 = "SELECT \"matcatname\",\"nwquantity\",\"utirate\",\"unit\",\"amomoney\",\"unitprice\",\"no\",\"totalprice\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"
String sql4 = "SELECT \"matcatname\",\"nwquantity\",\"utirate\",\"unit\",\"amomoney\",\"unitprice\",\"no\",\"totalprice\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '" + selectedOption + "' and \"revision\" = '" +dbRevList.get(0)+ "' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc"; + ButtonCellEditor.cusquotation.getProjectid() + "' and \"cbdlx\" = '" + selectedOption
+ "' and \"revision\" = '" + dbRevList.get(0)
+ "' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc";
System.out.println("sql4:" + sql4); System.out.println("sql4:" + sql4);
Boolean zjdbjg = false; Boolean zjdbjg = false;
if (totalPriceCompareTextField.getText() == null || "".equals(totalPriceCompareTextField.getText())) { if (totalPriceCompareTextField.getText() == null || "".equals(totalPriceCompareTextField.getText())) {
@ -1157,7 +1125,6 @@ public class MyController extends KFXPanelController {
dbtotalpriceList.add(totalPriceCompareTextField.getText()); dbtotalpriceList.add(totalPriceCompareTextField.getText());
} }
} }
} catch (SQLException e1) { } catch (SQLException e1) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
@ -1165,7 +1132,9 @@ public class MyController extends KFXPanelController {
} }
// 开始刷新对比结果数据 // 开始刷新对比结果数据
// 获取数据库该类型成本单最新的版本 // 获取数据库该类型成本单最新的版本
String getLastRevSql1 = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '" + selectedOption + "' order by \"revision\" desc" ; String getLastRevSql1 = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"cbdlx\" = '" + selectedOption
+ "' order by \"revision\" desc";
System.out.println("getLastRevSql:" + getLastRevSql1); System.out.println("getLastRevSql:" + getLastRevSql1);
List<String> revList = new ArrayList<String>(); List<String> revList = new ArrayList<String>();
try { try {
@ -1180,7 +1149,12 @@ public class MyController extends KFXPanelController {
if (revList.size() > 0) { if (revList.size() > 0) {
try { try {
String reSql = "SELECT \"dbjg\" FROM \"CHINT_DBCUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '"+costSheetTypeComboBox.getSelectionModel().getSelectedItem()+"' and \"revision\" = '"+editionComboBox.getSelectionModel().getSelectedItem()+ "' and \"dbrevision\" = '" + revList.get(0) + "' and \"dbcbdlx\"='"+selectedOption +"' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc"; String reSql = "SELECT \"dbjg\" FROM \"CHINT_DBCUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"
+ ButtonCellEditor.cusquotation.getProjectid() + "' and \"cbdlx\" = '"
+ costSheetTypeComboBox.getSelectionModel().getSelectedItem() + "' and \"revision\" = '"
+ editionComboBox.getSelectionModel().getSelectedItem() + "' and \"dbrevision\" = '"
+ revList.get(0) + "' and \"dbcbdlx\"='" + selectedOption
+ "' order by \"matgroup\" asc,TO_NUMBER(\"mgsnumber\") asc ,TO_NUMBER(\"matcnumber\") asc,TO_NUMBER(\"no\") asc";
System.out.println("reSql:" + reSql); System.out.println("reSql:" + reSql);
ResultSet reSql1 = SqlUtil.read(reSql); ResultSet reSql1 = SqlUtil.read(reSql);
ArrayList<String> tableList = new ArrayList<String>(); ArrayList<String> tableList = new ArrayList<String>();
@ -1196,7 +1170,8 @@ public class MyController extends KFXPanelController {
tableList.set(j, "0"); tableList.set(j, "0");
} }
System.out.println(tableList.get(j)); System.out.println(tableList.get(j));
quotationMX.setContrastPrice(new SimpleStringProperty(QuotationUtil.formatString(tableList.get(j)))); quotationMX.setContrastPrice(
new SimpleStringProperty(QuotationUtil.formatString(tableList.get(j))));
} }
System.out.println("刷新表格"); System.out.println("刷新表格");
materialsTable.refresh(); materialsTable.refresh();
@ -1233,7 +1208,8 @@ public class MyController extends KFXPanelController {
return; return;
} }
if(costSheetTypeComboBox.getSelectionModel().getSelectedItem() == null || "".equals(costSheetTypeComboBox.getSelectionModel().getSelectedItem())) { if (costSheetTypeComboBox.getSelectionModel().getSelectedItem() == null
|| "".equals(costSheetTypeComboBox.getSelectionModel().getSelectedItem())) {
MessageBox.post(paramKFXPanel.getParentDialog(), "请选择对比成本单", "提示", MessageBox.INFORMATION); MessageBox.post(paramKFXPanel.getParentDialog(), "请选择对比成本单", "提示", MessageBox.INFORMATION);
// MessageBox.post("请选择对比成本单", "提示", MessageBox.INFORMATION); // MessageBox.post("请选择对比成本单", "提示", MessageBox.INFORMATION);
return; return;
@ -1266,9 +1242,6 @@ public class MyController extends KFXPanelController {
} }
} }
System.out.println("表格长度:" + materialsTable.getItems().size()); System.out.println("表格长度:" + materialsTable.getItems().size());
// 获取当前表格用户填写情况 // 获取当前表格用户填写情况
for (int i = 0; i < materialsTable.getItems().size(); i++) { for (int i = 0; i < materialsTable.getItems().size(); i++) {
@ -1284,7 +1257,8 @@ public class MyController extends KFXPanelController {
BigDecimal oldjine = new BigDecimal(Double.valueOf(moneyList.get(i))); BigDecimal oldjine = new BigDecimal(Double.valueOf(moneyList.get(i)));
double absPercent = newjine.subtract(oldjine).doubleValue(); // 减法 double absPercent = newjine.subtract(oldjine).doubleValue(); // 减法
System.out.println(absPercent + ""); System.out.println(absPercent + "");
quotationMX.setContrastPrice(new SimpleStringProperty(QuotationUtil.formatString(df.format(absPercent)+""))); quotationMX.setContrastPrice(
new SimpleStringProperty(QuotationUtil.formatString(df.format(absPercent) + "")));
} }
materialsTable.refresh(); materialsTable.refresh();
// 计算总价 // 计算总价

@ -17,14 +17,10 @@ public class Process {
private List<FileJson> esopFiles; private List<FileJson> esopFiles;
public Process() { public Process() {
super(); super();
} }
public Process(String factoryCode, String processName, String processCode, String workCenter, String processType, public Process(String factoryCode, String processName, String processCode, String workCenter, String processType,
List<FileJson> processRouteFiles, List<FileJson> esopFiles) { List<FileJson> processRouteFiles, List<FileJson> esopFiles) {
super(); super();
@ -37,92 +33,62 @@ public class Process {
this.esopFiles = esopFiles; this.esopFiles = esopFiles;
} }
public String getFactoryCode() { public String getFactoryCode() {
return factoryCode; return factoryCode;
} }
public void setFactoryCode(String factoryCode) { public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode; this.factoryCode = factoryCode;
} }
public String getProcessName() { public String getProcessName() {
return processName; return processName;
} }
public void setProcessName(String processName) { public void setProcessName(String processName) {
this.processName = processName; this.processName = processName;
} }
public String getProcessCode() { public String getProcessCode() {
return processCode; return processCode;
} }
public void setProcessCode(String processCode) { public void setProcessCode(String processCode) {
this.processCode = processCode; this.processCode = processCode;
} }
public String getWorkCenter() { public String getWorkCenter() {
return workCenter; return workCenter;
} }
public void setWorkCenter(String workCenter) { public void setWorkCenter(String workCenter) {
this.workCenter = workCenter; this.workCenter = workCenter;
} }
public String getProcessType() { public String getProcessType() {
return processType; return processType;
} }
public void setProcessType(String processType) { public void setProcessType(String processType) {
this.processType = processType; this.processType = processType;
} }
public List<FileJson> getProcessRouteFiles() { public List<FileJson> getProcessRouteFiles() {
return processRouteFiles; return processRouteFiles;
} }
public void setProcessRouteFiles(List<FileJson> processRouteFiles) { public void setProcessRouteFiles(List<FileJson> processRouteFiles) {
this.processRouteFiles = processRouteFiles; this.processRouteFiles = processRouteFiles;
} }
public List<FileJson> getEsopFiles() { public List<FileJson> getEsopFiles() {
return esopFiles; return esopFiles;
} }
public void setEsopFiles(List<FileJson> esopFiles) { public void setEsopFiles(List<FileJson> esopFiles) {
this.esopFiles = esopFiles; this.esopFiles = esopFiles;
} }
@Override @Override
public String toString() { public String toString() {
return "Process [factoryCode=" + factoryCode + ", processName=" + processName + ", processCode=" + processCode return "Process [factoryCode=" + factoryCode + ", processName=" + processName + ", processCode=" + processCode
@ -130,6 +96,4 @@ public class Process {
+ processRouteFiles + ", esopFiles=" + esopFiles + "]"; + processRouteFiles + ", esopFiles=" + esopFiles + "]";
} }
} }

@ -30,8 +30,8 @@ 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
@ -70,5 +70,3 @@ public class sendGXToMOMHandler extends AbstractHandler{
return null; return null;
} }
} }

@ -64,9 +64,14 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{
System.out.println(type); System.out.println(type);
if ("ZT2_FirstOPRevision".equals(type)) { if ("ZT2_FirstOPRevision".equals(type)) {
process.setProcessType("1"); process.setProcessType("1");
// FileJson fileJson = new FileJson();
List<FileJson> fileJsons = new ArrayList<FileJson>(); List<FileJson> fileJsons = new ArrayList<FileJson>();
// fileJsons.add(fileJson);
process.setProcessRouteFiles(fileJsons); process.setProcessRouteFiles(fileJsons);
List<FileJson> fileJsons1 = new ArrayList<FileJson>(); List<FileJson> fileJsons1 = new ArrayList<FileJson>();
// fileJsons1.add(fileJson);
process.setEsopFiles(fileJsons1); process.setEsopFiles(fileJsons1);
} else { } else {
process.setProcessType("2"); process.setProcessType("2");
@ -77,8 +82,10 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{
for (TCComponent component : referenceListProperty) { for (TCComponent component : referenceListProperty) {
String gxType = component.getStringProperty("object_type"); String gxType = component.getStringProperty("object_type");
if ("ZT2_ProcessRule".equals(gxType)) { if ("ZT2_ProcessRule".equals(gxType)) {
TCComponentItemRevision latestItemRevision = ((TCComponentItem)component).getLatestItemRevision(); TCComponentItemRevision latestItemRevision = ((TCComponentItem) component)
TCComponent[] referenceListProperty2 = latestItemRevision.getReferenceListProperty("IMAN_specification"); .getLatestItemRevision();
TCComponent[] referenceListProperty2 = latestItemRevision
.getReferenceListProperty("IMAN_specification");
if (referenceListProperty2 != null && referenceListProperty2.length > 0) { if (referenceListProperty2 != null && referenceListProperty2.length > 0) {
for (TCComponent component2 : referenceListProperty2) { for (TCComponent component2 : referenceListProperty2) {
String typePdf = component2.getStringProperty("object_type"); String typePdf = component2.getStringProperty("object_type");
@ -106,8 +113,10 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{
for (TCComponent component : referenceListProperty1) { for (TCComponent component : referenceListProperty1) {
String gxType = component.getStringProperty("object_type"); String gxType = component.getStringProperty("object_type");
if ("ZT2_ProcGuidBook".equals(gxType)) { if ("ZT2_ProcGuidBook".equals(gxType)) {
TCComponentItemRevision latestItemRevision = ((TCComponentItem)component).getLatestItemRevision(); TCComponentItemRevision latestItemRevision = ((TCComponentItem) component)
TCComponent[] referenceListProperty2 = latestItemRevision.getReferenceListProperty("IMAN_specification"); .getLatestItemRevision();
TCComponent[] referenceListProperty2 = latestItemRevision
.getReferenceListProperty("IMAN_specification");
if (referenceListProperty2 != null && referenceListProperty2.length > 0) { if (referenceListProperty2 != null && referenceListProperty2.length > 0) {
for (TCComponent component2 : referenceListProperty2) { for (TCComponent component2 : referenceListProperty2) {
String typePdf = component2.getStringProperty("object_type"); String typePdf = component2.getStringProperty("object_type");
@ -129,7 +138,6 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{
process.setEsopFiles(fileJsons1); process.setEsopFiles(fileJsons1);
} }
System.out.println("Òª·¢Ë͵ÄÊý¾Ý" + process.toString()); System.out.println("Òª·¢Ë͵ÄÊý¾Ý" + process.toString());
String json = JSON.toJSONString(process); String json = JSON.toJSONString(process);
@ -144,7 +152,6 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{
String sendJsonHttpPost = sendJsonHttpPost(url, json); String sendJsonHttpPost = sendJsonHttpPost(url, json);
JSONObject parseObject = JSONObject.parseObject(sendJsonHttpPost); JSONObject parseObject = JSONObject.parseObject(sendJsonHttpPost);
MessageBox.post(parseObject.getString("msg"), "Ìáʾ", MessageBox.INFORMATION); MessageBox.post(parseObject.getString("msg"), "Ìáʾ", MessageBox.INFORMATION);
} }

Loading…
Cancel
Save