基于javaweb的SSM+Maven家庭理财系统(java+ssm+jsp+tomcat+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

130023542402

140023542402

160023542402

170023542402

180023542402

190023542402

1
2
3
4
登录:
老王 123456——家长(管理员)
大娃 123456
二娃 123456

基于javaweb的SSM+Maven家庭理财系统(java+ssm+jsp+tomcat+mysql)

一、项目简述

功能:家庭理财,财务分析,统计等等。

二、项目运行

运行环境:

jdk8+tomcat8+mysql+IntelliJ IDEA( Eclispe , MyEclispe ,Sts 都支持,代码与开发环境运行无关啦,只需要调整环境即可)

项目技术:SpringMVC + Spring + Mybatis + MySQL + Ajax + HTML + JavaScript + CSS + Jsp等等

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
48
49
50
51
}
@RequestMapping(value = {"/addGoal"})
public String SaveGoal() {
return "savegoal";
}


//添加存款目标
@RequestMapping(value = {"/setgoal"})
@ResponseBody
public SaveGoalStatus doSave(HttpSession session, @RequestBody Deposit goal){
int flag=saveGoalService.isRun(goal.getUid());
SaveGoalStatus sgs=new SaveGoalStatus();
if(flag==0){
//添加存款目标
saveGoalService.addSaveGoal(goal);
sgs.setInfo("添加目标成功");
sgs.setCode(200);
return sgs;

}else {
sgs.setInfo("存在正在进行的目标,请先完成当前目标");
sgs.setCode(0);
return sgs;
}

}
//获取家庭成员
@RequestMapping(value={"/getmembers"})
@ResponseBody
public List<User> getMembers(HttpSession session,@RequestBody User user){
return saveGoalService.getAllUser(user.getUid());
}

//获取个人历史存款目标
@RequestMapping(value ={"/getAllGoal"})
@ResponseBody
public GoalListStatus getAllGoal(HttpSession session,@RequestBody SaveGoalCombination saveGoalCombination){
GoalListStatus gls=new GoalListStatus();
List<Deposit> depositList=individualManagerService.getHistoryGoal(saveGoalCombination);
gls.setData(depositList);
gls.setCount(individualManagerService.getCountHistoryGoal(saveGoalCombination));
return gls;
}

//获取个人当前存款目标
@RequestMapping(value = {"/getCurrentGoal"})
@ResponseBody
public AccountAndDepositVo getCurrentGoal(HttpSession session,@RequestBody User user){
return individualManagerService.getIndividualState(user.getUid());
}
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
            msg.put("code", "500");
msg.put("msg", "error");
return objectMapper.writeValueAsString(msg);
}
}
}
package cn.edu.cuit.controller;



/**
*/
@Controller
@RequestMapping("/savegoal")
public class SaveGoalController {
@Autowired
private SaveGoalService saveGoalService;
@Autowired
private IndividualManagerService individualManagerService;

@RequestMapping(value = {"/page"})
public String toSaveGoal() {
return "showgoal";

}
@RequestMapping(value = {"/addGoal"})
public String SaveGoal() {
return "savegoal";
}
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
        loginService.addUserAndFamily(userAndFamily);
registerStatus.setInfo("登记家庭成功!");
registerStatus.setCode(200);
return registerStatus;
}


}
package cn.edu.cuit.controller;




