wcs调度修改
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.schedule;
|
||||
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.PlcConnectInfo;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.CustomThread;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.SsjDevice;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.Ssj;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
@@ -14,6 +17,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public class ScheduleThread {
|
||||
|
||||
public CustomThread customThread;
|
||||
@Autowired
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
|
||||
/**
|
||||
* 项目初始化启动
|
||||
@@ -23,10 +28,12 @@ public class ScheduleThread {
|
||||
String ip = "192.168.0.1";
|
||||
int port = 80;
|
||||
PlcConnectInfo ssjPlcConnectInfo = new PlcConnectInfo(ip, port);
|
||||
ConcurrentHashMap<String, SsjDevice>list = new ConcurrentHashMap<>();
|
||||
ConcurrentHashMap<String, DeviceSsj>list = new ConcurrentHashMap<>();
|
||||
//获取要去取的输送机
|
||||
|
||||
|
||||
List<DeviceSsj> deviceSsjs = deviceSsjService.selectDeviceSsjList(new DeviceSsj());
|
||||
for (DeviceSsj deviceSsj : deviceSsjs) {
|
||||
list.put(deviceSsj.getDeviceCode(),deviceSsj);
|
||||
}
|
||||
|
||||
PlcRead plcRead = new PlcRead(list,ssjPlcConnectInfo);
|
||||
Thread plcReadThread = new Thread(plcRead);
|
||||
|
||||
Reference in New Issue
Block a user