#
Junjie
2024-03-26 4c622f3fb68660f69ccf1894afcfff72cf866be5
zy-asrs-openapi/src/main/java/com/zy/asrs/openapi/controller/ApiController.java
@@ -38,6 +38,11 @@
    @Autowired
    private ApiService apiService;
    @PostMapping("/test")
    public R test() {
        return R.ok();
    }
    /**
     * 生成入库订单
     */
@@ -55,8 +60,8 @@
        if (Cools.isEmpty(param.getOrderType())) {
            return R.error("单据类型[orderType]不能为空");
        }
        if (Cools.isEmpty(param.getOrderDetails())) {
            return R.error("单据明细[orderDetails]不能为空");
        if (Cools.isEmpty(param.getMats())) {
            return R.error("物料[mats]不能为空");
        }
        param.setHostId(hostKey.getHostId());
        apiService.generateOrderPakIn(param);
@@ -80,8 +85,8 @@
        if (Cools.isEmpty(param.getOrderType())) {
            return R.error("单据类型[orderType]不能为空");
        }
        if (Cools.isEmpty(param.getOrderDetails())) {
            return R.error("单据明细[orderDetails]不能为空");
        if (Cools.isEmpty(param.getMats())) {
            return R.error("物料[mats]不能为空");
        }
        param.setHostId(hostKey.getHostId());
        apiService.generateOrderPakOut(param);
@@ -124,9 +129,10 @@
     */
    @PostMapping("/createMat")
    public synchronized R createMat(@RequestHeader(required = true) String appkey,
                                    @RequestBody(required = false) List<CreateMatParam> mats) {
        HostKey hostKey = auth(appkey, mats, true);
        int result = apiService.createMat(mats, hostKey.getHostId());
                                    @RequestBody(required = false) CreateMatParam param) {
        HostKey hostKey = auth(appkey, param, true);
        param.setHostId(hostKey.getHostId());
        int result = apiService.createMat(param);
        return R.ok().add(result);
    }
@@ -161,4 +167,10 @@
        return hostKey;
    }
    @PostMapping("order/execute/auth/v1")
    public R wms1(@RequestBody Map<String, Object> map) {
        log.info("order/execute/auth/v1:" + JSON.toJSONString(map));
        return R.ok();
    }
}