package com.tax.file.service.async.apply;

import com.tax.file.constants.FileConstants;
import com.yxcheng.token.utils.DateUtils;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.util.Date;
import java.util.Map;

@Data
public class ApplyContext {

    public static String fixLackApply = "fixLackApply";
    public static String init = "init";
    public static String notFixLastMonth = "notFixLastMonth";


    public static Date getFixLackApplyStartDate(Map<String,String> context,Date preDateStart){
        if(StringUtils.isNotBlank(context.get(ApplyContext.fixLackApply))){
            preDateStart =  DateUtils.getPreFirstDay(preDateStart,0);
        }else{
            //往前补偿三天
            preDateStart =  DateUtils.getPreApplyDate(preDateStart,FileConstants.preApplyRange);
        }
        return preDateStart;
    }

}
