vmis进销存项目-1

vmis进销存项目-1
1.选择好项目的后台模板,调通各个页面链接


js控制导航栏。
利用svn管理项目,svn集成了apache,因为用的adsl拨号上网没固定ip,所以通过动态域名绑定(花生壳,3322org)可以在任何地方checkout commit开发项目。

数据库 用户模块表设计:

将spring security集成到项目中


可以通过application_security.xml进行资源与方法的权限管理

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:securuty
="http://www.springframework.org/schema/security"
    xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p
="http://www.springframework.org/schema/p"
    xsi:schemaLocation
="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"
>
    
    
<!-- 
    <securuty:global-method-security>
        
        <securuty:protect-pointcut access="ROLE_ADMIN,ROLE_USER" expression="execution(* com.vle.service.*.sayHello(..))"/>
        <securuty:protect-pointcut access="ROLE_ADMIN" expression="execution(* com.vle.service.*.say*(..))"/>
    </securuty:global-method-security>
     
-->
    
<securuty:http auto-config="true" access-denied-page="/noaccess.jsp" >
    
        
<!-- 指定登陆页面 -->
        
<securuty:form-login login-page="/login.jsp" default-target-url="/index.jsp"/>
        
<!-- 退出系统的页面 -->
        
<securuty:logout logout-success-url="/login.jsp"/>
        
        
<!-- 不拦截登陆页面     -->
        
<securuty:intercept-url pattern="/login.jsp*" filters="none"/>
        
<securuty:intercept-url pattern="/images/*" filters="none"/>
        
<securuty:intercept-url pattern="/js/*" filters="none"/>
        
<!--<securuty:intercept-url pattern="/admin.jsp" access="ROLE_ADMIN"/>
        <securuty:intercept-url pattern="/index.jsp" access="ROLE_ADMIN,ROLE_USER"/>
         <securuty:intercept-url pattern="/**" access="ROLE_USER"/>
         
             
-->
         
<!-- 防止第二次登陆 -->
             
         
<securuty:concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true"/>
         
    
</securuty:http>
    
<securuty:authentication-provider>
        
<securuty:password-encoder hash="md5">
                
<securuty:salt-source user-property="username"/>
            
</securuty:password-encoder>
            
<securuty:jdbc-user-service data-source-ref="dataSource" 
            users-by-username-query
="select username,password,status as enabled from user where username=?"
            authorities-by-username-query
="SELECT u.username,r.NAME AS authority FROM USER u JOIN user_role ur ON u.id=ur.user_id JOIN  role r ON r.id=ur.role_id where u.username=?"/>

    
</securuty:authentication-provider>
    
    
<!-- 资源文件 -->
    
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        
<property name="basename" value="classpath:org/springframework/security/messages_zh_CN"/>
    
</bean>
    
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver"/>
    
<!-- 
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/ss"/>
        <property name="username" value="root"/>
        <property name="password" value="mysqladmin"></property>
    </bean>
     
-->

    
<bean id="filterInvocationDefinitionSource" class="com.vle.security.JdbcFilterInvocationDefinitionSourceFactoryBean">
        
<property name="dataSource" ref="dataSource"/>
        
<property name="resourceQuery" 
        value
="SELECT rs.res_string,r.name FROM resc rs JOIN role_resc rr ON rs.id=rr.resc_id JOIN role r ON rr.role_id=r.id ORDER BY rs.priority"/>
    
</bean>
        
    
<bean id="filterSecurityInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor" autowire="byType">
        
<securuty:custom-filter before="FILTER_SECURITY_INTERCEPTOR"/>
        
<property name="objectDefinitionSource" ref="filterInvocationDefinitionSource"/>  
    
</bean>
    
    
<!-- 用户信息缓存 -->
    
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>
    
<bean id="userEhCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
        
<property name="cacheManager" ref="cacheManager"/>
        
<property name="cacheName" value="userCache"/>
    
</bean>
    
<bean id="userCache" class="org.springframework.security.providers.dao.cache.EhCacheBasedUserCache">
        
<property name="cache" ref="userEhCache"/>
    
</bean>
    
    
</beans>

管理之后如图,当以管理员身份进去时,

能看见管理员才能用的模块,者利用了ss2的标签。
当用户进去时,

部分模块不可见,同理很多service方法也可以用配置设置。
然后是jsptaglib和poi对查询的主体做分页和导出excel控制。

目前用户模块正在继续编写。将对用户的权限、部门和MD5&盐值加密算法并入其中

你可能感兴趣的:(vmis进销存项目-1)