1
zhang
3 天以前 add29c9dfe37a3147ee1a426e1dba2f42ad741e6
src/main/java/com/zy/asrs/controller/SiteController.java
@@ -8,8 +8,8 @@
import com.zy.asrs.domain.vo.SiteTableVo;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.service.BasDevpService;
import com.zy.asrs.utils.CommandUtils;
import com.zy.core.DevpThread;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
@@ -18,6 +18,7 @@
import com.zy.core.model.protocol.StaProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.SiemensDevpThread;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -32,6 +33,7 @@
 */
@RestController
@RequestMapping("/site")
@Slf4j
public class SiteController {
    @Autowired
@@ -48,8 +50,8 @@
            SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
            Map<String, Object> map2 = new HashMap<>();
            map2.put("floor", 2);
            map2.put("modeVal", devpThread.ioModeOf2F.id);
            map2.put("modeDesc", devpThread.ioModeOf2F.desc);
            map2.put("modeVal", devpThread.ioModeOf1F1.id);
            map2.put("modeDesc", devpThread.ioModeOf1F1.desc);
            res.add(map2);
        }
        return R.ok().add(res);
@@ -227,7 +229,8 @@
                        basDevp.setOutEnable(outEnable ? "Y" : "N");
                    }
                    basDevpService.updateById(basDevp);
                    boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol), false);
                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    log.info("修改站点信息命令推送输送线队列成功:{}",staProtocol);
                    if (result) {
                        return R.ok();
                    } else {
@@ -277,7 +280,7 @@
                    staProtocol.setWorkNo((short) 0);
                    staProtocol.setStaNo((short) 0);
                    basDevpService.updateById(basDevp);
                    boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol), false);
                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
                    if (result) {
                        return R.ok();
                    } else {
@@ -318,7 +321,7 @@
                }
                staProtocol.setWorkNo((short) 9999);
                staProtocol.setStaNo(inSta.getStaNo().shortValue());
                boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol), false);
                boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
                if (result) {
                    return R.ok();
                } else {