chen.lin
17 小时以前 a38d4a8619b886e2544cdefe421f171765ad2229
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package com.vincent.rsf.server.api.controller.erp;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.api.controller.erp.params.InventoryQueryConditionParam;
import com.vincent.rsf.server.api.controller.erp.params.QueryOrderParam;
import com.vincent.rsf.server.api.service.ReceiveMsgService;
import com.vincent.rsf.server.common.annotation.OperationLog;
import com.vincent.rsf.server.common.domain.BaseParam;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.manager.entity.Loc;
import com.vincent.rsf.server.manager.service.*;
import com.vincent.rsf.server.system.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Map;
import java.util.Objects;
 
/**
 * @author Ryan
 * @version 1.0
 * @title ErpApiController
 * @description
 * @create 2025/3/4 13:19
 */
@RestController
@RequestMapping("/erp")
@Api(tags = "综合查询")
public class ErpQueryController extends BaseController {
 
    @Autowired
    private ReceiveMsgService receiveMsgService;
 
    @Autowired
    private MatnrGroupService matnrGroupService;
 
    /**
     * @author Ryan
     * @date 2025/8/19
     * @description: 物料分类列表查询
     * @version 1.0
     */
    @ApiOperation(value = "查询分类信息")
    @OperationLog("物料分类列表")
    @PostMapping("/query/matnr/group")
    public R syncMatGroup() {
        return R.ok().add(matnrGroupService.list());
    }
 
    /**
     * @author Ryan
     * @date 2025/8/19
     * @description: 查询单据及明细
     * @version 1.0
     */
    @ApiOperation(value = "查询单据状态及明细")
    @OperationLog("查询订单状态及明细")
    @PostMapping("/query/order")
    public R queryOrderStatus(@RequestBody QueryOrderParam queryParams) {
        if (Objects.isNull(queryParams)) {
            throw new CoolException("参数不能为空!!");
        }
       return receiveMsgService.queryOrderStatus(queryParams);
    }
 
 
    /**
     * @author Ryan
     * @date 2025/8/15
     * @description: 库位信息查询
     * @version 1.0
     */
    @PostMapping("/query/locs/detls")
    @ApiOperation(value = "库位信息查询")
    @OperationLog("库位明细列表")
    public R syncLocDetls(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<Loc, BaseParam> pageParam = new PageParam<>(baseParam, Loc.class);
        QueryWrapper<Loc> wrapper = pageParam.buildWrapper(true);
        return receiveMsgService.syncLocsDetl(pageParam, wrapper);
    }
 
    /**
     * @author Ryan
     * @date 2025/8/21
     * @description: 调拔单信息查询
     * @version 1.0
     */
    @PostMapping("/query/transfer")
    @ApiOperation("查询调拔单及明细")
    @OperationLog("调拔单及明细查询")
    public R queryTransfer(@RequestBody QueryOrderParam queryParams) {
        if (Objects.isNull(queryParams)) {
            throw new CoolException("参数不能为空!!");
        }
        return receiveMsgService.queryTransfer(queryParams);
    }
 
    /**
     * ERP库存查询明细(供open-api模块调用)
     * 对应open-api的 /inventory/details 接口
     * @param condition 查询条件
     * @return 库存明细列表
     */
    @PostMapping("/inventory/details")
    @ApiOperation(value = "ERP库存查询明细", hidden = true)
    @OperationLog("ERP库存查询明细")
    public R erpQueryInventoryDetails(@RequestBody InventoryQueryConditionParam condition) {
        // 参数验证
        if (condition == null) {
            return R.error("查询条件不能为空");
        }
        
        return receiveMsgService.erpQueryInventoryDetails(condition);
    }
 
    /**
     * ERP库存查询汇总(供open-api模块调用)
     * 对应open-api的 /inventory/summary 接口
     * @param condition 查询条件
     * @return 库存汇总列表
     */
    @PostMapping("/inventory/summary")
    @ApiOperation(value = "ERP库存查询汇总", hidden = true)
    @OperationLog("ERP库存查询汇总")
    public R erpQueryInventorySummary(@RequestBody InventoryQueryConditionParam condition) {
        // 参数验证
        if (condition == null) {
            return R.error("查询条件不能为空");
        }
        
        return receiveMsgService.erpQueryInventorySummary(condition);
    }
 
}