自动化立体仓库 - WMS系统
zhou zhou
1 天以前 6df97fba67b0e0698a02673e65c6eca00879d5be
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
package com.zy.api.controller;
 
import com.alibaba.fastjson.JSON;
import com.core.common.R;
import com.zy.api.entity.OrderParams;
import com.zy.api.service.KopenApiService;
import com.zy.asrs.entity.Mat;
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.List;
import java.util.Map;
import java.util.Objects;
 
@RestController
@RequestMapping("/kopen")
public class KopenApiController {
 
    @Autowired
    private KopenApiService kopenApiService;
 
    /**
     * 上游下发派工单
     * 
     * @author Ryan
     * @date 2025/11/24 15:18
     * @param params
     * @return com.core.common.R
     */
    @ApiOperation("上架派工单")
    @PostMapping("/order/add")
    public R receiveOrders(@RequestBody OrderParams params) {
        if (Objects.isNull(params)) {
            return R.error("参数不能为空!!");
        }
        if (Objects.isNull(params.getType())) {
            return R.error("单据类型不能为空!");
        }
        return kopenApiService.receiveOrders(params);
    }
 
    /**
     * 上游下发零件数据变更
     * s
     * @author Ryan
     * @date 2025/11/24 15:19
     * @param params
     * @return com.core.common.R
     */
    @ApiOperation("零件信息数据更新")
    @PostMapping("/sync/mat")
    public R basMatUpdate(@RequestBody Map<String, String> params) {
        if (Objects.isNull(params.get("matnrs"))) {
            return R.error("参数不能为空!!");
        }
        if (params.get("matnrs").isEmpty()) {
            return R.error("变更零件明细不能为空!!");
        }
        List<Mat> mats = JSON.parseArray(params.get("matnrs"), Mat.class);
 
        return kopenApiService.basMatupdate(mats);
    }
 
 
 
}