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