123456789101112131415161718192021222324252627282930 |
- package com.gzlh.task;
- import cn.hutool.extra.spring.SpringUtil;
- import cn.hutool.http.HttpUtil;
- import com.gzlh.led.factory.LedFactory;
- import com.gzlh.led.properties.LedPropertiesConfig;
- import lombok.extern.slf4j.Slf4j;
- import javax.annotation.Resource;
- @Slf4j
- public class CleanTask implements Runnable {
- private String serverUrl;
- private String channelName;
- public CleanTask(String serverUrl, String channelName) {
- this.serverUrl = serverUrl;
- this.channelName = channelName;
- }
- @Override
- public void run() {
- HttpUtil.get(serverUrl + "/open/cleanWeighbridge?channel=" + channelName);
- // log.info("clean finish");
- LedPropertiesConfig ledPropertiesConfig = SpringUtil.getBean(LedPropertiesConfig.class);
- LedFactory ledFactory = SpringUtil.getBean(LedFactory.class);
- String msg = "园内称重";
- ledFactory.handler(ledPropertiesConfig.getBrand()).sendMsg(msg);
- }
- }
|