美文网首页
办公系统

办公系统

作者: 磊_5d71 | 来源:发表于2018-12-22 16:45 被阅读0次

报销流程

图片.png

数据库设计

图片.png

项目创建

图片.png

包及全局配置

图片.png

dao配置

<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.alan.oa.dao"></context:component-scan>

    <!--配置数据源-->
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.cj.jdbc.Driver"></property>
        <property name="url" value="jdbc:mysql://localhost:3306/oa?characterEncoding=utf-8"></property>
        <property name="username" value="root"></property>
        <property name="password" value="root"></property>
    </bean>

    <!--配置session工厂-->
    <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!--关联声明的数据源-->
        <property name="dataSource" ref="dataSource"></property>
        <!--配置别名,entity下的类不需要配置包的全路径-->
        <property name="typeAliasesPackage" value="com.alan.oa.entity"></property>
    </bean>

    <!--配置映射器接口-->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="sqlSessionFactoryBeanName" value="sessionFactory"></property>
        <!--配置接口与映射文件对应,需要放置在dao包里面-->
        <property name="basePackage" value="com.alan.oa.dao"></property>
    </bean>
</beans>

biz配置

  • 声明式事务需要配置在业务层 dao层封装为事务太细了,web层一次次请求封装为事务太粗了,放在业务层声明事务相对合理。 一个业务功能,要么都成功,要么都失败。
<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">


    <!--将dao层的spring配置文件引入进来-->
    <import resource="spring-dao.xml"></import>

    <!--开启自动扫描-->
    <context:component-scan base-package="com.alan.oa.biz"></context:component-scan>
    <!--开启aspectj自动代理-->
    <aop:aspectj-autoproxy></aop:aspectj-autoproxy>


    <!--配置声明式事务-->
    <bean id="transationManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"></property>
    </bean>


    <!--声明通知-->
    <tx:advice id="txAdvice" transaction-manager="transationManager">
        <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.alan.oa.biz.*.*(..))"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="txpc"/>
    </aop:config>
</beans>

WEB配置

  • dto 是页面数据与controller数据之间交互,类似dao层里面的entity包
  • 在web.xml中配置springMVC加载
<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.alan.oa.controller"/>
    <mvc:annotation-driven/>

    <!--静态资源交给servlet处理-->
    <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>
</beans>

部门管理

1、实体类
2、dao接口与sql映射文件
3、biz接口与其实现类
4、控制器
5、页面

通过Spring注解进行格式转换

    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm")
    private Date dealTime;
  • 声明式事务封装在业务层。 每一个业务层的具体方法中的所有sql都是一个统一的事物,具有原子性、一致性、隔离性、持久性。

相关文章

  • 办公系统

    1.0到4.0的演进,主要从办公资源,数据使用,实时使用信息,在线支付等方面入手,在对办公资源优化的基础上实现共享...

  • 办公系统

    报销流程 数据库设计 项目创建 包及全局配置 dao配置 biz配置 声明式事务需要配置在业务层 dao层封装为事...

  • 【OA软件】办公系统OA哪家好?

    【OA软件】办公系统OA哪家好? 【OA软件】办公系统OA哪家好?越来越多的企业有OA办公系统的需求,想用OA办公...

  • 凡度空间,您的办公空间解决专家

    凡度空间专注于办公家具研发和办公空间研究,为客户提供包括系统家具、智能系统、办公室隔断、终端控制系统等办公配套。通...

  • 智能办公系统解决方案

    什么是智能办公系统? 智能办公自动化系统(IOAS)利用先进的技术和设备提高办公效率和办公质量,改善办公条件,减轻...

  • 【OA软件】OA办公系统选型需要把握协同的4大特性

    OA办公系统曾经被认为是入门级的办公系统,无法与ERP、财务、进销存等管理系统相比。但当今,随着OA办公系统的协同...

  • 如何看待一款OA办公系统的易用性?

    看一个OA办公系统是否优秀,最直接的体现就是OA办公系统的易用性。一个优秀的OA办公系统厂商提供给用户的OA办公系...

  • 手机oa办公系统帮助企业实现移动办公?

    手机oa办公系统帮助企业实现移动办公? 手机oa办公系统是能实现一个企业多人、多部门、跨地域的协同办公模式,使日常...

  • 办公系统宣传书

    办公系统目前主要在企业微信、钉钉、普通网页等基础工具上制作,具有高灵活性、移动性、可视化、简便管理、简单使用等特点...

  • 办公系统小程序

    传统办公系统软件很实用,但是目前商务人士整天穿梭于全国甚至世界各地,需要随时随地访问公司系统取得相关资源,同时把一...

网友评论

      本文标题:办公系统

      本文链接:https://www.haomeiwen.com/subject/wvdxfqtx.html