Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS100
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7c33e71c
由
LN
编写于
2026-01-13 15:34:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
nexim对接修改。
1 个父辈
a8383be3
全部展开
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
139 行增加
和
27 行删除
BLL/Config.cs
BLL/Extension/Item_General.cs
BLL/Nexim/NeximApiUtil.cs
Model/Http.cs
SmartScan/ScanWork.cs
SmartScan/SetControl/WPF/WPF_MaterialTemplate.xaml.cs
BLL/Config.cs
查看文件 @
7c33e71
...
@@ -375,6 +375,7 @@ namespace BLL
...
@@ -375,6 +375,7 @@ namespace BLL
public
static
MyConfig
<
string
>
Nexim_UserName
=
""
;
public
static
MyConfig
<
string
>
Nexim_UserName
=
""
;
public
static
MyConfig
<
string
>
Nexim_Password
=
""
;
public
static
MyConfig
<
string
>
Nexim_Password
=
""
;
public
static
MyConfig
<
string
>
Nexim_RegisterDidInfoUrl
=
""
;
public
static
MyConfig
<
string
>
Nexim_RegisterDidInfoUrl
=
""
;
public
static
MyConfig
<
string
>
Nexim_PartMastersUrl
=
""
;
/// <summary>
/// <summary>
/// Nexim参数,key=需要的参数,value=对应的关键字
/// Nexim参数,key=需要的参数,value=对应的关键字
/// </summary>
/// </summary>
...
...
BLL/Extension/Item_General.cs
查看文件 @
7c33e71
...
@@ -479,10 +479,10 @@ namespace BLL
...
@@ -479,10 +479,10 @@ namespace BLL
LogNet
.
log
.
Info
(
"ex"
+
ex
.
ToString
());
LogNet
.
log
.
Info
(
"ex"
+
ex
.
ToString
());
}
}
if
(!
DidRegisterValidate
(
key
,
out
errmsg
))
//
if(!DidRegisterValidate(key, out errmsg))
{
//
{
return
false
;
//
return false;
}
//
}
//SaveRetrospect?.Invoke(key);
//SaveRetrospect?.Invoke(key);
return
true
;
return
true
;
...
@@ -490,30 +490,30 @@ namespace BLL
...
@@ -490,30 +490,30 @@ namespace BLL
}
}
private
bool
DidRegisterValidate
(
Dictionary
<
string
,
string
>
content
,
out
string
errmsg
)
//
private bool DidRegisterValidate(Dictionary<string, string> content, out string errmsg)
{
//
{
errmsg
=
""
;
//
errmsg = "";
try
//
try
{
//
{
if
(
BLLCommon
.
neximApiUtils
.
registerNewDid
(
content
,
out
string
msg
))
//
if (BLLCommon.neximApiUtils.registerNewDid(content, out string msg))
{
//
{
return
true
;
//
return true;
}
//
}
else
//
else
{
//
{
errmsg
=
msg
;
//
errmsg = msg;
//Register Failure Notice
//
//Register Failure Notice
MessageboxNeo
.
Show
(
"Register Failure Notice"
,
errmsg
,
"NEO SCAN"
,
true
);
//
MessageboxNeo.Show("Register Failure Notice", errmsg, "NEO SCAN", true);
return
false
;
//
return false;
}
//
}
}
//
}
catch
(
Exception
ex
)
//
catch (Exception ex)
{
//
{
LogNet
.
log
.
Info
(
"DidRegisterValidate"
+
ex
.
ToString
());
//
LogNet.log.Info("DidRegisterValidate" + ex.ToString());
}
//
}
return
false
;
//
return false;
}
//
}
public
void
Update
()
public
void
Update
()
{
{
...
...
BLL/Nexim/NeximApiUtil.cs
查看文件 @
7c33e71
此文件的差异被折叠,
点击展开。
Model/Http.cs
查看文件 @
7c33e71
...
@@ -145,6 +145,42 @@ namespace Model
...
@@ -145,6 +145,42 @@ namespace Model
LogNet
.
log
.
Info
(
"[Post]URL:"
+
url
+
"Return:"
+
s
);
LogNet
.
log
.
Info
(
"[Post]URL:"
+
url
+
"Return:"
+
s
);
return
FormatContent
(
s
);
return
FormatContent
(
s
);
}
}
public
static
string
GetWithHeader
(
string
url
,
Dictionary
<
string
,
string
>
headerMap
,
Dictionary
<
string
,
object
>
queryParams
=
null
)
{
if
(
queryParams
!=
null
&&
queryParams
.
Count
>
0
)
{
var
queryString
=
HttpUtility
.
ParseQueryString
(
string
.
Empty
);
foreach
(
var
param
in
queryParams
)
{
queryString
.
Add
(
param
.
Key
,
param
.
Value
?.
ToString
());
}
if
(
url
.
Contains
(
"?"
))
url
+=
"&"
+
queryString
.
ToString
();
else
url
+=
"?"
+
queryString
.
ToString
();
}
LogNet
.
log
.
Info
(
"[Get]URL:"
+
url
);
RestClient
client
=
new
(
url
)
{
Timeout
=
10000
};
RestRequest
request
=
new
(
Method
.
GET
);
if
(
headerMap
!=
null
&&
headerMap
.
Count
>
0
)
{
foreach
(
var
head
in
headerMap
)
{
request
.
AddHeader
(
head
.
Key
,
head
.
Value
);
}
}
IRestResponse
response
=
client
.
Execute
(
request
);
if
(
response
.
ErrorException
!=
null
)
{
LogNet
.
log
.
Error
(
"[Get]URL:"
+
url
+
" Error: "
+
response
.
ErrorException
.
ToString
());
throw
response
.
ErrorException
;
}
string
s
=
response
.
Content
;
LogNet
.
log
.
Info
(
"[Get]URL:"
+
url
+
"Return:"
+
s
);
return
FormatContent
(
s
);
}
}
}
public
class
CustSerialize
:
RestSharp
.
Serialization
.
IRestSerializer
public
class
CustSerialize
:
RestSharp
.
Serialization
.
IRestSerializer
{
{
...
...
SmartScan/ScanWork.cs
查看文件 @
7c33e71
...
@@ -168,6 +168,18 @@ namespace SmartScan
...
@@ -168,6 +168,18 @@ namespace SmartScan
isMatched
=
Request_API_C2
(
matchedTexts
);
isMatched
=
Request_API_C2
(
matchedTexts
);
}
}
Dictionary
<
string
,
string
>
lastKey
=
BLLCommon
.
extension
.
GetUIKeywords
();
if
(
lastKey
==
null
)
lastKey
=
new
Dictionary
<
string
,
string
>(
workCodeKeyword
);
else
lastKey
=
new
Dictionary
<
string
,
string
>(
lastKey
,
StringComparer
.
OrdinalIgnoreCase
);
//nexim对接
if
(
isMatched
&&
(!
DidRegisterValidate
(
lastKey
,
out
string
errmsg
)))
{
isMatched
=
false
;
LogNet
.
log
.
Info
(
"DidRegisterValidate error ,isMatched = false"
);
}
if
(
isMatched
)
if
(
isMatched
)
{
{
Check2s
?.
Invoke
(
"2"
);
Check2s
?.
Invoke
(
"2"
);
...
@@ -223,6 +235,67 @@ namespace SmartScan
...
@@ -223,6 +235,67 @@ namespace SmartScan
}
}
}
}
private
bool
DidRegisterValidate
(
Dictionary
<
string
,
string
>
content
,
out
string
errmsg
)
{
errmsg
=
""
;
if
(!
BLLCommon
.
neximApiUtils
.
IsEnalbe
())
{
return
true
;
}
try
{
string
pn
=
BLLCommon
.
neximApiUtils
.
getReelInfo
(
content
,
"PN"
);
string
msg
;
bool
result
;
Dictionary
<
string
,
object
>
pmData
=
BLLCommon
.
neximApiUtils
.
getPartMasters
(
pn
,
out
msg
);
if
(!
string
.
IsNullOrEmpty
(
msg
))
{
LogNet
.
log
.
Error
(
$
"getPartMasters failed, pn={pn}, msg={msg},开始注册PN"
);
result
=
BLLCommon
.
neximApiUtils
.
postPartMasters
(
content
,
out
msg
);
if
(
result
)
{
LogNet
.
log
.
Info
(
$
"postPartMasters OK, pn={pn}"
);
}
else
{
LogNet
.
log
.
Error
(
$
"getPartMasters failed, pn={pn}, msg={msg}"
);
errmsg
=
msg
;
MessageboxNeo
.
Show
(
"Register PartMasters Failure Notice"
,
errmsg
,
"NEO SCAN"
,
false
);
return
false
;
}
}
else
{
string
reelId
=
BLLCommon
.
neximApiUtils
.
getReelInfo
(
content
,
"RI"
);
//获取did信息,获取成功直接返回
Dictionary
<
string
,
object
>
didData
=
BLLCommon
.
neximApiUtils
.
getDid
(
reelId
,
out
msg
);
LogNet
.
log
.
Error
(
$
"getPartMasters OK, getDid OK,直接返回 true"
);
if
(
string
.
IsNullOrEmpty
(
msg
))
{
return
true
;
}
}
if
(
BLLCommon
.
neximApiUtils
.
registerNewDid
(
content
,
pmData
,
out
msg
))
{
return
true
;
}
else
{
errmsg
=
msg
;
//Register Failure Notice
MessageboxNeo
.
Show
(
"Register Failure Notice"
,
errmsg
,
"NEO SCAN"
,
false
);
return
false
;
}
}
catch
(
Exception
ex
)
{
LogNet
.
log
.
Info
(
"DidRegisterValidate"
+
ex
.
ToString
());
}
return
false
;
}
private
bool
Request_API_C2
(
List
<
string
>
matchedTexts
)
private
bool
Request_API_C2
(
List
<
string
>
matchedTexts
)
{
{
string
url
=
config
.
HttpLabelReport
.
Trim
();
string
url
=
config
.
HttpLabelReport
.
Trim
();
...
...
SmartScan/SetControl/WPF/WPF_MaterialTemplate.xaml.cs
查看文件 @
7c33e71
...
@@ -119,6 +119,8 @@ namespace SmartScan.SetControl.WPF
...
@@ -119,6 +119,8 @@ namespace SmartScan.SetControl.WPF
{
{
codeItems
.
Add
(
item
);
codeItems
.
Add
(
item
);
}
}
data3
.
ItemsSource
=
null
;
data3
.
ItemsSource
=
codeItems
;
if
(
data3
.
Items
.
Count
>
0
)
if
(
data3
.
Items
.
Count
>
0
)
data3
.
SelectedIndex
=
-
1
;
data3
.
SelectedIndex
=
-
1
;
bmp
=
(
Bitmap
)
ImgShow
.
Image
;
bmp
=
(
Bitmap
)
ImgShow
.
Image
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论