package com.fjhx.mes.controller.production;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.mes.entity.production.vo.ProductionReportingDetailVo;
import com.fjhx.mes.entity.production.dto.ProductionReportingDetailSelectDto;
import com.fjhx.mes.entity.production.dto.ProductionReportingDetailDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.mes.service.production.ProductionReportingDetailService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 生产报工明细 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-03-30
 */
@RestController
@RequestMapping("/productionReportingDetail")
public class ProductionReportingDetailController {

    @Autowired
    private ProductionReportingDetailService productionReportingDetailService;

    /**
     * 生产报工明细分页
     */
    @PostMapping("/page")
    public Page<ProductionReportingDetailVo> page(@RequestBody ProductionReportingDetailSelectDto dto) {
        return productionReportingDetailService.getPage(dto);
    }

    /**
     * 生产报工明细明细
     */
    @PostMapping("/detail")
    public ProductionReportingDetailVo detail(@RequestBody BaseSelectDto dto) {
        return productionReportingDetailService.detail(dto.getId());
    }

    /**
     * 生产报工明细新增
     */
    @PostMapping("/add")
    public void add(@RequestBody ProductionReportingDetailDto productionReportingDetailDto) {
        productionReportingDetailService.add(productionReportingDetailDto);
    }

    /**
     * 生产报工明细编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody ProductionReportingDetailDto productionReportingDetailDto) {
        productionReportingDetailService.edit(productionReportingDetailDto);
    }

    /**
     * 生产报工明细删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        productionReportingDetailService.delete(dto.getId());
    }

}
