|  |  |  | 
|---|
|  |  |  | import com.zy.core.properties.SlaveProperties; | 
|---|
|  |  |  | import com.zy.core.properties.SystemProperties; | 
|---|
|  |  |  | import com.zy.core.thread.BarcodeThread; | 
|---|
|  |  |  | import com.zy.core.thread.MelsecCrnThread; | 
|---|
|  |  |  | import com.zy.core.thread.ScaleThread; | 
|---|
|  |  |  | import com.zy.core.thread.SiemensCrnThread; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 堆垛机状态判断 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | if (crnProtocol.getAlarm() > 0) { | 
|---|
|  |  |  | if (crnProtocol.getAlarm1() > 0) { | 
|---|
|  |  |  | vo.setCrnStatus(CrnStatusType.MACHINE_ERROR); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (crnProtocol.getTaskNo()>0) { | 
|---|
|  |  |  | 
|---|
|  |  |  | CrnDetailVo vo = new CrnDetailVo(); | 
|---|
|  |  |  | for (CrnSlave crnSlave : slaveProperties.getCrn()) { | 
|---|
|  |  |  | if (crnSlave.getId().equals(crnNo)) { | 
|---|
|  |  |  | MelsecCrnThread crnThread = (MelsecCrnThread) SlaveConnection.get(SlaveType.Crn, crnSlave.getId()); | 
|---|
|  |  |  | SiemensCrnThread crnThread = (SiemensCrnThread) SlaveConnection.get(SlaveType.Crn, crnSlave.getId()); | 
|---|
|  |  |  | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); | 
|---|
|  |  |  | vo.setCrnNo(crnNo); | 
|---|
|  |  |  | vo.setWorkNo(crnProtocol.getTaskNo()); | 
|---|
|  |  |  | vo.setCrnStatus(crnProtocol.getStatusType().desc); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (crnProtocol.getAlarm() > 0) { | 
|---|
|  |  |  | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm()); | 
|---|
|  |  |  | if (crnProtocol.getAlarm1() > 0) { | 
|---|
|  |  |  | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm1()); | 
|---|
|  |  |  | vo.setError(crnError == null ? "未知异常" : crnError.getErrName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|