——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明







基于javaweb的SSH网上银行银行帐目管理系统(java+ssh+mysql+jsp)
管理员
admin 123456
用户
1016041135 12345
B12110931 123456
B12110901 123456
B12110902 123456
B12110903 123456
B12110904 123456
B12110905 123456
B12110906 123456
B12110907 123456
B12110908 123456
B12110909 123456
B12110913 123456
1234567 123456
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| public Account getAccount(String username); //获取账户对象 public Account getAccount(int accountid); //修改账户 public boolean updateAccount(Account account); //从session中重新获取对象account public void reflush(Account account); //根据username获取管理员对象 public Admin getAdmin(String username); //根据账户状态名称获取账户状态对象 public Status getStatus(String name); //根据账户状态id获取账户状态对象 public Status getStatus(int id); //管理员删除账户 public boolean delAccount(Account account); //开户 public boolean addAccount(Account account); } <%@ page language="java" contentType="text/html;" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>开户</title> <script type="text/javascript"> function check() { var username = document.getElementById("username").value; var pwd = document.getElementById("pwd").value; var confirmpwd = document.getElementById("confirmpwd").value; var balance = document.getElementById("balance").value; var realname = document.getElementById("realname").value; var age = document.getElementById("age").value; var address = document.getElementById("address").value; var telephone = document.getElementById("telephone").value; var cardid = document.getElementById("cardid").value; document.getElementById("errorusername").innerHTML = ""; document.getElementById("errorpwd").innerHTML = ""; document.getElementById("errorconfirmpwd").innerHTML = ""; document.getElementById("errorbalance").innerHTML = ""; document.getElementById("errorrealname").innerHTML = ""; document.getElementById("errorage").innerHTML = ""; document.getElementById("erroraddress").innerHTML = ""; document.getElementById("errortelephone").innerHTML = ""; document.getElementById("errorcardid").innerHTML = "";
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| }
public void setStatus(Status status) { this.status = status; }
public Set getTransactionLogs() { return transactionLogs; }
public void setTransactionLogs(Set transactionLogs) { this.transactionLogs = transactionLogs; }
public Set getPersoninfos() { return personinfos; }
public void setPersoninfos(Set personinfos) { this.personinfos = personinfos; } }
public class Personinfo implements Serializable {
private Integer id; private Account account; private String realname; private Integer age; private String sex; private Long cardid; private String address; private String telephone; public Personinfo() {}
public Personinfo(Account account, String realname, Integer age, String sex, Long cardid, String address, String telephone) { this.account = account; this.realname = realname; this.age = age;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| public boolean add(Personinfo personinfo) { return personinfoDaoInter.add(personinfo); }
}
public class UserServiceImpl implements UserServiceInter {
UserDaoInter userDaoInter; public UserDaoInter getUserDaoInter() { return userDaoInter; } public void setUserDaoInter(UserDaoInter userDaoInter) { this.userDaoInter = userDaoInter; }
public Account getAccount(String username) { return userDaoInter.getAccount(username); }
public Boolean modifyAccount(Account account) { return userDaoInter.updateAccount(account); }
public void reflush(Account account) { userDaoInter.reflush(account); }
public Account getAccount(int accountid) { return userDaoInter.getAccount(accountid); }
public Admin getAdmin(String username) { return userDaoInter.getAdmin(username); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| public void setStatus(Status status) { this.status = status; }
public Set getTransactionLogs() { return transactionLogs; }
public void setTransactionLogs(Set transactionLogs) { this.transactionLogs = transactionLogs; }
public Set getPersoninfos() { return personinfos; }
public void setPersoninfos(Set personinfos) { this.personinfos = personinfos; } }
public class Personinfo implements Serializable {
private Integer id; private Account account; private String realname; private Integer age; private String sex; private Long cardid; private String address; private String telephone; public Personinfo() {}
public Personinfo(Account account, String realname, Integer age, String sex, Long cardid, String address, String telephone) { this.account = account; this.realname = realname; this.age = age; this.sex = sex; this.cardid = cardid; this.address = address; this.telephone = telephone; }
public Integer getId() { return id; }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| return true; } public boolean uploanLog(LoanLog log) { Session session = sessionFactory.getCurrentSession(); session.update(log); return true; }
public List getLogs(Account account, int page) { Session session = sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(TransactionLog.class); c.add(Restrictions.or(Restrictions.eq("account", account), Restrictions.eq("otherid", account.getAccountid()))); c.addOrder(Order.desc("id")); c.setFirstResult(8*(page-1)); c.setMaxResults(8); return c.list(); } public List getLoanLogs(Account account, int page) { Session session = sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(LoanLog.class); c.add(Restrictions.eq("account", account)); c.addOrder(Order.desc("id")); c.setFirstResult(8*(page-1)); c.setMaxResults(8); return c.list(); } public List getLogsOfC(Account account) { Session session = sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(TransactionLog.class); c.add(Restrictions.and(Restrictions.eq("account", account))); return c.list(); }
public Integer getCountOfLogs(Account account) { Session session = sessionFactory.getCurrentSession(); String sql = "select count(*) from Transaction_Log where (accountid="+account.getAccountid()+" or otherid="+account.getAccountid()+")"; Query query = session.createSQLQuery(sql); Integer count = Integer.parseInt(query.uniqueResult().toString()); return count; }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=251623312808201ct
https://javayms.pages.dev?id=251623312808201ct