package com.staffing.web.controller.employee;

import com.staffing.common.core.controller.BaseController;
import com.staffing.common.core.domain.AjaxResult;
import com.staffing.common.core.page.TableDataInfo;
import com.staffing.custom.domain.StEmployeeFundRecord;
import com.staffing.custom.domain.StTaskSign;
import com.staffing.custom.service.IStEmployeeFundRecordService;
import com.staffing.custom.service.IStTaskService;
import com.staffing.custom.service.IStTaskSignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 任务Controller
 * 
 * @author staffing
 * @date 2024-08-27
 */
@RestController
@RequestMapping("/employee/fund")
public class EmployeeFundController extends BaseController
{
    @Autowired
    private IStTaskService stTaskService;
    @Autowired
    private IStTaskSignService stTaskSignService;

    @Autowired
    private IStEmployeeFundRecordService stEmployeeFundRecordService;

    @GetMapping("/list")
    public TableDataInfo list(StEmployeeFundRecord stEmployeeFundRecord)
    {
        startPage();
        List<StEmployeeFundRecord> list = stEmployeeFundRecordService.selectStEmployeeFundRecordList(stEmployeeFundRecord);
        return getDataTable(list);
    }

    /**
     * 获取任务详细信息
     */
    @GetMapping(value = "/details/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(stTaskService.selectStTaskById(id));
    }

    /**
     * 修改签到
     */
    @PutMapping("/editSign")
    public AjaxResult edit(@RequestBody StTaskSign stTaskSign)
    {
        return toAjax(stTaskSignService.updateStTaskSign(stTaskSign));
    }


}
