其实审核的功能
就是 改变下  state 状态,
默认状态是:"未审核"
审核之后是:把状态改为 "已通过" 或者  "不通过" (由管理员审核)如果没有审核,则时间超过了12小时的话,默认审核 为"已通过"。请问这个该怎么实现呢?

解决方案 »

  1.   

    使用Java中的定时任务TimerTask
    具体使用方法详见API
      

  2.   

    定时器,一小时执行一次。判断数据创建时间与当前时间相差几个小时,大于12小时的update。spring2.5.6定时器
    spring3定时器
      

  3.   

    有没和Struts2 结合使用的例子呢?
    谢谢。
      

  4.   

    http://weibo.com/2339175770/z00zyzqJc
    你觉得是不是可以这样?
    启动bean时初始化这个任务,从数据库拉取数据,批量更新状态
      

  5.   


    struts可以和spring整合,如果不想要hibernate就不要引入它的包。
    SSH
    SSI
      

  6.   


    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    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/tx 
                         http://www.springframework.org/schema/tx/spring-tx.xsd 
                         http://www.springframework.org/schema/aop 
                         http://www.springframework.org/schema/aop/spring-aop.xsd">   
    <!-- DRG抓取包裹信息   1小时一次 end-->
    <!-- TMS转运   1小时一次-->
         <bean id="timeGetPackageState2Infomation" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
            <property name="targetObject">
                <ref bean="tmsRouteSearchManagerAction"/><!-- 自己在定义 的struts的bean名字-->
            </property>
            <property name="targetMethod">
                <value>getPackageInfomation</value><!-- 调用执行的方法-->
            </property>
        </bean>
        <bean id="timeGetPackageState2InfomationTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> 
         <property name="jobDetail"> 
             <ref bean="timeGetPackageState2Infomation"/>   <!--调用上面声明的bean -->
         </property>
         <property name="cronExpression">
           <value>0 */1 * * * ?</value>  <!-- 每5分钟触发一次 -->
    <!--          <value>0 0 */1 * * ?</value>   每1小时触发一次 -->
         </property>
     </bean>
    <!-- TMS转运   1小时一次 end-->
        
    <bean autowire = "no" class = "org.springframework.scheduling.quartz.SchedulerFactoryBean">
            <property name="triggers">
                <list>
                    <ref local="timeGetPackageState2InfomationTrigger"/>
                </list>
            </property>
        </bean>
        

    </beans>LZ,这就是一个spring的定时器,时间可以自己定义的,我这是5分钟跑一个程序!
      

  7.   

    定时器吧。 这样解决是最方便的。 集体update status
      

  8.   


    额,没用过数据库作业这个呢。这个job 会一直更新的吧,我想要的是当用户提交了申请之后,如果管理员没有审核,则12小时之后(开始计算的时间为用户提交的时间。),自动默认审核通过。审核通过了之后,以后就不再判断是否需要更新了。这个job 就是说,会一直扫描整个表,不管你已审核了还是未审核。