package com.cnd3b.service;

import com.cnd3b.common.BaseClass;
import com.cnd3b.common.data.db.DBConnect;
import com.cnd3b.common.data.db.SQLiteJDBC;

public class DataStatusChange extends BaseClass implements Runnable {

    @Override
    public void run() {
        try {
            if (new SQLiteJDBC().checkServicesUsed("DataStatusChange",true)) {
                agentActivities();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 经销商推广活动到期
     */
    public void agentActivities() {
        try {
            DBConnect dbConnect = new DBConnect();
            dbConnect.runSqlUpdate("update tagentactivities set fstatus='到期' where convert(varchar(10),fenddate,120)<=getdate() and fstatus!='到期'");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
