Thread threadTemp = new Thread(new Runnable() {
@Override
public void run() {
try {
NightshiftInterval ns = nightshiftIntervalMapper.selectByPrimaryKeyType(1);
if(ns!=null && ns.getMillis()!=null){
Thread.currentThread().sleep(Long.parseLong(ns.getMillis()));
int res = ControllerVehicle(vehicleOld.getSn(), vehicleOld.getCode(), "501");
logger.info("<----------------车辆SN:" + vehicleOld.getSn() + ",锁门返回结果:" + res + "!---------------------->");
}else{
Thread.currentThread().sleep(120000L);
int res = ControllerVehicle(vehicleOld.getSn(), vehicleOld.getCode(), "501");
logger.info("<----------------车辆SN:" + vehicleOld.getSn() + ",锁门返回结果:" + res + "!---------------------->");
}
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
});
threadTemp.start();