#
vincentlu
2025-12-26 4d45de01e35f8b271e5ba25439b574a8b67bc5eb
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -96,6 +96,8 @@
    private LaneService laneService;
    @Autowired
    private ActionSorter actionSorter;
    @Autowired
    private StaReserveService staReserveService;
    @SuppressWarnings("all")
    @Transactional
@@ -175,15 +177,19 @@
                        throw new BusinessException("oriLoc:" + task.getOriLoc$() + " failed to update");
                    }
                    // reserver station inbound, qty: 1
                    destSta = staService.getById(task.getDestSta());
                    if (!destSta.getStaSts().equals(StaStsType.IDLE.val())) {
                        throw new BusinessException("destSta:" + task.getDestSta$() + " is not in IDLE status");
                    if (null == staReserveService.reserveStaIn(destSta, task, 1)) {
                        throw new BusinessException("destSta:" + task.getDestSta$() + " failed to reserve");
                    }
                    destSta.setStaSts(StaStsType.READY_RELEASE.val());
                    destSta.setUpdateTime(now);
                    if (!staService.updateById(destSta)) {
                        throw new BusinessException("destSta:" + task.getDestSta$() + " failed to update");
                    }
//                    if (!destSta.getStaSts().equals(StaStsType.IDLE.val())) {
//                        throw new BusinessException("destSta:" + task.getDestSta$() + " is not in IDLE status");
//                    }
//                    destSta.setStaSts(StaStsType.READY_RELEASE.val());
//                    destSta.setUpdateTime(now);
//                    if (!staService.updateById(destSta)) {
//                        throw new BusinessException("destSta:" + task.getDestSta$() + " failed to update");
//                    }
                    break;
                case STA_TO_LOC:
                    oriSta = staService.getById(task.getOriSta());
@@ -1196,6 +1202,7 @@
            for (Segment item : segmentList) {
                item.setGroupId(groupId);
                item.setState(SegmentStateType.RUNNING.toString());
                item.setStartTime(now);
                item.setUpdateTime(now);
                if (null != algoStartTime) {
                    item.setAlgoTime((int) (now.getTime() - algoStartTime.getTime()));
@@ -1556,6 +1563,7 @@
        // segment
        for (Segment segment : segmentList) {
            segment.setState(SegmentStateType.FINISH.toString());
            segment.setEndTime(now);
            segment.setUpdateTime(now);
            if (!segmentService.updateById(segment)) {
                log.error("Segment [{}] 更新失败 !!!", segment.getGroupId() + " - " + segment.getSerial());