| | |
| | | package com.zy.common.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | |
| | | import com.zy.common.utils.NavigateUtils; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.StationCommand; |
| | | import com.zy.core.model.protocol.StationProtocol; |
| | | import com.zy.core.thread.StationThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, |
| | | wrkMast.getWrkNo(), Integer.valueOf(param.getSourceStaNo()), Integer.valueOf(param.getSourceStaNo()), 0); |
| | | |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(2, command)); |
| | | Map<Integer, StationProtocol> statusMap = stationThread.getStatusMap(); |
| | | StationProtocol stationProtocol = statusMap.get(command.getStationId()); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("oldTaskNo", wrkMast.getWrkNo()); |
| | | data.put("newTaskNo", stationProtocol.getTaskNo()); |
| | | data.put("command", command); |
| | | data.put("stationId", command.getStationId()); |
| | | data.put("deviceNo", 1); |
| | | redisUtil.set(RedisKeyType.RECEIVE_IN_TASK_CHANGE_STATION_TASK.key + command.getStationId(), JSONObject.toJSONString(data), 60 * 5); |
| | | |
| | | if (findCrnResult.getCrnType().equals(SlaveType.Crn)) { |
| | | wrkMast.setCrnNo(findCrnResult.getCrnNo()); |