浏览代码

检查回应报文模拟器类型是否正确。

tom 3 月之前
父节点
当前提交
40592a078e
共有 1 个文件被更改,包括 12 次插入4 次删除
  1. 12 4
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/CommReceiveService.java

+ 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);