1
zhang
2025-06-17 513f54c61991af2078c9098845df3e840ea5b863
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -48,7 +48,7 @@
 */
@Slf4j
@Service("mainService")
public class MainService {
public class MainService implements IMainService {
    @Autowired
    private BusService busService;
@@ -284,7 +284,9 @@
     */
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void buildMajorTask(Long agvId, List<Task> taskList) {
        if (Cools.isEmpty(agvId, taskList)) { return; }
        if (Cools.isEmpty(agvId, taskList)) {
            return;
        }
        try {
            // valid -----------------------------------------------
            Agv agv = agvService.getById(agvId);
@@ -332,8 +334,10 @@
                backpackLev ++;
                Code startCode = null;
                Code endCode = null;
                Loc oriLoc = null; Loc destLoc = null;
                Sta oriSta = null; Sta destSta = null;
                Loc oriLoc = null;
                Loc destLoc = null;
                Sta oriSta = null;
                Sta destSta = null;
                switch (Objects.requireNonNull(TaskTypeType.get(task.getTaskTypeEl()))) {
                    case LOC_TO_LOC:
                        oriLoc = locService.getById(task.getOriLoc());
@@ -530,9 +534,12 @@
    /**
     * 充电 回待机位任务
     */
    @Transactional(propagation = Propagation.REQUIRES_NEW) // although there is a Transactional here that the lock is isolated, but we can't join the caller's Transactional
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    // although there is a Transactional here that the lock is isolated, but we can't join the caller's Transactional
    public boolean buildMinorTask(Long agvId, TaskTypeType taskType, String destination, Jam jam) {
        if (Cools.isEmpty(agvId, taskType)) { return false; }
        if (Cools.isEmpty(agvId, taskType)) {
            return false;
        }
        try {
            String agvNo = agvService.getAgvNo(agvId);
            if (!agvService.judgeEnable(agvId)) {
@@ -609,7 +616,8 @@
            }
            // generate segment
            int segSerial = 0;     segSerial ++;
            int segSerial = 0;
            segSerial++;
            List<Segment> segmentList = new ArrayList<>();
            String posType = "";
@@ -685,7 +693,9 @@
    @Transactional
    public synchronized void generateAction(Long agvId, List<Segment> segmentList, List<String> pathList, Date algoStartTime) {
        try {
            if (Cools.isEmpty(agvId, segmentList)) { return; }
            if (Cools.isEmpty(agvId, segmentList)) {
                return;
            }
            Date now = new Date();
            long actionPrepareSts = ActionStsType.PREPARE.val();
//            JSONObject storeDirection = configService.getVal("storeDirection", JSONObject.class);
@@ -727,7 +737,9 @@
                    List<String> pathListPart = pathList.subList(pathList.indexOf(lastCode.getData()), pathList.indexOf(code.getData()) + 1);
                    for (int i = 0; i < pathListPart.size(); i++) {
                        if (i == 0) { continue; }
                        if (i == 0) {
                            continue;
                        }
                        String next = pathListPart.get(i);
@@ -1469,8 +1481,10 @@
        for (Segment segment : segmentList) {
            boolean taskComplete = false;
            Task task = taskService.getById(segment.getTaskId());   assert null != task;
            TaskTypeType typeType = TaskTypeType.get(task.getTaskTypeEl());     assert null != typeType;
            Task task = taskService.getById(segment.getTaskId());
            assert null != task;
            TaskTypeType typeType = TaskTypeType.get(task.getTaskTypeEl());
            assert null != typeType;
            TaskPosDto.PosType posType = TaskPosDto.queryPosType(segment.getPosType());
            switch (Objects.requireNonNull(posType)) {