Commit be18f5c3 by 吕明尚

修改定时任务传参

parent 05bb962f
package share.quartz.task;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import share.system.domain.DeviceGateway;
......@@ -19,6 +22,7 @@ import java.util.List;
@Component
public class DeviceTask {
private static final Logger log = LoggerFactory.getLogger(DeviceTask.class);
@Autowired
private DeviceStatusLogService deviceStatusLogService;
@Autowired
......@@ -49,12 +53,11 @@ public class DeviceTask {
}
}
/**
* 定期修改门锁设备的开锁密码
* @param validTime 有效时长
*/
@XxlJob("updateDeviceDoorLockPassword")
public void updateDeviceDoorLockPassword(Integer validTime) {
public void updateDeviceDoorLockPassword() {
String jobParam = XxlJobHelper.getJobParam();
Integer validTime = Integer.getInteger(jobParam);
log.debug("jobParam:" + jobParam);
if (validTime == null) {
validTime = 15;
}
......
......@@ -27,7 +27,7 @@
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<level>DEBUG</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment