CleanTask.java 961 B

123456789101112131415161718192021222324252627282930
  1. package com.gzlh.task;
  2. import cn.hutool.extra.spring.SpringUtil;
  3. import cn.hutool.http.HttpUtil;
  4. import com.gzlh.led.factory.LedFactory;
  5. import com.gzlh.led.properties.LedPropertiesConfig;
  6. import lombok.extern.slf4j.Slf4j;
  7. import javax.annotation.Resource;
  8. @Slf4j
  9. public class CleanTask implements Runnable {
  10. private String serverUrl;
  11. private String channelName;
  12. public CleanTask(String serverUrl, String channelName) {
  13. this.serverUrl = serverUrl;
  14. this.channelName = channelName;
  15. }
  16. @Override
  17. public void run() {
  18. HttpUtil.get(serverUrl + "/open/cleanWeighbridge?channel=" + channelName);
  19. // log.info("clean finish");
  20. LedPropertiesConfig ledPropertiesConfig = SpringUtil.getBean(LedPropertiesConfig.class);
  21. LedFactory ledFactory = SpringUtil.getBean(LedFactory.class);
  22. String msg = "园内称重";
  23. ledFactory.handler(ledPropertiesConfig.getBrand()).sendMsg(msg);
  24. }
  25. }