云
4 天以前 f02d0df2f1dfc7a8b775cf50d45375e57628a5ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package cn.iocoder.yudao.module.mes.controller.admin.qc.ncr;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mes.dal.dataobject.qc.ncr.MesQcPurchaseReturnDO;
import cn.iocoder.yudao.module.mes.service.qc.ncr.MesQcPurchaseReturnService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - 来料不合格采购退货")
@RestController
@RequestMapping("/mes/qc-purchase-return")
public class MesQcPurchaseReturnController {
    @Resource private MesQcPurchaseReturnService service;
 
    @GetMapping("/get-by-ncr")
    @Operation(summary = "按不合格单查看采购退货单")
    @PreAuthorize("@ss.hasPermission('mes:qc-ncr:query') or @ss.hasPermission('mes:wm-return-vendor:finish')")
    public CommonResult<MesQcPurchaseReturnDO> getByNcr(@RequestParam Long ncrId) {
        return success(service.getByNcrId(ncrId));
    }
 
    @GetMapping("/page")
    @Operation(summary = "采购仓库查询待退和已退单据")
    @PreAuthorize("@ss.hasPermission('mes:wm-return-vendor:finish')")
    public CommonResult<PageResult<MesQcPurchaseReturnDO>> page(PageParam page, @RequestParam(required = false) Integer status) {
        return success(service.getPage(page, status));
    }
 
    @PutMapping("/confirm")
    @Operation(summary = "采购仓库确认已退回供应商")
    @PreAuthorize("@ss.hasPermission('mes:wm-return-vendor:finish')")
    public CommonResult<Boolean> confirm(@RequestParam Long id, @RequestParam(required = false) String remark) {
        service.confirm(id, remark);
        return success(true);
    }
}