👉文末查看项目功能视频演示+获取源码+sql脚本+视频导入教程视频
1 、功能描述
家庭理财管理系统拥有多种角色,可以自行设置权限和用户等,主要功能有:
收入管理、支付管理、资产管理、负债详情、统计报表、家庭成员管理、用户管理等
1.1 背景描述
理财管理系统是一种面向个人和机构的管理工具,用于管理和优化资产配置、投资组合和财务目标的实现。随着金融市场的发展和人们对财富管理需求的增加,传统的理财方式已经无法满足日益复杂的投资环境。理财管理系统的出现解决了这一问题。该系统通过整合个人或机构的资产信息、市场数据、投资策略等关键数据,为用户提供投资分析、资产配置、风险控制等功能。同时,系统还提供了财务目标制定、投资回报分析、投资组合调整等功能,帮助用户实现财务规划和资产增值。理财管理系统既方便了个人和机构的投资决策,也提高了资产管理的效率和风险控制能力。它已经成为现代财富管理领域的重要工具,为用户提供了科学、个性化的投资管理服务,促进了财富的增长和保值。
2、项目技术
后端框架:springboot、Mybatis
前端技术:html
2.1 springboot
Spring Boot是由Pivotal团队提供的基于Spring的框架,该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。Spring Boot集成了绝大部分目前流行的开发框架,就像Maven集成了所有的JAR包一样,Spring Boot集成了几乎所有的框架,使得开发者能快速搭建Spring项目。
2.2 mysql
MySQL是一款Relational Database Management System,直译过来的意思就是关系型数据库管理系统,MySQL有着它独特的特点,这些特点使他成为目前最流行的RDBMS之一,MySQL想比与其他数据库如ORACLE、DB2等,它属于一款体积小、速度快的数据库,重点是它符合本次毕业设计的真实租赁环境,拥有成本低,开发源码这些特点,这也是选择它的主要原因。
3、开发环境
- JAVA版本:JDK1.8(最佳)
- IDE类型:IDEA、Eclipse都可运行
- 数据库类型:MySql(5.7、8.x版本都可)
- tomcat版本:无需
- maven版本:无限制
- 硬件环境:Windows
4、功能截图+视频演示+文档目录
4.1 登录
4.2功能列表
5 、核心代码实现
5.1 配置代码
spring:
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/ffms?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&allowPublicKeyRetrieval=true
username: root
password: root
#初始化时建立物理连接的个数
initial-size: 5
#最小连接池数量
min-idle: 5
#最大连接池数量 maxIdle已经不再使用
max-active: 20
#获取连接时最大等待时间,单位毫秒
max-wait: 60000
#申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
test-while-idle: true
#既作为检测的间隔时间又作为testWhileIdel执行的依据
time-between-eviction-runs-millis: 60000
#销毁线程时检测当前连接的最后活动时间和当前时间差大于该值时,关闭当前连接
min-evictable-idle-time-millis: 30000
#用来检测连接是否有效的sql 必须是一个查询语句
#mysql中为 select 'x'
#oracle中为 select 1 from dual
validation-query: select 'x'
mvc:
static-path-pattern: /static/**
throw-exception-if-no-handler-found: true
thymeleaf:
cache: false
encoding: UTF-8
servlet:
content-type: text/html
mybatis:
mapper-locations: classpath:mappers/*.xml
type-aliases-package: com.xust.ffms.entity
logging:
level:
root: info
org:
springframework:
web: info
com.xust.ffms.dao: debug
server:
port: 8081
resources:
#静态资源扫描
static-locations: classpath:/WEB-INF/resources/
5.2 其它核心代码
package com.xust.ffms.controller;
import com.xust.ffms.entity.MoneyManage;
import com.xust.ffms.entity.UserInfo;
import com.xust.ffms.service.MoneyManageService;
import com.xust.ffms.utils.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
@RestController
@RequestMapping("/moneymanage")
public class MoneyManageController {
@Resource
private MoneyManageService moneyManageService;
@RequestMapping("/getBillsByWhere/{pageNo}/{pageSize}")
public Result<MoneyManage> getBillsByWhere(MoneyManage moneyManage, @PathVariable int pageNo, @PathVariable int pageSize, HttpSession session){
moneyManage = getHouseBill(moneyManage,session);
PageModel model = new PageModel<>(pageNo,moneyManage);
model.setPageSize(pageSize);
return moneyManageService.findByWhere(model);
}
private MoneyManage getHouseBill(MoneyManage bill, HttpSession session) {
UserInfo currentUser = Config.getSessionUser(session);
//当登录用户为家主时,查询默认查询全家账单情况
//当登录用户为普通用户时,仅查询当前用户的账单
if (currentUser.getRoleid() == 2){
bill.setHouseid(currentUser.getHouseid());
}else if (currentUser.getRoleid() == 3){
bill.setUserid(currentUser.getId());
}
bill.setHouseid(currentUser.getHouseid());
bill.setUserid(currentUser.getId());
return bill;
}
@RequestMapping(value = "/addBill",method = RequestMethod.POST)
public Result add(MoneyManage moneyManage, HttpSession session){
if (Config.getSessionUser(session)!=null){
moneyManage.setUserid(Config.getSessionUser(session).getId());
moneyManage.setHouseid(Config.getSessionUser(session).getHouseid());
}
Utils.log(moneyManage.toString());
try {
int num = moneyManageService.add(moneyManage);
if(num>0){
int billid = moneyManage.getId();
moneyManage = new MoneyManage();
moneyManage.setId(billid);
return ResultUtil.success("记录成功!",moneyManageService.findByWhereNoPage(moneyManage));
// return ResultUtil.success("记账成功!",bill);
}else {
return ResultUtil.unSuccess();
}
}catch (Exception e){
return ResultUtil.error(e);
}
}
@RequestMapping("/updateBill")
public Result update(MoneyManage moneyManage, HttpSession session){
if (Config.getSessionUser(session)!=null){
moneyManage.setUserid(Config.getSessionUser(session).getId());
moneyManage.setHouseid(Config.getSessionUser(session).getHouseid());
}
Utils.log(moneyManage.toString());
int num = moneyManageService.update(moneyManage);
if(num>0){
return ResultUtil.success("修改成功!",null);
}else {
return ResultUtil.unSuccess();
}
}
@RequestMapping("/delBill")
public Result del(int id){
try {
int num = moneyManageService.del(id);
if(num>0){
return ResultUtil.success("删除成功!",null);
}else {
return ResultUtil.unSuccess();
}
}catch (Exception e){
return ResultUtil.error(e);
}
}
}