作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
项目介绍
Springboot银行柜面管理系统主要分为管理员与普通用户两种角色。
管理员角色主要功能如下:
系统用户管理:管理员用户、修改密码;
用户管理:用户查询、新增、编辑、删除等;
取款管理:用户查询、新增、编辑、删除等;
存款管理:用户查询、新增、编辑、删除等;
转账管理:用户查询、新增、编辑、删除等;
普通用户主要功能如下:
个人资料管理:修改个人资料、修改密码;
取款管理:用户查询、新增、编辑、删除等;
存款管理:用户查询、新增、编辑、删除等;
转账管理:用户查询、新增、编辑、删除等;
使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者
由于本程序规模不大,可供课程设计,毕业设计学习演示之用
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
技术栈
后端:SpringBoot+Mybaits
前端:Html+css+element+jquery+bootstrap+vue
使用说明
项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入地址:http://localhost:8888/end/page/login.html
管理员账号、密码:hsg/hsg
普通用户账号、密码:001/001
运行截图
管理员界面
用户角色界面
相关代码
EchartsController
package com.example.controller;
import cn.hutool.json.JSONObject;
import com.example.common.Result;
import com.example.dao.*;
import com.example.vo.EchartsData;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
@RestController
@RequestMapping("/echarts")
public class EchartsController {
@Resource
private AdminInfoDao adminInfoDao;
// @Resource
// private UserInfoDao userInfoDao;
//@Resource
//private CommentInfoDao commentInfoDao;
// @Resource
// private OrderInfoDao orderInfoDao;
// @Resource
// private ShangpinchukuInfoDao shangpinchukuInfoDao;
// @Resource
// private OrderGoodsRelDao orderGoodsRelDao;
@GetMapping("/getTotal")
Result<Map<String, Object>> getTotal() {
Map<String, Object> map = new HashMap<>(4);
// 获取用户总数
map.put("totalUser", getUserCount() == null ? 0 : getUserCount());
// 获取评论总数
//map.put("totalComment", commentInfoDao.count() == null ? 0 : commentInfoDao.count());
// 获取总销售额
// map.put("totalPrice", orderInfoDao.totalPrice() == null ? 0 : orderInfoDao.totalPrice());
// 获取总销量
// map.put("totalShopping", orderGoodsRelDao.totalShopping() == null ? 0 : orderGoodsRelDao.totalShopping());
return Result.success(map);
}
//youtongji
// @GetMapping("/get/tj_shangpinxiaoliang")
// Result<List<EchartsData>> getTj_shangpinxiaoliang_EchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> shangpinxiaoliangList = shangpinchukuInfoDao.select_tj_xiaoliang();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : shangpinxiaoliangList) {
//
// typeMap.put((String)map.get("aa"), (Double.valueOf((String)map.get("bb").toString())));
//
// }
// getPieData("商品销量统计", list, typeMap);
// getBarData("商品销量统计", list, typeMap);
// return Result.success(list);
// }
// @GetMapping("/get/shopping")
// Result<List<EchartsData>> getShoppingEchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> typePriceList = orderInfoDao.getTypeCount();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : typePriceList) {
// typeMap.put((String)map.get("name"), ((BigDecimal)map.get("count")).doubleValue());
// }
// getPieData("分类总销量", list, typeMap);
// getBarData("分类总销量", list, typeMap);
// return Result.success(list);
// }
// @GetMapping("/get/price")
// Result<List<EchartsData>> getPriceEchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> typePriceList = orderInfoDao.getTypePrice();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : typePriceList) {
// typeMap.put((String)map.get("name"), (Double)map.get("price"));
// }
// getPieData("分类总销售额", list, typeMap);
// getBarData("分类总销售额", list, typeMap);
// return Result.success(list);
// }
private void getPieData(String name, List<EchartsData> pieList, Map<String, Double> dataMap) {
EchartsData pieData = new EchartsData();
EchartsData.Series series = new EchartsData.Series();
Map<String, String> titleMap = new HashMap<>(2);
titleMap.put("text", name);
pieData.setTitle(titleMap);
series.setName(name + "比例");
series.setType("pie");
series.setRadius("55%");
List<Object> objects = new ArrayList<>();
List<Object> legendList = new ArrayList<>();
for (String key : dataMap.keySet()) {
Double value = dataMap.get(key);
objects.add(new JSONObject().putOpt("name", key).putOpt("value", value));
legendList.add(key);
}
series.setData(objects);
pieData.setSeries(Collections.singletonList(series));
Map<String, Boolean> map = new HashMap<>();
map.put("show", true);
pieData.setTooltip(map);
Map<String, Object> legendMap = new HashMap<>(4);
legendMap.put("orient", "vertical");
legendMap.put("x", "left");
legendMap.put("y", "center");
legendMap.put("data", legendList);
pieData.setLegend(legendMap);
pieList.add(pieData);
}
private void getBarData(String name, List<EchartsData> barList, Map<String, Double> dataMap) {
EchartsData barData = new EchartsData();
EchartsData.Series series = new EchartsData.Series();
List<Object> seriesObjs = new ArrayList<>();
List<Object> xAxisObjs = new ArrayList<>();
for (String key : dataMap.keySet()) {
Double value = dataMap.get(key);
xAxisObjs.add(key);
seriesObjs.add(value);
}
series.setType("bar");
series.setName(name);
series.setData(seriesObjs);
barData.setSeries(Collections.singletonList(series));
Map<String, Object> xAxisMap = new HashMap<>(1);
xAxisMap.put("data", xAxisObjs);
barData.setxAxis(xAxisMap);
barData.setyAxis(new HashMap<>());
Map<String, Object> legendMap = new HashMap<>(1);
legendMap.put("data", Collections.singletonList(name));
barData.setLegend(legendMap);
Map<String, Boolean> map = new HashMap<>(1);
map.put("show", true);
barData.setTooltip(map);
Map<String, String> titleMap = new HashMap<>(1);
titleMap.put("text", name);
barData.setTitle(titleMap);
barList.add(barData);
}
private Integer getUserCount() {
Integer count = 0;
count += adminInfoDao.count();
//count += sellerInfoDao.count();
// count += userInfoDao.count();
return count;
}
}
QukuanInfoController
package com.example.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.QukuanInfo;
import com.example.dao.QukuanInfoDao;
import com.example.service.QukuanInfoService;
import com.example.exception.CustomException;
import com.example.common.ResultCode;
import com.example.vo.EchartsData;
import com.example.vo.QukuanInfoVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.example.service.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Value;
import cn.hutool.core.util.StrUtil;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping(value = "/qukuanInfo")
public class QukuanInfoController {
@Resource
private QukuanInfoService qukuanInfoService;
@Resource
private QukuanInfoDao qukuanInfoDao;
@PostMapping
public Result<QukuanInfo> add(@RequestBody QukuanInfoVo qukuanInfo) {
//mixmajixami
qukuanInfoService.add(qukuanInfo);
return Result.success(qukuanInfo);
}
//youtixing1
//youtixing2
@DeleteMapping("/{id}")
public Result delete(@PathVariable Long id) {
qukuanInfoService.delete(id);
return Result.success();
}
@PutMapping
public Result update(@RequestBody QukuanInfoVo qukuanInfo) {
qukuanInfoService.update(qukuanInfo);
return Result.success();
}
//@PutMapping("/update2")
// public Result update2(@RequestBody QukuanInfoVo qukuanInfo) {
// qukuanInfoService.update2(qukuanInfo);
// return Result.success();
// }
@GetMapping("/{id}")
public Result<QukuanInfo> detail(@PathVariable Long id) {
QukuanInfo qukuanInfo = qukuanInfoService.findById(id);
return Result.success(qukuanInfo);
}
@GetMapping("/changeStatus/{id}")
public Result<QukuanInfo> changeStatus(@PathVariable Long id) {
qukuanInfoService.changeStatus(id);
return Result.success();
}
@GetMapping
public Result<List<QukuanInfoVo>> all() {
return Result.success(qukuanInfoService.findAll());
}
@GetMapping("/page/{name}")
public Result<PageInfo<QukuanInfoVo>> page(@PathVariable String name,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "5") Integer pageSize,
HttpServletRequest request) {
return Result.success(qukuanInfoService.findPage(name, pageNum, pageSize, request));
}
@GetMapping("/pageqt/{name}")
public Result<PageInfo<QukuanInfoVo>> pageqt(@PathVariable String name,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "8") Integer pageSize,
HttpServletRequest request) {
return Result.success(qukuanInfoService.findPageqt(name, pageNum, pageSize, request));
}
// @PostMapping("/register")
// public Result<QukuanInfo> register(@RequestBody QukuanInfo qukuanInfo) {
// if (StrUtil.isBlank(qukuanInfo.getName()) || StrUtil.isBlank(qukuanInfo.getPassword())) {
// throw new CustomException(ResultCode.PARAM_ERROR);
// }
// return Result.success(qukuanInfoService.add(qukuanInfo));
// }
/**
* 批量通过excel添加信息
* @param file excel文件
* @throws IOException
*/
@PostMapping("/upload")
public Result upload(MultipartFile file) throws IOException {
List<QukuanInfo> infoList = ExcelUtil.getReader(file.getInputStream()).readAll(QukuanInfo.class);
if (!CollectionUtil.isEmpty(infoList)) {
// 处理一下空数据
List<QukuanInfo> resultList = infoList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getQukuanjine())).collect(Collectors.toList());
for (QukuanInfo info : resultList) {
qukuanInfoService.add(info);
}
}
return Result.success();
}
//yoxutonxgjitu
@GetMapping("/getExcelModel")
public void getExcelModel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("qukuanjine", "A取款金额");
row.put("zhifumima", "A支付密码");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "qukuan");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=qukuanInfoModel.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
IoUtil.close(System.out);
}
@GetMapping("/getExcel")
public void getExcel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("qukuanjine", "A取款金额");
row.put("zhifumima", "A支付密码");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "权限");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
List<Map<String, Object>> daochuexcellist = qukuanInfoDao.daochuexcel();
Map<String, Double> typeMap = new HashMap<>();
for (Map<String, Object> map : daochuexcellist) {
list.add(map);
}
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=qukuanInfo.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
IoUtil.close(System.out);
}
private void getPieData(String name, List<EchartsData> pieList, Map<String, Double> dataMap) {
EchartsData pieData = new EchartsData();
EchartsData.Series series = new EchartsData.Series();
Map<String, String> titleMap = new HashMap<>(2);
titleMap.put("text", name);
pieData.setTitle(titleMap);
series.setName(name + "比例");
series.setType("pie");
series.setRadius("55%");
List<Object> objects = new ArrayList<>();
List<Object> legendList = new ArrayList<>();
for (String key : dataMap.keySet()) {
Double value = dataMap.get(key);
objects.add(new JSONObject().putOpt("name", key).putOpt("value", value));
legendList.add(key);
}
series.setData(objects);
pieData.setSeries(Collections.singletonList(series));
Map<String, Boolean> map = new HashMap<>();
map.put("show", true);
pieData.setTooltip(map);
Map<String, Object> legendMap = new HashMap<>(4);
legendMap.put("orient", "vertical");
legendMap.put("x", "left");
legendMap.put("y", "center");
legendMap.put("data", legendList);
pieData.setLegend(legendMap);
pieList.add(pieData);
}
private void getBarData(String name, List<EchartsData> barList, Map<String, Double> dataMap) {
EchartsData barData = new EchartsData();
EchartsData.Series series = new EchartsData.Series();
List<Object> seriesObjs = new ArrayList<>();
List<Object> xAxisObjs = new ArrayList<>();
for (String key : dataMap.keySet()) {
Double value = dataMap.get(key);
xAxisObjs.add(key);
seriesObjs.add(value);
}
series.setType("bar");
series.setName(name);
series.setData(seriesObjs);
barData.setSeries(Collections.singletonList(series));
Map<String, Object> xAxisMap = new HashMap<>(1);
xAxisMap.put("data", xAxisObjs);
barData.setxAxis(xAxisMap);
barData.setyAxis(new HashMap<>());
Map<String, Object> legendMap = new HashMap<>(1);
legendMap.put("data", Collections.singletonList(name));
barData.setLegend(legendMap);
Map<String, Boolean> map = new HashMap<>(1);
map.put("show", true);
barData.setTooltip(map);
Map<String, String> titleMap = new HashMap<>(1);
titleMap.put("text", name);
barData.setTitle(titleMap);
barList.add(barData);
}
}
如果也想学习本系统,下面领取。关注并回复:112springboot