package com.fjhx.mes.controller.completion;

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.mes.entity.completion.vo.CompletionInfoVo;
import com.fjhx.mes.entity.completion.dto.CompletionInfoSelectDto;
import com.fjhx.mes.entity.completion.dto.CompletionInfoDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.mes.service.completion.CompletionInfoService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 完工入库 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-03-31
 */
//@DS(SourceConstant.MES)
@RestController
@RequestMapping("/completionInfo")
public class CompletionInfoController {

    @Autowired
    private CompletionInfoService completionInfoService;

    /**
     * 完工入库分页
     */
    @PostMapping("/page")
    public Page<CompletionInfoVo> page(@RequestBody CompletionInfoSelectDto dto) {
        return completionInfoService.getPage(dto);
    }

    /**
     * 完工入库明细
     */
    @PostMapping("/detail")
    public CompletionInfoVo detail(@RequestBody BaseSelectDto dto) {
        return completionInfoService.detail(dto.getId());
    }

    /**
     * 完工入库新增
     */
    @PostMapping("/add")
    public void add(@RequestBody CompletionInfoDto completionInfoDto) {
        completionInfoService.add(completionInfoDto);
    }

    /**
     * 完工入库编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody CompletionInfoDto completionInfoDto) {
        completionInfoService.edit(completionInfoDto);
    }

    /**
     * 完工入库删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        completionInfoService.delete(dto.getId());
    }

}
