基于javaweb的SSM+Maven报销erp系统(java+ssm+jsp+layui+jquery+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

560023182402

570023182402

580023182402

590023182402

000023192402

010023192402

020023192402

040023192402

基于javaweb的SSM+Maven报销erp系统(java+ssm+jsp+layui+jquery+mysql)

项目介绍

ssm ERP报销系统。主要分4个角色,总经理、部门经理、财务、普通员工,普通员工填写报销单后需要提交给部门经理审核,再由财务支付,如果金额大于5000,还需要总经理审核。 总经理拥有 部门管理 和 员工管理 功能 部门经理拥有 员工管理 功能 其他职务没有

环境需要

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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目  6.数据库:MySql 5.7版本;

技术栈

  1. 后端:Spring SpringMVC MyBatis 2. 前端:JSP+LayUI+jQuery

主要技术

  • Spring Ioc  - Mybatis+Spring整合  - 声明式事务  - Spring标签库  - Spring拦截器

软件架构

三层架构

  • 持久层–Mybatis  - 表现层–Spring MVC  - 控制器–Spring Controller

基于MVC模式

  • 视图–Jsp  - 模型–JavaBean  - 业务层–JavaBean

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行; 3. 将项目中spring-dao.xml配置文件中的数据库配置改为自己的配置 4. 运行项目,在浏览器中输入http://localhost:8080/ 登录

账户说明

系统默认用户里有四个,分别对应10001(总经理),10002(部门经理),10003(财务),10004(普通员工) 密码为000000 员工填写报销单后需要提交给部门经理审核,再由财务支付, 如果金额大于5000,还需要总经理审核。 总经理拥有 部门管理 和 员工管理 功能 部门经理拥有 员工管理 功能 其他职务没有

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
public String detail(int id,Map<String,Object> map){
map.put("claimVoucher",claimVoucherBiz.get(id));
map.put("items",claimVoucherBiz.getItems(id));
map.put("records",claimVoucherBiz.getRecords(id));
return "claim_voucher_detail";
}

@RequestMapping("/self")
public String self(HttpSession session,Map<String,Object> map){
Employee employee = (Employee)session.getAttribute("employee");
map.put("list",claimVoucherBiz.getForSelf(employee.getSn()));
return "claim_voucher_self";
}

@RequestMapping("/deal")
public String deal(HttpSession session,Map<String,Object> map){
Employee employee = (Employee)session.getAttribute("employee");
map.put("list",claimVoucherBiz.getForDeal(employee.getSn()));
return "claim_voucher_deal";
}

@RequestMapping("/to_update")
public String toUpdate(int id,Map<String,Object> map){
map.put("items",Contant.getItems());
ClaimVoucherInfo info = new ClaimVoucherInfo();
info.setClaimVoucher(claimVoucherBiz.get(id));
info.setItems(claimVoucherBiz.getItems(id));
map.put("info",info);
return "claim_voucher_update";
}

@RequestMapping("/update")
public String update(HttpSession session,ClaimVoucherInfo info){
Employee employee = (Employee)session.getAttribute("employee");
info.getClaimVoucher().setCreateSn(employee.getSn());
claimVoucherBiz.update(info.getClaimVoucher(),info.getItems());
return "redirect:deal";
}

@RequestMapping("/submit")
public String submit(int id){
claimVoucherBiz.submit(id);
return "redirect:deal";
}

@RequestMapping("/to_check")
public String toCheck(int id,Map<String,Object> map){
map.put("claimVoucher",claimVoucherBiz.get(id));
map.put("items",claimVoucherBiz.getItems(id));
map.put("records",claimVoucherBiz.getRecords(id));
DealRecord dealRecord =new DealRecord();
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
                    if(row==null){
continue;
}
if (row.getCell(0)!=null && !row.getCell(0).toString().isEmpty()){
claimVoucherInfo = new ClaimVoucherInfo();
claimVoucherInfo.setClaimVoucher(new ClaimVoucher());
claimVoucherInfo.setItems(new ArrayList<ClaimVoucherItem>());
list.add(claimVoucherInfo);
//去掉创建者工号中的 .0 因为如果全是数字后面有.0
claimVoucherInfo.getClaimVoucher().setCreateSn(Integer.toString((int)(row.getCell(0).getNumericCellValue())));
claimVoucherInfo.getClaimVoucher().setCause(row.getCell(1).toString());
claimVoucherInfo.getClaimVoucher().setTotalAmount(row.getCell(2).getNumericCellValue());
}
claimVoucherItem = new ClaimVoucherItem();
claimVoucherItem.setItem(row.getCell(3).toString());
claimVoucherItem.setAmount(row.getCell(4).getNumericCellValue());
if (!row.getCell(5).toString().isEmpty() && row.getCell(5).toString() != null) {
claimVoucherItem.setComment(row.getCell(5).toString());
}else {
claimVoucherItem.setComment("无");
}
claimVoucherInfo.getItems().add(claimVoucherItem);
}
}
} catch (IOException e) {
e.printStackTrace();
}
return list;
}

}
package com.cmj.oa.controller;



