Java项目:106SpringBoot理财管理系统(含论文)

2024-01-03 17:54:44

博主主页:Java旅途
简介:分享计算机知识、学习路线、系统源码及教程
文末获取源码

一、项目介绍

理财管理系统基于SpringBoot+Mybatis开发,功能完整,页面简洁,系统分为管理员和普通用户两种角色。

管理员功能如下:

  • 用户管理
  • 银行卡查看
  • 个人征信管理
  • 理财产品管理
  • 权限管理
  • 网贷审核
  • 提醒还款

普通用户功能如下:

  • 注册登录
  • 理财投资
  • 资金记录
  • 安全网贷
  • 我的银行卡管理
  • 我的理财
  • 我的借贷
  • 系统消息查看

二、技术框架

  • 后端:SpringBoot,Mybatis
  • 前端:bootstrap

三、安装教程

  1. 用idea打开项目
  2. 在idea中配置jdk环境
  3. 配置maven环境并下载依赖
  4. 新建数据库,导入数据库文件
  5. 在application.yml文件中将数据库账号密码改成自己本地的
  6. 启动运行 , 管理员账号密码 admin/123456 ,普通用户账号密码 lisi/123456

四、项目截图

image-20230711142833705

image-20230711142859423

image-20230711142912120

image-20230711142925796

image-20230711142947548

image-20230711143016531

image-20230711143041914

image-20230711143056943

image-20230711143113107

五、相关代码

BankCardController

package com.bjpowernode.finance.controller;

import com.bjpowernode.finance.common.Msg;
import com.bjpowernode.finance.entity.Bankcard;
import com.bjpowernode.finance.entity.User;
import com.bjpowernode.finance.service.BankCardService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
public class BankCardController {

    @Autowired
    BankCardService bankCardService;

    /**
     * 跳转到银行卡管理界面(用户)
     *
     * @param model
     * @param session
     * @return
     */
    @GetMapping("/user/personal/toBankCard.html")
    public String toBankCard(Model model, HttpSession session) {
        User loginUser = (User) session.getAttribute("loginUser");
        List<Bankcard> list = bankCardService.selectBankCardByUserId(loginUser.getId());
        model.addAttribute("bankCardList", list);

        model.addAttribute("pageTopBarInfo", "银行卡管理界面");
        model.addAttribute("activeUrl1", "personalActive");
        model.addAttribute("activeUrl2", "bankCardActive");
        return "/user/personal/bankcard";
    }

    /**
     * 新增银行卡
     *
     * @param bankcard
     * @param session
     * @return
     */
    @PostMapping("/user/addBankCard")
    @ResponseBody
    public Msg addBankCard(Bankcard bankcard, HttpSession session) {
        //System.out.println(bankcard.getCardbank());
        User loginUser = (User) session.getAttribute("loginUser");
        bankcard.setUserid(loginUser.getId());
        Integer result = bankCardService.insertBankCard(bankcard);
        if (result == 1) {
            return Msg.success();
        }
        return Msg.fail();
    }

    /**
     * 修改银行卡时回显银行卡信息
     *
     * @param id
     * @return
     */
    @GetMapping("/user/getBankCardById/{id}")
    @ResponseBody
    public Msg getBankCardById(@PathVariable("id") Integer id) {
        Bankcard bankcard = bankCardService.selectBankCardById(id);
        return Msg.success().add("bankcard", bankcard);
    }

    /**
     * 修改银行卡信息
     *
     * @param id
     * @param bankcard
     * @return
     */
    @PutMapping("/user/updateBankCard/{update-id}")
    @ResponseBody
    public Msg updateBankCard(@PathVariable("update-id") Integer id, Bankcard bankcard) {
        bankcard.setId(id);
        Integer result = bankCardService.updateBankCard(bankcard);
        if (result == 1) {
            return Msg.success();
        }
        return Msg.fail();
    }

    /**
     * 删除银行卡
     *
     * @param id
     * @return
     */
    @DeleteMapping("/user/deleteBankCard/{id}")
    @ResponseBody
    public Msg deleteBankCard(@PathVariable("id") Integer id) {
        Integer result = bankCardService.deleteBankCardById(id);
        if (result == 1) {
            return Msg.success();
        }
        return Msg.fail();
    }

    /**
     * 跳转到银行卡管理界面(管理员)
     * @param pageNum
     * @param pageSize
     * @param model
     * @param session
     * @return
     */
    @GetMapping("/admin/userinfo/toBankCard.html")
    public String toBankCard1(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                              @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                              Model model, HttpSession session) {
        PageHelper.startPage(pageNum, pageSize);
        List<Bankcard> list = bankCardService.selectAllBankCard();
        PageInfo<Bankcard> pageInfo = new PageInfo<Bankcard>(list, 5);
        model.addAttribute("bankcardPageInfo",pageInfo);
        model.addAttribute("bankcardList",list);

        model.addAttribute("pageTopBarInfo", "银行卡管理界面");
        model.addAttribute("activeUrl1", "userInfoActive");
        model.addAttribute("activeUrl2", "bankcardActive");
        return "/admin/userinfo/bankcard";
    }
}

PayMoneyController

package com.bjpowernode.finance.controller;

import com.bjpowernode.finance.common.Msg;
import com.bjpowernode.finance.entity.FlowOfFunds;
import com.bjpowernode.finance.entity.PayMoney;
import com.bjpowernode.finance.entity.UserPayMoney;
import com.bjpowernode.finance.service.FlowOfFundsService;
import com.bjpowernode.finance.service.PayMoneyService;
import com.bjpowernode.finance.service.UserPayMoneyService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Controller
public class PayMoneyController {

    @Autowired
    PayMoneyService payMoneyService;
    @Autowired
    UserPayMoneyService userPayMoneyService;
    @Autowired
    FlowOfFundsService flowOfFundsService;

    /**
     * 跳转到工资理财界面
     * @param model
     * @return
     */
    @RequestMapping("/user/finance/toPayMoney.html")
    public String toPaymoney(Model model){
        List<PayMoney> list = payMoneyService.selectAllPayMoney();
        model.addAttribute("payMoneyList",list);
        model.addAttribute("pageTopBarInfo","工资理财界面");
        model.addAttribute("activeUrl1","financeActive");
        model.addAttribute("activeUrl2","payMoneyActive");
        return "/user/finance/paymoney";
    }

    /**
     * 购买工资理财产品
     * @param payMoneyId
     * @param userId
     * @return
     */
    @PostMapping("/user/buyPayMoney")
    @ResponseBody
    public Msg buyPayMoney(@RequestParam("payMoneyId")Integer payMoneyId,
                           @RequestParam("userId") Integer userId ){
        PayMoney pm = payMoneyService.selectPayMoneyById(payMoneyId);
        UserPayMoney upm = new UserPayMoney();
        upm.setUserid(userId);
        upm.setPayid(payMoneyId);
        upm.setStarttime(new Date());
        upm.setAveryield(new BigDecimal("0.03123"));
        upm.setProfit(new BigDecimal("0.03123").multiply(pm.getMonthmoney()));
        upm.setStatus(1);
        Integer result = userPayMoneyService.insertUserPayMoney(upm);
        if (result==1){
            FlowOfFunds fof = new FlowOfFunds();
            fof.setUserid(userId);
            fof.setFlowmoney(pm.getMonthmoney());
            fof.setType(1);
            fof.setSource("工资理财");
            fof.setCreatetime(new Date());
            if (pm.getType()==1){
                fof.setFunddesc("国债");
            }else if(pm.getType()==2){
                fof.setFunddesc("期货");
            }
            flowOfFundsService.insertFlowOfFunds(fof);
            return Msg.success();
        }else {
            return Msg.fail();
        }
    }

    /**
     * 跳转到工资理财管理界面(管理员)
     * @param pageNum
     * @param pageSize
     * @param model
     * @param session
     * @return
     */
    @GetMapping("/admin/finance/toPayMoney.html")
    public String toPayMoneyInfo(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                             Model model, HttpSession session) {
        PageHelper.startPage(pageNum, pageSize);
        List<PayMoney> list = payMoneyService.selectAllPayMoney();
        PageInfo<PayMoney> pageInfo = new PageInfo<PayMoney>(list, 5);
        model.addAttribute("finacnePageInfo",pageInfo);
        model.addAttribute("financeList",list);

        model.addAttribute("activeUrl1", "financeActive");
        model.addAttribute("activeUrl2", "paymoneyActive");
        model.addAttribute("pageTopBarInfo", "工资理财管理界面");
        return "/admin/finance/paymoney";
    }

    /**
     * 新增工资理财产品
     * @param payMoney
     * @return
     */
    @PostMapping("/admin/addPayMoney")
    @ResponseBody
    public Msg addPayMoney(PayMoney payMoney){
        Integer result = payMoneyService.insertPayMoney(payMoney);
        if (result==1){
            return Msg.success();
        }
        return Msg.fail();
    }

    /**
     * 更新时回显信息
     * @param id
     * @return
     */
    @GetMapping("/admin/getPayMoneyInfoById/{id}")
    @ResponseBody
    public Msg getPayMoneyInfoById(@PathVariable("id") Integer id){
        PayMoney payMoney = payMoneyService.selectPayMoneyById(id);
        return Msg.success().add("payMoney",payMoney);
    }

    /**
     * 更新
     * @param id
     * @param payMoney
     * @return
     */
    @PutMapping("/admin/updatePayMoney/{id}")
    @ResponseBody
    public Msg updatePayMoney(@PathVariable("id") Integer id,PayMoney payMoney){
        payMoney.setId(id);
        Integer result = payMoneyService.updatePayMoney(payMoney);
        if (result==1){
            return Msg.success();
        }
        return Msg.fail();
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("/admin/deletePayMoneyById/{id}")
    @ResponseBody
    public Msg deletePayMoneyById(@PathVariable("id") Integer id){
        Integer result = payMoneyService.deletePayMoneyById(id);
        if (result==1){
            return Msg.success();
        }
        return Msg.fail();
    }
}

大家点赞、收藏、关注、评论啦 、👇🏻点开下方卡片👇🏻关注后回复 101

文章来源:https://blog.csdn.net/m0_37968982/article/details/135368324
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。