+
+
+
+
+
+
\ No newline at end of file
diff --git a/Bank.iml b/Bank.iml
new file mode 100644
index 0000000..b2abfee
--- /dev/null
+++ b/Bank.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/IDCard.java b/IDCard.java
deleted file mode 100644
index 91ed644..0000000
--- a/IDCard.java
+++ /dev/null
@@ -1,215 +0,0 @@
-package com.mobanker.framework.utils;
-
-import java.util.HashMap;
-
-/**
- * Created by dongruixi on 2016/10/2.
- */
-public class IDCard {
-
- private String _codeError;
-
- //wi =2(n-1)(mod 11)
- final int[] wi = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1};
- // verify digit
- final int[] vi = {1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2};
- private int[] ai = new int[18];
- private static String[] _areaCode = {"11", "12", "13", "14", "15", "21", "22"
- , "23", "31", "32", "33", "34", "35", "36", "37", "41", "42", "43", "44"
- , "45", "46", "50", "51", "52", "53", "54", "61", "62", "63", "64", "65", "71", "81", "82", "91"};
- private static HashMap dateMap;
- private static HashMap areaCodeMap;
-
- static {
- dateMap = new HashMap();
- dateMap.put("01", 31);
- dateMap.put("02", null);
- dateMap.put("03", 31);
- dateMap.put("04", 30);
- dateMap.put("05", 31);
- dateMap.put("06", 30);
- dateMap.put("07", 31);
- dateMap.put("08", 31);
- dateMap.put("09", 30);
- dateMap.put("10", 31);
- dateMap.put("11", 30);
- dateMap.put("12", 31);
- areaCodeMap = new HashMap();
- for (String code : _areaCode) {
- areaCodeMap.put(code, null);
- }
- }
-
- //验证身份证位数,15位和18位身份证
- public boolean verifyLength(String code) {
- int length = code.length();
- if (length == 15 || length == 18) {
- return true;
- } else {
- _codeError = "错误:输入的身份证号不是15位和18位的";
- return false;
- }
- }
-
- //判断地区码
- public boolean verifyAreaCode(String code) {
- String areaCode = code.substring(0, 2);
-// Element child= _areaCodeElement.getChild("_"+areaCode);
- if (areaCodeMap.containsKey(areaCode)) {
- return true;
- } else {
- _codeError = "错误:输入的身份证号的地区码(1-2位)[" + areaCode + "]不符合中国行政区划分代码规定(GB/T2260-1999)";
- return false;
- }
- }
-
- //判断月份和日期
- public boolean verifyBirthdayCode(String code) {
- //验证月份
- String month = code.substring(10, 12);
- boolean isEighteenCode = (18 == code.length());
- if (!dateMap.containsKey(month)) {
- _codeError = "错误:输入的身份证号" + (isEighteenCode ? "(11-12位)" : "(9-10位)") + "不存在[" + month + "]月份,不符合要求(GB/T7408)";
- return false;
- }
- //验证日期
- String dayCode = code.substring(12, 14);
- Integer day = dateMap.get(month);
- String yearCode = code.substring(6, 10);
- Integer year = Integer.valueOf(yearCode);
-
- //非2月的情况
- if (day != null) {
- if (Integer.valueOf(dayCode) > day || Integer.valueOf(dayCode) < 1) {
- _codeError = "错误:输入的身份证号" + (isEighteenCode ? "(13-14位)" : "(11-13位)") + "[" + dayCode + "]号不符合小月1-30天大月1-31天的规定(GB/T7408)";
- return false;
- }
- }
- //2月的情况
- else {
- //闰月的情况
- if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
- if (Integer.valueOf(dayCode) > 29 || Integer.valueOf(dayCode) < 1) {
- _codeError = "错误:输入的身份证号" + (isEighteenCode ? "(13-14位)" : "(11-13位)") + "[" + dayCode + "]号在" + year + "闰年的情况下未符合1-29号的规定(GB/T7408)";
- return false;
- }
- }
- //非闰月的情况
- else {
- if (Integer.valueOf(dayCode) > 28 || Integer.valueOf(dayCode) < 1) {
- _codeError = "错误:输入的身份证号" + (isEighteenCode ? "(13-14位)" : "(11-13位)") + "[" + dayCode + "]号在" + year + "平年的情况下未符合1-28号的规定(GB/T7408)";
- return false;
- }
- }
- }
- return true;
- }
-
- //验证身份除了最后位其他的是否包含字母
- public boolean containsAllNumber(String code) {
- String str = "";
- if (code.length() == 15) {
- str = code.substring(0, 15);
- } else if (code.length() == 18) {
- str = code.substring(0, 17);
- }
- char[] ch = str.toCharArray();
- for (int i = 0; i < ch.length; i++) {
- if (!(ch[i] >= '0' && ch[i] <= '9')) {
- _codeError = "错误:输入的身份证号第" + (i + 1) + "位包含字母";
- return false;
- }
- }
- return true;
- }
-
- public String getCodeError() {
- return _codeError;
- }
-
- //验证身份证
- public boolean verify(String idcard) {
- _codeError = "";
- //验证身份证位数,15位和18位身份证
- if (!verifyLength(idcard)) {
- return false;
- }
- //验证身份除了最后位其他的是否包含字母
- if (!containsAllNumber(idcard)) {
- return false;
- }
-
- //如果是15位的就转成18位的身份证
- String eifhteencard = "";
- if (idcard.length() == 15) {
- eifhteencard = uptoeighteen(idcard);
- } else {
- eifhteencard = idcard;
- }
- //验证身份证的地区码
- if (!verifyAreaCode(eifhteencard)) {
- return false;
- }
- //判断月份和日期
- if (!verifyBirthdayCode(eifhteencard)) {
- return false;
- }
- //验证18位校验码,校验码采用ISO 7064:1983,MOD 11-2 校验码系统
- if (!verifyMOD(eifhteencard)) {
- return false;
- }
- return true;
- }
-
- //验证18位校验码,校验码采用ISO 7064:1983,MOD 11-2 校验码系统
- public boolean verifyMOD(String code) {
- String verify = code.substring(17, 18);
- if ("x".equals(verify)) {
- code = code.replaceAll("x", "X");
- verify = "X";
- }
- String verifyIndex = getVerify(code);
- if (verify.equals(verifyIndex)) {
- return true;
- }
-// int x=17;
-// if(code.length()==15){
-// x=14;
-// }
- _codeError = "错误:输入的身份证号最末尾的数字验证码错误";
- return false;
- }
-
- //获得校验位
- public String getVerify(String eightcardid) {
- int remaining = 0;
-
- if (eightcardid.length() == 18) {
- eightcardid = eightcardid.substring(0, 17);
- }
-
- if (eightcardid.length() == 17) {
- int sum = 0;
- for (int i = 0; i < 17; i++) {
- String k = eightcardid.substring(i, i + 1);
- ai[i] = Integer.parseInt(k);
- }
-
- for (int i = 0; i < 17; i++) {
- sum = sum + wi[i] * ai[i];
- }
- remaining = sum % 11;
- }
-
- return remaining == 2 ? "X" : String.valueOf(vi[remaining]);
- }
-
- //15位转18位身份证
- public String uptoeighteen(String fifteencardid) {
- String eightcardid = fifteencardid.substring(0, 6);
- eightcardid = eightcardid + "19";
- eightcardid = eightcardid + fifteencardid.substring(6, 15);
- eightcardid = eightcardid + getVerify(eightcardid);
- return eightcardid;
- }
-}
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 23cb790..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- {description}
- Copyright (C) {year} {fullname}
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- {signature of Ty Coon}, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..b93a864
--- /dev/null
+++ b/README.txt
@@ -0,0 +1 @@
+Swing+MySQL
\ No newline at end of file
diff --git a/out/production/Bank/com/company/Loan$1.class b/out/production/Bank/com/company/Loan$1.class
new file mode 100644
index 0000000..62da50c
Binary files /dev/null and b/out/production/Bank/com/company/Loan$1.class differ
diff --git a/out/production/Bank/com/company/Loan$2.class b/out/production/Bank/com/company/Loan$2.class
new file mode 100644
index 0000000..0abc931
Binary files /dev/null and b/out/production/Bank/com/company/Loan$2.class differ
diff --git a/out/production/Bank/com/company/Loan.class b/out/production/Bank/com/company/Loan.class
new file mode 100644
index 0000000..cf55804
Binary files /dev/null and b/out/production/Bank/com/company/Loan.class differ
diff --git a/out/production/Bank/com/company/Login$1.class b/out/production/Bank/com/company/Login$1.class
new file mode 100644
index 0000000..efd401d
Binary files /dev/null and b/out/production/Bank/com/company/Login$1.class differ
diff --git a/out/production/Bank/com/company/Login$2.class b/out/production/Bank/com/company/Login$2.class
new file mode 100644
index 0000000..7ba2b30
Binary files /dev/null and b/out/production/Bank/com/company/Login$2.class differ
diff --git a/out/production/Bank/com/company/Login.class b/out/production/Bank/com/company/Login.class
new file mode 100644
index 0000000..0f27107
Binary files /dev/null and b/out/production/Bank/com/company/Login.class differ
diff --git a/out/production/Bank/com/company/Main.class b/out/production/Bank/com/company/Main.class
new file mode 100644
index 0000000..1a93b10
Binary files /dev/null and b/out/production/Bank/com/company/Main.class differ
diff --git a/out/production/Bank/com/company/PayPlan.class b/out/production/Bank/com/company/PayPlan.class
new file mode 100644
index 0000000..041c410
Binary files /dev/null and b/out/production/Bank/com/company/PayPlan.class differ
diff --git a/out/production/Bank/com/company/Record.class b/out/production/Bank/com/company/Record.class
new file mode 100644
index 0000000..fec2635
Binary files /dev/null and b/out/production/Bank/com/company/Record.class differ
diff --git a/out/production/Bank/com/company/Repay$1.class b/out/production/Bank/com/company/Repay$1.class
new file mode 100644
index 0000000..51bbf96
Binary files /dev/null and b/out/production/Bank/com/company/Repay$1.class differ
diff --git a/out/production/Bank/com/company/Repay$2.class b/out/production/Bank/com/company/Repay$2.class
new file mode 100644
index 0000000..51a2603
Binary files /dev/null and b/out/production/Bank/com/company/Repay$2.class differ
diff --git a/out/production/Bank/com/company/Repay.class b/out/production/Bank/com/company/Repay.class
new file mode 100644
index 0000000..7d40416
Binary files /dev/null and b/out/production/Bank/com/company/Repay.class differ
diff --git a/out/production/Bank/com/company/TableEditor$1.class b/out/production/Bank/com/company/TableEditor$1.class
new file mode 100644
index 0000000..81de68c
Binary files /dev/null and b/out/production/Bank/com/company/TableEditor$1.class differ
diff --git a/out/production/Bank/com/company/TableEditor.class b/out/production/Bank/com/company/TableEditor.class
new file mode 100644
index 0000000..f0232d2
Binary files /dev/null and b/out/production/Bank/com/company/TableEditor.class differ
diff --git a/out/production/Bank/com/company/TableRender.class b/out/production/Bank/com/company/TableRender.class
new file mode 100644
index 0000000..12c5cbb
Binary files /dev/null and b/out/production/Bank/com/company/TableRender.class differ
diff --git a/out/production/Bank/com/company/client.class b/out/production/Bank/com/company/client.class
new file mode 100644
index 0000000..02f5f40
Binary files /dev/null and b/out/production/Bank/com/company/client.class differ
diff --git a/src/com/company/Loan.java b/src/com/company/Loan.java
new file mode 100644
index 0000000..4e4058e
--- /dev/null
+++ b/src/com/company/Loan.java
@@ -0,0 +1,111 @@
+package com.company;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.sql.*;
+import static com.company.Login.nam;
+
+/**
+ * Created by wuyan on 2017/8/22.
+ */
+public class Loan extends JPanel {
+ JPanel jp = new JPanel();
+ JPanel jp1 = new JPanel();
+ JPanel jp2 = new JPanel();
+ JPanel jp3 = new JPanel();
+ JPanel jp4=new JPanel();
+ JLabel jl1, jl2, jl3, jl4;
+ JButton jb1, jb2;
+ JTextField jf1, jf2,jf3;
+
+ Connection conn = null;
+ Statement statement = null;
+ int in1,in2,in3;
+
+ public Loan() {
+ jl1 = new JLabel("贷款金额(单位:元)");
+ JComboBox comboBox_money=new JComboBox();
+ for (int i = 1; i <6 ; i++) {
+ comboBox_money.addItem(1000*i);
+ }
+ comboBox_money.setPreferredSize(new Dimension(70,20));
+ comboBox_money.setBackground(Color.white);
+
+ jl2 = new JLabel("贷款时间(单位:月) ");
+ JComboBox comboBox_month=new JComboBox();
+ for (int i = 5; i <13 ; i++) {
+ comboBox_month.addItem(i); //时间选框
+ }
+ comboBox_month.setPreferredSize(new Dimension(50,20));
+ comboBox_month.setBackground(Color.white);
+ jl4 = new JLabel("还款期数(单位:期)");
+ JComboBox comboBox=new JComboBox();
+ for (int i = 5; i <13 ; i++) {
+ comboBox.addItem(i); //期数选框
+ }
+ comboBox.setPreferredSize(new Dimension(50,20));
+ comboBox.setBackground(Color.white);
+ jb1 = new JButton("确认");
+ jb2 = new JButton("取消");
+ jp1.add(jl1);
+ jp1.add(comboBox_money);
+ jp2.add(jl2);
+ jp2.add(comboBox_month);
+ jp4.add(jl4);
+ jp4.add(comboBox);
+ jp3.add(jb1);
+ jp3.add(jb2);
+ jp.setLayout(new GridLayout(4,1));
+ jp.add(jp1);
+ jp.add(jp2);
+ jp.add(jp4);
+ jp.add(jp3);
+
+ jb1.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ String str = comboBox_money.getSelectedItem().toString();
+ in1= Integer.parseInt(str);//贷款金额
+ String str2=comboBox_month.getSelectedItem().toString();
+ in2=Integer.parseInt(str2);//贷款时间
+ String str3=comboBox.getSelectedItem().toString();
+ in3=Integer.parseInt(str3);//贷款期数
+ JOptionPane.showMessageDialog(null,"贷款成功!");
+ try {
+ Driver driver = new com.mysql.jdbc.Driver();
+ DriverManager.registerDriver(driver);
+ String url = "jdbc:mysql://192.168.1.214:3306/test";
+ String user = "root";
+ String password = "chengce214";
+ conn = DriverManager.getConnection(url, user, password);
+ statement = conn.createStatement();
+ String sql = "UPDATE test_wuyan SET total='"+in1+"',n='"+in2+"',agv='"+in3+"',loan_time=now() WHERE NAME ='"+nam+"'";
+ statement.executeUpdate(sql);
+ }
+ catch (SQLException ee) {
+ ee.printStackTrace();
+ }finally {
+ try {
+ if(conn!=null) {
+ conn.close();
+ }
+ statement.close();
+ } catch (SQLException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ });
+ jb2.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ System.exit(0);
+ }
+ });
+ this.add(jp);
+ this.setVisible(true);
+ this.setSize(600, 400);
+ }
+}
\ No newline at end of file
diff --git a/src/com/company/Login.java b/src/com/company/Login.java
new file mode 100644
index 0000000..b5c5034
--- /dev/null
+++ b/src/com/company/Login.java
@@ -0,0 +1,109 @@
+package com.company;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.sql.*;
+
+/**
+ * Created by wuyan on 2017/8/22.
+ */
+public class Login extends JFrame{
+ JButton jb1,jb2;
+ JTextField jtf;
+ JPasswordField jpwd;
+ JLabel jl1,jl2;
+ JPanel jp1,jp2,jp3;
+
+ Connection conn = null;
+ Statement statement = null;
+ ResultSet res = null;
+ String InName;
+ String InPwd;
+ public static String nam,ID,pw;
+
+ public Login() {
+ jb1 = new JButton("确认");
+ jb2 = new JButton("取消");
+
+ jtf = new JTextField(10);
+ jpwd = new JPasswordField(10);
+
+ jl1 = new JLabel("账号:");
+ jl2 = new JLabel("密码:");
+
+ jp1 = new JPanel();
+ jp2 = new JPanel();
+ jp3 = new JPanel();
+ this.setLayout(new GridLayout(3, 1, 5, 5));
+
+ jp1.add(jl1);
+ jp1.add(jtf);
+
+ jp2.add(jl2);
+ jp2.add(jpwd);
+
+ jp3.add(jb1);
+ jp3.add(jb2);
+
+ this.add(jp1);
+ this.add(jp2);
+ this.add(jp3);
+ this.setTitle("登录界面");
+ this.setSize(280, 160);
+ this.setLocation(800, 400);
+ this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ this.setVisible(true);
+ jb1.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ try {
+ InName=jtf.getText().trim();
+ InPwd=String.valueOf(jpwd.getPassword());
+ System.out.println(InName);
+ System.out.println(InPwd);
+ Driver driver = new com.mysql.jdbc.Driver();
+ DriverManager.registerDriver(driver);
+ String url = "jdbc:mysql://192.168.1.214:3306/test";
+ String user = "root";
+ String password = "chengce214";
+ conn = DriverManager.getConnection(url, user, password);
+ statement = conn.createStatement();
+ String sql = "select * from test_wuyan where NAME='"+InName+"'";
+ res = statement.executeQuery(sql);
+ while(res.next()) {
+ ID = res.getString(2);
+ nam = res.getString(1);
+ pw=res.getString(3);
+ System.out.println("name:" + nam+",password:"+pw);
+ }
+ if (InName.equals(nam)&&InPwd.equals(pw)){
+ new client();
+ dispose();
+ }
+ else{
+ JOptionPane.showMessageDialog(null,"账号或密码错误");
+ }
+
+ } catch (SQLException ee) {
+ ee.printStackTrace();
+ } finally {
+ if (res != null) {
+ try {
+ res.close();
+ } catch (SQLException ee) {
+ ee.printStackTrace();
+ }
+ }
+ }
+ }
+ });
+ jb2.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ System.exit(0);
+ }
+ });
+ }
+}
diff --git a/src/com/company/Main.java b/src/com/company/Main.java
new file mode 100644
index 0000000..1e45624
--- /dev/null
+++ b/src/com/company/Main.java
@@ -0,0 +1,7 @@
+package com.company;
+
+public class Main {
+ public static void main(String[] args) {
+ new Login();
+ }
+}
diff --git a/src/com/company/PayPlan.java b/src/com/company/PayPlan.java
new file mode 100644
index 0000000..bef4fca
--- /dev/null
+++ b/src/com/company/PayPlan.java
@@ -0,0 +1,121 @@
+package com.company;
+
+import javax.swing.*;
+import javax.swing.table.DefaultTableModel;
+import java.awt.*;
+import java.sql.*;
+import java.util.Vector;
+
+import static com.company.Login.nam;
+import static com.company.Repay.money;
+/**
+ *@Author:吴焰
+ *@Date:17:39 2017/9/22
+ *@Description:显示还款计划,只展示前5个月的
+ */
+public class PayPlan extends JPanel {
+ JPanel jp,jp1,jp2,jp3,jp4;
+ JLabel jl1,jl2,jl3,jl4;
+ Connection conn = null;
+ Statement statement = null;
+ ResultSet res = null;
+ int total,agv,n;//总额,每期应还金额,期数
+ static float money1,money2,money3,money4,money5;
+ Date lo_time;
+ float money_guazhang;
+ int record;
+ Date pay_time1;
+ DefaultTableModel model = null;
+ public PayPlan(){
+ try {
+ Driver driver = new com.mysql.jdbc.Driver();
+ DriverManager.registerDriver(driver);
+ String url = "jdbc:mysql://192.168.1.214:3306/test";
+ String user = "root";
+ String password = "chengce214";
+ conn = DriverManager.getConnection(url, user, password);
+ statement = conn.createStatement();
+ String sql = "select * from test_wuyan WHERE NAME ='" + nam + "'";
+ res = statement.executeQuery(sql);
+ while (res.next()) {
+ total = res.getInt("total");
+ n = res.getInt("n");
+ agv = res.getInt("agv");
+ lo_time = res.getDate("loan_time");
+ money_guazhang=res.getInt("guazhang");
+ record=res.getInt("record");
+ pay_time1=res.getDate("pay_time1");
+ }
+ if (pay_time1.toLocalDate().getMonthValue()>lo_time.toLocalDate().getMonthValue()+1){
+ money2=(float) (total * 30 * 0.005+((total-total/n)*30*0.003+total/n));
+ } else if(n!=0){
+ money1 = (float) (total * 30 * 0.003 + total/n-money_guazhang-record);
+ money2= (float) ((total-total/n)*30*0.003+total/n);
+ money3= (float) ((total-total/n*2)*30*0.003+total/n);
+ money4= (float) ((total-total/n*3)*30*0.003+total/n);
+ money5= (float) ((total-total/n*4)*30*0.003+total/n);
+ }
+ Vector v = new Vector();
+ for(int i=0;i4){
+ rowData = new Object[][]{
+ {String.valueOf(lo_time.toLocalDate().getYear())+"年"+v.elementAt(s-5)+"月"+
+ String.valueOf(lo_time.toLocalDate().getDayOfMonth())+"日", money1,null},
+ {String.valueOf(lo_time.toLocalDate().getYear())+"年"+v.elementAt(s-4)+"月"+
+ String.valueOf(lo_time.toLocalDate().getDayOfMonth())+"日",money2,null},
+ {String.valueOf(lo_time.toLocalDate().getYear())+"年"+v.elementAt(s-3)+"月"+
+ String.valueOf(lo_time.toLocalDate().getDayOfMonth())+"日",money3,null},
+ {String.valueOf(lo_time.toLocalDate().getYear()+1)+"年"+((Integer)v.elementAt(s-2)-12)+"月"+
+ String.valueOf(lo_time.toLocalDate().getDayOfMonth())+"日",money4,null},
+ {String.valueOf(lo_time.toLocalDate().getYear()+1)+"年"+((Integer)v.elementAt(s-1)-12)+"月"+
+ String.valueOf(lo_time.toLocalDate().getDayOfMonth())+"日",money5,null}
+ };
+ s--;
+ }
+ //JTable jt = new JTable(rowData, columnNames);
+ model = new DefaultTableModel(rowData, columnNames);
+ JTable jt=new JTable(6,3);
+ jt = new JTable(model);
+ TableRender render = new TableRender();
+ TableEditor editor = new TableEditor(new JTextField());
+ jt.getColumnModel().getColumn(2).setCellRenderer(render);
+ jt.getColumnModel().getColumn(2).setCellEditor(editor);
+ jt.getColumnModel().getColumn(2).setMaxWidth(300);
+ editor.setClickCountToStart(0);
+ jt.setPreferredScrollableViewportSize(new Dimension(600, 200));//设置表格的大小
+ jt.setRowHeight(30);//设置每行的高度为30
+ jt.setRowMargin(5);//设置相邻两行单元格的距离
+ jt.setRowSelectionAllowed(true);//设置可否被选择.默认为false
+ jt.setSelectionBackground(Color.white);//设置所选择行的背景色
+ jt.setSelectionForeground(Color.red);//设置所选择行的前景色
+ jt.setGridColor(Color.black);//设置网格线的颜色
+ jt.setBackground(Color.LIGHT_GRAY);
+ JScrollPane pane3 = new JScrollPane(jt);
+ JPanel panel = new JPanel(new GridLayout(0, 1));
+ panel.setBackground(Color.black);
+ panel.add(pane3);
+ this.add(panel);
+
+ } catch (SQLException ee) {
+ ee.printStackTrace();
+ } finally {
+ if (res != null) {
+ try {
+ res.close();
+ } catch (SQLException ee) {
+ ee.printStackTrace();
+ }
+ }
+ }
+ }
+}
diff --git a/src/com/company/Record.java b/src/com/company/Record.java
new file mode 100644
index 0000000..74de204
--- /dev/null
+++ b/src/com/company/Record.java
@@ -0,0 +1,68 @@
+package com.company;
+
+import javax.swing.*;
+
+import java.awt.*;
+import java.sql.*;
+import java.util.Vector;
+
+import static com.company.Login.nam;
+/**
+ * Created by wuyan on 2017/8/30.
+ */
+public class Record extends JPanel{
+ Connection conn = null;
+ Statement statement = null;
+ ResultSet r = null;
+ int money_record;
+ Date p_time1,p_time2,p_time3,p_time4;
+ JLabel jl;
+ public Record(){
+ try {
+ Driver driver = new com.mysql.jdbc.Driver();
+ DriverManager.registerDriver(driver);
+ String url = "jdbc:mysql://192.168.1.214:3306/test";
+ String user = "root";
+ String password = "chengce214";
+ conn = DriverManager.getConnection(url, user, password);
+ statement = conn.createStatement();
+ String sql = "SELECT * FROM test_wuyan WHERE NAME ='"+nam+"'";
+ r = statement.executeQuery(sql);
+ while (r.next()) {
+ int money_record0=r.getInt("record");
+ int money_record1=r.getInt("guazhang");
+ money_record=money_record0+money_record1;
+ System.out.println(money_record);
+ p_time1=r.getDate("pay_time1");
+ p_time2=r.getDate("pay_time2");
+ p_time3=r.getDate("pay_time3");
+ }
+} catch (SQLException e) {
+ e.printStackTrace();
+ }
+ Vector v = new Vector();
+ v.add(p_time1.toLocalDate().getMonthValue()+1);
+
+ Object[][] rowData = new Object[3][2];
+ rowData = new Object[][]{
+ { String.valueOf(p_time1.toLocalDate().getYear())+"年"+v.elementAt(0)+"月"+
+ String.valueOf(p_time1.toLocalDate().getDayOfMonth())+"日", money_record }
+ };
+final Object[] columnNames = {"还款日期", "已还金额(元)"};
+ JTable jt = new JTable(rowData, columnNames);
+ jt.setPreferredScrollableViewportSize(new Dimension(600, 200));//设置表格的大小
+ jt.setRowHeight(30);//设置每行的高度为30
+ jt.setRowHeight(0, 20);//设置第1行的高度为20
+ jt.setRowMargin(5);//设置相邻两行单元格的距离
+ jt.setRowSelectionAllowed(true);//设置可否被选择.默认为false
+ jt.setSelectionBackground(Color.white);//设置所选择行的背景色
+ jt.setSelectionForeground(Color.red);//设置所选择行的前景色
+ jt.setGridColor(Color.black);//设置网格线的颜色
+ jt.setBackground(Color.LIGHT_GRAY);
+ JScrollPane pane4 = new JScrollPane(jt);
+ JPanel panel = new JPanel(new GridLayout(0, 1));
+ panel.setBackground(Color.black);
+ panel.add(pane4);
+ this.add(panel);
+ }
+}
diff --git a/src/com/company/Repay.java b/src/com/company/Repay.java
new file mode 100644
index 0000000..5f652f5
--- /dev/null
+++ b/src/com/company/Repay.java
@@ -0,0 +1,127 @@
+package com.company;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.sql.*;
+import java.util.*;
+import java.util.Date;
+
+import static com.company.Login.nam;
+import static com.company.PayPlan.money1;
+import static com.company.client.card;
+import static com.company.client.jp;
+
+/**
+ * Created by wuyan on 2017/8/22.
+ */
+public class Repay extends JPanel{
+ JPanel jp0,jp1,jp2;
+ JLabel jl1,jl2,jl3;
+ JTextField jtf;
+ JButton jb1,jb2;
+
+ Connection conn = null;
+ Statement statement = null;
+ ResultSet res = null;
+ ResultSet res2=null;
+ int total,n;//总额,每期应还金额,期数
+ int record;
+ String s;
+ static int money;//还款金额
+ int tol;//剩余金额
+ int re;//sql更新金额update
+ Date loan_time,loan_time1,loan_time2;
+ int guazhang=0;
+ public Repay(){
+ jl1=new JLabel("还款金额:");
+ jl2=new JLabel("元");
+
+ jtf=new JTextField(5);
+
+ jp0=new JPanel();
+ jp1=new JPanel();
+ jp2=new JPanel();
+
+ jb1=new JButton("确定");
+ jb2=new JButton("返回");
+
+ jb2.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ JOptionPane.showMessageDialog(null,"确定返回?");
+ PayPlan p=new PayPlan();
+ jp.add(p,"p");
+ card.show(jp,"p");
+ }
+ });
+ jp1.add(jl1);
+ jp1.add(jtf);
+ jp1.add(jl2);
+ jp2.add(jb1);
+ jp2.add(jb2);
+ jp0.setLayout(new GridLayout(6,10,10,10));
+ jp0.add(jp1);
+ jp0.add(jp2);
+
+ this.add(jp0);
+ this.setVisible(true);
+ this.setSize(600,400);
+ try{
+ Driver driver = new com.mysql.jdbc.Driver();
+ DriverManager.registerDriver(driver);
+ String url = "jdbc:mysql://192.168.1.214:3306/test";
+ String user = "root";
+ String password = "chengce214";
+ conn = DriverManager.getConnection(url, user, password);
+ statement = conn.createStatement();
+ String sql = "SELECT * FROM test_wuyan WHERE NAME ='"+nam+"'";
+ res = statement.executeQuery(sql);
+ while (res.next()) {
+ total=res.getInt("total");
+ loan_time=res.getTime("loan_time");
+ guazhang=guazhang+res.getInt("guazhang");
+ }
+
+ jb1.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ try {
+ s=jtf.getText();
+ money=Integer.parseInt(s);
+ if(money