package com.qunzhixinxi.hnqz.admin.entity.input;

import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;

/**
 * @Version: 2021.4.16
 * @Author: ryz
 * @Date: 2021/4/22
 */
@Data
public class SettleAmountMonitorInput {

	/**
	 * 身份证号
	 */
	private List<String> idCard;

	private List<Integer> ids;

	private List<String> userIds;

	private LocalDate startTime;

	private LocalDate endTime;

	private String subType;

	public static SettleAmountMonitorInput fromIdCard(List<String> idCard, List<Integer> ids, String subType) {
		SettleAmountMonitorInput input = new SettleAmountMonitorInput();

		input.idCard = idCard;
		input.ids = ids;

		LocalDate now = LocalDate.now();
		input.startTime = now.withDayOfMonth(1);
		input.endTime = now.plusMonths(1L).withDayOfMonth(1);
		input.subType = subType;

		return input;
	}

	public static SettleAmountMonitorInput fromUserId(List<String> userIds, List<Integer> ids, String subType) {
		SettleAmountMonitorInput input = new SettleAmountMonitorInput();

		input.userIds = userIds;
		input.ids = ids;

		LocalDate now = LocalDate.now();
		input.startTime = now.withDayOfMonth(1);
		input.endTime = now.plusMonths(1L).withDayOfMonth(1);
		input.subType = subType;

		return input;
	}
}
