|
|
|
@ -269,7 +269,7 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
if (delCompList.get(i) == findList.get(j).getCompId()) {
|
|
|
|
|
String sql = "delete from JD2_Component where test_id=?";
|
|
|
|
|
update(sql, findList.get(j).getCompId());
|
|
|
|
|
// System.out.println("移除了原本数据库就有的");
|
|
|
|
|
System.out.println("移除了原本数据库就有的");
|
|
|
|
|
findList.remove(j);
|
|
|
|
|
}
|
|
|
|
|
Iterator<ComponentBean> compIt = componentData.iterator();
|
|
|
|
@ -277,7 +277,7 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
int compid = compIt.next().getCompId();
|
|
|
|
|
if (delCompList.get(i) == compid) {
|
|
|
|
|
compIt.remove();
|
|
|
|
|
// System.out.println("初始结果集移除了一条");
|
|
|
|
|
System.out.println("初始结果集移除了一条");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -300,14 +300,17 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
}
|
|
|
|
|
if (flag) {
|
|
|
|
|
for (ComponentBean com : findList) {
|
|
|
|
|
System.out.println("状态" + com.getStage());
|
|
|
|
|
// System.out.println("状态" + com.getStage());
|
|
|
|
|
if (com.getStage() == 1) {
|
|
|
|
|
insert(com);
|
|
|
|
|
com.setStage(0);
|
|
|
|
|
selectId(com);
|
|
|
|
|
System.out.println("com的Id" + com.getCompId());
|
|
|
|
|
}
|
|
|
|
|
if (com.getStage() == 2) {
|
|
|
|
|
update(com);
|
|
|
|
|
com.setStage(0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
tableView0.refresh();
|
|
|
|
@ -519,6 +522,7 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
if (mac.getStage() == 1) {
|
|
|
|
|
insertMac(mac);
|
|
|
|
|
mac.setStage(0);
|
|
|
|
|
selectMacId(mac);
|
|
|
|
|
}
|
|
|
|
|
if (mac.getStage() == 2) {
|
|
|
|
|
updateMac(mac);
|
|
|
|
@ -576,6 +580,66 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
return results;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void selectId(ComponentBean com) {
|
|
|
|
|
String sql = "select component_id_seq.nextval from dual";
|
|
|
|
|
con = DBConnectionUtil.dbConn("infodba", "infodba");
|
|
|
|
|
try {
|
|
|
|
|
ps = con.prepareStatement(sql);
|
|
|
|
|
rs = ps.executeQuery();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
int id = rs.getInt(1) - 1;
|
|
|
|
|
System.out.println("id" + id);
|
|
|
|
|
com.setCompId(id);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.out.println("查找失败");
|
|
|
|
|
} finally {
|
|
|
|
|
if (ps != null) {
|
|
|
|
|
try {
|
|
|
|
|
ps.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (con != null) {
|
|
|
|
|
try {
|
|
|
|
|
con.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void selectMacId(MachineBean com) {
|
|
|
|
|
String sql = "select machine_id_seq.nextval from dual";
|
|
|
|
|
con = DBConnectionUtil.dbConn("infodba", "infodba");
|
|
|
|
|
try {
|
|
|
|
|
ps = con.prepareStatement(sql);
|
|
|
|
|
rs = ps.executeQuery();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
int id = rs.getInt(1);
|
|
|
|
|
com.setMacId(id);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
} finally {
|
|
|
|
|
if (ps != null) {
|
|
|
|
|
try {
|
|
|
|
|
ps.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (con != null) {
|
|
|
|
|
try {
|
|
|
|
|
con.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void insert(ComponentBean com) {
|
|
|
|
|
String sql = "insert into JD2_Component(test_type,test_project,test_time,test_num,test_cost) values(?,?,?,?,?)";
|
|
|
|
|
con = DBConnectionUtil.dbConn("infodba", "infodba");
|
|
|
|
@ -602,6 +666,20 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.out.println("Ìí¼Óʧ°Ü");
|
|
|
|
|
} finally {
|
|
|
|
|
if (ps != null) {
|
|
|
|
|
try {
|
|
|
|
|
ps.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (con != null) {
|
|
|
|
|
try {
|
|
|
|
|
con.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -627,6 +705,20 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.out.println("Ìí¼Óʧ°Ü");
|
|
|
|
|
} finally {
|
|
|
|
|
if (ps != null) {
|
|
|
|
|
try {
|
|
|
|
|
ps.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (con != null) {
|
|
|
|
|
try {
|
|
|
|
|
con.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -656,6 +748,20 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
} finally {
|
|
|
|
|
if (ps != null) {
|
|
|
|
|
try {
|
|
|
|
|
ps.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (con != null) {
|
|
|
|
|
try {
|
|
|
|
|
con.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -709,6 +815,20 @@ public class CSXWHDialog extends Application {
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
} finally {
|
|
|
|
|
if (ps != null) {
|
|
|
|
|
try {
|
|
|
|
|
ps.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (con != null) {
|
|
|
|
|
try {
|
|
|
|
|
con.close();
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|