Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS100
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 59dbae0f
由
刘韬
编写于
2025-08-26 15:26:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修正二次检查功能的BUG
1 个父辈
fb295ce8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
14 行增加
和
32 行删除
BLL/PrintLabelEdit.cs
SmartScan/Form/FrmMain.cs
SmartScan/ScanWork.cs
BLL/PrintLabelEdit.cs
查看文件 @
59dbae0
...
...
@@ -387,9 +387,9 @@ namespace BLL
return
bmp
;
}
public
void
PrintLast
(
string
labelName
,
string
printName
,
bool
printLandscape
,
Dictionary
<
string
,
string
>
text
,
out
string
[]
barCode
)
public
void
PrintLast
(
string
labelName
,
string
printName
,
bool
printLandscape
,
Dictionary
<
string
,
string
>
text
,
out
List
<
string
>
barCode
)
{
barCode
=
n
ull
;
barCode
=
n
ew
List
<
string
>()
;
int
index
=
labelTemp
.
FindIndex
(
match
=>
match
.
Name
==
labelName
);
if
(
index
==
-
1
)
{
...
...
@@ -398,7 +398,7 @@ namespace BLL
}
SizeF
sf
;
barCode
=
new
string
[
labelTemp
[
index
].
Field
.
Count
];
for
(
int
i
=
0
;
i
<
labelTemp
[
index
].
Field
.
Count
;
i
++)
{
PrintLabelField
field
=
labelTemp
[
index
].
Field
[
i
];
...
...
@@ -415,8 +415,8 @@ namespace BLL
{
sf
=
ObjConversion
.
MmToPx
(
field
.
Rectangle
.
Size
);
field
.
Image
=
ConvertBarcode
.
StrToCode
(
field
.
Type
,
field
.
PrintText
,
sf
);
barCode
.
Add
(
field
.
PrintText
);
}
barCode
[
i
]
=
field
.
PrintText
;
}
using
System.Drawing.Printing.PrintDocument
print
=
new
();
...
...
SmartScan/Form/FrmMain.cs
查看文件 @
59dbae0
...
...
@@ -883,30 +883,14 @@ namespace SmartScan
private
void
Extension_Printing
(
Dictionary
<
string
,
string
>
content
)
{
string
str
=
"打印内容:"
;
//if (lastContent!=null)
//{
// bool isSame = CompareContent(content);
// if (isSame)
// {
// BLLCommon.extension.labelText = "OK";
// lastContent.Clear();
// }
// else
// {
// BLLCommon.extension.labelText = "NG";
// }
//}
string
aa
=
""
;
try
{
foreach
(
string
key
in
content
.
Keys
)
{
// 提取简写键(保留原键的层级结构)
string
shortKey
=
key
.
Split
(
'\t'
).
First
();
// 输出 "RID" 或 "QTY"
str
+=
string
.
Format
(
"({0}:{1})"
,
shortKey
,
content
[
key
]
);
aa
+=
string
.
Format
(
"({0}:{1})"
,
shortKey
,
content
[
key
]
);
}
LogNet
.
log
.
Info
(
"打印内容:"
+
JsonConvert
.
SerializeObject
(
content
));
SaveResult
(
content
);
//Bitmap labelBmp = Common.labelEdit.PrintImage(Common.config.DefaultPrintLabel, content, out _);
BLLCommon
.
labelEdit
.
PrintLast
(
BLLCommon
.
config
.
DefaultPrintLabel
,
BLLCommon
.
config
.
PrinterName
,
BLLCommon
.
config
.
PrintLandscape
,
content
,
out
List
<
string
>
barcode
);
LogNet
.
log
.
Info
(
string
.
Format
(
"打印标签 Label[{0}] Printer[{1}] Barcode[{2}]"
,
BLLCommon
.
config
.
DefaultPrintLabel
,
BLLCommon
.
config
.
PrinterName
,
string
.
Join
(
","
,
barcode
))
);
try
{
// 确保目录存在
...
...
@@ -917,18 +901,14 @@ namespace SmartScan
}
// 覆盖文件内容(只保留最新日志)
File
.
WriteAllText
(
FilePath
.
CONFIG_Code_Value
,
$
"{aa}"
);
File
.
WriteAllText
(
FilePath
.
CONFIG_Code_Value
,
string
.
Join
(
"\r\n"
,
barcode
)
);
}
catch
(
Exception
ex
)
{
LogNet
.
log
.
Error
(
$
"写入文件失败: {ex.Message}"
);
}
LogNet
.
log
.
Info
(
str
);
SaveResult
(
content
);
//Bitmap labelBmp = Common.labelEdit.PrintImage(Common.config.DefaultPrintLabel, content, out _);
BLLCommon
.
labelEdit
.
PrintLast
(
BLLCommon
.
config
.
DefaultPrintLabel
,
BLLCommon
.
config
.
PrinterName
,
BLLCommon
.
config
.
PrintLandscape
,
content
,
out
string
[]
barcode
);
LogNet
.
log
.
Info
(
string
.
Format
(
"打印标签 Label[{0}] Printer[{1}]"
,
BLLCommon
.
config
.
DefaultPrintLabel
,
BLLCommon
.
config
.
PrinterName
));
var
bmp
=
BLLCommon
.
labelEdit
.
PrintImage
(
BLLCommon
.
config
.
DefaultPrintLabel
,
content
,
out
_
);
if
(
bmp
!=
null
)
{
...
...
SmartScan/ScanWork.cs
查看文件 @
59dbae0
...
...
@@ -262,6 +262,8 @@ namespace SmartScan
// 读取文件内容
string
fileContent
=
File
.
ReadAllText
(
FilePath
.
CONFIG_Code_Value
);
LogNet
.
log
.
Info
(
"扫描到条码:"
+
string
.
Join
(
","
,
codeTexts
));
LogNet
.
log
.
Info
(
"在以下条码中匹配:"
+
fileContent
);
// 检查文件内容是否包含任一条码文本
foreach
(
string
codeText
in
codeTexts
)
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论