@Controller("departmentController")
@RequestMapping("/department")
public class DepartmentController {
@Autowired
private DepartmentBiz departmentBiz;
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


@Controller("departmentController")
@RequestMapping("/department")
public class DepartmentController {
@Autowired
private DepartmentBiz departmentBiz;
@Autowired
private ClaimVoucherBiz claimVoucherBiz;
@Autowired
private EmployeeBiz employeeBiz;
@Qualifier("employeeDao")
@Autowired
private EmployeeDao employeeDao;
@RequestMapping("/list")
public String list(Map<String,Object> map){
map.put("list",departmentBiz.getAll());
return "department_list";
}

@RequestMapping("/to_add")
public String toAdd(Map<String,Object> map){
map.put("department",new Department());
return "department_add";
}

@RequestMapping("/add")
public String add(Department department){
departmentBiz.add(department);
return "redirect:list";
}

@RequestMapping(value = "/to_update",params = "sn")
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
        result.put("success", true);
result.put("msg", "导入成功");
return result;
}

private List<ClaimVoucherInfo> excel_to_claimVoucherInfo(File userUploadFile) throws ParseException {
List<ClaimVoucherInfo> list = new ArrayList<>();
ClaimVoucherInfo claimVoucherInfo = null;
ClaimVoucherItem claimVoucherItem = null;
try {
POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(userUploadFile));
HSSFWorkbook wb = new HSSFWorkbook(fs);
//获取第一个sheet页
HSSFSheet sheet = wb.getSheetAt(0);
if(sheet!=null){
//从第二行开始导入数据
for(int rowNum =1;rowNum<=sheet.getLastRowNum();rowNum++){
HSSFRow row = sheet.getRow(rowNum);
if(row==null){
continue;
}
if (row.getCell(0)!=null && !row.getCell(0).toString().isEmpty()){
claimVoucherInfo = new ClaimVoucherInfo();
claimVoucherInfo.setClaimVoucher(new ClaimVoucher());
claimVoucherInfo.setItems(new ArrayList<ClaimVoucherItem>());
list.add(claimVoucherInfo);
//去掉创建者工号中的 .0 因为如果全是数字后面有.0
claimVoucherInfo.getClaimVoucher().setCreateSn(Integer.toString((int)(row.getCell(0).getNumericCellValue())));
claimVoucherInfo.getClaimVoucher().setCause(row.getCell(1).toString());
claimVoucherInfo.getClaimVoucher().setTotalAmount(row.getCell(2).getNumericCellValue());
}
claimVoucherItem = new ClaimVoucherItem();
claimVoucherItem.setItem(row.getCell(3).toString());
claimVoucherItem.setAmount(row.getCell(4).getNumericCellValue());
if (!row.getCell(5).toString().isEmpty() && row.getCell(5).toString() != null) {
claimVoucherItem.setComment(row.getCell(5).toString());
}else {
claimVoucherItem.setComment("无");
}
claimVoucherInfo.getItems().add(claimVoucherItem);
}
}
} catch (IOException e) {
e.printStackTrace();
}
return list;
}

}
package com.cmj.oa.controller;

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
    @PostMapping("/add")
public String add(Employee employee){
employeeBiz.add(employee);
return "redirect:list";
}

@RequestMapping(value = "/to_update",params = "sn")
public String toUpdate(String sn, Map<String,Object> map){
map.put("employee",employeeBiz.get(sn));
map.put("dlist",departmentBiz.getdlist());
map.put("plist",Contant.getPost());
return "employee_update";
}

@RequestMapping("/update")
public String update(Employee employee){
employeeBiz.edit(employee);
return "redirect:list";
}

@RequestMapping(value = "/remove",params = "sn")
public String remove(String sn){
//根据员工工号找到对应报销单 再根据对应的报销单id删除报销单 最后删除员工信息
List<ClaimVoucher> claimVoucherList = claimVoucherBiz.getForSelf(sn);
if (!claimVoucherList.isEmpty() && claimVoucherList != null){
List<Integer> ids = new ArrayList<>();
for (ClaimVoucher claimVoucher : claimVoucherList){
ids.add(claimVoucher.getId());
}
for (int id : ids){
claimVoucherBiz.deleteById(id);
}
}
employeeBiz.remove(sn);
return "redirect:list";
}


}
package com.cmj.oa.controller;


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