springboot083基于springboot的个人理财系统--论文pf
表4.8 支出账单
个人理财系统的系统管理员可以管理用户信息,可以对用户信息信息添加修改删除以及查询操作。具体界面的展示如图5.1所示。
系统管理员可以查看对账单类型信息进行添加,修改,删除以及查询操作。具体界面如图5.2所示。
用户注册后才可以登录。界面如下图所示:
用户登录后可以在点击收入账单进行可以对收入账单添加修改删除操作。界面如下图所示:
任务:消除软件故障,保证程序的可靠运行。测试与纠错的关系,可以用图6-1的数据流图来说明。图中表明,每一次测试都要准备好若干必要的测试数据,与被测试程序一道送入计算机执行。通常把一次程序执行需要的测试数据,称为一个“测试用例(Test Case)。每一个测试用例产生一个相应的“测试结果”。如果它与“期望结果”不想符合,便说明程序中存在错误,需要用纠错来改正。
LicaijihuaServiceImpl.java
package com.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;
import com.dao.LicaijihuaDao;
import com.entity.LicaijihuaEntity;
import com.service.LicaijihuaService;
import com.entity.vo.LicaijihuaVO;
import com.entity.view.LicaijihuaView;
@Service("licaijihuaService")
public class LicaijihuaServiceImpl extends ServiceImpl<LicaijihuaDao, LicaijihuaEntity> implements LicaijihuaService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<LicaijihuaEntity> page = this.selectPage(
new Query<LicaijihuaEntity>(params).getPage(),
new EntityWrapper<LicaijihuaEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<LicaijihuaEntity> wrapper) {
Page<LicaijihuaView> page =new Query<LicaijihuaView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<LicaijihuaVO> selectListVO(Wrapper<LicaijihuaEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public LicaijihuaVO selectVO(Wrapper<LicaijihuaEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<LicaijihuaView> selectListView(Wrapper<LicaijihuaEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public LicaijihuaView selectView(Wrapper<LicaijihuaEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}
ZhangdanleixingController.java
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.ZhangdanleixingEntity;
import com.entity.view.ZhangdanleixingView;
import com.service.ZhangdanleixingService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 账单类型
* 后端接口
* @author
* @email
* @date 2021-04-25 16:19:48
*/
@RestController
@RequestMapping("/zhangdanleixing")
public class ZhangdanleixingController {
@Autowired
private ZhangdanleixingService zhangdanleixingService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ZhangdanleixingEntity zhangdanleixing,
HttpServletRequest request){
EntityWrapper<ZhangdanleixingEntity> ew = new EntityWrapper<ZhangdanleixingEntity>();
PageUtils page = zhangdanleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhangdanleixing), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ZhangdanleixingEntity zhangdanleixing,
HttpServletRequest request){
EntityWrapper<ZhangdanleixingEntity> ew = new EntityWrapper<ZhangdanleixingEntity>();
PageUtils page = zhangdanleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhangdanleixing), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ZhangdanleixingEntity zhangdanleixing){
EntityWrapper<ZhangdanleixingEntity> ew = new EntityWrapper<ZhangdanleixingEntity>();
ew.allEq(MPUtil.allEQMapPre( zhangdanleixing, "zhangdanleixing"));
return R.ok().put("data", zhangdanleixingService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ZhangdanleixingEntity zhangdanleixing){
EntityWrapper< ZhangdanleixingEntity> ew = new EntityWrapper< ZhangdanleixingEntity>();
ew.allEq(MPUtil.allEQMapPre( zhangdanleixing, "zhangdanleixing"));
ZhangdanleixingView zhangdanleixingView = zhangdanleixingService.selectView(ew);
return R.ok("查询账单类型成功").put("data", zhangdanleixingView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ZhangdanleixingEntity zhangdanleixing = zhangdanleixingService.selectById(id);
return R.ok().put("data", zhangdanleixing);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ZhangdanleixingEntity zhangdanleixing = zhangdanleixingService.selectById(id);
return R.ok().put("data", zhangdanleixing);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ZhangdanleixingEntity zhangdanleixing, HttpServletRequest request){
zhangdanleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zhangdanleixing);
zhangdanleixingService.insert(zhangdanleixing);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ZhangdanleixingEntity zhangdanleixing, HttpServletRequest request){
zhangdanleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zhangdanleixing);
zhangdanleixingService.insert(zhangdanleixing);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ZhangdanleixingEntity zhangdanleixing, HttpServletRequest request){
//ValidatorUtils.validateEntity(zhangdanleixing);
zhangdanleixingService.updateById(zhangdanleixing);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
zhangdanleixingService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<ZhangdanleixingEntity> wrapper = new EntityWrapper<ZhangdanleixingEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = zhangdanleixingService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
HomeComment.vue
<template>
<div class="home-comment">
<div class="title">用户留言</div>
<div class="comment-list">
<div v-for="(item,index) in list" v-bind:key="index" class="comment-item">
<div class="user-content">
<el-image
class="avator"
:src="item.avator"
></el-image>
<span class="user">{{item.name}}</span>
</div>
<div class="comment">{{item.content}}</div>
<div class="create-time">{{item.createTime}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
list: [
{
name: "MaskLin",
avator:
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
content:
"你以为只要长得漂亮就有男生喜欢?你以为只要有了钱漂亮妹子就自己贴上来了?你以为学霸就能找到好工作?我告诉你吧,这些都是真的!",
createTime: "5月02日 00:00"
},
{
name: "MaskLin",
avator:
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
content: "作者太帅了",
createTime: "5月04日 00:00"
},
{
name: "MaskLin",
avator:
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
content: "作者太帅了",
createTime: "5月04日 00:00"
},
{
name: "MaskLin",
avator: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
content: "作者太帅了",
createTime: "5月04日 00:00"
}
]
};
}
};
</script>
<style lang="scss" scoped>
.home-comment {
background: #ffffff;
.title {
font-size: 18px;
color: #666;
font-weight: bold;
padding: 10px;
border-bottom: 1px solid #eeeeee;
}
.comment-list {
padding: 10px;
.comment-item {
padding: 10px;
border-bottom: 1px solid #eeeeee;
.user-content {
display: flex;
align-items: center;
.user {
font-size: 18px;
color: #666;
font-weight: bold;
line-height: 50px;
margin-left: 10px;
}
.avator {
width: 50px;
height: 50px;
border-radius: 50%;
}
}
.comment {
margin-top: 10px;
font-size: 14px;
color: #888888;
}
.create-time {
margin-top: 15px;
font-size: 14px;
color: #888888;
}
}
}
}
</style>
main.js
import Vue from 'vue'
import App from '@/App.vue'
// element ui 完全引入
import ElementUI from 'element-ui'
import '@/assets/css/element-variables.scss'
import '@/assets/css/style.scss'
// 加载路由
// import router from '@/router/router-static.js';
import router from '@/router/router-static.js';
// 面包屑导航,注册为全局组件
import BreadCrumbs from '@/components/common/BreadCrumbs'
// 引入echart
import echarts from 'echarts'
// 引入echart主题
// import '@/assets/js/echarts-theme-macarons.js'
import 'echarts/theme/macarons.js'
// ajax
import http from '@/utils/http.js'
// 基础配置
import base from '@/utils/base'
// 工具类
import { isAuth, getCurDate, getCurDateTime } from '@/utils/utils'
// storage 封装
import storage from "@/utils/storage";
// 上传组件
import FileUpload from "@/components/common/FileUpload";
// 富文本编辑组件
import Editor from "@/components/common/Editor";
// api 接口
import api from '@/utils/api'
// 数据校验工具类
import * as validate from '@/utils/validate.js'
// 后台地图
import VueAMap from 'vue-amap'
import '@/icons'
//excel导出
import JsonExcel from 'vue-json-excel'
//打印
import printJS from 'print-js'
//MD5
import md5 from 'js-md5';
// 后台地图
Vue.use(VueAMap)
VueAMap.initAMapApiLoader({
key: 'ca04cee7ac952691aa67a131e6f0cee0',
plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.Geocoder'],
// 默认高德 sdk 版本为 1.4.4
v: '1.4.4'
})
Vue.prototype.$validate = validate
Vue.prototype.$http = http // ajax请求方法
Vue.prototype.$echarts = echarts
Vue.prototype.$base = base.get()
Vue.prototype.$project = base.getProjectName()
Vue.prototype.$storage = storage
Vue.prototype.$api = api
// 判断权限方法
Vue.prototype.isAuth = isAuth
Vue.prototype.getCurDateTime = getCurDateTime
Vue.prototype.getCurDate = getCurDate
// Vue.prototype.$base = base
Vue.use(ElementUI, { size: 'medium', zIndex: 3000 });
Vue.config.productionTip = false
// 组件全局组件
Vue.component('bread-crumbs', BreadCrumbs)
Vue.component('file-upload', FileUpload)
Vue.component('editor', Editor)
//excel导出
Vue.component('downloadExcel', JsonExcel)
//MD5
Vue.prototype.$md5 = md5;
new Vue({
render: h => h(App),
router
}).$mount('#app')