freehalfadjust.java~1~
来自「银行信用评估系统」· JAVA~1~ 代码 · 共 602 行 · 第 1/2 页
JAVA~1~
602 行
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(null); jTextField1.setText(""); jTextField1.setBounds(new Rectangle(143, 50, 112, 20)); jButton1.setBounds(new Rectangle(301, 47, 76, 33)); jButton1.setFont(new java.awt.Font("Dialog", 1, 15)); jButton1.setText("调整"); jButton1.addActionListener(new FreeHalfAdjust_jButton1_actionAdapter(this)); jTextField2.setText(""); jTextField2.setBounds(new Rectangle(125, 168, 104, 21)); jLabel8.setBounds(new Rectangle(35, 169, 63, 22)); jLabel8.setText("用户号:"); jLabel8.setFont(new java.awt.Font("Dialog", 1, 15)); jTextField3.setText(""); jTextField3.setBounds(new Rectangle(126, 205, 104, 22)); jLabel16.setBounds(new Rectangle(18, 49, 123, 21)); jLabel16.setText("输入信用卡号:"); jLabel16.setFont(new java.awt.Font("Dialog", 1, 16)); jTextField5.setText(""); jTextField5.setBounds(new Rectangle(127, 275, 104, 22)); jLabel17.setBounds(new Rectangle(36, 238, 82, 24)); jLabel17.setText("用户等级:"); jLabel17.setFont(new java.awt.Font("Dialog", 1, 15)); jLabel18.setBounds(new Rectangle(79, 0, 295, 49)); jLabel18.setText("免担保半年调整"); jLabel18.setHorizontalAlignment(SwingConstants.CENTER); jLabel18.setDebugGraphicsOptions(0); jLabel18.setFont(new java.awt.Font("华文行楷", 1, 30)); jLabel19.setBounds(new Rectangle(147, 86, 161, 26)); jLabel19.setText("调整结果显示:"); jLabel19.setRequestFocusEnabled(true); jLabel19.setFont(new java.awt.Font("Dialog", 1, 20)); jTextField4.setBounds(new Rectangle(126, 240, 105, 20)); jTextField4.setText(""); jLabel110.setBounds(new Rectangle(36, 275, 87, 23)); jLabel110.setText("透支额度:"); jLabel110.setFont(new java.awt.Font("Dialog", 1, 15)); jLabel111.setBounds(new Rectangle(35, 206, 107, 20)); jLabel111.setText("信用卡性质:"); jLabel111.setFont(new java.awt.Font("Dialog", 1, 15)); jLabel1.setFont(new java.awt.Font("Dialog", 1, 18)); jLabel1.setText("担保人显示"); jLabel1.setBounds(new Rectangle(85, 126, 115, 18)); jLabel2.setBounds(new Rectangle(288, 124, 119, 18)); jLabel2.setText("被担保人显示"); jLabel2.setFont(new java.awt.Font("Dialog", 1, 18)); jTextField6.setEnabled(false); jTextField6.setBounds(new Rectangle(294, 168, 104, 21)); jTextField6.setText(""); jTextField7.setEnabled(false); jTextField7.setBounds(new Rectangle(295, 203, 104, 23)); jTextField7.setText(""); jTextField8.setEnabled(false); jTextField8.setText(""); jTextField8.setBounds(new Rectangle(295, 241, 105, 21)); jTextField9.setEnabled(false); jTextField9.setBounds(new Rectangle(296, 275, 104, 22)); jTextField9.setText(""); this.setBackground(new Color(217, 230, 236)); this.add(jLabel18, null); this.add(jLabel16, null); this.add(jLabel110, null); this.add(jTextField5, null); this.add(jLabel17, null); this.add(jTextField4, null); this.add(jLabel111, null); this.add(jTextField3, null); this.add(jTextField2, null); this.add(jLabel8, null); this.add(jLabel2, null); this.add(jTextField6, null); this.add(jTextField7, null); this.add(jTextField8, null); this.add(jTextField9, null); this.add(jLabel1, null); this.add(jTextField1, null); this.add(jButton1, null); this.add(jLabel19, null); 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 + -
显示快捷键?