|  | @@ -133,6 +133,7 @@ public class CommSendService {
 | 
	
		
			
				|  |  |                  return arE3;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        s = simService.uniqueBySimNum(simNum);
 | 
	
		
			
				|  |  |          // todo: aj改造
 | 
	
		
			
				|  |  |          readOneSimAtLastByDebug(s);
 | 
	
		
			
				|  |  |          return AjaxResult.success("成功读取!");
 | 
	
	
		
			
				|  | @@ -254,13 +255,18 @@ public class CommSendService {
 | 
	
		
			
				|  |  |       * @param s
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    public AjaxResult checkOneSimStateActive(final Sim s) {
 | 
	
		
			
				|  |  | +    public AjaxResult checkOneSimStateActive(Sim s) {
 | 
	
		
			
				|  |  | +        long simId = s.getSimId();
 | 
	
		
			
				|  |  | +        // 这句可能会调整模拟器状态
 | 
	
		
			
				|  |  |          checkOneSimState(s, true);
 | 
	
		
			
				|  |  | +        //
 | 
	
		
			
				|  |  | +        s = simService.selectSimBySimId(simId);
 | 
	
		
			
				|  |  |          // 如果模拟器离线
 | 
	
		
			
				|  |  | -        if (s == null || !Sim.State.ONLINE.equals(s.getSimState())) {
 | 
	
		
			
				|  |  | +        if (s != null && Sim.State.ONLINE.equals(s.getSimState())) {
 | 
	
		
			
				|  |  | +            return AjaxResult.success();
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  |              return AjaxResult.error("未连接模拟器,请检查连接!");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        return AjaxResult.success();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
	
		
			
				|  | @@ -415,21 +421,22 @@ public class CommSendService {
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      public AjaxResult debugClearAllFaultBySimNum(final String simNum) {
 | 
	
		
			
				|  |  | -        Sim s = simService.uniqueBySimNum(simNum);
 | 
	
		
			
				|  |  | +        Sim s1 = simService.uniqueBySimNum(simNum);
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -            AjaxResult arE3 = checkOneSimStateActive(s);
 | 
	
		
			
				|  |  | +            AjaxResult arE3 = checkOneSimStateActive(s1);
 | 
	
		
			
				|  |  |              if (arE3.isError()) {
 | 
	
		
			
				|  |  |                  return arE3;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if (s == null) {
 | 
	
		
			
				|  |  | +        s1 = simService.uniqueBySimNum(simNum);
 | 
	
		
			
				|  |  | +        if (s1 == null) {
 | 
	
		
			
				|  |  |              return AjaxResult.error("清除失败,对应simNum模拟器不存在!");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if (!Sim.State.ONLINE.equals(s.getSimState())) {
 | 
	
		
			
				|  |  | +        if (!Sim.State.ONLINE.equals(s1.getSimState())) {
 | 
	
		
			
				|  |  |              return AjaxResult.error("清除失败,模拟器尚未在线!");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          List<SimMsg> list = new ArrayList<>();
 | 
	
		
			
				|  |  | -        for (String b : getGZBWBySimType(s.getSimType())) {
 | 
	
		
			
				|  |  | +        for (String b : getGZBWBySimType(s1.getSimType())) {
 | 
	
		
			
				|  |  |              SimMsg sm = debugClearOneFault(simNum, b);
 | 
	
		
			
				|  |  |              list.add(sm);
 | 
	
		
			
				|  |  |              if (sm != null && !sm.getOk()) {
 | 
	
	
		
			
				|  | @@ -528,6 +535,7 @@ public class CommSendService {
 | 
	
		
			
				|  |  |          // 打开socket
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              AjaxResult ar1 = openSocket();
 | 
	
		
			
				|  |  | +            l.info("ar1 = {}", ar1);
 | 
	
		
			
				|  |  |              if (ar1.isError()) {
 | 
	
		
			
				|  |  |                  return ar1;
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -539,6 +547,7 @@ public class CommSendService {
 | 
	
		
			
				|  |  |                  return arE3;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        s = simService.uniqueBySimNum(simNum);
 | 
	
		
			
				|  |  |          // Step 2
 | 
	
		
			
				|  |  |          // msg判断,是否含有"故障部位"字符串
 | 
	
		
			
				|  |  |          {
 |