package com.hzs.bonus.detail.controller.api;

import cn.hutool.core.bean.BeanUtil;
import com.hzs.bonus.detail.service.ICuRegionAssessService;
import com.hzs.bonus.detail.vo.CuRegionAssessDetailVO;
import com.hzs.bonus.detail.vo.CuRegionAssessVO;
import com.hzs.bonus.param.CuRegionAssessParam;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.member.detail.CuRegionAssessDetail;
import com.hzs.common.domain.member.detail.ext.CuRegionAssessExt;
import com.hzs.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: 考核会员端
 * @author: sui q
 * @time: 2025/1/16 11:12
 * @classname: ApiCuRegionAssessController
 * @package_name: com.hzs.bonus.detail.controller.api
 * version 1.0.0
 */
@RestController
@RequestMapping("/api/region")
public class ApiCuRegionAssessController extends BaseController {

    @Autowired
    private ICuRegionAssessService regionAssessService;

    /**
     * 查询会员昨天奖金的值
     */
    @GetMapping("/query")
    public TableDataInfo listRegionAssess(){
        CuRegionAssessParam cuRegionAssessParam = new CuRegionAssessParam();
        cuRegionAssessParam.setPkCountry(SecurityUtils.getPkCountry());
        cuRegionAssessParam.setPkMember(SecurityUtils.getUserId());
        List<CuRegionAssessExt> cuRegionAssessExtList = regionAssessService.queryRegionAssessByCondition(cuRegionAssessParam);
        return getDataTable(regionAssessService.getCuRegionAssessVoS(cuRegionAssessExtList));
    }
}
