基于javaweb+mysql的ssm家庭理财管理系统(java+ssm+bootstrap+highcharts+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM家庭理财管理系统(java+ssm+bootstrap+highcharts+mysql)
项目介绍
SSM家庭理财管理系统,分为管理员与普通用户两种角色; 管理员角色包含以下功能: 收支管理:收入信息维护、支出信息维护; 财务管理:证券账户管理、持股管理、证券流水账管理; 报表管理:按时间收入报表、按时间支出报表、按类型报表; 用户报表:用户信息管理、修改用户信息、修改密码、安全退出;
普通用户角色包含以下功能: 收支管理:收入信息维护、支出信息维护; 财务管理:证券账户管理、持股管理、证券流水账管理; 报表管理:按时间收入报表、按时间支出报表、按类型报表; 用户报表:修改用户信息、修改密码、安全退出;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7/8.0等版本均可;
技术栈
-
后端:Spring+springmvc+mybatis
-
前端:JSP+css+javascript+jQuery+bootstrap+highcharts
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置; 3. 将项目中db.properties配置文件中的数据库配置改为自己的用户名密码,然后运行; 4. 运行成功后,在浏览器中输入:http://localhost:8080/ffms/index.do 管理员账号密码:admin/123456 普通用户账号密码:user/123456
return "success";
} else {
return "error";
/**
* 修改账单信息
*/
@RequestMapping(value = {"/modifyAccount"})
@ResponseBody
public String modifyInfo(Account account) {
int count = accountInfoService.modifyAccount(account);
if (count == 1) {
return "success";
} else {
return "error";
* 跳转到添加账单页面
*/
@RequestMapping(value = {"/addInfo"})
public String toAddAccount(Model model, HttpSession session) {
User user = (User) session.getAttribute("user");
model.addAttribute("uid", user.getUid());
return "addAccount";
/**
* 跳转到账单详情
*/
@RequestMapping(value = {"/queryInfo"})
public String toAccountInfo(int acid, Model model) {
model.addAttribute("acid", acid);
at.setAcid(account.getAcid());
at.setAmount(account.getAmount());
at.setDate(account.getDate());
at.setIsExpose(account.getIsExpose());
at.setRemarks(account.getRemarks());
at.setIetype(account.getIetype());
at.setTypeName(name);
return at;
/**
* 保存账单信息
session.setAttribute("user", newUser);
rs.setData(us);
return rs;
@RequestMapping(value = {"/userAdd"})
@ResponseBody
public RegisterStatus addUser(@RequestBody User user) {
// 封装返回的JSON数据
RegisterStatus rs = new RegisterStatus();
if (userService.isExists(user.getName())) {
rs.setCode(405);
rs.setInfo("用户名已经存在!");
} else {
ModelAndView mav = new ModelAndView();
mav.setViewName("userAdd");
return mav;
@RequestMapping(value = {"/getUserList"})
@ResponseBody
public UserListStatus getUserList(@RequestBody UserListCombination userListCombination,HttpSession session) {
UserListStatus uls = new UserListStatus();
User user =(User) session.getAttribute("user");
List<User> userList =userService.list(userListCombination,user.getFid());
uls.setData(userList);
uls.setCount(userService.getCountByUser(user.getFid()));
return uls;
@RequestMapping(value = {"/center"})
public ModelAndView toUser(HttpSession session) {
if (count == 1) {
return "success";
} else {
return "error";
/**
* 删除账单
*/
@RequestMapping(value = {"/deleteAccount"})
@ResponseBody
public String deleteInfo(@RequestBody Account account) throws JsonProcessingException {
int count = accountInfoService.deleteAccount(account.getAcid());
@RequestMapping("/accountInfo")
public class AccountInfoController {
@Autowired
AccountInfoService accountInfoService;
/**
* 跳转到添加账单页面
*/
@RequestMapping(value = {"/addInfo"})
public String toAddAccount(Model model, HttpSession session) {
User user = (User) session.getAttribute("user");
model.addAttribute("uid", user.getUid());
return "addAccount";
*/
@RequestMapping(value = {"/log"})
public String toLogin() {
// 跳转到login.jsp页面。
return "login";
/**
* 注册界面
* @return String
*/
@RequestMapping(value = {"/reg"})
public String toRegister() {
// 跳转到login.jsp页面。
if (count >= 1) {
return "success";
} else {
return "error";
/**
* 修改账单信息
*/
@RequestMapping(value = {"/modifyAccount"})
@ResponseBody
public String modifyInfo(Account account) {
int count = accountInfoService.modifyAccount(account);
if (count == 1) {
* 跳转到添加账单页面
*/
@RequestMapping(value = {"/addInfo"})
public String toAddAccount(Model model, HttpSession session) {
User user = (User) session.getAttribute("user");
model.addAttribute("uid", user.getUid());
return "addAccount";
/**
* 跳转到账单详情
*/
@RequestMapping(value = {"/queryInfo"})
public String toAccountInfo(int acid, Model model) {
model.addAttribute("acid", acid);
@ResponseBody
public String addAccount(Account account) {
account.setIsAvaliable(1);
int count = accountInfoService.addAccount(account);
if (count >= 1) {
return "success";
} else {
return "error";
/**
* 修改账单信息
*/
* 跳转到账单详情
*/
@RequestMapping(value = {"/queryInfo"})
public String toAccountInfo(int acid, Model model) {
model.addAttribute("acid", acid);
return "accountInfo";
/**
* 跳转到账单修改页面
*/
@RequestMapping(value = {"/modifyInfo"})
public String toModifyInfo(int acid, Model model) {
Account account = accountInfoService.queryAccountInfoById(acid);
Account account = accountInfoService.queryAccountInfoById(acid);
int type = account.getTid();
String name = accountInfoService.queryAccountTypeById(type);
AccountAndIEType at = new AccountAndIEType();
at.setAcid(account.getAcid());
at.setAmount(account.getAmount());
at.setDate(account.getDate());
at.setIsExpose(account.getIsExpose());
at.setRemarks(account.getRemarks());
at.setIetype(account.getIetype());
at.setTypeName(name);
public String toModifyInfo(int acid, Model model) {
Account account = accountInfoService.queryAccountInfoById(acid);
model.addAttribute("account", account);
return "modifyInfo";
/**
* 查询账单分类
*/
@RequestMapping(value = {"/queryAccountType"})
@ResponseBody
public List<AccountType> queryAccountType() {
public String toAccountInfo(int acid, Model model) {
model.addAttribute("acid", acid);
return "accountInfo";
/**
* 跳转到账单修改页面
*/
@RequestMapping(value = {"/modifyInfo"})
public String toModifyInfo(int acid, Model model) {
Account account = accountInfoService.queryAccountInfoById(acid);
model.addAttribute("account", account);
return "modifyInfo";
/**
return at;
/**
* 保存账单信息
*/
@RequestMapping(value = {"/saveAccount"})
@ResponseBody
public String addAccount(Account account) {
account.setIsAvaliable(1);
int count = accountInfoService.addAccount(account);
if (count >= 1) {
return "success";
} else {
return "error";
ls.setUser(loginUser);
return ls;
} else {
// 登录失败:返回错误信息
ls.setCode(502);
ls.setInfo("姓名或密码有误!");
return ls;
@RequestMapping(value = {"/rDo"})
@ResponseBody
public RegisterStatus doLogin(HttpSession session, @RequestBody UserAndFamily userAndFamily) {
RegisterStatus registerStatus = new RegisterStatus();
// 首先判断用户是否存在
public LoginStatus doLogin(HttpSession session, @RequestBody User user) {
// 用户登录检查
User loginUser = loginService.getUserByUsernameAndPassword(user);
LoginStatus ls = new LoginStatus();
if (loginUser != null) {
// 登录成功:设置用户登录状态,并返回信息
loginUser.setPassword(null);
session.setAttribute("user", loginUser);
ls.setCode(200);
ls.setInfo("登录成功!");
ls.setUser(loginUser);
return ls;
} else {