freehalfadjust.java

来自「银行信用评估系统」· Java 代码 · 共 604 行 · 第 1/2 页

JAVA
604
字号
package management;import java.awt.*;import javax.swing.*;import com.borland.dx.sql.dataset.*;import java.sql.*;import com.borland.dx.sql.dataset.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class FreeHalfAdjust extends JPanel {  JTextField jTextField1 = new JTextField();  JButton jButton1 = new JButton();  Database database1 = new Database();  JTextField jTextField2 = new JTextField();  JLabel jLabel8 = new JLabel();  JTextField jTextField3 = new JTextField();  JLabel jLabel16 = new JLabel();  JTextField jTextField5 = new JTextField();  JLabel jLabel17 = new JLabel();  JLabel jLabel18 = new JLabel();  JLabel jLabel19 = new JLabel();  JTextField jTextField4 = new JTextField();  JLabel jLabel110 = new JLabel();  JLabel jLabel111 = new JLabel();  PreparedStatement pstmt;  PreparedStatement pstmt1;  PreparedStatement pstmt2;  PreparedStatement pstmt3;  Connection con;  String query;  String query1;  String query2;  String query3;  ResultSet rs;  ResultSet rs1;  ResultSet rs2;  ResultSet rs3;  String str;  String str1;  String str2;  String str3;  String str4;  String str5;  String str6;  String str7;  String str8;  String str9;  float a1,a2,b;  int a3,b1;  public FreeHalfAdjust() {    try {      jbInit();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  void jbInit() throws Exception {    this.setLayout(gridBagLayout1);    jTextField1.setText("");    jButton1.setBackground(new Color(151, 164, 203));    jButton1.setFont(new java.awt.Font("Dialog", 1, 15));    jButton1.setText("调整");    jButton1.addActionListener(new FreeHalfAdjust_jButton1_actionAdapter(this));    jTextField2.setText("");    jLabel8.setText("用户号:");    jLabel8.setFont(new java.awt.Font("Dialog", 1, 15));    jTextField3.setText("");    jLabel16.setText("输入信用卡号:");    jLabel16.setFont(new java.awt.Font("Dialog", 1, 16));    jTextField5.setText("");    jLabel17.setText("用户等级:");    jLabel17.setFont(new java.awt.Font("Dialog", 1, 15));    jLabel18.setText("免担保半年调整");    jLabel18.setHorizontalAlignment(SwingConstants.CENTER);    jLabel18.setDebugGraphicsOptions(0);    jLabel18.setFont(new java.awt.Font("华文行楷", 1, 30));    jLabel19.setText("调整结果显示:");    jLabel19.setRequestFocusEnabled(true);    jLabel19.setFont(new java.awt.Font("Dialog", 1, 15));    jTextField4.setText("");    jLabel110.setText("透支额度:");    jLabel110.setFont(new java.awt.Font("Dialog", 1, 15));    jLabel111.setText("信用卡性质:");    jLabel111.setFont(new java.awt.Font("Dialog", 1, 15));    jLabel1.setFont(new java.awt.Font("Dialog", 1, 18));    jLabel1.setText("担保人显示");    jLabel2.setText("被担保人显示");    jLabel2.setFont(new java.awt.Font("Dialog", 1, 18));    jTextField6.setEnabled(false);    jTextField6.setText("");    jTextField7.setEnabled(false);    jTextField7.setText("");    jTextField8.setEnabled(false);    jTextField8.setText("");    jTextField9.setEnabled(false);    jTextField9.setText("");    this.setBackground(new Color(217, 230, 236));    this.add(jLabel18,  new GridBagConstraints(1, 0, 5, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 15, 126), 56, 21));    this.add(jLabel16,  new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(49, 17, 0, 0), 5, -2));    this.add(jTextField5,  new GridBagConstraints(2, 6, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(14, 9, 22, 0), 139, 0));    this.add(jTextField4,  new GridBagConstraints(2, 5, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(18, 9, 0, 0), 137, -2));    this.add(jTextField3,  new GridBagConstraints(2, 4, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(15, 8, 0, 0), 138, 1));    this.add(jTextField2,  new GridBagConstraints(2, 3, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(27, 9, 0, 0), 137, -1));    this.add(jLabel1,  new GridBagConstraints(1, 2, 3, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(18, 0, 0, 76), 12, -8));    this.add(jTextField1,  new GridBagConstraints(3, 0, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(49, 0, 0, 0), 174, -2));    this.add(jTextField7,  new GridBagConstraints(4, 4, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(15, 28, 0, 41), 142, 1));    this.add(jTextField6,  new GridBagConstraints(4, 3, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(28, 27, 0, 41), 143, -1));    this.add(jTextField8,  new GridBagConstraints(4, 5, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(17, 28, 0, 41), 142, -1));    this.add(jTextField9,  new GridBagConstraints(4, 6, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(14, 29, 22, 41), 141, 0));    this.add(jLabel2,     new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(18, 24, 0, 73), 47, -8));    this.add(jLabel111,  new GridBagConstraints(0, 4, 2, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(22, 17, 0, 0), 2, -2));    this.add(jLabel8,  new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(30, 17, 0, 0), 0, 0));    this.add(jLabel17,  new GridBagConstraints(0, 5, 2, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(16, 17, 0, 14), 3, 2));    this.add(jLabel110,  new GridBagConstraints(0, 6, 2, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(14, 17, 22, 8), 8, 1));    this.add(jLabel19,  new GridBagConstraints(3, 1, 2, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(13, 6, 0, 15), 12, -3));    this.add(jButton1,  new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(42, 31, 0, 64), 1, -3));    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");    String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=CCES";    String username= "sa";    String password= "";    con = DriverManager.getConnection(url,username,password);    jTextField2.setEnabled(false);    jTextField3.setEnabled(false);    jTextField4.setEnabled(false);    jTextField5.setEnabled(false);    jTextField6.setEnabled(false);    jTextField7.setEnabled(false);    jTextField8.setEnabled(false);    jTextField9.setEnabled(false);  } public int UseRecordadjust(float a1,float a2,int a3,float a4,String b) {//a1表示存款余额,a2表示使用金额,a3表示使用次数,a4表示月累计透支额,b表示使用状态   PreparedStatement pstmt4;   ResultSet rs4;     String query4[]=new String[5];     String strb[] = new String[5];     String str0=null;     int sum=0;   try{      //月均存款余额       if (a1 >=3000)  {query4[0] = "select Yjcky3 from UseInstance"; strb[0] = "Yjcky3";}       else if ( (a1 < 3000) && (a1 >= 1500)) {query4[0] = "select Yjcky3_15 from UseInstance"; strb[0] = "Yjcky3_15"; }       else if ( (a1 < 1500) && (a1 >= 500)) {query4[0] = "select Yjcky15_5 from UseInstance"; strb[0] = "Yjcky15_5";}       else if ( (a1 < 500) && (a1 >= 100)) {query4[0] = "select Yjcky5_1 from UseInstance";strb[0] = "Yjcky5_1";}       else {query4[0] = "select Yjcky1 from UseInstance";strb[0] = "Yjcky1";}        pstmt4 = con.prepareStatement(query4[0]);        rs4=pstmt4.executeQuery();        if(rs4.next()){          str0 = rs4.getString(strb[0]); //调整分        }        sum = Integer.parseInt(str0);       //月均累计透支额       if (a4 >= 5000) {query4[1] = "select Yjljtz5 from UseInstance";strb[1] = "Yjljtz5";}       else if ( (a4 < 5000) && (a4 >= 2000)) {query4[1] = "select Yjljtz2_5 from UseInstance";strb[1] = "Yjljtz2_5";}       else if ( (a4 < 2000) && (a4 >= 1000)) {query4[1] = "select Yjljtz1_2 from UseInstance";strb[1] = "Yjljtz1_2";}       else if ( (a4 < 1000) && (a4 >= 100)) {query4[1] = "select Yjljtz1_1 from UseInstance";strb[1] = "Yjljtz1_1";}       else  {query4[1] = "select Yjljtz1 from UseInstance";strb[1] = "Yjljtz1";}       pstmt4 = con.prepareStatement(query4[1]);       rs4=pstmt4.executeQuery();       if(rs4.next()){        str0 = rs4.getString(strb[1]); //调整分       }       sum += Integer.parseInt(str0);       //月均消费额       if (a2 >= 10000) {query4[3] = "select Yjxf1 from UseInstance";strb[3] = "Yjxf1";}       else if ( (a2 < 10000) && (a2 >= 5000)) {query4[3] = "select Yjxf5_1 from UseInstance";strb[3] = "Yjxf5_1";}       else if ( (a2 < 5000) && (a2 >= 500)) {query4[3] = "select Yjxf5_5 from UseInstance";strb[3] = "Yjxf5_5";}       else if ( (a3 < 500) && (a3 > 0)) {query4[3] = "select Yjxf5 from UseInstance";strb[3] = "Yjxf5";}       else  {query4[3] = "select Yjxf0 from UseInstance";strb[3] = "Yjxf0";}       pstmt4 = con.prepareStatement(query4[3]);       rs4=pstmt4.executeQuery();       if(rs4.next()){        str0 = rs4.getString(strb[3]); //调整分       }       sum += Integer.parseInt(str0);      // jTextField5.setText(Integer.toString(sum));   if(b!="透支"){   //月均消费次数       if (a3 > 10) {query4[2] = "select Yjxfcs10 from UseInstance";strb[2] = "Yjxfcs10";}       else if ( (a3 <= 9) && (a3 >= 6)) {query4[2] = "select Yjxfcs6_9 from UseInstance";strb[2] = "Yjxfcs6_9";}       else if ( (a3 <= 5) && (a3 >= 3)) {query4[2] = "select Yjxfcs3_5 from UseInstance";strb[2] = "Yjxfcs3_5";}       else if ( (a3 <= 2) && (a3 > 0)) {query4[2] = "select Yjxfcs2 from UseInstance";strb[2] = "Yjxfcs2";}       else  {query4[2] = "select Yjxfcs0 from UseInstance"; strb[2] = "Yjxfcs0";}       pstmt4 = con.prepareStatement(query4[2]);       rs4=pstmt4.executeQuery();       if(rs4.next()){        str0 = rs4.getString(strb[2]); //调整分       }       sum += Integer.parseInt(str0);     }    else   //已还款透支次数     {       if (a3 > 10) {query4[4] = "select Yhktzcs10 from UseInstance";strb[4] = "Yhktzcs10";}       else if ( (a3 <= 9) && (a3 >= 6)) {query4[4] = "select Yhktzcs6_9 from UseInstance";strb[4] = "Yhktzcs6_9";}       else if ( (a3 <= 5) && (a3 >= 3)) {query4[4] = "select Yhktzcs3_5 from UseInstance";strb[4] = "Yhktzcs3_5";}       else if ( (a3 <= 2) && (a3 > 0)) {query4[4] = "select Yhktzcs2 from UseInstance";strb[4] = "Yhktzcs2";}       else  {query4[4] = "select Yhktzcs0 from UseInstance";strb[4] = "Yhktzcs0";}       pstmt4 = con.prepareStatement(query4[4]);       rs4=pstmt4.executeQuery();       if(rs4.next()){        str0 = rs4.getString(strb[4]); //调整分       }       sum += Integer.parseInt(str0);    }   }   catch(Exception ef)        { System.out.print("系统错误,请重新运行。");         }   return sum; }public int Badrecordadjust(String strx){   PreparedStatement pstmt5;   PreparedStatement pstmt6;   ResultSet rs5;   ResultSet rs6;   String strx0 = null;   String strx01 = null;   String queryb=null;   String queryx[] = new String[3];   String strbl =null;   String strbx[] = new String[4];   String strbx1[] = new String[3];   int sum1=0;  try{        String bljl="select UserId from UserMoral";        Statement ps;        ps=con.createStatement();        rs6=ps.executeQuery(bljl);        String del=null;        while(rs6.next()){         del=rs6.getString("UserId");         if(del.trim().equals(strx)){        queryb= "select BadRecdId from UserMoral where UserId=?";        pstmt5 = con.prepareStatement(queryb);        pstmt5.setString(1,strx);        rs5=pstmt5.executeQuery();        if(rs5.next()){        strbl=rs5.getString("BadRecdId");   //不良记录号        jTextField5.setText(strbl);        }        queryb= "select UnOverdraft,BadRecord,CriminalRecord,OtherDebt from Badrecord where BadRecdId=?";        pstmt5 = con.prepareStatement(queryb);        pstmt5.setString(1,strbl);        rs5=pstmt5.executeQuery();        if(rs5.next()){        strbx[0]=rs5.getString("UnOverdraft");   //有非正常透支        strbx[1]=rs5.getString("BadRecord");     //在我行贷款有 不良行为        strbx[2]=rs5.getString("CriminalRecord");  //涉嫌犯罪或正受法律处罚和调查        strbx[3]=rs5.getString("OtherDebt");  //其它未偿还的债务      }      //有非正常透支      if(strbx[0]!=null) {        if (strbx[0].trim().equals("逾期透支")) {          queryx[0] = "select Yqoverdraft from Unlrecord ";          strbx1[0] = "Yqoverdraft";        }        else if (strbx[0].trim().equals("呆滞透支")) {          queryx[0] = "select Dxoverdraft from Unlrecord";

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?