From e1d1d6279ca95febb12f6ce476a54c5bfc30d93f Mon Sep 17 00:00:00 2001 From: vincentlu <t1341870251@gmail.com> Date: 星期二, 14 一月 2025 12:46:52 +0800 Subject: [PATCH] # --- zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java | 29 +++++++++++------------------ 1 files changed, 11 insertions(+), 18 deletions(-) diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java index ada07bc..b7968b4 100644 --- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java +++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java @@ -497,7 +497,6 @@ if (Cools.isEmpty(agvId, taskType)) { return false; } try { String agvNo = agvService.getAgvNo(agvId); - AgvDetail agvDetail = agvDetailService.selectByAgvId(agvId); if (!agvService.judgeEnable(agvId)) { return false; } @@ -510,6 +509,7 @@ } Date now = new Date(); + AgvDetail agvDetail = agvDetailService.selectMajorByAgvId(agvId); Code endCode = null; switch (taskType) { case TO_CHARGE: @@ -653,9 +653,9 @@ // JSONObject storeDirection = configService.getVal("storeDirection", JSONObject.class); int angleOffsetVal = configService.getVal("mapAngleOffsetVal", Integer.class); String agvNo = agvService.getAgvNo(agvId); - if (!agvService.judgeEnable(agvId)) { - throw new CoolException("AGV[" + agvNo + "]褰撳墠涓嶅彲鐢�..."); - } +// if (!agvService.judgeEnable(agvId)) { +// throw new CoolException("AGV[" + agvNo + "]褰撳墠涓嶅彲鐢�..."); +// } AgvModel agvModel = agvModelService.getByAgvId(agvId); Double workDirection = agvModel.getWorkDirection(); @@ -989,26 +989,19 @@ now // 宸ヤ綔鏃堕棿 )); -// List<Action> newActionList = new ArrayList<>(actionList); - -// List<Action> optimizeList = actionService.optimizeSort(actionList); - - List<Action> optimizeList = actionSorter.optimizeSort(actionList); - List<Action> newActionList = new ArrayList<>(optimizeList); - - + List<Action> newActionList = actionSorter.optimizeSort(actionList); String groupId = String.valueOf(snowflakeIdWorker.nextId()).substring(3); // save action int i = newActionList.size(); for (Action action : newActionList) { - action.setUuid(String.valueOf(snowflakeIdWorker.nextId()).substring(3)); +// action.setUuid(String.valueOf(snowflakeIdWorker.nextId()).substring(3)); action.setGroupId(groupId); action.setPriority(i); - if (!actionService.save(action)) { - throw new BusinessException(action.getName() + "鍔ㄤ綔淇濆瓨澶辫触"); - } i -= 1; + } + if (!actionService.saveBatch(newActionList)) { + throw new BusinessException("group[" + groupId + "] 鍔ㄤ綔淇濆瓨澶辫触"); } // update segment @@ -1077,8 +1070,8 @@ } } - Agv agv = agvService.getById(actionList.get(0).getAgvId()); - AgvAction agvAction = new AgvAction(agv.getUuid(), actionGroupId); + String agvNo = agvService.getAgvNo(actionList.get(0).getAgvId()); + AgvAction agvAction = new AgvAction(agvNo, actionGroupId); for (Action action : actionList) { switch (Objects.requireNonNull(ActionTypeType.get(action.getActionTypeEl()))) { -- Gitblit v1.9.1