zhang
2025-05-20 1313906bb1eb983d3beece810035e7fc28d6a92f
zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java
@@ -7,6 +7,7 @@
import com.zy.acs.common.domain.protocol.AGV_01_UP;
import com.zy.acs.common.utils.RedisSupport;
import com.zy.acs.framework.common.Cools;
import com.zy.acs.manager.core.service.MainService;
import com.zy.acs.manager.core.service.MapService;
import com.zy.acs.manager.manager.entity.Action;
import com.zy.acs.manager.manager.entity.Agv;
@@ -16,7 +17,6 @@
import com.zy.acs.manager.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@@ -55,6 +55,8 @@
    @Autowired
    private AgvDetailService agvDetailService;
    @Autowired
    private AgvModelService agvModelService;
    @Autowired
    private ActionService actionService;
    @Autowired
    private ConfigService configService;
@@ -64,6 +66,8 @@
    private MapService mapService;
    @Autowired
    private JamService jamService;
    @Autowired
    private MainService mainService;
    @PostConstruct
    public void init() {
@@ -88,7 +92,7 @@
        this.responseThread = new Thread(() -> {
            while (!Thread.currentThread().isInterrupted()) {
                try {
                    Thread.sleep(100);
                    Thread.sleep(5);
                    if (configService.getVal("fakeSign", Boolean.class)) {
                        this.responseTheRequest();
@@ -111,7 +115,7 @@
        this.simulatorTread = new Thread(() -> {
            while (!Thread.currentThread().isInterrupted()) {
                try {
                    Thread.sleep(100);
                    Thread.sleep(30);
                    if (configService.getVal("fakeSign", Boolean.class)) {
@@ -124,19 +128,23 @@
                        for (Agv agv : agvList) {
                            if (!AGV_PROCESSING_MAP.get(agv.getId())) {
                                AGV_PROCESSING_MAP.put(agv.getId(), true);
                                List<Action> actionList = actionService.queryLatestGroup(agv.getId(), ActionStsType.ISSUED);
                                if (!Cools.isEmpty(actionList)) {
                                    AGV_PROCESSING_MAP.put(agv.getId(), true);
                                    executorService.submit(new AgvSimulatorTask(
                                            agv
                                            , redis
                                            , agvDetailService
                                            , agvModelService
                                            , actionService
                                            , codeService
                                            , mapService
                                            , jamService
                                            , mainService
                                            , actionList
                                    ));
                                } else {
                                    AGV_PROCESSING_MAP.put(agv.getId(), false);
                                }
                            }