1
0

2 Commity b4fd41dbeb ... a7c512571c

Autor SHA1 Správa Dátum
  tom a7c512571c 添加ORN_BROADCAST。 3 mesiacov pred
  tom 40592a078e 检查回应报文模拟器类型是否正确。 3 mesiacov pred

+ 5 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/constant/CommConst.java

@@ -11,6 +11,11 @@ public interface CommConst {
     /**
      * orientation
      */
+    String ORN_BROADCAST = "00";
+
+    /**
+     * orientation
+     */
     String ORN_SEND = "01";
 
     /**

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

@@ -48,27 +48,35 @@ public class CommReceiveService {
         return AjaxResult.success();
     }
 
+    /**
+     * c.endsWith(s.getSimNum())
+     * 检查回应报文模拟器类型是否正确。
+     *
+     * @param sm
+     * @param s
+     * @return
+     */
     public AjaxResult checkOneSimSn(SimMsg sm, Sim s) {
         final String simType = s.getSimType();
-        final String r = sm.getReceiveMsg();
+        final String c = subContentData(sm.getReceiveMsg());
         final String msgError = "连接模拟器类型不正确!";
         switch (simType) {
             case Sim.TYPE_0001 -> {
-                if (r.startsWith(Sim.TYPE_0001_SN) && r.endsWith(s.getSimNum())) {
+                if (c.startsWith(Sim.TYPE_0001_SN)) {
                     return AjaxResult.success();
                 } else {
                     return AjaxResult.error(msgError);
                 }
             }
             case Sim.TYPE_0002 -> {
-                if (r.startsWith(Sim.TYPE_0002_SN) && r.endsWith(s.getSimNum())) {
+                if (c.startsWith(Sim.TYPE_0002_SN)) {
                     return AjaxResult.success();
                 } else {
                     return AjaxResult.error(msgError);
                 }
             }
             case Sim.TYPE_0003 -> {
-                if (r.startsWith(Sim.TYPE_0003_SN) && r.endsWith(s.getSimNum())) {
+                if (c.startsWith(Sim.TYPE_0003_SN)) {
                     return AjaxResult.success();
                 } else {
                     return AjaxResult.error(msgError);