package com.yiqi.quartz.task;

import com.yiqi.common.utils.DateUtils;
import com.yiqi.common.utils.StringUtils;
import com.yiqi.core.domain.dto.SettlementBillAddDTO;
import com.yiqi.core.service.ISettlementManageBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 定时任务调度测试
 *
 * @author ruoyi
 */
@Component("SettlementTask")
public class SettlementTask {
    @Autowired
    private ISettlementManageBillService settlementManageBillService;

    public void insertSettlementBill(){
        String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM, DateUtils.addMonths(DateUtils.getNowDate(), -1));
        String title = date+"账单";
        SettlementBillAddDTO settlementBillAddDTO = new SettlementBillAddDTO();
        settlementBillAddDTO.setMonth(date);
        settlementBillAddDTO.setTitle(title);
        settlementManageBillService.insertSettlementManageBill(settlementBillAddDTO);
    }
}
