|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/site") | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | public class SiteController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 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 { | 
|---|