package net.lab1024.sa.admin.module.business.wms.receive.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import net.lab1024.sa.admin.module.business.wms.receive.form.BatchReceiveForm;
import net.lab1024.sa.admin.module.business.wms.receive.form.BatchReturnForm;
import net.lab1024.sa.admin.module.business.wms.receive.service.ReceiveService;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import net.lab1024.sa.base.module.support.operatelog.annotation.OperateLog;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Tag(name = "收货")

public class ReceiveController {

    @Resource
    private ReceiveService receiveService;

    @Operation(summary = "批量收货 @author 霍锦")
    @PostMapping("/receive/batchReceive")
    @SaCheckPermission("receive:batchReceive")
    @OperateLog
    public ResponseDTO<String> batchReceive(@RequestBody BatchReceiveForm batchReceiveForm) {
        return receiveService.batchReceive(batchReceiveForm);
    }

    @Operation(summary = "批量退货 @author 霍锦")
    @PostMapping("/receive/batchReturn")
    @SaCheckPermission("receive:batchReturn")
    @OperateLog
    public ResponseDTO<String> batchReturn(@RequestBody BatchReturnForm batchReturnForm) {
        return receiveService.batchReturn(batchReturnForm);
    }
}
