getAll(String id);
14 | }
15 |
--------------------------------------------------------------------------------
/oa_service/src/main/java/com/cd/oa/service/GlobalService.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.service;
2 |
3 | import com.cd.oa.entity.Employee;
4 |
5 | public interface GlobalService {
6 |
7 | //登陆
8 | Employee login(String id,String password);
9 |
10 | //修改密码
11 | void changePassword(Employee employee);
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/oa_web/src/main/webapp/assets/img/patterns/noise.html:
--------------------------------------------------------------------------------
1 | 404 Not Found Not Found The requested URL "/demos/absolute/1.1/assets/img/patterns/noise.png" was not found on this server.
--------------------------------------------------------------------------------
/oa_web/src/main/webapp/assets/img/patterns/topbar-bg3.html:
--------------------------------------------------------------------------------
1 | 404 Not Found Not Found The requested URL "/demos/absolute/1.1/assets/img/patterns/topbar-bg3.jpg" was not found on this server.
--------------------------------------------------------------------------------
/oa_web/target/oa_web-1.0-SNAPSHOT/assets/img/patterns/noise.html:
--------------------------------------------------------------------------------
1 | 404 Not Found Not Found The requested URL "/demos/absolute/1.1/assets/img/patterns/noise.png" was not found on this server.
--------------------------------------------------------------------------------
/oa_web/target/oa_web-1.0-SNAPSHOT/assets/img/patterns/topbar-bg3.html:
--------------------------------------------------------------------------------
1 | 404 Not Found Not Found The requested URL "/demos/absolute/1.1/assets/img/patterns/topbar-bg3.jpg" was not found on this server.
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/dao/LogDao.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.dao;
2 |
3 | import com.cd.oa.entity.Log;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | @Repository("logDao")
9 | public interface LogDao {
10 |
11 | void insert(Log log);
12 |
13 | void delete(int id);
14 |
15 | List selectAll(String id);
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/oa_web/src/main/webapp/assets/skin/default_skin/img/plugins/slider-knob.html:
--------------------------------------------------------------------------------
1 | 404 Not Found Not Found The requested URL "/demos/absolute/1.1/assets/skin/default_skin/img/plugins/slider-knob.png" was not found on this server.
--------------------------------------------------------------------------------
/oa_web/target/oa_web-1.0-SNAPSHOT/assets/skin/default_skin/img/plugins/slider-knob.html:
--------------------------------------------------------------------------------
1 | 404 Not Found Not Found The requested URL "/demos/absolute/1.1/assets/skin/default_skin/img/plugins/slider-knob.png" was not found on this server.
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/dao/DealRecordDao.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.dao;
2 |
3 | import com.cd.oa.entity.DealRecord;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | @Repository("dealRecordDao")
9 | public interface DealRecordDao {
10 |
11 | void insert(DealRecord dealRecord);
12 |
13 | List selectByClaimVoucher(int claimVoucherId);
14 |
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/oa_service/src/main/java/com/cd/oa/service/EmployeeService.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.service;
2 |
3 | import com.cd.oa.entity.Employee;
4 |
5 | import java.util.List;
6 |
7 | public interface EmployeeService {
8 |
9 | void add(Employee employee);
10 |
11 | void edit(Employee employee);
12 |
13 | void remove(String id);
14 |
15 | Employee get(String id);
16 |
17 | List getAll();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/oa_service/src/main/java/com/cd/oa/service/DepartmentService.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.service;
2 |
3 | import com.cd.oa.entity.Department;
4 |
5 | import java.util.List;
6 |
7 | public interface DepartmentService {
8 |
9 | void add(Department department);
10 |
11 | void edit(Department department);
12 |
13 | void remove(String id);
14 |
15 | Department get(String id);
16 |
17 | List getAll();
18 | }
19 |
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/dao/DepartmentDao.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.dao;
2 |
3 | import com.cd.oa.entity.Department;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | @Repository("departmentDao")
9 | public interface DepartmentDao {
10 |
11 | void insert(Department department);
12 |
13 | void update(Department department);
14 |
15 | void delete(String id);
16 |
17 | Department select(String id);
18 |
19 | List selectAll();
20 | }
21 |
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/dao/ClaimVoucherItemDao.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.dao;
2 |
3 | import com.cd.oa.entity.ClaimVoucherItem;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | @Repository("claimVoucherItemDao")
9 | public interface ClaimVoucherItemDao {
10 |
11 | void insert(ClaimVoucherItem claimVoucherItem);
12 |
13 | void update(ClaimVoucherItem claimVoucherItem);
14 |
15 | void delete(int id);
16 |
17 | //获取某报销单所属的所有报销单条目
18 | List selectByClaimVoucher(int claimVoucherId);
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/dao/ClaimVoucherDao.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.dao;
2 |
3 | import com.cd.oa.entity.ClaimVoucher;
4 | import com.cd.oa.entity.DealRecord;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.List;
8 |
9 | @Repository("claimVoucherDao")
10 | public interface ClaimVoucherDao {
11 |
12 | void insert(ClaimVoucher claimVoucher);
13 |
14 | void update(ClaimVoucher claimVoucher);
15 |
16 | void delete(int id);
17 |
18 | ClaimVoucher select(int id);
19 |
20 | //根据创建人id查看个人报销单
21 | List selectByCreateId(String cid);
22 |
23 | //根据待处理人id查看待处理报销单
24 | List selectByNextDealId(String ndid);
25 | }
26 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.cd
8 | OA
9 | pom
10 | 1.0-SNAPSHOT
11 |
12 | oa_dao
13 | oa_service
14 | oa_web
15 |
16 |
17 |
18 |
19 | 4.3.23.RELEASE
20 |
21 |
22 |
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/entity/Department.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.entity;
2 |
3 | /**
4 | * 部门实体类【实体类属性与表的字段是一一对应的】
5 | */
6 | public class Department {
7 | private String id;
8 | private String name;
9 | private String address;
10 |
11 | public String getId() {
12 | return id;
13 | }
14 |
15 | public void setId(String id) {
16 | this.id = id;
17 | }
18 |
19 | public String getName() {
20 | return name;
21 | }
22 |
23 | public void setName(String name) {
24 | this.name = name;
25 | }
26 |
27 | public String getAddress() {
28 | return address;
29 | }
30 |
31 | public void setAddress(String address) {
32 | this.address = address;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/oa_web/src/main/java/com/cd/oa/dto/ClaimVoucherInfo.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.dto;
2 |
3 | import com.cd.oa.entity.ClaimVoucher;
4 | import com.cd.oa.entity.ClaimVoucherItem;
5 |
6 | import java.util.List;
7 |
8 | public class ClaimVoucherInfo {
9 | private ClaimVoucher claimVoucher;
10 | private List items;
11 |
12 | public ClaimVoucher getClaimVoucher() {
13 | return claimVoucher;
14 | }
15 |
16 | public void setClaimVoucher(ClaimVoucher claimVoucher) {
17 | this.claimVoucher = claimVoucher;
18 | }
19 |
20 | public List getItems() {
21 | return items;
22 | }
23 |
24 | public void setItems(List items) {
25 | this.items = items;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/dao/EmployeeDao.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.dao;
2 |
3 | import com.cd.oa.entity.Employee;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.List;
8 |
9 | @Repository("employeeDao")
10 | public interface EmployeeDao {
11 |
12 | void insert(Employee employee);
13 |
14 | void update(Employee employee);
15 |
16 | void delete(String id);
17 |
18 | Employee select(String id);
19 |
20 | List selectAll();
21 |
22 | /**
23 | * 多参数时,注意一定要在参数前加上@Param来匹配相同参数名的参数,
24 | * 即@Param注解内的名称必须与xml映射文件中的属性名一致
25 | * 则会报: Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2] 参数不匹配错误
26 | */
27 | List selectByDepartmentAndPost(@Param("did") String did,@Param("post") String post);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/oa_service/src/main/java/com/cd/oa/service/impl/LogServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.service.impl;
2 |
3 | import com.cd.oa.dao.LogDao;
4 | import com.cd.oa.entity.Log;
5 | import com.cd.oa.service.LogService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.beans.factory.annotation.Qualifier;
8 | import org.springframework.stereotype.Service;
9 |
10 | import java.util.List;
11 |
12 | @Service("logService")
13 | public class LogServiceImpl implements LogService {
14 |
15 | @Qualifier("logDao")
16 | @Autowired
17 | private LogDao logDao;
18 |
19 | public void add(Log log) {
20 | logDao.insert(log);
21 | }
22 |
23 | public void delete(int id) {
24 | logDao.delete(id);
25 | }
26 |
27 | public List getAll(String id) {
28 | return logDao.selectAll(id);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/oa_service/src/main/java/com/cd/oa/service/ClaimVoucherService.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.service;
2 |
3 | import com.cd.oa.entity.ClaimVoucher;
4 | import com.cd.oa.entity.ClaimVoucherItem;
5 | import com.cd.oa.entity.DealRecord;
6 |
7 | import java.util.List;
8 |
9 | public interface ClaimVoucherService {
10 |
11 | //保存报销单
12 | void save(ClaimVoucher claimVoucher, List items);
13 |
14 | //获取报销单
15 | ClaimVoucher get(int id);
16 |
17 | //获取报销单条目
18 | List getItems(int claimVoucherId);
19 |
20 | //获取处理记录
21 | List getRecords(int claimVoucherId);
22 |
23 | //获取个人报销单
24 | List getForSelf(String id);
25 |
26 | //获取待处理报销单
27 | List getForDeal(String id);
28 |
29 | //修改报销单
30 | void update(ClaimVoucher claimVoucher, List items);
31 |
32 | //提交表单
33 | void submit(int id);
34 |
35 | //报销单审核与打款
36 | void deal(DealRecord dealRecord);
37 | }
38 |
--------------------------------------------------------------------------------
/oa_service/src/main/java/com/cd/oa/service/impl/GlobalServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.service.impl;
2 |
3 | import com.cd.oa.dao.EmployeeDao;
4 | import com.cd.oa.entity.Employee;
5 | import com.cd.oa.service.GlobalService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.beans.factory.annotation.Qualifier;
8 | import org.springframework.stereotype.Service;
9 |
10 | @Service("globalService")
11 | public class GlobalServiceImpl implements GlobalService {
12 |
13 | @Qualifier("employeeDao")
14 | @Autowired
15 | private EmployeeDao employeeDao;
16 |
17 | public Employee login(String id, String password) {
18 | Employee employee = employeeDao.select(id);
19 | if(employee!=null && employee.getPassword().equals(password)){
20 | return employee;
21 | }
22 | return null;
23 | }
24 |
25 | public void changePassword(Employee employee) {
26 | employeeDao.update(employee);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/oa_web/src/main/java/com/cd/oa/controller/LogController.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.controller;
2 |
3 | import com.cd.oa.entity.Employee;
4 | import com.cd.oa.service.LogService;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.PathVariable;
8 | import org.springframework.web.bind.annotation.RequestMapping;
9 |
10 | import javax.servlet.http.HttpSession;
11 | import java.util.Map;
12 |
13 | @Controller
14 | @RequestMapping("log")
15 | public class LogController {
16 |
17 | @Autowired
18 | private LogService logService;
19 |
20 | @RequestMapping("/list")
21 | public String list(HttpSession session,Map map){
22 | Employee employee = (Employee) session.getAttribute("employee");
23 | String id = employee.getId();
24 | map.put("list",logService.getAll(id));
25 | return "log_list";
26 | }
27 |
28 | @RequestMapping("/delete/{id}")
29 | public String delete(@PathVariable int id){
30 | logService.delete(id);
31 | return "redirect:/log/list";
32 | }
33 |
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/oa_service/src/main/java/com/cd/oa/service/impl/DepartmentServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.service.impl;
2 |
3 | import com.cd.oa.dao.DepartmentDao;
4 | import com.cd.oa.entity.Department;
5 | import com.cd.oa.service.DepartmentService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.beans.factory.annotation.Qualifier;
8 | import org.springframework.stereotype.Service;
9 |
10 | import java.util.List;
11 |
12 | @Service("departmentService")
13 | public class DepartmentServiceImpl implements DepartmentService {
14 |
15 |
16 | @Qualifier("departmentDao")
17 | @Autowired
18 | private DepartmentDao departmentDao;
19 |
20 | public void add(Department department) {
21 | departmentDao.insert(department);
22 | }
23 |
24 | public void edit(Department department) {
25 | departmentDao.update(department);
26 | }
27 |
28 | public void remove(String id) {
29 | departmentDao.delete(id);
30 | }
31 |
32 | public Department get(String id) {
33 | return departmentDao.select(id);
34 | }
35 |
36 | public List getAll() {
37 | return departmentDao.selectAll();
38 | }
39 | }
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/entity/ClaimVoucherItem.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.entity;
2 |
3 | /**
4 | * 报销单条目实体类
5 | */
6 | public class ClaimVoucherItem {
7 | private int id;
8 | private int claimVoucherId;
9 | private String item;
10 | private Double amount;
11 | private String comment;
12 |
13 | public int getId() {
14 | return id;
15 | }
16 |
17 | public void setId(int id) {
18 | this.id = id;
19 | }
20 |
21 | public int getClaimVoucherId() {
22 | return claimVoucherId;
23 | }
24 |
25 | public void setClaimVoucherId(int claimVoucherId) {
26 | this.claimVoucherId = claimVoucherId;
27 | }
28 |
29 | public String getItem() {
30 | return item;
31 | }
32 |
33 | public void setItem(String item) {
34 | this.item = item;
35 | }
36 |
37 | public Double getAmount() {
38 | return amount;
39 | }
40 |
41 | public void setAmount(Double amount) {
42 | this.amount = amount;
43 | }
44 |
45 | public String getComment() {
46 | return comment;
47 | }
48 |
49 | public void setComment(String comment) {
50 | this.comment = comment;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/oa_service/src/main/java/com/cd/oa/service/impl/EmployeeServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.service.impl;
2 |
3 | import com.cd.oa.dao.EmployeeDao;
4 | import com.cd.oa.entity.Employee;
5 | import com.cd.oa.service.EmployeeService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.beans.factory.annotation.Qualifier;
8 | import org.springframework.stereotype.Service;
9 |
10 | import javax.annotation.Resource;
11 | import java.util.List;
12 |
13 | @Service("employeeService")
14 | public class EmployeeServiceImpl implements EmployeeService {
15 |
16 | @Qualifier("employeeDao")
17 | @Autowired
18 | private EmployeeDao employeeDao;
19 |
20 | public void add(Employee employee) {
21 | //给添加的员工设置一个默认密码
22 | employee.setPassword("123456");
23 | employeeDao.insert(employee);
24 | }
25 |
26 | public void edit(Employee employee) {
27 | employeeDao.update(employee);
28 | }
29 |
30 | public void remove(String id) {
31 | employeeDao.delete(id);
32 | }
33 |
34 | public Employee get(String id) {
35 | return employeeDao.select(id);
36 | }
37 |
38 | public List getAll() {
39 | return employeeDao.selectAll();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/oa_web/src/main/java/com/cd/oa/global/EncodingFilter.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.global;
2 |
3 | import javax.servlet.*;
4 | import javax.servlet.http.HttpServletRequest;
5 | import javax.servlet.http.HttpServletResponse;
6 | import java.io.IOException;
7 |
8 | public class EncodingFilter implements Filter {
9 |
10 | private String encoding = "utf-8";
11 |
12 | //获取web.xml容器中配置的filter过滤器的初始化参数
13 | public void init(FilterConfig filterConfig) throws ServletException {
14 |
15 | if(filterConfig.getInitParameter("encoding")!=null){
16 | encoding = filterConfig.getInitParameter("encoding");
17 | }
18 | }
19 |
20 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
21 | throws IOException, ServletException {
22 | //HttpServletRequest继承了ServletRequest,这里不强转也是可以的
23 | HttpServletRequest request = (HttpServletRequest) servletRequest;
24 | HttpServletResponse response = (HttpServletResponse) servletResponse;
25 | request.setCharacterEncoding(encoding);
26 | response.setCharacterEncoding(encoding);
27 | //调用过滤器链执行doFilter()方法,让过滤器链继续执行
28 | filterChain.doFilter(request,response);
29 | }
30 |
31 | public void destroy() {
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/oa_web/src/main/java/com/cd/oa/global/GlobalInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.global;
2 |
3 | import org.springframework.web.servlet.HandlerInterceptor;
4 | import org.springframework.web.servlet.ModelAndView;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 | import javax.servlet.http.HttpSession;
9 |
10 | public class GlobalInterceptor implements HandlerInterceptor {
11 |
12 | public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
13 |
14 | // String url = httpServletRequest.getRequestURI();
15 | // if(url.toLowerCase().indexOf("login")>=0){
16 | // return true;
17 | // }
18 |
19 | HttpSession session = httpServletRequest.getSession();
20 | if(session.getAttribute("employee")!=null){
21 | return true;
22 | }
23 | httpServletResponse.sendRedirect("/to_login");
24 | return false;
25 | }
26 |
27 | public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
28 |
29 | }
30 |
31 | public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/entity/Log.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.entity;
2 |
3 | import org.springframework.format.annotation.DateTimeFormat;
4 |
5 | import java.util.Date;
6 |
7 | public class Log {
8 | private int id;
9 | private String employeeId;
10 | @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm")
11 | private Date operationTime;
12 | private String operation;
13 |
14 | public int getId() {
15 | return id;
16 | }
17 |
18 | public void setId(int id) {
19 | this.id = id;
20 | }
21 |
22 | public String getEmployeeId() {
23 | return employeeId;
24 | }
25 |
26 | public void setEmployeeId(String employeeId) {
27 | this.employeeId = employeeId;
28 | }
29 |
30 | public Date getOperationTime() {
31 | return operationTime;
32 | }
33 |
34 | public void setOperationTime(Date operationTime) {
35 | this.operationTime = operationTime;
36 | }
37 |
38 | public String getOperation() {
39 | return operation;
40 | }
41 |
42 | public void setOperation(String operation) {
43 | this.operation = operation;
44 | }
45 |
46 | private Employee employee;
47 |
48 | public Employee getEmployee() {
49 | return employee;
50 | }
51 |
52 | public void setEmployee(Employee employee) {
53 | this.employee = employee;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/oa_service/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | OA
7 | com.cd
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | oa_service
13 |
14 |
15 |
16 |
17 | com.cd
18 | oa_dao
19 | 1.0-SNAPSHOT
20 |
21 |
22 |
23 | org.springframework
24 | spring-aop
25 | ${spring.version}
26 |
27 |
28 |
29 | org.aspectj
30 | aspectjweaver
31 | 1.9.3
32 |
33 |
34 |
35 | org.springframework
36 | spring-tx
37 | ${spring.version}
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/oa_dao/src/main/java/com/cd/oa/entity/Employee.java:
--------------------------------------------------------------------------------
1 | package com.cd.oa.entity;
2 |
3 | /**
4 | * 员工实体类
5 | */
6 | public class Employee {
7 | private String id;
8 | private String password;
9 | private String name;
10 | private String departmentId;
11 | private String post;
12 |
13 | public String getId() {
14 | return id;
15 | }
16 |
17 | public void setId(String id) {
18 | this.id = id;
19 | }
20 |
21 | public String getPassword() {
22 | return password;
23 | }
24 |
25 | public void setPassword(String password) {
26 | this.password = password;
27 | }
28 |
29 | public String getName() {
30 | return name;
31 | }
32 |
33 | public void setName(String name) {
34 | this.name = name;
35 | }
36 |
37 | public String getDepartmentId() {
38 | return departmentId;
39 | }
40 |
41 | public void setDepartmentId(String departmentId) {
42 | this.departmentId = departmentId;
43 | }
44 |
45 | public String getPost() {
46 | return post;
47 | }
48 |
49 | public void setPost(String post) {
50 | this.post = post;
51 | }
52 |
53 | //关联对象
54 | private Department department;
55 |
56 | public Department getDepartment() {
57 | return department;
58 | }
59 |
60 | public void setDepartment(Department department) {
61 | this.department = department;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/oa_dao/target/classes/com/cd/oa/dao/LogDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | insert into log(employee_id,operation_time,operation) values(#{employeeId},#{operationTime},#{operation})
18 |
19 |
20 |
21 | delete from log where id=#{id}
22 |
23 |
24 |
25 | select l.*,e.id eid,e.name ename from log l
26 | left join employee e on (e.id=l.employee_id)
27 | where e.id=#{id} order by l.operation_time desc
28 |
29 |
30 |
--------------------------------------------------------------------------------
/oa_dao/src/main/resources/com/cd/oa/dao/LogDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | insert into log(employee_id,operation_time,operation) values(#{employeeId},#{operationTime},#{operation})
18 |
19 |
20 |
21 | delete from log where id=#{id}
22 |
23 |
24 |
25 | select l.*,e.id eid,e.name ename from log l
26 | left join employee e on (e.id=l.employee_id)
27 | where e.id=#{id} order by l.operation_time desc
28 |
29 |
30 |
--------------------------------------------------------------------------------
/oa_web/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | OA
7 | com.cd
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | oa_web
13 | war
14 |
15 |
16 |
17 |
18 | com.cd
19 | oa_service
20 | 1.0-SNAPSHOT
21 |
22 |
23 |
24 | org.springframework
25 | spring-webmvc
26 | ${spring.version}
27 |
28 |
29 |
30 | jstl
31 | jstl
32 | 1.2
33 |
34 |
35 |
36 | javax.servlet
37 | servlet-api
38 | 2.5
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/oa_web/src/main/webapp/js/items.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function(){
2 | builderIndex();
3 | calculateMoney();
4 | $("#addItemButton").click(
5 | function(){
6 | $("#items").children("div").last().after($("#items").children("div").first().clone());
7 | $("#items").children("div").find("button").click(
8 | function(){
9 | $(this).parent().parent().remove();
10 | if($("#items").children("div").size()==1){
11 | $("#items").find("button").attr("disabled",true);
12 | }
13 | builderIndex();
14 | calculateMoney();
15 | }
16 | );
17 | $("#items").find("button").attr("disabled",false);
18 | builderIndex();
19 | $(".money").change(
20 | function(){
21 | calculateMoney();
22 | }
23 | );
24 | calculateMoney();
25 | }
26 | );
27 | $(".money").change(
28 | function(){
29 | calculateMoney();
30 | }
31 | );
32 | });// JavaScript Document
33 |
34 | function builderIndex(){
35 | $.each($("#items").children(),function(i,val){
36 | $("#items").children("div").eq(i).children().eq(0).find("select").attr("name","items["+i+"].item");
37 | $("#items").children("div").eq(i).children().eq(1).find("input").attr("name","items["+i+"].amount");
38 | $("#items").children("div").eq(i).children().eq(2).find("input").attr("name","items["+i+"].comment");
39 |
40 | });
41 | }
42 | function calculateMoney(){
43 | var totalMoney=0;
44 | $.each($(".money"),function(i,val){
45 | totalMoney+=parseFloat($(".money").eq(i).val());
46 | });
47 | $("#totalMoney").attr("value",totalMoney);
48 | }
--------------------------------------------------------------------------------
/oa_dao/target/classes/com/cd/oa/dao/ClaimVoucherItemDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | insert into claim_voucher_item (claim_voucher_id,item,amount,comment)
15 | values (#{claimVoucherId},#{item},#{amount},#{comment})
16 |
17 |
18 |
19 | update claim_voucher_item set claim_voucher_id=#{claimVoucherId},item=#{item},amount=#{amount},comment=#{comment}
20 |
21 |
22 |
23 | delete from claim_voucher_item where id=#{id}
24 |
25 |
26 |
27 | select *from claim_voucher_item where claim_voucher_id=#{claimVoucherId} order by id
28 |
29 |
30 |
--------------------------------------------------------------------------------
/oa_dao/src/main/resources/com/cd/oa/dao/ClaimVoucherItemDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | insert into claim_voucher_item (claim_voucher_id,item,amount,comment)
15 | values (#{claimVoucherId},#{item},#{amount},#{comment})
16 |
17 |
18 |
19 | update claim_voucher_item set claim_voucher_id=#{claimVoucherId},item=#{item},amount=#{amount},comment=#{comment}
20 |
21 |
22 |
23 | delete from claim_voucher_item where id=#{id}
24 |
25 |
26 |
27 | select *from claim_voucher_item where claim_voucher_id=#{claimVoucherId} order by id
28 |
29 |
30 |
--------------------------------------------------------------------------------
/oa_web/target/oa_web-1.0-SNAPSHOT/js/items.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function(){
2 | builderIndex();
3 | calculateMoney();
4 | $("#addItemButton").click(
5 | function(){
6 | $("#items").children("div").last().after($("#items").children("div").first().clone());
7 | $("#items").children("div").find("button").click(
8 | function(){
9 | $(this).parent().parent().remove();
10 | if($("#items").children("div").size()==1){
11 | $("#items").find("button").attr("disabled",true);
12 | }
13 | builderIndex();
14 | calculateMoney();
15 | }
16 | );
17 | $("#items").find("button").attr("disabled",false);
18 | builderIndex();
19 | $(".money").change(
20 | function(){
21 | calculateMoney();
22 | }
23 | );
24 | calculateMoney();
25 | }
26 | );
27 | $(".money").change(
28 | function(){
29 | calculateMoney();
30 | }
31 | );
32 | });// JavaScript Document
33 |
34 | function builderIndex(){
35 | $.each($("#items").children(),function(i,val){
36 | $("#items").children("div").eq(i).children().eq(0).find("select").attr("name","items["+i+"].item");
37 | $("#items").children("div").eq(i).children().eq(1).find("input").attr("name","items["+i+"].amount");
38 | $("#items").children("div").eq(i).children().eq(2).find("input").attr("name","items["+i+"].comment");
39 |
40 | });
41 | }
42 | function calculateMoney(){
43 | var totalMoney=0;
44 | $.each($(".money"),function(i,val){
45 | totalMoney+=parseFloat($(".money").eq(i).val());
46 | });
47 | $("#totalMoney").attr("value",totalMoney);
48 | }
--------------------------------------------------------------------------------
/oa_web/src/main/webapp/vendor/plugins/xeditable/inputs/typeaheadjs/lib/typeahead.js-bootstrap.css:
--------------------------------------------------------------------------------
1 | .twitter-typeahead .tt-query,
2 | .twitter-typeahead .tt-hint {
3 | margin-bottom: 0;
4 | }
5 |
6 | .tt-dropdown-menu {
7 | min-width: 160px;
8 | margin-top: 2px;
9 | padding: 5px 0;
10 | background-color: #fff;
11 | border: 1px solid #ccc;
12 | border: 1px solid rgba(0,0,0,.2);
13 | *border-right-width: 2px;
14 | *border-bottom-width: 2px;
15 | -webkit-border-radius: 6px;
16 | -moz-border-radius: 6px;
17 | border-radius: 6px;
18 | -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
19 | -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
20 | box-shadow: 0 5px 10px rgba(0,0,0,.2);
21 | -webkit-background-clip: padding-box;
22 | -moz-background-clip: padding;
23 | background-clip: padding-box;
24 | }
25 |
26 | .tt-suggestion {
27 | display: block;
28 | padding: 3px 20px;
29 | }
30 |
31 | .tt-suggestion.tt-is-under-cursor {
32 | color: #fff;
33 | background-color: #0081c2;
34 | background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
35 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
36 | background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
37 | background-image: -o-linear-gradient(top, #0088cc, #0077b3);
38 | background-image: linear-gradient(to bottom, #0088cc, #0077b3);
39 | background-repeat: repeat-x;
40 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0)
41 | }
42 |
43 | .tt-suggestion.tt-is-under-cursor a {
44 | color: #fff;
45 | }
46 |
47 | .tt-suggestion p {
48 | margin: 0;
49 | }
50 |
--------------------------------------------------------------------------------
/oa_web/target/oa_web-1.0-SNAPSHOT/vendor/plugins/xeditable/inputs/typeaheadjs/lib/typeahead.js-bootstrap.css:
--------------------------------------------------------------------------------
1 | .twitter-typeahead .tt-query,
2 | .twitter-typeahead .tt-hint {
3 | margin-bottom: 0;
4 | }
5 |
6 | .tt-dropdown-menu {
7 | min-width: 160px;
8 | margin-top: 2px;
9 | padding: 5px 0;
10 | background-color: #fff;
11 | border: 1px solid #ccc;
12 | border: 1px solid rgba(0,0,0,.2);
13 | *border-right-width: 2px;
14 | *border-bottom-width: 2px;
15 | -webkit-border-radius: 6px;
16 | -moz-border-radius: 6px;
17 | border-radius: 6px;
18 | -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
19 | -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
20 | box-shadow: 0 5px 10px rgba(0,0,0,.2);
21 | -webkit-background-clip: padding-box;
22 | -moz-background-clip: padding;
23 | background-clip: padding-box;
24 | }
25 |
26 | .tt-suggestion {
27 | display: block;
28 | padding: 3px 20px;
29 | }
30 |
31 | .tt-suggestion.tt-is-under-cursor {
32 | color: #fff;
33 | background-color: #0081c2;
34 | background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
35 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
36 | background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
37 | background-image: -o-linear-gradient(top, #0088cc, #0077b3);
38 | background-image: linear-gradient(to bottom, #0088cc, #0077b3);
39 | background-repeat: repeat-x;
40 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0)
41 | }
42 |
43 | .tt-suggestion.tt-is-under-cursor a {
44 | color: #fff;
45 | }
46 |
47 | .tt-suggestion p {
48 | margin: 0;
49 | }
50 |
--------------------------------------------------------------------------------
/oa_dao/target/classes/com/cd/oa/dao/DepartmentDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | insert into department values(#{id},#{name},#{address})
18 |
19 |
20 |
21 |
22 | update department set name=#{name},address=#{address} where id=#{id}
23 |
24 |
25 |
26 | delete from department where id=#{id}
27 |
28 |
29 |
32 |
33 | select * from department where id=#{id}
34 |
35 |
36 |
37 | select * from department
38 |
39 |
40 |
--------------------------------------------------------------------------------
/oa_dao/src/main/resources/com/cd/oa/dao/DepartmentDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | insert into department values(#{id},#{name},#{address})
18 |
19 |
20 |
21 |
22 | update department set name=#{name},address=#{address} where id=#{id}
23 |
24 |
25 |
26 | delete from department where id=#{id}
27 |
28 |
29 |
32 |
33 | select * from department where id=#{id}
34 |
35 |
36 |
37 | select * from department
38 |
39 |
40 |
--------------------------------------------------------------------------------
/oa_web/src/main/webapp/WEB-INF/pages/bottom.jsp:
--------------------------------------------------------------------------------
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
2 |
3 |
4 |
5 |
19 |
20 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |