自动化立体仓库 - WCS系统
#
LSH
2023-11-16 ee718203195675fe7b1aab64b3c1890efafb8068
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -40,6 +40,8 @@
import com.zy.core.thread.BarcodeThread;
import com.zy.core.thread.LedThread;
import com.zy.core.thread.SiemensDevpThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -91,6 +93,10 @@
    private BasCrnErrorMapper basCrnErrorMapper;
    @Autowired
    private TaskWrkMapper taskWrkMapper;
    @Autowired
    private TaskWrkService taskWrkService;
    @Autowired
    private ConfigService configService;
    @Value("${wms.url}")
    private String wmsUrl;
@@ -1362,5 +1368,25 @@
        }
    }
    //自动派发任务
    public void autoDistribute() {
        Config config = configService.selectByCode("autoDistribute");
        if (config == null) {
            return;
        }
        if (config.getValue().equals("false")) {//判断是否开启自动派发任务
            return;
        }
        for (TaskWrk taskWrk : taskWrkService.selectReceive()) {
            try {
                taskWrkService.distribute(taskWrk.getTaskNo(), 9527L);
            } catch (CoolException e) {
                e.printStackTrace();
            }
        }
    }
}