#
cpT
8 天以前 463b9e4b68b8ab62a11c6985081fd5d62692cc79
src/main/java/com/zy/core/network/real/ZyCrnV2RealConnect.java
@@ -6,9 +6,12 @@
import HslCommunication.Profinet.Siemens.SiemensS7Net;
import com.alibaba.fastjson.JSON;
import com.core.common.DateUtils;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.DeviceConfig;
import com.zy.common.utils.RedisUtil;
import com.zy.core.News;
import com.zy.core.cache.OutputQueue;
import com.zy.core.enums.RedisKeyType;
import com.zy.core.model.CommandResponse;
import com.zy.core.model.command.CrnCommand;
import com.zy.core.network.api.ZyCrnConnectApi;
@@ -101,7 +104,12 @@
                            array[7] = (short) 0;
                            array[8] = (short) 0;
                            array[9] = (short) 0;
                            OperateResult taskClearResult = siemensNet.Write("DB100.0", array);
                            RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
                            Object lock = redisUtil.get(RedisKeyType.CRN_SEND_COMMAND_LOCK.key + deviceConfig.getDeviceNo());
                            if (lock == null) {
                                OperateResult taskClearResult = siemensNet.Write("DB100.0", array);
                            }
                        }
                    }
                }
@@ -121,6 +129,8 @@
    @Override
    public CommandResponse sendCommand(CrnCommand command) {
        RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
        redisUtil.set(RedisKeyType.CRN_SEND_COMMAND_LOCK.key + deviceConfig.getDeviceNo(), "lock", 5);
        CommandResponse response = new CommandResponse(false);
        try {
            if (null == command) {