基于javaweb的SpringBoot财务收支记账账单管理系统(java+springboot+maven+mybatis+layui+thymeleaf+html)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

062024221606

082024221606

092024221606

102024221606

基于javaweb的SpringBoot财务收支记账账单管理系统(java+springboot+maven+mybatis+layui+thymeleaf+html)
登录:
member1 123456
member2 123456

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

/**
* <p>
* 前端控制器
* </p>
*
*/
@Controller
@RequestMapping("/bills")
public class BillsController {

@Autowired
private BillsService billService;

@Autowired
private BilltypeService billTypeService;

/**
* 跳转到系统主页
*/
@RequestMapping("toBillsList")
public String toBillsList() {
return "list";
}



/**
* 加载帐单数据
*/
@RequestMapping("loadAllBills")
@ResponseBody
public DataGridView loadAllBills(BillsVo billsVo) {
IPage<Bills> page=new Page<>(billsVo.getPage(), billsVo.getLimit());
QueryWrapper<Bills> queryWrapper=new QueryWrapper<>();
queryWrapper.eq(null!=billsVo.getTypeid()&&billsVo.getTypeid()!=0, "typeid", billsVo.getTypeid());
queryWrapper.ge(billsVo.getStartDate()!=null,"billtime", billsVo.getStartDate());
queryWrapper.le(billsVo.getEndDate()!=null, "billtime",billsVo.getEndDate());
queryWrapper.orderByDesc("billtime");
billService.page(page, queryWrapper);

List<Bills> records = page.getRecords();
for (Bills bills : records) {
Billtype billtype = this.billTypeService.getById(bills.getTypeid());
bills.setTypeName(billtype.getName());
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

/**
* <p>
* 前端控制器
* </p>
*
*/
@Controller
@RequestMapping("/bills")
public class BillsController {

@Autowired
private BillsService billService;

@Autowired
private BilltypeService billTypeService;

/**
* 跳转到系统主页
*/
@RequestMapping("toBillsList")
public String toBillsList() {
return "list";
}



/**
* 加载帐单数据
*/
@RequestMapping("loadAllBills")
@ResponseBody
public DataGridView loadAllBills(BillsVo billsVo) {
IPage<Bills> page=new Page<>(billsVo.getPage(), billsVo.getLimit());
QueryWrapper<Bills> queryWrapper=new QueryWrapper<>();
queryWrapper.eq(null!=billsVo.getTypeid()&&billsVo.getTypeid()!=0, "typeid", billsVo.getTypeid());
queryWrapper.ge(billsVo.getStartDate()!=null,"billtime", billsVo.getStartDate());
queryWrapper.le(billsVo.getEndDate()!=null, "billtime",billsVo.getEndDate());
queryWrapper.orderByDesc("billtime");
billService.page(page, queryWrapper);

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

/**
* <p>
* 前端控制器
* </p>
*
*/
@Controller
@RequestMapping("/bills")
public class BillsController {

@Autowired
private BillsService billService;

@Autowired
private BilltypeService billTypeService;

/**
* 跳转到系统主页
*/
@RequestMapping("toBillsList")
public String toBillsList() {
return "list";
}



/**
* 加载帐单数据
*/
@RequestMapping("loadAllBills")
@ResponseBody
public DataGridView loadAllBills(BillsVo billsVo) {
IPage<Bills> page=new Page<>(billsVo.getPage(), billsVo.getLimit());
QueryWrapper<Bills> queryWrapper=new QueryWrapper<>();
queryWrapper.eq(null!=billsVo.getTypeid()&&billsVo.getTypeid()!=0, "typeid", billsVo.getTypeid());
queryWrapper.ge(billsVo.getStartDate()!=null,"billtime", billsVo.getStartDate());
queryWrapper.le(billsVo.getEndDate()!=null, "billtime",billsVo.getEndDate());
queryWrapper.orderByDesc("billtime");
billService.page(page, queryWrapper);

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
	 * 添加账单
*/
@RequestMapping("addBills")
@ResponseBody
public ResultObj addBills(BillsVo billsVo) {
try {
this.billService.save(billsVo);
return new ResultObj(200, "录入成功");
} catch (Exception e) {
e.printStackTrace();
return new ResultObj(-1, "录入失败");
}
}
}








/**
* <p>
* 前端控制器
* 登陆控制
* </p>
*
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
	 */
@RequestMapping("toLogin")
public String toLogin() {
return "login";
}

@RequestMapping("login")
@ResponseBody
public ResultObj login(String loginname,String pwd,String code,HttpSession session) {
Object codeSession = session.getAttribute("code");
if(code!=null&&code.equals(codeSession)) {

QueryWrapper<User> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("loginname", loginname);
queryWrapper.eq("pwd", pwd);
User user = userService.getOne(queryWrapper);
if(null!=user) {
session.setAttribute("user", user);
return new ResultObj(200, "登陆成功");
}else {
return new ResultObj(-1, "用户名或密码不正确");
}
}else {
return new ResultObj(-1, "验证码错误");
}

}


@RequestMapping("getCode")
public void getCode(HttpServletResponse resp,HttpSession session) throws IOException {
CircleCaptcha captcha = CaptchaUtil.createCircleCaptcha(116, 36, 4, 5);
//得到code
String code = captcha.getCode();
System.out.println(code);
//放到session
session.setAttribute("code", code);
ServletOutputStream outputStream = resp.getOutputStream();
captcha.write(outputStream);
outputStream.close();
}
}






项目链接:
https://javayms.github.io?id=052024221606201lv
https://javayms.pages.dev?id=052024221606201lv