skyouc
2026-01-05 af5e14557af94409a0d2e3f2dca1eed1b99a895a
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -799,7 +799,8 @@
                        // 第一步:如果下一个方向正好是作业方向的相反方向,则重置下一个方向为作业方向,标记 reverse = true
                        boolean reverse = false;
                        if (nextDirection.equals((workDirection + 180) % 360)) {
                            if ((isStation && turnCodes.contains(lastCode.getData())) || (isLoc && locTurnCodes.contains(lastCode.getData()))) {
                            if ((turnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000050")) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
                            // if ((isStation && turnCodes.contains(lastCode.getData())) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
                                reverse = false;
                                lastDirection = nextDirection;
                            } else {
@@ -826,7 +827,8 @@
                                    nextDirection = lastDirection;
                                    reverse = true;
                                } else {
                                    if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && lastCode.getData().equals("00000080"))) {
                                    if ((turnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000050")) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
                                    // if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
                                        // turn
                                        reverse = false;
                                        actionList.add(new Action(
@@ -852,8 +854,9 @@
                                                180);
                                    } else {
                                        Double turnDirection = nextDirection;
                                        if (turnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000050")) {
                                        if ((turnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000050")) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
                                            turnDirection = 180.0;
                                            reverse = false;
                                        }
                                        // turn
                                        actionList.add(new Action(
@@ -876,13 +879,14 @@
                                                lastCode.getData(),
                                                lastCode.getCornerBool(),
                                                nextDirection,
                                                nextDirection);
                                                lastDirection);
                                    }
                                    lastDirection = nextDirection;
                                }
                            } else {
                                // if (isStation && lastCode.getData().equals("00000050")) {
                                if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && lastCode.getData().equals("00000080"))) {
                                if ((turnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000050")) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
                                // if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && lastCode.getData().equals("00000080"))) {
                                    // turn
                                    reverse = false;
                                    actionList.add(new Action(
@@ -901,7 +905,6 @@
                                            now    // 工作时间
                                    ));
                                    reverse = false;
                                    log.info("3TurnCorner posType={}, code={}, corner={}, nextDirection={}, finalAngle={}",
                                            posType,
                                            lastCode.getData(),
@@ -971,8 +974,11 @@
                if (first) {
                    if (Cools.isEmpty(actionList) || !actionList.get(0).getActionType().equals(ActionTypeType.TurnCorner.val())) {
                        Double turnDirection = workDirection;
                        Code nextCode = codeService.getCacheByData(lastCode.getData());
//                        Double nextDirection = mapService.calculateDirection(lastCode, nextCode, angleOffsetVal);
                        // if (isStation && turnCodes.contains(lastCode.getData())) {
                        if ((isStation && turnCodes.contains(lastCode.getData())) || (isLoc && locTurnCodes.contains(lastCode.getData()))) {
                        if ((turnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000050")) || (isLoc && locTurnCodes.contains(nextCode.getData()) && lastCode.getData().equals("00000080"))) {
                        // if ((isStation && turnCodes.contains(lastCode.getData())) || (isLoc && locTurnCodes.contains(lastCode.getData()))) {
                            turnDirection = workDirection + 180.0;
                        }
                        if (lastCode.getCornerBool()) {