锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲色图.com,亚洲AV午夜福利精品一区二区 ,亚洲成在人线中文字幕http://www.tkk7.com/maguangjun/category/35632.htmlzh-cnSun, 07 Dec 2008 02:41:02 GMTSun, 07 Dec 2008 02:41:02 GMT60Spring瀹氭椂鍣ㄧ殑瀹炰緥http://www.tkk7.com/maguangjun/articles/244030.html椹厜鍐?/dc:creator>椹厜鍐?/author>Tue, 02 Dec 2008 14:27:00 GMThttp://www.tkk7.com/maguangjun/articles/244030.htmlhttp://www.tkk7.com/maguangjun/comments/244030.htmlhttp://www.tkk7.com/maguangjun/articles/244030.html#Feedback0http://www.tkk7.com/maguangjun/comments/commentRss/244030.htmlhttp://www.tkk7.com/maguangjun/services/trackbacks/244030.html
package com.strongit.zwjc.infopush.vo;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import com.strongit.zwjc.common.dao.BaseDAO;
import com.strongit.zwjc.infopush.po.Afficheinfo;
import com.strongit.zwjc.infopush.po.InfopushDocClass;
import com.strongit.zwjc.infopush.po.Performance;
import com.strongit.zwjc.util.TimeKit1;

/**
 * 瀹氫竴涓畾鏃舵煡璇㈢殑綾?br />  
*/

public class ScheduledTimer {

    
/**
     * 瀹氭椂榪愯鐨勬柟娉?br />      
*/
    
private BaseDAO baseDaoImpl;

    @SuppressWarnings({ 
"unchecked""deprecation" })
    
public void startRun() throws Exception {
        
// 絎竴錛屾煡璇㈢被鍨嬭〃涓殑瑙勫垯
        Calendar now = Calendar.getInstance();
        @SuppressWarnings(
"unused")
        
int nowDay = now.get(Calendar.DAY_OF_MONTH);
        
int nowMonth = now.get(Calendar.MONTH) + 1;
        List
<InfopushDocClass> InfopushClassList = this.baseDaoImpl
                .findAll(InfopushDocClass.
class);
        String docPushRule 
= "monthly:15";
        @SuppressWarnings(
"unused")
        String monthly 
= "";
        String strDay 
= "";
        
int intDay = 0;
        String classId 
= "";
        String className 
= "" ;
        String orgId 
= "";
        String orgName 
= "orgName" ;
        
//InfopushDoc infopushDoc = null;
        List infopushDocList = null ;
        Performance performance 
= null ;
        Afficheinfo afficheinfo 
= null ;
        String strSfficheinfo 
= "" ;
        List
<Performance> performanceList = null ;
        Date performanceDate 
= TimeKit1.getDateByString(TimeKit1.now("short"));
        
for (InfopushDocClass infopushDocClass : InfopushClassList) {
            docPushRule 
= infopushDocClass.getDocPushRule();
            classId 
= infopushDocClass.getClassId();
            orgId 
= infopushDocClass.getOrgId();
            monthly 
= docPushRule.split(":")[0];
            strDay 
= docPushRule.split(":")[1];
            intDay 
= Integer.parseInt(strDay);
            
//姝ゆ柟娉曞彧鑳介傚簲涓?nbsp;鏈堟姤
            if (nowDay == intDay) {
                infopushDocList 
= this.baseDaoImpl
                        .findAll(
"FROM InfopushDoc idoc where idoc.infopushDocClass.classId='"
                                
+ classId
                                
+ "' and idoc.orgId = '"
                                
+ orgId
                                
+ "'");
                
                
int totalsize = infopushDocList.size() ;
                
                performanceList 
= this.baseDaoImpl.findAll(Performance.class);
                
if(totalsize>0){
                    
boolean flag = false ;
                    
for(Performance performance2:performanceList){
                        
int performanceMonth = performance2.getPerformanceDate().getMonth()+1 ;
                        
if(nowMonth==performanceMonth){
                            flag 
= true ;
                            
break ;
                        }
                    }
                    
if(flag){
                    }
else{
//                        鏈夋暟鎹?nbsp;鍔犲垎
                        className = infopushDocClass.getClassName() ;
                        orgName 
= infopushDocClass.getOrgName() ;
                        performance 
= new Performance() ;
                        performance.setClassId(classId);
                        performance.setOrgId(orgId);
                        performance.setOrgName(orgName);
                        performance.setClassName(className);
                        performance.setPerformanceDate(performanceDate);
                        performance.setScore(Long.valueOf(
"1"));
                        
this.baseDaoImpl.insert(performance);
                    }
                }
else{
                    
boolean flag = false ;
                    
for(Performance performance2:performanceList){
                        
int performanceMonth = performance2.getPerformanceDate().getMonth()+1 ;
                        
if(nowMonth==performanceMonth){
                            flag 
= true ;
                            
break ;
                        }
                    }
                    
if(flag){
                    }
else{
//                        娌℃湁鏁版嵁 涓?鍒嗭紝騫朵笖閫氭姤
                        orgName = infopushDocClass.getOrgName() ;
                        className 
= infopushDocClass.getClassName() ;
                        performance 
= new Performance() ;
                        performance.setClassId(classId);
                        performance.setClassName(className);
                        performance.setOrgId(orgId);
                        performance.setOrgName(orgName);
                        performance.setPerformanceDate(performanceDate);
                        performance.setScore(Long.valueOf(
"0"));
                        
this.baseDaoImpl.insert(performance);
                        
                        className 
= infopushDocClass.getClassName() ;
                        afficheinfo 
= new Afficheinfo() ;
                        afficheinfo.setClassId(classId);
                        afficheinfo.setOrgId(orgId);
                        afficheinfo.setAfficheinfoDate(performanceDate);
                        strSfficheinfo 
= "銆?/span>"+TimeKit1.getNowDate()+"銆戙?/span>"+orgName+"銆戞湭鎺ㄩ併?/span>"+className+"銆戝垎綾繪枃鐚俊鎭?/span>" ;
                        afficheinfo.setAfficheInfo(strSfficheinfo);
                        afficheinfo.setClassName(className);
                        afficheinfo.setOrgName(orgName);
                        
this.baseDaoImpl.insert(afficheinfo);
                    }
                }
            }
        }
        System.out.println(
"鎴愬姛鎻掑叆錛侊紒");
    }

    
public BaseDAO getBaseDaoImpl() {
        
return baseDaoImpl;
    }

    
public void setBaseDaoImpl(BaseDAO baseDaoImpl) {
        
this.baseDaoImpl = baseDaoImpl;
    }

}
applicationContext-infopush-timer.xml錛?br />
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation
="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    
<!-- 瀹氭椂榪愯鐨勭被 -->
    
