2026-07-09 d41fe2e95f3f64c6e3a7229acd9e74e673513a0a
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package cn.iocoder.yudao.module.mes.controller.admin.wms.approval;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wms.approval.WmsWarehouseApprovalConfigDO;
import cn.iocoder.yudao.module.mes.service.wms.approval.WmsApprovalService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
/**
 * 仓库审批配置 Controller
 */
@Tag(name = "管理后台 - 仓库审批配置")
@RestController
@RequestMapping("/mes/wms/approval")
@Validated
public class WmsApprovalController {
 
    @Resource
    private WmsApprovalService approvalService;
 
    @GetMapping("/config/get")
    @Operation(summary = "获取仓库审批配置")
    @Parameter(name = "warehouseId", description = "仓库ID", required = true)
    @Parameter(name = "bizType", description = "业务类型", required = true)
    @PreAuthorize("@ss.hasPermission('mes:wm-warehouse:query')")
    public CommonResult<WmsWarehouseApprovalConfigDO> getApprovalConfig(
            @RequestParam("warehouseId") Long warehouseId,
            @RequestParam("bizType") String bizType) {
        return success(approvalService.getApprovalConfig(warehouseId, bizType));
    }
 
    @GetMapping("/config/list")
    @Operation(summary = "获取仓库所有审批配置")
    @Parameter(name = "warehouseId", description = "仓库ID", required = true)
    @PreAuthorize("@ss.hasPermission('mes:wm-warehouse:query')")
    public CommonResult<List<WmsWarehouseApprovalConfigDO>> getApprovalConfigList(
            @RequestParam("warehouseId") Long warehouseId) {
        return success(approvalService.getApprovalConfigList(warehouseId));
    }
 
    @PostMapping("/config/save")
    @Operation(summary = "保存审批配置")
    @PreAuthorize("@ss.hasPermission('mes:wm-warehouse:update')")
    public CommonResult<Boolean> saveApprovalConfig(@Valid @RequestBody WmsWarehouseApprovalConfigDO config) {
        approvalService.saveApprovalConfig(config);
        return success(true);
    }
 
    @GetMapping("/process-list")
    @Operation(summary = "获取可用的审批流程列表")
    @Parameter(name = "warehouseId", description = "仓库ID", required = true)
    @Parameter(name = "bizType", description = "业务类型", required = true)
    @PreAuthorize("@ss.hasPermission('mes:wm-warehouse:query')")
    public CommonResult<List<BpmProcessDefinitionInfoDO>> getAvailableProcessList(
            @RequestParam("warehouseId") Long warehouseId,
            @RequestParam("bizType") String bizType) {
        return success(approvalService.getAvailableProcessList(warehouseId, bizType));
    }
 
}