package cn.iocoder.yudao.module.stockTransfer.controller.admin;


import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSti;
import cn.iocoder.yudao.module.stockTransfer.service.DlRepairStiService;
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStiReqVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * 调拨单子表(DlRepairSti)表控制层
 * @author 小李
 * @date 17:27 2024/9/13
**/
@RestController
@RequestMapping("/repair/sti")
public class DlRepairStiController{
    /**
     * 服务对象
     */
    @Resource
    private DlRepairStiService dlRepairStiService;

    /**
     * 调拨单子表 分页
     *
     * @author 小李
     * @date 14:48 2024/9/19
     * @param repairStiReqVO 查询对象
     * @param pageNo 页码
     * @param pageSize 条数
    **/
    @GetMapping("/page")
    @Operation(summary = "调拨单子表 分页")
    public CommonResult<?> getStiPage(DlRepairStiReqVO repairStiReqVO,
                                      @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo,
                                      @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){
        Page<DlRepairSti> page = new Page<>(pageNo, pageSize);
        return success(dlRepairStiService.getStiPage(repairStiReqVO, page));
    }

    /**
     * 调拨单子表 配件详情
     *
     * @author 小李
     * @date 18:33 2024/9/22
     * @param ids ids
    **/
    @GetMapping("/getWares")
    @Operation(summary = "调拨单子表 配件详情")
    public CommonResult<?> getStIsWares(@RequestParam("ids") List<String> ids){
        return success(dlRepairStiService.getStIsWares(ids));
    }
}

