feat: add additional features (fjgn) support

- Add fjgn (附加功能) field extraction from instrument characteristics
- Extract additional features from model number's instrument feature field
- Merge all fields from index 5 onwards to handle dot separators in features
- Remove oil-fill type (Y+digit) suffix from additional features
- Normalize separators (comma and dot) to comma for consistent parsing
- Implement multi-value matching for fjgn conditions (contains logic)
  - fjgn=N1: true if fjgn contains N1
  - fjgn!=N1: true if fjgn does not contain N1
- Add fjgn to condition config in MainModule and BIPUploadModule

Fixes issue where additional features with dot separators (e.g., N3.N2.Y3)
were incorrectly parsed by merging all fields from index 5 onwards.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-02-02 11:04:19 +08:00
parent a22ee42119
commit 57adf860ac
4 changed files with 91 additions and 4 deletions

View File

@@ -146,7 +146,15 @@ Private Function EvaluateSingleCondition(condition As String, Conditions As Obje
EvaluateSingleCondition = True EvaluateSingleCondition = True
Else Else
actualValue = Conditions(varName) actualValue = Conditions(varName)
EvaluateSingleCondition = (actualValue <> value)
' fjgn
If varName = "fjgn" Then
' fjgn!=N1检查actualValue中是否不包含value
EvaluateSingleCondition = (InStr(actualValue, value) = 0)
Else
' 其他字段使用精确匹配
EvaluateSingleCondition = (actualValue <> value)
End If
End If End If
Exit Function Exit Function
End If End If
@@ -164,7 +172,15 @@ Private Function EvaluateSingleCondition(condition As String, Conditions As Obje
EvaluateSingleCondition = False EvaluateSingleCondition = False
Else Else
actualValue = Conditions(varName) actualValue = Conditions(varName)
EvaluateSingleCondition = (actualValue = value)
' fjgn
If varName = "fjgn" Then
' fjgn=N1检查actualValue中是否包含value
EvaluateSingleCondition = (InStr(actualValue, value) > 0)
Else
' 其他字段使用精确匹配
EvaluateSingleCondition = (actualValue = value)
End If
End If End If
Exit Function Exit Function
End If End If

View File

@@ -150,6 +150,31 @@ Private Function ParseHeader() As Boolean
lcfw = Trim(dotParts(4)) lcfw = Trim(dotParts(4))
pConditions.Add "lcfw", lcfw pConditions.Add "lcfw", lcfw
' 仪表特性 - 第6个位置(索引5)及之后的所有部分
' .(N3.N2.Y3)5
Dim fjgn As String
If UBound(dotParts) >= 5 Then
Dim instrumentFeature As String
Dim i As Long
instrumentFeature = ""
' 5.
For i = 5 To UBound(dotParts)
If instrumentFeature = "" Then
instrumentFeature = dotParts(i)
Else
instrumentFeature = instrumentFeature & "." & dotParts(i)
End If
Next i
instrumentFeature = Trim(instrumentFeature)
fjgn = ExtractAdditionalFeatures(instrumentFeature)
Else
' fjgn
fjgn = ""
End If
pConditions.Add "fjgn", fjgn
ParseHeader = True ParseHeader = True
Exit Function Exit Function
@@ -229,4 +254,50 @@ Public Function GetAllConditions() As String
Next key Next key
GetAllConditions = result GetAllConditions = result
End Function
'=====================================================================
' 方法: ExtractAdditionalFeatures
' 功能: 从仪表特性中提取附加功能
' : instrumentFeature - ("N2,N3.Y3""Y3")
' 返回: String - 附加功能字符串,多个功能用逗号分隔
' 说明:
' 1. 识别并去除充油类型(位于最后格式为Y+一位数字)
' 2. 统一分隔符处理(将.替换为,)
' 3. 去除可能的后缀分隔符
'=====================================================================
Private Function ExtractAdditionalFeatures(instrumentFeature As String) As String
On Error GoTo ErrorHandler
Dim result As String
result = Trim(instrumentFeature)
' 1. 检查是否以Y+数字结尾(充油类型)
If Len(result) >= 2 Then
Dim lastTwoChars As String
lastTwoChars = Right(result, 2)
' Y+
If UCase(Left(lastTwoChars, 1)) = "Y" And IsNumeric(Right(lastTwoChars, 1)) Then
' 去掉充油类型
result = Left(result, Len(result) - 2)
result = Trim(result)
End If
End If
' 2. 处理可能的分隔符(,或.
' .,
result = Replace(result, ".", ",")
' 3.
If Len(result) > 0 And Right(result, 1) = "," Then
result = Left(result, Len(result) - 1)
End If
ExtractAdditionalFeatures = Trim(result)
Exit Function
ErrorHandler:
'
ExtractAdditionalFeatures = ""
End Function End Function

View File

@@ -9,7 +9,7 @@ Option Explicit
' 常量定义 ' 常量定义
'===================================================================== '=====================================================================
' 提取条件配置 ' 提取条件配置
Private Const CONDITION_CONFIG = "azxs,安装形式|bkxs,表壳形式|gclj,过程连接|jycz,接液材质|lcfw,量程范围" Private Const CONDITION_CONFIG = "azxs,安装形式|bkxs,表壳形式|gclj,过程连接|jycz,接液材质|lcfw,量程范围|fjgn,附加功能"
' 行号基数 ' 行号基数
Private Const ROW_NUMBER_BASE = 7000 Private Const ROW_NUMBER_BASE = 7000

View File

@@ -9,7 +9,7 @@ Option Explicit
' 常量定义 ' 常量定义
'===================================================================== '=====================================================================
' 提取条件配置(可灵活扩展) ' 提取条件配置(可灵活扩展)
Private Const CONDITION_CONFIG = "azxs,安装形式|bkxs,表壳形式|gclj,过程连接|jycz,接液材质|lcfw,量程范围" Private Const CONDITION_CONFIG = "azxs,安装形式|bkxs,表壳形式|gclj,过程连接|jycz,接液材质|lcfw,量程范围|fjgn,附加功能"
'===================================================================== '=====================================================================
' 过程: ProcessProductModels ' 过程: ProcessProductModels