自动化立体仓库 - WCS系统
#
zjj
2023-12-08 d04ce586afce3b78f238289dad10dacd4c22206a
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -235,7 +235,7 @@
        auth(appkey, params, request);
        List<WMSAndAGVInterfaceParam> params1 =new ArrayList<>();
        for (WMSAndAGVInterfaceParam param:params){
            try {
                if (Cools.isEmpty(param)){
                    return R.error("参数为空!");
                } else if (Cools.isEmpty(param.getTaskNo())){
@@ -254,29 +254,35 @@
                if (Cools.isEmpty(param.getEmptyContainer())){
                    return R.error("是否空托盘信号为空!");
                }
//        if (Cools.isEmpty(param.getTaskTunnel())){
//            return R.error("任务巷道为空!");
//        }
//        if (Cools.isEmpty(param.getGroupNo())){
//            return R.error("任务组为空!");
//        }
//        if (Cools.isEmpty(param.getTaskSerialNo())){
//            return R.error("任务执行顺序为空!");
//        }
                if (Cools.isEmpty(param.getTargetWharf())){
                    return R.error("目标码头区域为空!");//G开头=7车间,H开头=8层,J开头=9车间
                }
                StaDesc staDesc = new StaDesc();
                if (param.getTaskType().equals("CK") && param.getTargetWharf().contains("J")){
                    staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>()
                            .eq("crn_no", param.getTaskTunnel()).eq("type_no",2).lt("crn_stn", 200));
                }else {
                    staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>()
                            .eq("crn_no", param.getTaskTunnel()).eq("type_no",2).ge("crn_stn", 200));
                }
                param.setTargetLocationCode(staDesc.getStnNo().toString());
                openService.taskCreate(new taskCreateParam(param));
                params1.add(param);
//                return R.ok(param);
            }catch (Exception e){
                String errorMsg = Cools.isEmpty(e.getLocalizedMessage()) ? "" : e.getLocalizedMessage();
                return R.error("生成任务失败,请联系管理员!"+ errorMsg);
            }
                R r = openService.taskCreate(new taskCreateParam(param));
                apiLogService.save("Wms任务下发接口"
                        ,request.getRemoteAddr()+request.getRequestURI()
                        ,appkey
                        ,request.getRemoteAddr()
                        ,JSON.toJSONString(param)
                        ,r.toString()
                        ,true
                );
                return r;
        }
        return R.ok(params1);
        return null;
    }
    //任务取消接口