基于SSM的OA系统

基于SSM的OA系统:

-Mybatis、Spring、SpringMVC
-MySql

主要技术:

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

用例分析:

1.功能模块
-部门信息管理
-员工信息管理
-报销单处理
2.主要角色
-员工
-部门经理
-总经理
-财务

开发流程:

以上便是开发过程:
开发完成之后的代码结构大致是这样的:

其中Biz模块:

Dao模块:

Web模块:

接下来介绍几个文件:

oa中的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.fitsoft</groupId>
    <artifactId>oa</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>

    <modules>
        <module>oa_dao</module>
        <module>oa_biz</module>
        <module>web</module>
    </modules>

</project>

oa_dao中的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>oa</artifactId>
        <groupId>com.fitsoft</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>oa_dao</artifactId>

    <properties>
        <spring-version>4.0.2.RELEASE</spring-version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.11</version>
        </dependency>

        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.4.4</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>1.3.1</version>
        </dependency>
    </dependencies>
</project>

oa_biz中的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>oa</artifactId>
        <groupId>com.fitsoft</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>oa_biz</artifactId>

    <properties>
        <spring-version>4.0.2.RELEASE</spring-version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.fitsoft</groupId>
            <artifactId>oa_dao</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.8.0</version>
        </dependency>
    </dependencies>
</project>

web中的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>oa</artifactId>
        <groupId>com.fitsoft</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>web</artifactId>

    <properties>
        <spring-version>4.0.2.RELEASE</spring-version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.fitsoft</groupId>
            <artifactId>oa_dao</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.fitsoft</groupId>
            <artifactId>oa_biz</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring-version}</version>
        </dependency>
    </dependencies>
</project>

spring-dao.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd">

    <context:component-scan base-package="com.fitsoft.oa.dao"/>

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/oa?useUnicode=true&amp;characterEncoding=utf-8&amp;serverTimezone=Asia/Shanghai"/>
        <property name="username" value="root"/>
        <property name="password" value="joker666"/>
    </bean>

    <!-- 数据源 -->
    <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="typeAliasesPackage" value="com.fitsoft.oa.entity"/>
    </bean>

    <!-- 映射扫描配置 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="sqlSessionFactoryBeanName" value="sessionFactory"/>
        <property name="basePackage" value="com.fitsoft.oa.dao"/>
    </bean>
</beans>

spring-biz.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx.xsd">

    <!-- 关联 -->
    <import resource="spring-dao.xml"/>

    <context:component-scan base-package="com.fitsoft.oa.biz"/>
    <aop:aspectj-autoproxy/>

    <!-- 事务管理器 -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <!-- 声明通知 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="get*" read-only="true"/>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="search*" read-only="true"/>
            <tx:method name="*" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>

    <!-- 关联通知和切入点 -->
    <aop:config>
        <!-- 所有参数 -->
        <aop:pointcut id="txpc" expression="execution(* com.fitsoft.oa.biz.*.*(..))"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="txpc"/>
    </aop:config>
</beans>

