package com.ruoyi.web.controller.ie;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.ie.domain.AEnrollScore;
import com.ruoyi.ie.service.IAEnrollScoreService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 院校考生考核成绩部分Controller
 * 
 * @author voluntary
 * @date 2023-11-26
 */
@RestController
@RequestMapping("/ie/aEnrollScore")
public class AEnrollScoreController extends BaseController
{
    @Autowired
    private IAEnrollScoreService aEnrollScoreService;

    /**
     * 查询院校考生考核成绩部分列表
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollScore:list')")
    @GetMapping("/list")
    public TableDataInfo list(AEnrollScore aEnrollScore)
    {
        startPage();
        List<AEnrollScore> list = aEnrollScoreService.selectAEnrollScoreList(aEnrollScore);
        return getDataTable(list);
    }

    /**
     * 导出院校考生考核成绩部分列表
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollScore:export')")
    @Log(title = "院校考生考核成绩部分", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, AEnrollScore aEnrollScore)
    {
        List<AEnrollScore> list = aEnrollScoreService.selectAEnrollScoreList(aEnrollScore);
        ExcelUtil<AEnrollScore> util = new ExcelUtil<AEnrollScore>(AEnrollScore.class);
        util.exportExcel(response, list, "院校考生考核成绩部分数据");
    }

    /**
     * 获取院校考生考核成绩部分详细信息
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollScore:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(aEnrollScoreService.selectAEnrollScoreById(id));
    }

    /**
     * 新增院校考生考核成绩部分
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollScore:add')")
    @Log(title = "院校考生考核成绩部分", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AEnrollScore aEnrollScore)
    {
        return toAjax(aEnrollScoreService.insertAEnrollScore(aEnrollScore));
    }

    /**
     * 修改院校考生考核成绩部分
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollScore:edit')")
    @Log(title = "院校考生考核成绩部分", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AEnrollScore aEnrollScore)
    {
        return toAjax(aEnrollScoreService.updateAEnrollScore(aEnrollScore));
    }

    /**
     * 删除院校考生考核成绩部分
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollScore:remove')")
    @Log(title = "院校考生考核成绩部分", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(aEnrollScoreService.deleteAEnrollScoreByIds(ids));
    }
}
