package com.fjhx.purchase.controller.arrival;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.fjhx.common.constant.SourceConstant;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.purchase.entity.arrival.vo.ArrivalDetailVo;
import com.fjhx.purchase.entity.arrival.dto.ArrivalDetailSelectDto;
import com.fjhx.purchase.entity.arrival.dto.ArrivalDetailDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.purchase.service.arrival.ArrivalDetailService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * <p>
 * 到货明细单 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-07
 */
@DS(SourceConstant.PURCHASE)
@RestController
@RequestMapping("/arrivalDetail")
public class ArrivalDetailController {

    @Autowired
    private ArrivalDetailService arrivalDetailService;

    /**
     * 到货明细单分页
     */
    @PostMapping("/page")
    public Page<ArrivalDetailVo> page(@RequestBody ArrivalDetailSelectDto dto) {
        return arrivalDetailService.getPage(dto);
    }

    /**
     * 到货明细单明细
     */
    @PostMapping("/detail")
    public List<ArrivalDetailVo> detail(@RequestBody ArrivalDetailSelectDto dto) {
        return arrivalDetailService.detail(dto.getIds());
    }
}