spring-web.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd">

    <import resource="spring-biz.xml"/>

    <context:component-scan base-package="com.fitsoft.oa.controller"/>
    <mvc:annotation-driven/>

    <mvc:default-servlet-handler/>

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
        <property name="prefix" value="/WEB-INF/pages/"/>
        <property name="suffix" value=".jsp"/>
    </bean>

    <mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/**"/>
            <bean class="com.fitsoft.oa.global.LoginInterceptor"/>
        </mvc:interceptor>
    </mvc:interceptors>

</beans>

这里是项目的地址:
https://www.lanzous.com/i6c5jkh
亲测运行OK,另需要此教程的话可以加我QQ,在右侧公告栏,免费。

原文地址:https://www.cnblogs.com/zqm-sau/p/11569641.html

时间: 2024-08-05 22:26:44

基于SSM的OA系统的相关文章

基于SSM的房屋租赁系统租房管理系统——计算机毕业设计

基于SSM的房屋租赁系统租房管理系统 系统采用Mybatis框架实现ORM对象关系映射,前台JSP实现,后台springMvc映射,使用Spring框架进行整合.适合学习J2EE的一段时间的熟手,代码思路清晰,注解详细,数据库用的是mysql5.1,服务器用的tomcat7,JDK版本1.7. 编程软件Eclispe J2EE版本.是典型MVC架构,并且前后台分离,具体功能这里不再赘述,请下方看系统详细演示图,如果大家有什么疑问或者什么不懂得可以在下方给我留言,或者你有更好的建议等等都可以的,也

《基于面向对象的OA系统的设计和实现》的办公功能分析图

原文地址:https://www.cnblogs.com/zztcat/p/11790978.html

asp.net oa系统开发方案

思道OA开发版 2016下载地址http://www.345oa.com/develop/ 思道OA基于Microsoft .NET/ASP.NET 4.0开发,数据库SQL Server,开发工具Visual Studio 2013. 思道OA提供开放的二次开发系统架构.Web开发的全套环境,是开发管理应用系统的理想平台. 思道OA提供单点登录技术,可于第三方系统集成,提供相关接口.案例源码. 思道OA介绍 1. 基于.NET平台    思道OA是国内最早发布的基于.NET平台的企业OA办公解

基于ssm框架的论坛系统

                                                             基于ssm框架的论坛系统 1.介绍 本论坛系统基于spring,spring mvc,mybatis框架搭建,实现了论坛的基本功能,注册,登录,发帖,浏览等功能. 2.截图 3.源码 源码已上传至我的github,链接为 https://github.com/withstars/Genesis  ,如有需要请自行下载 原文地址:https://www.cnblogs.com/

一个基于SSM框架开发的高并发电商秒杀Web系统

0 前言 一个基于SSM框架的高并发秒杀系统采用IDEA+Maven+SSM+Mysql+Redis+Jetty.Bootstrap/Jquery开发. 通过这个小项目,理清了基于SSM框架开发Web应用的流程以及常见的避坑方法,并在最后简单采用了Redis缓存以及Mysql Procedure对项目进行了高并发优化. 接下来从DAO层.Service层.Web层开发以及高并发优化4个方面梳理整个项目开发过程. 源码地址https://github.com/Allegr0/seckill 项目准

基于SSM的水质检测系统-java水质检测系统

基于SSM的水质检测系统-java水质检测系统 1.包含源程序,数据库脚本.代码和数据库脚本都有详细注释.2.课题设计仅供参考学习使用,可以在此基础上进行扩展完善开发环境:Eclipse ,MYSQL,JDK1.7,Tomcat 7涉及技术点:MVC模式.SpringMvc.Mybatis.Spring.HTML.JavaScript.CSS.JQUERY.DWR.Ajax等系统采用Mybatis框架实现ORM对象关系映射,前台JSP实现,后台springMvc映射,使用Spring框架进行整合

基于SSM技术的茶馆在线预约系统-java茶馆在线预约系统

基于SSM技术的茶馆在线预约系统-java茶馆在线预约系统 1.包含源程序,数据库脚本.代码和数据库脚本都有详细注释.2.课题设计仅供参考学习使用,可以在此基础上进行扩展完善开发环境:Eclipse ,MYSQL,JDK1.7,Tomcat 7涉及技术点:MVC模式.SpringMvc.Mybatis.Spring.HTML.JavaScript.CSS.JQUERY.DWR.Ajax等系统采用Mybatis框架实现ORM对象关系映射,前台JSP实现,后台springMvc映射,使用Spring

基于SSM的图书馆座位预约管理系统占座系统-java图书馆座位预约管理系统占座系统

基于SSM的图书馆座位预约管理系统占座系统-java图书馆座位预约管理系统占座系统 1.包含源程序,数据库脚本.代码和数据库脚本都有详细注释.2.课题设计仅供参考学习使用,可以在此基础上进行扩展完善开发环境:Eclipse ,MYSQL,JDK1.7,Tomcat 7涉及技术点:MVC模式.SpringMvc.Mybatis.Spring.HTML.JavaScript.CSS.JQUERY.DWR.Ajax等系统采用Mybatis框架实现ORM对象关系映射,前台JSP实现,后台springMv

基于ssm框架设计定做

一,关于我们启思java设计帮做为广大学子提供设计帮做服务!即使您完全不懂程序,或者您忙于实习没时间做.都请交给我们吧.诚信,专业,具有十年java设计及设计代写经验.为您提供全程跟踪服务.确保您顺利通过设计答辩. 联系我们:.扣.扣.号(幺零三贰三七幺贰幺) 二,服务流程我们在确认了设计的要求后,即可开始设计.无定金,2至3个工作日后,由学生验收设计,满意后才付费.不满意,绝不收您一分钱.全国仅此一家!!! 三,服务项目1.java设计:进销存管理系统,网上购物系统,物流管理系统,网上订餐系统