Sfoglia il codice sorgente

修复 出题值,答题值,没有被正确写入数据库的问题。

tom 1 settimana fa
parent
commit
df87c5fa59

+ 6 - 4
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/CommReceiveService.java

@@ -89,11 +89,13 @@ public class CommReceiveService {
             //
 
             //
-            HashSet<Fault> fSet = new HashSet<>();
+            HashSet<String> fSet = new HashSet<>();
             for (String fId : faultIds) {
-                fSet.add(faultService.selectFaultByFaultId(fId));
+                fSet.add(fId);
             }
+            l.info("fSet.size() = {}", fSet.size());
             String faultId = f.getFaultId();
+            l.info("faultId = {}", faultId);
             DebugFault df = debugFaultService.exist(s.getSimId(), faultId);
             if (df == null) {
                 df = new DebugFault();
@@ -105,7 +107,7 @@ public class CommReceiveService {
                     df.setFlag(DebugFault.Flag.NO);
                 }
                 df.setSimFaultQuestionValue(faultQuestionValue);
-                df.setSimFaultQuestionValue("");
+                df.setSimFaultAnswerValue("");
                 debugFaultService.insertDebugFault(df);
             } else {
                 if (fSet.contains(faultId)) {
@@ -114,7 +116,7 @@ public class CommReceiveService {
                     df.setFlag(DebugFault.Flag.NO);
                 }
                 df.setSimFaultQuestionValue(faultQuestionValue);
-                df.setSimFaultQuestionValue("");
+                df.setSimFaultAnswerValue("");
                 debugFaultService.updateDebugFault(df);
             }
         }

+ 5 - 4
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/CommSendService.java

@@ -734,7 +734,7 @@ public class CommSendService {
         simReceiveService.setFaultAnswerValue(sm2, s, reF, f, refState);
     }
 
-    // private long shangyige_sleep = 0
+    private long previousSendSleep = 0;
 
     /**
      * send hex message
@@ -742,7 +742,7 @@ public class CommSendService {
      * @param sm              发送
      * @param s               可以为空,更新最后发送/接收时间 用。
      * @param retryTotalCount 重试次数
-     * @param sleep           不使用传入0
+     * @param sleep           不使用传入0,不进行挂起。
      * @return
      */
     public synchronized SimMsg send(final SimMsg sm, final Sim s, final int retryTotalCount, final long sleep) {
@@ -765,10 +765,11 @@ public class CommSendService {
             openSocket();
             {
                 // sleep ,追求顺序请求。
-                if (sleep > 0) {
-                    Thread.sleep(sleep);
+                if (sleep > 0 && previousSendSleep != 0L) {
+                    Thread.sleep(previousSendSleep);
                 }
             }
+            previousSendSleep = sleep;
             InputStream is = cachedSocket.getInputStream();
             OutputStream os = cachedSocket.getOutputStream();
             os.write(hexStrToByteArrs(sm.getSendMsg()));