自动化立体仓库 - WMS系统
#
1
1 天以前 53f87c2ff10f7ab71d6b0340a5a4811089d7cd1e
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -403,6 +403,9 @@
        } catch (Exception e){
            return R.error("单据编号[order_id]以 "+sign_arm_sku+" 与 "+sign_arm_order+" 作为拆分标记拆分失败!!!");
        }
        if (param.getArm_no()>4){
            return R.ok().add(true);
        }
        boolean taskArmWorkOrderSign = openService.TaskArmWorkOrderSign(param);
        return R.ok().add(taskArmWorkOrderSign);
@@ -413,7 +416,7 @@
     * AGV上报接收
     */
    @PostMapping("/agv/task/v1/agvCallback")
    @AppAuth(memo = "AGV上报接收")
//    @AppAuth(memo = "AGV上报接收")
    public synchronized R TaskAgvReport(@RequestHeader(required = false) String appkey,
                                        @RequestBody TaskAgvReportParam param,
                                        HttpServletRequest request) {
@@ -439,8 +442,12 @@
            return R.error("WMS任务号[reqCode]不能为空");
        }
        String taskCode = param.getTaskCode();
        String[] split = taskCode.split("-");
        param.setTaskNo(Integer.parseInt(split[0]));
        if (taskCode == null || !taskCode.matches("^\\d+-.*$")) {
            throw new CoolException("taskCode 格式错误,需为 数字-xxx,例如 123-ABC");
        }
        param.setTaskNo(Integer.parseInt(taskCode.substring(0, taskCode.indexOf("-"))));
//        if (Cools.isEmpty(param.getTimestamp())) {
//            return R.error("RGV任务号[timestamp]不能为空");
//        }
@@ -451,4 +458,92 @@
        return R.error("任务号不存在");
    }
    /**
     * PDA创建AGV任务
     */
    @PostMapping("/agv/task/v1/createTask")
    @AppAuth(memo = "PDA创建AGV任务")
    public synchronized R TaskAgvCreate(@RequestHeader(required = false) String appkey,
                                        @RequestBody TaskAgvCreateParam param,
                                        HttpServletRequest request) {
        auth(appkey, param, request);
        if (Cools.isEmpty(param)) {
            return R.parse(BaseRes.PARAM);
        }
        boolean taskAgvCreate = openService.taskAgvCreate(param);
        if (taskAgvCreate){
            return R.ok();
        }
        return R.error("任务号不存在");
    }
    /**
     * PDA获取AGV库位
     */
    @PostMapping("/agv/loc/v1/getLocList")
    @AppAuth(memo = "PDA检索AGV库位")
    public synchronized R GetAgvLocList(@RequestHeader(required = false) String appkey,
                                        @RequestBody AgvLocListParam param,
                                        HttpServletRequest request) {
        auth(appkey, param, request);
        List<AgvLocListDetlParam> list = openService.getAgvLocList(param);
        if (!list.isEmpty()) {
            return R.ok(list);
        }
        return R.error("库位不存在或无明细");
    }
    /**
     * PDA绑定解绑
     */
    @PostMapping("/agv/bindCtnrAndBin/v1")
    @AppAuth(memo = "PDA绑定与解绑")
    public synchronized R bindCtnrAndBin(@RequestHeader(required = false) String appkey,
                                        @RequestBody bindCtnrAndBinParam param,
                                        HttpServletRequest request) {
        auth(appkey, param, request);
        if (Cools.isEmpty(param)) {
            return R.parse(BaseRes.PARAM);
        }
        boolean bindCtnrAndBin = openService.bindCtnrAndBin(param);
        if (bindCtnrAndBin) {
            return R.ok();
        }
        return R.error("库位不存在或无明细");
    }
    /**
     * AGV申请过光栅
     */
    @PostMapping("/agv/arm/grating/v1/agvCallback")
    @AppAuth(memo = "AGV申请过光栅")
    public synchronized R agvGrating(@RequestHeader(required = false) String appkey,
                                         @RequestBody AgvGoTheArnParam param,
                                         HttpServletRequest request) {
//        auth(appkey, param, request);
        if (Cools.isEmpty(param)) {
            return R.parse(BaseRes.PARAM);
        }
        if (Cools.isEmpty(param.getCurrentPositionCode())) {
            return R.error("位置[currentPositionCode]不能为空");
        }
        boolean bindCtnrAndBin = true;
        List<ArmAgvGratingParam> armList = param.getArmNo();
        if (armList.isEmpty()){
            return R.error("库位不存在或无明细");
        }
        for (ArmAgvGratingParam arm : armList){
            if (bindCtnrAndBin){
                bindCtnrAndBin = openService.agvApplicationPassedTheGrating(arm);
//                System.out.println("请求通过光栅"+armNo);
            }
        }
        if (bindCtnrAndBin) {
            return new R(0,"成功");
        }
        return R.error("库位不存在或无明细");
    }
}