——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SSM+Maven家庭理财管理系统(java+ssm+bootstrap+highcharts+mysql)
项目介绍
SSM家庭理财管理系统,分为管理员与普通用户两种角色; 管理员角色包含以下功能: 收支管理:收入信息维护、支出信息维护; 财务管理:证券账户管理、持股管理、证券流水账管理; 报表管理:按时间收入报表、按时间支出报表、按类型报表; 用户报表:用户信息管理、修改用户信息、修改密码、安全退出;
普通用户角色包含以下功能: 收支管理:收入信息维护、支出信息维护; 财务管理:证券账户管理、持股管理、证券流水账管理; 报表管理:按时间收入报表、按时间支出报表、按类型报表; 用户报表:修改用户信息、修改密码、安全退出;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7/8.0等版本均可;
技术栈
后端:Spring+springmvc+mybatis
前端:JSP+css+javascript+jQuery+bootstrap+highcharts
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置; 3. 将项目中db.properties配置文件中的数据库配置改为自己的用户名密码,然后运行; 4. 运行成功后,在浏览器中输入:http://localhost:8080/ffms/index.do 管理员账号密码:admin/123456 普通用户账号密码:user/123456
——————————CodeStart——————————
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
|
@Controller public class TradeController { @Resource private TradeService tradeService; @Resource private DatadicService datadicService; @Resource private UserService userService; @Resource private SharesService sharesService;
@InitBinder public void initBinder(WebDataBinder binder) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); dateFormat.setLenient(false); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); }
|
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
| map.put("searchStarttime", s_security.getSearchStarttime()); map.put("searchEndtime", s_security.getSearchEndtime()); map.put("roleid", s_security.getRoleid()); map.put("userid", s_security.getUserid()); map.put("start", pageBean.getStart()); map.put("size", pageBean.getPageSize()); List<Security> securityList = securityService.findSecurity(map); Long total = securityService.getTotalSecurity(map); JSONObject result = new JSONObject(); JSONArray jsonArray = JSONArray.fromObject(securityList); result.put("rows", jsonArray); result.put("total", total); ResponseUtil.write(response, result); return null; }
@RequestMapping("/securitysave.do") public String save(Security security, HttpServletResponse response) throws Exception { int resultTotal = 0; JSONObject result = new JSONObject(); if (security.getId() == null) { resultTotal = securityService.addSecurity(security); } else { resultTotal = securityService.updateSecurity(security); }
if (resultTotal > 0) { result.put("errres", true); result.put("errmsg", "数据保存成功!"); } else { result.put("errres", false); result.put("errmsg", "数据保存失败"); } ResponseUtil.write(response, result); return null; }
|
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
| } else if (!basepath.matches(regex) && !basepath.matches(regex1)) { result.put("errres", false); result.put("errmsg", "备份路径不正确!"); } else { File file = new File(basepath); if (file.exists() == false) { file.mkdir(); }
String filepath = basepath + "\\" + DateUtil.getCurrentDateCustomFormat("yyyyMMddHHmmss") + ".sql"; File files = new File(filepath); if (files.exists() == false) { file.createNewFile(); } FileOutputStream fout = new FileOutputStream(filepath);
OutputStreamWriter writer = new OutputStreamWriter(fout, "utf8"); writer.write(outStr); writer.flush(); in.close(); xx.close(); br.close(); writer.close(); fout.close();
databack.setUserid(userid); databack.setFilename(DateUtil.getCurrentDateCustomFormat("yyyyMMddHHmmss") + ".sql"); databack.setTime(DateUtil.getCurrentDateCustomFormat("yyyy-MM-dd HH:mm:ss")); databack.setLocation(filepath); databack.setDataid(1);
if (save(databack)) { result.put("errres", true); result.put("errmsg", "数据备份成功!"); } else { result.put("errres", false); result.put("errmsg", "数据备份失败"); }
} } catch (Exception e) { System.out.println("异常"); e.printStackTrace(); result.put("errres", false); result.put("errmsg", "数据备份失败"); } ResponseUtil.write(response, result); return null; }
|
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
| ResponseUtil.write(response, result); return null; }
@RequestMapping("/datainit.do") public String datainit(@RequestParam(value = "userid") Integer userid, Database datainit, HttpServletResponse response) throws Exception { JSONObject result = new JSONObject(); String[] tables = {"t_income", "t_pay", "t_security", "t_shares", "t_trade"}; for (int i = 0; i < tables.length; i++) { databaseService.truncateTable(tables[i]); }
datainit.setUserid(userid); datainit.setTime(DateUtil.getCurrentDateCustomFormat("yyyy-MM-dd HH:mm:ss")); datainit.setDataid(3);
if (save(datainit)) { result.put("errres", true); result.put("errmsg", "数据库初始化成功!"); } else { result.put("errres", false); result.put("errmsg", "数据库初始化失败"); } ResponseUtil.write(response, result); return null; }
|
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
|
@Controller public class SecurityController { @Resource private SecurityService securityService; @Resource private DatadicService datadicService; @Resource private UserService userService; @InitBinder public void initBinder(WebDataBinder binder) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); dateFormat.setLenient(false); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); }
|
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
| JSONArray incomeArray,obj; JSONObject result; JSONArray outerobj = new JSONArray(); for(int i=0;i<incomers.size();i++){ curincomer = incomers.get(i).getIncomer(); incomeArray = new JSONArray(); for(int j = 0; j < incomeList.size(); j++) { obj = new JSONArray(); if(incomeList.get(j).getIncomer().equals(curincomer)){ obj.add(incomeList.get(j).getIncometime()); obj.add(incomeList.get(j).getMoney()); incomeArray.add(obj); } } if(incomeArray.size()>0){ result = new JSONObject(); result.put("name", curincomer); result.put("data", incomeArray); outerobj.add(result); } } ResponseUtil.write(response, outerobj); return null; }
@RequestMapping("/payTimeManage.do") public String payTimeManage() { return "payTimeManage"; }
@RequestMapping("/producePayTime.do")
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=321023491103200yi
https://javayms.pages.dev?id=321023491103200yi