From 5c0622d48c825ca4b75f63dda78d51ed75bc7a2f Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 12 四月 2024 11:04:19 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/DeviceTimer.java | 27 +++------------------------ 1 files changed, 3 insertions(+), 24 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/DeviceTimer.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/DeviceTimer.java index f464165..9df4890 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/DeviceTimer.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/DeviceTimer.java @@ -3,16 +3,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zy.asrs.wcs.core.action.LiftAction; import com.zy.asrs.wcs.core.action.ShuttleAction; +import com.zy.asrs.wcs.core.model.enums.DeviceCtgType; import com.zy.asrs.wcs.core.utils.RedisUtil; -import com.zy.asrs.wcs.rcs.cache.SlaveConnection; import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant; import com.zy.asrs.wcs.rcs.entity.Device; -import com.zy.asrs.wcs.rcs.entity.DeviceType; -import com.zy.asrs.wcs.rcs.model.enums.SlaveType; -import com.zy.asrs.wcs.rcs.model.protocol.ShuttleProtocol; import com.zy.asrs.wcs.rcs.service.DeviceService; -import com.zy.asrs.wcs.rcs.service.DeviceTypeService; -import com.zy.asrs.wcs.rcs.thread.ShuttleThread; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; @@ -29,24 +24,15 @@ @Autowired private DeviceService deviceService; @Autowired - private DeviceTypeService deviceTypeService; - @Autowired private ShuttleAction shuttleAction; @Autowired private LiftAction liftAction; @Scheduled(cron = "0/1 * * * * ? ") public synchronized void executeShuttle() { - DeviceType deviceType = deviceTypeService.getOne(new LambdaQueryWrapper<DeviceType>() - .eq(DeviceType::getFlag, String.valueOf(SlaveType.Shuttle)) - .eq(DeviceType::getStatus, 1)); - if (deviceType == null) { - return; - } - List<Device> list = deviceService.list(new LambdaQueryWrapper<Device>() .eq(Device::getStatus, 1) - .eq(Device::getDeviceType, deviceType.getId())); + .eq(Device::getDeviceType, DeviceCtgType.SHUTTLE.val())); for (Device device : list) { //灏忚溅绌洪棽涓旀湁璺戝簱绋嬪簭 shuttleAction.moveLoc(device); @@ -66,16 +52,9 @@ @Scheduled(cron = "0/1 * * * * ? ") public synchronized void executeLift() { - DeviceType deviceType = deviceTypeService.getOne(new LambdaQueryWrapper<DeviceType>() - .eq(DeviceType::getFlag, String.valueOf(SlaveType.Lift)) - .eq(DeviceType::getStatus, 1)); - if (deviceType == null) { - return; - } - List<Device> list = deviceService.list(new LambdaQueryWrapper<Device>() .eq(Device::getStatus, 1) - .eq(Device::getDeviceType, deviceType.getId())); + .eq(Device::getDeviceType, DeviceCtgType.LIFT.val())); for (Device device : list) { Object object = redisUtil.get(DeviceRedisConstant.LIFT_FLAG + device.getDeviceNo()); if (object == null) { -- Gitblit v1.9.1