#
Junjie
昨天 253e9b3735533c4d8c69cf5e6983d5fa1e984ae9
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -63,22 +63,6 @@
            return R.error("参数不能为空");
        }
        boolean dispatchShuttle = shuttleDispatchUtils.dispatchShuttle(null, param.getLocNo(), param.getShuttleNo());
        apiLogService.insert(new ApiLog(
                null
                , "小车移动任务"
                , "/createMoveTask"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , null
                , null
                , dispatchShuttle ? 1 : 0
                , 1
                , new Date()
                , null
                , null
        ));
        if (dispatchShuttle) {
            return R.ok();
        }
@@ -93,22 +77,6 @@
            return R.error("参数不能为空");
        }
        boolean result = commonService.createLocMoveTask(param);
        apiLogService.insert(new ApiLog(
                null
                , "移库任务"
                , "/createLocMoveTask"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , null
                , null
                , result ? 1 : 0
                , 1
                , new Date()
                , null
                , null
        ));
        if (result) {
            return R.ok();
        }
@@ -118,27 +86,11 @@
    //入库任务
    @PostMapping("/createInTask")
    @OpenApiLog(memo = "入库任务")
    public R createInTask(@RequestBody CreateInTaskParam param) {
    public synchronized R createInTask(@RequestBody CreateInTaskParam param) {
        if (param == null) {
            return R.error("参数不能为空");
        }
        boolean result = commonService.createInTask(param);
        apiLogService.insert(new ApiLog(
                null
                , "入库任务"
                , "/createInTask"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , null
                , null
                , result ? 1 : 0
                , 1
                , new Date()
                , null
                , null
        ));
        if (result) {
            return R.ok();
        }
@@ -148,27 +100,11 @@
    //出库任务
    @PostMapping("/createOutTask")
    @OpenApiLog(memo = "出库任务")
    public R createOutTask(@RequestBody CreateOutTaskParam param) {
    public synchronized R createOutTask(@RequestBody CreateOutTaskParam param) {
        if (param == null) {
            return R.error("参数不能为空");
        }
        boolean result = commonService.createOutTask(param);
        apiLogService.insert(new ApiLog(
                null
                , "出库任务"
                , "/createOutTask"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , null
                , null
                , result ? 1 : 0
                , 1
                , new Date()
                , null
                , null
        ));
        if (result) {
            return R.ok();
        }
@@ -182,22 +118,6 @@
            return R.error("参数不能为空");
        }
        boolean completeTask = commonService.completeTask(param);
        apiLogService.insert(new ApiLog(
                null
                , "任务完成"
                , "/completeTask"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , null
                , null
                , completeTask ? 1 : 0
                , 1
                , new Date()
                , null
                , null
        ));
        if (completeTask) {
            return R.ok();
        }
@@ -211,22 +131,6 @@
            return R.error("参数不能为空");
        }
        boolean completeTask = commonService.cancelTask(param);
        apiLogService.insert(new ApiLog(
                null
                , "任务取消"
                , "/cancelTask"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , null
                , null
                , completeTask ? 1 : 0
                , 1
                , new Date()
                , null
                , null
        ));
        if (completeTask) {
            return R.ok();
        }
@@ -292,28 +196,10 @@
        map.put("forkLift", forkLiftProtocols);
        map.put("lift", liftProtocols);
        apiLogService.insert(new ApiLog(
                null
                , "获取设备状态"
                , "/deviceStatus"
                , null
                , null
                , null
                , null
                , JSON.toJSONString(map)
                , null
                , null
                , 1
                , new Date()
                , null
                , null
        ));
        return R.ok().add(map);
    }
    @RequestMapping("/liftDeviceOriginData")
//    @OpenApiLog(memo = "获取提升机原始数据")
    public R getLiftDeviceOriginData() {
        HashMap<Integer, String> map = new HashMap<>();
@@ -328,23 +214,6 @@
            map.put(device.getDeviceNo(), liftThread.getRealtimeOriginData());
        }
        apiLogService.insert(new ApiLog(
                null
                , "获取提升机原始数据"
                , "/liftDeviceOriginData"
                , null
                , null
                , null
                , null
                , JSON.toJSONString(map)
                , null
                , null
                , 1
                , new Date()
                , null
                , null
        ));
        return R.ok().add(map);
    }
@@ -363,23 +232,6 @@
        HashMap<String, Object> map = new HashMap<>();
        map.put("locNo", locMast.getLocNo());
        map.put("locSts", locMast.getLocSts());
        apiLogService.insert(new ApiLog(
                null
                , "获取指定库位信息"
                , "/getLocInformation"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , JSON.toJSONString(map)
                , null
                , null
                , 1
                , new Date()
                , null
                , null
        ));
        return R.ok().add(map);
    }
@@ -400,23 +252,6 @@
            list.add(map);
        }
        apiLogService.insert(new ApiLog(
                null
                , "获取全部库位信息"
                , "/getAllLocInformation"
                , null
                , null
                , null
                , null
                , JSON.toJSONString(list)
                , null
                , null
                , 1
                , new Date()
                , null
                , null
        ));
        return R.ok().add(list);
    }
@@ -424,24 +259,6 @@
    @OpenApiLog(memo = "小车集合")
    public R shuttleGather(@RequestBody ShuttleGatherParam param) {
        List<ShuttleGatherResult> shuttleGather = shuttleDispatchUtils.shuttleGather(param);
        apiLogService.insert(new ApiLog(
                null
                , "小车集合"
                , "/shuttleGather"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , JSON.toJSONString(shuttleGather)
                , null
                , null
                , 1
                , new Date()
                , null
                , null
        ));
        return R.ok().add(shuttleGather);
    }
@@ -449,24 +266,6 @@
    @OpenApiLog(memo = "小车演示")
    public R shuttleDemo(@RequestBody ShuttleDemoParam param) {
        shuttleDispatchUtils.shuttleDemo(param);
        apiLogService.insert(new ApiLog(
                null
                , "小车演示"
                , "/shuttleDemo"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , null
                , null
                , null
                , 1
                , new Date()
                , null
                , null
        ));
        return R.ok();
    }
@@ -486,26 +285,14 @@
            wrapper.eq("io_type", ioType.id);
        }
        List<WrkMast> wrkMasts = wrkMastService.selectList(wrapper);
        apiLogService.insert(new ApiLog(
                null
                , "查询任务"
                , "/queryTask"
                , null
                , null
                , null
                , JSON.toJSONString(param)
                , JSON.toJSONString(wrkMasts)
                , null
                , null
                , 1
                , new Date()
                , null
                , null
        ));
        return R.ok().add(wrkMasts);
    }
    @GetMapping("/systemStatus")
    public R systemStatus() {
        return R.ok();
    }
    @GetMapping("/test")
    public R test() {
        notifyUtils.notify("task", 1, "9999", "W9999", NotifyMsgType.SHUTTLE_MOVING, "data");