<bean id="scheduledTimer"
        class
="com.strongit.zwjc.infopush.vo.ScheduledTimer">
        
<property name="baseDaoImpl">
            
<ref bean="baseDAO" />
        
</property>
    
</bean>
    
    
<!--瀹氫箟瀹氭椂鎵цScheduledTimer綾諱腑  鐨剆tartRun()鏂規硶-->
    
<bean id="scheduledTask"
        class
="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        
<property name="targetObject">
            
<ref bean="scheduledTimer" />
        
</property>
        
<property name="targetMethod">
            
<value>startRun</value>
        
</property>
    
</bean>

    
<!--瑙﹀彂鍣ㄧ殑bean鐨勮緗紝鍦ㄨ繖閲屾垜浠緗簡鎴戜滑瑕佽Е鍙戠殑jobDetail鏄摢涓?br />         榪欓噷鎴戜滑瀹氫箟浜嗚瑙﹀彂鐨刯obDetail錛屽嵆瑙﹀彂鍣ㄥ幓瑙﹀彂鍝釜bean..騫朵笖鎴戜滑榪樺畾涔変簡瑙﹀彂鐨勬椂闂?/span>-->
    
<bean id="cronTrigger"
        class
="org.springframework.scheduling.quartz.CronTriggerBean">
        
<property name="jobDetail">
            
<ref bean="scheduledTask" />
        
</property>
        
<property name="cronExpression">
<!--             鍏抽敭鍦ㄩ厤緗琛ㄨ揪寮?nbsp;姣忓ぉ涓崍12鐐歸挓鏁磋Е鍙戜簨浠?/span>-->
            
<value>0 0 12 * * ?</value>
        
</property>
    
</bean>

    
<!--綆$悊瑙﹀彂鍣ㄧ殑鎬昏緗?鍙互鏀劇疆澶氫釜瑙﹀彂鍣ㄣ?/span>-->
    
<bean autowire="no"
        class
="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        
<property name="triggers">
            
<list>
                
<ref bean="cronTrigger" />
            
</list>
        
</property>
    
</bean>

</beans>

涓よ呯粨鍚堝氨鑳藉疄鐜板畾鏃惰繍琛岀▼搴忥紒



]]>
主站蜘蛛池模板: 中文亚洲成a人片在线观看| 欧美男同gv免费网站观看 | 一本无码人妻在中文字幕免费| 亚洲日韩乱码中文无码蜜桃臀网站| 无码人妻一区二区三区免费视频 | 无码精品国产一区二区三区免费| 亚洲精品无码永久在线观看你懂的 | 在线免费中文字幕| 亚洲黄色免费观看| 黄瓜视频影院在线观看免费| 77777午夜亚洲| 国产在线播放免费| 九九热久久免费视频| 亚洲av无码一区二区三区网站| 免费黄色电影在线观看| 91亚洲一区二区在线观看不卡 | 日本最新免费不卡二区在线| 337p日本欧洲亚洲大胆人人| 亚洲无码黄色网址| 亚洲免费在线观看| 免费久久人人爽人人爽av| 亚洲高清日韩精品第一区| 免费H网站在线观看的| 国产成人精品日本亚洲语音| 亚洲国产午夜中文字幕精品黄网站 | 极品美女一级毛片免费| 亚洲精品乱码久久久久久久久久久久| 18禁在线无遮挡免费观看网站| 亚洲人成免费网站| 亚洲国模精品一区| 久久免费的精品国产V∧| 亚洲高清一区二区三区| 亚洲一区二区三区免费| 最近2018中文字幕免费视频| 亚洲国产精品嫩草影院 | 亚洲天堂福利视频| 亚洲国产精品一区二区第一页免 | 久久亚洲中文字幕精品有坂深雪| 91视频国产免费| 丰满人妻一区二区三区免费视频| 亚洲成av人片不卡无码|