package com.fjhx.sale.controller.dept;

import com.alibaba.fastjson2.JSONObject;
import com.fjhx.sale.entity.dept.dto.DeptPerfDto;
import com.fjhx.sale.entity.dept.dto.DeptPerfSelectDto;
import com.fjhx.sale.entity.dept.vo.DeptPerfVo;
import com.fjhx.sale.service.dept.DeptPerfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 部门绩效 前端控制器
 * </p>
 *
 * @author
 * @since 2024-01-21
 */
@RestController
@RequestMapping("/deptPerf")
public class DeptPerfController {

    @Autowired
    private DeptPerfService deptPerfService;

    /**
     * 部门绩效列表
     */
    @PostMapping("/list")
    public List<DeptPerfVo> list(@RequestBody DeptPerfDto dto) {
        return deptPerfService.getList(dto);
    }

    /**
     * 部门绩效编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody DeptPerfDto deptPerfDto) {
        deptPerfService.edit(deptPerfDto);
    }


    /**
     * 月报表
     *
     * @return
     */
    @PostMapping("/monthlyReporting")
    public List<JSONObject> monthlyReporting(@RequestBody DeptPerfSelectDto dto) {
        return deptPerfService.monthlyReporting(dto);
    }

}
