package com.hzy.framework.web.service;

import com.hzy.common.enums.EDelFlag;
import com.hzy.common.utils.DateUtils;
import com.hzy.project.business.customer.domain.Customer;
import com.hzy.project.business.customer.service.ICustomerService;
import com.hzy.project.system.user.domain.User;
import com.hzy.project.system.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * RuoYi首创 html调用 thymeleaf 实现字典读取
 * 
 * @author ruoyi
 */
@Service("common")
public class CommonService
{

    @Autowired
    private ICustomerService customerService;

    /**
     * 查询用户数据信息
     * 
     * @return 参数键值
     */
    public List<String> getDurationList() throws ParseException {

        List<String> list = new ArrayList<>();

        Date start = DateUtils.parseDate("2025-10-01",DateUtils.YYYY_MM_DD);
        Date end = DateUtils.getNowDate();

        for (Date curr = start; curr.before(end); curr = DateUtils.addMonths(curr, 1)) {
            list.add(DateUtils.parseDateToStr("yyyyMM", curr));
        }

        return list;
    }

    public List<Customer> getCustomerList()
    {
        Customer cond = new Customer();
        cond.setDelFlag(EDelFlag.NO.getVal());
        return customerService.selectCustomerList(cond);
    }
}
