|  | @@ -115,8 +115,7 @@ public class CommSendService {
 | 
											
												
													
														|  |                  if (refQ == null || refQ.getExamId() == 0L) {
 |  |                  if (refQ == null || refQ.getExamId() == 0L) {
 | 
											
												
													
														|  |                      continue;
 |  |                      continue;
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  | -                if (!RealExamFault.State.WRITTEN.equals(ref.getRefState()) &&
 |  | 
 | 
											
												
													
														|  | -                        !RealExamFault.State.LOOP_READ.equals(ref.getRefState())) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +                if (!RealExamFault.State.WRITTEN.equals(ref.getRefState()) && !RealExamFault.State.LOOP_READ.equals(ref.getRefState())) {
 | 
											
												
													
														|  |                      continue;
 |  |                      continue;
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
										
											
												
													
														|  | @@ -559,8 +558,7 @@ public class CommSendService {
 | 
											
												
													
														|  |       * @return
 |  |       * @return
 | 
											
												
													
														|  |       * @throws IOException
 |  |       * @throws IOException
 | 
											
												
													
														|  |       */
 |  |       */
 | 
											
												
													
														|  | -    public SimMsg debugWriteOneFault(final Long seatId,
 |  | 
 | 
											
												
													
														|  | -                                     final String bindHardwareMsg) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public SimMsg debugWriteOneFault(final Long seatId, final String bindHardwareMsg) {
 | 
											
												
													
														|  |          Seat seat = seatService.selectSeatBySeatId(seatId);
 |  |          Seat seat = seatService.selectSeatBySeatId(seatId);
 | 
											
												
													
														|  |          Sim sim = getSimBySeatIdNewVer(seatId);
 |  |          Sim sim = getSimBySeatIdNewVer(seatId);
 | 
											
												
													
														|  |          SimMsg sm = commBuildService.buildSendMsgWriteFault(sim.getSimNum(), bindHardwareMsg);
 |  |          SimMsg sm = commBuildService.buildSendMsgWriteFault(sim.getSimNum(), bindHardwareMsg);
 | 
											
										
											
												
													
														|  | @@ -773,16 +771,20 @@ public class CommSendService {
 | 
											
												
													
														|  |                  voOne.setSim(sim);
 |  |                  voOne.setSim(sim);
 | 
											
												
													
														|  |                  voOne.setFault(oneF);
 |  |                  voOne.setFault(oneF);
 | 
											
												
													
														|  |                  AjaxResult ar = readOneSimOneFaultCheck(voOne);
 |  |                  AjaxResult ar = readOneSimOneFaultCheck(voOne);
 | 
											
												
													
														|  | 
 |  | +                // getDefaultErrorAR voReturn 可能为空
 | 
											
												
													
														|  |                  FaultCheckVo voReturn = (FaultCheckVo) ar.get(AjaxResult.DATA_TAG);
 |  |                  FaultCheckVo voReturn = (FaultCheckVo) ar.get(AjaxResult.DATA_TAG);
 | 
											
												
													
														|  | -                if (!voReturn.isCheckOk()) {
 |  | 
 | 
											
												
													
														|  | -                    l.info("log 故障部位[" + oneF.getBindHardwareMsg() + "][" + oneF.getReplaceName() + "]未正确安装;");
 |  | 
 | 
											
												
													
														|  | -                    listNGVo.add(voReturn);
 |  | 
 | 
											
												
													
														|  | -                    // add map.
 |  | 
 | 
											
												
													
														|  | -                    // mapVo.put(buildKey(voReturn.getSim().getSimType(), voReturn.getFault().getBindHardwareMsg()), voReturn);
 |  | 
 | 
											
												
													
														|  | -                    setNG.add(oneF.getFaultId());
 |  | 
 | 
											
												
													
														|  | -                } else {
 |  | 
 | 
											
												
													
														|  | -                    l.info("log 故障部位[" + oneF.getBindHardwareMsg() + "][" + oneF.getReplaceName() + "]安装ok;");
 |  | 
 | 
											
												
													
														|  | 
 |  | +                if (voReturn != null) {
 | 
											
												
													
														|  | 
 |  | +                    if (voReturn.isCheckOk()) {
 | 
											
												
													
														|  | 
 |  | +                        l.info("log 故障部位[" + oneF.getBindHardwareMsg() + "][" + oneF.getReplaceName() + "]安装ok;");
 | 
											
												
													
														|  | 
 |  | +                    } else {
 | 
											
												
													
														|  | 
 |  | +                        l.info("log 故障部位[" + oneF.getBindHardwareMsg() + "][" + oneF.getReplaceName() + "]未正确安装;");
 | 
											
												
													
														|  | 
 |  | +                        listNGVo.add(voReturn);
 | 
											
												
													
														|  | 
 |  | +                        // add map.
 | 
											
												
													
														|  | 
 |  | +                        // mapVo.put(buildKey(voReturn.getSim().getSimType(), voReturn.getFault().getBindHardwareMsg()), voReturn);
 | 
											
												
													
														|  | 
 |  | +                        setNG.add(oneF.getFaultId());
 | 
											
												
													
														|  | 
 |  | +                    }
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  | 
 |  | +                // readOneSimOneFaultCheck 得出ar有问题直接返回
 | 
											
												
													
														|  |                  if (ar.isError()) {
 |  |                  if (ar.isError()) {
 | 
											
												
													
														|  |                      return ar;
 |  |                      return ar;
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
										
											
												
													
														|  | @@ -830,12 +832,7 @@ public class CommSendService {
 | 
											
												
													
														|  |  //
 |  |  //
 | 
											
												
													
														|  |  //                }
 |  |  //                }
 | 
											
												
													
														|  |  //            }
 |  |  //            }
 | 
											
												
													
														|  | -            if (setNG != null &&
 |  | 
 | 
											
												
													
														|  | -                    setNG.contains("0003GZBW0003") &&
 |  | 
 | 
											
												
													
														|  | -                    setNG.contains("0003GZBW0004") &&
 |  | 
 | 
											
												
													
														|  | -                    setNG.contains("0003GZBW000B") &&
 |  | 
 | 
											
												
													
														|  | -                    setNG.contains("0003GZBW000E")
 |  | 
 | 
											
												
													
														|  | -            ) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +            if (setNG != null && setNG.contains("0003GZBW0003") && setNG.contains("0003GZBW0004") && setNG.contains("0003GZBW000B") && setNG.contains("0003GZBW000E")) {
 | 
											
												
													
														|  |                  return AjaxResult.error("请检查 显控报警板与主板连接线 连接情况!");
 |  |                  return AjaxResult.error("请检查 显控报警板与主板连接线 连接情况!");
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -853,6 +850,14 @@ public class CommSendService {
 | 
											
												
													
														|  |          SimMsg smS = commBuildService.buildSendMsgReadFaultResistance(vo.getSim().getSimNum(), vo.getFault().getBindHardwareMsg());
 |  |          SimMsg smS = commBuildService.buildSendMsgReadFaultResistance(vo.getSim().getSimNum(), vo.getFault().getBindHardwareMsg());
 | 
											
												
													
														|  |          SimMsg smR = send(smS, vo.getSeat(), vo.getSim(), RETRY_COUNT_CHECK_ONE_FAULT, commStrategy.getSleepLong());
 |  |          SimMsg smR = send(smS, vo.getSeat(), vo.getSim(), RETRY_COUNT_CHECK_ONE_FAULT, commStrategy.getSleepLong());
 | 
											
												
													
														|  |          if (smR.isResultNotOk()) {
 |  |          if (smR.isResultNotOk()) {
 | 
											
												
													
														|  | 
 |  | +            if (Objects.equals(smR.getResult(), SimMsg.Result.RECEIVE_CHECK_FAIL) ||
 | 
											
												
													
														|  | 
 |  | +                    (Objects.equals(smR.getResult(), SimMsg.Result.RECEIVE_NOT_MATCH))) {
 | 
											
												
													
														|  | 
 |  | +                l.info("reset connection!");
 | 
											
												
													
														|  | 
 |  | +                String ip = vo.getSeat().getSeatRs485Ip();
 | 
											
												
													
														|  | 
 |  | +                Integer port = vo.getSeat().getSeatRs485Port();
 | 
											
												
													
														|  | 
 |  | +                SimSocketParamVo sspv = new SimSocketParamVo(ip, port);
 | 
											
												
													
														|  | 
 |  | +                socketService.closeOne(sspv, true);
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  |              return smR.getDefaultErrorAR();
 |  |              return smR.getDefaultErrorAR();
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          // set send and receive msg.
 |  |          // set send and receive msg.
 | 
											
										
											
												
													
														|  | @@ -915,8 +920,7 @@ public class CommSendService {
 | 
											
												
													
														|  |       * @param bindHardwareMsg
 |  |       * @param bindHardwareMsg
 | 
											
												
													
														|  |       * @return
 |  |       * @return
 | 
											
												
													
														|  |       */
 |  |       */
 | 
											
												
													
														|  | -    public SimMsg debugReadOneFaultResistance(final Long seatId,
 |  | 
 | 
											
												
													
														|  | -                                              final String bindHardwareMsg) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public SimMsg debugReadOneFaultResistance(final Long seatId, final String bindHardwareMsg) {
 | 
											
												
													
														|  |          Seat seat = seatService.selectSeatBySeatId(seatId);
 |  |          Seat seat = seatService.selectSeatBySeatId(seatId);
 | 
											
												
													
														|  |          Sim sim = getSimBySeatIdNewVer(seatId);
 |  |          Sim sim = getSimBySeatIdNewVer(seatId);
 | 
											
												
													
														|  |          SimMsg sm = commBuildService.buildSendMsgReadFaultResistance(sim.getSimNum(), bindHardwareMsg);
 |  |          SimMsg sm = commBuildService.buildSendMsgReadFaultResistance(sim.getSimNum(), bindHardwareMsg);
 | 
											
										
											
												
													
														|  | @@ -951,14 +955,11 @@ public class CommSendService {
 | 
											
												
													
														|  |          SimMsg sm2 = null;
 |  |          SimMsg sm2 = null;
 | 
											
												
													
														|  |          if (reF != null && refState != null) {
 |  |          if (reF != null && refState != null) {
 | 
											
												
													
														|  |              if (RealExamFault.State.FINISH.equals(refState)) { // 是否最后一次读取。
 |  |              if (RealExamFault.State.FINISH.equals(refState)) { // 是否最后一次读取。
 | 
											
												
													
														|  | -                sm2 = send(sm1, seat, sim,
 |  | 
 | 
											
												
													
														|  | -                        RETRY_COUNT_READ_ONE_RESISTANCE_FINAL, commStrategy.getSleepShort());
 |  | 
 | 
											
												
													
														|  | 
 |  | +                sm2 = send(sm1, seat, sim, RETRY_COUNT_READ_ONE_RESISTANCE_FINAL, commStrategy.getSleepShort());
 | 
											
												
													
														|  |              } else if (RealExamFault.State.LOOP_READ.equals(refState)) { // 是否是中间读取
 |  |              } else if (RealExamFault.State.LOOP_READ.equals(refState)) { // 是否是中间读取
 | 
											
												
													
														|  | -                sm2 = send(sm1, seat, sim,
 |  | 
 | 
											
												
													
														|  | -                        RETRY_COUNT_READ_ONE_RESISTANCE_MIDDLE, commStrategy.getSleepShort(), false);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                sm2 = send(sm1, seat, sim, RETRY_COUNT_READ_ONE_RESISTANCE_MIDDLE, commStrategy.getSleepShort(), false);
 | 
											
												
													
														|  |              } else {
 |  |              } else {
 | 
											
												
													
														|  | -                sm2 = send(sm1, seat, sim,
 |  | 
 | 
											
												
													
														|  | -                        RETRY_COUNT_0, commStrategy.getSleepShort());
 |  | 
 | 
											
												
													
														|  | 
 |  | +                sm2 = send(sm1, seat, sim, RETRY_COUNT_0, commStrategy.getSleepShort());
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          } else {
 |  |          } else {
 | 
											
												
													
														|  |              sm2 = send(sm1, seat, sim, RETRY_COUNT_READ_ONE_RESISTANCE_FINAL, commStrategy.getSleepShort());
 |  |              sm2 = send(sm1, seat, sim, RETRY_COUNT_READ_ONE_RESISTANCE_FINAL, commStrategy.getSleepShort());
 | 
											
										
											
												
													
														|  | @@ -966,8 +967,7 @@ public class CommSendService {
 | 
											
												
													
														|  |          simReceiveService.setFaultAnswerValue(sm2, sim, reF, f, refState);
 |  |          simReceiveService.setFaultAnswerValue(sm2, sim, reF, f, refState);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    public SimMsg send(final SimMsg sm, final Seat seat, final Sim sim,
 |  | 
 | 
											
												
													
														|  | -                       final int retryTotalCount, final long sleep) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public SimMsg send(final SimMsg sm, final Seat seat, final Sim sim, final int retryTotalCount, final long sleep) {
 | 
											
												
													
														|  |          return send(sm, seat, sim, retryTotalCount, sleep, true);
 |  |          return send(sm, seat, sim, retryTotalCount, sleep, true);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -985,8 +985,7 @@ public class CommSendService {
 | 
											
												
													
														|  |       * @param importantTask
 |  |       * @param importantTask
 | 
											
												
													
														|  |       * @return
 |  |       * @return
 | 
											
												
													
														|  |       */
 |  |       */
 | 
											
												
													
														|  | -    public SimMsg send(final SimMsg sm, final Seat seat, final Sim sim,
 |  | 
 | 
											
												
													
														|  | -                       final int retryTotalCount, final long sleep, final boolean importantTask) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public SimMsg send(final SimMsg sm, final Seat seat, final Sim sim, final int retryTotalCount, final long sleep, final boolean importantTask) {
 | 
											
												
													
														|  |          if (!config.isCommGlobal()) {
 |  |          if (!config.isCommGlobal()) {
 | 
											
												
													
														|  |              l.warn("isCommGlobal == false [模拟器通信被禁用!]");
 |  |              l.warn("isCommGlobal == false [模拟器通信被禁用!]");
 | 
											
												
													
														|  |              return sm;
 |  |              return sm;
 |