package com.hxhq.business.controller;

import com.hxhq.business.dto.mjy.FfjlListDto;
import com.hxhq.business.dto.mjy.ListDto;
import com.hxhq.business.form.mjy.ArchiveForm;
import com.hxhq.business.form.mjy.FfjlSearchForm;
import com.hxhq.business.form.mjy.SearchForm;
import com.hxhq.business.service.IMjyFfjlService;
import com.hxhq.common.core.web.controller.BaseController;
import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo;
import com.hxhq.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;


/**
 * 麻精药发放记录档案Controller
 *
 * @author hxhq
 * @date 2025-12-18
 */
@RestController
@RequestMapping("/business/mjyFfjlArchive")
public class MjyFfjlArchiveController extends BaseController
{
    @Autowired
    private IMjyFfjlService mjyFfjlService;


    /**
     * 列表
     */
    @RequiresPermissions("business:archive:mjyFfjl:list")
    @GetMapping("/list")
    public TableDataInfo list(FfjlSearchForm form)
    {
        startPage();
        List<FfjlListDto> list = mjyFfjlService.queryArchiveList(form);
        return getDataTable(list);
    }

    /**
     * 同意归档
     */
    @PostMapping("/tygd")
    @RequiresPermissions("business:archive:mjyFfjl:tygd")
    public AjaxResult tygd(@RequestBody ArchiveForm form)
    {
        mjyFfjlService.tygd(form);
        return AjaxResult.success("操作成功");
    }


    /**
     * 拒绝归档
     */
    @PostMapping("/jjgd")
    @RequiresPermissions("business:archive:mjyFfjl:jjgd")
    public AjaxResult jjgd(@RequestBody ArchiveForm form)
    {
        mjyFfjlService.jjgd(form);
        return AjaxResult.success("操作成功");
    }

    /**
     * 同意解档
     */
    @PostMapping("/tyjd")
    @RequiresPermissions("business:archive:mjyFfjl:tyjd")
    public AjaxResult tyjd(@RequestBody ArchiveForm form)
    {
        mjyFfjlService.tyjd(form);
        return AjaxResult.success("操作成功");
    }


    /**
     * 拒绝解档
     */
    @PostMapping("/jjjd")
    @RequiresPermissions("business:archive:mjyFfjl:jjjd")
    public AjaxResult jjjd(@RequestBody ArchiveForm form)
    {
        mjyFfjlService.jjjd(form);
        return AjaxResult.success("操作成功");
    }

    /**
     * 同意借阅
     */
    @PostMapping("/tyjy")
    @RequiresPermissions("business:archive:mjyFfjl:tyjy")
    public AjaxResult tyjy(@RequestBody ArchiveForm form)
    {
        mjyFfjlService.tyjy(form);
        return AjaxResult.success("操作成功");
    }


    /**
     * 拒绝借阅
     */
    @PostMapping("/jjjy")
    @RequiresPermissions("business:archive:mjyFfjl:jjjy")
    public AjaxResult jjjy(@RequestBody ArchiveForm form)
    {
        mjyFfjlService.jjjy(form);
        return AjaxResult.success("操作成功");
    }


    /**
     * 确认归还
     */
    @PostMapping("/qrgh")
    @RequiresPermissions("business:archive:mjyFfjl:qrgh")
    public AjaxResult qrgh(@RequestBody ArchiveForm form)
    {
        mjyFfjlService.qrgh(form);
        return AjaxResult.success("操作成功");
    }

}
