Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS100
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cd0daa29
由
刘韬
编写于
2025-04-24 17:00:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
数量去掉pcs再匹配
1 个父辈
5f5fd015
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
33 行增加
和
24 行删除
BLL/MaterialEdit.cs
Model/FilePath.cs
SmartScan/Form/FrmCodeExtract.cs
SmartScan/Program.cs
BLL/MaterialEdit.cs
查看文件 @
cd0daa2
...
@@ -619,8 +619,11 @@ namespace BLL
...
@@ -619,8 +619,11 @@ namespace BLL
{
{
int
matchCount
=
0
;
int
matchCount
=
0
;
var
codeText
=
codeinfo
.
Text
;
var
codeText
=
codeinfo
.
Text
;
codeText
=
codeText
.
Replace
(
"\r"
,
""
);
if
(
codeinfo
.
CodeType
==
"OCR"
)
codeText
=
codeText
.
Replace
(
"\n"
,
""
);
{
codeText
=
codeText
.
Replace
(
"\r"
,
""
);
codeText
=
codeText
.
Replace
(
"\n"
,
""
);
}
MatchAnalysis
.
SetBarcode
(
codeinfo
);
MatchAnalysis
.
SetBarcode
(
codeinfo
);
code
=
codeMatch
[
i
].
CaseSensitive
?
codeText
:
codeText
.
ToUpper
();
code
=
codeMatch
[
i
].
CaseSensitive
?
codeText
:
codeText
.
ToUpper
();
bool
ismatch
=
true
;
bool
ismatch
=
true
;
...
@@ -649,7 +652,7 @@ namespace BLL
...
@@ -649,7 +652,7 @@ namespace BLL
if
(!
code
.
StartsWith
(
text
))
if
(!
code
.
StartsWith
(
text
))
ismatch
=
false
;
ismatch
=
false
;
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"开头字符:\"{text}\""
,
$
"NG"
);
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"开头字符:\"{text}\""
,
ismatch
?
"OK"
:
"NG"
);
//if (!ismatch) return null;
//if (!ismatch) return null;
}
}
...
@@ -662,7 +665,7 @@ namespace BLL
...
@@ -662,7 +665,7 @@ namespace BLL
if
(!
code
.
EndsWith
(
text
))
if
(!
code
.
EndsWith
(
text
))
ismatch
=
false
;
ismatch
=
false
;
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"结尾字符:\"{text}\""
,
$
"NG"
);
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"结尾字符:\"{text}\""
,
ismatch
?
"OK"
:
"NG"
);
//if (!ismatch) return null;
//if (!ismatch) return null;
}
}
...
@@ -689,7 +692,7 @@ namespace BLL
...
@@ -689,7 +692,7 @@ namespace BLL
ismatch
=
false
;
ismatch
=
false
;
var
mode
=
codeMatch
[
i
].
MatchMiddleType
==
0
?
"相等"
:
codeMatch
[
i
].
MatchMiddleType
==
1
?
"至多"
:
"至少"
;
var
mode
=
codeMatch
[
i
].
MatchMiddleType
==
0
?
"相等"
:
codeMatch
[
i
].
MatchMiddleType
==
1
?
"至多"
:
"至少"
;
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"中间字符:\"{text}\",{mode}匹配:{codeMatch[i].MiddleTextCount}次"
,
$
"NG"
);
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"中间字符:\"{text}\",{mode}匹配:{codeMatch[i].MiddleTextCount}次"
,
ismatch
?
"OK"
:
"NG"
);
//if (!ismatch) return null;
//if (!ismatch) return null;
}
}
...
@@ -714,7 +717,7 @@ namespace BLL
...
@@ -714,7 +717,7 @@ namespace BLL
ismatch
=
false
;
ismatch
=
false
;
}
}
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"分割符:{codeMatch[i].SplitText},第:{codeMatch[i].SplitPart}位"
,
$
"NG"
);
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"分割符:{codeMatch[i].SplitText},第:{codeMatch[i].SplitPart}位"
,
ismatch
?
"OK"
:
"NG"
);
//if (!ismatch) return null;
//if (!ismatch) return null;
}
}
...
@@ -740,13 +743,14 @@ namespace BLL
...
@@ -740,13 +743,14 @@ namespace BLL
if
(
codeMatch
[
i
].
MatchISNumber
)
if
(
codeMatch
[
i
].
MatchISNumber
)
{
{
LogNet
.
log
.
Info
(
$
"开始匹配数字 [{filtercode}]"
);
LogNet
.
log
.
Info
(
$
"开始匹配数字 [{filtercode}]"
);
string
analysisReason
=
$
"\"{filtercode}\""
;
filtercode
=
filtercode
.
Trim
().
ToLower
().
Replace
(
"pcs"
,
""
);
filtercode
=
filtercode
.
Replace
(
","
,
""
);
string
analysisReason
=
filtercode
;
if
(!
int
.
TryParse
(
filtercode
,
out
int
res
))
if
(!
int
.
TryParse
(
filtercode
,
out
int
res
))
{
{
ismatch
=
false
;
ismatch
=
false
;
analysisReason
+=
$
" NG"
;
analysisReason
+=
$
" NG"
;
}
}
else
else
{
{
...
@@ -765,7 +769,7 @@ namespace BLL
...
@@ -765,7 +769,7 @@ namespace BLL
//bool ismatch = true;
//bool ismatch = true;
if
(
code
.
Length
<
codeMatch
[
i
].
MinLength
)
if
(
code
.
Length
<
codeMatch
[
i
].
MinLength
)
ismatch
=
false
;
ismatch
=
false
;
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"长度小于:{codeMatch[i].MatchMinLength}"
,
$
"NG"
);
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"长度小于:{codeMatch[i].MatchMinLength}"
,
ismatch
?
"OK"
:
"NG"
);
//if (!ismatch) return null;
//if (!ismatch) return null;
}
}
...
@@ -776,7 +780,7 @@ namespace BLL
...
@@ -776,7 +780,7 @@ namespace BLL
//bool ismatch = true;
//bool ismatch = true;
if
(
code
.
Length
>
codeMatch
[
i
].
MaxLength
)
if
(
code
.
Length
>
codeMatch
[
i
].
MaxLength
)
ismatch
=
false
;
ismatch
=
false
;
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"长度最大:{codeMatch[i].MatchMaxLength}"
,
$
"NG"
);
MatchAnalysis
.
AddMatch
(
codeMatch
[
i
].
Keyword
,
ismatch
,
codeMatch
[
i
].
CodeID
,
$
"长度最大:{codeMatch[i].MatchMaxLength}"
,
ismatch
?
"OK"
:
"NG"
);
}
}
if
(!
ismatch
)
if
(!
ismatch
)
...
...
Model/FilePath.cs
查看文件 @
cd0daa2
...
@@ -12,19 +12,19 @@ namespace Model
...
@@ -12,19 +12,19 @@ namespace Model
/// </summary>
/// </summary>
public
static
class
FilePath
public
static
class
FilePath
{
{
public
static
readonly
string
LANGUAGE_DIR
=
Environment
.
CurrentDirectory
+
"\\Language\\"
;
public
static
readonly
string
LANGUAGE_DIR
=
Application
.
StartupPath
+
"\\Language\\"
;
public
static
readonly
string
MATERIAL_DIR
=
Environment
.
CurrentDirectory
+
"\\Material\\"
;
public
static
readonly
string
MATERIAL_DIR
=
Application
.
StartupPath
+
"\\Material\\"
;
public
static
readonly
string
RETROSPECT_DIR
=
Application
.
StartupPath
+
"\\Retrospect\\"
;
public
static
readonly
string
RETROSPECT_DIR
=
Application
.
StartupPath
+
"\\Retrospect\\"
;
public
static
readonly
string
PRINT_LABEL_DIR
=
Environment
.
CurrentDirectory
+
"\\PrintLabel\\"
;
public
static
readonly
string
PRINT_LABEL_DIR
=
Application
.
StartupPath
+
"\\PrintLabel\\"
;
public
static
readonly
string
CONFIG_DIR
=
Environment
.
CurrentDirectory
+
"\\Config\\"
;
public
static
readonly
string
CONFIG_DIR
=
Application
.
StartupPath
+
"\\Config\\"
;
public
static
readonly
string
CONFIG_APP
=
Environment
.
CurrentDirectory
+
"\\Config\\app.config"
;
public
static
readonly
string
CONFIG_APP
=
Application
.
StartupPath
+
"\\Config\\app.config"
;
public
static
readonly
string
CONFIG_CAMERA
=
Environment
.
CurrentDirectory
+
"\\Config\\Camera.json"
;
public
static
readonly
string
CONFIG_CAMERA
=
Application
.
StartupPath
+
"\\Config\\Camera.json"
;
public
static
readonly
string
CONFIG_MACRO_KEY
=
Environment
.
CurrentDirectory
+
"\\Config\\MacroKey.txt"
;
public
static
readonly
string
CONFIG_MACRO_KEY
=
Application
.
StartupPath
+
"\\Config\\MacroKey.txt"
;
public
static
readonly
string
CONFIG_HTTP_TEST_DATA
=
Environment
.
CurrentDirectory
+
"\\Config\\HttpTestData.json"
;
public
static
readonly
string
CONFIG_HTTP_TEST_DATA
=
Application
.
StartupPath
+
"\\Config\\HttpTestData.json"
;
public
static
readonly
string
CONFIG_EXTENSION
=
Environment
.
CurrentDirectory
+
"\\Config\\Extension.json"
;
public
static
readonly
string
CONFIG_EXTENSION
=
Application
.
StartupPath
+
"\\Config\\Extension.json"
;
public
static
readonly
string
CONFIG_REELID
=
Environment
.
CurrentDirectory
+
"\\Config\\ReelID"
;
public
static
readonly
string
CONFIG_REELID
=
Application
.
StartupPath
+
"\\Config\\ReelID"
;
public
static
readonly
string
CONFIG_DATABASE
=
Environment
.
CurrentDirectory
+
"\\Config\\Database.db3"
;
public
static
readonly
string
CONFIG_DATABASE
=
Application
.
StartupPath
+
"\\Config\\Database.db3"
;
public
static
readonly
string
CONFIG_AUTOGENRULES
=
Environment
.
CurrentDirectory
+
"\\Config\\AutoGenRules.json"
;
public
static
readonly
string
CONFIG_AUTOGENRULES
=
Application
.
StartupPath
+
"\\Config\\AutoGenRules.json"
;
}
}
}
}
SmartScan/Form/FrmCodeExtract.cs
查看文件 @
cd0daa2
...
@@ -29,8 +29,12 @@ namespace SmartScan
...
@@ -29,8 +29,12 @@ namespace SmartScan
{
{
InitializeComponent
();
InitializeComponent
();
windowHeight
=
this
.
Height
;
windowHeight
=
this
.
Height
;
codeText
=
codeText
.
Replace
(
"\r"
,
""
);
this
.
codeText
=
codeText
;
this
.
codeText
=
codeText
.
Replace
(
"\n"
,
""
);
if
(
codeType
==
"OCR"
)
{
codeText
=
codeText
.
Replace
(
"\r"
,
""
);
this
.
codeText
=
codeText
.
Replace
(
"\n"
,
""
);
}
this
.
codeID
=
codeID
;
this
.
codeID
=
codeID
;
this
.
codeType
=
codeType
;
this
.
codeType
=
codeType
;
TxtMatchingEndText
.
Tag
=
"not"
;
TxtMatchingEndText
.
Tag
=
"not"
;
...
...
SmartScan/Program.cs
查看文件 @
cd0daa2
...
@@ -99,6 +99,7 @@ namespace SmartScan
...
@@ -99,6 +99,7 @@ namespace SmartScan
Application
.
SetCompatibleTextRenderingDefault
(
false
);
Application
.
SetCompatibleTextRenderingDefault
(
false
);
//BLL.Config.Backgrounder = true;
//BLL.Config.Backgrounder = true;
bool
back
=
BLL
.
Config
.
Backgrounder
;
bool
back
=
BLL
.
Config
.
Backgrounder
;
bool
hide
=
false
;
bool
hide
=
false
;
if
(
args
.
Length
>
0
)
if
(
args
.
Length
>
0
)
hide
=
args
[
0
].
ToLower
()
==
"hide"
;
hide
=
args
[
0
].
ToLower
()
==
"hide"
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论