|  | @@ -1,6 +1,7 @@
 | 
	
		
			
				|  |  |  package com.ruoyi.sim.service.impl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.ruoyi.common.core.domain.AjaxResult;
 | 
	
		
			
				|  |  | +import com.ruoyi.sim.constant.CommConst;
 | 
	
		
			
				|  |  |  import com.ruoyi.sim.constant.FaultConst;
 | 
	
		
			
				|  |  |  import com.ruoyi.sim.domain.*;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
	
		
			
				|  | @@ -163,7 +164,7 @@ public class CommReceiveService {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     * 截取
 | 
	
		
			
				|  |  | +     * 截取 内容报文。
 | 
	
		
			
				|  |  |       *
 | 
	
		
			
				|  |  |       * @param receiveMsg
 | 
	
		
			
				|  |  |       * @return
 | 
	
	
		
			
				|  | @@ -185,27 +186,29 @@ public class CommReceiveService {
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      public AjaxResult getOneFaultCheck(SimMsg sm, Sim s, Fault f) {
 | 
	
		
			
				|  |  |          String checkValue = parseGetData(sm.getReceiveMsg());
 | 
	
		
			
				|  |  | -        if (s != null && isFaultCheckPass(sm, s, f)) {
 | 
	
		
			
				|  |  | +        if (s == null) {
 | 
	
		
			
				|  |  | +            return AjaxResult.error("没有对应模拟器!");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        // 是否在 故障部位 跳过检查 白名单中。
 | 
	
		
			
				|  |  | +        if (FaultConst.FAULT_SET_CHECK_PASS.contains(f.getFaultId())) {
 | 
	
		
			
				|  |  | +            // 跳过检查,直接成功。
 | 
	
		
			
				|  |  |              return AjaxResult.success(f);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if (BLANK_CONTENT.equals(checkValue)) {
 | 
	
		
			
				|  |  | +        // 是否是 2型的维护管 或 3型的维护管
 | 
	
		
			
				|  |  | +        if (FaultConst.FAULT_SET_WHG.contains(f.getFaultId())) {
 | 
	
		
			
				|  |  | +            // 判断必须存在
 | 
	
		
			
				|  |  | +            String WHG_EXIST_MSG = checkValue.substring(4, 6);
 | 
	
		
			
				|  |  | +            if (CommConst.WHG_MSG_EXIST_YES.equals(WHG_EXIST_MSG)) {
 | 
	
		
			
				|  |  | +                return AjaxResult.success(f);
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                return AjaxResult.error("故障部位[" + f.getBindHardwareMsg() + "][" + f.getReplaceName() + "]未正确安装;", f);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (CommConst.BLANK_CONTENT.equals(checkValue)) {
 | 
	
		
			
				|  |  |              l.info("故障部位[" + f.getBindHardwareMsg() + "][" + f.getReplaceName() + "]未正确安装;");
 | 
	
		
			
				|  |  |              return AjaxResult.error("故障部位[" + f.getBindHardwareMsg() + "][" + f.getReplaceName() + "]未正确安装;", f);
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              return AjaxResult.success(f);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    /**
 | 
	
		
			
				|  |  | -     * 是否在故障部位白名单中。
 | 
	
		
			
				|  |  | -     *
 | 
	
		
			
				|  |  | -     * @param sm
 | 
	
		
			
				|  |  | -     * @param s
 | 
	
		
			
				|  |  | -     * @param f
 | 
	
		
			
				|  |  | -     * @return true 在白名单中。
 | 
	
		
			
				|  |  | -     */
 | 
	
		
			
				|  |  | -    public boolean isFaultCheckPass(SimMsg sm, Sim s, Fault f) {
 | 
	
		
			
				|  |  | -        String faultRealGZBWId = f.getFaultId();
 | 
	
		
			
				|  |  | -        return FaultConst.FAULT_SET_CHECK_PASS.contains(faultRealGZBWId);
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  |  }
 |