博主主页:一季春秋
博主简介:专注Java技术领域和毕业设计项目实战、Java、微信小程序、安卓等技术开发,远程调试部署、代码讲解、文档指导、ppt制作等技术指导。
主要内容:毕业设计(Java项目、小程序、安卓等)、简历模板、学习资料、技术咨询。精彩专栏推荐订阅👇🏻👇🏻 不然下次找不到哟
SpringBoot+Vue项目持续更新中
http://t.csdn.cn/1mgm8
🍅文末获取联系🍅
目录
一、项目介绍
二、项目主要技术
三、系统功能描述
3.1 系统功能结构
四、系统实现
4.1 系统前台用户功能实现
4.2 后台管理员模块实现
4.3 后台用户模块实现
五、实现代码
5.1 协同算法关键代码
5.2 支出记账关键代码
一、项目介绍
记帐理财系统采用B/S模式、后端采用JAVA语言、SpringBoot作为开发框架,同时集成MyBatis、Redis等相关技术、数据库使用的是mysql数据库、前台使用的是Vue技术。
二、项目主要技术
开发语言:Java
使用框架:spring boot
前端技术:JavaScript、Vue 、css3
开发工具:IDEA/MyEclipse/Eclipse、Visual Studio Code
数据库:MySQL 5.7/8.0
数据库管理工具:phpstudy/Navicat
JDK版本:jdk1.8
Maven: apache-maven 3.8.1-bin
三、系统功能描述
(1)登陆注册(用户账号,密码,再次确认密码,手机号)
(2)用户注销功能,用户能注销,管理员不需要注销功能
(3)用户个人信息修改删除(头像,性别,账号,密码,手机号,地址)
(4)新闻页面供用户浏览新闻内容由管理员添加、修改、册除,作为新闻发布和推荐管理两部分
(5)收入、支出类型的添加修改删除收入、支出的添加修改删除,收入、支出分别用Echarts出统计图,根据用户记录收支时的收益类别看出类别占比
(6)浏览理财信息用户入口可以进行理财产品购买
(7)理财订单,用户查看已购买的理财产品管理,用户可以终止理财审核,管理员对理财产品能添加、修改、册除
3.1 系统功能结构
四、系统实现
4.1 系统前台用户功能实现
系统首页
理财产品
理财产品详情
4.2 后台管理员模块实现
系统首页
理财产品管理
理财订单管理
支出记账管理
系统管理
4.3 后台用户模块实现
理财订单管理
收入记账管理
五、实现代码
5.1 协同算法关键代码
/**
* 协同算法(按收藏推荐)
*/
@RequestMapping("/autoSort2")
public R autoSort2(@RequestParam Map<String, Object> params,ChanpinxinxiEntity chanpinxinxi, HttpServletRequest request){
String userId = request.getSession().getAttribute("userId").toString();
String inteltypeColumn = "chanpinfenlei";
List<StoreupEntity> storeups = storeupService.selectList(new EntityWrapper<StoreupEntity>().eq("type", 1).eq("userid", userId).eq("tablename", "chanpinxinxi").orderBy("addtime", false));
List<String> inteltypes = new ArrayList<String>();
Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
List<ChanpinxinxiEntity> chanpinxinxiList = new ArrayList<ChanpinxinxiEntity>();
//去重
if(storeups!=null && storeups.size()>0) {
for(StoreupEntity s : storeups) {
chanpinxinxiList.addAll(chanpinxinxiService.selectList(new EntityWrapper<ChanpinxinxiEntity>().eq(inteltypeColumn, s.getInteltype())));
}
}
EntityWrapper<ChanpinxinxiEntity> ew = new EntityWrapper<ChanpinxinxiEntity>();
params.put("sort", "id");
params.put("order", "desc");
PageUtils page = chanpinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chanpinxinxi), params), params));
List<ChanpinxinxiEntity> pageList = (List<ChanpinxinxiEntity>)page.getList();
if(chanpinxinxiList.size()<limit) {
int toAddNum = (limit-chanpinxinxiList.size())<=pageList.size()?(limit-chanpinxinxiList.size()):pageList.size();
for(ChanpinxinxiEntity o1 : pageList) {
boolean addFlag = true;
for(ChanpinxinxiEntity o2 : chanpinxinxiList) {
if(o1.getId().intValue()==o2.getId().intValue()) {
addFlag = false;
break;
}
}
if(addFlag) {
chanpinxinxiList.add(o1);
if(--toAddNum==0) break;
}
}
} else if(chanpinxinxiList.size()>limit) {
chanpinxinxiList = chanpinxinxiList.subList(0, limit);
}
page.setList(chanpinxinxiList);
return R.ok().put("data", page);
}
}
5.2 支出记账关键代码
/**
* 支出记账
* 后端接口
* @author
* @email
* @date 2023-05-12 22:58:08
*/
@RestController
@RequestMapping("/zhichujizhang")
public class ZhichujizhangController {
@Autowired
private ZhichujizhangService zhichujizhangService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ZhichujizhangEntity zhichujizhang,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
zhichujizhang.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
PageUtils page = zhichujizhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhichujizhang), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ZhichujizhangEntity zhichujizhang,
HttpServletRequest request){
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
PageUtils page = zhichujizhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhichujizhang), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ZhichujizhangEntity zhichujizhang){
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
ew.allEq(MPUtil.allEQMapPre( zhichujizhang, "zhichujizhang"));
return R.ok().put("data", zhichujizhangService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ZhichujizhangEntity zhichujizhang){
EntityWrapper< ZhichujizhangEntity> ew = new EntityWrapper< ZhichujizhangEntity>();
ew.allEq(MPUtil.allEQMapPre( zhichujizhang, "zhichujizhang"));
ZhichujizhangView zhichujizhangView = zhichujizhangService.selectView(ew);
return R.ok("查询支出记账成功").put("data", zhichujizhangView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ZhichujizhangEntity zhichujizhang = zhichujizhangService.selectById(id);
return R.ok().put("data", zhichujizhang);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ZhichujizhangEntity zhichujizhang = zhichujizhangService.selectById(id);
return R.ok().put("data", zhichujizhang);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ZhichujizhangEntity zhichujizhang, HttpServletRequest request){
zhichujizhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zhichujizhang);
zhichujizhangService.insert(zhichujizhang);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ZhichujizhangEntity zhichujizhang, HttpServletRequest request){
zhichujizhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zhichujizhang);
zhichujizhangService.insert(zhichujizhang);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody ZhichujizhangEntity zhichujizhang, HttpServletRequest request){
//ValidatorUtils.validateEntity(zhichujizhang);
zhichujizhangService.updateById(zhichujizhang);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
zhichujizhangService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* (按值统计)
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}")
public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
}
List<Map<String, Object>> result = zhichujizhangService.selectValue(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计(多))
*/
@RequestMapping("/valueMul/{xColumnName}")
public R valueMul(@PathVariable("xColumnName") String xColumnName,@RequestParam String yColumnNameMul, HttpServletRequest request) {
String[] yColumnNames = yColumnNameMul.split(",");
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
}
for(int i=0;i<yColumnNames.length;i++) {
params.put("yColumn", yColumnNames[i]);
List<Map<String, Object>> result = zhichujizhangService.selectValue(params, ew);
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
result2.add(result);
}
return R.ok().put("data", result2);
}
/**
* (按值统计)时间统计类型
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}/{timeStatType}")
public R valueDay(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
params.put("timeStatType", timeStatType);
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
}
List<Map<String, Object>> result = zhichujizhangService.selectTimeStatValue(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计)时间统计类型(多)
*/
@RequestMapping("/valueMul/{xColumnName}/{timeStatType}")
public R valueMulDay(@PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,@RequestParam String yColumnNameMul,HttpServletRequest request) {
String[] yColumnNames = yColumnNameMul.split(",");
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("timeStatType", timeStatType);
List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
}
for(int i=0;i<yColumnNames.length;i++) {
params.put("yColumn", yColumnNames[i]);
List<Map<String, Object>> result = zhichujizhangService.selectTimeStatValue(params, ew);
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
result2.add(result);
}
return R.ok().put("data", result2);
}
/**
* 分组统计
*/
@RequestMapping("/group/{columnName}")
public R group(@PathVariable("columnName") String columnName,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("column", columnName);
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
}
List<Map<String, Object>> result = zhichujizhangService.selectGroup(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* 总数量
*/
@RequestMapping("/count")
public R count(@RequestParam Map<String, Object> params,ZhichujizhangEntity zhichujizhang, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
zhichujizhang.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<ZhichujizhangEntity> ew = new EntityWrapper<ZhichujizhangEntity>();
int count = zhichujizhangService.selectCount(MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhichujizhang), params), params));
return R.ok().put("data", count);
}
}