package cn.iocoder.yudao.module.mes.controller.admin.stockworkshop;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.mes.service.stockworkshop.MesStockOutService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PutMapping;
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 static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - ERP 其它出库单")
@RestController
@RequestMapping("/mes/stock-out")
@Validated
public class MesStockOutController {

    @Resource
    private MesStockOutService mesStockOutService;

    @PutMapping("/mes-update-status")
    @Operation(summary = "更新其它出库单的状态")
    //@PreAuthorize("@ss.hasPermission('erp:stock-out:update-status')")
    public CommonResult<Boolean> updateMesStockOutStatus(@RequestParam("id") Long id,
                                                         @RequestParam("status") Integer status) {
        mesStockOutService.updateMesStockOutStatus(id, status);
        return success(true);
    }
}