@Controller
@RequestMapping("/accountType")
public class AccountTypeController {
@Autowired
AccountTypeService accountTypeService;

@RequestMapping(value = {"/"})
public String LookAccountType() {
return "accountTypeList";
}
//账目类型列表
@RequestMapping(value = {"/list"})
@ResponseBody
public AccountTypeListStatus ListAccountType( @RequestParam Integer page, @RequestParam Integer limit) {
AccountTypeListStatus atls = new AccountTypeListStatus();
List<AccountType> accountTypes = (List<AccountType>) accountTypeService.getAccountType(page, limit);
atls.setData(accountTypes);
atls.setCount(accountTypeService.getAccountTypeCount());
return atls;
}
//添加账目类型
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
48
49
@RequestMapping(value = {"/userEdit"})
@ResponseBody
public UserListStatus editUser(@RequestBody User user, HttpSession session) {
UserListStatus rs = new UserListStatus();
userService.update(user);
rs.setCode(200);
rs.setMsg("添加成功!");
// 要更新session中的用户的值
List<User> us = userService.list(user.getUid());
User newUser = us.get(0);
newUser.setPassword("");
session.setAttribute("user", newUser);
rs.setData(us);
return rs;
}

@RequestMapping(value = {"/userAdd"})
@ResponseBody
public RegisterStatus addUser(@RequestBody User user) {
// 封装返回的JSON数据
RegisterStatus rs = new RegisterStatus();
if (userService.isExists(user.getName())) {
rs.setCode(405);
rs.setInfo("用户名已经存在!");
} else {
userService.add(user);
rs.setCode(200);
rs.setInfo("添加成功!");
}
return rs;
}

/*.@RequestMapping(value={"/UserUpload"})
public String upload(User user, HttpServletRequest request,Model model)throws Exception{
System.out.println(request.getParameter("name"));
String sqlPath=null;
String localPath="D:\\CuitJavaEEPractice\\CuitJavaEEPractice\\src\\main\\webapp\\asset\\avatar\\";
String filename=null;
if(!user.getAvatar().isEmpty()){
String uuid= UUID.randomUUID().toString().replaceAll("-","");
String contentType=user.getAvatar().getContentType();
String suffixName=contentType.substring(contentType.indexOf("/"+1));
filename=uuid+"."+suffixName;
System.out.println(filename);
user.getAvatar().transferTo(newFile(localPath+filename));
}
sqlPath="/image/"+filename;
user.setAvatar(sqlPath);
userService.add(user);
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
48
49
50
51
52
53
54
    SaveGoalStatus sgs=new SaveGoalStatus();
if(flag==0){
//添加存款目标
saveGoalService.addSaveGoal(goal);
sgs.setInfo("添加目标成功");
sgs.setCode(200);
return sgs;

}else {
sgs.setInfo("存在正在进行的目标,请先完成当前目标");
sgs.setCode(0);
return sgs;
}

}
//获取家庭成员
@RequestMapping(value={"/getmembers"})
@ResponseBody
public List<User> getMembers(HttpSession session,@RequestBody User user){
return saveGoalService.getAllUser(user.getUid());
}

//获取个人历史存款目标
@RequestMapping(value ={"/getAllGoal"})
@ResponseBody
public GoalListStatus getAllGoal(HttpSession session,@RequestBody SaveGoalCombination saveGoalCombination){
GoalListStatus gls=new GoalListStatus();
List<Deposit> depositList=individualManagerService.getHistoryGoal(saveGoalCombination);
gls.setData(depositList);
gls.setCount(individualManagerService.getCountHistoryGoal(saveGoalCombination));
return gls;
}

//获取个人当前存款目标
@RequestMapping(value = {"/getCurrentGoal"})
@ResponseBody
public AccountAndDepositVo getCurrentGoal(HttpSession session,@RequestBody User user){
return individualManagerService.getIndividualState(user.getUid());
}

//取消存款目标
@RequestMapping(value = {"/cancelGoal"})
@ResponseBody
public SaveGoalStatus ConcelGoal(HttpSession session,@RequestBody User user){
SaveGoalStatus sgs=new SaveGoalStatus();
individualManagerService.cancelGoal(user.getUid());
sgs.setInfo("取消目标成功");
sgs.setCode(200);
return sgs;
}
//提前完成存款目标
@RequestMapping(value = {"/finishGoal"})
@ResponseBody
public SaveGoalStatus finishGoal(HttpSession session,@RequestBody User user){


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