package com.hzs.bonus.detail.provider;

import com.hzs.bonus.detail.ICuRegionAssessApi;
import com.hzs.bonus.detail.service.ICuRegionAssessService;
import com.hzs.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

/**
 * @Description: 新零售会员dubbo服务
 * @Author: jiang chao
 * @Time: 2024/12/31 13:40
 * @Classname: MemberRetailProvider
 * @PackageName: com.hzs.retail.member.provider
 */
@Slf4j
@DubboService
public class CuRegionAssessProvider implements ICuRegionAssessApi {

    @Autowired
    private ICuRegionAssessService iCuRegionAssessService;


    /**
     * @description: 定时处理会员收益区域（处理前三天）
     * @author: zhang jing
     * @date: 2025/3/7 10:45
     * @param: [startDate]
     * @return: com.hzs.common.core.domain.R<?>
     **/
    @Override
    public R<?> validateHandAreaAssess(Date startDate,Date endDate) {
        try {
            iCuRegionAssessService.validateHandAreaAssess(startDate,endDate);
            return R.ok();
        } catch (Exception e) {
            log.error("定时任务处理前3天收益区域异常", e);
            return R.fail(e.getMessage());
        }
    }


}
