|
@@ -2,8 +2,8 @@ package com.gzlh.event;
|
|
|
|
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
import cn.hutool.core.util.NumberUtil;
|
|
import cn.hutool.core.util.NumberUtil;
|
|
-import cn.hutool.core.util.RandomUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
import com.gzlh.config.ModuleEnum;
|
|
import com.gzlh.config.ModuleEnum;
|
|
import com.gzlh.dto.EventDTO;
|
|
import com.gzlh.dto.EventDTO;
|
|
import com.gzlh.infrared.config.RedPropertiesConfig;
|
|
import com.gzlh.infrared.config.RedPropertiesConfig;
|
|
@@ -13,34 +13,25 @@ import com.gzlh.led.properties.LedPropertiesConfig;
|
|
import com.gzlh.weighbridge.config.WeighbridgePropertiesConfig;
|
|
import com.gzlh.weighbridge.config.WeighbridgePropertiesConfig;
|
|
import com.gzlh.weighbridge.factory.WeighbridgeFactory;
|
|
import com.gzlh.weighbridge.factory.WeighbridgeFactory;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
-import java.util.Date;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
-public class EventThread extends Thread{
|
|
|
|
|
|
+public class EventThread implements Runnable{
|
|
private List<EventDTO> eventDTOList;
|
|
private List<EventDTO> eventDTOList;
|
|
private String eventName;
|
|
private String eventName;
|
|
- @Resource
|
|
|
|
- private LedFactory ledFactory;
|
|
|
|
- @Resource
|
|
|
|
- private RedFactory redFactory;
|
|
|
|
- @Resource
|
|
|
|
- WeighbridgeFactory weighbridgeFactory;
|
|
|
|
|
|
|
|
- @Resource
|
|
|
|
- private WeighbridgePropertiesConfig weighbridgePropertiesConfig;
|
|
|
|
- @Resource
|
|
|
|
- private RedPropertiesConfig redPropertiesConfig;
|
|
|
|
- @Resource
|
|
|
|
- private LedPropertiesConfig ledPropertiesConfig;
|
|
|
|
|
|
+ private LedFactory ledFactory = SpringUtil.getBean(LedFactory.class);
|
|
|
|
+ private RedFactory redFactory = SpringUtil.getBean(RedFactory.class);
|
|
|
|
+ private WeighbridgeFactory weighbridgeFactory = SpringUtil.getBean(WeighbridgeFactory.class);
|
|
|
|
+
|
|
|
|
+ private WeighbridgePropertiesConfig weighbridgePropertiesConfig = SpringUtil.getBean(WeighbridgePropertiesConfig.class);
|
|
|
|
+ private RedPropertiesConfig redPropertiesConfig = SpringUtil.getBean(RedPropertiesConfig.class);
|
|
|
|
+ private LedPropertiesConfig ledPropertiesConfig = SpringUtil.getBean(LedPropertiesConfig.class);
|
|
|
|
|
|
public EventThread() {
|
|
public EventThread() {
|
|
}
|
|
}
|
|
|
|
|
|
public EventThread(String eventName) {
|
|
public EventThread(String eventName) {
|
|
- this.setName(eventName);
|
|
|
|
this.eventName=eventName;
|
|
this.eventName=eventName;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -105,6 +96,7 @@ public class EventThread extends Thread{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
public void run(){
|
|
public void run(){
|
|
handlerEvent(eventName);
|
|
handlerEvent(eventName);
|
|
}
|
|
}
|