|
@@ -15,6 +15,7 @@ import com.gzlh.weighbridge.factory.WeighbridgeFactory;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -38,8 +39,8 @@ public class EventThread extends Thread{
|
|
public EventThread() {
|
|
public EventThread() {
|
|
}
|
|
}
|
|
|
|
|
|
- public EventThread(String name, String eventName) {
|
|
|
|
- this.setName(name+"-"+ RandomUtil.randomNumber());
|
|
|
|
|
|
+ public EventThread(String eventName) {
|
|
|
|
+ this.setName(eventName);
|
|
this.eventName=eventName;
|
|
this.eventName=eventName;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -56,11 +57,9 @@ public class EventThread extends Thread{
|
|
*/
|
|
*/
|
|
public void handlerEvent(String eventName) {
|
|
public void handlerEvent(String eventName) {
|
|
log.info("event:{}", eventName);
|
|
log.info("event:{}", eventName);
|
|
- System.out.println(eventName);
|
|
|
|
|
|
|
|
eventDTOList.stream().filter(eventDTO -> StrUtil.equals(eventName, eventDTO.getName()))
|
|
eventDTOList.stream().filter(eventDTO -> StrUtil.equals(eventName, eventDTO.getName()))
|
|
.findFirst().ifPresent(eventDTO -> {
|
|
.findFirst().ifPresent(eventDTO -> {
|
|
- System.out.println(eventDTO);
|
|
|
|
|
|
|
|
List<String> actionList = eventDTO.getActionList().getAction();
|
|
List<String> actionList = eventDTO.getActionList().getAction();
|
|
//依次执行动作
|
|
//依次执行动作
|
|
@@ -107,8 +106,6 @@ public class EventThread extends Thread{
|
|
}
|
|
}
|
|
|
|
|
|
public void run(){
|
|
public void run(){
|
|
- System.out.println("thread开始");
|
|
|
|
handlerEvent(eventName);
|
|
handlerEvent(eventName);
|
|
- System.out.println("thread结束");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|