PointLotteryBiz.java 1.01 KB
package com.cjs.cms.biz.user.point;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cjs.cms.dao.user.point.PointLotteryDao;
import com.cjs.cms.model.user.point.PointLotteryInfo;

@Service
public class PointLotteryBiz {
    @Autowired
    private PointLotteryDao dao;

    /**
     * 定时修改过期的刮奖记录
     */
    public void updateLottery() {
        try {
            List<PointLotteryInfo> list = dao.searchLotteryExpire();
            for (PointLotteryInfo pointLotteryInfo : list) {
                pointLotteryInfo.setLottery("3");//抽奖过期
                dao.update(pointLotteryInfo);
            }
            list = dao.searchBuyExpire();
            for (PointLotteryInfo pointLotteryInfo : list) {
                pointLotteryInfo.setBuy("3");//购买过期
                dao.update(pointLotteryInfo);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}