📄 movedatagui.java
字号:
jRadioButton3.setSelected(true);
group_workChange_3.add (jRadioButton5);
group_workChange_3.add (jRadioButton6);
jRadioButton5.setSelected(true);
jPanel2.add(jButton_Excel, null);
jPanel2.add(jButton4, null);
jPanel2.add(jButton1, null);
jPanel2.add(jButton10, null);
jPanel2.add(jButton9, null);
jPanel2.add(jButton2, null);
jPanel2.add(jButton3, null);
jPanel1.add(jLabel1, new PaneConstraints("jLabel1", "jLabel1", PaneConstraints.ROOT, 0.5f));
jPanel1.add(jProgressBar1, new PaneConstraints("jProgressBar1", "jLabel1", PaneConstraints.BOTTOM, 0.44897962f));
jPanel3.add(jPanel2, "jPanel2");
this.getContentPane().add(jPanel3, null);
jPanel3.add(jPanel1, "jPanel1");
jPanel3.add(jPanel5, "jPanel5");
jPanel5.add(jButton5, null);
jPanel5.add(jButton6, null);
this.getContentPane().add(jCheckBox2, null);
this.getContentPane().add(statusBar, null);
jPanel9.add(jRadioButton1, null);
jPanel9.add(jRadioButton2, null);
jPanel9.add(jTextArea6, null);
jPanel9.add(jTextArea5, null);
jPanel6.add(jPanel7, "jPanel7");
jPanel7.add(jTextArea2, null);
jPanel7.add(jRadioButton4, null);
jPanel7.add(jTextArea1, null);
jPanel7.add(jRadioButton3, null);
jPanel6.add(jPanel8, "jPanel9");
jPanel6.add(jPanel10, "jPanel10");
jPanel6.add(jPanel9, "jPanel6");
jPanel10.add(jLabel6, null);
jPanel10.add(jLabel3, null);
jPanel10.add(jLabel7, null);
jPanel10.add(jLabel5, null);
jPanel10.add(jLabel8, null);
jPanel10.add(jLabel4, null);
jPanel10.add(jLabel9, null);
jPanel8.add(jRadioButton6, null);
jPanel8.add(jRadioButton5, null);
jPanel8.add(jTextArea4, null);
jPanel8.add(jTextArea3, null);
this.getContentPane().add(jPanel12, null);
jPanel12.add(selectpanel, null);
jPanel12.add(jPanel11, null);
jPanel11.add(panel1, new PaneConstraints("panel1", "panel1", PaneConstraints.ROOT, 1.0f));
panel1.add(jPanel4, "jPanel4");
jPanel11.add(jPanel6, new PaneConstraints("jPanel6", "panel1", PaneConstraints.RIGHT, 0.47923324f));
jPanel4.add(jLabel2, new PaneConstraints("jLabel2", "jLabel2", PaneConstraints.ROOT, 0.5f));
selectpanel.setVisible(false);
jPanel8.setVisible(false);
jPanel9.setVisible(false);
jPanel10.setVisible(false);
jRadioButton1.addActionListener(new java.awt.event.ActionListener (){
public void actionPerformed(ActionEvent e) {
jRadioButton1_actionPerformed(e);
}
});
jRadioButton2.addActionListener(new java.awt.event.ActionListener (){
public void actionPerformed(ActionEvent e) {
jRadioButton2_actionPerformed(e);
}
});
}
void jButton2_actionPerformed(ActionEvent e) {
jPanel1.setVisible(true);
jPanel2.setVisible(false);
getAreacode();
ThreadRun();
}
/**
*
*得到区域编码
**/
/**
**功能:提供中断数据恢复数据升级操作
**/
private void getAreacode(){
LineNum=(Integer.valueOf(RWConfig.ReadControl())).intValue();
if(LineNum==_ENDFLAG)
{
JOptionPane.showConfirmDialog(this, "数据库结构已完成更新!", "提示",
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}//END IF
else if(LineNum==_STRFLAG)
{
selectValue=JOptionPane.showConfirmDialog(this, "请确认在数据迁移前已备份数据库!继续吗?", "提示",
JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
if(selectValue==JOptionPane.NO_OPTION)
System.exit(0);;
}//END IF
/*界面选择区域编码(存在多个区域编码)*/
try{
Vector Para_code=new Vector();
Statement QueryAStatement = conn.createStatement();
String sql_A="select 区域编码 from 区域";
ResultSet QueryAResult=QueryAStatement.executeQuery(sql_A);
while(QueryAResult.next()){
bmtmp=QueryAResult.getString(1);
Para_code.addElement(bmtmp);
}//end while
QueryAStatement.close();
QueryAResult.close();
if(Para_code.size()>1)
{
SelectCode Sgui=new SelectCode(Para_code);
Sgui.setLocation((BaseGui.screenSize.width - BaseGui.frameSize.width-100) / 2,
(BaseGui.screenSize.height - BaseGui.frameSize.height+100) / 2);
Sgui.setSize(365,60);
Sgui.show();
bmtmp=Sgui.ComboxId;
}//end if
}//end try
catch (java.sql.SQLException se)
{
System.out.println(se);
}
}
/**
*
*线程控制转换进度
**/
private void ThreadRun(){
Debug.print("come in ThreadRun");
jRadioButton1.setVisible(false);
jRadioButton2.setVisible(false);
Thread oTread = new Thread(new runCourse(conn,
jLabel1,
jProgressBar1,
jPanel1,
jPanel2,
bmtmp,
Const.PD_CREATEDB,
jLabel3,
jLabel4,
jLabel8,
jLabel9,
this
));
oTread.start();
/*线程停止*/
if(oTread.isAlive()==false)
this.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jButton4.setVisible(true);
jButton2.setVisible(false);
jButton9.setVisible(false);
jButton10.setVisible(false);
jButton_Excel.setVisible(true);
}
void jButton3_actionPerformed(ActionEvent e) {
System.exit(0);
}
void jButton1_actionPerformed(ActionEvent e) {
}
//Overridden so we can exit when window is closed
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
selectValue=JOptionPane.showConfirmDialog(this, "中断数据转换吗!", "提示",
JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
if(selectValue==JOptionPane.YES_OPTION)
System.exit(0);
else
this.setVisible(true);
}
}
/**/
void jRadioButton1_actionPerformed(ActionEvent e){
jPanel4.setVisible(true);
selectpanel.setVisible(false);
jPanel5.setVisible(false);
jPanel2.setVisible(true);
jRadioButton1.setEnabled(true);
jRadioButton1.setSelected(true);
jRadioButton2.setEnabled(true);
_updateZ(0);
}
void jRadioButton2_actionPerformed(ActionEvent e){
selectpanel.setVisible(true);
jPanel4.setVisible(false);
jPanel2.setVisible(false);
jPanel5.setVisible(true);
jRadioButton1.setEnabled(false);
jRadioButton2.setEnabled(false);
jCheckBox2.setVisible(true);
}
/**
* 功能转换完成后清理临时中间表数据
*
*/
void jButton4_actionPerformed(ActionEvent e) {
selectValue=JOptionPane.showConfirmDialog(this, "数据库迁移升级确认完成吗?\n确认后数据的录入请使用系统的\n数据录入功能或EXCEL数据导入功能\n调整数据!", "提示",
JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
if(selectValue==JOptionPane.YES_OPTION)
{
this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
new DeleteMiddleTable(conn,Const.PD_DROPTABLE);
this.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
}
else
return;
RWConfig.writeControl(Const.FINISH_FLAG);
System.exit(0);
}
void jButton6_actionPerformed(ActionEvent e) {
jPanel4.setVisible(true);
selectpanel.setVisible(false);
jPanel5.setVisible(false);
jPanel2.setVisible(true);
jRadioButton1.setEnabled(true);
jRadioButton1.setSelected(true);
jRadioButton2.setEnabled(true);
jCheckBox2.setVisible(false);
}
void reback(){
jPanel4.setVisible(true);
selectpanel.setVisible(false);
jPanel5.setVisible(false);
jPanel2.setVisible(true);
jRadioButton1.setEnabled(true);
jRadioButton1.setSelected(true);
jRadioButton2.setEnabled(true);
jCheckBox2.setVisible(false);
}
/**自定义表迁移事件*/
void jButton5_actionPerformed(ActionEvent e) {
int fristFlag=0;
String I_TABLENAME=null;
String I_sql=null;
String ctablename=null;
boolean error_flag=false;
Vector NewUtablename=new Vector();
this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
try{
Statement I_SqlStatement = conn.createStatement();
ResultSet I_selsqlResultSet=null;
if(SelectPanel.uTablename.size()!=0)
{
conn.setAutoCommit(false);
/*uTablename Vector 重排序*/
for(int j=0;j<SelectPanel.uTablename.size();j++)
{
I_sql="select ctablename from zjdy_t where ctablename='"+(String)SelectPanel.uTablename.elementAt(j)+"' order by ser";
I_selsqlResultSet=I_SqlStatement.executeQuery(I_sql);
I_selsqlResultSet.next();
ctablename=I_selsqlResultSet.getString(1);
Debug.print("checkbox11111===="+ctablename);
NewUtablename.addElement(ctablename);
}
for(int i=0;i<NewUtablename.size();i++)
{
statusBar.setText("正在删除中间数据表!请稍候.....");
I_sql="select I_TABLENAME from zjdy_t where ctablename='"+NewUtablename.elementAt(i)+"'";
I_selsqlResultSet=I_SqlStatement.executeQuery(I_sql);
I_selsqlResultSet.next();
I_TABLENAME=I_selsqlResultSet.getString(1);
/*此处可加个vector排序对zjdy_t的ser*/
/*删除中间表*/
error_flag=deleteI_table("delete from I_PCDM."+I_TABLENAME,I_TABLENAME);
updateZtable((String)SelectPanel.uTablename.elementAt(i),fristFlag);
Debug.print("checkbox===="+(String)SelectPanel.uTablename.elementAt(i));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -